OPENDJ-1453 (CR-3697) Change time heart beat change numbers should be synced with updates
Left over changes from a failed attempt at sending replica offline messages after all update messages have been sent on replica shutdown (see the JIRA issue for details):
- Shutdown sequence improvements (reordered shutdown stages)
- Code cleanups / refactorings / clarifications
DirectoryServer.java:
In shutDown(), removed dead code + reordered stages to: shutdown connection handlers, then work queue, then replication, then the rest.
shutting down the work queue waits for the worker threads to exit for ServerShutdownMonitor.WAIT_TIME. To be improved by OPENDJ-1469 2 phase shutdown
Made several constants final.
Made several methods private.
ServerShutdownMonitor.java:
Extracted WAIT_TIME constants to reuse it in DirectoryServer.shutDown().
ReplicationBroker.java
Reordered shutdown sequence: first shutdown changeTime heartbeat publisher thread, then RS heartbeat monitoring thread, then set no connected RS.
ReplicationDomain.java, DummyReplicationDomain.java:
Made status private + added signalNewStatus().
LDAPReplicationDomain.java:
Consequence of the change to signalNewStatus().
ReplicationServerDomain.java:
Added PendingStatusMessages.toString().
Made some methods private.
In sendPendingTopologyMsgs(), avoid building a topology message if there is no RSs to send it to.
PendingChange.java:
Code cleanup.
Removed useless field/methods targetDN, getTargetDN(), setOp().
Added toString().
PendingChanges.java:
In putLocalOperation(), avoid storing synchronization operations because they will never be sent (see code in pushCommittedChanges()).
In pushCommittedChanges(), made better use of TreeMap API + do not return int anymore (it was never used).
In commitAndPushCommittedChanges(), do not return int anymore (it was never used).
RemotePendingChanges.java:
Consequence of the change to PendingChange.getTargetDN().
Renamed targetDn local variables to targetDN.
TraditionalWorkerThread.java, CSNGenerator.java:
Code cleanup.