net.rim.pushsdk.pap.control
Class ResultNotificationResponseControl

java.lang.Object
  extended by net.rim.pushsdk.pap.control.PapControl
      extended by net.rim.pushsdk.pap.control.ResultNotificationResponseControl

public class ResultNotificationResponseControl
extends PapControl

Represents the Result Notification PAP response control (XML).

Author:
dstrelbytsky

Field Summary
static String BAD_MESSAGE_DESCRIPTION
          The description when a result notification cannot properly be unmarshalled because it is a bad message.
static String FULL_NOTIFICATION_QUEUE_DESCRIPTION
          The description when a result notification cannot be processed because the processing queue is full.
static String GENERAL_ERROR_DESCRIPTION
          The description when a result notification cannot be properly handled and none of the other descriptions apply.
static String ILLEGAL_ARGUMENT_DESCRIPTION
          The description when a result notification fails validation.
static String SUCCESS_DESCRIPTION
          The description when a result notification has been successfully received.
 
Fields inherited from class net.rim.pushsdk.pap.control.PapControl
ATTRIBUTE_KEY_VALUE_SEPARATOR, CLOSE_BRACKET, CLOSE_BRACKET_WITH_SLASH, DTD_DECLARATION_BES, DTD_DECLARATION_PUBLIC, EPILOGUE, ESCAPED_DOUBLE_QUOTE, FORWARD_SLASH, NEW_LINE, OPEN_BRACKET, OPEN_BRACKET_WITH_SLASH, PREAMBLE_BES, PREAMBLE_PUBLIC, pushId, pushSDKProperties, usingPublicPush, XML_DECLARATION
 
Constructor Summary
ResultNotificationResponseControl()
           
 
Method Summary
 String getAddress()
          Gets the address associated with the result notification response control.
 StatusCode getCode()
          Gets the status code associated with the result notification response control.
 String getDescription()
          Gets the status description associated with the result notification response control.
 String getPushId()
          Gets the push id associated with the result notification response control.
 void setAddress(String address)
          Sets the address associated with the result notification response control.
 void setCode(StatusCode code)
          Sets the status code associated with the result notification response control.
 void setDescription(String description)
          Sets the status description associated with the result notification response control.
 void setPushId(String pushId)
          Sets the push id associated with the result notification response control.
 String toString()
          Constructs a String with all attributes in name = value format.
protected  void validate()
          Validates the following:
- the push id is not null
- the push id does not contain certain special characters (see the "parser.special.characters" property in PushSDK.properties for the full list)
- the address is not null and is not the push_all token
- the status code is not null
 void writeTo(ByteArrayOutputStream out)
          Writes the PAP control out to the specified output stream.
 
Methods inherited from class net.rim.pushsdk.pap.control.PapControl
getAttribute, getContentType, getEndTag, getEpilogue, getPreamble, getStartTagClosed, getStartTagOpen, isUsingPublicPush, setPushSDKProperties, setUsingPublicPush, validatePushIdForSpecialCharacters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SUCCESS_DESCRIPTION

public static final String SUCCESS_DESCRIPTION
The description when a result notification has been successfully received.

See Also:
Constant Field Values

FULL_NOTIFICATION_QUEUE_DESCRIPTION

public static final String FULL_NOTIFICATION_QUEUE_DESCRIPTION
The description when a result notification cannot be processed because the processing queue is full.

See Also:
Constant Field Values

BAD_MESSAGE_DESCRIPTION

public static final String BAD_MESSAGE_DESCRIPTION
The description when a result notification cannot properly be unmarshalled because it is a bad message.

See Also:
Constant Field Values

ILLEGAL_ARGUMENT_DESCRIPTION

public static final String ILLEGAL_ARGUMENT_DESCRIPTION
The description when a result notification fails validation. See the validate() method in the ResultNotification class.

See Also:
Constant Field Values

GENERAL_ERROR_DESCRIPTION

public static final String GENERAL_ERROR_DESCRIPTION
The description when a result notification cannot be properly handled and none of the other descriptions apply.

See Also:
Constant Field Values
Constructor Detail

ResultNotificationResponseControl

public ResultNotificationResponseControl()
Method Detail

writeTo

public void writeTo(ByteArrayOutputStream out)
             throws IOException
Description copied from class: PapControl
Writes the PAP control out to the specified output stream.

Specified by:
writeTo in class PapControl
Parameters:
out - the output stream
Throws:
IOException - if any errors occur writing to the output stream

validate

protected void validate()
Validates the following:
- the push id is not null
- the push id does not contain certain special characters (see the "parser.special.characters" property in PushSDK.properties for the full list)
- the address is not null and is not the push_all token
- the status code is not null

Specified by:
validate in class PapControl

toString

public String toString()
Constructs a String with all attributes in name = value format.

Overrides:
toString in class Object
Returns:
a String representation of this object.

getPushId

public String getPushId()
Gets the push id associated with the result notification response control.

Returns:
the push id

setPushId

public void setPushId(String pushId)
Sets the push id associated with the result notification response control.

Parameters:
pushId - the push id

getCode

public StatusCode getCode()
Gets the status code associated with the result notification response control.

Returns:
the status code

setCode

public void setCode(StatusCode code)
Sets the status code associated with the result notification response control.

Parameters:
code - the status code

getDescription

public String getDescription()
Gets the status description associated with the result notification response control.

Returns:
the status description

setDescription

public void setDescription(String description)
Sets the status description associated with the result notification response control.

Parameters:
description - the status description

getAddress

public String getAddress()
Gets the address associated with the result notification response control.

Returns:
the address

setAddress

public void setAddress(String address)
Sets the address associated with the result notification response control.

Parameters:
address - the address


Copyright © 2011 Research In Motion. All Rights Reserved.