| | |
| | | import org.opends.server.DirectoryServerTestCase; |
| | | import org.opends.server.TestCaseUtils; |
| | | import org.opends.server.replication.common.ServerState; |
| | | import org.opends.server.replication.plugin.ChangelogBroker; |
| | | import org.opends.server.replication.plugin.ReplicationBroker; |
| | | import org.opends.server.replication.plugin.PersistentServerState; |
| | | import org.opends.server.schema.IntegerSyntax; |
| | | import org.opends.server.core.DeleteOperation; |
| | |
| | | } |
| | | |
| | | /** |
| | | * Open a changelog session to the local Changelog server. |
| | | * Open a replicationServer session to the local ReplicationServer. |
| | | * |
| | | */ |
| | | protected ChangelogBroker openChangelogSession( |
| | | protected ReplicationBroker openChangelogSession( |
| | | final DN baseDn, short serverId, int window_size, |
| | | int port, int timeout, boolean emptyOldChanges) |
| | | throws Exception, SocketException |
| | |
| | | else |
| | | state = new ServerState(); |
| | | |
| | | ChangelogBroker broker = new ChangelogBroker( |
| | | ReplicationBroker broker = new ReplicationBroker( |
| | | state, baseDn, serverId, 0, 0, 0, 0, window_size, 0); |
| | | ArrayList<String> servers = new ArrayList<String>(1); |
| | | servers.add("localhost:" + port); |
| | |
| | | if (timeout != 0) |
| | | broker.setSoTimeout(timeout); |
| | | TestCaseUtils.sleep(100); // give some time to the broker to connect |
| | | // to the changelog server. |
| | | // to the replicationServer. |
| | | if (emptyOldChanges) |
| | | { |
| | | /* |
| | |
| | | } |
| | | |
| | | /** |
| | | * Open a new session to the Changelog Server |
| | | * Open a new session to the ReplicationServer |
| | | * starting with a given ServerState. |
| | | */ |
| | | protected ChangelogBroker openChangelogSession( |
| | | protected ReplicationBroker openChangelogSession( |
| | | final DN baseDn, short serverId, int window_size, |
| | | int port, int timeout, ServerState state) |
| | | throws Exception, SocketException |
| | | { |
| | | ChangelogBroker broker = new ChangelogBroker( |
| | | ReplicationBroker broker = new ReplicationBroker( |
| | | state, baseDn, serverId, 0, 0, 0, 0, window_size, 0); |
| | | ArrayList<String> servers = new ArrayList<String>(1); |
| | | servers.add("localhost:" + port); |
| | |
| | | } |
| | | |
| | | /** |
| | | * Open a changelog session with flow control to the local Changelog server. |
| | | * Open a replicationServer session with flow control to the local |
| | | * ReplicationServer. |
| | | * |
| | | */ |
| | | protected ChangelogBroker openChangelogSession( |
| | | protected ReplicationBroker openChangelogSession( |
| | | final DN baseDn, short serverId, int window_size, |
| | | int port, int timeout, int maxSendQueue, int maxRcvQueue, |
| | | boolean emptyOldChanges) |
| | |
| | | else |
| | | state = new ServerState(); |
| | | |
| | | ChangelogBroker broker = new ChangelogBroker( |
| | | ReplicationBroker broker = new ReplicationBroker( |
| | | state, baseDn, serverId, maxRcvQueue, 0, |
| | | maxSendQueue, 0, window_size, 0); |
| | | ArrayList<String> servers = new ArrayList<String>(1); |
| | |
| | | "Unable to add the Multimaster replication plugin"); |
| | | |
| | | |
| | | // Add the changelog server |
| | | // Add the replication server |
| | | DirectoryServer.getConfigHandler().addEntry(changeLogEntry, null); |
| | | assertNotNull(DirectoryServer.getConfigEntry(changeLogEntry.getDN()), |
| | | "Unable to add the changeLog server"); |