public class StorageBackedIdPSession extends AbstractIdPSession
IdPSession for use with StorageBackedSessionManager.AbstractIdPSession.AddressFamily| Modifier and Type | Field and Description |
|---|---|
private Logger |
log
Class logger.
|
private StorageBackedSessionManager |
sessionManager
Back-reference to parent instance.
|
private int |
version
Storage version used to synchronize changes.
|
MDC_ATTRIBUTE| Constructor and Description |
|---|
StorageBackedIdPSession(StorageBackedSessionManager manager,
String sessionId,
String canonicalName,
long creationTime)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
AuthenticationResult |
addAuthenticationResult(AuthenticationResult result) |
SPSession |
addSPSession(SPSession spSession) |
void |
bindToAddress(String address) |
boolean |
checkAddress(String address) |
boolean |
checkTimeout() |
AuthenticationResult |
getAuthenticationResult(String flowId) |
Map<String,com.google.common.base.Optional<AuthenticationResult>> |
getAuthenticationResultMap() |
Set<AuthenticationResult> |
getAuthenticationResults() |
SPSession |
getSPSession(String serviceId) |
Map<String,com.google.common.base.Optional<SPSession>> |
getSPSessionMap() |
Set<SPSession> |
getSPSessions() |
private String |
getSPSessionStorageKey(String serviceId)
Convert a service identifier into a suitable key for the underlying storage service.
|
protected int |
getVersion()
Get the record version.
|
private AuthenticationResult |
loadAuthenticationResultFromStorage(String flowId)
Loads an
AuthenticationResult record from storage and deserializes it using the object
attached to the corresponding AuthenticationFlowDescriptor. |
private SPSession |
loadSPSessionFromStorage(String serviceId)
Loads a
SPSession record from storage and deserializes it using the object
registered in the attached SPSessionSerializerRegistry. |
boolean |
removeAuthenticationResult(AuthenticationResult result) |
boolean |
removeSPSession(SPSession spSession) |
private boolean |
saveAuthenticationResultToStorage(AuthenticationResult result)
Saves an
AuthenticationResult record to storage, serializing it using the object
attached to the corresponding AuthenticationFlowDescriptor. |
private boolean |
saveSPSessionToStorage(SPSession session)
Saves a
SPSession record to storage. |
void |
setLastActivityInstant(long instant) |
protected void |
setVersion(int ver)
Set the record version.
|
void |
updateAuthenticationResultActivity(AuthenticationResult result) |
private boolean |
writeToStorage()
Update the master session record based on the current contents of this object.
|
doAddAuthenticationResult, doAddSPSession, doBindToAddress, doRemoveAuthenticationResult, doRemoveSPSession, doSetLastActivityInstant, equals, getAddress, getAddressFamily, getCreationInstant, getId, getLastActivityInstant, getPrincipalName, hashCode, toString@Nonnull private final StorageBackedSessionManager sessionManager
private int version
public StorageBackedIdPSession(@Nonnull StorageBackedSessionManager manager, @Nonnull@NotEmpty String sessionId, @Nonnull@NotEmpty String canonicalName, long creationTime)
manager - parent SessionManager instancesessionId - unique ID of sessioncanonicalName - canonical name of session subjectcreationTime - creation time of session in millisecondspublic void setLastActivityInstant(@Duration@Positive
long instant)
throws SessionException
setLastActivityInstant in class AbstractIdPSessionSessionExceptionpublic boolean checkAddress(@Nonnull@NotEmpty String address) throws SessionException
checkAddress in interface IdPSessioncheckAddress in class AbstractIdPSessionSessionExceptionpublic void bindToAddress(@Nonnull@NotEmpty String address) throws SessionException
bindToAddress in class AbstractIdPSessionSessionException@Nonnull @NonnullElements @NotLive @Unmodifiable public Set<AuthenticationResult> getAuthenticationResults()
getAuthenticationResults in interface IdPSessiongetAuthenticationResults in class AbstractIdPSession@Nullable public AuthenticationResult getAuthenticationResult(@Nonnull@NotEmpty String flowId)
getAuthenticationResult in interface IdPSessiongetAuthenticationResult in class AbstractIdPSession@Nullable public AuthenticationResult addAuthenticationResult(@Nonnull AuthenticationResult result) throws SessionException
addAuthenticationResult in interface IdPSessionaddAuthenticationResult in class AbstractIdPSessionSessionExceptionpublic void updateAuthenticationResultActivity(@Nonnull AuthenticationResult result) throws SessionException
SessionExceptionpublic boolean removeAuthenticationResult(@Nonnull AuthenticationResult result) throws SessionException
removeAuthenticationResult in interface IdPSessionremoveAuthenticationResult in class AbstractIdPSessionSessionException@Nonnull @NonnullElements @NotLive @Unmodifiable public Set<SPSession> getSPSessions()
getSPSessions in interface IdPSessiongetSPSessions in class AbstractIdPSession@Nullable public SPSession getSPSession(@Nonnull@NotEmpty String serviceId)
getSPSession in interface IdPSessiongetSPSession in class AbstractIdPSession@Nullable public SPSession addSPSession(@Nonnull SPSession spSession) throws SessionException
addSPSession in interface IdPSessionaddSPSession in class AbstractIdPSessionSessionExceptionpublic boolean removeSPSession(@Nonnull SPSession spSession) throws SessionException
removeSPSession in interface IdPSessionremoveSPSession in class AbstractIdPSessionSessionExceptionpublic boolean checkTimeout()
throws SessionException
checkTimeout in interface IdPSessioncheckTimeout in class AbstractIdPSessionSessionExceptionprotected int getVersion()
protected void setVersion(int ver)
ver - version to set@Nonnull @NonnullElements @Live public Map<String,com.google.common.base.Optional<AuthenticationResult>> getAuthenticationResultMap()
getAuthenticationResultMap in class AbstractIdPSession@Nonnull @NonnullElements @Live public Map<String,com.google.common.base.Optional<SPSession>> getSPSessionMap()
getSPSessionMap in class AbstractIdPSession@Nullable private AuthenticationResult loadAuthenticationResultFromStorage(@Nonnull@NotEmpty String flowId) throws IOException
AuthenticationResult record from storage and deserializes it using the object
attached to the corresponding AuthenticationFlowDescriptor.flowId - ID of result/flow to loadIOException - if a possibly transitory storage-related error occursprivate boolean saveAuthenticationResultToStorage(@Nonnull AuthenticationResult result) throws IOException
AuthenticationResult record to storage, serializing it using the object
attached to the corresponding AuthenticationFlowDescriptor.result - the object to storeIOException - if a possibly transitory storage-related error occurs@Nullable private SPSession loadSPSessionFromStorage(@Nonnull@NotEmpty String serviceId) throws IOException
SPSession record from storage and deserializes it using the object
registered in the attached SPSessionSerializerRegistry.serviceId - ID of service for session to loadIOException - if a possibly transitory storage-related error occursprivate boolean saveSPSessionToStorage(@Nonnull SPSession session) throws IOException
SPSession record to storage.session - the object to storeIOException - if a possibly transitory storage-related error occurs@Nonnull @NotEmpty private String getSPSessionStorageKey(@Nonnull@NotEmpty String serviceId)
serviceId - the service identifierprivate boolean writeToStorage()
throws IOException
IOException - if an error occurs trying to perform an updateCopyright © 1999–2014. All rights reserved.