Interface AttributeTranscoder<T>

Type Parameters:
T - the type of object supported
All Superinterfaces:
Component, InitializableComponent
All Known Subinterfaces:
CASAttributeTranscoder, SAML1AttributeTranscoder<EncodedType>, SAML2AttributeTranscoder<EncodedType>
All Known Implementing Classes:
AbstractAttributeTranscoder, AbstractCASAttributeTranscoder, AbstractSAML1AttributeTranscoder, AbstractSAML2AttributeTranscoder, AbstractSAMLAttributeTranscoder, CASScopedStringAttributeTranscoder, CASStringAttributeTranscoder, SAML1ByteAttributeTranscoder, SAML1ScopedStringAttributeTranscoder, SAML1StringAttributeTranscoder, SAML1XMLObjectAttributeTranscoder, SAML2ByteAttributeTranscoder, SAML2ScopedStringAttributeTranscoder, SAML2StringAttributeTranscoder, SAML2XMLObjectAttributeTranscoder

@ThreadSafe
public interface AttributeTranscoder<T>
extends InitializableComponent
Transcoders are objects that support both attribute encoding and decoding for bidirectional translation between IdPAttribute format and technology-specific formats.

Implementations must take into account values of multiple types. An implementation encountering a value type it does not understand may either decide to ignore it or throw exceptions.

Transcoders implement a Predicate interface to determine their applicability to a request.

Transcoders MUST be thread-safe and stateless.

  • Method Details

    • getEncodedType

      @Nonnull Class<T> getEncodedType()
      Get the class representing the type of object supported by this transcoder.
      Returns:
      object type supported
    • getEncodedName

      @Nullable @NotEmpty String getEncodedName​(@Nonnull TranscodingRule rule)
      Get the name of the encoded object that would be created by a given set of instructions.
      Parameters:
      rule - properties governing the encoding process
      Returns:
      a canonical name for objects produced by this transcoder for the given instructions
    • encode

      @Nullable T encode​(@Nullable ProfileRequestContext profileRequestContext, @Nonnull IdPAttribute attribute, @Nonnull Class<? extends T> to, @Nonnull TranscodingRule rule) throws AttributeEncodingException
      Encode the supplied attribute into a protocol specific representation.
      Parameters:
      profileRequestContext - current profile request context
      attribute - the attribute to encode
      to - specific type of object to encode
      rule - properties governing the encoding process, principally the resulting object's naming
      Returns:
      the Object the attribute was encoded into
      Throws:
      AttributeEncodingException - if unable to successfully encode attribute
    • decode

      @Nullable IdPAttribute decode​(@Nullable ProfileRequestContext profileRequestContext, @Nonnull T input, @Nonnull TranscodingRule rule) throws AttributeDecodingException
      Decode the supplied object into a protocol-neutral representation.
      Parameters:
      profileRequestContext - current profile request context
      input - the object to decode
      rule - properties governing the decoding process, principally the resulting attribute's naming
      Returns:
      the attribute the object was decoded into
      Throws:
      AttributeDecodingException - if unable to successfully decode object