|
All LDAP Classes Internal LDAP Classes |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.novell.ldap.util.LDIFReader
public class LDIFReader
The class to process the inputStream object to read an LDIF file.
This calss reads LDAP entries and LDAP Requests form an LDIF file
The constructors uses a default size value of 8,192 to create the buffering character-input stream and assume that the size is big enough to hold the dn field and the first line of the next field of the first record in the LDIF file currently being read.
The constructors uses '1' as default LDIF file version
Field Summary | |
---|---|
private java.io.BufferedReader |
bufReader
|
private byte[] |
bytes
|
private java.util.ArrayList |
cList
|
private boolean |
control
|
private LDAPControl[] |
controls
|
private LDAPEntry |
currentEntry
|
private LDAPMessage |
currentRequest
|
private int |
dnlNumber
|
private java.lang.String |
entryDN
|
private int |
fNumber
|
private int |
lNumber
|
private java.lang.String[] |
modInfo
|
private LDAPModification[] |
mods
|
private int |
reqType
|
private boolean |
requestFile
|
private java.util.ArrayList |
rFields
|
private java.lang.String |
version
|
Constructor Summary | |
---|---|
LDIFReader(java.io.InputStream in)
Constructs an LDIFReader object by initializing LDIF_VERSION, isRequest, InputStreamReader, and BufferedReader. |
|
LDIFReader(java.io.InputStream in,
int version)
Constructs an LDIFReader object by initializing LDIF_VERSION, isRequest, InputStreamReader, and BufferedReader. |
|
LDIFReader(java.io.InputStream in,
int version,
int bufSize)
Constructs an LDIFReader object by initializing LDIF_VERSION, isRequest, InputStreamReader, and BufferedReader. |
Method Summary | |
---|---|
java.lang.String |
getVersion()
Gets the version of the LDIF data associated with the input stream |
private int |
IndexOf(java.lang.StringBuffer bl,
int ch)
Returns the index within this StringBuffer object of the first occurence of the specified char. |
boolean |
isRequest()
Returns true if request data ist associated with the input stream, or false if content data. |
LDAPMessage |
readMessage()
Read LDAP Requests from the LDIF request (change) file or content file. |
private void |
readRecordFields()
Read all lines in the current record, convert record lines to the record fields, and trim off extra spaces in record fields. |
private void |
setRequest(boolean type)
Sets the request type of the file being read, true if request data or false if content data. |
private void |
setVersion(int value)
Gets the version of the LDIF data associated with the input stream |
private void |
toLDAPEntry()
Process LDIF record fields to generate an LDAPEntry. |
private void |
toLDAPModifications()
Build LDAPModification array based on the content of LDIF modify record. |
private void |
toModInfo()
Build String array object that contains moddn information. |
private void |
toRecordProperties()
Set record properties. |
private java.lang.StringBuffer |
trimField(java.lang.StringBuffer line)
trimField trims off extra spaces in a field. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean requestFile
private java.lang.String version
private int reqType
private int lNumber
private int dnlNumber
private int fNumber
private byte[] bytes
private boolean control
private java.lang.String entryDN
private java.lang.String[] modInfo
private java.util.ArrayList rFields
private java.util.ArrayList cList
private java.io.BufferedReader bufReader
private LDAPControl[] controls
private LDAPEntry currentEntry
private LDAPModification[] mods
private LDAPMessage currentRequest
Constructor Detail |
---|
public LDIFReader(java.io.InputStream in) throws java.io.IOException, LDAPLocalException
in
- The InputStream object to be processed by LDIFReader
java.io.IOException
LDAPLocalException
public LDIFReader(java.io.InputStream in, int version) throws java.io.IOException, LDAPLocalException
in
- The Inputstream object to be processed by LDIFReaderversion
- The version currently used in the LDIF file
java.io.IOException
LDAPLocalException
public LDIFReader(java.io.InputStream in, int version, int bufSize) throws java.io.IOException, LDAPLocalException
in
- The Inputstream object to be processed by LDIFReaderversion
- The version currently used in the LDIF filebufSize
- The size used to create a buffering character-input
stream. The defaule value is 8,192.
java.io.IOException
LDAPLocalException
Method Detail |
---|
public java.lang.String getVersion()
getVersion
in interface LDAPReader
private void setVersion(int value)
value
- the version numberpublic boolean isRequest()
isRequest
in interface LDAPReader
private void setRequest(boolean type)
type
- sets the type of file to content or request data.public LDAPMessage readMessage() throws java.io.IOException, LDAPException
readMessage
in interface LDAPReader
java.io.IOException
LDAPException
private void readRecordFields() throws java.io.IOException, LDAPException
java.io.IOException
LDAPException
private void toRecordProperties() throws java.io.IOException, LDAPException
For LDIF content record, LDAPEntry specidfied by this record is created
For LDIF change record, depending on the request type, either LDAPEntry, modInfo, or LDAPModifiction array along with the controls associated with the request are created
java.io.IOException
LDAPException
private void toLDAPEntry() throws LDAPLocalException
LDAPLocalException
private void toModInfo() throws LDAPLocalException
LDAPLocalException
private void toLDAPModifications() throws LDAPLocalException
LDAPLocalException
private int IndexOf(java.lang.StringBuffer bl, int ch)
bl
- The StringBuffer objectch
- The character to look for in the StringBuffer object
private java.lang.StringBuffer trimField(java.lang.StringBuffer line) throws LDAPLocalException
LDAPLocalException
|
All LDAP Classes Internal LDAP Classes |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |