org.springframework.extensions.webscripts.connector
Class CredentialsImpl

java.lang.Object
  extended by org.springframework.extensions.webscripts.connector.CredentialsImpl
All Implemented Interfaces:
Serializable, Credentials

public class CredentialsImpl
extends Object
implements Credentials, 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

Field Summary
protected  String endpointId
           
protected  boolean persistent
           
protected  HashMap<String,Object> properties
           
 
Fields inherited from interface org.springframework.extensions.webscripts.connector.Credentials
CREDENTIAL_PASSWORD, CREDENTIAL_USERNAME
 
Constructor Summary
CredentialsImpl(String endpointId)
          Instantiates a new user credential.
 
Method Summary
 String getEndpointId()
          Gets the endpoint id.
 Object getProperty(String key)
          Gets a given property
 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(String key)
          Removes all properties
 void removeProperty(String key)
          Removes a given property
 void setProperty(String key, Object value)
          Sets a given property
 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 String endpointId

properties

protected HashMap<String,Object> properties
Constructor Detail

CredentialsImpl

public CredentialsImpl(String endpointId)
Instantiates a new user credential.

Parameters:
endpointId - the endpoint id
Method Detail

getEndpointId

public String getEndpointId()
Description copied from interface: Credentials
Gets the endpoint id.

Specified by:
getEndpointId in interface Credentials
Returns:
the endpoint id

getProperty

public Object getProperty(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(String key,
                        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(String key)
Description copied from interface: Credentials
Removes a given property

Specified by:
removeProperty in interface Credentials

removeAllProperties

public void removeAllProperties(String key)
Description copied from interface: Credentials
Removes all properties

Specified by:
removeAllProperties in interface Credentials

getPropertyKeys

public 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:

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 SpringSource, Inc. All Rights Reserved.