edu.vt.middleware.ldap.ldif
public class Ldif extends java.lang.Object implements java.io.Serializable
Ldif
contains functions for converting LDAP search result sets
into LDIF.Modifier and Type | Field and Description |
---|---|
protected LdapBeanFactory |
beanFactory
Ldap bean factory.
|
static int |
COLON_CHAR
ASCII decimal value of colon.
|
static int |
CR_CHAR
ASCII decimal value of carriage return.
|
static int |
LA_CHAR
ASCII decimal value of left arrow.
|
static int |
LF_CHAR
ASCII decimal value of line feed.
|
protected org.apache.commons.logging.Log |
logger
Log for this class.
|
static int |
MAX_ASCII_CHAR
ASCII decimal value of highest character.
|
static int |
NUL_CHAR
ASCII decimal value of nul.
|
static int |
SP_CHAR
ASCII decimal value of space.
|
Constructor and Description |
---|
Ldif() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createLdif(java.util.Iterator<javax.naming.directory.SearchResult> results)
This will take the results of a prior LDAP query and convert it to LDIF.
|
java.lang.String |
createLdif(LdapResult result)
This will take the results of a prior LDAP query and convert it to LDIF.
|
protected java.lang.String |
createLdifEntry(LdapEntry ldapEntry)
This will take an LDAP entry and convert it to LDIF.
|
LdapBeanFactory |
getLdapBeanFactory()
Returns the factory for creating ldap beans.
|
java.util.Iterator<javax.naming.directory.SearchResult> |
importLdif(java.io.Reader reader)
This will take a Reader containing an LDIF and convert it to an Iterator of
LDAP search results.
|
LdapResult |
importLdifToLdapResult(java.io.Reader reader)
This will take a Reader containing an LDIF and convert it to an
LdapResult . |
void |
outputLdif(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
LDIF form.
|
void |
outputLdif(LdapResult result,
java.io.Writer writer)
This will write the supplied LDAP search results to the supplied writer in
LDIF form.
|
void |
setLdapBeanFactory(LdapBeanFactory lbf)
Sets the factory for creating ldap beans.
|
public static final int NUL_CHAR
public static final int LF_CHAR
public static final int CR_CHAR
public static final int SP_CHAR
public static final int COLON_CHAR
public static final int LA_CHAR
public static final int MAX_ASCII_CHAR
protected final org.apache.commons.logging.Log logger
protected LdapBeanFactory beanFactory
public LdapBeanFactory getLdapBeanFactory()
LdapBeanFactory
public void setLdapBeanFactory(LdapBeanFactory lbf)
lbf
- LdapBeanFactory
public java.lang.String createLdif(java.util.Iterator<javax.naming.directory.SearchResult> results)
results
- Iterator
of LDAP search resultsString
public java.lang.String createLdif(LdapResult result)
result
- LdapResult
String
protected java.lang.String createLdifEntry(LdapEntry ldapEntry)
ldapEntry
- LdapEntry
to convertString
public void outputLdif(java.util.Iterator<javax.naming.directory.SearchResult> results, java.io.Writer writer) throws java.io.IOException
results
- Iterator
of LDAP search resultswriter
- Writer
to write tojava.io.IOException
- if an error occurs while writing to the output streampublic void outputLdif(LdapResult result, java.io.Writer writer) throws java.io.IOException
result
- LdapResult
writer
- Writer
to write tojava.io.IOException
- if an error occurs while writing to the output streampublic java.util.Iterator<javax.naming.directory.SearchResult> importLdif(java.io.Reader reader) throws java.io.IOException
reader
- Reader
containing LDIF contentIterator
- of LDAP search resultsjava.io.IOException
- if an I/O error occurspublic LdapResult importLdifToLdapResult(java.io.Reader reader) throws java.io.IOException
LdapResult
. Provides a loose implementation of RFC 2849. Should not
be used to validate LDIF format as it does not enforce strictness.reader
- Reader
containing LDIF contentLdapResult
- LDAP search resultsjava.io.IOException
- if an I/O error occursCopyright © 2014. All Rights Reserved.