24 Sep, 2013

5 commits

  • Silencing annoying warnings in Continuous Integration.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9588 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Silencing annoying warnings in Continuous Integration.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9587 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 
    ReplicationTestCase.java
    Added remove(ReplicationServer...) and stop(ReplicationBroker...).
    
    *Test.java:
    Used the new methods from ReplicationTestCase.
    Used Arrays.fill().
    Removed various redundant methods that had been extracted in the past:
    - GroupIdHandshakeTest.clear()
    - ReplicationServerFailoverTest.clear()
    - ExternalChangeLogTest.stop()
    - ReplicationServerTest.stop()
    - ReplicationServerTest.removeRsAndChangeLog()
    - ReplicationDomainTest.remove())
    
    AssuredReplicationServerTest.java:
    Removed all the rs*Port fields, replaced by rsPorts.
    Removed all the fakeRd* fields, replaced by fakeRDs.
    Extracted methods disableService(), shutdown(), assertFakeDSReceivedAndAcked(), assertFakeRDNbReceivedUpdates(), assertFakeRSNbReceivedUpdates(), checkDSNothingReceivedOrSent(), assertContainsOnly().
    Used more the checkDSSentAndAcked(), checkDSReceivedAndAcked().
    Inlined on createFakeReplicationDomain().
    Removed all sorts of assertNotNull() where the code could never be null.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9582 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Changed after review from Matt.
    
    ChangelogDB.java:
    Removed setReplicationDBDirectory(), now set in JEChangelogDB constructor.
    Renamed getDBDirName() to getDBDirectoryName().
    Improved javadocs.
    
    JEChangelogDB.java:
    Consequence of the changes to ChangelogDB.
    Renamed dbDirName to dbDirectoryName.
    Made 2 fields final.
    Added makeDir().
    
    ReplicationServer.java:
    Consequence of the changes to ChangelogDB.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9581 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • HostPort.java:
    Improved javadocs.
    Improved host normalization for and used remote IP addresses for remote hosts (complies with code from ReplicationServer.java.disconnectRemovedReplicationServers()).
    Renamed normalizedHost() tpo normalizeHost().
    Removed trimming for serverURLs.
    In valueOf(), added a special case to reject unbracketed IPV6 addresses.
    Extracted constant LOCALHOST to avoid typos.
    Reworked the code from isLocalAddress(), equals(), hashCode().
    
    HostPortTest.java:
    Reworked some tests.
    Added new tests.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9580 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

23 Sep, 2013

6 commits

  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9579 41b1ffd8-f28e-4786-ab96-9950f0a78031
    matthew
     
  • LDAPURL.java:
    Weakened urlDecode() visibility from private to package to allow easy unit testing.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9578 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Review CR-2344
    
    NPE occurs in AdministrationConnector#createSelfSignedCertificateIfNeeded method.
    To avoid this, now attempt to create certificate only if initial setup has not been changed. 
    
    * AdministrationConnector.java : 
      - completed method createSelfSignedCertificateIfNeeded to add more checks to detect when initial setup has changed
      - added method hasDefaultConfigChanged to isolate the check
    
    * No unit test added, functional test to be added
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9577 41b1ffd8-f28e-4786-ab96-9950f0a78031
    nicolas.capponi@forgerock.com
     
  • Let's make the build happier.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9576 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 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
    JnRouvignac
     
  • Refactored code to make it more readable.
    Extracted several methods to reduce code duplication.
    Inlined local variables.
    Extracted constants.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9574 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

21 Sep, 2013

2 commits


20 Sep, 2013

7 commits


19 Sep, 2013

8 commits

  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9559 41b1ffd8-f28e-4786-ab96-9950f0a78031
    csovant
     
  • ExternalChangeLogTest.java:
    Reverted the @Test annotation added in r9543.
    Used different backendId and baseDN from other tests to avoid clashing tests in concurrent test runs.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9557 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 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
    JnRouvignac
     
  • …ile when execution path contains whitespace (which is the case when running on Jenkins)
    * Avoid reading twice the value of trustStorePathArg and keyStorePathArg in getConnectionFactory method
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9555 41b1ffd8-f28e-4786-ab96-9950f0a78031
    nicolas.capponi@forgerock.com
     
  • 
    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
    JnRouvignac
     
  • 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
    JnRouvignac
     
  • Review CR-1243
    
    NPE happens when no trust password is given.
    
    * ConnectionFactoryProvider.java : 
      - test for null value before converting to charArray
      - fixed a unrelated copy-paste error (using trustStorePathArg instead of keyStorePathArg)
    
    * Added a test class ConnectionFactoryProviderTest.java to check behavior in case no trust password is given
    * Added a dummy-trustore in test resources, as this is needed for correct behavior of tested method getConnectionFactory
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9552 41b1ffd8-f28e-4786-ab96-9950f0a78031
    nicolas.capponi@forgerock.com
     
  • 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
    JnRouvignac
     

18 Sep, 2013

6 commits

  • * update Rest2LDAP documentation due to new configuration options.
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9549 41b1ffd8-f28e-4786-ab96-9950f0a78031
    matthew
     
  • See code review CR-2269 for more details.
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9548 41b1ffd8-f28e-4786-ab96-9950f0a78031
    matthew
     
  • 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
    JnRouvignac
     
  • 
    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
    JnRouvignac
     
  • Checkstyle mi amor
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9545 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • In toNormalizedString(), complemented the javadoc.
    Comments => javadocs.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9544 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

17 Sep, 2013

6 commits

  • Attempt at fixing random failures for ECLReplicationServerFullTest() in Jenkins.
    It fails because a search finds an additional entry with "targetDN: uid=eclafterchangelogtrim1,o=test" which obviously comes from ECLAfterChangelogTrim() method.
    It looks like this methods are run in parallel, but ReplicationTestCase (ExternalChangeLogTest superclass) specifies to run tests sequentially.
    I am trying to duplicate this annotation in ExternalChangeLogTest in the hope Jenkins will obey it.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9543 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 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
    JnRouvignac
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9541 41b1ffd8-f28e-4786-ab96-9950f0a78031
    cjr
     
  • 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
    JnRouvignac
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9539 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 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
    JnRouvignac