Code cleanup after running Findbugs.
Remove useless initializations, useless toString() on strings, and other redundant if tests...
| | |
| | | /** |
| | | * The attribute name used to store the generation id in the backend. |
| | | */ |
| | | protected static final String REPLICATION_GENERATION_ID = |
| | | private static final String REPLICATION_GENERATION_ID = |
| | | "ds-sync-generation-id"; |
| | | /** |
| | | * The attribute name used to store the fractional include configuration in |
| | |
| | | if (!backend.supportsLDIFImport()) |
| | | { |
| | | Message message = ERR_INIT_IMPORT_NOT_SUPPORTED.get( |
| | | backend.getBackendID().toString()); |
| | | backend.getBackendID()); |
| | | if (ieContext.getException() == null) |
| | | ieContext.setException(new DirectoryException(ResultCode.OTHER, |
| | | message)); |
| | |
| | | if (!backend.supportsLDIFExport()) |
| | | { |
| | | Message message = ERR_INIT_EXPORT_NOT_SUPPORTED.get( |
| | | backend.getBackendID().toString()); |
| | | backend.getBackendID()); |
| | | logError(message); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS |
| | | * Portions copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | public void changeStatusForResetGenId(long newGenId) |
| | | throws IOException |
| | | { |
| | | StatusMachineEvent event = null; |
| | | StatusMachineEvent event; |
| | | |
| | | if (newGenId == -1) |
| | | { |
| | |
| | | Message message = NOTE_BAD_GEN_ID_IN_FULL_UPDATE.get( |
| | | Integer.toString(replicationServerDomain. |
| | | getReplicationServer().getServerId()), |
| | | getServiceId().toString(), |
| | | getServiceId(), |
| | | Integer.toString(serverId), |
| | | Long.toString(generationId), |
| | | Long.toString(newGenId)); |
| | |
| | | ServerStatus newStatus = StatusMachine.computeNewStatus(status, event); |
| | | if (newStatus == ServerStatus.INVALID_STATUS) |
| | | { |
| | | Message msg = ERR_RS_CANNOT_CHANGE_STATUS.get(getServiceId().toString(), |
| | | Message msg = ERR_RS_CANNOT_CHANGE_STATUS.get(getServiceId(), |
| | | Integer.toString(serverId), status.toString(), event.toString()); |
| | | logError(msg); |
| | | // Status analyzer must only change from NORMAL_STATUS to DEGRADED_STATUS |
| | |
| | | if (event == StatusMachineEvent.INVALID_EVENT) |
| | | { |
| | | Message msg = ERR_RS_INVALID_NEW_STATUS.get(reqStatus.toString(), |
| | | getServiceId().toString(), Integer.toString(serverId)); |
| | | getServiceId(), Integer.toString(serverId)); |
| | | logError(msg); |
| | | return ServerStatus.INVALID_STATUS; |
| | | } |
| | |
| | | return; |
| | | } |
| | | |
| | | StartMsg outStartMsg = null; |
| | | try |
| | | { |
| | | outStartMsg = sendStartToRemote(protocolVersion); |
| | | StartMsg outStartMsg = sendStartToRemote(protocolVersion); |
| | | |
| | | // log |
| | | logStartHandshakeRCVandSND(inServerStartMsg, outStartMsg); |
| | |
| | | DataFormatException, |
| | | NotSupportedOldVersionPDUException |
| | | { |
| | | ReplicationMsg msg = null; |
| | | msg = session.receive(); |
| | | ReplicationMsg msg = session.receive(); |
| | | |
| | | if (msg instanceof StopMsg) |
| | | { |
| | |
| | | { |
| | | Message message = ERR_RS_INVALID_INIT_STATUS.get( |
| | | this.status.toString(), |
| | | getServiceId().toString(), |
| | | getServiceId(), |
| | | Integer.toString(serverId)); |
| | | throw new DirectoryException(ResultCode.OTHER, message); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS |
| | | * Portions copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | import org.opends.messages.MessageBuilder; |
| | |
| | | ArrayList<Attribute> attributes = new ArrayList<Attribute>(); |
| | | attributes.add(Attributes.create("replicationServer-database", |
| | | String.valueOf(serverId))); |
| | | attributes.add(Attributes.create("domain-name", baseDn.toString())); |
| | | attributes.add(Attributes.create("domain-name", baseDn)); |
| | | if (firstChange != null) |
| | | { |
| | | Date firstTime = new Date(firstChange.getTime()); |
| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS |
| | | * Portions copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | |
| | | return; |
| | | } |
| | | |
| | | // TODO:ECL please document the details of the cases where update could |
| | | // be not null here |
| | | if (update == null) |
| | | try |
| | | { |
| | | try |
| | | { |
| | | handler.refreshEligibleCN(); |
| | | update = handler.takeECLUpdate(); |
| | | } |
| | | catch(DirectoryException de) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | handler.refreshEligibleCN(); |
| | | update = handler.takeECLUpdate(); |
| | | } |
| | | catch(DirectoryException de) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | if (update == null) |
| | |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | import org.opends.server.types.DirectoryException; |
| | | |
| | | /** |
| | | * This interface defines a session used to search the external changelog |
| | | * This class implements a session used to search the external changelog |
| | | * in the Directory Server. |
| | | */ |
| | | public class ExternalChangeLogSessionImpl |
| | |
| | | { |
| | | |
| | | ECLServerHandler handler; |
| | | ReplicationServer rs; |
| | | |
| | | /** |
| | | * Create a new external changelog session. |
| | | * @param rs The replication server to which we will request the log. |
| | | * @throws DirectoryException When an error occurs. |
| | | */ |
| | | public ExternalChangeLogSessionImpl(ReplicationServer rs) |
| | | throws DirectoryException |
| | | { |
| | | this.rs = rs; |
| | | } |
| | | |
| | | /** |
| | | * Create a new external changelog session. |
| | |
| | | StartECLSessionMsg startECLSessionMsg) |
| | | throws DirectoryException |
| | | { |
| | | this.rs = rs; |
| | | |
| | | this.handler = new ECLServerHandler( |
| | | rs.getServerURL(), |
| | | rs.getServerId(), |
| | |
| | | if (!this.serviceId.equalsIgnoreCase(serviceId)) |
| | | { |
| | | Message message = ERR_RS_DN_DOES_NOT_MATCH.get( |
| | | this.serviceId.toString(), |
| | | serviceId.toString()); |
| | | this.serviceId, |
| | | serviceId); |
| | | throw new DirectoryException(ResultCode.OTHER, |
| | | message, null); |
| | | } |
| | |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | int missingChangesLsiLsj = |
| | | ChangeNumber.diffSeqNum(lsjMaxCN, lsiLastCN); |
| | | |
| | | mds += |
| | | "+ diff("+lsjMaxCN+"-" |
| | | +lsiLastCN+")="+missingChangesLsiLsj; |
| | | if (debugEnabled()) |
| | | { |
| | | mds += |
| | | "+ diff("+lsjMaxCN+"-" |
| | | +lsiLastCN+")="+missingChangesLsiLsj; |
| | | } |
| | | |
| | | // Regarding a DS that is generating changes. If it is a local DS1, |
| | | // we get its server state, store it, then retrieve server states of |
| | |
| | | if (missingChangesLsiLsj <= 50) |
| | | { |
| | | missingChangesLsiLsj = 0; |
| | | mds += " (diff replaced by 0 as for server id " + lsiSid + ")"; |
| | | if (debugEnabled()) |
| | | { |
| | | mds += " (diff replaced by 0 as for server id " + lsiSid + ")"; |
| | | } |
| | | } |
| | | } |
| | | |
| | | lsiMissingChanges += missingChangesLsiLsj; |
| | | } |
| | | } |
| | | mds += "=" + lsiMissingChanges; |
| | | if (debugEnabled()) |
| | | { |
| | | mds += "=" + lsiMissingChanges; |
| | | } |
| | | this.missingChanges.put(lsiSid,lsiMissingChanges); |
| | | } |
| | | |
| | |
| | | int missingChangesLsiLsj = |
| | | ChangeNumber.diffSeqNum(lsjMaxCN, lsiLastCN); |
| | | |
| | | mds += |
| | | "+ diff("+lsjMaxCN+"-" |
| | | +lsiLastCN+")="+missingChangesLsiLsj; |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | mds += |
| | | "+ diff("+lsjMaxCN+"-" |
| | | +lsiLastCN+")="+missingChangesLsiLsj; |
| | | } |
| | | lsiMissingChanges += missingChangesLsiLsj; |
| | | } |
| | | } |
| | | mds += "=" + lsiMissingChanges; |
| | | if (debugEnabled()) |
| | | { |
| | | mds += "=" + lsiMissingChanges; |
| | | } |
| | | this.missingChangesRS.put(lsiSid,lsiMissingChanges); |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo( |
| | | "Complete monitor data : Missing changes ("+ lsiSid +")=" + mds); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2009-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Monitoring publisher starting for dn " |
| | | + replicationServerDomain.getBaseDn().toString()); |
| | | + replicationServerDomain.getBaseDn()); |
| | | } |
| | | |
| | | try |
| | |
| | | catch (InterruptedException e) |
| | | { |
| | | TRACER.debugInfo("Monitoring publisher for dn " |
| | | + replicationServerDomain.getBaseDn().toString() |
| | | + replicationServerDomain.getBaseDn() |
| | | + " in RS " |
| | | + replicationServerDomain.getReplicationServer() |
| | | .getServerId() |
| | |
| | | |
| | | done = true; |
| | | TRACER.debugInfo("Monitoring publisher for dn " |
| | | + replicationServerDomain.getBaseDn().toString() |
| | | + replicationServerDomain.getBaseDn() |
| | | + " is terminated." |
| | | + " This is in RS " |
| | | + replicationServerDomain.getReplicationServer() |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Shutting down monitoring publisher for dn " + |
| | | replicationServerDomain.getBaseDn().toString() + " in RS " + |
| | | replicationServerDomain.getBaseDn() + " in RS " + |
| | | replicationServerDomain.getReplicationServer().getServerId()); |
| | | } |
| | | } |
| | |
| | | if (n >= FACTOR) |
| | | { |
| | | TRACER.debugInfo("Interrupting monitoring publisher for dn " + |
| | | replicationServerDomain.getBaseDn().toString() + " in RS " + |
| | | replicationServerDomain.getBaseDn() + " in RS " + |
| | | replicationServerDomain.getReplicationServer().getServerId()); |
| | | this.interrupt(); |
| | | } |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Monitoring publisher for dn " + |
| | | replicationServerDomain.getBaseDn().toString() + |
| | | replicationServerDomain.getBaseDn() + |
| | | " changing period value to " + period); |
| | | } |
| | | |
| | |
| | | ReplicationServerDomain rc = rsdi.next(); |
| | | |
| | | // Skip containers that are not covered by the include branches. |
| | | baseDN = DN.decode(rc.getBaseDn().toString() + "," + BASE_DN); |
| | | baseDN = DN.decode(rc.getBaseDn() + "," + BASE_DN); |
| | | |
| | | if (includeBranches == null || includeBranches.isEmpty()) |
| | | { |
| | |
| | | UpdateMsg msg = ri.getChange(); |
| | | processChange( |
| | | msg, exportConfig, ldifWriter, searchOperation, |
| | | rsd.getBaseDn().toString()); |
| | | rsd.getBaseDn()); |
| | | if (!ri.next()) |
| | | break; |
| | | } |
| | |
| | | ReplicationServerDomain rsd = rsdi.next(); |
| | | |
| | | // Skip containers that are not covered by the include branches. |
| | | baseDN = DN.decode(rsd.getBaseDn().toString() + "," + BASE_DN); |
| | | baseDN = DN.decode(rsd.getBaseDn() + "," + BASE_DN); |
| | | |
| | | if (searchBaseDN.isDescendantOf(baseDN) || |
| | | searchBaseDN.isAncestorOf(baseDN)) |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | import org.opends.messages.MessageBuilder; |
| | |
| | | dbCloseLock = new ReentrantReadWriteLock(true); |
| | | |
| | | // |
| | | Cursor cursor = null; |
| | | Cursor cursor; |
| | | Transaction txn = null; |
| | | DatabaseEntry key = new DatabaseEntry(); |
| | | DatabaseEntry data = new DatabaseEntry(); |
| | |
| | | public ChangeNumber readFirstChange() |
| | | { |
| | | Cursor cursor = null; |
| | | String str = null; |
| | | ChangeNumber cn = null; |
| | | |
| | | try |
| | |
| | | return null; |
| | | } |
| | | |
| | | str = decodeUTF8(key.getData()); |
| | | String str = decodeUTF8(key.getData()); |
| | | cn = new ChangeNumber(str); |
| | | if (ReplicationDB.isaCounter(cn)) |
| | | { |
| | |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return serverId + baseDn.toString(); |
| | | return serverId + baseDn; |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | // We can move close to the startingChangeNumber. |
| | | // Let's create a cursor from that point. |
| | | DatabaseEntry key = new DatabaseEntry(); |
| | | DatabaseEntry data = new DatabaseEntry(); |
| | | if (localCursor.getPrev(key, data, LockMode.DEFAULT) != |
| | | DatabaseEntry aKey = new DatabaseEntry(); |
| | | DatabaseEntry aData = new DatabaseEntry(); |
| | | if (localCursor.getPrev(aKey, aData, LockMode.DEFAULT) != |
| | | OperationStatus.SUCCESS) |
| | | { |
| | | localCursor.close(); |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | import org.opends.messages.*; |
| | |
| | | String[] str = stringData.split(FIELD_SEPARATOR, 3); |
| | | if (str[0].equals(GENERATION_ID_TAG)) |
| | | { |
| | | long generationId=-1; |
| | | long generationId; |
| | | |
| | | String baseDn; |
| | | |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | * Portions Copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | * check that all replication server in the config are in the |
| | | * connected Set. If not create the connection |
| | | */ |
| | | for (String serverURL : replicationServers) |
| | | for (String aServerURL : replicationServers) |
| | | { |
| | | final int separator = serverURL.lastIndexOf(':'); |
| | | final String portString = serverURL.substring(separator + 1); |
| | | final int separator = aServerURL.lastIndexOf(':'); |
| | | final String portString = aServerURL.substring(separator + 1); |
| | | final int port = Integer.parseInt(portString); |
| | | final String hostname = serverURL.substring(0, separator); |
| | | final String hostname = aServerURL.substring(0, separator); |
| | | final InetAddress inetAddress; |
| | | try |
| | | { |
| | |
| | | } |
| | | |
| | | // Don't connect to a server if it is already connected. |
| | | final String normalizedServerURL = normalizeServerURL(serverURL); |
| | | final String normalizedServerURL = normalizeServerURL(aServerURL); |
| | | if (connectedReplServers.contains(normalizedServerURL)) |
| | | { |
| | | continue; |
| | | } |
| | | |
| | | connect(serverURL, domain.getBaseDn()); |
| | | connect(aServerURL, domain.getBaseDn()); |
| | | } |
| | | } |
| | | |
| | |
| | | " getEligibleCN() ends with " + |
| | | " the following domainEligibleCN for each domain :" + debugLog + |
| | | " thus CrossDomainEligibleCN=" + eligibleCN + |
| | | " ts=" + |
| | | (eligibleCN!=null? |
| | | new Date(eligibleCN.getTime()).toString(): null)); |
| | | " ts=" + new Date(eligibleCN.getTime()).toString()); |
| | | |
| | | return eligibleCN; |
| | | } |
| | |
| | | |
| | | // for this domain, have the state in the replchangelog |
| | | // where the last DraftCN update is |
| | | long ec =0; |
| | | long ec; |
| | | if (domainsServerStateForLastSeqnum == null) |
| | | { |
| | | // Count changes of this domain from the beginning of the changelog |
| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions copyright 2011 ForgeRock AS |
| | | * Portions copyright 2011-2012 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | |
| | |
| | | |
| | | // look for the dbHandler that is responsible for the LDAP server which |
| | | // generated the change. |
| | | DbHandler dbHandler = null; |
| | | DbHandler dbHandler; |
| | | synchronized (sourceDbHandlers) |
| | | { |
| | | dbHandler = sourceDbHandlers.get(id); |
| | |
| | | if (i==2) |
| | | { |
| | | Message message = ERR_EXCEPTION_SENDING_TOPO_INFO.get( |
| | | baseDn.toString(), |
| | | baseDn, |
| | | "directory", |
| | | Integer.toString(handler.getServerId()), |
| | | e.getMessage()); |
| | |
| | | if (i==2) |
| | | { |
| | | Message message = ERR_EXCEPTION_SENDING_TOPO_INFO.get( |
| | | baseDn.toString(), |
| | | baseDn, |
| | | "replication", |
| | | Integer.toString(handler.getServerId()), |
| | | e.getMessage()); |
| | |
| | | } |
| | | } catch (IOException e) |
| | | { |
| | | logError(ERR_EXCEPTION_FORWARDING_RESET_GEN_ID.get(baseDn.toString(), |
| | | logError(ERR_EXCEPTION_FORWARDING_RESET_GEN_ID.get(baseDn, |
| | | e.getMessage())); |
| | | } |
| | | } |
| | |
| | | dsHandler.changeStatusForResetGenId(newGenId); |
| | | } catch (IOException e) |
| | | { |
| | | logError(ERR_EXCEPTION_CHANGING_STATUS_AFTER_RESET_GEN_ID.get(baseDn. |
| | | toString(), |
| | | logError(ERR_EXCEPTION_CHANGING_STATUS_AFTER_RESET_GEN_ID.get(baseDn, |
| | | Integer.toString(dsHandler.getServerId()), |
| | | e.getMessage())); |
| | | } |
| | |
| | | catch (IOException e) |
| | | { |
| | | logError(ERR_EXCEPTION_CHANGING_STATUS_FROM_STATUS_ANALYZER |
| | | .get(baseDn.toString(), |
| | | .get(baseDn, |
| | | Integer.toString(serverHandler.getServerId()), |
| | | e.getMessage())); |
| | | } |
| | |
| | | |
| | | // Publish to monitor the generation ID by replicationServerDomain |
| | | builder = new AttributeBuilder("generation-id"); |
| | | builder.add(baseDn.toString() + " " + generationId); |
| | | builder.add(baseDn + " " + generationId); |
| | | attributes.add(builder.toAttribute()); |
| | | |
| | | MonitorData md = getDomainMonitorData(); |
| | |
| | | ArrayList<Attribute> attributes = super.getMonitorData(); |
| | | |
| | | attributes.add(Attributes.create("server-id", String.valueOf(serverId))); |
| | | attributes.add(Attributes.create("domain-name", getServiceId().toString())); |
| | | attributes.add(Attributes.create("domain-name", getServiceId())); |
| | | |
| | | // Deprecated |
| | | attributes.add(Attributes.create("max-waiting-changes", String |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Directory server status analyzer starting for dn " + |
| | | replicationServerDomain.getBaseDn().toString()); |
| | | replicationServerDomain.getBaseDn()); |
| | | } |
| | | |
| | | boolean interrupted = false; |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Shutting down status analyzer for dn " |
| | | + replicationServerDomain.getBaseDn().toString() + " in RS " |
| | | + replicationServerDomain.getBaseDn() + " in RS " |
| | | + replicationServerDomain.getReplicationServer().getServerId()); |
| | | } |
| | | } |
| | |
| | | if (n >= FACTOR) |
| | | { |
| | | TRACER.debugInfo("Interrupting status analyzer for dn " + |
| | | replicationServerDomain.getBaseDn().toString() + " in RS " + |
| | | replicationServerDomain.getBaseDn() + " in RS " + |
| | | replicationServerDomain.getReplicationServer().getServerId()); |
| | | this.interrupt(); |
| | | } |
| | |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugInfo("Directory server status analyzer for dn " + |
| | | replicationServerDomain.getBaseDn().toString() + " changing threshold" + |
| | | " value to " + degradedStatusThreshold); |
| | | replicationServerDomain.getBaseDn() + " changing threshold value to " + |
| | | degradedStatusThreshold); |
| | | } |
| | | |
| | | this.degradedStatusThreshold = degradedStatusThreshold; |
| | |
| | | |
| | | // Get and compare addresses of RS1 and RS2 |
| | | String rs1 = rs1Url.substring(0, separator1); |
| | | InetAddress[] rs1Addresses = null; |
| | | InetAddress[] rs1Addresses; |
| | | try |
| | | { |
| | | if (isLocalAddress(rs1)) |
| | |
| | | } |
| | | |
| | | String rs2 = rs2Url.substring(0, separator2); |
| | | InetAddress[] rs2Addresses = null; |
| | | InetAddress[] rs2Addresses; |
| | | try |
| | | { |
| | | if (isLocalAddress(rs1)) |
| | |
| | | hasSomeServerWithSameGroupId(topologyMsg.getRsList()); |
| | | |
| | | // Really no other server with our group id ? |
| | | if ((tmpRsGroupId == groupId) || |
| | | ((tmpRsGroupId != groupId) && !someServersWithSameGroupId)) |
| | | if ((tmpRsGroupId == groupId) || (!someServersWithSameGroupId)) |
| | | { |
| | | replicationServer = session.getReadableRemoteAddress(); |
| | | maxSendWindow = replicationServerInfo.getWindowSize(); |
| | |
| | | Byte.toString(groupId), Integer.toString(rsServerId), |
| | | replicationServerInfo.getServerURL(), |
| | | Byte.toString(getRsGroupId()), |
| | | baseDn.toString(), Integer.toString(serverId)); |
| | | baseDn, Integer.toString(serverId)); |
| | | logError(message); |
| | | } |
| | | startRSHeartBeatMonitoring(); |
| | |
| | | String repDn = replServerInfo.getBaseDn(); |
| | | if (!(this.baseDn.equals(repDn))) |
| | | { |
| | | errorMessage = ERR_DS_DN_DOES_NOT_MATCH.get(repDn.toString(), |
| | | errorMessage = ERR_DS_DN_DOES_NOT_MATCH.get(repDn, |
| | | this.baseDn); |
| | | return null; |
| | | } |
| | |
| | | try |
| | | { |
| | | // Send our Start Session |
| | | StartECLSessionMsg startECLSessionMsg = null; |
| | | startECLSessionMsg = new StartECLSessionMsg(); |
| | | StartECLSessionMsg startECLSessionMsg = new StartECLSessionMsg(); |
| | | startECLSessionMsg.setOperationId("-1"); |
| | | session.publish(startECLSessionMsg); |
| | | |
| | |
| | | private TopologyMsg performPhaseTwoHandshake(String server, |
| | | ServerStatus initStatus) |
| | | { |
| | | TopologyMsg topologyMsg = null; |
| | | TopologyMsg topologyMsg; |
| | | |
| | | try |
| | | { |
| | | /* |
| | | * Send our StartSessionMsg. |
| | | */ |
| | | StartSessionMsg startSessionMsg = null; |
| | | StartSessionMsg startSessionMsg; |
| | | // May have created a broker with null replication domain for |
| | | // unit test purpose. |
| | | if (domain != null) |
| | |
| | | return false; |
| | | } |
| | | |
| | | private static final void debugInfo(String s) |
| | | private static void debugInfo(String s) |
| | | { |
| | | logError(Message.raw(Category.SYNC, Severity.NOTICE, s)); |
| | | TRACER.debugInfo(s); |