org.lsc.jndi
Class SimpleJndiSrcService

java.lang.Object
  extended by org.lsc.jndi.AbstractSimpleJndiService
      extended by org.lsc.jndi.SimpleJndiSrcService
All Implemented Interfaces:
ISrcService

public class SimpleJndiSrcService
extends AbstractSimpleJndiService
implements ISrcService

This class is a generic but configurable implementation to get data from the directory. You can specify where (baseDn) and what (filterId & attr) information will be read on which type of entries (filterAll and attrId). TODO implements JUnit test

Author:
Sebastien Bahloul <seb@lsc-project.org>

Constructor Summary
SimpleJndiSrcService(Properties props)
          Constructor adapted to the context properties and the bean class name to instantiate.
 
Method Summary
 IBean getBean(IBean bean, Map.Entry<String,LscAttributes> ids)
          The simple object getter according to its identifier.
 JndiServices getJndiServices()
          Source LDAP Services getter.
 Map<String,LscAttributes> getListPivots()
          Get the identifiers list.
 
Methods inherited from class org.lsc.jndi.AbstractSimpleJndiService
get, getAttrs, getAttrsId, getBaseDn, getBeanFromSR, getFilterAll, getFilterId, getObjectFromSR
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleJndiSrcService

public SimpleJndiSrcService(Properties props)
Constructor adapted to the context properties and the bean class name to instantiate.

Parameters:
props - the properties used to identify the directory parameters and context
Method Detail

getBean

public final IBean getBean(IBean bean,
                           Map.Entry<String,LscAttributes> ids)
                    throws NamingException
The simple object getter according to its identifier.

Specified by:
getBean in interface ISrcService
Parameters:
bean - IBean object to fill
ids - the data identifier in the directory - must identify a unique directory entry
Returns:
The filled bean or null if an error occurred
Throws:
NamingException - thrown if an directory exception is encountered while getting the identified bean

getJndiServices

public final JndiServices getJndiServices()
Source LDAP Services getter.

Specified by:
getJndiServices in class AbstractSimpleJndiService
Returns:
the Source JndiServices object used to apply directory operations

getListPivots

public Map<String,LscAttributes> getListPivots()
                                        throws NamingException
Get the identifiers list.

Specified by:
getListPivots in interface ISrcService
Returns:
Map of DNs of all entries that are returned by the directory with an associated map of attribute names and values, never null
Throws:
NamingException - thrown if an directory exception is encountered while getting the identifiers list


Copyright © 2005-2010 LSC project. All Rights Reserved.