org.springframework.extensions.webscripts.connector
Class AbstractAuthenticator

java.lang.Object
  extended by org.springframework.extensions.webscripts.connector.AbstractAuthenticator
All Implemented Interfaces:
Authenticator
Direct Known Subclasses:
AlfrescoAuthenticator

public abstract class AbstractAuthenticator
extends Object
implements Authenticator

Abstract implementation of an Authenticator which can be used quite readily as a base class for your own custom implementations. This abstract implementation provides helper methods for post-processing response elements such as headers. The sole authenticate method remains unimplemented.

Author:
muzquiano

Constructor Summary
AbstractAuthenticator()
           
 
Method Summary
abstract  ConnectorSession authenticate(String endpoint, Credentials credentials, ConnectorSession connectorSession)
          Authenticate against the given Endpoint URL with the supplied Credentials
abstract  boolean isAuthenticated(String endpoint, ConnectorSession connectorSession)
          Returns whether the current connector session has been authenticated or not
protected  void processResponse(Response response, ConnectorSession connectorSession)
          Retrieves headers from response and stores onto the Connector Session
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAuthenticator

public AbstractAuthenticator()
Method Detail

authenticate

public abstract ConnectorSession authenticate(String endpoint,
                                              Credentials credentials,
                                              ConnectorSession connectorSession)
                                       throws AuthenticationException
Description copied from interface: Authenticator
Authenticate against the given Endpoint URL with the supplied Credentials

Specified by:
authenticate in interface Authenticator
Returns:
The connector session instance
Throws:
AuthenticationException - on error

isAuthenticated

public abstract boolean isAuthenticated(String endpoint,
                                        ConnectorSession connectorSession)
Description copied from interface: Authenticator
Returns whether the current connector session has been authenticated or not

Specified by:
isAuthenticated in interface Authenticator
Returns:

processResponse

protected void processResponse(Response response,
                               ConnectorSession connectorSession)
Retrieves headers from response and stores onto the Connector Session

Parameters:
response -


Copyright © 2009 SpringSource, Inc. All Rights Reserved.