AttributeType - type of attribute producedEncodedType - the type of data that can be encoded by the encoderpublic abstract class AbstractSAMLAttributeEncoder<AttributeType extends SAMLObject,EncodedType extends IdPAttributeValue> extends AbstractInitializableComponent implements AttributeEncoder<AttributeType>, UnmodifiableComponent
| Modifier and Type | Field and Description |
|---|---|
private com.google.common.base.Predicate<ProfileRequestContext> |
activationCondition
Condition for use of this encoder.
|
private boolean |
encodeType
Whether to encode with xsi:type or not.
|
private org.slf4j.Logger |
log
Class logger.
|
private String |
name
The name of the attribute.
|
| Constructor and Description |
|---|
AbstractSAMLAttributeEncoder()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract AttributeType |
buildAttribute(IdPAttribute idpAttribute,
List<XMLObject> attributeValues)
Builds a SAML attribute element from the given attribute values.
|
protected abstract boolean |
canEncodeValue(IdPAttribute idpAttribute,
IdPAttributeValue value)
Checks if the given value can be handled by the encoder.
|
protected void |
doInitialize() |
AttributeType |
encode(IdPAttribute attribute) |
boolean |
encodeType()
Get whether to encode type information.
|
protected abstract XMLObject |
encodeValue(IdPAttribute idpAttribute,
EncodedType value)
Encodes an attribute value in to a SAML attribute value element.
|
boolean |
equals(Object obj) |
com.google.common.base.Predicate<ProfileRequestContext> |
getActivationCondition() |
String |
getName()
Get the name of the attribute.
|
int |
hashCode() |
void |
setActivationCondition(com.google.common.base.Predicate<ProfileRequestContext> condition)
Set the activation condition for this encoder.
|
void |
setEncodeType(boolean flag)
Set whether to encode type information.
|
void |
setName(String attributeName)
Set the name of the attribute.
|
destroy, doDestroy, initialize, isDestroyed, isInitializedclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetProtocol@Nonnull private final org.slf4j.Logger log
@Nonnull private com.google.common.base.Predicate<ProfileRequestContext> activationCondition
@NonnullAfterInit private String name
private boolean encodeType
@Nonnull public com.google.common.base.Predicate<ProfileRequestContext> getActivationCondition()
getActivationCondition in interface AttributeEncoder<AttributeType extends SAMLObject>public void setActivationCondition(@Nonnull com.google.common.base.Predicate<ProfileRequestContext> condition)
condition - condition to set@NonnullAfterInit public final String getName()
public void setName(@Nonnull@NotEmpty String attributeName)
attributeName - name of the attributepublic boolean encodeType()
Defaults to 'true'
public void setEncodeType(boolean flag)
flag - flag to setprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationException@Nonnull public AttributeType encode(@Nonnull IdPAttribute attribute) throws AttributeEncodingException
encode in interface AttributeEncoder<AttributeType extends SAMLObject>AttributeEncodingExceptionprotected abstract boolean canEncodeValue(@Nonnull IdPAttribute idpAttribute, @Nonnull IdPAttributeValue value)
idpAttribute - the attribute being encoded, never nullvalue - the value to check, never null@Nullable protected abstract XMLObject encodeValue(@Nonnull IdPAttribute idpAttribute, @Nonnull EncodedType value) throws AttributeEncodingException
idpAttribute - the attribute being encoded, never nullvalue - the value to encoder, never nullAttributeEncodingException - thrown if there is a problem encoding the attribute value@Nonnull protected abstract AttributeType buildAttribute(@Nonnull IdPAttribute idpAttribute, @Nonnull@NonnullElements List<XMLObject> attributeValues) throws AttributeEncodingException
idpAttribute - the attribute being encoded, never nullattributeValues - the encoded values for the attribute, never null or containing null elementsAttributeEncodingException - thrown if there is a problem constructing the SAML attributeCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.