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
ImapResponseComposer
untaggedNoResponse
in interface ImapResponseComposer
displayMessage
- 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
ImapResponseComposer
continuationResponse
in interface ImapResponseComposer
message
- message for display, not nullIOException
(java.lang.String)
public ImapResponseComposer commandResponse(ImapCommand command, String message) throws IOException
ImapResponseComposer
ImapCommand
to which the response belongscommandResponse
in interface ImapResponseComposer
IOException
ImapResponseComposer.commandResponse(org.apache.james.imap.api.ImapCommand,
java.lang.String)
public ImapResponseComposer taggedResponse(String message, String tag) throws IOException
ImapResponseComposer
taggedResponse
in interface ImapResponseComposer
message
- The message to write to the client.IOException
ImapResponseComposer.taggedResponse(java.lang.String, java.lang.String)
public ImapResponseComposer untaggedResponse(String message) throws IOException
ImapResponseComposer
untaggedResponse
in interface ImapResponseComposer
message
- The message to write to the client.IOException
ImapResponseComposer.untaggedResponse(java.lang.String)
public ImapResponseComposer untagged() throws IOException
ImapResponseComposer
untagged
in interface ImapResponseComposer
IOException
ImapResponseComposer.untagged()
public ImapResponseComposer message(String message) throws IOException
ImapResponseComposer
String
message
in interface ImapResponseComposer
IOException
ImapResponseComposer.message(java.lang.String)
public ImapResponseComposer end() throws IOException
ImapResponseComposer
end
in interface ImapResponseComposer
IOException
ImapResponseComposer.end()
public ImapResponseComposer tag(String tag) throws IOException
ImapResponseComposer
tag
in interface ImapResponseComposer
IOException
ImapResponseComposer.tag(java.lang.String)
public ImapResponseComposer closeParen() throws IOException
ImapResponseComposer
closeParen
in interface ImapResponseComposer
IOException
ImapResponseComposer.closeParen()
public ImapResponseComposer openParen() throws IOException
ImapResponseComposer
openParen
in interface ImapResponseComposer
IOException
ImapResponseComposer.openParen()
public ImapResponseComposer flags(javax.mail.Flags flags) throws IOException
ImapResponseComposer
flags
in interface ImapResponseComposer
flags
- Flags
, not nullIOException
ImapResponseComposer.flags(javax.mail.Flags)
public ImapResponseComposer nil() throws IOException
ImapResponseComposer
NIL
.nil
in interface ImapResponseComposer
IOException
ImapResponseComposer.nil()
public ImapResponseComposer upperCaseAscii(String message) throws IOException
ImapResponseComposer
upperCaseAscii
in interface ImapResponseComposer
message
- ASCII encoded, not nullIOException
ImapResponseComposer.upperCaseAscii(java.lang.String)
public ImapResponseComposer quoteUpperCaseAscii(String message) throws IOException
ImapResponseComposer
quoteUpperCaseAscii
in interface ImapResponseComposer
message
- ASCII encoded, not nullIOException
(java.lang.String)
public ImapResponseComposer message(long number) throws IOException
ImapResponseComposer
Long
message
in interface ImapResponseComposer
IOException
ImapResponseComposer.message(long)
public ImapResponseComposer commandName(String commandName) throws IOException
commandName
in interface ImapResponseComposer
IOException
ImapResponseComposer.commandName(java.lang.String)
public ImapResponseComposer quote(String message) throws IOException
ImapResponseComposer
quote
in interface ImapResponseComposer
IOException
ImapResponseComposer.quote(java.lang.String)
public ImapResponseComposer skipNextSpace()
ImapResponseComposer
ImapResponseComposer
to skip the next written spaceskipNextSpace
in interface ImapResponseComposer
ImapResponseComposer.skipNextSpace()
public ImapResponseComposer literal(Literal literal) throws IOException
ImapResponseComposer
Literal
and write it to the socket. Everything which was buffered before will
get written tooliteral
in interface ImapResponseComposer
IOException
ImapResponseComposer.literal(org.apache.james.imap.message.response.Literal)
public ImapResponseComposer closeSquareBracket() throws IOException
ImapResponseComposer
closeSquareBracket
in interface ImapResponseComposer
IOException
public ImapResponseComposer openSquareBracket() throws IOException
ImapResponseComposer
openSquareBracket
in interface ImapResponseComposer
IOException
public ImapResponseComposer sequenceSet(IdRange[] ranges) throws IOException
ImapResponseComposer
sequenceSet
in interface ImapResponseComposer
IOException
ImapResponseComposer.sequenceSet(org.apache.james.imap.api.message.IdRange[])
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.