|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.util.CommandLineTool
com.unboundid.util.MultiServerLDAPCommandLineTool
com.unboundid.ldap.sdk.unboundidds.MoveSubtree
@ThreadSafety(level=NOT_THREADSAFE) public final class MoveSubtree
NOTE: This class is part of the Commercial Edition of the UnboundID LDAP SDK for Java. It is not available for use in applications that include only the Standard Edition of the LDAP SDK, and is not supported for use in conjunction with non-UnboundID products.This class provides a utility that may be used to move a single entry or a small subtree of entries from one server to another.
Constructor Summary | |
---|---|
MoveSubtree(java.io.OutputStream out,
java.io.OutputStream err)
Creates a new instance of this tool with the provided output and error streams. |
Method Summary | |
---|---|
void |
addNonLDAPArguments(ArgumentParser parser)
Adds the arguments needed by this command-line tool to the provided argument parser which are not related to connecting or authenticating to the directory server. |
void |
doPostAddProcessing(ReadOnlyEntry entry)
Performs any processing which may be needed after the provided entry has been added to the target server. |
void |
doPostDeleteProcessing(DN entryDN)
Performs any processing which may be needed after the specified entry has been deleted from the source server. |
ReadOnlyEntry |
doPreAddProcessing(ReadOnlyEntry entry)
Performs any processing which may be needed before the provided entry is added to the target server. |
void |
doPreDeleteProcessing(DN entryDN)
Performs any processing which may be needed before the specified entry is deleted from the source server. |
protected void |
doShutdownHookProcessing(ResultCode resultCode)
Performs any processing that may be needed when the JVM is shutting down, whether because tool processing has completed or because it has been interrupted (e.g., by a kill or break signal). |
ResultCode |
doToolProcessing()
Performs the core set of processing for this tool. |
LDAPConnectionOptions |
getConnectionOptions()
Retrieves the connection options that should be used for connections that are created with this command line tool. |
java.util.LinkedHashMap<java.lang.String[],java.lang.String> |
getExampleUsages()
Retrieves a set of information that may be used to generate example usage information. |
java.lang.String |
getToolDescription()
Retrieves a human-readable description for this tool. |
java.lang.String |
getToolName()
Retrieves the name of this tool. |
java.lang.String |
getToolVersion()
Retrieves a version string for this tool, if available. |
void |
handleUnsolicitedNotification(LDAPConnection connection,
ExtendedResult notification)
Performs any processing that may be necessary in response to the provided unsolicited notification that has been received from the server. |
static void |
main(java.lang.String... args)
Parse the provided command line arguments and perform the appropriate processing. |
static ResultCode |
main(java.lang.String[] args,
java.io.OutputStream out,
java.io.OutputStream err)
Parse the provided command line arguments and perform the appropriate processing. |
static MoveSubtreeResult |
moveEntryWithInteractiveTransaction(LDAPConnection sourceConnection,
LDAPConnection targetConnection,
java.lang.String entryDN,
OperationPurposeRequestControl opPurposeControl,
boolean suppressRefInt,
MoveSubtreeListener listener)
Moves a single leaf entry using a pair of interactive transactions. |
static MoveSubtreeResult |
moveEntryWithInteractiveTransaction(LDAPConnection sourceConnection,
LDAPConnection targetConnection,
java.lang.String entryDN,
OperationPurposeRequestControl opPurposeControl,
MoveSubtreeListener listener)
Moves a single leaf entry using a pair of interactive transactions. |
static MoveSubtreeResult |
moveSubtreeWithRestrictedAccessibility(LDAPConnection sourceConnection,
LDAPConnection targetConnection,
java.lang.String baseDN,
int sizeLimit,
OperationPurposeRequestControl opPurposeControl,
boolean suppressRefInt,
MoveSubtreeListener listener)
Moves a subtree of entries using a process in which access to the subtree will be restricted while the move is in progress. |
static MoveSubtreeResult |
moveSubtreeWithRestrictedAccessibility(LDAPConnection sourceConnection,
LDAPConnection targetConnection,
java.lang.String baseDN,
int sizeLimit,
OperationPurposeRequestControl opPurposeControl,
MoveSubtreeListener listener)
Moves a subtree of entries using a process in which access to the subtree will be restricted while the move is in progress. |
protected boolean |
registerShutdownHook()
Indicates whether this tool should register a shutdown hook with the JVM. |
Methods inherited from class com.unboundid.util.MultiServerLDAPCommandLineTool |
---|
addToolArguments, createBindRequest, createServerSet, createSSLUtil, doExtendedArgumentValidation, doExtendedNonLDAPArgumentValidation, getConnection, getConnectionPool, getUnauthenticatedConnection |
Methods inherited from class com.unboundid.util.CommandLineTool |
---|
createArgumentParser, err, getErr, getMaxTrailingArguments, getOut, getTrailingArgumentsPlaceholder, out, runTool, wrapErr, wrapOut |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MoveSubtree(java.io.OutputStream out, java.io.OutputStream err)
out
- The output stream to which standard out should be written. It
may be null
if output should be suppressed.err
- The output stream to which standard error should be written.
It may be null
if error messages should be suppressed.Method Detail |
---|
public static void main(java.lang.String... args)
args
- The command line arguments provided to this program.public static ResultCode main(java.lang.String[] args, java.io.OutputStream out, java.io.OutputStream err)
args
- The command line arguments provided to this program.out
- The output stream to which standard out should be written.
It may be null
if output should be suppressed.err
- The output stream to which standard error should be written.
It may be null
if error messages should be
suppressed.
public java.lang.String getToolName()
getToolName
in class CommandLineTool
public java.lang.String getToolDescription()
getToolDescription
in class CommandLineTool
public java.lang.String getToolVersion()
getToolVersion
in class CommandLineTool
null
if none is
available.public void addNonLDAPArguments(ArgumentParser parser) throws ArgumentException
addNonLDAPArguments
in class MultiServerLDAPCommandLineTool
parser
- The argument parser to which the arguments should be added.
ArgumentException
- If a problem occurs while adding the arguments.public LDAPConnectionOptions getConnectionOptions()
getConnectionOptions
in class MultiServerLDAPCommandLineTool
public ResultCode doToolProcessing()
doToolProcessing
in class CommandLineTool
public static MoveSubtreeResult moveEntryWithInteractiveTransaction(LDAPConnection sourceConnection, LDAPConnection targetConnection, java.lang.String entryDN, OperationPurposeRequestControl opPurposeControl, MoveSubtreeListener listener)
sourceConnection
- A connection established to the source server.
It should be authenticated as a user with
permission to perform all of the operations
against the source server as referenced above.targetConnection
- A connection established to the target server.
It should be authenticated as a user with
permission to perform all of the operations
against the target server as referenced above.entryDN
- The base DN for the subtree to move.opPurposeControl
- An optional operation purpose request control
that may be included in all requests sent to the
source and target servers.listener
- An optional listener that may be invoked during
the course of moving entries from the source
server to the target server.
public static MoveSubtreeResult moveEntryWithInteractiveTransaction(LDAPConnection sourceConnection, LDAPConnection targetConnection, java.lang.String entryDN, OperationPurposeRequestControl opPurposeControl, boolean suppressRefInt, MoveSubtreeListener listener)
sourceConnection
- A connection established to the source server.
It should be authenticated as a user with
permission to perform all of the operations
against the source server as referenced above.targetConnection
- A connection established to the target server.
It should be authenticated as a user with
permission to perform all of the operations
against the target server as referenced above.entryDN
- The base DN for the subtree to move.opPurposeControl
- An optional operation purpose request control
that may be included in all requests sent to the
source and target servers.suppressRefInt
- Indicates whether to include a request control
causing referential integrity updates to be
suppressed on the source server.listener
- An optional listener that may be invoked during
the course of moving entries from the source
server to the target server.
public static MoveSubtreeResult moveSubtreeWithRestrictedAccessibility(LDAPConnection sourceConnection, LDAPConnection targetConnection, java.lang.String baseDN, int sizeLimit, OperationPurposeRequestControl opPurposeControl, MoveSubtreeListener listener)
sourceConnection
- A connection established to the source server.
It should be authenticated as a user with
permission to perform all of the operations
against the source server as referenced above.targetConnection
- A connection established to the target server.
It should be authenticated as a user with
permission to perform all of the operations
against the target server as referenced above.baseDN
- The base DN for the subtree to move.sizeLimit
- The maximum number of entries to be moved. It
may be less than or equal to zero to indicate
that no client-side limit should be enforced
(although the server may still enforce its own
limit).opPurposeControl
- An optional operation purpose request control
that may be included in all requests sent to the
source and target servers.listener
- An optional listener that may be invoked during
the course of moving entries from the source
server to the target server.
public static MoveSubtreeResult moveSubtreeWithRestrictedAccessibility(LDAPConnection sourceConnection, LDAPConnection targetConnection, java.lang.String baseDN, int sizeLimit, OperationPurposeRequestControl opPurposeControl, boolean suppressRefInt, MoveSubtreeListener listener)
sourceConnection
- A connection established to the source server.
It should be authenticated as a user with
permission to perform all of the operations
against the source server as referenced above.targetConnection
- A connection established to the target server.
It should be authenticated as a user with
permission to perform all of the operations
against the target server as referenced above.baseDN
- The base DN for the subtree to move.sizeLimit
- The maximum number of entries to be moved. It
may be less than or equal to zero to indicate
that no client-side limit should be enforced
(although the server may still enforce its own
limit).opPurposeControl
- An optional operation purpose request control
that may be included in all requests sent to the
source and target servers.suppressRefInt
- Indicates whether to include a request control
causing referential integrity updates to be
suppressed on the source server.listener
- An optional listener that may be invoked during
the course of moving entries from the source
server to the target server.
public void handleUnsolicitedNotification(LDAPConnection connection, ExtendedResult notification)
handleUnsolicitedNotification
in interface UnsolicitedNotificationHandler
connection
- The connection on which the unsolicited notification
was received.notification
- The unsolicited notification that has been received
from the server.public ReadOnlyEntry doPreAddProcessing(ReadOnlyEntry entry)
doPreAddProcessing
in interface MoveSubtreeListener
entry
- A read-only representation of the entry to be added to the
target server.
null
if the
entry should not be added to the target server (but will still be
removed from the source server).public void doPostAddProcessing(ReadOnlyEntry entry)
doPostAddProcessing
in interface MoveSubtreeListener
entry
- A read-only representation of the entry that was added to
the target server. Note that depending on the algorithm
used to perform the move, the entry may not yet be
accessible in the target server. Also note that the add may
potentially be reverted if move processing encounters an
error later in its processing.public void doPreDeleteProcessing(DN entryDN)
doPreDeleteProcessing
in interface MoveSubtreeListener
entryDN
- The DN of the entry that is to be removed from the
source server. Note that depending on the algorithm used
to perform the move, the entry may already be inaccessible
in the source server.public void doPostDeleteProcessing(DN entryDN)
doPostDeleteProcessing
in interface MoveSubtreeListener
entryDN
- The DN of the entry that has been removed from the source
server. Note that the delete may potentially be reverted
if move processing encounters an error later in its
processing.protected boolean registerShutdownHook()
System.exit()
or Runtime.exit()
is called.System.halt()
or
Runtime.halt()
methods).
true
, then the
CommandLineTool.doShutdownHookProcessing(ResultCode)
method should also be
overridden to contain the logic that will be invoked when the JVM is
shutting down in a manner that calls shutdown hooks.
registerShutdownHook
in class CommandLineTool
true
if this tool should register a shutdown hook, or
false
if not.protected void doShutdownHookProcessing(ResultCode resultCode)
java.lang.Runtime.addShutdownHook
method for recommendations and
restrictions about writing shutdown hooks.
doShutdownHookProcessing
in class CommandLineTool
resultCode
- The result code returned by the tool. It may be
null
if the tool was interrupted before it
completed processing.public java.util.LinkedHashMap<java.lang.String[],java.lang.String> getExampleUsages()
getExampleUsages
in class CommandLineTool
null
or empty if no example usage
information is available.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |