net.rim.device.api.itpolicy
Class ITPolicy

java.lang.Object
  extended by net.rim.device.api.itpolicy.ITPolicy

public final class ITPolicy
extends Object

Provides access to the IT policy database.

IT Policy is used by BlackBerry system administrators to govern the desktop and handheld settings of individual BlackBerry handheld users. IT policies enable system administrators to customize the features that are common to all BlackBerry handheld users on a given BlackBerry Enterprise Server, such as password details and convenience settings like mail forwarding options and browser settings.

IT policies provide an efficient method for managing many different users simultaneously.

Since:
BlackBerry API 3.6.0

Field Summary
static long GUID_IT_POLICY_CHANGED
          Deprecated. Use @link{ITPolicyChangedListener#policyChanged}. This event will only go to non-RIM applications
static long GUID_IT_POLICY_CHANGED_LOCKED_HANDHELD
          Deprecated. Use @link{ITPolicyChangedListener#policyChanged}. This event will only go to non-RIM applications
static long GUID_PASSWORD_SET_BY_ITADMIN
          Deprecated. Use @link{ITPolicyInfoListener#passwordSetByAdmin}. This event will only go to non-RIM applications
static int PUBLIC_KEY_TAG
          Represents the public key sub tag (for use with ITPOLICY_VERIFICATION_KEYS tag)
static int SIGNATURE_KEY_TAG
          Represents the signature key sub tag (for use with ITPOLICY_SIGNATURE_KEYS tag)
static int TERNARY_FALSE
          Represents the ternary false value.
static int TERNARY_PROMPT
          Represents the ternary prompt value.
static int TERNARY_TRUE
          Represents the ternary true value.
 
Method Summary
static void addListener(ITPolicyListener listener)
          Adds a listener to process ITPolicy events.
static void addListener(Application application, ITPolicyListener listener)
          Adds a listener to process ITPolicy events.
static boolean getBoolean(int id, boolean defaultValue)
          Returns a boolean value from the IT policy database.
static boolean getBoolean(int group, int id, boolean defaultValue)
          Returns a boolean value from the IT policy database given the group key, the ID and a boolean representing the default value.
static boolean getBoolean(String name, boolean defaultValue)
          Returns a boolean value from the IT policy database given the name of the parameter and its default value.
static byte getByte(int id, byte defaultValue)
          Returns a byte value from the IT policy database.
static byte getByte(int group, int id, byte defaultValue)
          Returns a byte value from the IT policy database.
static byte getByte(String name)
          Returns a byte value from the IT policy database given the name of the parameter.
static byte[] getByteArray(int id)
          Returns a byte array from the IT policy database.
static byte[] getByteArray(int group, int id)
          Returns a byte array from the IT policy database given the group key and ID.
static byte[] getByteArray(String name)
          Returns a byte array from the IT policy database given the name of the byte array.
static int getInteger(int id, int defaultValue)
          Returns an integer value from the IT policy database given the ID and default value.
static int getInteger(int group, int id, int defaultValue)
          Returns an integer value from the IT policy database.
static int getInteger(String name, int defaultValue)
          Returns an integer value from the IT policy database given the name of the parameter and its default value.
static String getString(int id)
          Returns a string value from the IT policy database.
static String getString(int group, int id)
          Returns a string value from the IT policy database given the group key and ID.
static String getString(String name)
          Returns a string value from the IT policy database given the name of the string.
static void removeListener(ITPolicyListener listener)
          Removes listener from the calling application's list of listeners.
static void removeListener(Application application, ITPolicyListener listener)
          Removes listener from the calling application's list of listeners.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Field Detail

GUID_IT_POLICY_CHANGED

public static final long GUID_IT_POLICY_CHANGED
Deprecated. Use @link{ITPolicyChangedListener#policyChanged}. This event will only go to non-RIM applications
The GUID for the global event sent when the IT Policy changes.

See Also:
Constant Field Values
Since:
BlackBerry API 3.6.0

GUID_IT_POLICY_CHANGED_LOCKED_HANDHELD

public static final long GUID_IT_POLICY_CHANGED_LOCKED_HANDHELD
Deprecated. Use @link{ITPolicyChangedListener#policyChanged}. This event will only go to non-RIM applications
The GUID for the global event sent when the IT Policy changes and handheld locking is required

See Also:
Constant Field Values
Since:
BlackBerry API 4.0.0

GUID_PASSWORD_SET_BY_ITADMIN

public static final long GUID_PASSWORD_SET_BY_ITADMIN
Deprecated. Use @link{ITPolicyInfoListener#passwordSetByAdmin}. This event will only go to non-RIM applications
The GUID for the global event sent when the password is changed by the BES administrator.

See Also:
Constant Field Values
Since:
BlackBerry API 4.3.0

TERNARY_TRUE

public static final int TERNARY_TRUE
Represents the ternary true value.

See Also:
Constant Field Values
Since:
BlackBerry API 3.6.0

TERNARY_FALSE

public static final int TERNARY_FALSE
Represents the ternary false value.

See Also:
Constant Field Values
Since:
BlackBerry API 3.6.0

TERNARY_PROMPT

public static final int TERNARY_PROMPT
Represents the ternary prompt value.

See Also:
Constant Field Values
Since:
BlackBerry API 3.6.0

PUBLIC_KEY_TAG

public static final int PUBLIC_KEY_TAG
Represents the public key sub tag (for use with ITPOLICY_VERIFICATION_KEYS tag)

See Also:
Constant Field Values
Since:
BlackBerry API 4.0.2

SIGNATURE_KEY_TAG

public static final int SIGNATURE_KEY_TAG
Represents the signature key sub tag (for use with ITPOLICY_SIGNATURE_KEYS tag)

See Also:
Constant Field Values
Since:
BlackBerry API 4.0.2


Method Detail

getString

public static String getString(String name)
Returns a string value from the IT policy database given the name of the string.

Parameters:
name - The parameter name.
Returns:
The parameter value, or null if no entry was found.
Since:
BlackBerry API 3.6.0

getByteArray

public static byte[] getByteArray(String name)
Returns a byte array from the IT policy database given the name of the byte array.

Parameters:
name - The parameter name.
Returns:
The parameter value, or null if no entry was found.
Since:
BlackBerry API 3.6.0

getByte

public static byte getByte(String name)
Returns a byte value from the IT policy database given the name of the parameter.

Parameters:
name - The parameter name.
Returns:
The parameter value, or a null byte ('\0') if no entry was found.
Since:
BlackBerry API 3.6.0

getBoolean

public static boolean getBoolean(String name,
                                 boolean defaultValue)
Returns a boolean value from the IT policy database given the name of the parameter and its default value.

Parameters:
name - The parameter name.
defaultValue - The value to be returned if no entry was found.
Returns:
The parameter value.
Since:
BlackBerry API 3.6.0

getInteger

public static int getInteger(String name,
                             int defaultValue)
Returns an integer value from the IT policy database given the name of the parameter and its default value.

Parameters:
name - The parameter name.
defaultValue - The value to be returned if no entry was found.
Returns:
The parameter value.
Since:
BlackBerry API 3.6.0

getString

public static String getString(int id)
Returns a string value from the IT policy database.

Parameters:
id - The parameter id.
Returns:
The parameter value, or null if no entry was found.
Since:
BlackBerry API 3.6.0

getString

public static String getString(int group,
                               int id)
Returns a string value from the IT policy database given the group key and ID.

Parameters:
group - The group key.
id - The parameter id belonging to this group.
Returns:
The parameter value, or null if no entry was found.
Since:
BlackBerry API 3.6.0

getByteArray

public static byte[] getByteArray(int id)
Returns a byte array from the IT policy database.

Parameters:
id - The parameter id.
Returns:
The parameter value, or null if no entry was found.
Since:
BlackBerry API 3.6.0

getByteArray

public static byte[] getByteArray(int group,
                                  int id)
Returns a byte array from the IT policy database given the group key and ID.

Parameters:
group - The group key.
id - The parameter id that belongs to this group.
Returns:
The parameter value, or null if no entry was found.
Since:
BlackBerry API 3.6.0

getBoolean

public static boolean getBoolean(int id,
                                 boolean defaultValue)
Returns a boolean value from the IT policy database.

Parameters:
id - The parameter id.
defaultValue - The value to be returned if no entry was found.
Returns:
The parameter value.
Since:
BlackBerry API 3.6.0

getBoolean

public static boolean getBoolean(int group,
                                 int id,
                                 boolean defaultValue)
Returns a boolean value from the IT policy database given the group key, the ID and a boolean representing the default value.

Parameters:
group - The group key.
id - The parameter id belonging to this group.
defaultValue - The value to be returned if no entry was found.
Returns:
The parameter value.
Since:
BlackBerry API 3.6.0

getInteger

public static int getInteger(int id,
                             int defaultValue)
Returns an integer value from the IT policy database given the ID and default value.

Parameters:
id - The parameter id.
defaultValue - The value to be returned if no entry was found.
Returns:
The parameter value.
Since:
BlackBerry API 3.6.0

getInteger

public static int getInteger(int group,
                             int id,
                             int defaultValue)
Returns an integer value from the IT policy database.

Parameters:
group - The group key.
id - The parameter id belonging to this group.
defaultValue - The value to be returned if no entry was found.
Returns:
The parameter value.
Since:
BlackBerry API 3.6.0

getByte

public static byte getByte(int id,
                           byte defaultValue)
Returns a byte value from the IT policy database.

Parameters:
id - The parameter id.
defaultValue - The value to be returned if no entry was found.
Returns:
The parameter value.
Since:
BlackBerry API 3.6.0

getByte

public static byte getByte(int group,
                           int id,
                           byte defaultValue)
Returns a byte value from the IT policy database.

Parameters:
group - The group key.
id - The parameter id belong to this group.
defaultValue - The value to be returned if no entry was found.
Returns:
The parameter value.
Since:
BlackBerry API 3.6.0

addListener

public static void addListener(ITPolicyListener listener)
Adds a listener to process ITPolicy events. The listener notifications will be processed by the calling application's event thread.

Parameters:
listener - Listener for process termination events.
Throws:
NullPointerException - if listener is null.
IllegalStateException - if this method is called when there is no Application object in the calling process.
Since:
BlackBerry API 5.0.0

addListener

public static void addListener(Application application,
                               ITPolicyListener listener)
Adds a listener to process ITPolicy events. The listener notifications will be processed by the calling application's event thread.

Parameters:
application - The application whose event thread will process the notifications sent to listener.
listener - Listener for process termination events.
Throws:
NullPointerException - if listener is null.
IllegalStateException - if this method is called when there is no Application object in the calling process.
Since:
BlackBerry API 5.0.0

removeListener

public static void removeListener(ITPolicyListener listener)
Removes listener from the calling application's list of listeners. If listener is null or is not on the calling application's list of listeners, then this method does nothing.

Parameters:
listener - Listener for process terminated events.
Throws:
IllegalStateException - If this method is called when there is no Application object in the calling process.
Since:
BlackBerry API 5.0.0

removeListener

public static void removeListener(Application application,
                                  ITPolicyListener listener)
Removes listener from the calling application's list of listeners. If listener is null or is not on the calling application's list of listeners, then this method does nothing.

Parameters:
application - The application whose event thread will no longer process the notifications sent to listener.
listener - Listener for process terminated events.
Throws:
IllegalStateException - If this method is called when there is no Application object in the calling process.
Since:
BlackBerry API 5.0.0





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.