class DirectoryCopy
extends java.lang.Object
Known limitations:
subtree
mapping mode then
mapping data must be already present in LDAP tree.Modifier and Type | Field and Description |
---|---|
private java.lang.String[] |
args
Reference to command line parameters
|
private int |
changed
utility statistics
|
private int |
errors
utility statistics
|
private int |
found
utility statistics
|
private int |
skipped
utility statistics
|
Constructor and Description |
---|
DirectoryCopy(java.lang.String[] args)
Construct an instance of DirectoryCopy for given command line
parameters.
|
Modifier and Type | Method and Description |
---|---|
private void |
clear(java.lang.String[] args)
Attribute Value Clear utility.
|
private void |
clearNodeWorker(Remapper rt,
java.lang.String nodeId,
java.lang.String nclass,
java.lang.String nattr,
java.lang.String val,
boolean clearAll)
Attribute Value Clear utility.
|
private void |
clearWorker(Remapper rt,
java.lang.String node,
java.lang.String nclass,
java.lang.String nattr,
java.lang.String val,
boolean clearAll)
Attribute Value Clear utility.
|
private void |
copy()
Directory Copy utility.
|
static void |
main(java.lang.String[] args)
Application entry point.
|
private void |
protCopy()
Protected Directory Copy utility.
|
private void |
remove()
Directory Branch Removal utility.
|
private static boolean |
removeDirectoryNode(Remapper rm,
java.lang.String nodeId)
Removes the specified directory node, including all child nodes.
|
(package private) static void |
say_(java.lang.String msg)
Shortcut for the System.out.print()
|
(package private) static void |
say(java.lang.String msg)
Shortcut for the System.out.println()
|
private void |
selectiveCopy(java.lang.String[] args)
Selective directory copy.
|
private boolean |
selectiveCopyWorker(Remapper rs,
Remapper rt,
java.lang.String path,
java.lang.String nclass,
java.lang.String sclass,
java.lang.String subnode,
java.lang.String attrName,
java.lang.String val,
java.lang.String[] cpys)
Selective copy worker.
|
private void |
set(java.lang.String[] args)
Attribute Value Set utility.
|
private void |
setNodeWorker(Remapper rt,
java.lang.String nodeId,
java.lang.String nclass,
java.lang.String nattr,
int attrType,
java.lang.Object val,
int index)
Attribute Value Set node worker.
|
private void |
setWorker(Remapper rt,
java.lang.String node,
java.lang.String nclass,
java.lang.String nattr,
int attrType,
java.lang.Object val,
int index)
Attribute Value Set worker.
|
private java.lang.String[] args
private int skipped
private int found
private int changed
private int errors
public DirectoryCopy(java.lang.String[] args)
args
- Command line parameters.static void say(java.lang.String msg)
msg
- Message to print to standard output.static void say_(java.lang.String msg)
msg
- Message to print to standard output.private void protCopy() throws ConfigurationException
ConfigurationException
- In case of configuration error.private void copy() throws ConfigurationException
ConfigurationException
- In case of configuration error.private void remove() throws ConfigurationException
ConfigurationException
- In case of configuration error.private void clearNodeWorker(Remapper rt, java.lang.String nodeId, java.lang.String nclass, java.lang.String nattr, java.lang.String val, boolean clearAll)
private void clearWorker(Remapper rt, java.lang.String node, java.lang.String nclass, java.lang.String nattr, java.lang.String val, boolean clearAll)
private void clear(java.lang.String[] args) throws ConfigurationException
ConfigurationException
- In case of configuration error.private void set(java.lang.String[] args) throws ConfigurationException
ConfigurationException
- In case of configuration error.private void selectiveCopy(java.lang.String[] args) throws ConfigurationException
The filtering is done in the target directory. The path is enumerated and all the nodes of the given class are checked for the given subnodes' attribure value. If a node passes filtering, then the specified subnodes of the node in the source directory are copied to replace the existing subnodes in the target, if any.
Typical use would be: find all user account definitions in the target directory, having the user-num attribute 0, and copy from the source directory some account extensions like created-date, user-num, user-level, key.
ConfigurationException
- In case of configuration error.private boolean selectiveCopyWorker(Remapper rs, Remapper rt, java.lang.String path, java.lang.String nclass, java.lang.String sclass, java.lang.String subnode, java.lang.String attrName, java.lang.String val, java.lang.String[] cpys)
true
if successprivate void setWorker(Remapper rt, java.lang.String node, java.lang.String nclass, java.lang.String nattr, int attrType, java.lang.Object val, int index)
private void setNodeWorker(Remapper rt, java.lang.String nodeId, java.lang.String nclass, java.lang.String nattr, int attrType, java.lang.Object val, int index)
private static boolean removeDirectoryNode(Remapper rm, java.lang.String nodeId)
rm
- A bound directory remappernodeId
- ID of node to removetrue
if removed the node successfullypublic static void main(java.lang.String[] args)
args
- Command line parameters. The first one specifies the utility
and the rest is utility specific. The currently implemented
utilities are: