Package net.shibboleth.idp.session

# Interface SessionManager

All Known Implementing Classes:
  `StorageBackedSessionManager`

@ThreadSafe public interface SessionManager
Component that manages sessions between the IdP and client devices.

## Method Summary

Modifier and Type
Method
Description
`IdPSession`
`createSession(String principalName)`
Create and return a new `IdPSession` object for a subject.
`void`
`destroySession(String sessionId, boolean unbind)`
Invalidates or otherwise removes a session from persistent storage and/or unbinds it from a client.

## Method Details

### createSession

@Nonnull IdPSession createSession(@Nonnull @NotEmpty String principalName) throws SessionException
Create and return a new `IdPSession` object for a subject.

Implementations may perform additional work to persist or associate the session with the client.

Parameters:
  `principalName` - canonical name of the subject of the session
Returns:
  the newly created session
Throws:
  `SessionException` - if the session cannot be created

### destroySession

void destroySession(@Nonnull @NotEmpty String sessionId, boolean unbind) throws SessionException
Invalidates or otherwise removes a session from persistent storage and/or unbinds it from a client.

After calling this method, no further method calls on a corresponding `IdPSession` object that may be in hand are guaranteed to function correctly. Their behavior is unspecified.

Parameters:
  `sessionId` - the unique ID of the session to destroy
  `unbind` - whether the session should be unbound from the client
Throws:
  `SessionException` - if the session cannot be destroyed