org.apache.geronimo.javamail.store.imap.connection
Class IMAPTaggedResponse

java.lang.Object
  extended by org.apache.geronimo.javamail.store.imap.connection.IMAPResponse
      extended by org.apache.geronimo.javamail.store.imap.connection.IMAPTaggedResponse
Direct Known Subclasses:
IMAPContinuationResponse

public class IMAPTaggedResponse
extends IMAPResponse

Util class to represent a response from a IMAP server

Version:
$Rev: 594520 $ $Date: 2007-11-13 07:57:39 -0500 (Tue, 13 Nov 2007) $

Field Summary
protected  String message
           
protected  String status
           
protected  String tag
           
 
Fields inherited from class org.apache.geronimo.javamail.store.imap.connection.IMAPResponse
response
 
Constructor Summary
IMAPTaggedResponse(byte[] response)
          Create a continuation response for a submitted command.
IMAPTaggedResponse(String tag, String status, String message, byte[] response)
          Create a command completion response for a submitted command.
 
Method Summary
 byte[] decodeChallengeResponse()
          Decode the message portion of a continuation challenge response.
 String getMessage()
          Get the message included on the tagged response.
 boolean hasStatus(String name)
          Test if the untagged response includes a given status indicator.
 boolean isBAD()
          Test for an error return from a command.
 boolean isContinuation()
          Test if this is a continuation response.
 boolean isNO()
          Test for an error return from a command.
 boolean isOK()
          Test if the response code was "OK".
 
Methods inherited from class org.apache.geronimo.javamail.store.imap.connection.IMAPResponse
getResponseData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

status

protected String status

tag

protected String tag

message

protected String message
Constructor Detail

IMAPTaggedResponse

public IMAPTaggedResponse(String tag,
                          String status,
                          String message,
                          byte[] response)
Create a command completion response for a submitted command. The tag prefix identifies the command this response is for.

Parameters:
tag - The command tag value.
status - The Status response (OK, BAD, or NO).
message - The remainder of the response, as a string.
response - The response data used to create the reply object.

IMAPTaggedResponse

public IMAPTaggedResponse(byte[] response)
Create a continuation response for a submitted command.

Parameters:
response - The response data used to create the reply object.
Method Detail

isOK

public boolean isOK()
Test if the response code was "OK".

Returns:
True if the response status was OK, false for any other status.

isBAD

public boolean isBAD()
Test for an error return from a command.

Returns:
True if the response status was BAD.

isNO

public boolean isNO()
Test for an error return from a command.

Returns:
True if the response status was NO.

getMessage

public String getMessage()
Get the message included on the tagged response.

Returns:
The String message data.

decodeChallengeResponse

public byte[] decodeChallengeResponse()
Decode the message portion of a continuation challenge response.

Returns:
The byte array containing the decoded data.

isContinuation

public boolean isContinuation()
Test if this is a continuation response.

Returns:
True if this a continuation. false for a normal tagged response.

hasStatus

public boolean hasStatus(String name)
Test if the untagged response includes a given status indicator. Mostly used for checking READ-ONLY or READ-WRITE status after selecting a mail box.

Parameters:
name - The status name to check.
Returns:
true if this is found in the "[" "]" delimited section of the response message.


Copyright © 2003-2009 The Apache Software Foundation. All Rights Reserved.