mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
07.44.2015 5bdeb0ac3f36be10ed81ba03c07b2df509a9c754
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Tuesday, July 7, 2015 14:44 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Tuesday, July 7, 2015 14:44 +0200
commit5bdeb0ac3f36be10ed81ba03c07b2df509a9c754
tree 11a5e186ac55857224604269b3314db07e6daa3b tree | zip | gz
parent edaa9e524a9a2d7ec2b378e45c7acb10833892d7 view | diff
Code cleanups


EnableReplicationUserData.java:
Extracted inner class EnableReplicationServerData.
Removed all fields named "*1" and "*2" and replaced them with new fields EnableReplicationServerData server1 and server2.

ReplicationCliMain.java:
Used EnableReplicationUserData.EnableReplicationServerData.
As a consequence, extracted methods setConnectionDetails(), setReplicationDetails(), checkReplicationServerAlreadyConfigured(), checkReplicationPort(), checkAdminAndReplicationPortsAreDifferent(), addToSets(), configureToReplicateBaseDN(), countReplicationServers(), checkCanMergeReplicationTopologies() to reduce code duplication.
Extracted methods findSameReplicationServer() and findReplicaInSuffix2() to increase readability.
Extracted configureServer() from configureServer1() and configureServer2() + removed these 2 methods.
Moved getValue(String v, String defaultValue) and getValue(int v, int defaultValue) to ReplicationCliArgumentParser.
Consequence of the changes to ReplicationCliArgumentParser.

ReplicationCliArgumentParser.java:
Reduced methods visibility + made a few methods static.
Renamed or inlined various methods.
Added getValueOrDefault(StringArgument) and getValueOrDefault(IntegerArgument).
Used ternary operator.
Extracted method getAdminUidArg()

PurgeHistoricalUserData.java:
Code cleanups.
Consequence of the changes to ReplicationCliArgumentParser.
Removed getValue(String v, String defaultValue) and getValue(int v, int defaultValue).
4 files modified
1787 ■■■■■ changed files
opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/EnableReplicationUserData.java 527 ●●●●● diff | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalUserData.java 93 ●●●● diff | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java 234 ●●●●● diff | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliMain.java 933 ●●●●● diff | view | raw | blame | history