Package edu.vt.middleware.ldap.dsml
Class AbstractDsml
- java.lang.Object
-
- edu.vt.middleware.ldap.dsml.AbstractDsml
-
- All Implemented Interfaces:
java.io.Serializable
public abstract class AbstractDsml extends java.lang.Object implements java.io.SerializableAbstractDsmlcontains functions for converting LDAP search result sets into DSML.- Version:
- $Revision: 1330 $ $Date: 2010-05-24 00:10:53 +0200 (Mon, 24 May 2010) $
- Author:
- Middleware Services
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected LdapBeanFactorybeanFactoryLdap bean factory.protected org.apache.commons.logging.LogloggerLog for this class.
-
Constructor Summary
Constructors Constructor Description AbstractDsml()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract org.dom4j.DocumentcreateDsml(LdapResult result)This will take the results of a prior LDAP query and convert it to a DSMLDocument.abstract org.dom4j.DocumentcreateDsml(java.util.Iterator<javax.naming.directory.SearchResult> results)This will take the results of a prior LDAP query and convert it to a DSMLDocument.protected org.dom4j.ElementcreateDsmlAttribute(java.lang.String attrName, java.util.Set<?> attrValues, org.dom4j.Namespace ns, java.lang.String elementName, java.lang.String elementAttrName, java.lang.String elementValueName)This will take an attribute name and it's values and return a DSML attribute element.protected java.util.List<org.dom4j.Element>createDsmlAttributes(LdapAttributes ldapAttributes, org.dom4j.Namespace ns)This will return a list of DSML attribute elements from the suppliedLdapAttributes.protected org.dom4j.ElementcreateDsmlEntry(org.dom4j.QName entryName, LdapEntry ldapEntry, org.dom4j.Namespace ns)This will take an LDAP search result and convert it to a DSML entry element.protected LdapEntrycreateLdapEntry(org.dom4j.Element entryElement)This will take a DSMLElementcontaining an entry of typeand convert it to an LDAP entry. protected abstract LdapResultcreateLdapResult(org.dom4j.Document doc)This will take a DSMLDocumentand convert it to an Iterator of LDAP search results.LdapBeanFactorygetLdapBeanFactory()Returns the factory for creating ldap beans.java.util.Iterator<javax.naming.directory.SearchResult>importDsml(java.io.Reader reader)This will take a Reader containing a DSMLDocumentand convert it to an Iterator of LDAP search results.LdapResultimportDsmlToLdapResult(java.io.Reader reader)This will take a Reader containing a DSMLDocumentand convert it to anLdapResult.voidoutputDsml(LdapResult result, java.io.Writer writer)This will write the supplied LDAP result to the supplied writer in the form of DSML.voidoutputDsml(java.util.Iterator<javax.naming.directory.SearchResult> results, java.io.Writer writer)This will write the supplied LDAP search results to the supplied writer in the form of DSML.voidsetLdapBeanFactory(LdapBeanFactory lbf)Sets the factory for creating ldap beans.
-
-
-
Field Detail
-
logger
protected final org.apache.commons.logging.Log logger
Log for this class.
-
beanFactory
protected LdapBeanFactory beanFactory
Ldap bean factory.
-
-
Method Detail
-
getLdapBeanFactory
public LdapBeanFactory getLdapBeanFactory()
Returns the factory for creating ldap beans.- Returns:
LdapBeanFactory
-
setLdapBeanFactory
public void setLdapBeanFactory(LdapBeanFactory lbf)
Sets the factory for creating ldap beans.- Parameters:
lbf-LdapBeanFactory
-
createDsml
public abstract org.dom4j.Document createDsml(java.util.Iterator<javax.naming.directory.SearchResult> results)
This will take the results of a prior LDAP query and convert it to a DSMLDocument.- Parameters:
results-Iteratorof LDAP search results- Returns:
Document
-
createDsml
public abstract org.dom4j.Document createDsml(LdapResult result)
This will take the results of a prior LDAP query and convert it to a DSMLDocument.- Parameters:
result-LdapResult- Returns:
Document
-
createDsmlEntry
protected org.dom4j.Element createDsmlEntry(org.dom4j.QName entryName, LdapEntry ldapEntry, org.dom4j.Namespace ns)This will take an LDAP search result and convert it to a DSML entry element.- Parameters:
entryName-QNamename of element to createldapEntry-LdapEntryto convertns-Namespaceof DSML- Returns:
Document
-
createDsmlAttributes
protected java.util.List<org.dom4j.Element> createDsmlAttributes(LdapAttributes ldapAttributes, org.dom4j.Namespace ns)
This will return a list of DSML attribute elements from the suppliedLdapAttributes.- Parameters:
ldapAttributes-LdapAttributesns-Namespaceof DSML- Returns:
Listof elements
-
createDsmlAttribute
protected org.dom4j.Element createDsmlAttribute(java.lang.String attrName, java.util.Set<?> attrValues, org.dom4j.Namespace ns, java.lang.String elementName, java.lang.String elementAttrName, java.lang.String elementValueName)This will take an attribute name and it's values and return a DSML attribute element.- Parameters:
attrName-StringattrValues-Setns-Namespaceof DSMLelementName-Stringof the attribute elementelementAttrName-Stringof the attribute elementelementValueName-Stringof the value element- Returns:
Element
-
outputDsml
public void outputDsml(java.util.Iterator<javax.naming.directory.SearchResult> results, java.io.Writer writer) throws java.io.IOExceptionThis will write the supplied LDAP search results to the supplied writer in the form of DSML.- Parameters:
results-Iteratorof LDAP search resultswriter-Writerto write to- Throws:
java.io.IOException- if an error occurs while writing
-
outputDsml
public void outputDsml(LdapResult result, java.io.Writer writer) throws java.io.IOException
This will write the supplied LDAP result to the supplied writer in the form of DSML.- Parameters:
result-LdapResultwriter-Writerto write to- Throws:
java.io.IOException- if an error occurs while writing
-
importDsml
public java.util.Iterator<javax.naming.directory.SearchResult> importDsml(java.io.Reader reader) throws org.dom4j.DocumentException, java.io.IOExceptionThis will take a Reader containing a DSMLDocumentand convert it to an Iterator of LDAP search results.- Parameters:
reader-Readercontaining DSML content- Returns:
Iterator- of LDAP search results- Throws:
org.dom4j.DocumentException- if an error occurs building a document from the readerjava.io.IOException- if an I/O error occurs
-
importDsmlToLdapResult
public LdapResult importDsmlToLdapResult(java.io.Reader reader) throws org.dom4j.DocumentException, java.io.IOException
This will take a Reader containing a DSMLDocumentand convert it to anLdapResult.- Parameters:
reader-Readercontaining DSML content- Returns:
LdapResult- Throws:
org.dom4j.DocumentException- if an error occurs building a document from the readerjava.io.IOException- if an I/O error occurs
-
createLdapResult
protected abstract LdapResult createLdapResult(org.dom4j.Document doc)
This will take a DSMLDocumentand convert it to an Iterator of LDAP search results.- Parameters:
doc-Documentof DSML- Returns:
Iterator- of LDAP search results
-
createLdapEntry
protected LdapEntry createLdapEntry(org.dom4j.Element entryElement)
This will take a DSMLElementcontaining an entry of typeand convert it to an LDAP entry. - Parameters:
entryElement-Elementof DSML content- Returns:
LdapEntry
-
-