Class AttributeSetImpl
- java.lang.Object
-
- se.litsec.swedisheid.opensaml.saml2.attribute.AttributeSetImpl
-
- All Implemented Interfaces:
AttributeSet
public class AttributeSetImpl extends Object implements AttributeSet
A bean representing an Attribute Set as defined in Attribute Specification for the Swedish eID Framework.- Author:
- Martin Lindström (martin.lindstrom@litsec.se)
-
-
Constructor Summary
Constructors Constructor Description AttributeSetImpl()Default constructor.AttributeSetImpl(String identifier, String uri, String friendlyName, AttributeTemplate[] requiredAttributes, AttributeTemplate[] recommendedAttributes)A constructor setting all properties of this bean.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetFriendlyName()Returns the friendly name for this attribute set.StringgetIdentifier()Each attribute set within the Swedish eID Framework is assigned an unique profile identifier.AttributeTemplate[]getRecommendedAttributes()Returns the recommended attributes for this attribute setAttributeTemplate[]getRequiredAttributes()Returns the required attributes for this attribute setStringgetUri()Each attribute set within the Swedish eID Framework is assigned an unique URI.voidsetFriendlyName(String friendlyName)Assigns the friendly name for this attribute set.voidsetIdentifier(String identifier)Each attribute set within the Swedish eID Framework is assigned an unique profile identifier.voidsetRecommendedAttributes(AttributeTemplate[] recommendedAttributes)Assigns the recommended attributes for this set.voidsetRequiredAttributes(AttributeTemplate[] requiredAttributes)Assigns the required attributes for this attribute set.voidsetUri(String uri)Each attribute set within the Swedish eID Framework is assigned an unique URI.voidvalidateAttributes(Assertion assertion, List<RequestedAttribute> explicitlyRequestedAttributes)Validates the attributes received in the assertion against the attribute set.
-
-
-
Constructor Detail
-
AttributeSetImpl
public AttributeSetImpl()
Default constructor.
-
AttributeSetImpl
public AttributeSetImpl(String identifier, String uri, String friendlyName, AttributeTemplate[] requiredAttributes, AttributeTemplate[] recommendedAttributes)
A constructor setting all properties of this bean.- Parameters:
identifier- the unique profile identifieruri- the unique profile URIfriendlyName- the "friendly name" of the attribute setrequiredAttributes- the required attributes for this attribute setrecommendedAttributes- the recommended attributes for this attribute set
-
-
Method Detail
-
validateAttributes
public void validateAttributes(Assertion assertion, List<RequestedAttribute> explicitlyRequestedAttributes) throws AttributesValidationException
Validates the attributes received in the assertion against the attribute set. The validation logic is as follows:- Make sure that all the attributes that the set states as "required" are included in the assertion.
- Make sure that all explicitly requested attributes, that has the attribute isRequired set, are included in the
assertion. These requested attributes are listed in the SP metadata record as
<md:RequestedAttribute>elements.
- Specified by:
validateAttributesin interfaceAttributeSet- Parameters:
assertion- the assertion containing the attributes to validateexplicitlyRequestedAttributes- a list of explicitly requested attributes that the Service Provider has specified in its metadata record (using<md:RequestedAttribute>elements). This parameter may benullif no explicitly requested attributes exist- Throws:
AttributesValidationException- for violations of the attribute set
-
getIdentifier
public String getIdentifier()
Each attribute set within the Swedish eID Framework is assigned an unique profile identifier. This method returns this unique value.- Specified by:
getIdentifierin interfaceAttributeSet- Returns:
- the attribute set identifier
- See Also:
AttributeSet.getUri()
-
getUri
public String getUri()
Each attribute set within the Swedish eID Framework is assigned an unique URI. This method returns this value.- Specified by:
getUriin interfaceAttributeSet- Returns:
- the attribute set URI
- See Also:
AttributeSet.getIdentifier()
-
getFriendlyName
public String getFriendlyName()
Returns the friendly name for this attribute set.- Specified by:
getFriendlyNamein interfaceAttributeSet- Returns:
- the attribute set friendly name
-
getRequiredAttributes
public AttributeTemplate[] getRequiredAttributes()
Returns the required attributes for this attribute set- Specified by:
getRequiredAttributesin interfaceAttributeSet- Returns:
- an array of required attributes for this set
-
getRecommendedAttributes
public AttributeTemplate[] getRecommendedAttributes()
Returns the recommended attributes for this attribute set- Specified by:
getRecommendedAttributesin interfaceAttributeSet- Returns:
- an array of recommended attributes for this set
-
setIdentifier
public void setIdentifier(String identifier)
Each attribute set within the Swedish eID Framework is assigned an unique profile identifier. This method assigns this unique value.- Parameters:
identifier- the identifier to assign
-
setUri
public void setUri(String uri)
Each attribute set within the Swedish eID Framework is assigned an unique URI. This method assigns this unique value.- Parameters:
uri- the URI to assign
-
setFriendlyName
public void setFriendlyName(String friendlyName)
Assigns the friendly name for this attribute set.- Parameters:
friendlyName- the friendlyName to set
-
setRequiredAttributes
public void setRequiredAttributes(AttributeTemplate[] requiredAttributes)
Assigns the required attributes for this attribute set.- Parameters:
requiredAttributes- the attributes to assign
-
setRecommendedAttributes
public void setRecommendedAttributes(AttributeTemplate[] recommendedAttributes)
Assigns the recommended attributes for this set.- Parameters:
recommendedAttributes- the attributes to assign
-
-