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.