Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.security.jps.service.credstore
Class CredentialStoreImpl

java.lang.Object
  extended by oracle.security.jps.service.credstore.CredentialStoreImpl
All Implemented Interfaces:
CredentialStore, JpsPersistable, ServiceInstance

public class CredentialStoreImpl
extends java.lang.Object
implements CredentialStore


Field Summary
static java.lang.Class CLASS_INSTANCE
           
protected static java.lang.String STORE_NAME
           
 
Constructor Summary
CredentialStoreImpl()
           
 
Method Summary
 void accept(ServiceInstanceVisitor visitor)
           
 boolean containsCredential(java.lang.String mapName, java.lang.String key)
          Returns true if an entry associated with the specified map name for this key exist in this store, false otherwise.
 boolean containsMap(java.lang.String mapName)
          Returns true if an map associated with the specified map name exist in this store, false otherwise.
 void deleteAllCredentials()
          Removes all the Credential objects from this CredentialStore
 void deleteCredential(java.lang.String mapName, java.lang.String key)
          Removes the Credential objects associated with the specified mapName and key.
 void deleteCredentialMap(java.lang.String mapName)
          Removes the CredentialMap objects associated with the specified mapName.
 Credential getCredential(java.lang.String mapName, java.lang.String key)
          Returns the Credential objects associated with the specified mapName and key.
 CredentialMap getCredentialMap(java.lang.String mapName)
          Returns the CredentialMap of Credential objects associated with the specified mapName.
 Set getMapNames()
          Returns the Set of all the available mapNames.
 java.lang.String getName()
           
 Map getProperties()
          Returns the configured properties for this instance
 void persist()
          Persists state to backing store
 void refresh()
          Refreshes state by reloading from backing store (which might have changed)
 void resetCredential(java.lang.String mapName, java.lang.String key, Credential credential)
          Overrides the Credential object for the specified mapName and key.
 void resetCredentialMap(java.lang.String mapName, CredentialMap credentialMap)
          Overrides the CredentialMap of Credential objects for the specified mapName.
 void setCredential(java.lang.String mapName, java.lang.String key, Credential credential)
          Stores the Credential object for the specified mapName and key.
 void setCredentialMap(java.lang.String mapName, CredentialMap credentialMap)
          Stores the CredentialMap of Credential objects for the specified mapName.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_INSTANCE

public static final java.lang.Class CLASS_INSTANCE

STORE_NAME

protected static final java.lang.String STORE_NAME
Constructor Detail

CredentialStoreImpl

public CredentialStoreImpl()
Method Detail

containsMap

public boolean containsMap(java.lang.String mapName)
                    throws CredStoreException
Returns true if an map associated with the specified map name exist in this store, false otherwise.

Specified by:
containsMap in interface CredentialStore
Parameters:
mapName - - The name of the map. Must be non-null and length must be greater than zero.
Returns:
true if map name exists, false otherwise
Throws:
CredStoreException - if the Credential Store has not been initialized
CredStoreRuntimeException - If invalid map name (null or empty) is passed.

getCredentialMap

public CredentialMap getCredentialMap(java.lang.String mapName)
                               throws CredStoreException
Returns the CredentialMap of Credential objects associated with the specified mapName. Returns null if this Credential map is not found.

Specified by:
getCredentialMap in interface CredentialStore
Parameters:
mapName - - The name of the map. Must be non-null and length must be greater than zero.
Returns:
Credential Map for this map name if exists, null otherwise
Throws:
CredStoreException - if the Credential Store has not been initialized
CredStoreRuntimeException - If invalid map name (null or empty) is passed.

setCredentialMap

public void setCredentialMap(java.lang.String mapName,
                             CredentialMap credentialMap)
                      throws CredentialInvalidException,
                             CredentialAlreadyExistsException,
                             CredStoreException
Stores the CredentialMap of Credential objects for the specified mapName. By default, this method always persits these credentials to store. See also store method.

Specified by:
setCredentialMap in interface CredentialStore
Parameters:
mapName - - The map name. Must be non-null and length must be greater than zero.
credentialMap - - Map of all the Credentials. Must not be null.
Throws:
CredentialInvalidException - if the credential data is not valid and can not be stored
CredentialAlreadyExistsException - if this credential already exists
CredStoreException - if the Credential Store has not been initialized properly or this credential cannot be set
CredStoreRuntimeException - If invalid map name (null or empty) is passed, or null credential map is passed.

resetCredentialMap

public void resetCredentialMap(java.lang.String mapName,
                               CredentialMap credentialMap)
                        throws CredentialInvalidException,
                               CredStoreException
Overrides the CredentialMap of Credential objects for the specified mapName. If the Map already exists, it will override it, otherwise new map will be created. By default, this method always persits these credentials to store. See also store method.

Specified by:
resetCredentialMap in interface CredentialStore
Parameters:
mapName - - The map name. Must be non-null and length must be greater than zero.
credentialMap - - Map of all the Credentials
Throws:
CredentialInvalidException - if the credential data is not valid and can not be stored
CredStoreException - if the credential store has not been initialized properly or this Credential cannot be set
CredStoreRuntimeException - If invalid map name (null or empty) is passed, or null credential map is passed.

deleteCredentialMap

public void deleteCredentialMap(java.lang.String mapName)
                         throws CredStoreException,
                                CredentialNotFoundException
Removes the CredentialMap objects associated with the specified mapName.

Specified by:
deleteCredentialMap in interface CredentialStore
Parameters:
mapName - - The name of the map. Must be non-null and length must be greater than zero.
Throws:
CredStoreException - if the Credential Store has not been initialized properly or credential cannot be deleted
CredentialNotFoundException - if this credential does not exist.
CredStoreRuntimeException - If invalid map name (null or empty) is passed.

getMapNames

public Set getMapNames()
                throws CredStoreException
Returns the Set of all the available mapNames.

Specified by:
getMapNames in interface CredentialStore
Returns:
Set of all the map names
Throws:
CredStoreException - if the Credential Store has not been initialized

deleteAllCredentials

public void deleteAllCredentials()
                          throws CredStoreException
Removes all the Credential objects from this CredentialStore

Specified by:
deleteAllCredentials in interface CredentialStore
Throws:
CredStoreException - if the Credential Store has not been initialized

toString

public java.lang.String toString()
Specified by:
toString in interface CredentialStore
Overrides:
toString in class java.lang.Object

getProperties

public Map getProperties()
Returns the configured properties for this instance

Specified by:
getProperties in interface CredentialStore

containsCredential

public boolean containsCredential(java.lang.String mapName,
                                  java.lang.String key)
                           throws CredStoreException
Returns true if an entry associated with the specified map name for this key exist in this store, false otherwise.

Specified by:
containsCredential in interface CredentialStore
Parameters:
mapName - - The name of the map. Must be non-null and length must be greater than zero.
key - - This Credential key of this map name. Must be non-null and length must be greater than zero. return true if this Credential exists, false otherwise
Throws:
CredStoreException - if the Credential Store has not been initialized
CredStoreRuntimeException - If invalid map name (null or empty) is passed.

getCredential

public Credential getCredential(java.lang.String mapName,
                                java.lang.String key)
                         throws CredentialExpiredException,
                                CredStoreException
Returns the Credential objects associated with the specified mapName and key. Returns null if this Credential is not found. This is equivalent to getCredentialMap(mapName).getCredential(key).

Specified by:
getCredential in interface CredentialStore
Parameters:
mapName - - The name of the map. Must be non-null and length must be greater than zero.
key - - The Credential key of this map name. Must be non-null and length must be greater than zero. return credetnial object if exists, null otherwise
Throws:
CredentialExpiredException - if this credential is already expired
CredStoreException - if the Credential Store has not been initialized
CredStoreRuntimeException - If invalid map name (null or empty) is passed.

setCredential

public void setCredential(java.lang.String mapName,
                          java.lang.String key,
                          Credential credential)
                   throws CredentialInvalidException,
                          CredentialAlreadyExistsException,
                          CredStoreException
Stores the Credential object for the specified mapName and key. By default, this method always persits this credential to store. See also store method. If the mapname passed is not present, it'll create a credential map with this name.

Specified by:
setCredential in interface CredentialStore
Parameters:
mapName - - The name of the map. Must be non-null and length must be greater than zero.
key - - The name of the Credential key. Must be non-null and length must be greater than zero.
credential - - The Credential object to be stored
Throws:
CredentialInvalidException - if the credential data is not valid and can not be stored
CredentialAlreadyExistsException - if this credential already exists
CredStoreException - if the Credential Store has not been initialized properly or this Credential Map cannot be set
CredStoreRuntimeException - If invalid map name (null or empty) is passed.

resetCredential

public void resetCredential(java.lang.String mapName,
                            java.lang.String key,
                            Credential credential)
                     throws CredentialInvalidException,
                            CredStoreException
Overrides the Credential object for the specified mapName and key. If the credential already exists, it will override it otherwise new credential will be created. By default, this method always persits this credential to store. See also store method. If the mapname passed is not present, it'll create a credential map with this name.

Specified by:
resetCredential in interface CredentialStore
Parameters:
mapName - - The name of the map. Must be non-null and length must be greater than zero.
key - - The name of the Credential key. Must be non-null and length must be greater than zero.
credential - - The Credential object to be stored
Throws:
CredentialInvalidException - if the credential data is not valid and can not be stored
CredStoreException - if the Credential Store has not been initialized properly or this Credential Map cannot be set
CredStoreRuntimeException - If invalid map name (null or empty) is passed.

deleteCredential

public void deleteCredential(java.lang.String mapName,
                             java.lang.String key)
                      throws CredStoreException,
                             CredentialNotFoundException
Removes the Credential objects associated with the specified mapName and key.

Specified by:
deleteCredential in interface CredentialStore
Parameters:
mapName - - The name of the map. Must be non-null and length must be greater than zero.
key - - The key for this map name. Must be non-null and length must be greater than zero.
Throws:
CredStoreException - if the Credential Store has not been initialized
CredentialNotFoundException - if this credential does not exist.
CredStoreRuntimeException - If invalid map name (null or empty) is passed.

persist

public void persist()
Persists state to backing store

Specified by:
persist in interface JpsPersistable

refresh

public void refresh()
Refreshes state by reloading from backing store (which might have changed)

Specified by:
refresh in interface JpsPersistable

accept

public void accept(ServiceInstanceVisitor visitor)
Specified by:
accept in interface ServiceInstance

getName

public java.lang.String getName()
Specified by:
getName in interface ServiceInstance

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.