|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.blackberry.api.push.PushApplicationDescriptor
public class PushApplicationDescriptor
Enables creating and managing client-side push application descriptor based on application properties.
Descriptor contains the following properties:
Client-side push applications should specify the server type in order to perform registration. If the server does not track
applications, for example, the BlackBerry Enterprise Server with no BPAS module, then PushApplicationDescriptor.SERVER_TYPE_NONE
value should be
used. In this case, there is no registration and client-side push application starts to listen for push messages right away.
If server maintains a database of client-side push applications and requires registration, such as the BPAS database, then the
PushApplicationDescriptor.SERVER_TYPE_BPAS
constant should be used for specifying the server type. BPAS requires the application ID that was
provided during application registration and the server URL which is used for communication during client-side push application
registration.
The BPAS may impose registration rules and reject the registration requests. Client-side push application will be notified with registration results. When an application is registered with the BPAS it will be automatically un-registered when user swaps the SIM card. The client-side push application will be notified as well on this event and can re-register if the new user is authorized and wishes to receive push messages.
Field Summary | ||
---|---|---|
static byte |
SERVER_TYPE_BPAS
BlackBerry Push API server (BPAS) type. |
|
static byte |
SERVER_TYPE_NONE
No server-side support for client-side push applications. |
Constructor Summary | ||
---|---|---|
PushApplicationDescriptor(int port)
Creates client-side push application descriptor based on given port number only. |
||
PushApplicationDescriptor(int port,
ApplicationDescriptor appDescriptor)
Creates push application descriptor based on given port number and application descriptor. |
||
PushApplicationDescriptor(String appId,
int port,
String serverUrl,
byte serverType,
ApplicationDescriptor appDescriptor)
Creates push application descriptor based on port number, server type, and application descriptor. |
Method Summary | ||
---|---|---|
ApplicationDescriptor |
getAppDescriptor()
Returns the application descriptor that contains arguments passed into the main() method |
|
String |
getAppId()
Returns the application ID |
|
int |
getPort()
Returns the network port number to listen to |
|
byte |
getServerType()
Returns the server type which is either PushApplicationDescriptor.SERVER_TYPE_NONE or
PushApplicationDescriptor.SERVER_TYPE_BPAS |
|
String |
getServerUrl()
Returns the server URL that is used by servers that track client-side push applications. |
|
void |
setAppDescriptor(ApplicationDescriptor appDescriptor)
Sets the application descriptor that contains arguments passed into the main() method |
|
void |
setAppId(String appId)
Sets the application ID for servers that track the client-side push applications, such as the BPAS |
|
void |
setPort(int port)
Sets the network port number to listen to |
|
void |
setServerType(byte serverType)
Sets the server type that tracks the client-side push applications. |
|
void |
setServerUrl(String serverUrl)
Sets the server URL that is used for registration. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte SERVER_TYPE_NONE
This constant should be used when server doesn't track client applications, such as the BlackBerry Enterprise Server without BPAS. If this constant is used then the library starts listening for incoming messages right away without registering with the server.
public static final byte SERVER_TYPE_BPAS
Constructor Detail |
---|
public PushApplicationDescriptor(int port)
PushApplicationDescriptor.SERVER_TYPE_NONE
for server type
port
- port number to listen to for incoming push messagespublic PushApplicationDescriptor(int port, ApplicationDescriptor appDescriptor)
PushApplicationDescriptor.SERVER_TYPE_NONE
is
used for server type
port
- port number to listen to for incoming push messagesappDescriptor
- application descriptor that defines startup arguments passed to the main() methodpublic PushApplicationDescriptor(String appId, int port, String serverUrl, byte serverType, ApplicationDescriptor appDescriptor)
appId
- application ID required by the BPASport
- port number to listen to for incoming push messagesserverUrl
- URL that points to the server which tracks client-side push applicationsserverType
- either the PushApplicationDescriptor.SERVER_TYPE_NONE
or PushApplicationDescriptor.SERVER_TYPE_BPAS
appDescriptor
- descriptor that specifies parameters passed to client-side push application when it is startedMethod Detail |
---|
public int getPort()
public void setPort(int port)
port
- new port number to listen topublic byte getServerType()
PushApplicationDescriptor.SERVER_TYPE_NONE
or
PushApplicationDescriptor.SERVER_TYPE_BPAS
public void setServerType(byte serverType)
PushApplicationDescriptor.SERVER_TYPE_BPAS
or PushApplicationDescriptor.SERVER_TYPE_NONE
.
serverType
- public ApplicationDescriptor getAppDescriptor()
public void setAppDescriptor(ApplicationDescriptor appDescriptor)
appDescriptor
- new descriptor with argumentspublic String getAppId()
public void setAppId(String appId)
appId
- public String getServerUrl()
public void setServerUrl(String serverUrl)
serverUrl
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.