Class SimpleCredentialVault

java.lang.Object
org.springframework.extensions.webscripts.connector.SimpleCredentialVault
All Implemented Interfaces:
Serializable, CredentialVault

public class SimpleCredentialVault extends Object implements CredentialVault, 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:
  • Field Details

  • Constructor Details

    • SimpleCredentialVault

      public SimpleCredentialVault(String id, RemoteConfigElement remote)
      Instantiates a new simple credential vault.
      Parameters:
      id - the id
  • Method Details

    • store

      public void store(Credentials credentials)
      Description copied from interface: CredentialVault
      Places the given credentials into the vault
      Specified by:
      store in interface CredentialVault
      Parameters:
      credentials - the credentials
    • retrieve

      public Credentials retrieve(String endpointId)
      Description copied from interface: CredentialVault
      Retrieves credentials for a given endpoint id from the vault
      Specified by:
      retrieve in interface CredentialVault
      Parameters:
      endpointId - the endpoint id
      Returns:
      the credentials
    • remove

      public void remove(String endpointId)
      Description copied from interface: CredentialVault
      Removes credentials for a given endpoint id from the vault
      Specified by:
      remove in interface CredentialVault
      Parameters:
      endpointId - String
    • hasCredentials

      public boolean hasCredentials(String endpointId)
      Specified by:
      hasCredentials in interface CredentialVault
      Returns:
      true if any credentials are stored for this endpoint id
    • getStoredIds

      public String[] getStoredIds()
      Description copied from interface: CredentialVault
      Returns the ids for stored credentials
      Specified by:
      getStoredIds in interface CredentialVault
      Returns:
      String[]
    • newCredentials

      public Credentials newCredentials(String endpointId)
      Description copied from interface: CredentialVault
      Creates new credentials which are stored in this vault
      Specified by:
      newCredentials in interface CredentialVault
      Parameters:
      endpointId - String
      Returns:
      the credentials object
    • toString

      public String toString()
      Overrides:
      toString in class Object