net.rim.pushsdk.subscription.web
Class SubscribeRequest

java.lang.Object
  extended by net.rim.pushsdk.subscription.web.BaseRequest
      extended by net.rim.pushsdk.subscription.web.SubscribeRequest
All Implemented Interfaces:
Serializable

public class SubscribeRequest
extends BaseRequest

Represents the details of an HTTP request from a subscribe.

Author:
mdandrea
See Also:
Serialized Form

Field Summary
static int ADDRESS_MAX_LENGTH
          The maximum allowed length for a subscriber's address (e.g.
static int MODEL_MAX_LENGTH
          The maximum allowed length for the model number of a subscriber's device.
static int OS_VERSION_MAX_LENGTH
          The maximum allowed length for the OS version of a subscriber's device.
static int SUBSCRIBER_ID_MAX_LENGTH
          The maximum allowed length for the id of a subscriber.
 
Fields inherited from class net.rim.pushsdk.subscription.web.BaseRequest
pushApplicationId, subscriberId
 
Constructor Summary
SubscribeRequest()
          Constructs a subscribe request.
SubscribeRequest(String pushApplicationId, String subscriberId, String address, String osVersion, String model)
          Deprecated. As of release 1.1, replaced by the SubscribeRequest(String, String, String, String, String, SubscriberType) 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.
SubscribeRequest(String pushApplicationId, String subscriberId, String address, String osVersion, String model, SubscriberType type)
          Constructs a subscribe request with the given subscription details.
 
Method Summary
 boolean equals(Object obj)
          Returns true if two subscribe requests are found to be equal and false otherwise.
 String getAddress()
          Gets the current value of the subscriber's address (e.g.
 String getModel()
          Gets the current value of the model number of a subscriber's device.
 String getOsVersion()
          Gets the current value of the OS version of a subscriber's device.
 SubscriberType getType()
          Gets the type of the subscriber.
 int hashCode()
          Returns a hashcode for this subscribe request.
 void setAddress(String address)
          Sets the subscriber's address (e.g.
 void setModel(String model)
          Sets the model number of a subscriber's device.
 void setOsVersion(String osVersion)
          Sets the OS version of a subscriber's device.
 void setType(SubscriberType type)
          Sets the type of the subscriber.
 String toString()
          Constructs a String with all attributes in name = value format.
 
Methods inherited from class net.rim.pushsdk.subscription.web.BaseRequest
getPushApplicationId, getSubscriberId, setPushApplicationId, setSubscriberId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ADDRESS_MAX_LENGTH

public static final int ADDRESS_MAX_LENGTH
The maximum allowed length for a subscriber's address (e.g. PIN, email address).

See Also:
Constant Field Values

OS_VERSION_MAX_LENGTH

public static final int OS_VERSION_MAX_LENGTH
The maximum allowed length for the OS version of a subscriber's device.

See Also:
Constant Field Values

MODEL_MAX_LENGTH

public static final int MODEL_MAX_LENGTH
The maximum allowed length for the model number of a subscriber's device.

See Also:
Constant Field Values

SUBSCRIBER_ID_MAX_LENGTH

public static final int SUBSCRIBER_ID_MAX_LENGTH
The maximum allowed length for the id of a subscriber.

See Also:
Constant Field Values
Constructor Detail

SubscribeRequest

public SubscribeRequest()
Constructs a subscribe request.


SubscribeRequest

@Deprecated
public SubscribeRequest(String pushApplicationId,
                                   String subscriberId,
                                   String address,
                                   String osVersion,
                                   String model)
Deprecated. As of release 1.1, replaced by the SubscribeRequest(String, String, String, String, String, SubscriberType) 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 subscribe request with the given subscription details.

Parameters:
pushApplicationId - the app id of a push application
subscriberId - the id of a subscriber to a push application
address - the address (e.g. PIN, email address) of a subscriber
osVersion - the OS version of a subscriber's device
model - the model number of a subscriber's device

SubscribeRequest

public SubscribeRequest(String pushApplicationId,
                        String subscriberId,
                        String address,
                        String osVersion,
                        String model,
                        SubscriberType type)
Constructs a subscribe request with the given subscription details.

Parameters:
pushApplicationId - the app id of a push application
subscriberId - the id of a subscriber to a push application
address - the address (e.g. PIN, email address) of a subscriber
osVersion - the OS version of a subscriber's device
model - the model number of a subscriber's device
type - the subscriber's type (i.e. public (BIS) or enterprise (BES); this parameter is allowed to be null if pushApplicationId does not correspond to a push app of type Public+Enterprise Push)
Since:
1.1
See Also:
SubscriberType
Method Detail

getAddress

public String getAddress()
Gets the current value of the subscriber's address (e.g. PIN, email address).

Returns:
a subscriber's address

setAddress

public void setAddress(String address)
Sets the subscriber's address (e.g. PIN, email address).

Parameters:
address - the subscriber's address

getOsVersion

public String getOsVersion()
Gets the current value of the OS version of a subscriber's device.

Returns:
the OS version of a subscriber's device

setOsVersion

public void setOsVersion(String osVersion)
Sets the OS version of a subscriber's device.

Parameters:
osVersion - the OS version of a subscriber's device

getModel

public String getModel()
Gets the current value of the model number of a subscriber's device.

Returns:
the model number of a subscriber's device

setModel

public void setModel(String model)
Sets the model number of a subscriber's device.

Parameters:
model - the model number of a subscriber's device

getType

public SubscriberType getType()
Gets the type of the subscriber.

Returns:
the subscriber's type
Since:
1.1
See Also:
SubscriberType

setType

public void setType(SubscriberType type)
Sets the type of the subscriber.

Parameters:
type - the subscriber's type
Since:
1.1
See Also:
SubscriberType

toString

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

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

hashCode

public int hashCode()
Returns a hashcode for this subscribe request.

Overrides:
hashCode in class BaseRequest
Returns:
a hashcode for this subscribe request.

equals

public boolean equals(Object obj)
Returns true if two subscribe requests are found to be equal and false otherwise.

Overrides:
equals in class BaseRequest
Returns:
whether two subscribe requests are equal


Copyright © 2011 Research In Motion. All Rights Reserved.