SHOW Signed
 

net.rim.device.api.ldap
Class LDAPPasswordCache

java.lang.Object
  |
  +--net.rim.device.api.ldap.LDAPPasswordCache
All Implemented Interfaces:
MemoryCleanerListener

public final class LDAPPasswordCache
extends Object
implements MemoryCleanerListener

This class maps a server to any username/password used for that server. Then when we are connecting to the same server again we will first try an existing password entry BEFORE prompting the user. Note as well that we will wipe out our cache if the memory cleaner fires.

Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

Since:
JDE 4.0.0

Field Summary
 
Fields inherited from interface net.rim.device.api.memorycleaner.MemoryCleanerListener
EVENT_DEVICE_LOCK, EVENT_IDLE_TIMEOUT, EVENT_IN_HOLSTER, EVENT_IT_POLICY_CHANGED, EVENT_MEMORY_CLEANER, EVENT_OTA_SYNC_TRANSACTION_STOPPED, EVENT_PERSISTENT_CONTENT_CLEAN, EVENT_POWER_DOWN, EVENT_PROGRAMMATIC_CLEAN, EVENT_SYNC_START, EVENT_SYNC_STOPPED, EVENT_TIME_CHANGED
 
Method Summary
 Category: Signed  boolean cleanNow(int event)
           LDAPPasswordCache Removes all passwords from the cache hash MemoryCleanerListener.EVENT_MEMORY_CLEANER MemoryCleanerListener.EVENT_DEVICE_LOCK MemoryCleanerListener.EVENT_POWER_DOWN MemoryCleanerListener.EVENT_PROGRAMMATIC_CLEAN
 Category: Signed  void cleanPassword(String server, String baseQuery)
          This method cleans out the password for the entry represented by the server and baseQuery passed into this method.
 Category: Signed  String getDescription()
          Invoked when the memory cleaner application must display a string about the type of listener being cleaned.
 Category: Signed static LDAPPasswordCache getInstance()
          Returns the instance of the LDAPPasswordCache.
 Category: Signed  String getPassword(String server, String baseQuery)
          Returns the password associated with the server and base query.
 Category: Signed  String getUserDN(String server, String baseQuery)
          Returns the userDN associated with the server and base query.
 Category: Signed  void setPassword(String server, String baseQuery, String userDN, String password)
          Sets the username and password associated with the server and baseQuery passed into this method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

cleanNow

public boolean cleanNow(int event)
LDAPPasswordCache Removes all passwords from the cache hash MemoryCleanerListener.EVENT_MEMORY_CLEANER MemoryCleanerListener.EVENT_DEVICE_LOCK MemoryCleanerListener.EVENT_POWER_DOWN MemoryCleanerListener.EVENT_PROGRAMMATIC_CLEAN
Since:
JDE 4.0.0

Following copied from interface: MemoryCleanerListener
Parameters:
event - Constant describing the specific event (one of the defined EVENT_* fields in this class).
Returns:
True if any objects were released (hence requiring a GC); otherwise, false.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

cleanPassword

public void cleanPassword(String server,
                          String baseQuery)
                   throws IllegalArgumentException
This method cleans out the password for the entry represented by the server and baseQuery passed into this method.
Parameters:
server - the string representing the server to use for finding the password.
baseQuery - the string representing the base query to use for finding the password.
Throws:
IllegalArgumentException - thrown if the server or baseQuery are null.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getDescription

public String getDescription()
Description copied from interface: MemoryCleanerListener
Invoked when the memory cleaner application must display a string about the type of listener being cleaned.
Since:
JDE 4.0.0

Following copied from interface: MemoryCleanerListener
Returns:
A textual description the MemoryCleaner application can show to the user; if null, it will not be shown in the memory cleaner application but it will still be called to clean.
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getInstance

public static LDAPPasswordCache getInstance()
Returns the instance of the LDAPPasswordCache.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getPassword

public String getPassword(String server,
                          String baseQuery)
                   throws IllegalArgumentException
Returns the password associated with the server and base query. If no password exists for that server and base query then null is returned from this method.
Parameters:
server - the server to retrieve the password for.
baseQuery - the baseQuery to retrieve the password for.
Throws:
IllegalArgumentException - if any of the parameters are null.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

getUserDN

public String getUserDN(String server,
                        String baseQuery)
                 throws IllegalArgumentException
Returns the userDN associated with the server and base query. If no userDN exists for that server and base query then null is returned from this method.
Parameters:
server - the server to retrieve the userDN for.
baseQuery - the baseQuery to retrieve the userDN for.
Throws:
IllegalArgumentException - if any of the parameters are null.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.

setPassword

public void setPassword(String server,
                        String baseQuery,
                        String userDN,
                        String password)
                 throws IllegalArgumentException
Sets the username and password associated with the server and baseQuery passed into this method.
Parameters:
server - the server to associate with the username and password.
baseQuery - the baseQuery to associate with the username and password.
userDN - the user distinguished name for this server.
password - the password for this server.
Throws:
IllegalArgumentException - if any of the parameters are null.
Since:
JDE 4.0.0
Category:
Signed: This element is only accessible by signed applications. If you intend to use this element, please visit http://www.blackberry.com/go/codesigning to obtain a set of code signing keys. Code signing is only required for applications running on BlackBerry smartphones; development on BlackBerry Smartphone Simulators can occur without code signing.



Copyright 1999-2009 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.