Class LdifRecord
- All Implemented Interfaces:
Serializable
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:
- dn
- controls
- changetype
- <attributes-or-changes>
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThis class allows us to keep track of our position in the ldif file. -
Field Summary
FieldsFields inherited from class org.bedework.util.directory.common.DirRecord
changeTypeAdd, changeTypeDelete, changeTypeInvalid, changeTypeModdn, changeTypeModify -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Should be overriden to clear attributes.getMods()booleanread(LdifRecord.Input in) Read an entire ldif record from an input streamvoidsetMods(ModificationItem[] val) voidWrite an ldif record representing this objectbooleanwriteInputData(Writer wtr) Write the data we built this fromMethods inherited from class org.bedework.util.directory.common.BasicDirRecord
getAttributes, toStringMethods inherited from class org.bedework.util.directory.common.DirRecord
addAttr, attrElements, attrEquals, attrValCompare, attrValCompare, contains, dnEquals, equals, equals, equals, equalsAllBut, findAttr, getAttrStr, getAttrVal, getChangeType, getDn, getIsContent, getName, setAttr, setChangeType, setDn, setIsContent, setName
-
Field Details
-
changeTypes
-
-
Constructor Details
-
LdifRecord
public LdifRecord()Create an LdifRecord object ready for further processing.
-
-
Method Details
-
clear
public void clear()Description copied from class:DirRecordShould be overriden to clear attributes.- Overrides:
clearin classBasicDirRecord
-
read
Read an entire ldif record from an input stream- Parameters:
in- Input object to read from input stream- Returns:
- boolean true if we read some ldif data. false if there was no data
- Throws:
NamingException
-
setMods
-
getMods
- Overrides:
getModsin classDirRecord- Returns:
- ModificationItem[]
- Throws:
NamingException
-
writeInputData
Write the data we built this from- Parameters:
wtr- Writer to write to- Returns:
- boolean false for no data
- Throws:
Throwable
-
write
Write an ldif record representing this object- Parameters:
wtr- Writer to write to- Throws:
Throwable
-