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

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.TemplateAttributeDefinition
All Implemented Interfaces:
AttributeDefinition, ResolutionPlugIn<BaseAttribute>

public class TemplateAttributeDefinition
extends BaseAttributeDefinition

An AttributeDefinition that constructs its values based on the values of its dependencies using the Velocity Template Language. Dependencies may have multiple values, however multiples dependencies must have the same number of values. In the case of multi-valued dependencies, the template will be evaluated multiples times, iterating over each dependency.


Constructor Summary
TemplateAttributeDefinition(org.apache.velocity.app.VelocityEngine newVelocityEngine)
          Constructor.
 
Method Summary
protected  BaseAttribute doResolve(ShibbolethResolutionContext resolutionContext)
          Creates and populates the values for the resolved attribute.
 String getAttributeTemplate()
          Get the attribute template.
 List<String> getSourceAttributes()
          Get the source attribute IDs.
 void initialize()
          Initialize the attribute definition and prepare it for use.
protected  void registerTemplate()
          Registers the template with template engine.
 void setAttributeTemplate(String newAttributeTemplate)
          Set the attribute template.
 void setSourceAttributes(List<String> newSourceAttributes)
          Set the source attribute IDs.
 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

TemplateAttributeDefinition

public TemplateAttributeDefinition(org.apache.velocity.app.VelocityEngine newVelocityEngine)
Constructor.

Parameters:
newVelocityEngine - velocity engine used to parse template.
Method Detail

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

initialize

public void initialize()
                throws Exception
Initialize the attribute definition and prepare it for use.

Throws:
Exception - if unable to initialize attribute definition

registerTemplate

protected void registerTemplate()
Registers the template with template engine.


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

getAttributeTemplate

public String getAttributeTemplate()
Get the attribute template.

Returns:
the attribute template

setAttributeTemplate

public void setAttributeTemplate(String newAttributeTemplate)
Set the attribute template.

Parameters:
newAttributeTemplate - the attribute template

getSourceAttributes

public List<String> getSourceAttributes()
Get the source attribute IDs.

Returns:
the source attribute IDs

setSourceAttributes

public void setSourceAttributes(List<String> newSourceAttributes)
Set the source attribute IDs.

Parameters:
newSourceAttributes - the source attribute IDs


Copyright © 2006-2009 Internet2. All Rights Reserved.