Remote Systems
v6.4.1

com.ibm.etools.systems.core
Class PasswordPersistenceManager

java.lang.Object
  extended bycom.ibm.etools.systems.core.PasswordPersistenceManager

public class PasswordPersistenceManager
extends Object

PasswordPersistanceManager manages the saving and retreiving of user ID / passwords to the Eclipse keyring for registered system types. Registration is done via the com.ibm.etools.systems.core.passwordPersistence extension point.


Nested Class Summary
protected  class PasswordPersistenceManager.RegisteredSystemType
          Inner class used for storing registered system types
 
Field Summary
static String copyright
           
static String DEFAULT_SYSTEM_TYPE
           
static int RC_ALREADY_EXISTS
           
static int RC_ERROR
           
static int RC_OK
           
 
Method Summary
 int add(SystemSignonInformation info, boolean overwrite)
          Add a new persisted password to the password database.
 int add(SystemSignonInformation info, boolean overwrite, boolean updateDefault)
          Add a new persisted password to the password database.
 SystemSignonInformation find(String systemtype, String hostname, String userid)
          Find the persisted password for the specified systemtype, hostname and userid.
 SystemSignonInformation find(String systemtype, String hostname, String userid, boolean checkDefault)
          Find the persisted password for the specified systemtype, hostname and userid.
static PasswordPersistenceManager getInstance()
          Retrieve the singleton isntance of the PasswordPersistanceManger
 String[] getRegisteredSystemTypes()
          Retrieve the list of registered system types
 List getSavedUserIDs()
          Retrieve a list of the stored user IDs.
 boolean isUserIDCaseSensitive(String systemType)
          Helper method for determining if system type uses case sensitive user IDs
 boolean passwordExists(String systemtype, String hostname, String userid)
          Check if a password entry exists for the specified system type, hostname and userid.
 boolean passwordExists(String systemtype, String hostname, String userid, boolean checkDefault)
          Check if a password entry exists for the specified system type, hostname and userid.
 void remove(String systemtype, String hostname, String userid)
          Remove the entry from the keyring that matches the hostname, userid and system type parameters.
 void remove(SystemSignonInformation info)
          Remove the entry from the keyring that matches the systemtype, hostname and user ID from the SystemSignonInfo parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

RC_OK

public static final int RC_OK
See Also:
Constant Field Values

RC_ALREADY_EXISTS

public static final int RC_ALREADY_EXISTS
See Also:
Constant Field Values

RC_ERROR

public static final int RC_ERROR
See Also:
Constant Field Values

DEFAULT_SYSTEM_TYPE

public static final String DEFAULT_SYSTEM_TYPE
See Also:
Constant Field Values
Method Detail

getInstance

public static final PasswordPersistenceManager getInstance()
Retrieve the singleton isntance of the PasswordPersistanceManger


remove

public void remove(SystemSignonInformation info)
Remove the entry from the keyring that matches the systemtype, hostname and user ID from the SystemSignonInfo parameter.


remove

public void remove(String systemtype,
                   String hostname,
                   String userid)
Remove the entry from the keyring that matches the hostname, userid and system type parameters.


passwordExists

public boolean passwordExists(String systemtype,
                              String hostname,
                              String userid)
Check if a password entry exists for the specified system type, hostname and userid.


passwordExists

public boolean passwordExists(String systemtype,
                              String hostname,
                              String userid,
                              boolean checkDefault)
Check if a password entry exists for the specified system type, hostname and userid.

Parameters:
systemtype - The system type to check for.
userid - The user ID to check for.
checkDefault - Whether or not to check for a default system type if the specified system type is not found.
Since:
RSE 6.2

add

public int add(SystemSignonInformation info,
               boolean overwrite)
Add a new persisted password to the password database. This method assumes the encrypted password is already stored in the SystemSignonInformation parameter.

Parameters:
info - The signon information to store
overwrite - Whether to overwrite any existing entry
Returns:
RC_OK if the password was successfully stored RC_ALREADY_EXISTS if the password already exists and overwrite was false

add

public int add(SystemSignonInformation info,
               boolean overwrite,
               boolean updateDefault)
Add a new persisted password to the password database. This method assumes the encrypted password is already stored in the SystemSignonInformation parameter.

Parameters:
info - The signon information to store
overwrite - Whether to overwrite any existing entry
updateDefault - Whether or not to update the default entry for the specified hostname / user ID if one exists.
Returns:
RC_OK if the password was successfully stored RC_ALREADY_EXISTS if the password already exists and overwrite was false

find

public SystemSignonInformation find(String systemtype,
                                    String hostname,
                                    String userid)
Find the persisted password for the specified systemtype, hostname and userid.


find

public SystemSignonInformation find(String systemtype,
                                    String hostname,
                                    String userid,
                                    boolean checkDefault)
Find the persisted password for the specified systemtype, hostname and userid.

Parameters:
systemtype - The system type to check for.
userid - The user ID to check for.
checkDefault - Whether or not to check for a default system type if the specified system type is not found.
Since:
RSE 6.2

isUserIDCaseSensitive

public boolean isUserIDCaseSensitive(String systemType)
Helper method for determining if system type uses case sensitive user IDs


getRegisteredSystemTypes

public String[] getRegisteredSystemTypes()
Retrieve the list of registered system types


getSavedUserIDs

public List getSavedUserIDs()
Retrieve a list of the stored user IDs.

Returns:
List A list of the stored user IDs as SystemSignonInformation instances without the saved passwords.

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.