Class IdPAttributePrincipalSerializer

All Implemented Interfaces:
PrincipalSerializer<String>, Component, DestructableComponent, InitializableComponent

@ThreadSafe public class IdPAttributePrincipalSerializer extends AbstractPrincipalSerializer<String>
Principal serializer for IdPAttributePrincipal.
  • Field Details

  • Constructor Details

    • IdPAttributePrincipalSerializer

      public IdPAttributePrincipalSerializer()
      Constructor.
  • Method Details

    • supports

      public boolean supports(@Nonnull Principal principal)
      Whether the supplied principal can be serialized.
      Parameters:
      principal - to examine
      Returns:
      whether principal can be serialized
    • serialize

      @Nonnull @NotEmpty public String serialize(@Nonnull Principal principal) throws IOException
      Serialize the supplied principal.
      Parameters:
      principal - to serialize
      Returns:
      serialized value
      Throws:
      IOException - if an error occurs during serialization
    • supports

      public boolean supports(@Nonnull @NotEmpty String value)
      Whether the supplied value can be deserialized.
      Parameters:
      value - to examine
      Returns:
      whether value can be deserialized
    • deserialize

      @Nullable public IdPAttributePrincipal deserialize(@Nonnull @NotEmpty String value) throws IOException
      Deserialize the supplied value.
      Parameters:
      value - to deserialize
      Returns:
      principal
      Throws:
      IOException - if an error occurs during deserialization
    • serializeValue

      @Nonnull protected javax.json.JsonObject serializeValue(@Nonnull 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 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