Class ConsentSerializer
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.consent.storage.impl.ConsentSerializer
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,StorageSerializer<Map<String,Consent>>
public class ConsentSerializer
extends AbstractInitializableComponent
implements StorageSerializer<Map<String,Consent>>
Serializes
Consent.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final JsonGeneratorFactoryJSON generator factory.private static final StringField name of consent identifier.private static final StringField name of whether consent is approved.private final org.slf4j.LoggerClass logger.private final JsonReaderFactoryJSON reader factory.Shrink consent IDs into symbolic numbers.private static final StringField name of consent value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(long version, String context, String key, String value, Long expiration) protected Stringdesymbolize(JsonValue field) Map a field value to a string, either directly or via the symbolic map.voidsetSymbolics(Map<String, Integer> mappings) Set mappings of string constants to symbolic constants.Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
ID_FIELD
Field name of consent identifier.- See Also:
-
VALUE_FIELD
Field name of consent value.- See Also:
-
IS_APPROVED_FIELD
Field name of whether consent is approved.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
generatorFactory
JSON generator factory. -
readerFactory
JSON reader factory. -
symbolics
Shrink consent IDs into symbolic numbers.
-
-
Constructor Details
-
ConsentSerializer
public ConsentSerializer()Constructor.
-
-
Method Details
-
setSymbolics
Set mappings of string constants to symbolic constants.- Parameters:
mappings- string to symbolic mappings
-
desymbolize
Map a field value to a string, either directly or via the symbolic map.- Parameters:
field- the object field to examine- Returns:
- the resulting string, or null if invalid
-
deserialize
@Nonnull public Map<String,Consent> deserialize(long version, @Nonnull @NotEmpty String context, @Nonnull @NotEmpty String key, @Nonnull @NotEmpty String value, @Nullable Long expiration) throws IOException - Specified by:
deserializein interfaceStorageSerializer<Map<String,Consent>> - Throws:
IOException
-
serialize
@Nonnull @NotEmpty public String serialize(@Nonnull Map<String, Consent> consents) throws IOException- Specified by:
serializein interfaceStorageSerializer<Map<String,Consent>> - Throws:
IOException
-