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

Jean-Noel Rouvignac
23.17.2013 78813fcdf53fa83bd4ea4ab55fec7bd8de9f4476
refs
author Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Monday, September 23, 2013 10:17 +0200
committer Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Monday, September 23, 2013 10:17 +0200
commit78813fcdf53fa83bd4ea4ab55fec7bd8de9f4476
tree 6f8b9b0425de69101bec19785a098b95ec2b2c1f tree | zip | gz
parent 6aa19737512582bc35c7a51b876cf1a737b0a1fe view | diff
OPENDJ-1134 (CR-2338) Introduce a class in replication for encapsulating host+port combinations

Augmented HostPort class to support the use cases mentioned in OPENDJ-1134.
Moved host splitting and port range validation to HostPort class.


HostPort.java:
Added valueOf() to parses a "host:port" URL + Added extractPort(), normalizePort(), normalizedHost(), removeExtraChars().
Moved isLocalAddress() code here from StaticUtils.
Added normalizedHost field, toNormalizedString() and toString(String) + modified hashCode() and equals() to ensure stability of the results returned by hashCode() and equals().
Added allAddresses() to hide HostPort(int).
Moved isEquivalentTo() code here from ReplicationBroker.isSameReplicationServerUrl().

HostPortTest.java:
Added.

StaticUtils.java:
Moved isLocalAddress() and related code to the HostPort class.

ReplicationBroker.java:
Moved some isSameReplicationServerUrl() to HostPort as isEquivalentTo().

*.java:
Used the new HostPort ctor everywhere.
It simplified the code in many places and also helped remove duplicated code.

ComputeBestServerTest.java:
Added ports to serverURLs to ensure tests still pass.

*Test.java:
Removed the test anti-pattern try/catch/fail.
1 files added
15 files modified
1723 ■■■■ changed files
opends/src/server/org/opends/server/core/CoreConfigManager.java 103 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java 38 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/protocols/jmx/JmxConnectionHandler.java 28 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationServer.java 42 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationServerHandler.java 2 ●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/service/ReplicationBroker.java 124 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/types/HostPort.java 391 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/types/LDAPURL.java 68 ●●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/util/StaticUtils.java 83 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ComputeBestServerTest.java 6 ●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/FractionalReplicationTest.java 6 ●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/GroupIdHandshakeTest.java 178 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/ReplicationServerFailoverTest.java 153 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/TopologyViewTest.java 292 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/AssuredReplicationServerTest.java 87 ●●●●● diff | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/types/HostPortTest.java 122 ●●●●● diff | view | raw | blame | history