mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

gbellato
27.09.2007 0bd0fe4197cc72c8fed4d520d043d618b2ff9301
This is is the last part of the replication renaming (issue 1090)
and is the renaming of the configuration.

The change in the configurations are quite simples, basically the changelog string
has been replaced by the replication-server and the synchronization string
has been replaced by replication except when it is used as synchronization provider.

The schema is a bit more complex because I've decided to keep the old objectclass
names and the old attribute names as alias of the new names.
This would allow the previous configuration to work, however my testing has shown that
the admin framework does not seem to deal well with objectclass aliases and therefore
this is not entirely true.
1 files deleted
1 files added
2 files renamed
17 files modified
566 ■■■■ changed files
opends/resource/config/replication.ldif 43 ●●●●● patch | view | raw | blame | history
opends/resource/config/synchronization.ldif 43 ●●●●● patch | view | raw | blame | history
opends/resource/schema/02-config.ldif 33 ●●●● patch | view | raw | blame | history
opends/src/admin/defn/org/opends/server/admin/std/MultimasterDomainConfiguration.xml 30 ●●●● patch | view | raw | blame | history
opends/src/admin/defn/org/opends/server/admin/std/MultimasterSynchronizationProviderConfiguration.xml 4 ●●●● patch | view | raw | blame | history
opends/src/admin/defn/org/opends/server/admin/std/ReplicationServerConfiguration.xml 38 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/MultimasterReplication.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java 8 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/plugin/ReplicationServerListener.java 22 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/replication/server/ReplicationServer.java 33 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/InitOnLineTest.java 24 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ProtocolWindowTest.java 45 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReSyncTest.java 26 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java 16 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/SchemaReplicationTest.java 32 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/StressTest.java 51 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java 41 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java 29 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/DbHandlerTest.java 2 ●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplServerFakeConfiguration.java 24 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java 20 ●●●● patch | view | raw | blame | history
opends/resource/config/replication.ldif
New file
@@ -0,0 +1,43 @@
# Use this file as an example of the Multi-master replication configuration.
# The content of this file should be edited and
# added to the config.ldif file to enable replication.
#
# Each synchronized base DN must be specified using entry similar to
# cn=example, cn=domains, cn=Multimaster Synchronization,cn=Synchronization Providers,cn=config.
# Each server must have its own unique server ID defined in ds-cfg-server-id.
# Each replication server must be enabled using the
# cn=Replication Server, cn=Multimaster Synchronization, cn=Synchronization Providers, cn=config
# entry.
dn: cn=Multimaster Synchronization,cn=Synchronization Providers,cn=config
objectClass: top
objectClass: ds-cfg-synchronization-provider
objectClass: ds-cfg-multimaster-synchronization-provider
ds-cfg-synchronization-provider-enabled: true
ds-cfg-synchronization-provider-class: org.opends.server.replication.plugin.MultimasterReplication
dn: cn=domains, cn=Multimaster Synchronization,cn=Synchronization Providers,cn=config
objectClass: top
objectClass: ds-cfg-branch
cn: domains
dn: cn=example, cn=domains, cn=Multimaster Synchronization,cn=Synchronization Providers,cn=config
objectClass: top
objectClass: ds-cfg-replication-domain-config
cn: example
ds-cfg-replication-dn: dc=example,dc=com
ds-cfg-replication-server: localhost:8989
ds-cfg-replication-server: localhost:8990
ds-cfg-directory-server-id: 1
ds-cfg-receive-status: true
dn: cn=Replication Server, cn=Multimaster Synchronization, cn=Synchronization Providers, cn=config
objectClass: top
objectClass: ds-cfg-replication-server-config
cn: Replication Server
ds-cfg-replication-server-port: 8989
ds-cfg-replication-server: localhost:8989
ds-cfg-replication-server: localhost:8990
ds-cfg-replication-server-id: 1
opends/resource/config/synchronization.ldif
File was deleted
opends/resource/schema/02-config.ldif
@@ -525,15 +525,15 @@
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
  X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.158
  NAME 'ds-cfg-changelog-port'
  NAME ( 'ds-cfg-replication-server-port' 'ds-cfg-changelog-port' )
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
  X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.290
  NAME 'ds-cfg-changelog-max-queue-size'
  NAME ( 'ds-cfg-replication-max-queue-size' 'ds-cfg-changelog-max-queue-size' )
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
  SINGLE-VALUE X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.278
  NAME 'ds-cfg-changelog-server-id'
  NAME ( 'ds-cfg-replication-server-id' 'ds-cfg-changelog-server-id' )
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
  X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.279
@@ -541,7 +541,7 @@
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
  X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.160
  NAME 'ds-cfg-changelog-server'
  NAME ( 'ds-cfg-replication-server' 'ds-cfg-changelog-server' )
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
  X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.161
@@ -774,7 +774,7 @@
  NAME 'ds-task-restart-server' SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
  SINGLE-VALUE X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.226
  NAME 'ds-cfg-synchronization-dn'
  NAME ( 'ds-cfg-replication-dn' 'ds-cfg-synchronization-dn' )
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.12
  SINGLE-VALUE X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.227 NAME 'ds-sync-state'
@@ -1046,7 +1046,8 @@
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE
  X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.306
  NAME 'ds-cfg-changelog-db-directory'
  NAME ( 'ds-cfg-replication-db-directory'
         'ds-cfg-changelog-db-directory' )
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE
  X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.307
@@ -1088,7 +1089,7 @@
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE
  X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.319
  NAME 'ds-cfg-changelog-purge-delay'
  NAME ( 'ds-cfg-replication-purge-delay' 'ds-cfg-changelog-purge-delay' )
  SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE
  X-ORIGIN 'OpenDS Directory Server' )
attributeTypes: ( 1.3.6.1.4.1.26027.1.1.321
@@ -1448,9 +1449,10 @@
  MUST ( ds-cfg-synchronization-provider-class $
  ds-cfg-synchronization-provider-enabled ) X-ORIGIN 'OpenDS Directory Server' )
objectClasses: ( 1.3.6.1.4.1.26027.1.2.58 NAME
  'ds-cfg-synchronization-provider-config' SUP top
  STRUCTURAL MUST ( ds-cfg-changelog-server $ ds-cfg-directory-server-id
  $ ds-cfg-synchronization-dn )
  ( 'ds-cfg-replication-domain-config'
    'ds-cfg-synchronization-provider-config' ) SUP top
  STRUCTURAL MUST ( ds-cfg-replication-server $ ds-cfg-directory-server-id
  $ ds-cfg-replication-dn )
  MAY ( cn $ ds-cfg-receive-status $ ds-cfg-max-receive-queue $
  ds-cfg-max-receive-delay $ ds-cfg-max-send-queue $ ds-cfg-max-send-delay $
  ds-cfg-window-size $ ds-cfg-heartbeat-interval )
@@ -1507,11 +1509,12 @@
  ds-task-import-is-encrypted )
  X-ORIGIN 'OpenDS Directory Server' )
objectClasses: ( 1.3.6.1.4.1.26027.1.2.65 NAME
  'ds-cfg-synchronization-changelog-server-config' SUP top
  STRUCTURAL MUST (ds-cfg-changelog-server-id $ ds-cfg-changelog-port )
  MAY ( ds-cfg-changelog-server $ cn $ ds-cfg-window-size $
  ds-cfg-changelog-max-queue-size $ds-cfg-changelog-db-directory )
  X-ORIGIN 'OpenDS Directory Server' )
  ( 'ds-cfg-replication-server-config'
    'ds-cfg-synchronization-changelog-server-config' ) SUP top STRUCTURAL
    MUST (ds-cfg-replication-server-id $ ds-cfg-replication-server-port )
    MAY ( ds-cfg-replication-server $ cn $ ds-cfg-window-size $
          ds-cfg-replication-max-queue-size $ ds-cfg-replication-db-directory )
    X-ORIGIN 'OpenDS Directory Server' )
objectClasses: ( 1.3.6.1.4.1.26027.1.2.66 NAME 'ds-backup-directory'
  SUP top STRUCTURAL MUST ( ds-backup-directory-path $ ds-backup-backend-dn )
  X-ORIGIN 'OpenDS Directory Server' )
opends/src/admin/defn/org/opends/server/admin/std/MultimasterDomainConfiguration.xml
@@ -13,14 +13,14 @@
  <adm:profile name="ldap">
    <ldap:object-class>
      <ldap:oid>1.3.6.1.4.1.26027.1.2.58</ldap:oid>
      <ldap:name>ds-cfg-synchronization-provider-config</ldap:name>
      <ldap:name>ds-cfg-replication-domain-config</ldap:name>
      <ldap:superior>top</ldap:superior>
    </ldap:object-class>
  </adm:profile>
  <adm:property name="changelog-server" multi-valued="true"
  <adm:property name="replication-server" multi-valued="true"
    mandatory="true">
    <adm:synopsis>
      Specifies the addresses of the changelog server to which this
      Specifies the addresses of the replication server to which this
      <adm:user-friendly-name />
      should try to connect at startup time.
    </adm:synopsis>
@@ -36,7 +36,7 @@
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:oid>1.3.6.1.4.1.26027.1.1.160</ldap:oid>
        <ldap:name>ds-cfg-changelog-server</ldap:name>
        <ldap:name>ds-cfg-replication-server</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
@@ -61,7 +61,7 @@
      </ldap:attribute>
    </adm:profile>
  </adm:property>
  <adm:property name="synchronization-dn" mandatory="true"
  <adm:property name="replication-dn" mandatory="true"
    multi-valued="false" read-only="true">
    <adm:synopsis>
      Specifies the base dn of the Multimaster Domain
@@ -72,14 +72,14 @@
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:oid>1.3.6.1.4.1.26027.1.1.226</ldap:oid>
        <ldap:name>ds-cfg-synchronization-dn</ldap:name>
        <ldap:name>ds-cfg-replication-dn</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
  <adm:property name="max-receive-queue" mandatory="false"
    multi-valued="false">
    <adm:synopsis>
      Specifies the maximum length of the receive queue on the changelog
      Specifies the maximum length of the receive queue on the replication
      server before flow control must be activated.
    </adm:synopsis>
    <adm:default-behavior>
@@ -100,7 +100,7 @@
  <adm:property name="max-receive-delay" mandatory="false"
    multi-valued="false">
    <adm:synopsis>
      Specifies the maximum delay on the changelog server before flow
      Specifies the maximum delay on the replication server before flow
      control must be activated.
    </adm:synopsis>
    <adm:default-behavior>
@@ -122,7 +122,7 @@
  <adm:property name="max-send-queue" mandatory="false"
    multi-valued="false">
    <adm:synopsis>
      Specifies the maximum length of the send queue on the changelog
      Specifies the maximum length of the send queue on the replication
      server before flow control must be activated.
    </adm:synopsis>
    <adm:default-behavior>
@@ -143,7 +143,7 @@
  <adm:property name="max-send-delay" mandatory="false"
    multi-valued="false">
    <adm:synopsis>
      Specifies the maximum send delay on the changelog server before
      Specifies the maximum send delay on the replication server before
      flow control must be activated.
    </adm:synopsis>
    <adm:default-behavior>
@@ -166,7 +166,7 @@
    multi-valued="false">
    <adm:synopsis>
      Specifies the window size that will this Domain must use when
      communicating with changelog servers.
      communicating with replication servers.
    </adm:synopsis>
    <adm:default-behavior>
      <adm:defined>
@@ -187,14 +187,14 @@
    multi-valued="false">
    <adm:synopsis>
      Specifies the heartbeat interval that this Domain must use when
      communicating with changelog servers. The Domain will expect
      regular heatbeat coming from the changelog server with this
      communicating with replication servers. The Domain will expect
      regular heatbeat coming from the replication server with this
      interval if they are not received it will close its connection and
      connect to another changelog server.
      connect to another replication server.
    </adm:synopsis>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>1000s</adm:value>
        <adm:value>1000ms</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
opends/src/admin/defn/org/opends/server/admin/std/MultimasterSynchronizationProviderConfiguration.xml
@@ -24,10 +24,10 @@
      <ldap:rdn-sequence>cn=domains</ldap:rdn-sequence>
    </adm:profile>
  </adm:relation>
  <adm:relation name="changelog-server">
  <adm:relation name="replication-server">
    <adm:one-to-zero-or-one />
    <adm:profile name="ldap">
      <ldap:rdn-sequence>cn=changelog server</ldap:rdn-sequence>
      <ldap:rdn-sequence>cn=replication server</ldap:rdn-sequence>
    </adm:profile>
  </adm:relation>
</adm:managed-object>
opends/src/admin/defn/org/opends/server/admin/std/ReplicationServerConfiguration.xml
File was renamed from opends/src/admin/defn/org/opends/server/admin/std/ChangelogServerConfiguration.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adm:managed-object name="changelog-server"
  plural-name="changelog-servers" package="org.opends.server.admin.std"
<adm:managed-object name="replication-server"
  plural-name="replication-servers" package="org.opends.server.admin.std"
  xmlns:adm="http://www.opends.org/admin"
  xmlns:ldap="http://www.opends.org/admin-ldap">
  <adm:synopsis>
@@ -13,15 +13,15 @@
    <ldap:object-class>
      <ldap:oid>1.3.6.1.4.1.26027.1.2.65</ldap:oid>
      <ldap:name>
        ds-cfg-synchronization-changelog-server-config
        ds-cfg-replication-server-config
      </ldap:name>
      <ldap:superior>top</ldap:superior>
    </ldap:object-class>
  </adm:profile>
  <adm:property name="changelog-server" multi-valued="true"
  <adm:property name="replication-server" multi-valued="true"
    mandatory="false">
    <adm:synopsis>
      Specifies the addresses of the changelog server to which this
      Specifies the addresses of the replication server to which this
      <adm:user-friendly-name />
      should try to connect at startup time.
    </adm:synopsis>
@@ -40,17 +40,17 @@
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:oid>1.3.6.1.4.1.26027.1.1.160</ldap:oid>
        <ldap:name>ds-cfg-changelog-server</ldap:name>
        <ldap:name>ds-cfg-replication-server</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
  <adm:property name="changelog-server-id" multi-valued="false"
  <adm:property name="replication-server-id" multi-valued="false"
    mandatory="true" read-only="true">
    <adm:synopsis>
      Specifies the server ID of this Changelog Server
      Specifies the server ID of this Replication Server
    </adm:synopsis>
    <adm:description>
      Each Changelog Server must have a different server ID.
      Each Replication Server must have a different server ID.
    </adm:description>
    <adm:requires-admin-action>
      <adm:none />
@@ -61,7 +61,7 @@
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:oid>1.3.6.1.4.1.26027.1.1.278</ldap:oid>
        <ldap:name>ds-cfg-changelog-server-id</ldap:name>
        <ldap:name>ds-cfg-replication-server-id</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
@@ -69,7 +69,7 @@
    multi-valued="false">
    <adm:synopsis>
      Specifies the window size that will this Domain must use when
      communicating with changelog servers.
      communicating with replication servers.
    </adm:synopsis>
    <adm:default-behavior>
      <adm:defined>
@@ -103,11 +103,11 @@
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:oid>1.3.6.1.4.1.26027.1.1.290</ldap:oid>
        <ldap:name>ds-cfg-changelog-max-queue-size</ldap:name>
        <ldap:name>ds-cfg-replication-max-queue-size</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
  <adm:property name="changelog-db-directory" mandatory="false"
  <adm:property name="replication-db-directory" mandatory="false"
    hidden="false" multi-valued="false" read-only="true">
    <adm:synopsis>
      The path where the
@@ -123,11 +123,11 @@
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:oid>1.3.6.1.4.1.26027.1.1.306</ldap:oid>
        <ldap:name>ds-cfg-changelog-db-directory</ldap:name>
        <ldap:name>ds-cfg-replication-db-directory</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
  <adm:property name="changelog-purge-delay" multi-valued="false">
  <adm:property name="replication-purge-delay" multi-valued="false">
    <adm:synopsis>
      The time (in seconds) after which the
      <adm:user-friendly-name />
@@ -144,16 +144,16 @@
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:oid>1.3.6.1.4.1.26027.1.1.319</ldap:oid>
        <ldap:name>ds-cfg-changelog-purge-delay</ldap:name>
        <ldap:name>ds-cfg-replication-purge-delay</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
  <adm:property name="changelog-port" mandatory="true"
  <adm:property name="replication-port" mandatory="true"
    multi-valued="false">
    <adm:synopsis>
      The port on which this
      <adm:user-friendly-name></adm:user-friendly-name>
      will wait for connections from other Changelog Servers or LDAP
      will wait for connections from other Replication Servers or LDAP
      Servers or from LDAP servers.
    </adm:synopsis>
    <adm:requires-admin-action>
@@ -165,7 +165,7 @@
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:oid>1.3.6.1.4.1.26027.1.1.158</ldap:oid>
        <ldap:name>ds-cfg-changelog-port</ldap:name>
        <ldap:name>ds-cfg-replication-server-port</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
opends/src/server/org/opends/server/replication/plugin/MultimasterReplication.java
@@ -535,7 +535,7 @@
  public ConfigChangeResult applyConfigurationDelete(
      MultimasterDomainCfg configuration)
  {
    DN dn = configuration.getSynchronizationDN();
    DN dn = configuration.getReplicationDN();
    ReplicationDomain domain = domains.remove(dn);
    if (domain != null)
      domain.shutdown();
opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java
@@ -277,9 +277,9 @@
    super("replication flush");
    // Read the configuration parameters.
    replicationServers = configuration.getChangelogServer();
    replicationServers = configuration.getReplicationServer();
    serverId = (short) configuration.getServerId();
    baseDN = configuration.getSynchronizationDN();
    baseDN = configuration.getReplicationDN();
    maxReceiveQueue = configuration.getMaxReceiveQueue();
    maxReceiveDelay = (int) configuration.getMaxReceiveDelay();
    maxSendQueue = configuration.getMaxSendQueue();
@@ -2786,7 +2786,7 @@
  {
    // Check that there is not already a domain with the same DN
    // TODO : Check that the server id is a short
    DN dn = configuration.getSynchronizationDN();
    DN dn = configuration.getReplicationDN();
    if (MultimasterReplication.findDomain(dn,null) != null)
    {
      String message = getMessage(MSGID_SYNC_INVALID_DN, dn.toString());
@@ -2805,7 +2805,7 @@
    // server id and base dn are readonly.
    // The other parameters needs to be renegociated with the ReplicationServer.
    // so that requires restarting the session with the ReplicationServer.
    replicationServers = configuration.getChangelogServer();
    replicationServers = configuration.getReplicationServer();
    maxReceiveQueue = configuration.getMaxReceiveQueue();
    maxReceiveDelay = (int) configuration.getMaxReceiveDelay();
    maxSendQueue = configuration.getMaxSendQueue();
opends/src/server/org/opends/server/replication/plugin/ReplicationServerListener.java
@@ -30,8 +30,8 @@
import org.opends.server.admin.server.ConfigurationAddListener;
import org.opends.server.admin.server.ConfigurationDeleteListener;
import org.opends.server.admin.std.server.ChangelogServerCfg;
import org.opends.server.admin.std.server.MultimasterSynchronizationProviderCfg;
import org.opends.server.admin.std.server.ReplicationServerCfg;
import org.opends.server.config.ConfigException;
import org.opends.server.replication.server.ReplicationServer;
import org.opends.server.types.ConfigChangeResult;
@@ -44,8 +44,8 @@
 *
 */
public class ReplicationServerListener
       implements ConfigurationAddListener<ChangelogServerCfg>,
       ConfigurationDeleteListener<ChangelogServerCfg>
       implements ConfigurationAddListener<ReplicationServerCfg>,
       ConfigurationDeleteListener<ReplicationServerCfg>
{
  ReplicationServer replicationServer = null;
@@ -64,12 +64,12 @@
      MultimasterSynchronizationProviderCfg configuration)
      throws ConfigException
  {
    configuration.addChangelogServerAddListener(this);
    configuration.addChangelogServerDeleteListener(this);
    configuration.addReplicationServerAddListener(this);
    configuration.addReplicationServerDeleteListener(this);
    if (configuration.hasChangelogServer())
    if (configuration.hasReplicationServer())
    {
      ChangelogServerCfg server = configuration.getChangelogServer();
      ReplicationServerCfg server = configuration.getReplicationServer();
      replicationServer = new ReplicationServer(server);
    }
  }
@@ -78,7 +78,7 @@
   * {@inheritDoc}
   */
  public ConfigChangeResult applyConfigurationAdd(
      ChangelogServerCfg configuration)
      ReplicationServerCfg configuration)
  {
    try
    {
@@ -96,7 +96,7 @@
   * {@inheritDoc}
   */
  public boolean isConfigurationAddAcceptable(
      ChangelogServerCfg configuration, List<String> unacceptableReasons)
      ReplicationServerCfg configuration, List<String> unacceptableReasons)
  {
    return ReplicationServer.isConfigurationAcceptable(
      configuration, unacceptableReasons);
@@ -115,7 +115,7 @@
   * {@inheritDoc}
   */
  public ConfigChangeResult applyConfigurationDelete(
      ChangelogServerCfg configuration)
      ReplicationServerCfg configuration)
  {
    // There can be only one replicationServer, just shutdown the
    // replicationServer currently configured.
@@ -130,7 +130,7 @@
   * {@inheritDoc}
   */
  public boolean isConfigurationDeleteAcceptable(
      ChangelogServerCfg configuration, List<String> unacceptableReasons)
      ReplicationServerCfg configuration, List<String> unacceptableReasons)
  {
    return true;
  }
opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -29,7 +29,6 @@
import static org.opends.server.loggers.Error.logError;
import static org.opends.server.messages.MessageHandler.getMessage;
import static org.opends.server.messages.ReplicationMessages.*;
import static org.opends.server.util.ServerConstants.*;
import static org.opends.server.util.StaticUtils.getFileForPath;
import java.io.File;
@@ -46,7 +45,7 @@
import java.util.Set;
import org.opends.server.admin.server.ConfigurationChangeListener;
import org.opends.server.admin.std.server.ChangelogServerCfg;
import org.opends.server.admin.std.server.ReplicationServerCfg;
import org.opends.server.api.ConfigurableComponent;
import org.opends.server.api.DirectoryThread;
import org.opends.server.config.ConfigAttribute;
@@ -73,7 +72,7 @@
 */
public class ReplicationServer
  implements Runnable, ConfigurableComponent,
             ConfigurationChangeListener<ChangelogServerCfg>
             ConfigurationChangeListener<ReplicationServerCfg>
{
  private short serverId;
  private String serverURL;
@@ -95,7 +94,7 @@
  private String localURL = "null";
  private boolean shutdown = false;
  private short changelogServerId;
  private short replicationServerId;
  private DN configDn;
  private List<ConfigAttribute> configAttributes =
          new ArrayList<ConfigAttribute>();
@@ -112,19 +111,19 @@
   * @param configuration The configuration of this replication server.
   * @throws ConfigException When Configuration is invalid.
   */
  public ReplicationServer(ChangelogServerCfg configuration)
  public ReplicationServer(ReplicationServerCfg configuration)
         throws ConfigException
  {
    shutdown = false;
    runListen = true;
    int changelogPort = configuration.getChangelogPort();
    changelogServerId = (short) configuration.getChangelogServerId();
    replicationServers = configuration.getChangelogServer();
    int replicationPort = configuration.getReplicationPort();
    replicationServerId = (short) configuration.getReplicationServerId();
    replicationServers = configuration.getReplicationServer();
    if (replicationServers == null)
      replicationServers = new ArrayList<String>();
    queueSize = configuration.getQueueSize();
    trimAge = configuration.getChangelogPurgeDelay();
    dbDirname = configuration.getChangelogDbDirectory();
    trimAge = configuration.getReplicationPurgeDelay();
    dbDirname = configuration.getReplicationDbDirectory();
    rcvWindow = configuration.getWindowSize();
    if (dbDirname == null)
    {
@@ -145,7 +144,7 @@
          e.getMessage() + " " + getFileForPath(dbDirname));
    }
    initialize(changelogServerId, changelogPort);
    initialize(replicationServerId, replicationPort);
    configuration.addChangeListener(this);
  }
@@ -248,7 +247,7 @@
       */
      for (ReplicationCache replicationCache: baseDNs.values())
      {
        Set<String> connectedChangelogs = replicationCache.getChangelogs();
        Set<String> connectedReplServers = replicationCache.getChangelogs();
        /*
         * check that all replication server in the config are in the connected
         * Set. If not create the connection
@@ -256,7 +255,7 @@
        for (String serverURL : replicationServers)
        {
          if ((serverURL.compareTo(this.serverURL) != 0) &&
              (!connectedChangelogs.contains(serverURL)))
              (!connectedReplServers.contains(serverURL)))
          {
            this.connect(serverURL, replicationCache.getBaseDn());
          }
@@ -474,9 +473,9 @@
   * @return true if the configuration is acceptable, false other wise.
   */
  public static boolean isConfigurationAcceptable(
      ChangelogServerCfg configuration, List<String> unacceptableReasons)
      ReplicationServerCfg configuration, List<String> unacceptableReasons)
  {
    int port = configuration.getChangelogPort();
    int port = configuration.getReplicationPort();
    try
    {
@@ -499,7 +498,7 @@
   * {@inheritDoc}
   */
  public ConfigChangeResult applyConfigurationChange(
      ChangelogServerCfg configuration)
      ReplicationServerCfg configuration)
  {
    // TODO : implement this
    return new ConfigChangeResult(ResultCode.SUCCESS, false);
@@ -509,7 +508,7 @@
   * {@inheritDoc}
   */
  public boolean isConfigurationChangeAcceptable(
      ChangelogServerCfg configuration, List<String> unacceptableReasons)
      ReplicationServerCfg configuration, List<String> unacceptableReasons)
  {
    // TODO : implement this
    return true;
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/InitOnLineTest.java
@@ -178,7 +178,7 @@
    // Add config entries to the current DS server based on :
    // Add the replication plugin: synchroPluginEntry & synchroPluginStringDN
    // Add synchroServerEntry
    // Add changeLogEntry
    // Add replServerEntry
    configureReplication();
    taskInitFromS2 = TestCaseUtils.makeEntry(
@@ -220,8 +220,8 @@
    + "ds-cfg-changelog-server-id: 1\n"
    + "ds-cfg-window-size: " + WINDOW_SIZE + "\n"
    + "ds-cfg-changelog-max-queue-size: " + CHANGELOG_QUEUE_SIZE;
    changeLogEntry = TestCaseUtils.entryFromLdifString(changeLogLdif);
    changeLogEntry = null;
    replServerEntry = TestCaseUtils.entryFromLdifString(changeLogLdif);
    replServerEntry = null;
  }
@@ -824,7 +824,7 @@
      connectServer1ToChangelog(changelog1ID);
      if (server2 == null)
        server2 = openChangelogSession(DN.decode("dc=example,dc=com"),
        server2 = openReplicationSession(DN.decode("dc=example,dc=com"),
          server2ID, 100, getChangelogPort(changelog1ID), 1000, emptyOldChanges);
      Thread.sleep(2000);
@@ -880,7 +880,7 @@
    addTestEntriesToDB();
    if (server2 == null)
      server2 = openChangelogSession(DN.decode("dc=example,dc=com"),
      server2 = openReplicationSession(DN.decode("dc=example,dc=com"),
        server2ID, 100, getChangelogPort(changelog1ID), 1000, emptyOldChanges);
    Thread.sleep(3000);
@@ -916,7 +916,7 @@
    // S1 is the server we are running in, S2 is simulated by a broker
    if (server2 == null)
      server2 = openChangelogSession(DN.decode("dc=example,dc=com"),
      server2 = openReplicationSession(DN.decode("dc=example,dc=com"),
        server2ID, 100, getChangelogPort(changelog1ID), 1000, emptyOldChanges);
    Thread.sleep(1000);
@@ -956,10 +956,10 @@
    // S1 is the server we are running in, S2 and S3 are simulated by brokers
    if (server2==null)
      server2 = openChangelogSession(DN.decode("dc=example,dc=com"),
      server2 = openReplicationSession(DN.decode("dc=example,dc=com"),
        server2ID, 100, getChangelogPort(changelog1ID), 1000, emptyOldChanges);
    ReplicationBroker server3 = openChangelogSession(DN.decode("dc=example,dc=com"),
    ReplicationBroker server3 = openReplicationSession(DN.decode("dc=example,dc=com"),
        server3ID, 100, getChangelogPort(changelog1ID), 1000, emptyOldChanges);
    Thread.sleep(1000);
@@ -997,7 +997,7 @@
      // S1 is the server we are running in, S2 is simulated by a broker
      if (server2==null)
        server2 = openChangelogSession(DN.decode("dc=example,dc=com"),
        server2 = openReplicationSession(DN.decode("dc=example,dc=com"),
          server2ID, 100, getChangelogPort(changelog1ID), 1000, emptyOldChanges);
      // Creates config to synchronize suffix
@@ -1180,7 +1180,7 @@
    // connected to changelog2
    if (server2 == null)
    {
      server2 = openChangelogSession(DN.decode("dc=example,dc=com"),
      server2 = openReplicationSession(DN.decode("dc=example,dc=com"),
        server2ID, 100, getChangelogPort(changelog2ID), 1000, emptyOldChanges);
    }
@@ -1226,7 +1226,7 @@
    // Connect a broker acting as server 2 to changelog2
    if (server2 == null)
    {
      server2 = openChangelogSession(DN.decode("dc=example,dc=com"),
      server2 = openReplicationSession(DN.decode("dc=example,dc=com"),
        server2ID, 100, getChangelogPort(changelog2ID),
        1000, emptyOldChanges);
    }
@@ -1359,7 +1359,7 @@
    // Connect a broker acting as server 2 to changelog2
    if (server2 == null)
    {
      server2 = openChangelogSession(DN.decode("dc=example,dc=com"),
      server2 = openReplicationSession(DN.decode("dc=example,dc=com"),
        server2ID, 100, getChangelogPort(changelog1ID),
        1000, emptyOldChanges);
    }
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ProtocolWindowTest.java
@@ -30,6 +30,7 @@
import static org.opends.server.loggers.Error.logError;
import static org.testng.Assert.*;
import java.net.ServerSocket;
import java.net.SocketTimeoutException;
import java.util.ArrayList;
import java.util.LinkedHashSet;
@@ -70,7 +71,7 @@
public class ProtocolWindowTest extends ReplicationTestCase
{
  private static final int WINDOW_SIZE = 10;
  private static final int CHANGELOG_QUEUE_SIZE = 100;
  private static final int REPLICATION_QUEUE_SIZE = 100;
  private static final String REPLICATION_STRESS_TEST =
    "Replication Stress Test";
@@ -79,6 +80,7 @@
   * A "person" entry
   */
  protected Entry personEntry;
  private int replServerPort;
  /**
   * Test the window mechanism by :
@@ -98,8 +100,8 @@
    final DN baseDn = DN.decode("ou=People,dc=example,dc=com");
    ReplicationBroker broker = openChangelogSession(baseDn, (short) 13,
        WINDOW_SIZE, 8989, 1000, true);
    ReplicationBroker broker = openReplicationSession(baseDn, (short) 13,
        WINDOW_SIZE, replServerPort, 1000, true);
    try {
@@ -110,7 +112,7 @@
       */
      Thread.sleep(1500);
      assertTrue(checkWindows(WINDOW_SIZE));
      assertTrue(checkChangelogQueueSize(CHANGELOG_QUEUE_SIZE));
      assertTrue(checkChangelogQueueSize(REPLICATION_QUEUE_SIZE));
      // Create an Entry (add operation) that will be later used in the test.
      Entry tmp = personEntry.duplicate(false);
@@ -139,7 +141,7 @@
      // send (2 * window + replicationServer queue) modify operations
      // so that window + replicationServer queue get stuck in the replicationServer queue
      int count = WINDOW_SIZE * 2 + CHANGELOG_QUEUE_SIZE;
      int count = WINDOW_SIZE * 2 + REPLICATION_QUEUE_SIZE;
      processModify(count);
      // let some time to the message to reach the replicationServer client
@@ -221,7 +223,7 @@
        new ASN1OctetString("cn=monitor"),
        SearchScope.WHOLE_SUBTREE,
        LDAPFilter.decode("(waiting-changes=" +
            (CHANGELOG_QUEUE_SIZE + WINDOW_SIZE) + ")"));
            (REPLICATION_QUEUE_SIZE + WINDOW_SIZE) + ")"));
    assertEquals(op.getResultCode(), ResultCode.SUCCESS);
    return (op.getEntriesSent() == 1);
@@ -274,26 +276,31 @@
    synchroPluginStringDN = "cn=Multimaster Synchronization, "
        + synchroStringDN;
    // find  a free port for the replicationServer
    ServerSocket socket = TestCaseUtils.bindFreePort();
    replServerPort = socket.getLocalPort();
    socket.close();
    // Change log
    String changeLogStringDN = "cn=Changelog Server, " + synchroPluginStringDN;
    String changeLogLdif = "dn: " + changeLogStringDN + "\n"
    String replServerLdif =
      "dn: " + "cn=Replication Server, " + synchroPluginStringDN + "\n"
        + "objectClass: top\n"
        + "objectClass: ds-cfg-synchronization-changelog-server-config\n"
        + "cn: Changelog Server\n" + "ds-cfg-changelog-port: 8989\n"
        + "ds-cfg-changelog-server-id: 1\n"
        + "objectClass: ds-cfg-replication-server-config\n"
        + "cn: Replication Server\n"
        + "ds-cfg-replication-server-port: " + replServerPort + "\n"
        + "ds-cfg-replication-server-id: 1\n"
        + "ds-cfg-window-size: " + WINDOW_SIZE + "\n"
        + "ds-cfg-changelog-max-queue-size: " + CHANGELOG_QUEUE_SIZE;
    changeLogEntry = TestCaseUtils.entryFromLdifString(changeLogLdif);
        + "ds-cfg-replication-max-queue-size: " + REPLICATION_QUEUE_SIZE;
    replServerEntry = TestCaseUtils.entryFromLdifString(replServerLdif);
    // suffix synchronized
    String synchroServerStringDN =
      "cn=example, cn=domains, " + synchroPluginStringDN;
    String synchroServerLdif = "dn: " + synchroServerStringDN + "\n"
    String synchroServerLdif =
      "dn: " + "cn=example, cn=domains, " + synchroPluginStringDN + "\n"
        + "objectClass: top\n"
        + "objectClass: ds-cfg-synchronization-provider-config\n"
        + "objectClass: ds-cfg-replication-domain-config\n"
        + "cn: example\n"
        + "ds-cfg-synchronization-dn: ou=People,dc=example,dc=com\n"
        + "ds-cfg-changelog-server: localhost:8989\n"
        + "ds-cfg-replication-dn: ou=People,dc=example,dc=com\n"
        + "ds-cfg-replication-server: localhost:" + replServerPort + "\n"
        + "ds-cfg-directory-server-id: 1\n"
        + "ds-cfg-receive-status: true\n"
        + "ds-cfg-window-size: " + WINDOW_SIZE;
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReSyncTest.java
@@ -73,7 +73,7 @@
    // find  a free port for the replicationServer
    ServerSocket socket = TestCaseUtils.bindFreePort();
    int changelogPort = socket.getLocalPort();
    int replServerPort = socket.getLocalPort();
    socket.close();
    // Create an internal connection
@@ -91,25 +91,25 @@
        + synchroStringDN;
    // Change log
    String changeLogStringDN = "cn=Changelog Server, " + synchroPluginStringDN;
    String changeLogLdif = "dn: " + changeLogStringDN + "\n"
    String replServerLdif =
      "dn: " + "cn=Replication Server, " + synchroPluginStringDN + "\n"
        + "objectClass: top\n"
        + "objectClass: ds-cfg-synchronization-changelog-server-config\n"
        + "cn: Changelog Server\n"
        + "ds-cfg-changelog-port:" + changelogPort + "\n"
        + "ds-cfg-changelog-server-id: 1\n";
    changeLogEntry = TestCaseUtils.entryFromLdifString(changeLogLdif);
        + "objectClass: ds-cfg-replication-server-config\n"
        + "cn: Replication Server\n"
        + "ds-cfg-replication-server-port:" + replServerPort + "\n"
        + "ds-cfg-replication-server-id: 1\n";
    replServerEntry = TestCaseUtils.entryFromLdifString(replServerLdif);
    // suffix synchronized
    String synchroServerLdif =
    String domainLdif =
      "dn: cn=example, cn=domains, " + synchroPluginStringDN + "\n"
        + "objectClass: top\n"
        + "objectClass: ds-cfg-synchronization-provider-config\n"
        + "objectClass: ds-cfg-replication-domain-config\n"
        + "cn: example\n"
        + "ds-cfg-synchronization-dn: dc=example,dc=com\n"
        + "ds-cfg-changelog-server: localhost:"+ changelogPort + "\n"
        + "ds-cfg-replication-dn: dc=example,dc=com\n"
        + "ds-cfg-replication-server: localhost:"+ replServerPort + "\n"
        + "ds-cfg-directory-server-id: 123\n";
    synchroServerEntry = TestCaseUtils.entryFromLdifString(synchroServerLdif);
    synchroServerEntry = TestCaseUtils.entryFromLdifString(domainLdif);
    configureReplication();
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ReplicationTestCase.java
@@ -84,7 +84,7 @@
  protected Entry synchroServerEntry;
  protected Entry changeLogEntry;
  protected Entry replServerEntry;
  /**
   * schema check flag
@@ -118,7 +118,7 @@
   * Open a replicationServer session to the local ReplicationServer.
   *
   */
  protected ReplicationBroker openChangelogSession(
  protected ReplicationBroker openReplicationSession(
      final DN baseDn, short serverId, int window_size,
      int port, int timeout, boolean emptyOldChanges)
          throws Exception, SocketException
@@ -165,7 +165,7 @@
   * Open a new session to the ReplicationServer
   * starting with a given ServerState.
   */
  protected ReplicationBroker openChangelogSession(
  protected ReplicationBroker openReplicationSession(
      final DN baseDn, short serverId, int window_size,
      int port, int timeout, ServerState state)
          throws Exception, SocketException
@@ -186,7 +186,7 @@
   * ReplicationServer.
   *
   */
  protected ReplicationBroker openChangelogSession(
  protected ReplicationBroker openReplicationSession(
      final DN baseDn, short serverId, int window_size,
      int port, int timeout, int maxSendQueue, int maxRcvQueue,
      boolean emptyOldChanges)
@@ -338,10 +338,10 @@
      
    // Add the replication server
    DirectoryServer.getConfigHandler().addEntry(changeLogEntry, null);
    assertNotNull(DirectoryServer.getConfigEntry(changeLogEntry.getDN()),
       "Unable to add the changeLog server");
    configEntryList.add(changeLogEntry.getDN());
    DirectoryServer.getConfigHandler().addEntry(replServerEntry, null);
    assertNotNull(DirectoryServer.getConfigEntry(replServerEntry.getDN()),
       "Unable to add the replication server");
    configEntryList.add(replServerEntry.getDN());
    // We also have a replicated suffix (replication domain)
    DirectoryServer.getConfigHandler().addEntry(synchroServerEntry, null);
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/SchemaReplicationTest.java
@@ -69,7 +69,7 @@
  private ArrayList<Modification> rcvdMods = null;
  private int changelogPort;
  private int replServerPort;
  /**
   * Set up the environment for performing the tests in this Class.
@@ -86,7 +86,7 @@
    // find  a free port for the replicationServer
    ServerSocket socket = TestCaseUtils.bindFreePort();
    changelogPort = socket.getLocalPort();
    replServerPort = socket.getLocalPort();
    socket.close();
    // Create an internal connection
@@ -100,25 +100,25 @@
        + synchroStringDN;
    // Change log
    String changeLogStringDN = "cn=Changelog Server, " + synchroPluginStringDN;
    String changeLogLdif = "dn: " + changeLogStringDN + "\n"
    String replServerLdif =
      "dn: " + "cn=Replication Server, " + synchroPluginStringDN + "\n"
        + "objectClass: top\n"
        + "objectClass: ds-cfg-synchronization-changelog-server-config\n"
        + "cn: Changelog Server\n"
        + "ds-cfg-changelog-port: " + changelogPort + "\n"
        + "ds-cfg-changelog-server-id: 1\n";
    changeLogEntry = TestCaseUtils.entryFromLdifString(changeLogLdif);
        + "objectClass: ds-cfg-replication-server-config\n"
        + "cn: Replication Server\n"
        + "ds-cfg-replication-server-port: " + replServerPort + "\n"
        + "ds-cfg-replication-server-id: 1\n";
    replServerEntry = TestCaseUtils.entryFromLdifString(replServerLdif);
    // suffix synchronized
    String synchroServerLdif =
    String domainLdif =
      "dn: cn=example, cn=domains, " + synchroPluginStringDN + "\n"
        + "objectClass: top\n"
        + "objectClass: ds-cfg-synchronization-provider-config\n"
        + "objectClass: ds-cfg-replication-domain-config\n"
        + "cn: example\n"
        + "ds-cfg-synchronization-dn: cn=schema\n"
        + "ds-cfg-changelog-server: localhost:" + changelogPort + "\n"
        + "ds-cfg-replication-server: localhost:" + replServerPort + "\n"
        + "ds-cfg-directory-server-id: 1\n";
    synchroServerEntry = TestCaseUtils.entryFromLdifString(synchroServerLdif);
    synchroServerEntry = TestCaseUtils.entryFromLdifString(domainLdif);
    configureReplication();
  }
@@ -137,7 +137,7 @@
    final DN baseDn = DN.decode("cn=schema");
    ReplicationBroker broker =
      openChangelogSession(baseDn, (short) 2, 100, changelogPort, 5000, true);
      openReplicationSession(baseDn, (short) 2, 100, replServerPort, 5000, true);
    try
    {
@@ -223,7 +223,7 @@
    final DN baseDn = DN.decode("cn=schema");
    ReplicationBroker broker =
      openChangelogSession(baseDn, (short) 2, 100, changelogPort, 5000, true);
      openReplicationSession(baseDn, (short) 2, 100, replServerPort, 5000, true);
    ChangeNumberGenerator gen = new ChangeNumberGenerator((short)2, 0);
@@ -257,7 +257,7 @@
    final DN baseDn = DN.decode("cn=schema");
    ReplicationBroker broker =
      openChangelogSession(baseDn, (short) 3, 100, changelogPort, 5000, true);
      openReplicationSession(baseDn, (short) 3, 100, replServerPort, 5000, true);
    // create a schema change Notification
    AttributeType attrType =
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/StressTest.java
@@ -32,6 +32,7 @@
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;
import java.net.ServerSocket;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.LinkedList;
@@ -72,21 +73,6 @@
  private static final String REPLICATION_STRESS_TEST =
    "Replication Stress Test";
  /**
   * The replication config manager entry
   */
  private String synchroStringDN;
  /**
   * The Server synchro entry
   */
  private String synchroServerStringDN;
  /**
   * The Change log entry
   */
  private String changeLogStringDN;
  private BrokerReader reader = null;
  /**
@@ -94,7 +80,8 @@
   */
  protected Entry personEntry;
  // WORKAROUND FOR BUG #639 - END -
  private int replServerPort;
  /**
   * Stress test from LDAP server to client using the ReplicationBroker API.
@@ -110,7 +97,7 @@
    final int TOTAL_MESSAGES = 1000;
    ReplicationBroker broker =
      openChangelogSession(baseDn, (short) 18, 100, 8989, 5000, true);
      openReplicationSession(baseDn, (short) 18, 100, replServerPort, 5000, true);
    Monitor monitor = new Monitor("stress test monitor");
    DirectoryServer.registerMonitorProvider(monitor);
@@ -225,29 +212,35 @@
    }
    // top level synchro provider
    synchroStringDN = "cn=Synchronization Providers,cn=config";
    String synchroStringDN = "cn=Synchronization Providers,cn=config";
    // Multimaster Synchro plugin
    synchroPluginStringDN = "cn=Multimaster Synchronization, "
        + synchroStringDN;
    // find  a free port for the replicationServer
    ServerSocket socket = TestCaseUtils.bindFreePort();
    replServerPort = socket.getLocalPort();
    socket.close();
    // Change log
    changeLogStringDN = "cn=Changelog Server, " + synchroPluginStringDN;
    String changeLogLdif = "dn: " + changeLogStringDN + "\n"
    String replServerLdif =
      "dn: cn=Replication Server, " + synchroPluginStringDN + "\n"
        + "objectClass: top\n"
        + "objectClass: ds-cfg-synchronization-changelog-server-config\n"
        + "cn: Changelog Server\n" + "ds-cfg-changelog-port: 8989\n"
        + "ds-cfg-changelog-server-id: 1\n";
    changeLogEntry = TestCaseUtils.entryFromLdifString(changeLogLdif);
        + "objectClass: ds-cfg-replication-server-config\n"
        + "cn: Replication Server\n"
        + "ds-cfg-replication-server-port: " + replServerPort + "\n"
        + "ds-cfg-replication-server-id: 1\n";
    replServerEntry = TestCaseUtils.entryFromLdifString(replServerLdif);
    // suffix synchronized
    synchroServerStringDN = "cn=example, cn=domains, " + synchroPluginStringDN;
    String synchroServerLdif = "dn: " + synchroServerStringDN + "\n"
    String synchroServerLdif =
      "dn: " + "cn=example, cn=domains, " + synchroPluginStringDN + "\n"
        + "objectClass: top\n"
        + "objectClass: ds-cfg-synchronization-provider-config\n"
        + "objectClass: ds-cfg-replication-domain-config\n"
        + "cn: example\n"
        + "ds-cfg-synchronization-dn: ou=People,dc=example,dc=com\n"
        + "ds-cfg-changelog-server: localhost:8989\n"
        + "ds-cfg-replication-dn: ou=People,dc=example,dc=com\n"
        + "ds-cfg-replication-server: localhost:" + replServerPort + "\n"
        + "ds-cfg-directory-server-id: 1\n" + "ds-cfg-receive-status: true\n";
    synchroServerEntry = TestCaseUtils.entryFromLdifString(synchroServerLdif);
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/UpdateOperationTest.java
@@ -30,6 +30,7 @@
import static org.opends.server.loggers.Error.logError;
import static org.testng.Assert.*;
import java.net.ServerSocket;
import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.List;
@@ -84,6 +85,7 @@
   * A "person" entry
   */
  protected Entry personEntry;
  private int replServerPort;
  /**
   * Set up the environment for performing the tests in this Class.
@@ -133,24 +135,29 @@
    synchroPluginStringDN = "cn=Multimaster Synchronization, "
        + synchroStringDN;
    // Change log
    String changeLogStringDN = "cn=Changelog Server, " + synchroPluginStringDN;
    String changeLogLdif = "dn: " + changeLogStringDN + "\n"
    // find  a free port for the replicationServer
    ServerSocket socket = TestCaseUtils.bindFreePort();
    replServerPort = socket.getLocalPort();
    socket.close();
    // replication server
    String replServerLdif =
      "dn: cn=Replication Server, " + synchroPluginStringDN + "\n"
        + "objectClass: top\n"
        + "objectClass: ds-cfg-synchronization-changelog-server-config\n"
        + "cn: Changelog Server\n" + "ds-cfg-changelog-port: 8989\n"
        + "ds-cfg-changelog-server-id: 1\n";
    changeLogEntry = TestCaseUtils.entryFromLdifString(changeLogLdif);
        + "objectClass: ds-cfg-replication-server-config\n"
        + "cn: Replication Server\n"
        + "ds-cfg-replication-server-port: " + replServerPort + "\n"
        + "ds-cfg-replication-server-id: 1\n";
    replServerEntry = TestCaseUtils.entryFromLdifString(replServerLdif);
    // suffix synchronized
    String synchroServerStringDN =
      "cn=example, cn=domains, " + synchroPluginStringDN;
    String synchroServerLdif = "dn: " + synchroServerStringDN + "\n"
    String synchroServerLdif =
      "dn: cn=example, cn=domains, " + synchroPluginStringDN + "\n"
        + "objectClass: top\n"
        + "objectClass: ds-cfg-synchronization-provider-config\n"
        + "objectClass: ds-cfg-replication-domain-config\n"
        + "cn: example\n"
        + "ds-cfg-synchronization-dn: ou=People,dc=example,dc=com\n"
        + "ds-cfg-changelog-server: localhost:8989\n"
        + "ds-cfg-replication-server: localhost:" + replServerPort + "\n"
        + "ds-cfg-directory-server-id: 1\n" + "ds-cfg-receive-status: true\n";
    synchroServerEntry = TestCaseUtils.entryFromLdifString(synchroServerLdif);
@@ -236,7 +243,7 @@
     * This must use a different serverId to that of the directory server.
     */
    ReplicationBroker broker =
      openChangelogSession(baseDn, (short) 2, 100, 8989, 1000, true);
      openReplicationSession(baseDn, (short)2, 100, replServerPort, 1000, true);
    /*
@@ -319,7 +326,7 @@
     * This must use a different serverId to that of the directory server.
     */
    ReplicationBroker broker =
      openChangelogSession(baseDn, (short) 2, 100, 8989, 1000, true);
      openReplicationSession(baseDn, (short)2, 100, replServerPort, 1000, true);
    /*
@@ -419,7 +426,7 @@
     * This must use a serverId different from the LDAP server ID
     */
    ReplicationBroker broker =
      openChangelogSession(baseDn, (short) 2, 100, 8989, 1000, true);
      openReplicationSession(baseDn, (short)2, 100, replServerPort, 1000, true);
    /*
     * Create a Change number generator to generate new changenumbers
@@ -826,7 +833,7 @@
    cleanRealEntries();
    ReplicationBroker broker =
      openChangelogSession(baseDn, (short) 27, 100, 8989, 1000, true);
      openReplicationSession(baseDn, (short) 27, 100, 8989, 1000, true);
    try {
      ChangeNumberGenerator gen = new ChangeNumberGenerator((short) 27, 0);
@@ -1110,7 +1117,7 @@
    Thread.sleep(2000);
    ReplicationBroker broker =
      openChangelogSession(baseDn, (short) 11, 100, 8989, 1000, true);
      openReplicationSession(baseDn, (short) 11, 100, 8989, 1000, true);
    try
    {
      ChangeNumberGenerator gen = new ChangeNumberGenerator((short) 11, 0);
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/HistoricalTest.java
@@ -46,6 +46,7 @@
import org.testng.annotations.BeforeClass;
import static org.testng.Assert.assertEquals;
import java.net.ServerSocket;
import java.util.List;
import java.util.ArrayList;
@@ -55,6 +56,8 @@
public class HistoricalTest
     extends ReplicationTestCase
{
  private int replServerPort;
  /**
   * Set up replication on the test backend.
   * @throws Exception If an error occurs.
@@ -68,24 +71,30 @@
    // Create an internal connection.
    connection = InternalClientConnection.getRootConnection();
    // find  a free port for the replicationServer
    ServerSocket socket = TestCaseUtils.bindFreePort();
    replServerPort = socket.getLocalPort();
    socket.close();
    // The replication server.
    String changeLogStringDN = "cn=Changelog Server, " + synchroPluginStringDN;
    String changeLogLdif = "dn: " + changeLogStringDN + "\n"
    String replServerStringDN = "cn=Replication Server, " + synchroPluginStringDN;
    String replServerLdif = "dn: " + replServerStringDN + "\n"
         + "objectClass: top\n"
         + "objectClass: ds-cfg-synchronization-changelog-server-config\n"
         + "cn: Changelog Server\n" + "ds-cfg-changelog-port: 8989\n"
         + "ds-cfg-changelog-server-id: 1\n";
    changeLogEntry = TestCaseUtils.entryFromLdifString(changeLogLdif);
         + "objectClass: ds-cfg-replication-server-config\n"
         + "cn: replication Server\n"
         + "ds-cfg-replication-server-port: " + replServerPort + "\n"
         + "ds-cfg-replication-server-id: 1\n";
    replServerEntry = TestCaseUtils.entryFromLdifString(replServerLdif);
    // The suffix to be synchronized.
    String synchroServerStringDN = "o=test, cn=domains, " + synchroPluginStringDN;
    String synchroServerLdif = "dn: " + synchroServerStringDN + "\n"
         + "objectClass: top\n"
         + "objectClass: ds-cfg-synchronization-provider-config\n"
         + "objectClass: ds-cfg-replication-domain-config\n"
         + "cn: example\n"
         + "ds-cfg-synchronization-dn: o=test\n"
         + "ds-cfg-changelog-server: localhost:8989\n"
         + "ds-cfg-replication-dn: o=test\n"
         + "ds-cfg-replication-server: localhost:" + replServerPort + "\n"
         + "ds-cfg-directory-server-id: 1\n"
         + "ds-cfg-receive-status: true\n";
    synchroServerEntry = TestCaseUtils.entryFromLdifString(synchroServerLdif);
@@ -203,7 +212,7 @@
     * This must use a different serverId to that of the directory server.
     */
    ReplicationBroker broker =
      openChangelogSession(baseDn, (short) 2, 100, 8989, 1000, true);
      openReplicationSession(baseDn, (short)2, 100, replServerPort, 1000, true);
    // Clear the backend.
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/DbHandlerTest.java
File was renamed from opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/dbHandlerTest.java
@@ -44,7 +44,7 @@
/**
 * Test the dbHandler class
 */
public class dbHandlerTest extends ReplicationTestCase
public class DbHandlerTest extends ReplicationTestCase
{
  @Test()
  void testDbHandlerTrim() throws Exception
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplServerFakeConfiguration.java
@@ -31,15 +31,15 @@
import org.opends.server.admin.ManagedObjectDefinition;
import org.opends.server.admin.PropertyProvider;
import org.opends.server.admin.server.ConfigurationChangeListener;
import org.opends.server.admin.std.client.ChangelogServerCfgClient;
import org.opends.server.admin.std.server.ChangelogServerCfg;
import org.opends.server.admin.std.client.ReplicationServerCfgClient;
import org.opends.server.admin.std.server.ReplicationServerCfg;
import org.opends.server.types.DN;
/**
 * This Class implements an object that can be used to instantiate
 * The ReplicationServer class for tests purpose.
 */
public class ReplServerFakeConfiguration implements ChangelogServerCfg
public class ReplServerFakeConfiguration implements ReplicationServerCfg
{
  int port;
  String dirName;
@@ -92,7 +92,7 @@
   * {@inheritDoc}
   */
  public void addChangeListener(
      ConfigurationChangeListener<ChangelogServerCfg> listener)
      ConfigurationChangeListener<ReplicationServerCfg> listener)
  {
  }
@@ -100,8 +100,8 @@
  /**
   * {@inheritDoc}
   */
  public ManagedObjectDefinition<? extends ChangelogServerCfgClient,
                                 ? extends ChangelogServerCfg> definition()
  public ManagedObjectDefinition<? extends ReplicationServerCfgClient,
                                 ? extends ReplicationServerCfg> definition()
  {
    return null;
  }
@@ -109,7 +109,7 @@
  /**
   * {@inheritDoc}
   */
  public String getChangelogDbDirectory()
  public String getReplicationDbDirectory()
  {
    return dirName;
  }
@@ -117,7 +117,7 @@
  /**
   * {@inheritDoc}
   */
  public int getChangelogPort()
  public int getReplicationPort()
  {
    return port;
  }
@@ -125,7 +125,7 @@
  /**
   * {@inheritDoc}
   */
  public long getChangelogPurgeDelay()
  public long getReplicationPurgeDelay()
  {
    return purgeDelay;
  }
@@ -133,7 +133,7 @@
  /**
   * {@inheritDoc}
   */
  public SortedSet<String> getChangelogServer()
  public SortedSet<String> getReplicationServer()
  {
     return servers;
  }
@@ -141,7 +141,7 @@
  /**
   * {@inheritDoc}
   */
  public int getChangelogServerId()
  public int getReplicationServerId()
  {
    return serverId;
  }
@@ -166,7 +166,7 @@
   * {@inheritDoc}
   */
  public void removeChangeListener(
      ConfigurationChangeListener<ChangelogServerCfg> listener)
      ConfigurationChangeListener<ReplicationServerCfg> listener)
  {
  }
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/server/ReplicationServerTest.java
@@ -123,10 +123,10 @@
      /*
       * Open a sender session and a receiver session to the replicationServer
       */
      server1 = openChangelogSession(
      server1 = openReplicationSession(
          DN.decode("dc=example,dc=com"), (short) 1, 100, changelogPort,
          1000, true);
      server2 = openChangelogSession(
      server2 = openReplicationSession(
          DN.decode("dc=example,dc=com"), (short) 2, 100, changelogPort,
          1000, true);
@@ -239,7 +239,7 @@
    try {
      broker =
        openChangelogSession(DN.decode("dc=example,dc=com"), (short) 3,
        openReplicationSession(DN.decode("dc=example,dc=com"), (short) 3,
                             100, changelogPort, 1000, false);
      ReplicationMessage msg2 = broker.receive();
@@ -276,7 +276,7 @@
     */
    try {
      broker =
        openChangelogSession(DN.decode("dc=example,dc=com"), (short) 3,
        openReplicationSession(DN.decode("dc=example,dc=com"), (short) 3,
                             100, changelogPort, 1000, state);
      ReplicationMessage msg2 = broker.receive();
@@ -424,7 +424,7 @@
      /*
       * Open a sender session
       */
      server = openChangelogSession(
      server = openReplicationSession(
          DN.decode("dc=example,dc=com"), (short) 5, 100, changelogPort,
          1000, 1000, 0, true);
@@ -435,7 +435,7 @@
       */
      for (int i =0; i< CLIENT_THREADS; i++)
      {
        clientBroker[i] = openChangelogSession(
        clientBroker[i] = openReplicationSession(
            DN.decode("dc=example,dc=com"), (short) (100+i), 100, changelogPort,
            1000, true);
        client[i] = new BrokerReader(clientBroker[i]);
@@ -509,7 +509,7 @@
        ChangeNumberGenerator gen =
          new ChangeNumberGenerator(serverId , (long) 0);
        ReplicationBroker broker =
          openChangelogSession( DN.decode("dc=example,dc=com"), serverId,
          openReplicationSession( DN.decode("dc=example,dc=com"), serverId,
            100, changelogPort, 1000, 1000, 0, true);
        producer[i] = new BrokerWriter(broker, gen, TOTAL_MSG/THREADS);
@@ -613,12 +613,12 @@
        //              and client2 to changelog2
        // For itest=1, only create and connect client1 to changelog1
        //              client2 will be created later
        broker1 = openChangelogSession(DN.decode("dc=example,dc=com"),
        broker1 = openReplicationSession(DN.decode("dc=example,dc=com"),
             brokerIds[0], 100, changelogPorts[0], 1000, !emptyOldChanges);
        if (itest == 0)
        {
          broker2 = openChangelogSession(DN.decode("dc=example,dc=com"),
          broker2 = openReplicationSession(DN.decode("dc=example,dc=com"),
             brokerIds[1], 100, changelogPorts[0], 1000, !emptyOldChanges);
        }
@@ -678,7 +678,7 @@
          changelogs[1] = new ReplicationServer(conf);
          // Connect broker 2 to changelog2
          broker2 = openChangelogSession(DN.decode("dc=example,dc=com"),
          broker2 = openReplicationSession(DN.decode("dc=example,dc=com"),
              brokerIds[1], 100, changelogPorts[1], 2000, !emptyOldChanges);
        }