public class ScriptedIdPAttributeImpl extends Object implements ScriptedIdPAttribute
IdPAttribute and also a lot of the V2 backwards compatibility stuff. | Modifier and Type | Field and Description |
|---|---|
private Collection<Object> |
attributeValues
All the
StringAttributeValue, but as strings.All other attributes as their native representation. |
private boolean |
calledGetNativeAttribute
has method
getNativeAttribute() be called. |
private IdPAttribute |
encapsulatedAttribute
The
IdPAttribute we are encapsulating. |
private org.slf4j.Logger |
log
Logger.
|
private String |
logPrefix
The prefix for logging.
|
| Constructor and Description |
|---|
ScriptedIdPAttributeImpl(IdPAttribute attribute,
String prefix)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addAsIdPAttributeValue(List<IdPAttributeValue<?>> values,
Object value)
Add the provided value to the provided list, converting
String to StringAttributeValue. |
void |
addValue(Object what)
Add the provided object to the attribute values, policing for type.
|
String |
getId()
Get the encapsulated attributeId.
|
protected String |
getLogPrefix()
The prefix for the logs.
|
IdPAttribute |
getNativeAttribute()
return the underlying attribute.
|
protected IdPAttribute |
getResultingAttribute()
Function to reconstruct the attribute after the scripting.
|
Collection<Object> |
getValues()
Return all the values, but with
StringAttributeValue values returned as strings.This method is a helper method for V2 compatibility. |
private void |
policeValueType(Object what)
Check that provided object is of type
String or IdPAttributeValue. |
private void |
setupAttributeValues()
We use an internal list of attribute values to allow the legacy use of getValues().add().
|
private final IdPAttribute encapsulatedAttribute
IdPAttribute we are encapsulating.private final org.slf4j.Logger log
private boolean calledGetNativeAttribute
getNativeAttribute() be called.private Collection<Object> attributeValues
StringAttributeValue, but as strings.getValues() method has not been
called.private final String logPrefix
public ScriptedIdPAttributeImpl(@Nonnull IdPAttribute attribute, String prefix)
attribute - the attribute we are encapsulating.prefix - the log path from the definition.private void setupAttributeValues()
@Nullable @NonnullElements public Collection<Object> getValues() throws ResolutionException
StringAttributeValue values returned as strings.getValues in interface ScriptedIdPAttributeResolutionException - if the script has called getNativeAttribute()@Nonnull public IdPAttribute getNativeAttribute() throws ResolutionException
getNativeAttribute in interface ScriptedIdPAttributeResolutionException - if the script has called getValues.@Nonnull @NotEmpty public String getId()
getId in interface ScriptedIdPAttributeprivate void addAsIdPAttributeValue(List<IdPAttributeValue<?>> values, Object value)
String to StringAttributeValue.values - the list to add to.value - the value to add. Known to be a String or an IdPAttributeValueprivate void policeValueType(@Nullable Object what) throws ResolutionException
String or IdPAttributeValue.what - value to checkResolutionException - if there is a type conflict.public void addValue(@Nullable Object what) throws ResolutionException
addValue in interface ScriptedIdPAttributewhat - a String or a IdPAttributeValue to add.ResolutionException - if the provided value is of the wrong type@Nonnull protected IdPAttribute getResultingAttribute() throws ResolutionException
getValues() has been called then this is
taken as the content and the attribute updated, otherwise the Attribute is returned.ResolutionException - if we find the wrong type.Copyright © 1999–2017 Shibboleth Consortium. All rights reserved.