public class LdifRecord extends BasicDirRecord
ldif-content records are largely implemented. The result of calling read with a valid ldif-content input stream is that the record will be populated with a dn and attributes with values and the stream will be left positioned at the start of the next record. The resulting record can be written as a directory record.
ldif-changes records are partially (and possibly incorrectly) implemented. deletions are complete. A delete record consists of a dn only. adds are complete. An add record is the same as a content record. modify is incomplete.
Attribute options are not yet implemented nor recognized. base64 encoded dns may be improperly converted to strings. We may need to specify the locale. (May be true of any encoded value) URL values not implemented.
While reading input we can be in a number of states. An ldif record consists of:
| Modifier and Type | Class and Description |
|---|---|
static class |
LdifRecord.Input
This class allows us to keep track of our position in the ldif file.
|
| Modifier and Type | Field and Description |
|---|---|
static String[] |
changeTypes |
changeTypeAdd, changeTypeDelete, changeTypeInvalid, changeTypeModdn, changeTypeModify| Constructor and Description |
|---|
LdifRecord()
Create an LdifRecord object ready for further processing.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Should be overriden to clear attributes.
|
ModificationItem[] |
getMods() |
boolean |
read(LdifRecord.Input in)
Read an entire ldif record from an input stream
|
void |
setMods(ModificationItem[] val) |
void |
write(Writer wtr)
Write an ldif record representing this object
|
boolean |
writeInputData(Writer wtr)
Write the data we built this from
|
getAttributesaddAttr, attrElements, attrEquals, attrValCompare, attrValCompare, contains, dnEquals, equals, equals, equals, equalsAllBut, findAttr, getAttrStr, getAttrVal, getChangeType, getDn, getIsContent, setAttr, setChangeType, setDn, setIsContentpublic static final String[] changeTypes
public LdifRecord()
public void clear()
DirRecordclear in class BasicDirRecordpublic boolean read(LdifRecord.Input in) throws Exception
in - Input object to read from input streamExceptionpublic void setMods(ModificationItem[] val)
public ModificationItem[] getMods() throws Exception
public boolean writeInputData(Writer wtr) throws Throwable
wtr - Writer to write toThrowableCopyright © 2015 Bedework. All rights reserved.