Class CredentialsImpl

  • All Implemented Interfaces:
    java.io.Serializable, Credentials

    public class CredentialsImpl
    extends java.lang.Object
    implements Credentials, java.io.Serializable
    Credentials for a given user. This stores credentials that are to be passed to a back-end service in order to authenticate. Once these credentials are used to authenticate, they may no longer be necessary as the service may hand back "endpoint credentials" which are to be used on subsequent calls. An example of a user credential might be username/password. An example of an endpoint credential might be an Alfresco ticket.
    Author:
    muzquiano
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      CredentialsImpl​(java.lang.String endpointId)
      Instantiates a new user credential.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getEndpointId()
      Gets the endpoint id.
      java.lang.Object getProperty​(java.lang.String key)
      Gets a given property
      java.lang.String[] getPropertyKeys()
      Returns the property keys
      boolean isPersistent()
      Returns whether this credential is persistent A persistent credential is written to a persistent vault.
      void removeAllProperties​(java.lang.String key)
      Removes all properties
      void removeProperty​(java.lang.String key)
      Removes a given property
      void setProperty​(java.lang.String key, java.lang.Object value)
      Sets a given property
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • persistent

        protected boolean persistent
      • endpointId

        protected java.lang.String endpointId
      • properties

        protected java.util.HashMap<java.lang.String,​java.lang.Object> properties
    • Constructor Detail

      • CredentialsImpl

        public CredentialsImpl​(java.lang.String endpointId)
        Instantiates a new user credential.
        Parameters:
        endpointId - the endpoint id
    • Method Detail

      • getEndpointId

        public java.lang.String getEndpointId()
        Description copied from interface: Credentials
        Gets the endpoint id.
        Specified by:
        getEndpointId in interface Credentials
        Returns:
        the endpoint id
      • getProperty

        public java.lang.Object getProperty​(java.lang.String key)
        Description copied from interface: Credentials
        Gets a given property
        Specified by:
        getProperty in interface Credentials
        Parameters:
        key - the key
        Returns:
        the property
      • setProperty

        public void setProperty​(java.lang.String key,
                                java.lang.Object value)
        Description copied from interface: Credentials
        Sets a given property
        Specified by:
        setProperty in interface Credentials
        Parameters:
        key - the key
        value - the value
      • removeProperty

        public void removeProperty​(java.lang.String key)
        Description copied from interface: Credentials
        Removes a given property
        Specified by:
        removeProperty in interface Credentials
        Parameters:
        key - String
      • removeAllProperties

        public void removeAllProperties​(java.lang.String key)
        Description copied from interface: Credentials
        Removes all properties
        Specified by:
        removeAllProperties in interface Credentials
        Parameters:
        key - String
      • getPropertyKeys

        public java.lang.String[] getPropertyKeys()
        Description copied from interface: Credentials
        Returns the property keys
        Specified by:
        getPropertyKeys in interface Credentials
        Returns:
        array of property keys
      • isPersistent

        public boolean isPersistent()
        Description copied from interface: Credentials
        Returns whether this credential is persistent A persistent credential is written to a persistent vault. A non-persistent credential is loaded into the vault but never stored
        Specified by:
        isPersistent in interface Credentials
        Returns:
        boolean
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object