Package net.shibboleth.idp.session

# Class SPSessionSerializerRegistry

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.session.SPSessionSerializerRegistry

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`

public final class SPSessionSerializerRegistry extends AbstractInitializableComponent
A registry of mappings between a `SPSession` class and a corresponding `StorageSerializer` for that type.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static class`
`SPSessionSerializerRegistry.Entry<T extends SPSession>`
Wrapper type for auto-wiring serializers.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Class logger.
`private Map<Class<? extends SPSession>,StorageSerializer<? extends SPSession>>`
`registry`
Storage for the registry mappings.

## Constructor Summary

Constructors
Constructor
Description
`SPSessionSerializerRegistry()`
Constructor.
`SPSessionSerializerRegistry(Collection<SPSessionSerializerRegistry.Entry<?>> serializers)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`<T extends SPSession>
StorageSerializer<T>`
`lookup(Class<T> type)`
Get a registered `StorageSerializer` for a given `SPSession` type, if any.
`void`
`setMappings(Map<Class<? extends SPSession>,StorageSerializer<? extends SPSession>> map)`
Set the mappings to use.

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### registry

@Nonnull private Map<Class<? extends SPSession>,StorageSerializer<? extends SPSession>> registry
Storage for the registry mappings.

## Constructor Details

### SPSessionSerializerRegistry

public SPSessionSerializerRegistry()
Constructor.

### SPSessionSerializerRegistry

@Autowired public SPSessionSerializerRegistry(@Nullable Collection<SPSessionSerializerRegistry.Entry<?>> serializers)
Constructor.

Parameters:
  `serializers` - auto-wired serializer entries
Since:
  4.1.0

## Method Details

### setMappings

public void setMappings(@Nonnull Map<Class<? extends SPSession>,StorageSerializer<? extends SPSession>> map)
Set the mappings to use.

Parameters:
  `map` - map to populate registry with

### lookup

@Nullable public <T extends SPSession> StorageSerializer<T> lookup(@Nonnull Class<T> type)
Get a registered `StorageSerializer` for a given `SPSession` type, if any.

Type Parameters:
  `T` - type of SPSession
Parameters:
  `type` - a type of SPSession
Returns:
  a corresponding StorageSerializer, or null