Interface PrincipalSerializer<Type>

Type Parameters:
Type - the type of object handled
All Superinterfaces:
Component, InitializableComponent
All Known Implementing Classes:
AbstractPrincipalSerializer, AuthenticationResultPrincipalSerializer, GenericPrincipalSerializer, IdPAttributePrincipalSerializer, LDAPPrincipalSerializer, NameIDPrincipalSerializer, ProxyAuthenticationPrincipalSerializer, SealedPrincipalSerializer, SimplePrincipalSerializer, X500PrincipalSerializer

public interface PrincipalSerializer<Type> extends InitializableComponent
Interface for the serialization/deserialization of principals.
  • Method Details

    • supports

      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 Type 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

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

      @Nullable Principal deserialize(@Nonnull Type value) throws IOException
      Deserialize the supplied value.
      Parameters:
      value - to deserialize
      Returns:
      principal
      Throws:
      IOException - if an error occurs during deserialization