Package org.bedework.util.directory.ldif
Class Ldif
java.lang.Object
org.bedework.util.directory.common.Directory
org.bedework.util.directory.ldif.Ldif
- All Implemented Interfaces:
org.bedework.util.logging.Logged
This class provides methods to read ldif data from an input stream.
The stream is considered to be broken up into lines, starting at line 1
each of which contains an ldif item, start of attribute + value,
continuation or record terminator (null line).
Methods allow us to position in the stream, read an entire ldif record,
or convert a record to a tabular form for processing.
Various Directory methods probably have no meaning here, searches will
typically fail with an exception or be ignored.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classLdifOut - out method is called to write ldif output -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanvoidstatic voiddumpAttr(Ldif.LdifOut lo, Attribute a) static voiddumpLdif(Ldif.LdifOut lo, DirRecord rec) dumpLdif write the entire record as ldif.org.bedework.util.logging.BwLoggervoidmodify(String dn, ModificationItem[] mods) Return the next record in the input stream.voidreInit()If possible, reInit should allow reuse after a closevoidReplace an entire attribute with one containing only the given valuevoidReplace an entire attribute with one containing only the given valuesvoidReplace a single given attribute value with the given valuebooleansearchMethods inherited from class org.bedework.util.directory.common.Directory
newRecord, search, searchBase, searchOneMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, trace, warn
-
Constructor Details
-
Method Details
-
reInit
public void reInit()Description copied from class:DirectoryIf possible, reInit should allow reuse after a close -
destroy
- Specified by:
destroyin classDirectory- Throws:
NamingException- on fatal error
-
search
search- Specified by:
searchin classDirectory- Parameters:
dn- Used as the pathnamefilter- Ignoredscope- Ignored- Returns:
- false means no record(s) found. true means it's safe to call nextRecord.
- Throws:
NamingException
-
nextRecord
Return the next record in the input stream.- Specified by:
nextRecordin classDirectory- Throws:
NamingException
-
create
- Specified by:
createin classDirectory- Parameters:
rec- directory record- Returns:
- boolean true if created, false if already exists
- Throws:
NamingException- on fatal error
-
replace
Description copied from class:DirectoryReplace an entire attribute with one containing only the given value- Specified by:
replacein classDirectory- Parameters:
dn- for recordattrName- name of attributeval- new value- Throws:
NamingException- on fatal error
-
replace
Description copied from class:DirectoryReplace an entire attribute with one containing only the given values- Specified by:
replacein classDirectory- Parameters:
dn- for recordattrName- name of attributeval- new value- Throws:
NamingException- on fatal error
-
replace
public void replace(String dn, String attrName, Object oldval, Object newval) throws NamingException Description copied from class:DirectoryReplace a single given attribute value with the given value- Specified by:
replacein classDirectory- Parameters:
dn- for recordattrName- name of attributeoldval- current valuenewval- new value- Throws:
NamingException- on fatal error
-
modify
- Specified by:
modifyin classDirectory- Parameters:
dn- for recordmods- list of changes- Throws:
NamingException- on fatal error
-
dumpLdif
dumpLdif write the entire record as ldif.- Throws:
NamingException
-
dumpAttr
- Throws:
NamingException
-
close
public void close() -
getLogger
public org.bedework.util.logging.BwLogger getLogger()
-