edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition
Class SAML2NameIDAttributeDefinition

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.AbstractResolutionPlugIn<BaseAttribute>
      extended by edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.BaseAttributeDefinition
          extended by edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.SAML2NameIDAttributeDefinition
All Implemented Interfaces:
AttributeDefinition, ResolutionPlugIn<BaseAttribute>

public class SAML2NameIDAttributeDefinition
extends BaseAttributeDefinition

An attribute definition the creates attributes whose values are NameID. When building the NameID the textual content of the NameID is the value of the source attribute. If a nameIdQualifier is provided that value is used as the NameID's name qualifier otherwise the attribute issuer's entity ID is used. The attribute requester's entity ID is always used as the NameID's SP name qualifier.


Constructor Summary
SAML2NameIDAttributeDefinition()
          Constructor.
 
Method Summary
protected  org.opensaml.saml2.core.NameID buildNameId(String nameIdValue, ShibbolethResolutionContext resolutionContext)
          Builds a name ID.
protected  BaseAttribute<?> doResolve(ShibbolethResolutionContext resolutionContext)
          Creates and populates the values for the resolved attribute.
 String getNameIdFormat()
          Gets the format for the NameID used as an attribute value.
 String getNameIdQualifier()
          Gets the NameQualifier for the NameID used as an attribute value.
 String getNameIdSPQualifier()
          Gets the SPNameQualifier for the NameID used as an attribute value.
 void setNameIdFormat(String format)
          Sets the format for the NameID used as an attribute value.
 void setNameIdQualifier(String qualifier)
          Sets the NameQualifier for the NameID used as an attribute value.
 void setNameIdSPQualifier(String qualifier)
          Sets the SPNameQualifier for the NameID used as an attribute value.
 void validate()
          Validate the internal state of this plug-in.
 
Methods inherited from class edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.attributeDefinition.BaseAttributeDefinition
getAttributeEncoders, getDisplayDescriptions, getDisplayNames, getSourceAttributeID, getValuesFromAllDependencies, isDependencyOnly, resolve, setDependencyOnly, setSourceAttributeID
 
Methods inherited from class edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.AbstractResolutionPlugIn
getDependencyIds, getId, getValuesFromAllDependencies, getValuesFromAttributeDependency, getValuesFromConnectorDependency, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.internet2.middleware.shibboleth.common.attribute.resolver.provider.ResolutionPlugIn
getDependencyIds, getId
 

Constructor Detail

SAML2NameIDAttributeDefinition

public SAML2NameIDAttributeDefinition()
Constructor.

Method Detail

getNameIdFormat

public String getNameIdFormat()
Gets the format for the NameID used as an attribute value.

Returns:
format for the NameID used as an attribute value

setNameIdFormat

public void setNameIdFormat(String format)
Sets the format for the NameID used as an attribute value.

Parameters:
format - format for the NameID used as an attribute value

getNameIdQualifier

public String getNameIdQualifier()
Gets the NameQualifier for the NameID used as an attribute value.

Returns:
NameQualifier for the NameID used as an attribute value

setNameIdQualifier

public void setNameIdQualifier(String qualifier)
Sets the NameQualifier for the NameID used as an attribute value.

Parameters:
qualifier - NameQualifier for the NameID used as an attribute value

getNameIdSPQualifier

public String getNameIdSPQualifier()
Gets the SPNameQualifier for the NameID used as an attribute value.

Returns:
SPNameQualifier for the NameID used as an attribute value

setNameIdSPQualifier

public void setNameIdSPQualifier(String qualifier)
Sets the SPNameQualifier for the NameID used as an attribute value.

Parameters:
qualifier - SPNameQualifier for the NameID used as an attribute value

doResolve

protected BaseAttribute<?> doResolve(ShibbolethResolutionContext resolutionContext)
                              throws AttributeResolutionException
Creates and populates the values for the resolved attribute. Implementations should *not* set, or otherwise manage, the attribute encoders for the resolved attribute.

Specified by:
doResolve in class BaseAttributeDefinition
Parameters:
resolutionContext - current attribute resolution context
Returns:
resolved attribute
Throws:
AttributeResolutionException - thrown if there is a problem resolving and creating the attribute

buildNameId

protected org.opensaml.saml2.core.NameID buildNameId(String nameIdValue,
                                                     ShibbolethResolutionContext resolutionContext)
Builds a name ID. The provided value is the textual content of the NameID. The NameQualifier and SPNameQualifier are set according to the configuration, or to the local and requesting entityIDs respectively.

Parameters:
nameIdValue - value of the NameID
resolutionContext - current resolution context
Returns:
the constructed NameID

validate

public void validate()
              throws AttributeResolutionException
Validate the internal state of this plug-in. This process may not rely on information from any dependency.

Throws:
AttributeResolutionException - if the plug-in has an invalid internal state


Copyright © 2006-2011 Internet2. All Rights Reserved.