net.rim.pushsdk.pushappmgmt
Enum PushApplicationType

java.lang.Object
  extended by java.lang.Enum<PushApplicationType>
      extended by net.rim.pushsdk.pushappmgmt.PushApplicationType
All Implemented Interfaces:
Serializable, Comparable<PushApplicationType>

public enum PushApplicationType
extends Enum<PushApplicationType>

Defines the types of applications that can be pushed to.

Since:
1.1
Author:
mdicesare

Enum Constant Summary
ENTERPRISE_PUSH
          An enterprise (BES) type of push application.
PUBLIC_AND_ENTERPRISE_PUSH
          A public (BIS) and enterprise (BES) type of push application.
PUBLIC_PUSH
          A public (BIS) type of push application.
WEB_SIGNAL
          A Web Signal type of application.
 
Method Summary
 String getType()
          Gets the current push application type.
static PushApplicationType getType(String pushApplicationType)
          Gets the push application type associated with the passed in string.
static boolean isTypeChangeAllowed(PushApplicationType currentType, PushApplicationType newType)
          Returns true if the change to the push application type is allowed; false otherwise.
 String toString()
          Returns a textual description of the type.
static PushApplicationType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static PushApplicationType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

ENTERPRISE_PUSH

public static final PushApplicationType ENTERPRISE_PUSH
An enterprise (BES) type of push application.


PUBLIC_PUSH

public static final PushApplicationType PUBLIC_PUSH
A public (BIS) type of push application.


PUBLIC_AND_ENTERPRISE_PUSH

public static final PushApplicationType PUBLIC_AND_ENTERPRISE_PUSH
A public (BIS) and enterprise (BES) type of push application.


WEB_SIGNAL

public static final PushApplicationType WEB_SIGNAL
A Web Signal type of application. Note: Currently not supported (reserved for future use).

Method Detail

values

public static PushApplicationType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (PushApplicationType c : PushApplicationType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PushApplicationType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getType

public String getType()
Gets the current push application type.

Returns:
the push application type

getType

public static PushApplicationType getType(String pushApplicationType)
Gets the push application type associated with the passed in string.

Parameters:
pushApplicationType - a push application type
Returns:
a push application type matching the string passed in
Throws:
IllegalArgumentException - if the type passed in is invalid

isTypeChangeAllowed

public static boolean isTypeChangeAllowed(PushApplicationType currentType,
                                          PushApplicationType newType)
Returns true if the change to the push application type is allowed; false otherwise.

If the currentType is null, return true. If newType is null, return false. The type of the push application can only change in one of two ways:

  1. You can update from PUBLIC_PUSH to PUBLIC_AND_ENTERPRISE_PUSH.
  2. You can update from ENTERPRISE_PUSH to PUBLIC_AND_ENTERPRISE_PUSH.

Parameters:
currentType - the current type of the push application
newType - the desired new type of the push application
Returns:
true if the push application type can be changed; false otherwise

toString

public String toString()
Returns a textual description of the type.

Overrides:
toString in class Enum<PushApplicationType>


Copyright © 2011 Research In Motion. All Rights Reserved.