net.geant.edugain.attributes.namemappers
Class DefaultAttributeNameMapper

java.lang.Object
  extended by net.geant.edugain.attributes.namemappers.DefaultAttributeNameMapper
All Implemented Interfaces:
AttributeNameMapper

public class DefaultAttributeNameMapper
extends java.lang.Object
implements AttributeNameMapper

Default Attribute Name mapping class. Mapping is configured by XML.

Author:
Adam Lantos

Field Summary
private  java.util.Map<NamespacedAttribute,java.lang.String> backwardMapping
          Store 'backward' mapping (physical -> logical) for input attributes
private  java.util.Map<java.lang.String,NamespacedAttribute> forwardMapping
          Store 'forward' mapping (logical -> physical) for output attributes
private  org.apache.log4j.Logger log
           
 
Constructor Summary
DefaultAttributeNameMapper(AttributeMapperType configuration)
          Creates new instance.
 
Method Summary
 java.lang.String getAttributeID(java.lang.String attributeName, java.lang.String attributeNamespace)
          Make 'backward-style' mapping: get the defined ID for attribute name and namespace.
 java.lang.String getAttributeName(java.lang.String attributeID)
          Make 'forward-style' mapping: get attribute name for the defined ID.
 java.lang.String getAttributeNamespace(java.lang.String attributeID)
          Make 'forward-style' mapping: get attribute name for the defined ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private org.apache.log4j.Logger log

forwardMapping

private java.util.Map<java.lang.String,NamespacedAttribute> forwardMapping
Store 'forward' mapping (logical -> physical) for output attributes


backwardMapping

private java.util.Map<NamespacedAttribute,java.lang.String> backwardMapping
Store 'backward' mapping (physical -> logical) for input attributes

Constructor Detail

DefaultAttributeNameMapper

public DefaultAttributeNameMapper(AttributeMapperType configuration)
Creates new instance.

Parameters:
configuration -
Method Detail

getAttributeName

public java.lang.String getAttributeName(java.lang.String attributeID)
Make 'forward-style' mapping: get attribute name for the defined ID.

Specified by:
getAttributeName in interface AttributeNameMapper
Parameters:
attributeID -
Returns:

getAttributeNamespace

public java.lang.String getAttributeNamespace(java.lang.String attributeID)
Make 'forward-style' mapping: get attribute name for the defined ID.

Specified by:
getAttributeNamespace in interface AttributeNameMapper
Parameters:
attributeID -
Returns:

getAttributeID

public java.lang.String getAttributeID(java.lang.String attributeName,
                                       java.lang.String attributeNamespace)
Make 'backward-style' mapping: get the defined ID for attribute name and namespace.

Specified by:
getAttributeID in interface AttributeNameMapper
Parameters:
attributeName -
attributeNamespace -
Returns: