org.pentaho.platform.plugin.services.security.userrole.ldap.transform
Class SearchResultToAttrValueList

java.lang.Object
  extended by org.pentaho.platform.plugin.services.security.userrole.ldap.transform.SearchResultToAttrValueList
All Implemented Interfaces:
org.apache.commons.collections.Transformer, org.springframework.beans.factory.InitializingBean

public class SearchResultToAttrValueList
extends Object
implements org.apache.commons.collections.Transformer, org.springframework.beans.factory.InitializingBean

Extracts the value of the token tokenName from the attribute attributeName. Ignores attribute value if value is not of type String. Returns the entire attribute value if tokenName is not specified.

Note: This transformer can produce more than one output (in the form of a collection) per single input. Any client of this class should merge the results (e.g. collection.addAll(collection)) into an existing collection.

Transformer input: SearchResult instance

Transformer output: Collection of String instances

TODO refactor into searchresulttoattributelist, attributelisttosingleattribute, attributestringtoattributesubstring

Author:
mlowery

Constructor Summary
SearchResultToAttrValueList(String attributeName)
           
SearchResultToAttrValueList(String attributeName, String tokenName)
           
 
Method Summary
 void afterPropertiesSet()
           
 Object transform(Object obj)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchResultToAttrValueList

public SearchResultToAttrValueList(String attributeName)

SearchResultToAttrValueList

public SearchResultToAttrValueList(String attributeName,
                                   String tokenName)
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

transform

public Object transform(Object obj)
Specified by:
transform in interface org.apache.commons.collections.Transformer