Package org.ldaptive.io
Class LdifWriter
- java.lang.Object
-
- org.ldaptive.io.LdifWriter
-
- All Implemented Interfaces:
SearchResultWriter
public class LdifWriter extends java.lang.Object implements SearchResultWriter
Writes aSearchResponse
as LDIF to aWriter
.- Author:
- Middleware Services
-
-
Constructor Summary
Constructors Constructor Description LdifWriter(java.io.Writer writer)
Creates a new ldif writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
createLdif(SearchResponse result)
Creates an LDIF using the supplied search result.protected java.lang.String
createLdifEntry(LdapEntry entry)
Creates an LDIF using the supplied ldap entry.protected java.lang.String
createSearchReference(SearchResultReference ref)
Creates an LDIF using the supplied search reference.void
write(SearchResponse result)
Writes the supplied search result to the writer.
-
-
-
Method Detail
-
write
public void write(SearchResponse result) throws java.io.IOException
Writes the supplied search result to the writer.- Specified by:
write
in interfaceSearchResultWriter
- Parameters:
result
- search result to write- Throws:
java.io.IOException
- if an error occurs using the writer
-
createLdif
protected java.lang.String createLdif(SearchResponse result)
Creates an LDIF using the supplied search result.- Parameters:
result
- search result- Returns:
- LDIF
-
createLdifEntry
protected java.lang.String createLdifEntry(LdapEntry entry)
Creates an LDIF using the supplied ldap entry.- Parameters:
entry
- ldap entry- Returns:
- LDIF
-
createSearchReference
protected java.lang.String createSearchReference(SearchResultReference ref)
Creates an LDIF using the supplied search reference.- Parameters:
ref
- search reference- Returns:
- LDIF
-
-