Class IdPAttributePrincipalSerializer

  • All Implemented Interfaces:
    net.shibboleth.idp.authn.principal.PrincipalSerializer<String>, net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.InitializableComponent

    @ThreadSafe
    public class IdPAttributePrincipalSerializer
    extends net.shibboleth.idp.authn.principal.AbstractPrincipalSerializer<String>
    Principal serializer for IdPAttributePrincipal.
    • Field Detail

      • PRINCIPAL_NAME_FIELD

        @Nonnull
        @NotEmpty
        private static final String PRINCIPAL_NAME_FIELD
        Field name of principal name.
        See Also:
        Constant Field Values
      • PRINCIPAL_ENTRY_FIELD

        @Nonnull
        @NotEmpty
        private static final String PRINCIPAL_ENTRY_FIELD
        Field name of principal entry.
        See Also:
        Constant Field Values
      • EMPTY_VALUE_FIELD

        @Nonnull
        @NotEmpty
        private static final String EMPTY_VALUE_FIELD
        Field name of type code of an EmptyAttributeValue.
        See Also:
        Constant Field Values
      • STRING_VALUE_FIELD

        @Nonnull
        @NotEmpty
        private static final String STRING_VALUE_FIELD
        Field name of type code of an StringAttributeValue.
        See Also:
        Constant Field Values
      • SCOPED_VALUE_FIELD

        @Nonnull
        @NotEmpty
        private static final String SCOPED_VALUE_FIELD
        Field name of type code of an ScopedStringAttributeValue.
        See Also:
        Constant Field Values
      • JSON_PATTERN

        private static final Pattern JSON_PATTERN
        Pattern used to determine if input is supported.
      • log

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

        @Nonnull
        private final javax.json.JsonBuilderFactory objectBuilderFactory
        JSON object bulder factory.
    • Constructor Detail

      • IdPAttributePrincipalSerializer

        public IdPAttributePrincipalSerializer()
        Constructor.
    • Method Detail

      • supports

        public boolean supports​(@Nonnull
                                Principal principal)
      • supports

        public boolean supports​(@Nonnull @NotEmpty
                                String value)
      • deserialize

        @Nullable
        public net.shibboleth.idp.authn.principal.IdPAttributePrincipal deserialize​(@Nonnull @NotEmpty
                                                                                    String value)
                                                                             throws IOException
        Throws:
        IOException
      • serializeValue

        @Nonnull
        protected javax.json.JsonObject serializeValue​(@Nonnull
                                                       net.shibboleth.idp.attribute.IdPAttributeValue value)
        Serialize an attribute value and produce a JsonObject.

        Override this method to support additional value types.

        Parameters:
        value - the attribute value to serialize
        Returns:
        the object
      • deserializeValue

        @Nullable
        protected net.shibboleth.idp.attribute.IdPAttributeValue deserializeValue​(@Nonnull
                                                                                  javax.json.JsonObject object)
        Deserialize an attribute value from a JsonObject.

        Override this method to support additional value types.

        Parameters:
        object - object to deserialize
        Returns:
        the attribute value, or null
      • getJsonObjectBuilder

        @Nonnull
        private javax.json.JsonObjectBuilder getJsonObjectBuilder()
        Get a JsonObjectBuilder in a thread-safe manner.
        Returns:
        an object builder
      • getJsonArrayBuilder

        @Nonnull
        private javax.json.JsonArrayBuilder getJsonArrayBuilder()
        Get a JsonArrayBuilder in a thread-safe manner.
        Returns:
        an array builder