Class LDIFLoad
Error-counts and write-counts are updated during the scan and may be monitored by the GUI thread using the status() method. The GUI thread may also read the errors as they are generated using getException(), and may also request that the operation be aborted using abort(). If the operation stops before the finish because it requires the user to make a choice, it may be restarted by executing the run() method again.
No aliases are followed when writing entries.
- Author:
- jp
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLDIFLoad
(DirectorySession ds, String in_fnam, boolean continue_on_error, DN dn_remove, DN dn_add, boolean correct_dn, boolean strip_op_coll) Initialize the LDIFLoad.LDIFLoad
(DirectorySession ds, String in_fnam, boolean continue_on_error, DN dn_remove, DN dn_add, boolean correct_dn, boolean strip_op_coll, Substitutor subs) Initialize the LDIFLoad. -
Method Summary
Modifier and TypeMethodDescriptionvoid
abort()
Abort the operation.int
Return the number of entries written to date.int
Return the number of errors noted to date.Returns the next outstanding Exception, or null if there are no more exceptions outstanding.boolean
Test to see if the dump has finished.void
run()
Run the LDIF load.status()
Get the current status of the operation as a string.
-
Field Details
-
dn_remove
DN to remove from source DN. -
dn_add
DN to add to source DN, if removal succeeded. -
correct_dn
public final boolean correct_dnCorrect DN-valued attributes that are loaded?
-
-
Constructor Details
-
LDIFLoad
public LDIFLoad(DirectorySession ds, String in_fnam, boolean continue_on_error, DN dn_remove, DN dn_add, boolean correct_dn, boolean strip_op_coll) Initialize the LDIFLoad. This may be called from the GUI thread.- Parameters:
ds
- DirectorySession to usein_fnam
- LDIF file to writecontinue_on_error
- Continue operations after errors?dn_remove
- DN to remove from each source DNdn_add
- DN to add to each source DN, assuming the removal succeededcorrect_dn
- Correct DNs in loaded data according to dn_remove/dn_addstrip_op_coll
- Strip operational and collective attributes
-
LDIFLoad
public LDIFLoad(DirectorySession ds, String in_fnam, boolean continue_on_error, DN dn_remove, DN dn_add, boolean correct_dn, boolean strip_op_coll, Substitutor subs) Initialize the LDIFLoad. This may be called from the GUI thread.- Parameters:
ds
- DirectorySession to usein_fnam
- LDIF file to writecontinue_on_error
- Continue operations after errors?dn_remove
- DN to remove from each source DNdn_add
- DN to add to each source DN, assuming the removal succeededcorrect_dn
- Correct DNs in loaded data according to dn_remove/dn_addstrip_op_coll
- Strip operational and collective attributessubs
- Helper class which will perform attribute modification/replacement, which may be null- Since:
- R16.2
-
-
Method Details
-
run
public void run()Run the LDIF load. Non-fatal Exceptions are queued rather than rethrown, so it is important to check for errors after running this method by calling getException(). If the load is set not to continue on errors, then this method will return early (with isFinished() returning not true), and execution of the load may then be continued by calling it again.This method must be run from a background (non-GUI) thread as it does directory operations directly and will block whilst waiting for directory data.
-
abort
public void abort()Abort the operation. This may be called from the GUI thread (assuming that the LDIF dump is running in the background). This will stop the operation at the next available opportunity. Note that if the operation is blocked waiting for a directory result, this cannot be interrupted and the abort will not be processed until the directory operation actually returns. -
status
Get the current status of the operation as a string. This may be called from the GUI thread (assuming that the LDIF dump is running in the background).- Returns:
- Status of the operation as a string
-
isFinished
public boolean isFinished()Test to see if the dump has finished.- Returns:
- Finished?
-
getException
Returns the next outstanding Exception, or null if there are no more exceptions outstanding. This may be called from the GUI thread (assuming that the LDIF dump is running in the background).The Exceptions are plain Exceptions, with an explanation and the problem DN in the message text. If the exception was caused by a DSAPIException, this is available using the getCause() method.
-
getEntryCount
public int getEntryCount()Return the number of entries written to date. -
getErrorCount
public int getErrorCount()Return the number of errors noted to date.
-