Interface AttributeTranscoder<T>
- Type Parameters:
T- the type of object supported
- All Superinterfaces:
Component,InitializableComponent
- All Known Subinterfaces:
SAML1AttributeTranscoder<EncodedType>,SAML2AttributeTranscoder<EncodedType>
- All Known Implementing Classes:
AbstractAttributeTranscoder,AbstractSAML1AttributeTranscoder,AbstractSAML2AttributeTranscoder,AbstractSAMLAttributeTranscoder,SAML1ByteAttributeTranscoder,SAML1ScopedStringAttributeTranscoder,SAML1StringAttributeTranscoder,SAML1XMLObjectAttributeTranscoder,SAML2ByteAttributeTranscoder,SAML2DateTimeAttributeTranscoder,SAML2ScopedStringAttributeTranscoder,SAML2StringAttributeTranscoder,SAML2XMLObjectAttributeTranscoder
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 Summary
Modifier and TypeMethodDescriptiondecode(ProfileRequestContext profileRequestContext, T input, TranscodingRule rule) Decode the supplied object into a protocol-neutral representation.encode(ProfileRequestContext profileRequestContext, IdPAttribute attribute, Class<? extends T> to, TranscodingRule rule) Encode the supplied attribute into a protocol specific representation.Get the name of the encoded object that would be created by a given set of instructions.Get the class representing the type of object supported by this transcoder.Methods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Method Details
-
getEncodedType
Get the class representing the type of object supported by this transcoder.- Returns:
- object type supported
-
getEncodedName
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 contextattribute- the attribute to encodeto- specific type of object to encoderule- 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 contextinput- the object to decoderule- 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
-