com.arsdigita.kernel.security
Class CredentialManager

java.lang.Object
  extended bycom.arsdigita.kernel.security.CredentialManager
Direct Known Subclasses:
CookieManager, URLManager

public abstract class CredentialManager
extends Object

Provides methods for saving, retrieving, and deleting a string value from HTTP requests and responses. Used with CredentialLoginModule to get, set, and delete client authentication credentials.

Author:
Sameer Ajmani
See Also:
CredentialLoginModule

Field Summary
static String versionId
           
 
Constructor Summary
protected CredentialManager()
          Constructs a new CredentialManager.
 
Method Summary
protected abstract  void deleteValue()
          Deletes the credential named by getModule().getCredentialName().
protected  CredentialLoginModule getModule()
          Returns the CredentialLoginModule associated with this CredentialManager.
protected abstract  String getValue()
          Retrieves the value of the credential named by getModule().getCredentialName().
protected  void initialize(CredentialLoginModule module, javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler handler, Map shared, Map options)
          Initializes this with the login context information.
protected abstract  void setValue(String value)
          Sets the credential named by getModule().getCredentialName() to the given value.
protected abstract  boolean shouldSetValue(String value)
          Determines whether setValue() should be called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

CredentialManager

protected CredentialManager()
Constructs a new CredentialManager.

Method Detail

getModule

protected CredentialLoginModule getModule()
Returns the CredentialLoginModule associated with this CredentialManager.


initialize

protected void initialize(CredentialLoginModule module,
                          javax.security.auth.Subject subject,
                          javax.security.auth.callback.CallbackHandler handler,
                          Map shared,
                          Map options)
Initializes this with the login context information. Called by CredentialLoginModule.initialize().

Parameters:
module - the CredentialLoginModule associated with this CredentialManager.

getValue

protected abstract String getValue()
                            throws javax.security.auth.login.LoginException
Retrieves the value of the credential named by getModule().getCredentialName().

Returns:
the credential value, never null.
Throws:
CredentialNotFoundException - if credential does not exist.
javax.security.auth.login.LoginException - if an error occurs.

shouldSetValue

protected abstract boolean shouldSetValue(String value)
                                   throws javax.security.auth.login.LoginException
Determines whether setValue() should be called.

Parameters:
value - the new value for the credential
Returns:
true if setValue() should be called
Throws:
javax.security.auth.login.LoginException - if an error occurs.

setValue

protected abstract void setValue(String value)
                          throws javax.security.auth.login.LoginException
Sets the credential named by getModule().getCredentialName() to the given value.

Parameters:
value - the new value for the credential
Throws:
javax.security.auth.login.LoginException - if an error occurs.

deleteValue

protected abstract void deleteValue()
                             throws javax.security.auth.login.LoginException
Deletes the credential named by getModule().getCredentialName().

Throws:
javax.security.auth.login.LoginException - if an error occurs.


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC