net.rim.pushsdk.pap.control
Class CancelMessageControl

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

public class CancelMessageControl
extends PapControl

Represents the Cancel PAP request message control (XML).

Author:
mdicesare

Field Summary
 
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
CancelMessageControl()
          Deprecated. As of release 1.1, replaced by CancelMessageControl(boolean) constructor instead. To use this constructor, you must configure the SDK to be in public or enterprise mode through the PushSDK.properties file by setting the use.public.push flag.
CancelMessageControl(boolean usingPublicPush)
          Constructs a cancel message control for either a public (BIS) push or an enterprise (BES) push.
CancelMessageControl(boolean usingPublicPush, String pushId)
          Constructs a cancel message control for either a public (BIS) push or an enterprise (BES) push with the given push id.
CancelMessageControl(boolean usingPublicPush, String pushId, List<String> addresses)
          Constructs a cancel message control for either a public (BIS) push or an enterprise (BES) push with the given push id and the list of addresses.
CancelMessageControl(String pushId)
          Deprecated. As of release 1.1, replaced by CancelMessageControl(boolean, String) constructor instead. To use this constructor, you must configure the SDK to be in public or enterprise mode through the PushSDK.properties file by setting the use.public.push flag.
CancelMessageControl(String pushId, List<String> addresses)
          Deprecated. As of release 1.1, replaced by CancelMessageControl(boolean, String, List) constructor instead. To use this constructor, you must configure the SDK to be in public or enterprise mode through the PushSDK.properties file by setting the use.public.push flag.
 
Method Summary
 AddressList getAddresses()
          Deprecated. As of release 1.1, replaced by getAddressList().
 List<String> getAddressList()
          Gets the list of addresses associated with the cancel message control.
 String getPushId()
          Gets the push id associated with the cancel message control.
 void setAddresses(AddressList addresses)
          Deprecated. As of release 1.1, replaced by setAddressList(List).
 void setAddressList(List<String> addresses)
          Sets the address list associated with the cancel message control.
 void setPushId(String pushId)
          Sets the push id associated with the cancel message 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 list is not null or empty
 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
 

Constructor Detail

CancelMessageControl

@Deprecated
public CancelMessageControl()
Deprecated. As of release 1.1, replaced by CancelMessageControl(boolean) constructor instead. To use this constructor, you must configure the SDK to be in public or enterprise mode through the PushSDK.properties file by setting the use.public.push flag.

Default cancel message control constructor.


CancelMessageControl

@Deprecated
public CancelMessageControl(String pushId)
Deprecated. As of release 1.1, replaced by CancelMessageControl(boolean, String) constructor instead. To use this constructor, you must configure the SDK to be in public or enterprise mode through the PushSDK.properties file by setting the use.public.push flag.

Constructs a cancel message control with the given push id.

Parameters:
pushId - the id of the push to be cancelled

CancelMessageControl

@Deprecated
public CancelMessageControl(String pushId,
                                       List<String> addresses)
Deprecated. As of release 1.1, replaced by CancelMessageControl(boolean, String, List) constructor instead. To use this constructor, you must configure the SDK to be in public or enterprise mode through the PushSDK.properties file by setting the use.public.push flag.

Constructs a cancel message control with the given push id and the list of addresses.

Parameters:
pushId - the id of the push to be cancelled
addresses - the list of addresses to cancel the push for

CancelMessageControl

public CancelMessageControl(boolean usingPublicPush)
Constructs a cancel message control for either a public (BIS) push or an enterprise (BES) push.

Parameters:
usingPublicPush - true if configuring for a public (BIS) push; false otherwise
Since:
1.1

CancelMessageControl

public CancelMessageControl(boolean usingPublicPush,
                            String pushId)
Constructs a cancel message control for either a public (BIS) push or an enterprise (BES) push with the given push id.

Parameters:
usingPublicPush - true if configuring for a public (BIS) push; false otherwise
pushId - the id of the push to be cancelled
Since:
1.1

CancelMessageControl

public CancelMessageControl(boolean usingPublicPush,
                            String pushId,
                            List<String> addresses)
Constructs a cancel message control for either a public (BIS) push or an enterprise (BES) push with the given push id and the list of addresses.

Parameters:
usingPublicPush - true if configuring for a public (BIS) push; false otherwise
pushId - the id of the push to be cancelled
addresses - the list of addresses to cancel the push for
Since:
1.1
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

getPushId

public String getPushId()
Gets the push id associated with the cancel message control.

Returns:
the push id

setPushId

public void setPushId(String pushId)
Sets the push id associated with the cancel message control.

Parameters:
pushId - the push id

getAddresses

@Deprecated
public AddressList getAddresses()
Deprecated. As of release 1.1, replaced by getAddressList().

Gets the address list associated with the cancel message control.

Returns:
the address list

getAddressList

public List<String> getAddressList()
Gets the list of addresses associated with the cancel message control.

Returns:
the list of addresses
Since:
1.1

setAddresses

@Deprecated
public void setAddresses(AddressList addresses)
Deprecated. As of release 1.1, replaced by setAddressList(List).

Sets the address list associated with the cancel message control.

Parameters:
addresses - the address list

setAddressList

public void setAddressList(List<String> addresses)
Sets the address list associated with the cancel message control.

Parameters:
addresses - the address list
Since:
1.1

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.

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 list is not null or empty

Specified by:
validate in class PapControl


Copyright © 2011 Research In Motion. All Rights Reserved.