| | |
| | | import static org.opends.server.synchronization.OperationContext.SYNCHROCONTEXT; |
| | | import static org.opends.server.synchronization.Historical.*; |
| | | |
| | | import java.net.SocketTimeoutException; |
| | | import java.util.ArrayList; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.LinkedList; |
| | |
| | | */ |
| | | try |
| | | { |
| | | broker = new ChangelogBroker(this); |
| | | broker = new ChangelogBroker(state, baseDN, serverId, maxReceiveQueue, |
| | | maxReceiveDelay, maxSendQueue, maxSendDelay); |
| | | synchronized (broker) |
| | | { |
| | | broker.start(serverId, changelogServers); |
| | | broker.start(changelogServers); |
| | | if (!receiveStatus) |
| | | broker.suspendReceive(); |
| | | } |
| | |
| | | { |
| | | broker.stop(); |
| | | changelogServers = newChangelogServers; |
| | | broker.start(serverId, changelogServers); |
| | | broker.start(changelogServers); |
| | | } |
| | | |
| | | /* |
| | |
| | | UpdateMessage update = null; |
| | | while (update == null) |
| | | { |
| | | SynchronizationMessage msg = broker.receive(); |
| | | if (msg == null) |
| | | SynchronizationMessage msg; |
| | | try |
| | | { |
| | | // The server is in the shutdown process |
| | | return null; |
| | | msg = broker.receive(); |
| | | if (msg == null) |
| | | { |
| | | // The server is in the shutdown process |
| | | return null; |
| | | } |
| | | |
| | | update = msg.processReceive(this); |
| | | } catch (SocketTimeoutException e) |
| | | { |
| | | // just retry |
| | | } |
| | | |
| | | update = msg.processReceive(this); |
| | | } |
| | | return update; |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * Get the largest ChangeNumber that has been processed locally. |
| | | * |
| | | * @return The largest ChangeNumber that has been processed locally. |
| | | */ |
| | | public ChangeNumber getMaxChangeNumber() |
| | | { |
| | | return state.getMaxChangeNumber(serverId); |
| | | } |
| | | |
| | | /** |
| | | * Create a new serverStartMessage suitable for this SynchronizationDomain. |
| | | * |
| | | * @return A new serverStartMessage suitable for this SynchronizationDomain. |
| | | */ |
| | | public ServerStartMessage newServerStartMessage() |
| | | { |
| | | return new ServerStartMessage(serverId, baseDN, maxReceiveDelay, |
| | | maxReceiveQueue, maxSendDelay, maxSendQueue, |
| | | state); |
| | | } |
| | | |
| | | /** |
| | | * Create and replay a synchronized Operation from an UpdateMessage. |
| | | * |
| | | * @param msg The UpdateMessage to be replayed. |
| | |
| | | { |
| | | done = true; // unknown type of operation ?! |
| | | } |
| | | if (done) |
| | | { |
| | | // the update became a dummy update and the result |
| | | // of the conflict resolution phase is to do nothing. |
| | | // however we still need to push this change to the serverState |
| | | updateError(changeNumber); |
| | | } |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | RDN entryRdn = op.getEntryDN().getRDN(); |
| | | msg.setDn(parentDn + "," + entryRdn); |
| | | RDN entryRdn = DN.decode(msg.getDn()).getRDN(); |
| | | msg.setDn(entryRdn + "," + parentDn); |
| | | return false; |
| | | } |
| | | } |
| | |
| | | */ |
| | | private String generateConflictDn(String entryUid, String dn) |
| | | { |
| | | return dn + "entryuuid=" + entryUid; |
| | | return "entryuuid=" + entryUid + "+" + dn; |
| | | } |
| | | |
| | | /** |