|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.util.LDIFReader
@PublicAPI(stability=UNCOMMITTED, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class LDIFReader
This class provides the ability to read information from an LDIF file. It provides support for both standard entries and change entries (as would be used with a tool like ldapmodify).
Constructor Summary | |
---|---|
LDIFReader(LDIFImportConfig importConfig)
Creates a new LDIF reader that will read information from the specified file. |
Method Summary | |
---|---|
void |
close()
Closes this LDIF reader and the underlying file or input stream. |
long |
getEntriesIgnored()
Retrieves the total number of entries that have been ignored so far by this LDIF reader because they did not match the import criteria. |
long |
getEntriesRead()
Retrieves the total number of entries read so far by this LDIF reader, including those that have been ignored or rejected. |
long |
getEntriesRejected()
Retrieves the total number of entries rejected so far by this LDIF reader. |
long |
getLastEntryLineNumber()
Retrieves the starting line number for the last entry read from the LDIF source. |
ChangeRecordEntry |
readChangeRecord(boolean defaultAdd)
Reads the next change record from the LDIF source. |
Entry |
readEntry()
Reads the next entry from the LDIF source. |
Entry |
readEntry(boolean checkSchema)
Reads the next entry from the LDIF source. |
void |
rejectLastEntry(Message message)
Rejects the last entry read from the LDIF. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LDIFReader(LDIFImportConfig importConfig) throws java.io.IOException
importConfig
- The import configuration for this LDIF reader. It
must not be null
.
java.io.IOException
- If a problem occurs while opening the LDIF file for
reading.Method Detail |
---|
public Entry readEntry() throws java.io.IOException, LDIFException
null
if
the end of the LDIF data is reached.
java.io.IOException
- If an I/O problem occurs while reading from the file.
LDIFException
- If the information read cannot be parsed as an LDIF
entry.public Entry readEntry(boolean checkSchema) throws java.io.IOException, LDIFException
checkSchema
- Indicates whether this reader should perform schema
checking on the entry before returning it to the
caller. Note that some basic schema checking (like
refusing multiple values for a single-valued
attribute) may always be performed.
null
if
the end of the LDIF data is reached.
java.io.IOException
- If an I/O problem occurs while reading from the file.
LDIFException
- If the information read cannot be parsed as an LDIF
entry.public ChangeRecordEntry readChangeRecord(boolean defaultAdd) throws java.io.IOException, LDIFException
defaultAdd
- Indicates whether the change type should default to
"add" if none is explicitly provided.
null
if the end of the LDIF data is reached.
java.io.IOException
- If an I/O problem occurs while reading from the file.
LDIFException
- If the information read cannot be parsed as an LDIF
entry.public long getLastEntryLineNumber()
public void rejectLastEntry(Message message)
message
- A human-readable message providing the reason that the
last entry read was not acceptable.public void close()
public long getEntriesRead()
public long getEntriesIgnored()
public long getEntriesRejected()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |