net.geant.edugain.attributes.namemappers
Interface AttributeNameMapper

All Known Implementing Classes:
DefaultAttributeNameMapper, NoopAttributeNameMapper

public interface AttributeNameMapper

Interface for Attribute Name Mappers. These mappers are used by the AttributeSet class to manage the logical - physical attribute name mappings. The AttributeConverter configuration refers only to the logical attribute ID, because most of the time the attribute names are too long and complicated; and there can be multiple names referring to the same logical attribute. These mappers do two-way mapping between the logical attribute name (called 'attributeID') and the physical attribute names. Input attributes are mapped to the logical ID and this logical ID is used to map back to physical output attribute name / namespace. Note that the input and output physical attribute names are separated: for each attribute name / namespace there must be at most one ID, and each ID maps to exactly one output attribute name / namespace. Multiple input attributes can link to the same ID. AttributeNameMapper implementations SHOULD handle the attributeID and attributeName / attributeNamespace case insensitive (ie. returning lowercase ID and compare attribute names case insensitive).

Author:
Adam Lantos

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.
 

Method Detail

getAttributeID

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. The return value MUST be lower-cased, and input parameters MUST be treated case insensitive (eg. lower-cased before comparison). Mapper MUST NOT return NULL, when no local mapping is found, it MUST return attributeName.toLowerCase() instead.

Parameters:
attributeName -
attributeNamespace -
Returns:

getAttributeName

java.lang.String getAttributeName(java.lang.String attributeID)
Make 'forward-style' mapping: get attribute name for the defined ID. Mapper MUST return NULL when no local mapping is found.

Parameters:
attributeID -
Returns:

getAttributeNamespace

java.lang.String getAttributeNamespace(java.lang.String attributeID)
Make 'forward-style' mapping: get attribute name for the defined ID. Mapper MUST return NULL when no local mapping is found.

Parameters:
attributeID -
Returns: