Class LdifRecord
- java.lang.Object
-
- org.bedework.util.directory.common.DirRecord
-
- org.bedework.util.directory.common.BasicDirRecord
-
- org.bedework.util.directory.ldif.LdifRecord
-
- All Implemented Interfaces:
Serializable
public class LdifRecord extends BasicDirRecord
This class represents an entire ldif record. As yet, this is an incomplete implementation. Not all aspects of ldif, as defined in RFC2849 are implemented. No schema checking is carried out by this class and only version 1 is supported. While we may later allow enforcement of the rule that only changes or content be present on a stream, for the present we will allow a mixed stream.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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classLdifRecord.InputThis class allows us to keep track of our position in the ldif file.
-
Field Summary
Fields Modifier and Type Field Description static String[]changeTypes-
Fields inherited from class org.bedework.util.directory.common.DirRecord
changeTypeAdd, changeTypeDelete, changeTypeInvalid, changeTypeModdn, changeTypeModify
-
-
Constructor Summary
Constructors Constructor Description LdifRecord()Create an LdifRecord object ready for further processing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Should be overriden to clear attributes.ModificationItem[]getMods()booleanread(LdifRecord.Input in)Read an entire ldif record from an input streamvoidsetMods(ModificationItem[] val)voidwrite(Writer wtr)Write an ldif record representing this objectbooleanwriteInputData(Writer wtr)Write the data we built this from-
Methods inherited from class org.bedework.util.directory.common.BasicDirRecord
getAttributes, toString
-
Methods 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 Detail
-
changeTypes
public static final String[] changeTypes
-
-
Method Detail
-
clear
public void clear()
Description copied from class:DirRecordShould be overriden to clear attributes.- Overrides:
clearin classBasicDirRecord
-
read
public boolean read(LdifRecord.Input in) throws NamingException
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
public void setMods(ModificationItem[] val)
-
getMods
public ModificationItem[] getMods() throws NamingException
- Overrides:
getModsin classDirRecord- Returns:
- ModificationItem[]
- Throws:
NamingException
-
writeInputData
public boolean writeInputData(Writer wtr) throws Throwable
Write the data we built this from- Parameters:
wtr- Writer to write to- Returns:
- boolean false for no data
- Throws:
Throwable
-
-