public class ImapResponseComposerImpl extends Object implements ImapConstants, ImapResponseComposer
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_BUFFER_SIZE |
static String |
FAILED |
static String |
FLAGS |
ACL_RESPONSE_NAME, APPEND_COMMAND_NAME, AUTHENTICATE_COMMAND_NAME, BACK_SLASH, BAD, BYE, BYTE_BACK_SLASH, BYTE_CLOSE_BRACE, BYTE_CLOSE_SQUARE_BRACKET, BYTE_CLOSING_PARENTHESIS, BYTE_DQUOTE, BYTE_OPEN_BRACE, BYTE_OPEN_SQUARE_BRACKET, BYTE_OPENING_PARENTHESIS, BYTE_QUESTION, BYTE_SP, CAPABILITY_COMMAND_NAME, CHECK_COMMAND_NAME, CLOSE_COMMAND_NAME, CLOSING_PARENTHESIS, CLOSING_SQUARE_BRACKET, COMPRESS_COMMAND_NAME, CONTINUATION, COPY_COMMAND_NAME, CREATE_COMMAND_NAME, DEFAULT_BATCH_SIZE, DELETE_COMMAND_NAME, DELETEACL_COMMAND_NAME, DQUOTE, EMPTY_STRING_ARRAY, ENABLE_COMMAND_NAME, EXAMINE_COMMAND_NAME, EXPUNGE_COMMAND_NAME, FETCH_BODY, FETCH_BODY_STRUCTURE, FETCH_COMMAND_NAME, FETCH_MODSEQ, FETCH_RFC822, FETCH_RFC822_HEADER, FETCH_RFC822_TEXT, GETACL_COMMAND_NAME, IDLE_COMMAND_NAME, INBOX_NAME, LINE_END, LIST_COMMAND_NAME, LIST_RESPONSE_NAME, LISTRIGHTS_COMMAND_NAME, LOGIN_COMMAND_NAME, LOGOUT_COMMAND_NAME, LSUB_COMMAND_NAME, LSUB_RESPONSE_NAME, MAX_NZ_NUMBER, MIME_HEADER_CONTENT_LANGUAGE, MIME_HEADER_CONTENT_LOCATION, MIME_HEADER_CONTENT_MD5, MIME_SUBTYPE_PLAIN, MIME_SUBTYPE_RFC822, MIME_TYPE_MESSAGE, MIME_TYPE_MULTIPART, MIME_TYPE_TEXT, MIN_NZ_NUMBER, MYRIGHTS_COMMAND_NAME, NAME_ATTRIBUTE_HAS_CHILDREN, NAME_ATTRIBUTE_HAS_NO_CHILDREN, NAME_ATTRIBUTE_MARKED, NAME_ATTRIBUTE_NOINFERIORS, NAME_ATTRIBUTE_NOSELECT, NAME_ATTRIBUTE_UNMARKED, NAMESPACE_COMMAND_NAME, NIL, NO, NOOP_COMMAND_NAME, OK, OPENING_PARENTHESIS, OPENING_SQUARE_BRACKET, PS_HEADER, PS_MIME, PS_TEXT, RENAME_COMMAND_NAME, RFC822_BCC, RFC822_CC, RFC822_DATE, RFC822_FROM, RFC822_IN_REPLY_TO, RFC822_MESSAGE_ID, RFC822_REPLY_TO, RFC822_SENDER, RFC822_SUBJECT, RFC822_TO, SEARCH_COMMAND_NAME, SEARCH_RESPONSE_NAME, SELECT_COMMAND_NAME, SETACL_COMMAND_NAME, SP, SP_CHAR, STARTTLS, STATUS_COMMAND_NAME, STATUS_HIGHESTMODSEQ, STATUS_MESSAGES, STATUS_RECENT, STATUS_UIDNEXT, STATUS_UIDVALIDITY, STATUS_UNSEEN, STORE_COMMAND_NAME, SUBSCRIBE_COMMAND_NAME, SUPPORTS_ACL, SUPPORTS_CONDSTORE, SUPPORTS_ENABLE, SUPPORTS_I18NLEVEL_1, SUPPORTS_IDLE, SUPPORTS_LITERAL_PLUS, SUPPORTS_NAMESPACES, SUPPORTS_QRESYNC, SUPPORTS_RFC3348, SUPPORTS_STARTTLS, SUPPORTS_XLIST, UID, UID_COMMAND_NAME, UNSELECT_COMMAND_NAME, UNSUBSCRIBE_COMMAND_NAME, UNTAGGED, UTF8, VERSION, XLIST_COMMAND_NAME, XLIST_RESPONSE_NAME| Constructor and Description |
|---|
ImapResponseComposerImpl(ImapResponseWriter writer) |
ImapResponseComposerImpl(ImapResponseWriter writer,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
ImapResponseComposer |
closeParen()
Write a ')'
|
ImapResponseComposer |
closeSquareBracket()
Write a '}'
|
ImapResponseComposer |
commandName(String commandName) |
ImapResponseComposer |
commandResponse(ImapCommand command,
String message)
Compose a response which contains the
ImapCommand to which the response belongs |
ImapResponseComposer |
continuationResponse(String message)
Writes a continuation response.
|
ImapResponseComposer |
end()
Write a CRLF and flush the composer which will write the content of it to the socket
|
ImapResponseComposer |
flags(javax.mail.Flags flags)
Compose flags to output using standard format.
|
ImapResponseComposer |
literal(Literal literal)
Compose a
Literal and write it to the socket. |
ImapResponseComposer |
message(long number)
Write the message of type
Long |
ImapResponseComposer |
message(String message)
Write the message of type
String |
ImapResponseComposer |
nil()
Composes a
NIL. |
ImapResponseComposer |
openParen()
Write a '('
|
ImapResponseComposer |
openSquareBracket()
Write a '{'
|
ImapResponseComposer |
quote(String message)
Write a quoted message
|
ImapResponseComposer |
quoteUpperCaseAscii(String message)
Appends the given message after conversion to upper case.
|
ImapResponseComposer |
sequenceSet(IdRange[] ranges)
Write the given sequence-set
|
ImapResponseComposer |
skipNextSpace()
Tell the
ImapResponseComposer to skip the next written space |
ImapResponseComposer |
tag(String tag)
Write a tag
|
ImapResponseComposer |
taggedResponse(String message,
String tag)
Writes the message provided to the client, prepended with the request
tag.
|
ImapResponseComposer |
untagged()
Write a '*'
|
ImapResponseComposer |
untaggedNoResponse(String displayMessage,
String responseCode)
Writes an untagged NO response.
|
ImapResponseComposer |
untaggedResponse(String message)
Writes the message provided to the client, prepended with the untagged
marker "*".
|
ImapResponseComposer |
upperCaseAscii(String message)
Appends the given message after conversion to upper case.
|
public static final String FLAGS
public static final String FAILED
public static final int DEFAULT_BUFFER_SIZE
public ImapResponseComposerImpl(ImapResponseWriter writer, int bufferSize)
public ImapResponseComposerImpl(ImapResponseWriter writer)
public ImapResponseComposer untaggedNoResponse(String displayMessage, String responseCode) throws IOException
ImapResponseComposeruntaggedNoResponse in interface ImapResponseComposerdisplayMessage - message for display, not nullresponseCode - response code or null when there is no response codeIOException(java.lang.String, java.lang.String)public ImapResponseComposer continuationResponse(String message) throws IOException
ImapResponseComposercontinuationResponse in interface ImapResponseComposermessage - message for display, not nullIOException(java.lang.String)public ImapResponseComposer commandResponse(ImapCommand command, String message) throws IOException
ImapResponseComposerImapCommand to which the response belongscommandResponse in interface ImapResponseComposerIOExceptionImapResponseComposer.commandResponse(org.apache.james.imap.api.ImapCommand,
java.lang.String)public ImapResponseComposer taggedResponse(String message, String tag) throws IOException
ImapResponseComposertaggedResponse in interface ImapResponseComposermessage - The message to write to the client.IOExceptionImapResponseComposer.taggedResponse(java.lang.String, java.lang.String)public ImapResponseComposer untaggedResponse(String message) throws IOException
ImapResponseComposeruntaggedResponse in interface ImapResponseComposermessage - The message to write to the client.IOExceptionImapResponseComposer.untaggedResponse(java.lang.String)public ImapResponseComposer untagged() throws IOException
ImapResponseComposeruntagged in interface ImapResponseComposerIOExceptionImapResponseComposer.untagged()public ImapResponseComposer message(String message) throws IOException
ImapResponseComposerStringmessage in interface ImapResponseComposerIOExceptionImapResponseComposer.message(java.lang.String)public ImapResponseComposer end() throws IOException
ImapResponseComposerend in interface ImapResponseComposerIOExceptionImapResponseComposer.end()public ImapResponseComposer tag(String tag) throws IOException
ImapResponseComposertag in interface ImapResponseComposerIOExceptionImapResponseComposer.tag(java.lang.String)public ImapResponseComposer closeParen() throws IOException
ImapResponseComposercloseParen in interface ImapResponseComposerIOExceptionImapResponseComposer.closeParen()public ImapResponseComposer openParen() throws IOException
ImapResponseComposeropenParen in interface ImapResponseComposerIOExceptionImapResponseComposer.openParen()public ImapResponseComposer flags(javax.mail.Flags flags) throws IOException
ImapResponseComposerflags in interface ImapResponseComposerflags - Flags, not nullIOExceptionImapResponseComposer.flags(javax.mail.Flags)public ImapResponseComposer nil() throws IOException
ImapResponseComposerNIL.nil in interface ImapResponseComposerIOExceptionImapResponseComposer.nil()public ImapResponseComposer upperCaseAscii(String message) throws IOException
ImapResponseComposerupperCaseAscii in interface ImapResponseComposermessage - ASCII encoded, not nullIOExceptionImapResponseComposer.upperCaseAscii(java.lang.String)public ImapResponseComposer quoteUpperCaseAscii(String message) throws IOException
ImapResponseComposerquoteUpperCaseAscii in interface ImapResponseComposermessage - ASCII encoded, not nullIOException(java.lang.String)public ImapResponseComposer message(long number) throws IOException
ImapResponseComposerLongmessage in interface ImapResponseComposerIOExceptionImapResponseComposer.message(long)public ImapResponseComposer commandName(String commandName) throws IOException
commandName in interface ImapResponseComposerIOExceptionImapResponseComposer.commandName(java.lang.String)public ImapResponseComposer quote(String message) throws IOException
ImapResponseComposerquote in interface ImapResponseComposerIOExceptionImapResponseComposer.quote(java.lang.String)public ImapResponseComposer skipNextSpace()
ImapResponseComposerImapResponseComposer to skip the next written spaceskipNextSpace in interface ImapResponseComposerImapResponseComposer.skipNextSpace()public ImapResponseComposer literal(Literal literal) throws IOException
ImapResponseComposerLiteral and write it to the socket. Everything which was buffered before will
get written tooliteral in interface ImapResponseComposerIOExceptionImapResponseComposer.literal(org.apache.james.imap.message.response.Literal)public ImapResponseComposer closeSquareBracket() throws IOException
ImapResponseComposercloseSquareBracket in interface ImapResponseComposerIOExceptionpublic ImapResponseComposer openSquareBracket() throws IOException
ImapResponseComposeropenSquareBracket in interface ImapResponseComposerIOExceptionpublic ImapResponseComposer sequenceSet(IdRange[] ranges) throws IOException
ImapResponseComposersequenceSet in interface ImapResponseComposerIOExceptionImapResponseComposer.sequenceSet(org.apache.james.imap.api.message.IdRange[])Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.