org.jsecurity.subject
Class AbstractRememberMeManager
java.lang.Object
org.jsecurity.subject.AbstractRememberMeManager
- All Implemented Interfaces:
- RememberMeManager
- Direct Known Subclasses:
- WebRememberMeManager
public abstract class AbstractRememberMeManager
- extends Object
- implements RememberMeManager
Abstract implementation of the RememberMeManager interface that handles
serialization and
encryption of the remembered user identity.
The remembered identity storage location is implementation-specific.
- Since:
- 0.9
- Author:
- Les Hazlewood, Jeremy Haile
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractRememberMeManager
public AbstractRememberMeManager()
getSerializer
public Serializer getSerializer()
setSerializer
public void setSerializer(Serializer serializer)
getCipher
public Cipher getCipher()
setCipher
public void setCipher(Cipher cipher)
getEncryptionCipherKey
public byte[] getEncryptionCipherKey()
setEncryptionCipherKey
public void setEncryptionCipherKey(byte[] encryptionCipherKey)
setEncryptionCipherKeyHex
public void setEncryptionCipherKeyHex(String hex)
setEncryptionCipherKeyBase64
public void setEncryptionCipherKeyBase64(String base64)
getDecryptionCipherKey
public byte[] getDecryptionCipherKey()
setDecryptionCipherKey
public void setDecryptionCipherKey(byte[] decryptionCipherKey)
setDecryptionCipherKeyHex
public void setDecryptionCipherKeyHex(String hex)
setDecryptionCipherKeyBase64
public void setDecryptionCipherKeyBase64(String base64)
getCipherKey
public byte[] getCipherKey()
setCipherKey
public void setCipherKey(byte[] cipherKey)
setCipherKeyHex
public void setCipherKeyHex(String hex)
setCipherKeyBase64
public void setCipherKeyBase64(String base64)
rememberSerializedIdentity
protected abstract void rememberSerializedIdentity(byte[] serialized)
getSerializedRememberedIdentity
protected abstract byte[] getSerializedRememberedIdentity()
forgetIdentity
protected abstract void forgetIdentity()
isRememberMe
protected boolean isRememberMe(AuthenticationToken token)
onSuccessfulLogin
public void onSuccessfulLogin(AuthenticationToken token,
AuthenticationInfo info)
- Specified by:
onSuccessfulLogin in interface RememberMeManager
rememberIdentity
public void rememberIdentity(AuthenticationToken submittedToken,
AuthenticationInfo successfullyAuthenticated)
rememberIdentity
public void rememberIdentity(AuthenticationInfo successfullyAuthenticated)
getIdentityToRemember
protected PrincipalCollection getIdentityToRemember(AuthenticationInfo info)
rememberIdentity
protected void rememberIdentity(PrincipalCollection accountPrincipals)
getRememberedPrincipals
public PrincipalCollection getRememberedPrincipals()
- Specified by:
getRememberedPrincipals in interface RememberMeManager
onRememberedPrincipalFailure
protected PrincipalCollection onRememberedPrincipalFailure(Exception e)
- Called when an exception is thrown while trying to retrieve principals. The default implementation logs a
warning and forgets the problem identity. This most commonly would occur when an encryption key is
updated and old principals are retrieved that have been encrypted with the previous key.
- Parameters:
e - the exception that was thrown.
- Returns:
- the principal collection to be returned.
encrypt
protected byte[] encrypt(byte[] serialized)
decrypt
protected byte[] decrypt(byte[] encrypted)
serialize
protected byte[] serialize(PrincipalCollection principals)
deserialize
protected PrincipalCollection deserialize(byte[] serializedIdentity)
onFailedLogin
public void onFailedLogin(AuthenticationToken token,
AuthenticationException ae)
- Specified by:
onFailedLogin in interface RememberMeManager
onLogout
public void onLogout(PrincipalCollection subjectPrincipals)
- Specified by:
onLogout in interface RememberMeManager
forgetIdentity
protected void forgetIdentity(AuthenticationToken token,
AuthenticationException ae)
forgetIdentity
protected void forgetIdentity(AuthenticationToken token)
Copyright © 2004-2008 JSecurity.