|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.util.Hashtable
|
+--net.rim.device.api.util.ContentProtectedHashtable
This class provides a hashtable that will employ content protection on the values stored in the hashtable. Note that it does NOT protect the keys in the hashtable.
| Fields inherited from interface net.rim.device.api.system.PersistentContentListener |
PERSISTENT_CONTENT_LOCKED_INSECURE, PERSISTENT_CONTENT_LOCKED_SECURE, PERSISTENT_CONTENT_LOCKING, PERSISTENT_CONTENT_UNLOCKED |
| Constructor Summary | ||
|
ContentProtectedHashtable()
Creates a new, empty ContentProtectedHashtable using the default capacity and automatically protects the values in the hashtable. |
|
|
ContentProtectedHashtable(boolean protect)
Creates a new, empty ContentProtectedHashtable using the default capacity. |
|
|
ContentProtectedHashtable(Hashtable hashtable,
boolean protect)
Creates a new ContentProtectedHashtable with the contents currently found in the Hashtable passed into this method. |
|
|
ContentProtectedHashtable(int initialCapacity)
Creates a new, empty ContentProtectedHashtable using the initial capacity and automatically protects the values in the hashtable. |
|
|
ContentProtectedHashtable(int initialCapacity,
boolean protect)
Creates a new, empty ContentProtectedHashtable. |
|
| Method Summary | ||
|
boolean |
checkCrypt()
This method will return a boolean indicating if the protection setting of this hashtable matches that of the user's content protection settings. |
|
boolean |
contains(Object value)
Determines if some key maps into the specified value in this hashtable. |
|
Enumeration |
elements()
Retrieves an enumeration of the values in this hashtable. |
|
Object |
get(Object key)
Retrieves value by key. |
|
boolean |
isProtected()
This method will return a boolean indicating if the values in this hashtable are currently being protected by content protection. |
|
void |
persistentContentModeChanged(int generation)
Invoked when the persistent content mode changes. |
|
void |
persistentContentStateChanged(int state)
Invoked when the persistent content state changes. |
|
Object |
put(Object key,
Object value)
Maps value to key in this hashtable. |
|
void |
reCrypt()
This method will enable protection and cause all the current contents to be encrypted according to the user's content protection settings. |
| Methods inherited from class java.util.Hashtable |
clear, containsKey, isEmpty, keys, rehash, remove, size, toString |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ContentProtectedHashtable(boolean protect)
protect - a boolean indicating whether or not the values to be
stored in the hashtable should be encrypted when placed in the hashtable
or only when it is deemed necessary via the reCrypt call.public ContentProtectedHashtable()
public ContentProtectedHashtable(int initialCapacity)
initialCapacity - the initial capacity of the hashtable.
public ContentProtectedHashtable(int initialCapacity,
boolean protect)
initialCapacity - the initial capacity of the hashtable.protect - a boolean indicating whether or not the values to be
stored in the hashtable should be encrypted when placed in the hashtable
or only when it is deemed necessary via the reCrypt call.public ContentProtectedHashtable(Hashtable hashtable, boolean protect)
hashtable - the hashtable to use for populating the ContentProtectedHashtable.protect - a boolean indicating whether or not to encrypt the values
of the hashtable.| Method Detail |
public boolean contains(Object value)
value is a byte array, then contains() will return false.
This operation is more expensive than Hashtable.containsKey(java.lang.Object).
value - Value to search for.NullPointerException - If null value provided.public Enumeration elements()
Use the Enumeration methods on the returned object to fetch the elements sequentially.
Enumeration,
Hashtable.keys()public Object get(Object key)
key - Key in this hashtable.public Object put(Object key, Object value)
The value can be retrieved by invoking get(java.lang.Object) with a key that
is equal to the original key (as determined by Object.equals(java.lang.Object).
key - Key to associate with the value.value - Value to put into table.NullPointerException - If null key or null value.public boolean isProtected()
public boolean checkCrypt()
public void reCrypt()
public void persistentContentModeChanged(int generation)
PersistentContentListener Listeners should call PersistentContent.checkEncoding(java.lang.Object) to see
if they need to call PersistentContent.reEncode(java.lang.Object).
Listeners should periodically compare the generation parameter to
PersistentContent.getModeGeneration(). If they are different, then
the listener should terminate their checkEncoding/reEncoding loop.
persistentContentModeChanged in interface PersistentContentListenerpublic void persistentContentStateChanged(int state)
PersistentContentListener Listeners should periodically compare the state parameter to
PersistentContent.getLockGeneration(). If they are different, then
the listener may wish to terminate its processing.
persistentContentStateChanged in interface PersistentContentListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2004 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.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.