| | |
| | | ReplicationDomain replDomain = ReplicationDomain.retrievesReplicationDomain(baseDn); |
| | | genId = replDomain.getGenerationId(); |
| | | } |
| | | catch(Exception e) {} |
| | | catch(Exception e) {} |
| | | return genId; |
| | | } |
| | | |
| | |
| | | final DN baseDn, short serverId, int window_size, |
| | | int port, int timeout, boolean emptyOldChanges) |
| | | throws Exception, SocketException |
| | | { |
| | | { |
| | | return openReplicationSession(baseDn, serverId, window_size, |
| | | port, timeout, emptyOldChanges, getGenerationId(baseDn)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Open a replicationServer session to the local ReplicationServer |
| | | * providing the generationId. |
| | |
| | | state = new ServerState(); |
| | | |
| | | ReplicationBroker broker = new ReplicationBroker( |
| | | state, baseDn, serverId, 0, 0, 0, 0, |
| | | state, baseDn, serverId, 0, 0, 0, 0, |
| | | window_size, 0, generationId, getReplSessionSecurity()); |
| | | ArrayList<String> servers = new ArrayList<String>(1); |
| | | servers.add("localhost:" + port); |
| | |
| | | final DN baseDn, short serverId, int window_size, |
| | | int port, int timeout, ServerState state) |
| | | throws Exception, SocketException |
| | | { |
| | | { |
| | | return openReplicationSession(baseDn, serverId, window_size, |
| | | port, timeout, state, getGenerationId(baseDn)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Open a new session to the ReplicationServer |
| | | * starting with a given ServerState. |
| | |
| | | throws Exception, SocketException |
| | | { |
| | | return openReplicationSession(baseDn, serverId, window_size, |
| | | port, timeout, maxSendQueue, maxRcvQueue, emptyOldChanges, |
| | | port, timeout, maxSendQueue, maxRcvQueue, emptyOldChanges, |
| | | getGenerationId(baseDn)); |
| | | } |
| | | |
| | | |
| | | protected ReplicationBroker openReplicationSession( |
| | | final DN baseDn, short serverId, int window_size, |
| | | int port, int timeout, int maxSendQueue, int maxRcvQueue, |
| | |
| | | while (true) |
| | | { |
| | | DN dn = configEntryList.removeLast(); |
| | | |
| | | |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, |
| | | "cleaning config entry " + dn)); |
| | | |
| | |
| | | { |
| | | DN dn = entryList.removeLast(); |
| | | |
| | | op = new DeleteOperationBasis(connection, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | op = new DeleteOperationBasis(connection, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | null, |
| | | dn); |
| | | |
| | | op.run(); |
| | | |
| | | |
| | | if ((op.getResultCode() != ResultCode.SUCCESS) && |
| | | (op.getResultCode() != ResultCode.NO_SUCH_OBJECT)) |
| | | { |
| | |
| | | |
| | | entryList = null; |
| | | configEntryList = null; |
| | | |
| | | // In-core restart to cleanup. |
| | | TestCaseUtils.restartServer(); |
| | | } |
| | | |
| | | /** |
| | |
| | | fail("waitTaskState Exception:"+ e.getMessage() + " " + stackTraceToSingleLineString(e)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Add to the current DB the entries necessary to the test |
| | | */ |
| | |
| | | Entry entry = TestCaseUtils.entryFromLdifString(ldifEntry); |
| | | AddOperationBasis addOp = new AddOperationBasis( |
| | | connection, |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | null, |
| | | entry.getDN(), |
| | | InternalClientConnection.nextOperationID(), |
| | | InternalClientConnection.nextMessageID(), |
| | | null, |
| | | entry.getDN(), |
| | | entry.getObjectClasses(), |
| | | entry.getUserAttributes(), |
| | | entry.getUserAttributes(), |
| | | entry.getOperationalAttributes()); |
| | | addOp.setInternalOperation(true); |
| | | addOp.run(); |
| | |
| | | else |
| | | { |
| | | TRACER.debugInfo(entry.getDN() + |
| | | " added " + addOp.getResultCode()); |
| | | " added " + addOp.getResultCode()); |
| | | } |
| | | // They will be removed at the end of the test |
| | | entryList.addLast(entry.getDN()); |