26 Aug, 2013

3 commits

  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9456 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     
  • Introduced interfaces ChangelogDB and ChangelogDBIterator to remove direct dependencies to org.opends.server.replication.server.changelog.je .
    The interfaces remain similar to the old classes DraftCNDbHandler and DraftCNDbIterator, but:
    - I plan to introduce more changes to rework a bit these interfaces
    - They reduce the number of accessible methods for client code
    
    
    ChangelogDB.java: ADDED
    Renamed getValue() to getPreviousCookie().
    
    ChangelogDBIterator.java: ADDED
    Renamed releaseCursor() to close().
    
    
    *.java:
    Consequence of the use of the new interfaces.
    Renamed instance variables, local variables and method parameters to accommodate the new classes.
    Also renamed variables and methods to better explicit their role.	
    Also reworked javadocs and comments.
    
    
    ReplicationServer.java:
    Extracted method contains().
    In getEligibleCN(), reworked the code to avoid computing debug information if debug is off.
    Renamed local variables.
    Removed useless comments.
    
    DraftCNDB.java:
    Removed unused instance member ReplicationServer.
    
    DraftCNDbHandler.java:
    Now implements ChangelogDB.
    Consequence of change to DraftCNDB.
    Extracted method debugException().
    Removed releaseReadCursor() (Replaced by StaticUtils.close()).
    
    DraftCNDbIterator.java:
    Now implements ChangelogDBIterator.
    
    TestCaseUtils.java:
    In deleteDirectory(), added a null check and an exists check.
    
    DbHandlerTest.java, DraftCNDbHandlerTest.java:
    Extracted method createCleanDir().
    Removed now useless checks before calling TestCaseUtils.deleteDirectory().
    Called StaticUtils.close().
    Extracted method assertIteratorReadsInOrder().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9455 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9454 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     

23 Aug, 2013

5 commits


22 Aug, 2013

10 commits

  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9448 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • - Changelog added
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9447 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     
  • Renamed releaseCursor() to close().
    Now extends Closeable.
    
    *.java:
    Consequence of the change to ReplicationIterator.
    
    MessageHandler.java:
    Removed releaseAllIterators() in favour of StaticUtils.close().
    
    ReplicationBackend.java:
    In getEntry(), used early exit.
    Used StaticUtils.close().
    Removed useless comments / code.
    Used interfaces rather than concrete classes.
    Extracted methods computeDN() and writeChangeRecord().
    
    ReplicationServerDomain.java:
    Removed sleep() replaced with StaticUtils.sleep().
    
    StaticUtils.java:
    Made close(Collection) more generic + now log exceptions happening when closing.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9446 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • …e jars nor the ant task.
    Building directly with xjc is preferred and this also makes the war file lighter.
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9445 41b1ffd8-f28e-4786-ab96-9950f0a78031
    ludo
     
  • git-svn-id: https://svn.forgerock.org/opendj/trunk@9444 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Fixed broken early exit.
    
    ServerHandler.java:
    Collapsed comments on one less lines.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9443 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Removed useless duplicated javadocs for getMonitorData.
    
    
    ServerHandler.java:
    Extracted method releaseDomainLock().
    Replaced lockDomain(boolean) with lockDomainNoTimeout() and lockDomainWithTimeout().
    Removed duplicate code from MessageHandler.
    Moved shuttingDown() to ServerHandler.
    
    DataServerHandler.java, ECLServerHandler.java:
    Consequence of the change to ServerHandler.
    
    MessageHandler.java:
    Moved shuttingDown() here from ServerHandler.
    
    ReplicationServerHandler.java
    Consequence of the change to ServerHandler.
    In checkGenerationId(), used early exit.
    Extracted method clearRemoteLSHandlers().
    In processTopoInfoFromRS(), inlined local variables.
    In hasRemoteLDAPServers() and getConnectedDirectoryServerIds(), removed useless and misleading synchronized blocks.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9442 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Removed unused file
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9441 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     
  • - Original data are copied under build/deb/ folder as the process to build the deb package implies to modify the source.
     - Opendj init script has been modified. Indeed, under debian OS (and others) the /var/run/ folder is deleted at reboot, deleting by the same way our pid  file, making the service wobbly.
     - As linux distro use the same opendj file, a new folder was created under resource to store the shared file between them.
     - At last, modified post/prem/specFile as well as the fact to create a symlink on an existing one throws an error. (same when you try to remove one from no-existing)
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9440 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     
  • Code cleanup.
    
    
    MonitoringPublisher.java:
    Removed one call to a setter.
    
    ReplicationDomainMonitor.java:
    Renamed computeDomainMonitorData() to recomputeMonitorData().
    
    ReplicationServerDomain.java:
    Renamed replyWithMonitorMsg() to replyWithTopologyMonitorMsg().
    
    ReplicationDomainTest.java:
    Extracted methods createReplicationServer(), assertExpectedServerStatuses(), disable(), remove().
    Replaced assertTrue() with assertEquals().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9439 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

21 Aug, 2013

6 commits

  • Fixed test break introduced in r9436.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9438 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Renamed fmd field to firstMissingDates.
    Obeyed java naming conventions.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9437 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 
    ReplicationDomainMonitor.java: ADDED
    Extracted from ReplicationServerDomain.
    
    ReplicationServerDomain.java:
    Moved all the code managing the MonitorData to ReplicationDomainMonitor + added domainMonitor instance member.
    In createGlobalTopologyMonitorMsg(), removed the MonitorData parameter.
    Renamed mayResetGenerationId() to resetGenerationIdIfPossible().
    Extracted methods setGenerationIdIfUnset() and getMessage().
    In getConnectedDSs() and getConnectedRSs() returned unmodifiable maps.
    
    MonitoringPublisher.java:
    Renamed instance member replicationServerDomain to domain.
    Consequences of the changes to ReplicationServerDomain.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9436 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • … instance is configured
    - buildinfo is not verified if remote  is detected.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9435 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     
  • - Making private the start*() methods
    - Moved some code to here from some other classes
    - MAking private the buildAndSendTopoInfoTo*() methods.
    
    ReplicationServerDomain.java:
    Extracted method sendTopoInfoToAllExcept().
    Renamed buildAndSendTopoInfoToDSs() to sendTopoInfoToAllDSsExcept() + made it private.
    Renamed buildAndSendTopoInfoToRSs() to sendTopoInfoToAllRSs() + made it private.
    Renamed changeStatusFromStatusAnalyzer() to changeStatus().
    Made startStatusAnalyzer() and startMonitoringPublisher() private.
    Directly used the fields connectedDSs and connectedRSs instead of through their getters.
    Moved 2 register() methods here from DataServerHandler and ReplicationServerHandler.
    Renamed all variables and parameters named "handler" to disambiguated names.
    
    DataServerHandler.java:
    Renamed changeStatusFromStatusAnalyzer() to changeStatus().
    Moved registerIntoDomain() + some other code to ReplicationServerDomain.
    
    ReplicationServerHandler.java:
    Moved registerIntoDomain() + some other code to ReplicationServerDomain.
    
    ReplicationServer.java
    Renamed all variables and parameters named "handler" to disambiguated names.
    Consequence of the change to ReplicationServerDomain.sendTopoInfoToAllExcept().
    
    StatusAnalyzer.java:
    Consequence of the change to ReplicationServerDomain.changeStatusFromStatusAnalyzer().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9434 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • - copyright added
    - doc section added (to complete)
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9433 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     

20 Aug, 2013

5 commits

  • Fixed off-by-one error.
    
    FractionalReplicationTest.java:
    Removed try / catch / fail test anti pattern.
    Removed useless comments.
    Extracted method waitTillEntryHasSynchroAttribute().
    Made attributes private.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9432 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Used interfaces instead of concrete classes.
    Removed useless comments.
    Extracted method addMonitorData().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9431 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Extracted methods newMapIfNull(), getUserOrOperationalAttributes(), getAttributes(), putAttributes(), removeAttributes(), addAllIfNotNull(), onlyKeepAttributesWithAllOptions(), getAttribute(), onlyKeepAttributesWithAllOptions(), addObjectClass(), hasObjectClassOrAttribute(), hasObjectClass(), containsObjectClassByName(), hashCode(), equals(), appendAttributes(), newList().
    Comments to javadoc.
    Used interfaces instead of concrete classes.
    Collapsed if statements.
    Put code on one line where possible.
    
    LDAPReplicationDomain.java:
    Extracted methods isSolveConflict(), needReconnection(), findReplicationSearchResultEntry(), isMandatoryAttribute(), isFractionalProhibited(AttributeType), canRemoveAttribute(), contains(), runAsSynchronizedOperation().
    Removed useless else.
    Used interfaces instead of concrete classes.
    Put code on one line where possible.
    Removed useless comments.
    Simplified code in several places.
    Collapsed if statements.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9430 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • It was due to a side effect of the last commit as well as several locations where cleanup wasn't properly done after a test.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9429 41b1ffd8-f28e-4786-ab96-9950f0a78031
    ludo
     
  • 
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9428 41b1ffd8-f28e-4786-ab96-9950f0a78031
    violette
     

19 Aug, 2013

5 commits

  • …ze(PostOperationOperation op) method. 
    Reviewed by JN, CR-2193.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9427 41b1ffd8-f28e-4786-ab96-9950f0a78031
    ludo
     
  • RSInfo.java, DSInfo.java:
    Made them (almost) immutable classes.
    
    LightweightServerHandler.java:
    Replaced many instance members with just one DSInfo instance member.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9426 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • …nknown function paramter
    - Added README to explain how to start the STAF daemon and run the tests
    
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9425 41b1ffd8-f28e-4786-ab96-9950f0a78031
    csovant
     
  • 
    
    ReplicationServerDomain.java:
    Used AtomicReference for statusAnalyzer and monitoringPublisher.
    As a consequence:
    - Changed update*(), start*() and stop*() methods.
    - Removed isRunning*() methods.
    
    MonitoringPublisher.java:
    Extracted getMessage() to make error messages more conherent.
    
    ServerReader.java:
    In run(), removed redundant code by checking whether the message is a RoutableMsg.
    Extracted method logException().
    In ServerReader.run(), moved some code to ServerHandler.put().
    Code cleanups:
    - inlined useless local variables
    - removed useless use of "this" before method calls.
    
    DataServerHandler.java, ECLServerHandler.java, ReplicationServerHandler.java:
    Extracted method createReplServerStartMsg().
    
    ServerHandler.java:
    Renamed process(WindowProbeMsg) to replyToWindowProbe().
    Made some instance members private.
    Moved createReplServerStartMsg here.
    In put(), moved decAndCheckWindow() call here from ServerReader.run().
    
    WindowProbeMsg.java:
    Fixed javadocs + simplified code.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9424 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • 
    ReplicationServer.java:
    Added getConnectedRSUrls(), that aggregates code from ReplicationServerDomain.getChangelogs() and from runConnect().
    In applyConfigurationChange(), moved code to ReplicationServerDomain for better encapsulation.
    
    ReplicationServerDomain.java:
    Renamed checkForDuplicateDS() into isAlreadyConnectedToDS().
    Renamed checkForDuplicateRS() into isAlreadyConnectedToRS().
    Moved getChangelogs() to ReplicationServer.
    Made several methods private to reduce coupling and enforce class responsibilities.
    Generalized the use of isRunningStatusAnalyzer() and isRunningMonitoringPublisher() to improved readability.
    Inlined updateStatusAnalyzer() and updateMonitoringPublisher().
    Moved code from ... to create updateDegradedStatusThreshold() and updateMonitoringPeriod().
    In stopReplicationServers(), renamed parameter for increased readability.
    
    DataServerHandler.java:
    Inlined createStatusAnalyzer().
    
    ServerHandler.java, ReplicationServerHandler.java:
    Inlined createMonitoringPublisher().
    In lockDomain(), removed useless else.
    Code cleanup.
    
    StatusAnalyzer.java:
    Extracted isInterrupted().
    Extracted getMessage() to make error messages more conherent.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9423 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

14 Aug, 2013

5 commits

  • Renamed directoryServers to connectedDSs.
    Renamed replicationServers to connectedRSs.
    Removed the useless getConnectedLDAPservers(), replaced with getConnectedDSs().
    Renamed a few local variables.
    
    DataServerHandler.java:
    Consequence of removing to ReplicationServerDomain.getConnectedLDAPservers()
    Extracted method changeStatus() from changeStatusFromStatusAnalyzer() and changeStatusForResetGenId().
    Extracted method getStatusMachineEvent() from changeStatusForResetGenId().
    
    InitOnLineTest.java
    Consequence of removing to ReplicationServerDomain.getConnectedLDAPservers().
    Removed useless try / catch / fail.
    Extracted methods getCompletionTime(), assertAttributeValue().
    Used Assertions.assertThat().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9418 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • - Updated i18n/datacomparison reference file
     
    
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9417 41b1ffd8-f28e-4786-ab96-9950f0a78031
    csovant
     
  • In the ctor, renamed parameters.
    In other methods, used early exit.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9416 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Removed ReplicationServerDomain.getReplicationServer() to follow the Law of Demeter: "Only talk to your immediate friends." to promote loose coupling.
    Changed approxFirstMissingDate from Long object to long primitive.
    
    
    ReplicationServerDomain.java:
    Removed getReplicationServer().
    Added getLocalRSMonitorInstanceName() and getLocalRSServerId().
    
    *.java:
    Used the newly added ReplicationServerDomain.getLocalRSMonitorInstanceName() and ReplicationServerDomain.getLocalRSServerId().
    
    LightweightServerHandler.java:
    Removed getLocalRSMonitorInstanceName().
    
    
    MonitorMsg.java, MonitorData.java:
    Changed firstMissingDate from Long object to long primitive.
    Used StringBuilder in toString().
    
    SynchronizationMsgTest.java
    Changed approxFirstMissingDate from Long object to long primitive.
    Extracted methods newList(), newSet(), getEntryAttributes(), assertAttributesEqual().
    Used assertEquals() instead of assertTrue().
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9415 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     
  • Removed avoidable references to replicationServerDomain.getReplicationServer().
    Code cleanups:
    - collapsed if statements
    - applied early exits
    - Replaced useless use of StringBulders with string concatenations
    - Removed useless parentheses
    
    
    *ServerHandler.java:
    Replaced calls to this.replicationServerDomain.getReplicationServer() with directly using this.replicationServer .
    
    DataServerHandler.java:
    Inlined local variables.
    Removed useless catch.
    
    ECLServerHandler.java:
    Extracted method releaseIterator().
    
    LightweightServerHandler.java:
    Extracted method getLocalRSMonitorInstanceName().
    
    ReplicationServerHandler.java
    In isRemoteLDAPServer(), renamed parameter.
    
    
    MessageHandler.java:
    Extracted methods collectAllIteratorsWithChanges(), addIteratorIfNotEmpty(), releaseAllIterators().
    
    ReplicationServerDomain.java
    Renamed replicationServer to localReplicationServer.
    In put(), renamed id to serverId + extracted method publishMessage().
    In getChangelogIterator(), renamed parameter.
    Extracted methods replyWithMonitorMsg(), replyWithUnroutableMsgType(), forwardMsgToAllServers(), replyWithUnreachablePeerMsg() from process().
    Renamed stopDbHandlers() to shutdownDbHandlers().
    Extracted isServerConnected() from getEligibleCN().
    
    
    
    DbHandler.java, JEReplicationIterator.java:
    Renamed parameter.
    
    git-svn-id: https://svn.forgerock.org/opendj/trunk@9414 41b1ffd8-f28e-4786-ab96-9950f0a78031
    JnRouvignac
     

13 Aug, 2013

1 commit