Class SimpleCredentialVault
- java.lang.Object
-
- org.springframework.extensions.webscripts.connector.SimpleCredentialVault
-
- All Implemented Interfaces:
java.io.Serializable,CredentialVault
public class SimpleCredentialVault extends java.lang.Object implements CredentialVault, java.io.Serializable
A simple implementation of a credential vault.Credentials can be stored and retrieved from this vault but they will be lost when the server is restarted.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Map<java.lang.String,Credentials>credentialsMapprotected java.lang.Stringidprotected RemoteConfigElementremote
-
Constructor Summary
Constructors Constructor Description SimpleCredentialVault(java.lang.String id, RemoteConfigElement remote)Instantiates a new simple credential vault.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]getStoredIds()Returns the ids for stored credentialsbooleanhasCredentials(java.lang.String endpointId)CredentialsnewCredentials(java.lang.String endpointId)Creates new credentials which are stored in this vaultvoidremove(java.lang.String endpointId)Removes credentials for a given endpoint id from the vaultCredentialsretrieve(java.lang.String endpointId)Retrieves credentials for a given endpoint id from the vaultvoidstore(Credentials credentials)Places the given credentials into the vaultjava.lang.StringtoString()
-
-
-
Field Detail
-
id
protected final java.lang.String id
-
credentialsMap
protected final java.util.Map<java.lang.String,Credentials> credentialsMap
-
remote
protected final RemoteConfigElement remote
-
-
Constructor Detail
-
SimpleCredentialVault
public SimpleCredentialVault(java.lang.String id, RemoteConfigElement remote)Instantiates a new simple credential vault.- Parameters:
id- the id
-
-
Method Detail
-
store
public void store(Credentials credentials)
Description copied from interface:CredentialVaultPlaces the given credentials into the vault- Specified by:
storein interfaceCredentialVault- Parameters:
credentials- the credentials
-
retrieve
public Credentials retrieve(java.lang.String endpointId)
Description copied from interface:CredentialVaultRetrieves credentials for a given endpoint id from the vault- Specified by:
retrievein interfaceCredentialVault- Parameters:
endpointId- the endpoint id- Returns:
- the credentials
-
remove
public void remove(java.lang.String endpointId)
Description copied from interface:CredentialVaultRemoves credentials for a given endpoint id from the vault- Specified by:
removein interfaceCredentialVault- Parameters:
endpointId- String
-
hasCredentials
public boolean hasCredentials(java.lang.String endpointId)
- Specified by:
hasCredentialsin interfaceCredentialVault- Returns:
- true if any credentials are stored for this endpoint id
-
getStoredIds
public java.lang.String[] getStoredIds()
Description copied from interface:CredentialVaultReturns the ids for stored credentials- Specified by:
getStoredIdsin interfaceCredentialVault- Returns:
- String[]
-
newCredentials
public Credentials newCredentials(java.lang.String endpointId)
Description copied from interface:CredentialVaultCreates new credentials which are stored in this vault- Specified by:
newCredentialsin interfaceCredentialVault- Parameters:
endpointId- String- Returns:
- the credentials object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-