Package net.shibboleth.idp.session

# Class BasicSPSession

java.lang.Object
net.shibboleth.idp.session.BasicSPSession

All Implemented Interfaces:
  `SPSession`, `Component`, `IdentifiedComponent`

Direct Known Subclasses:
  `CASSPSession`, `SAML1SPSession`, `SAML2SPSession`

@ThreadSafe public class BasicSPSession extends Object implements SPSession
Implementation support for a concrete `SPSession` implementation.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final Instant`
`creationInstant`
The time when this session was created.
`private final Instant`
`expirationInstant`
The time when this session expires.
`private final String`
`serviceId`
The unique identifier of the service.

## Constructor Summary

Constructors
Constructor
Description
`BasicSPSession(String id, Instant creation, Instant expiration)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`Instant`
`getCreationInstant()`
Get the time when this session was created.
`Instant`
`getExpirationInstant()`
Get the time when this session will expire.
`String`
`getId()`
`String`
`getProtocol()`
Get a protocol constant for the session suitable for metadata lookup.
`String`
`getSPSessionKey()`
Get a unique key identifying this subject's session with the service.
`int`
`hashCode()`
`boolean`
`supportsLogoutPropagation()`
Gets whether the session allows for logout propagation.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### serviceId

@Nonnull @NotEmpty private final String serviceId
The unique identifier of the service.

### creationInstant

@Nonnull private final Instant creationInstant
The time when this session was created.

### expirationInstant

@Nonnull private final Instant expirationInstant
The time when this session expires.

## Constructor Details

### BasicSPSession

public BasicSPSession(@Nonnull @NotEmpty String id, @Nonnull Instant creation, @Nonnull Instant expiration)
Constructor.

Parameters:
  `id` - the identifier of the service associated with this session
  `creation` - creation time of session
  `expiration` - expiration time of session

## Method Details

### getId

@Nonnull @NotEmpty public String getId()

Specified by:
  `getId` in interface `IdentifiedComponent`

### getCreationInstant

@Nonnull public Instant getCreationInstant()
Get the time when this session was created.

Specified by:
  `getCreationInstant` in interface `SPSession`
Returns:
  time when this session was created

### getExpirationInstant

@Nonnull public Instant getExpirationInstant()
Get the time when this session will expire.

Specified by:
  `getExpirationInstant` in interface `SPSession`
Returns:
  time when this session will expire

### getSPSessionKey

@Nullable public String getSPSessionKey()
Get a unique key identifying this subject's session with the service.

This will vary based on the type of session, typically based on the protocol used, but it provides a secondary lookup key that may be required in support of other use cases involving that protocol. Not all protocols may require such a key, so null may be returned.

Specified by:
  `getSPSessionKey` in interface `SPSession`
Returns:
  a unique key identifying this subject's session with the service, or null

### getProtocol

@Nullable @NotEmpty public String getProtocol()
Get a protocol constant for the session suitable for metadata lookup.

Specified by:
  `getProtocol` in interface `SPSession`
Returns:
  a protocol constant

### supportsLogoutPropagation

public boolean supportsLogoutPropagation()
Gets whether the session allows for logout propagation.

Specified by:
  `supportsLogoutPropagation` in interface `SPSession`
Returns:
  whether the session allows for logout propagation

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`