23 Sep, 2013
1 commit
-
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. git-svn-id: https://svn.forgerock.org/opendj/trunk@9575 41b1ffd8-f28e-4786-ab96-9950f0a78031
20 Sep, 2013
1 commit
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9565 41b1ffd8-f28e-4786-ab96-9950f0a78031
19 Sep, 2013
4 commits
-
JEChangelogDB.java: In getCursorFrom(), renamed local variable "it" to "cursor". git-svn-id: https://svn.forgerock.org/opendj/trunk@9556 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Note this change does not cater for: - the bind operations where the password is used to authenticate. The password is held in memory for as long as it takes to complete the bind operation (and the OS flushing the network packets, etc.) - REST operations where the web container (and the OS network stack) holds a HTTPServletRequest object for as long as it takes to process the request. AuthenticationInfo.java: Removed simplePassword and saslCredentials fields + getters (never used) to ensure they are not held for the lifetime of an LDAP connection. In few methods, reversed conditions to ensure accessed variables are all directly put under a null check. CollectClientConnectionsFilter.java Wiped out the password ASAP, even though this is a bit pointless since the password is held by the web container for the lifetime of a REST call, either in the headers or via HTTP basic authentication. *.java: Consequence of the changes to AuthenticationInfo ctors. git-svn-id: https://svn.forgerock.org/opendj/trunk@9554 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
In findCookie(), reverted an if statement to use an early exit in case of error. It improves readability by making this code consistent with the other code in this method. git-svn-id: https://svn.forgerock.org/opendj/trunk@9553 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
In replication converted the use of String for baseDN to use actual DNs. LDAPReplicationDomain.java: Used getBaseDNString() instead of getBaseDN() in String context. It will use toNormalizedString() instead of using toString() which is safer. git-svn-id: https://svn.forgerock.org/opendj/trunk@9551 41b1ffd8-f28e-4786-ab96-9950f0a78031
18 Sep, 2013
5 commits
-
* update Rest2LDAP documentation due to new configuration options. git-svn-id: https://svn.forgerock.org/opendj/trunk@9549 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Removed ReplicationServer.disableEligibility() stateful method and instead passed this list down as parameter in the methods that require it which is 1- cleaner and 2- safer with regards to concurrent programming (Particularly in ECLServerHandler). In ECLServerHandler.initialize(), called refreshEligibleCSN() to remove duplicate code. git-svn-id: https://svn.forgerock.org/opendj/trunk@9547 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
In replication converted the use of String for baseDN to use actual DNs. By looking at the code, I am a bit afraid that some paths in the code were doing DN.equals(String) or vice-versa. Problem is that the current changes might change the behaviour of these paths. One example I spotted is in LDAPReplicationDomain.isSolveConflict(). LDAPReplicationDomain.java: Removed fields serverId and baseDn already held in parent class + Used getServerId(), getBaseDN() and getBaseDNString() + moved getBaseDN() to ReplicationDomain. ReplicationDomain.java: Moved getBaseDN() here from LDAPReplicationDomain. ReplicationServer.java: In getECLChangeNumberLimits(), removed unnecessary code parsing a String. Now, the code will not throw a DirectoryException when the cookie cannot be parsed. I do not think this is a problem since the result of the parsing was never used anyway. ReplicationBroker.java: In performPhaseOneHandshake(), used StaticUtils.close(). In performECLPhaseTwoHandshake(), changed return type to void. *.java: Converted baseDNs from String type to DN type. Renamed a few getBaseDn() to getBaseDN(). *Test.java: Removed useless try / catch / fail test anti patterns. Changed some fake DNs to have DN-valid syntaxes. git-svn-id: https://svn.forgerock.org/opendj/trunk@9546 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Checkstyle mi amor git-svn-id: https://svn.forgerock.org/opendj/trunk@9545 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
In toNormalizedString(), complemented the javadoc. Comments => javadocs. git-svn-id: https://svn.forgerock.org/opendj/trunk@9544 41b1ffd8-f28e-4786-ab96-9950f0a78031
17 Sep, 2013
6 commits
-
Investigating ExternalChangeLogTest.ECLReplicationServerFullTest(), I found a bug introduced by r9538. In DraftCNDBCursor(long) ctor, when returning null, the code did not release the readLock anymore. Previously, it threw an exception that was caught, then released the readLock and rethrown. Problem is there was an underlying bug in the previous code too: when the DB was already closed, the readLock would not be released at all. Now by introducing the cursorHeld local variable, the readLock is appropriately released in the finally clause when no cursor is held at all. Also fixed the code in DraftCNDBCursor(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9542 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9541 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Added a debug statement to help diagnose a ClassCastException in ReplicationServerTest.windowProbeTest(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9540 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9539 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Fixed nightly test org.opends.server.replication.server.ExternalChangeLogTest#ECLReplicationServerFullTest14 broken by r9505. r9505 allowed code to throw ChangelogException and removed several useless catch(), in particular, a catch was removed from DraftCNDbHandler's methods getPreviousCookie(), getCSN(), getBaseDN() which were predecessors of getRecord(). Older code was throwing an exception, then catching it and returning null in some places while in other places, the exception was allowed to propagate. The final change removed the unnecessary exception throwing and swallowing where it was useless. The exception is now thrown again where it is useful. DraftCNDB.java: In DraftCNDBCursor(long) ctor, removed throwing the exception and return an empty cursor instead. DraftCNDbIterator.java: In DraftCNDbIterator() ctor, throw an exception when the cursor is empty. git-svn-id: https://svn.forgerock.org/opendj/trunk@9538 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
…tion topology at the same time Properly marked the state of the thread + checked it from the deeper DbHandler.trim() to ensure the thread stops as fast as possible. DB reentrant locsk then ensure the threads properly wait on each other before shutdown. DirectoryThread.java: Added ThreadState enum + a threadState AtomicReference instance field. Added isShutdownInitiated(), initiateShutdown(), startWork(), stopWork(), setThreadStateIfNotShuttingDown(), getThreadState(). Converted comments to javadocs. In uncaughtException(), do not log ThreadDeath error (coming from Ludo, suggested as part of OPENDJ-1061). DbHandler.java: Removed shutdown and done instance fields (replaced by the DirectoryThread.threadState). The done instance field had an ill defined purpose and its usefulness was questionable. In shutdown(), used DirectoryThread thread state management methods + removed dead code. In run() and trim(), used DirectoryThread thread state management methods. git-svn-id: https://svn.forgerock.org/opendj/trunk@9537 41b1ffd8-f28e-4786-ab96-9950f0a78031
16 Sep, 2013
2 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9534 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9533 41b1ffd8-f28e-4786-ab96-9950f0a78031
13 Sep, 2013
2 commits
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9532 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
- removed rfc2605.txt from documentation folder and restored in its initial folder /snmp/mib/ (RPM) - removed README file from RPM-DEB package (it contains informations about installation process and is unused for packages.) git-svn-id: https://svn.forgerock.org/opendj/trunk@9527 41b1ffd8-f28e-4786-ab96-9950f0a78031
07 Sep, 2013
1 commit
-
…ained. Corrected minor build constants. git-svn-id: https://svn.forgerock.org/opendj/trunk@9526 41b1ffd8-f28e-4786-ab96-9950f0a78031
06 Sep, 2013
11 commits
-
Added ChangelogDB interface to abstract all the remaining code away from JE. ChangelogDB.java, ChangelogState.java, Pair.java: ADDED JEChangelogDB.java: ADDED Created from code in ReplicationServer and ReplicationServerDomain. ReplicationServer.java: Moved a lot of code to JEChangelogDB. Added ChangelogDB field and delegated existing method calls to it. Added getChangelogDB(). Made getChangeNumberIndexDB() package protected for the tests. ReplicationServerDomain.java: Moved a lot of code to JEChangelogDB. Replaced sourceDbHandlers field with ChangelogDB field. Renamed publishMessage() to publishUpdateMsg(). FIXME!!!! Bug: generationIdSavedStatus is not protected by synchronized (sourceDbHandlers) !!!!! ReplicationDbEnv.java: Changed void initializeFromChangelogStateDB() to ChangelogState readChangelogState() ExternalChangeLogTest.java: Moved from package org.opends.server.replication to org.opends.server.replication.server. Extracted method getReplicationDomainStartState() ChangelogException.java: Changed one ctor visibility to public. git-svn-id: https://svn.forgerock.org/opendj/trunk@9524 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9523 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Removed unused getGenerationIdSavedStatus(). Removed savedStatus parameter from changeGenerationId() and defaulted it to false since all callers were calling it with false. DataServerHandler.java, ReplicationServerHandler.java, ServerHandler.java: Consequence of the change to ReplicationServerDomain.changeGenerationId(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9522 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
* fix JDK6 build - InetAddress.getLoopbackAddress() is JDK7 only. git-svn-id: https://svn.forgerock.org/opendj/trunk@9521 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
* cache network listener enumeration results for 30s * streamline connect thread URL iteration. git-svn-id: https://svn.forgerock.org/opendj/trunk@9520 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9519 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9517 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Renamed CNIndexData to CNIndexRecord. ChangeNumberIndexDB.java: Renamed getCNIndexData(changeNumber), getFirstCNIndexData(), getLastCNIndexData() to getRecord(changeNumber), getFirstRecord(), getLastRecord(). ChangeNumberIndexDBCursor.java: Renamed getCNIndexData() to getRecord(). *.java: Consequence of these changes. git-svn-id: https://svn.forgerock.org/opendj/trunk@9516 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Reviewed by Violette over IM git-svn-id: https://svn.forgerock.org/opendj/trunk@9515 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
…ex when upgrading from 2.5.0-Xpress Reviewed by Violette over IM git-svn-id: https://svn.forgerock.org/opendj/trunk@9514 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
- removed start task action (unused) - removed verifyTaskType function (unused) - used LDIF.search to retrieve backends (rebuild index works only on 'enabled' backend). - added rebuild all index task. - In case of an upgrade where a rebuild all task is present : . All the other single rebuild indexes are bypass. . Rebuild-all is launched only if the the user wants to. git-svn-id: https://svn.forgerock.org/opendj/trunk@9513 41b1ffd8-f28e-4786-ab96-9950f0a78031
05 Sep, 2013
5 commits
-
…th a dot, unlike Javadoc) git-svn-id: https://svn.forgerock.org/opendj/trunk@9512 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Fixed a few bugs (introduced in the previous commits?): - All code must check that the result of calling ChangeNumberIndexDB.getFirstCNIndexData() and ChangeNumberIndexDB.getLastCNIndexData() are not null (if the DB is empty, or closed, etc.). - In ReplicationServer.clearGenerationId(), the code could have a side effect if the last entry in the DB was cleared by this method: the lastGeneratedChangeNumber would be allowed to go back! ChangeNumberIndexDB.java: Removed getLastChangeNumber(). DraftCNDbHandler.java: Inlined getLastChangeNumber() to the only remaining method caller ReplicationServer.getChangeNumberIndexDB(). Finally changed the implementation of isEmpty() to something less costly. DraftCNDbHandlerTest.java: Inlined getFirstChangeNumber() and getLastChangeNumber(). ReplicationServer.java: In clearGenerationId(), removed the code changing the value of lastGeneratedChangeNumber: lastGeneratedChangeNumber is not allowed to go backward. In getChangeNumberIndexDB(), inlined here the code of DraftCNDbHandler.getLastChangeNumber() + removed useless use of MessageBuilder. In getECLChangeNumberLimits(), added a null check for the result of getLastCNIndexData(). replication.properties: Added a new error message. Changed MILD_ERR_DRAFT_CHANGENUMBER_DATABASE_173 to MILD_ERR_CHANGENUMBER_DATABASE_173. ECLServerHandler.java: In findCookie(), replaced the DB empty checks by null checks on the return of getFirstCNIndexData() and getLastCNIndexData() since this is purely equivalent. git-svn-id: https://svn.forgerock.org/opendj/trunk@9511 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
git-svn-id: https://svn.forgerock.org/opendj/trunk@9510 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Remainder of r9504: changed changeNumber from int to long. git-svn-id: https://svn.forgerock.org/opendj/trunk@9509 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
Added CNIndexData class to replace the conjunct use of the (CSN, baseDN, previousCookie) tuple along with the changeNumber. It allowed to replace: - several parameters list with all theses types - several groups of methods returning instances of these types with duplicate code in the implementation. Remainder of r9504: changed changeNumber from int to long. CNIndexData.java: ADDED *.java: Consequence of introducing CNIndexData class. ECLServerHandler.java: Renamed releaseIterator() into releaseCursor(). In getNextECLUpdate(), aggregated consecutive if statements + added a debugInfo(). Renamed assignNewDraftCNAndStore() to assignNewChangeNumberAndStore(). Changed changeNumber from int to long. ChangeNumberIndexDB.java: Replaced getCSN(), getBaseDN() and getPreviousCookie() by getCNIndexData(). Renamed getFirstChangeNumber() to getFirstCNIndexData(). Added getLastCNIndexData(). Changed add() signature. DraftCNDbHandler.java Consequence of the change to implemented interface ChangeNumberIndexDB. Changed changeNumber from int to long. Added getChangeNumber(). ChangeNumberIndexDBCursor.java: Replaced getCSN(), getBaseDN() and getPreviousCookie() by getCNIndexData(). DraftCNDbIterator.java Consequence of the change to implemented interface ChangeNumberIndexDBCursor. DraftCNData.java: Added changeNumber field + getter. Replaced fields value, baseDN and csn by cnIndexData + getters. Renamed readFirstChangeNumber() and readLastChangeNumber() to readFirstCNIndexData() and readLastCNIndexData(). Added newCNIndexData(). In inner class DraftCNDBCursor, Field key is now a ReplicationDraftCNKey (was DatabaseEntry) + DraftCNData field has been replaced with CNIndexData + entry is initialized on construction. Replaced currentValue(), currentBaseDN(), currentCSN() and currentKey() by currentData(). Removed getKey(). ReplicationDraftCNKey.java: Added a default ctor. In getChangeNumber(), matched the code in DraftCNDB. DraftCNDbHandlerTest.java: Added assertEqualTo(), getFirstChangeNumber(), getLastChangeNumber(), getPreviousCookie(). git-svn-id: https://svn.forgerock.org/opendj/trunk@9508 41b1ffd8-f28e-4786-ab96-9950f0a78031
04 Sep, 2013
2 commits
-
Change one field from Long to long. SearchOperationBasis*.java: Extracted method getSizeLimit() and getTimeLimit(). ExternalChangeLogTest.java: Simplified the code. git-svn-id: https://svn.forgerock.org/opendj/trunk@9506 41b1ffd8-f28e-4786-ab96-9950f0a78031
-
ChangeNumberIndexDB.java: All methods can now throw ChangelogException. ReplicationServer.java: Extracted method shutdownCNIndexDB(). Removed getFirstChangeNumber() and getLastChangeNumber(). DraftCNDbHandler.java: Removed catch blocks and let the exception propagate. ECLServerHandler.java: Let the ChangelogException propagate. ReplicaDBCursor.java: Augmented the javadoc to explain the sort order. Follow up of r9504. git-svn-id: https://svn.forgerock.org/opendj/trunk@9505 41b1ffd8-f28e-4786-ab96-9950f0a78031