com.memberwebs.ldapxml
Class LXReader

java.lang.Object
  extended bycom.memberwebs.ldapxml.LXReader

public class LXReader
extends java.lang.Object

Uses an LX map to read data from an LDAP directory, returning XML in a DOM format.

Version:
0.5
Author:
stef@memberwebs.com

Constructor Summary
LXReader()
          Creates a new LXReader object.
 
Method Summary
 com.novell.ldap.LDAPConnection getConnection()
          Get the LDAP connection used to retrieve data.
 LXConvert getConvert()
           
 com.memberwebs.ldapxml.map.LXMap getMap()
          Get the map that will be used to transform data.
 LXResults retrieveBlank(org.w3c.dom.Document doc)
          Retrieve a blank result set, with a properly created document, root node etc...
 org.w3c.dom.Element retrieveEntry(org.w3c.dom.Document doc, com.novell.ldap.LDAPEntry entry)
          Transform an already retrieved LDAP entry.
 org.w3c.dom.Element retrieveEntry(org.w3c.dom.Document doc, com.novell.ldap.LDAPEntry entry, LXSpecs specs)
          Transform an already retrieved LDAP entry with additional specifications.
 org.w3c.dom.Element retrieveEntry(org.w3c.dom.Document doc, java.lang.String dn)
          Retrieves a single entry from an LDAP tree.
 org.w3c.dom.Element retrieveEntry(org.w3c.dom.Document doc, java.lang.String dn, LXSpecs specs)
          Retrieves a single entry from an LDAP tree with additional specifications.
 org.w3c.dom.Element retrieveEntry(org.w3c.dom.Document doc, java.lang.String dn, java.lang.String query, LXSpecs specs)
          Retrieves a single entry from an LDAP tree with additional specifications.
 LXResults retrieveSearch(org.w3c.dom.Document doc, java.lang.String base, java.lang.String filter)
          Search for and retrieve data matching a filter.
 LXResults retrieveSearch(org.w3c.dom.Document doc, java.lang.String base, java.lang.String filter, LXSpecs specs)
           
 LXResults retrieveSearch(org.w3c.dom.Document doc, java.lang.String base, java.lang.String filter, LXSpecs specs, boolean batch)
          Search for and retrive data matching filter with additional retrieval specifications.
 void setConnection(com.novell.ldap.LDAPConnection conn)
          Set the LDAP connection to retrieve data from.
 void setConvert(LXConvert convert)
           
 void setMap(com.memberwebs.ldapxml.map.LXMap map)
          Set the LX map that will be used to transform data retrieved from the LDAP directory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LXReader

public LXReader()
Creates a new LXReader object.

Method Detail

getMap

public final com.memberwebs.ldapxml.map.LXMap getMap()
Get the map that will be used to transform data.

Returns:
The map.

setConvert

public final void setConvert(LXConvert convert)

getConvert

public final LXConvert getConvert()

setMap

public final void setMap(com.memberwebs.ldapxml.map.LXMap map)
                  throws LXException
Set the LX map that will be used to transform data retrieved from the LDAP directory.

Parameters:
map - The map.
Throws:
LXException

getConnection

public final com.novell.ldap.LDAPConnection getConnection()
Get the LDAP connection used to retrieve data.

Returns:
The connection.

setConnection

public final void setConnection(com.novell.ldap.LDAPConnection conn)
                         throws LXException
Set the LDAP connection to retrieve data from.

Parameters:
conn - The connection.
Throws:
LXException

retrieveSearch

public LXResults retrieveSearch(org.w3c.dom.Document doc,
                                java.lang.String base,
                                java.lang.String filter)
                         throws LXException,
                                com.novell.ldap.LDAPException
Search for and retrieve data matching a filter.

Parameters:
doc - The document from which to create elements.
base - Point in the LDAP tree to root search.
filter - The search filter.
Returns:
An array of retrieved elements, one for each LDAP entry found.
Throws:
LXException
com.novell.ldap.LDAPException

retrieveSearch

public LXResults retrieveSearch(org.w3c.dom.Document doc,
                                java.lang.String base,
                                java.lang.String filter,
                                LXSpecs specs)
                         throws LXException,
                                com.novell.ldap.LDAPException
Throws:
LXException
com.novell.ldap.LDAPException

retrieveSearch

public LXResults retrieveSearch(org.w3c.dom.Document doc,
                                java.lang.String base,
                                java.lang.String filter,
                                LXSpecs specs,
                                boolean batch)
                         throws LXException,
                                com.novell.ldap.LDAPException
Search for and retrive data matching filter with additional retrieval specifications.

Parameters:
doc - The document from which to create elements.
base - The point in the LDAP tree to root search.
filter - The search filter.
batch - Whether the retrieval is called in a batch and should update start and limit in specs
Returns:
An array of retrieved DOM elements, one for each LDAP entry found.
Throws:
LXException
com.novell.ldap.LDAPException

retrieveBlank

public LXResults retrieveBlank(org.w3c.dom.Document doc)
                        throws LXException
Retrieve a blank result set, with a properly created document, root node etc...

Parameters:
doc - The document from which to create elements.
Returns:
The blank result set.
Throws:
LXException

retrieveEntry

public org.w3c.dom.Element retrieveEntry(org.w3c.dom.Document doc,
                                         java.lang.String dn)
                                  throws LXException,
                                         com.novell.ldap.LDAPException
Retrieves a single entry from an LDAP tree.

Parameters:
doc - The document from which to create elements.
dn - The LDAP DN of the entry to retrieve.
Returns:
The DOM element or null if not found.
Throws:
LXException
com.novell.ldap.LDAPException

retrieveEntry

public org.w3c.dom.Element retrieveEntry(org.w3c.dom.Document doc,
                                         java.lang.String dn,
                                         LXSpecs specs)
                                  throws LXException,
                                         com.novell.ldap.LDAPException
Retrieves a single entry from an LDAP tree with additional specifications.

Parameters:
doc - The document from which to create elements.
dn - The LDAP DN of the entry to retrieve.
specs - The additional retrieval specifications.
Returns:
The DOM element or null if not found.
Throws:
LXException
com.novell.ldap.LDAPException

retrieveEntry

public org.w3c.dom.Element retrieveEntry(org.w3c.dom.Document doc,
                                         java.lang.String dn,
                                         java.lang.String query,
                                         LXSpecs specs)
                                  throws LXException,
                                         com.novell.ldap.LDAPException
Retrieves a single entry from an LDAP tree with additional specifications.

Parameters:
doc - The document from which to create elements.
dn - The LDAP DN of the entry to retrieve.
query - An ldap query to filter the entry with.
specs - The additional retrieval specifications.
Returns:
The DOM element or null if not found.
Throws:
LXException
com.novell.ldap.LDAPException

retrieveEntry

public org.w3c.dom.Element retrieveEntry(org.w3c.dom.Document doc,
                                         com.novell.ldap.LDAPEntry entry)
                                  throws LXException,
                                         com.novell.ldap.LDAPException
Transform an already retrieved LDAP entry.

Parameters:
doc - The document from which to create elements.
entry - The LDAP entry.
Returns:
The DOM element or null if not found in map.
Throws:
LXException
com.novell.ldap.LDAPException

retrieveEntry

public org.w3c.dom.Element retrieveEntry(org.w3c.dom.Document doc,
                                         com.novell.ldap.LDAPEntry entry,
                                         LXSpecs specs)
                                  throws LXException,
                                         com.novell.ldap.LDAPException
Transform an already retrieved LDAP entry with additional specifications.

Parameters:
doc - The document from which to create elements.
entry - The LDAP entry.
Returns:
The DOM element retrieved or null if not found in map.
Throws:
LXException
com.novell.ldap.LDAPException