net.rim.pushsdk.pushappmgmt
Class PushApplication

java.lang.Object
  extended by net.rim.pushsdk.pushappmgmt.PushApplication
All Implemented Interfaces:
Serializable

public class PushApplication
extends Object
implements Serializable

Represents the details and attributes of a push application. A push application refers to an application that can be installed on the device and that can accept push messages sent to it.

Author:
mdicesare
See Also:
Serialized Form

Field Summary
static int APP_ID_MAX_LENGTH
          Maximum application id field length.
static int DESC_MAX_LENGTH
          Maximum description field length.
protected  boolean isDeprecatedConstructorUsed
          Deprecated. 
static int MODIFIED_BY_MAX_LENGTH
          Maximum modified by field length.
static int NAME_MAX_LENGTH
          Maximum name field length.
static int PASSWORD_MAX_LENGTH
          Maximum password field length.
static int USERNAME_MAX_LENGTH
          Maximum username field length.
static int VERSION_MAX_LENGTH
          Maximum version field length.
 
Constructor Summary
PushApplication()
          Deprecated. As of release 1.1, use PushApplication(PushApplicationType)
PushApplication(PushApplication pushApplication)
          Copy Constructor.
PushApplication(PushApplicationType type)
          Constructs a push application with the given type.
 
Method Summary
 boolean equals(Object obj)
          Returns true if two push applications are found to be equal and false otherwise.
 Integer getConsecutiveFailedPushThreshold()
          Deprecated. As of release 1.1, the SDK will no longer keep a count of consecutive failed pushes when result notification is received from the PPG. If this functionality is desired it should be implemented by push initiator's themselves by subclassing the FailureNotificationListener from the acknowledgement component. The SDK no longer keeps this count because the public/BIS PPG will be implementing this logic on the platform side instead. For enterprise/BES the push initiator must implement the logic if desired.
 Date getCreatedDate()
          Gets the date at which the push application was created.
 Integer getDefaultPushLiveTime()
          Gets the current default time-to-live in seconds of a push message sent to the push application.
 String getDescription()
          Gets the current description for the push application.
 String getEnterpriseNotifyUrl()
          Returns the enterprise/BES notification call back URL for the push application.
 String getEnterprisePassword()
          Gets the current enterprise (BES) password, which is optional (can be null) to authenticate pushing to an application.
 Date getExpiryDate()
          Gets the date at which the push application expires.
 String getId()
          Gets the id that identifies the push application.
 Integer getMaxDailyQuota()
          Gets the current maximum daily quota (in number of pushes) for the push application.
 String getModifiedBy()
          Gets the id of the individual or entity which performed the last modification on the push application.
 Date getModifiedDate()
          Gets the date at which the push application was last modified.
 String getName()
          Gets the current name of the push application.
 String getNotifyUrl()
          Deprecated. As of version 1.1, use getPublicNotifyUrl() or getEnterpriseNotifyUrl()
 String getPassword()
          Deprecated. As of release 1.1, use getPublicPassword() or getEnterprisePassword()
 String getPublicNotifyUrl()
          Returns the public/BIS notification call back URL for the push application.
 String getPublicPassword()
          Gets the current public (BIS) password, which is required to authenticate pushing to an application.
 Integer getPushPort()
          Gets the current port that the push application is listening on.
 PushApplicationServiceLevel getServiceLevel()
          Gets the current service level (service class) of the push application.
 Date getStartDate()
          Gets the date the push application went into active service.
 PushApplicationStatus getStatus()
          Gets the current status of the push application.
 PushApplicationType getType()
          Returns the type of Push Application.
 String getUsername()
          Gets the current username, which is required to authenticate pushing to an application.
 String getVersion()
          Gets the current version number of the push application.
 int hashCode()
           
 boolean isApplicationReliable()
          Whether or not pushes sent to the push application should be acknowledged by the application itself.
 boolean isAutoDeleteRequests()
          Indicates whether push request data will be automatically deleted when the last notification for that request is received.
 boolean isBypassSubscription()
          Whether or not the push application allows subscriptions (for push applications of type "Enterprise Push" only).
protected  boolean isDeprecatedConstructorUsed()
          Deprecated. 
 boolean isExpired()
          Indicates if this push application is expired.
 boolean isLastNotificationEnabled()
          Indicates whether notifications of the 'last' type are enabled.
 boolean isStorePushRequests()
          Whether or not the push application should store the details of all outgoing push requests.
 boolean isTrackingLastNotification()
          Whether or not last notifications are being tracked for requests associated with the push application.
 void setApplicationReliable(boolean isApplicationReliable)
          Indicates if pushes sent to this push application should be acknowledged by the application on the device or whether the device receiving the message is satisfactory enough.
 void setAutoDeleteRequests(boolean autoDeleteRequests)
          Sets whether push request data will be automatically deleted when the last notification for that request is received.
 void setBypassSubscription(boolean bypassSubscription)
          Indicates whether the SDK should bypass checking/validating subscriptions for pushes sent to this push application.
 void setConsecutiveFailedPushThreshold(Integer consecutiveFailedPushThreshold)
          Deprecated. As of release 1.1, the SDK will no longer keep a count of consecutive failed pushes when result notification is received from the PPG. If this functionality is desired it should be implemented by push initiator's themselves by subclassing the FailureNotificationListener from the acknowledgement component. The SDK no longer keeps this count because the public/BIS PPG will be implementing this logic on the platform side instead. For enterprise/BES the push initiator must implement the logic if desired.
protected  void setCreatedDate(Date createdDate)
          Sets the date this push application was created.
 void setDefaultPushLiveTime(Integer defaultPushLiveTime)
          Sets the default time-to-live for a push message sent to this push application in seconds.
 void setDescription(String description)
          A textual description of the application.
 void setEnterpriseNotifyUrl(String enterpriseNotifyUrlPath)
          Sets the URL path where this push application will be listening for result notifications (acknowledgements) of the final outcome of the push sent via HTTP from the enterprise/BES PPG.
 void setEnterprisePassword(String password)
          Sets the enterprise (BES) password needed to authenticate pushing to this application.
 void setExpiryDate(Date expiryDate)
          Sets the date this push application expires and is not allowed to send any more pushes.
 void setId(String id)
          Sets the id that identifies this push application.
 void setLastNotificationEnabled(boolean lastNotificationEnabled)
          Sets whether 'last' type notifications are enabled.
 void setMaxDailyQuota(Integer maxDailyQuota)
          Sets the maximum daily quota (in number of pushes) that can be pushed to this push application.
 void setModifiedBy(String modifiedBy)
          Sets the identifier of the entity last making a modification to this push application's details.
protected  void setModifiedDate(Date modifiedDate)
          Sets the date this push application was last modified.
 void setName(String name)
          Sets the user friendly name of the push application.
 void setNotifyUrl(String notifyUrl)
          Deprecated. As of version 1.1, use setPublicNotifyUrl(String) or setEnterpriseNotifyUrl(String)
 void setPassword(String password)
          Deprecated. As of release 1.1, use setPublicPassword(String) or setEnterprisePassword(String)
 void setPublicNotifyUrl(String publicNotifyUrlRelativePath)
          Sets the relative part of the URL path where this push application will be listening for result notifications (acknowledgements) of the final outcome of the push sent via HTTP from the public/BIS PPG.
 void setPublicPassword(String password)
          Sets the public (BIS) password needed to authenticate pushing to this application.
 void setPushPort(Integer pushPort)
          Sets the port this push application is listening for pushed data on the device.
 void setServiceLevel(PushApplicationServiceLevel serviceLevel)
          Sets the service level (service class) for this push application.
 void setStartDate(Date startDate)
          Sets the date this push application went into active service.
 void setStatus(PushApplicationStatus status)
          Sets the status of this push application.
 void setStorePushRequests(boolean storePushRequests)
          Indicates whether the SDK should store the details of all outgoing push requests for pushes sent to this push application.
 void setType(PushApplicationType type)
          Sets the type of Push Application.
 void setUsername(String username)
          Sets the username needed to authenticate pushing to this application.
 void setVersion(String version)
          Sets the version number of this application.
 String toString()
          Constructs a String with all attributes in name = value format.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MODIFIED_BY_MAX_LENGTH

public static final int MODIFIED_BY_MAX_LENGTH
Maximum modified by field length.

See Also:
Constant Field Values

DESC_MAX_LENGTH

public static final int DESC_MAX_LENGTH
Maximum description field length.

See Also:
Constant Field Values

PASSWORD_MAX_LENGTH

public static final int PASSWORD_MAX_LENGTH
Maximum password field length.

See Also:
Constant Field Values

USERNAME_MAX_LENGTH

public static final int USERNAME_MAX_LENGTH
Maximum username field length.

See Also:
Constant Field Values

VERSION_MAX_LENGTH

public static final int VERSION_MAX_LENGTH
Maximum version field length.

See Also:
Constant Field Values

NAME_MAX_LENGTH

public static final int NAME_MAX_LENGTH
Maximum name field length.

See Also:
Constant Field Values

APP_ID_MAX_LENGTH

public static final int APP_ID_MAX_LENGTH
Maximum application id field length.

See Also:
Constant Field Values

isDeprecatedConstructorUsed

@Deprecated
protected boolean isDeprecatedConstructorUsed
Deprecated. 
Constructor Detail

PushApplication

public PushApplication(PushApplication pushApplication)
Copy Constructor.

Parameters:
pushApplication - a PushApplication object

PushApplication

@Deprecated
public PushApplication()
Deprecated. As of release 1.1, use PushApplication(PushApplicationType)

Constructs a push application.


PushApplication

public PushApplication(PushApplicationType type)
Constructs a push application with the given type.

Parameters:
type - the type of push application
Since:
1.1
See Also:
PushApplicationType
Method Detail

getId

public String getId()
Gets the id that identifies the push application.

Returns:
the push application's unique id

setId

public void setId(String id)
Sets the id that identifies this push application. When sending push requests this id will identify the application being pushed to.

For a push application of type "Public Push" or "Public+Enterprise Push", this will be assigned by a RIM administrator. For a push application of type "Enterprise Push", this can be any random unique value.

Parameters:
id - the id of the push application

getName

public String getName()
Gets the current name of the push application.

Returns:
the name of the push application

setName

public void setName(String name)
Sets the user friendly name of the push application. Used only for recording purposes.

Parameters:
name - the name of the push application

getVersion

public String getVersion()
Gets the current version number of the push application.

Returns:
the push application's current version number

setVersion

public void setVersion(String version)
Sets the version number of this application. Used only for recording purposes.

Parameters:
version - the version number

getUsername

public String getUsername()
Gets the current username, which is required to authenticate pushing to an application.

IMPORTANT: This field is used for enterprise/BES only (application ID is used as the username for public/BIS).

Returns:
the push application's username

setUsername

public void setUsername(String username)
Sets the username needed to authenticate pushing to this application.

IMPORTANT: This field is used for enterprise/BES only (application ID is used as the username for public/BIS).

Parameters:
username - the push application's username

getPassword

@Deprecated
public String getPassword()
Deprecated. As of release 1.1, use getPublicPassword() or getEnterprisePassword()

Gets the current password, which is required to authenticate pushing to an application.

Returns:
the push application's password

setPassword

@Deprecated
public void setPassword(String password)
Deprecated. As of release 1.1, use setPublicPassword(String) or setEnterprisePassword(String)

Sets the password needed to authenticate pushing to this application.

Note: It is mandatory for public (BIS) push but optional for an enterprise (BES) push.

Parameters:
password - the password

getPublicPassword

public String getPublicPassword()
Gets the current public (BIS) password, which is required to authenticate pushing to an application.

Returns:
the push application's password
Since:
1.1

setPublicPassword

public void setPublicPassword(String password)
Sets the public (BIS) password needed to authenticate pushing to this application.

Note: It is mandatory for public (BIS) push.

Parameters:
password - the password
Since:
1.1

getEnterprisePassword

public String getEnterprisePassword()
Gets the current enterprise (BES) password, which is optional (can be null) to authenticate pushing to an application.

Returns:
the push application's password
Since:
1.1

setEnterprisePassword

public void setEnterprisePassword(String password)
Sets the enterprise (BES) password needed to authenticate pushing to this application.

Note: It is optional for an enterprise (BES) push.

Parameters:
password - the password
Since:
1.1

getDescription

public String getDescription()
Gets the current description for the push application.

Returns:
the push application's description

setDescription

public void setDescription(String description)
A textual description of the application. Used only for recording purposes.

Parameters:
description - the description of the application

getMaxDailyQuota

public Integer getMaxDailyQuota()
Gets the current maximum daily quota (in number of pushes) for the push application.

Returns:
the push application's max. daily quota

setMaxDailyQuota

public void setMaxDailyQuota(Integer maxDailyQuota)
Sets the maximum daily quota (in number of pushes) that can be pushed to this push application.

Parameters:
maxDailyQuota - the maximum daily quota

getStatus

public PushApplicationStatus getStatus()
Gets the current status of the push application.

Returns:
the push application's status
See Also:
PushApplicationStatus

setStatus

public void setStatus(PushApplicationStatus status)
Sets the status of this push application.

Parameters:
status - the status of the application
See Also:
PushApplicationStatus, PushApplicationStatus

getPushPort

public Integer getPushPort()
Gets the current port that the push application is listening on.

Returns:
the push application's port

setPushPort

public void setPushPort(Integer pushPort)
Sets the port this push application is listening for pushed data on the device.

Parameters:
pushPort - the port

getNotifyUrl

@Deprecated
public String getNotifyUrl()
Deprecated. As of version 1.1, use getPublicNotifyUrl() or getEnterpriseNotifyUrl()

Gets the current notification URL for the push application.

Returns:
the push application's notification URL

getPublicNotifyUrl

public String getPublicNotifyUrl()
Returns the public/BIS notification call back URL for the push application.

Returns:
the push application's public/BIS notification call back URL
Since:
1.1

getEnterpriseNotifyUrl

public String getEnterpriseNotifyUrl()
Returns the enterprise/BES notification call back URL for the push application.

Returns:
the push application's enterprise/BES notification call back URL
Since:
1.1

setNotifyUrl

@Deprecated
public void setNotifyUrl(String notifyUrl)
Deprecated. As of version 1.1, use setPublicNotifyUrl(String) or setEnterpriseNotifyUrl(String)

Sets the URL where this push application will be listening for notifications of the final outcome of the push sent via HTTP.

Note: For public (BIS) push, this will only be a partial path of the URL. For enterprise (BES) push, this must be a fully qualified URL.

BIS push example: /notify - The leading part of the URL is registered with a RIM administrator on the PPG side (eg. http://127.0.0.1/pap).

BES push example: http://127.0.0.1/pap/notify

Parameters:
notifyUrl - the notify URL

setPublicNotifyUrl

public void setPublicNotifyUrl(String publicNotifyUrlRelativePath)
Sets the relative part of the URL path where this push application will be listening for result notifications (acknowledgements) of the final outcome of the push sent via HTTP from the public/BIS PPG.

The base part of the URL is specified by you when you register to use the public/BIS PPG; the base part of the URL will be prepended to this relative URL by the public/BIS PPG when it accepts the push.

For example, if you want result notifications to be sent to the following URL: http://myserverip:8080/pushsdk/notification then you must specify your base URL with the PPG at registration time as: http://myserverip:8080/pushsdk. Then, to this method, you set the relative portion of the path: /notification. When the PPG sends the result notification (acknowledgement message), it will combine both parts to get the full URL.

Parameters:
publicNotifyUrlRelativePath - the relative path part of the URL (base part of the URL must not be specified here!)
Since:
1.1

setEnterpriseNotifyUrl

public void setEnterpriseNotifyUrl(String enterpriseNotifyUrlPath)
Sets the URL path where this push application will be listening for result notifications (acknowledgements) of the final outcome of the push sent via HTTP from the enterprise/BES PPG.

The enterprise/BES PPG wants the full path of where to send the result notifications (acknowledgements).

For example, if you want result notifications to be sent to the following URL: http://myserverip:8080/pushsdk/notification then to this method you set the entire URL: http://myserverip:8080/pushsdk/notification.

Parameters:
enterpriseNotifyUrlPath - the full result notification URL
Since:
1.1

isStorePushRequests

public boolean isStorePushRequests()
Whether or not the push application should store the details of all outgoing push requests.

Returns:
true if they should be stored; otherwise, false

setStorePushRequests

public void setStorePushRequests(boolean storePushRequests)
Indicates whether the SDK should store the details of all outgoing push requests for pushes sent to this push application. Note: If storing push requests, then a notify URL must be set.

Parameters:
storePushRequests - true | false

isBypassSubscription

public boolean isBypassSubscription()
Whether or not the push application allows subscriptions (for push applications of type "Enterprise Push" only).

Returns:
true if subscriptions should be bypassed; otherwise, false

setBypassSubscription

public void setBypassSubscription(boolean bypassSubscription)
Indicates whether the SDK should bypass checking/validating subscriptions for pushes sent to this push application. This is only allowed for push applications of type "Enterprise Push".

Parameters:
bypassSubscription - true | false

getConsecutiveFailedPushThreshold

public Integer getConsecutiveFailedPushThreshold()
Deprecated. As of release 1.1, the SDK will no longer keep a count of consecutive failed pushes when result notification is received from the PPG. If this functionality is desired it should be implemented by push initiator's themselves by subclassing the FailureNotificationListener from the acknowledgement component. The SDK no longer keeps this count because the public/BIS PPG will be implementing this logic on the platform side instead. For enterprise/BES the push initiator must implement the logic if desired.

Gets the number of consecutive failed pushes allowed for a subscriber to the push application before automatically suspending them.

Returns:
the number of consecutive failed pushes allowed by the push application

setConsecutiveFailedPushThreshold

public void setConsecutiveFailedPushThreshold(Integer consecutiveFailedPushThreshold)
Deprecated. As of release 1.1, the SDK will no longer keep a count of consecutive failed pushes when result notification is received from the PPG. If this functionality is desired it should be implemented by push initiator's themselves by subclassing the FailureNotificationListener from the acknowledgement component. The SDK no longer keeps this count because the public/BIS PPG will be implementing this logic on the platform side instead. For enterprise/BES the push initiator must implement the logic if desired.

Sets the number of consecutive failed pushes that are permitted before the SDK automatically suspends a subscription.

Parameters:
consecutiveFailedPushThreshold - the number of consecutive failed pushes allowed before suspending the user

getStartDate

public Date getStartDate()
Gets the date the push application went into active service.

Returns:
the push application's start date

setStartDate

public void setStartDate(Date startDate)
Sets the date this push application went into active service. Used only for recording purposes.

Parameters:
startDate -

getExpiryDate

public Date getExpiryDate()
Gets the date at which the push application expires.

Returns:
the push application's expiry date

setExpiryDate

public void setExpiryDate(Date expiryDate)
Sets the date this push application expires and is not allowed to send any more pushes. Every time a push is sent to this push application it will be verified to ensure it has not expired. If the expiry date approaches and you wish to continue sending pushes, update the push application with a new expiry date set it in the future.

Parameters:
expiryDate - the expiry date

getCreatedDate

public Date getCreatedDate()
Gets the date at which the push application was created.

Returns:
the push application's created date

setCreatedDate

protected void setCreatedDate(Date createdDate)
Sets the date this push application was created. Note: This will be set automatically by the SDK.


getModifiedDate

public Date getModifiedDate()
Gets the date at which the push application was last modified.

Returns:
the push application's last modified date

setModifiedDate

protected void setModifiedDate(Date modifiedDate)
Sets the date this push application was last modified. Note: This will be set automatically by the SDK.


getModifiedBy

public String getModifiedBy()
Gets the id of the individual or entity which performed the last modification on the push application.

Returns:
the id of the last modifier of the push application

setModifiedBy

public void setModifiedBy(String modifiedBy)
Sets the identifier of the entity last making a modification to this push application's details.

Parameters:
modifiedBy - the identifier

getDefaultPushLiveTime

public Integer getDefaultPushLiveTime()
Gets the current default time-to-live in seconds of a push message sent to the push application.

Returns:
a push message's default time-to-live for the push application

setDefaultPushLiveTime

public void setDefaultPushLiveTime(Integer defaultPushLiveTime)
Sets the default time-to-live for a push message sent to this push application in seconds. Once the time-to-live has passed for a message, if the message has not be delivered, it will be marked as expired and can be retried.

Parameters:
defaultPushLiveTime - the time in seconds

isApplicationReliable

public boolean isApplicationReliable()
Whether or not pushes sent to the push application should be acknowledged by the application itself.

Returns:
the application-level reliability of pushes sent to the push application

setApplicationReliable

public void setApplicationReliable(boolean isApplicationReliable)
Indicates if pushes sent to this push application should be acknowledged by the application on the device or whether the device receiving the message is satisfactory enough.

Parameters:
isApplicationReliable - true for application level reliability; false for transport(device only) level reliability

getServiceLevel

public PushApplicationServiceLevel getServiceLevel()
Gets the current service level (service class) of the push application.

Returns:
the push application's service level

setServiceLevel

public void setServiceLevel(PushApplicationServiceLevel serviceLevel)
Sets the service level (service class) for this push application.

Parameters:
serviceLevel - the service level
See Also:
PushApplicationServiceLevel

isExpired

public boolean isExpired()
Indicates if this push application is expired.

Returns:
boolean true if the push application's expiry date has passed; false otherwise

isLastNotificationEnabled

public boolean isLastNotificationEnabled()
Indicates whether notifications of the 'last' type are enabled.

Returns:
true if notifications of the 'last' type are enabled

setLastNotificationEnabled

public void setLastNotificationEnabled(boolean lastNotificationEnabled)
Sets whether 'last' type notifications are enabled. Must be set to true in order for a notification listener of type 'LAST' to be invoked. This should only be enabled if the "Store push requests" field is also enabled.

Parameters:
lastNotificationEnabled - true if notification of the 'last' type are enabled; false otherwise

isAutoDeleteRequests

public boolean isAutoDeleteRequests()
Indicates whether push request data will be automatically deleted when the last notification for that request is received.

Returns:
true if request data will be deleted; false otherwise

setAutoDeleteRequests

public void setAutoDeleteRequests(boolean autoDeleteRequests)
Sets whether push request data will be automatically deleted when the last notification for that request is received. This should only be enabled if the "Store push requests" field is also enabled.

Parameters:
autoDeleteRequests - true if request data will be deleted; false otherwise

isTrackingLastNotification

public boolean isTrackingLastNotification()
Whether or not last notifications are being tracked for requests associated with the push application.

Returns:
true if push requests are being stored and either last notifications are enabled or the automatic deletion of requests is enabled; false otherwise

setType

public void setType(PushApplicationType type)
Sets the type of Push Application.

Parameters:
type - the type to set
Since:
1.1
See Also:
PushApplicationType

getType

public PushApplicationType getType()
Returns the type of Push Application.

Returns:
the type
Since:
1.1
See Also:
PushApplicationType

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.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

Overrides:
equals in class Object
Returns:
whether two push applications are equal

isDeprecatedConstructorUsed

@Deprecated
protected boolean isDeprecatedConstructorUsed()
Deprecated. 

This method is used internally and is for backwards compatibility only.

Returns:
whether or not the deprecated constructor was used


Copyright © 2011 Research In Motion. All Rights Reserved.