Class ConsentSerializer

  • All Implemented Interfaces:
    net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent, org.opensaml.storage.StorageSerializer<Map<String,​net.shibboleth.idp.consent.Consent>>

    public class ConsentSerializer
    extends net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
    implements org.opensaml.storage.StorageSerializer<Map<String,​net.shibboleth.idp.consent.Consent>>
    Serializes Consent.
    • Field Detail

      • IS_APPROVED_FIELD

        @Nonnull
        @NotEmpty
        private static final String IS_APPROVED_FIELD
        Field name of whether consent is approved.
        See Also:
        Constant Field Values
      • log

        @Nonnull
        private final Logger log
        Class logger.
      • generatorFactory

        @Nonnull
        private final javax.json.stream.JsonGeneratorFactory generatorFactory
        JSON generator factory.
      • readerFactory

        @Nonnull
        private final javax.json.JsonReaderFactory readerFactory
        JSON reader factory.
      • symbolics

        @Nonnull
        @NonnullElements
        private BiMap<String,​Integer> symbolics
        Shrink consent IDs into symbolic numbers.
    • Constructor Detail

      • ConsentSerializer

        public ConsentSerializer()
        Constructor.
    • Method Detail

      • setSymbolics

        public void setSymbolics​(@Nonnull @NonnullElements
                                 Map<String,​Integer> mappings)
        Set mappings of string constants to symbolic constants.
        Parameters:
        mappings - string to symbolic mappings
      • desymbolize

        @Nullable
        protected String desymbolize​(@Nonnull
                                     javax.json.JsonValue field)
        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,​net.shibboleth.idp.consent.Consent> deserialize​(long version,
                                                                                @Nonnull @NotEmpty
                                                                                String context,
                                                                                @Nonnull @NotEmpty
                                                                                String key,
                                                                                @Nonnull @NotEmpty
                                                                                String value,
                                                                                @Nullable
                                                                                Long expiration)
                                                                         throws IOException
        Specified by:
        deserialize in interface org.opensaml.storage.StorageSerializer<Map<String,​net.shibboleth.idp.consent.Consent>>
        Throws:
        IOException
      • serialize

        @Nonnull
        @NotEmpty
        public String serialize​(@Nonnull
                                Map<String,​net.shibboleth.idp.consent.Consent> consents)
                         throws IOException
        Specified by:
        serialize in interface org.opensaml.storage.StorageSerializer<Map<String,​net.shibboleth.idp.consent.Consent>>
        Throws:
        IOException