ServerState.java:
Assigned serverIdToChangeNumber field in the declaration.
In reload(), called update().
In cover(ServerState), cover(ChangeNumber).
In duplicate(), called Map.putAll().

DraftCNDbHandler.java:
In clear(String), removed useless code.

ExternalChangeLogTest.java:
Renamed createDomain() to startNewDomain().
In initializeTestBackend(), removed one parameter.
Renamed removeTestBackend2() to removeTestBackend() + Removed useless null checks around the calls to it.

git-svn-id: https://svn.forgerock.org/opendj/trunk@9460 41b1ffd8-f28e-4786-ab96-9950f0a78031
Made code more encapsulated and more explicit.
Removed parameters obscuring the code.


ReplicationServerDomain.java:
Renamed getServers() to getServerIds().

MessageHandler.java:
In getDomain(), removed createIfNotExist which was always true in calling code + called ReplicationServer.waitConnections() here.
In getRcvMsgQueueSize(), used early exit.

ReplicationServer.java:
In getReplicationServerDomain() methods, removed the create parameter.
Also extracted the waitConnections() method and called it higher up in the call hierarchy.
Created initDomainGenerationID() and addServerIdToDomain() methods here from code in ReplicationDbEnv.java
In runConnect(), collapsed if statements.


*.java
Consequence of the changes to:
- ReplicationServerDomain.getServers()
- ReplicationServer.getReplicationServerDomain()
- ReplicationServer.initDomainGenerationID() and addServerIdToDomain()

GenerationIdTest.java:
Extracted method isDegradedDueToGenerationId().

InitOnLineTest.java:
Extracted method getConnectedDSServerIds().

git-svn-id: https://svn.forgerock.org/opendj/trunk@9461 41b1ffd8-f28e-4786-ab96-9950f0a78031
Fixed the broken tests in ReplicationServerTest.

ReplicationDbEnv.java:
Decoupled the call to start() from building the object + Made start() a public method.
Inlined the code from readDomainBaseDNGenerationIDRecords() and readServerIdDomainBaseDNRecords() into start() to avoid reading twice the DB on startup.
Extracted method openDatabase().

ReplicationServer.java:
In initialize(), called ReplicationDbEnv.start().

git-svn-id: https://svn.forgerock.org/opendj/trunk@9462 41b1ffd8-f28e-4786-ab96-9950f0a78031
ReplicationServerDomain.java:
Extended the use of the getMessage() method to streamline debug message and reduce clutter when reading the code.

git-svn-id: https://svn.forgerock.org/opendj/trunk@9463 41b1ffd8-f28e-4786-ab96-9950f0a78031
Added retries on manage-tasks tool to avoid random test failure

git-svn-id: https://svn.forgerock.org/opendj/trunk@9464 41b1ffd8-f28e-4786-ab96-9950f0a78031
Trivial style fix

git-svn-id: https://svn.forgerock.org/opendj/trunk@9465 41b1ffd8-f28e-4786-ab96-9950f0a78031
Minor code cleanup, including renaming the private temporary config file to loginxxxx.conf instead of loginxxxxconf

git-svn-id: https://svn.forgerock.org/opendj/trunk@9466 41b1ffd8-f28e-4786-ab96-9950f0a78031
Minor code cleanup.

git-svn-id: https://svn.forgerock.org/opendj/trunk@9467 41b1ffd8-f28e-4786-ab96-9950f0a78031
Fix for OPENDJ-1129. Move the temp config file for JAAS / GSSAPI / Kerb login under instance/config.
 CR-2231. Thanks Matt

git-svn-id: https://svn.forgerock.org/opendj/trunk@9468 41b1ffd8-f28e-4786-ab96-9950f0a78031
ReplicationDbEnv.java:
Renamed:
- field stateDb to changelogStateDb.
- start() to initializeFromChangelogStateDB().
- putInStateDBIfNotExist() to putInChangelogStateDBIfNotExist()
- deleteFromStateDB() to deleteFromChangelogStateDB() + changed the signature.
In getOrAddDb(), reduced code clutter and removed useless comments.
Extracted methods kb(), mb(), toBytes(), buildGenIdKey(), buildServerIdKey(), buildGenIdData() for better readability.
Extracted method debug() to reduce code clutter.
Used static imports.

ReplicationServer.java:
Consequence of the rename of ReplicationDbEnv.start().

git-svn-id: https://svn.forgerock.org/opendj/trunk@9469 41b1ffd8-f28e-4786-ab96-9950f0a78031
Code cleanup.

ReplicationServerDomain.java:
Renamed getMessage() to debug() + called TRACER.debugInfo() in it.

MessageHandler.java:
Implemented toString().

git-svn-id: https://svn.forgerock.org/opendj/trunk@9470 41b1ffd8-f28e-4786-ab96-9950f0a78031
Minor error message cleanup.

git-svn-id: https://svn.forgerock.org/opendj/trunk@9471 41b1ffd8-f28e-4786-ab96-9950f0a78031
Fix OPENDJ-1124: Connection.search() return value not mockable

* make ConnectionEntryReader non-final.


git-svn-id: https://svn.forgerock.org/opendj/trunk@9472 41b1ffd8-f28e-4786-ab96-9950f0a78031
Partial fix for OPENDJ-1112: LoadBalancing connection factories need better diagnostic messages

* save last failure and include it as exception cause when all factories have failed.


git-svn-id: https://svn.forgerock.org/opendj/trunk@9474 41b1ffd8-f28e-4786-ab96-9950f0a78031
Partial fix for OPENDJ-1112: LoadBalancing connection factories need better diagnostic messages

* implement event notification framework
* TODO: need to figure out how to expose it in public API.



git-svn-id: https://svn.forgerock.org/opendj/trunk@9475 41b1ffd8-f28e-4786-ab96-9950f0a78031
Partial fix for OPENDJ-1112: LoadBalancing connection factories need better diagnostic messages

* avoid accidentally trapping Errors - only RuntimeExceptions should be caught. Thanks to Peter for pointing this out :-)

git-svn-id: https://svn.forgerock.org/opendj/trunk@9476 41b1ffd8-f28e-4786-ab96-9950f0a78031
ChangeNumberTest.java:
Added compareToEquivalentToEquals(), hashCodesEqualWhenChangeNumbersEqual(), hashCodesEqualWhenCompareToEqual() to verify basic properties are covered.
Code cleanup.

git-svn-id: https://svn.forgerock.org/opendj/trunk@9477 41b1ffd8-f28e-4786-ab96-9950f0a78031
OPENDJ-1116 Introduce abstraction for the changelog DB

Renamed:
- ReplicationIterator to ReplicationDBCursor
- ReplicationIteratorComparator to ReplicationDBCursorComparator
- JEReplicationIterator to JEReplicationDBCursor

Fixed javadocs, variable names, method names, etc.

ReplicationServerDomain.java:
Renamed getChangelogIterator() to getCursorFrom().

DbHandler.java:
Renamed generateIterator() to generateCursorFrom().

MessageHandler.java:
Extracted nextOldestUpdateMsg() and findOldestChangeNumberFromReplicationDBs() to increase code expressiveness.


git-svn-id: https://svn.forgerock.org/opendj/trunk@9478 41b1ffd8-f28e-4786-ab96-9950f0a78031
More code cleanup and use of interfaces in dsreplication and ADS.

git-svn-id: https://svn.forgerock.org/opendj/trunk@9479 41b1ffd8-f28e-4786-ab96-9950f0a78031
OPENDJ-1116 Introduce abstraction for the changelog DB

Fixed checkstyle.
Oh Eclipse, why did you fail me?


git-svn-id: https://svn.forgerock.org/opendj/trunk@9480 41b1ffd8-f28e-4786-ab96-9950f0a78031