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

Jean-Noel Rouvignac
07.44.2015 f1fec12bd1a545622e25a27ca1e118179c27e4e5
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
commitf1fec12bd1a545622e25a27ca1e118179c27e4e5
tree cfc3d0b3c66a6e541af9a6d9e8203e57ed7b211c tree | zip | gz
parent 0b84db63fb3f7840baabad0aa388055be888eff1 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-server-legacy/src/main/java/org/opends/server/tools/dsreplication/EnableReplicationUserData.java 527 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/PurgeHistoricalUserData.java 93 ●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliArgumentParser.java 234 ●●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/tools/dsreplication/ReplicationCliMain.java 933 ●●●●● diff | view | raw | blame | history