Class SAML2SPSessionSerializer
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.session.AbstractSPSessionSerializer
-
- net.shibboleth.idp.saml.session.impl.SAML2SPSessionSerializer
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,StorageSerializer<SPSession>
@ThreadSafeAfterInit public class SAML2SPSessionSerializer extends AbstractSPSessionSerializer
A serializer forSAML2SPSessionobjects.
-
-
Field Summary
Fields Modifier and Type Field Description private static StringACS_LOC_FIELDField name of ACS location.private static StringLOGOUT_PROP_FIELDField name of Single Logout indicator.private static StringNAMEID_FIELDField name of NameID.private static Map<String,Object>NO_XML_DECL_PARAMSDOM configuration parameters used by LSSerializer to exclude XML declaration.private ParserPoolparserPoolParser for NameID fields.private static StringSESSION_INDEX_FIELDField name of SessionIndex.
-
Constructor Summary
Constructors Constructor Description SAML2SPSessionSerializer(Duration offset)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SPSessiondoDeserialize(javax.json.JsonObject obj, String id, Instant creation, Instant expiration)Implement this method to return the appropriate type of object, populated with the basic information supplied.protected voiddoSerializeAdditional(SPSession instance, javax.json.stream.JsonGenerator generator)Override this method to handle serialization of additional data.voidsetParserPool(ParserPool pool)Set theParserPoolto use.-
Methods inherited from class net.shibboleth.idp.session.AbstractSPSessionSerializer
deserialize, serialize
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, isInitialized
-
-
-
-
Field Detail
-
NAMEID_FIELD
@Nonnull @NotEmpty private static final String NAMEID_FIELD
Field name of NameID.- See Also:
- Constant Field Values
-
SESSION_INDEX_FIELD
@Nonnull @NotEmpty private static final String SESSION_INDEX_FIELD
Field name of SessionIndex.- See Also:
- Constant Field Values
-
ACS_LOC_FIELD
@Nonnull @NotEmpty private static final String ACS_LOC_FIELD
Field name of ACS location.- See Also:
- Constant Field Values
-
LOGOUT_PROP_FIELD
@Nonnull @NotEmpty private static final String LOGOUT_PROP_FIELD
Field name of Single Logout indicator.- See Also:
- Constant Field Values
-
NO_XML_DECL_PARAMS
@Nonnull private static final Map<String,Object> NO_XML_DECL_PARAMS
DOM configuration parameters used by LSSerializer to exclude XML declaration.
-
parserPool
@Nonnull private ParserPool parserPool
Parser for NameID fields.
-
-
Constructor Detail
-
SAML2SPSessionSerializer
public SAML2SPSessionSerializer(@Nonnull @ParameterName(name="offset") Duration offset)
Constructor.- Parameters:
offset- time to subtract from record expiration to establish session expiration value
-
-
Method Detail
-
setParserPool
public void setParserPool(@Nonnull ParserPool pool)Set theParserPoolto use.- Parameters:
pool- parser source
-
doSerializeAdditional
protected void doSerializeAdditional(@Nonnull SPSession instance, @Nonnull javax.json.stream.JsonGenerator generator)Override this method to handle serialization of additional data.The serialization "context" is the continuation of a JSON struct.
- Overrides:
doSerializeAdditionalin classAbstractSPSessionSerializer- Parameters:
instance- object to serializegenerator- JSON generator to write to
-
doDeserialize
@Nonnull protected SPSession doDeserialize(@Nonnull javax.json.JsonObject obj, @Nonnull @NotEmpty String id, @Nonnull Instant creation, @Nonnull Instant expiration) throws IOException
Implement this method to return the appropriate type of object, populated with the basic information supplied.The JSON object supplied is a structure that may contain additional data created by the concrete subclass during serialization.
- Specified by:
doDeserializein classAbstractSPSessionSerializer- Parameters:
obj- JSON structure to parseid- the identifier of the service associated with this sessioncreation- creation time of sessionexpiration- expiration time of session- Returns:
- the newly constructed object
- Throws:
IOException- if an error occurs during deserialization
-
-