| | |
| | | /** The group id of the RS we are connected to. */ |
| | | private byte rsGroupId = -1; |
| | | /** The server id of the RS we are connected to. */ |
| | | private Integer rsServerId = -1; |
| | | private int rsServerId = -1; |
| | | /** The server URL of the RS we are connected to. */ |
| | | private String rsServerUrl; |
| | | /** Our replication domain. */ |
| | |
| | | * as seen by the ReplicationServer the last time it was polled or the last |
| | | * time it published monitoring information. |
| | | */ |
| | | private HashMap<Integer, ServerState> replicaStates = |
| | | private Map<Integer, ServerState> replicaStates = |
| | | new HashMap<Integer, ServerState>(); |
| | | /** |
| | | * The expected duration in milliseconds between heartbeats received |
| | |
| | | * Gets the server id of the RS we are connected to. |
| | | * @return The server id of the RS we are connected to |
| | | */ |
| | | public Integer getRsServerId() |
| | | public int getRsServerId() |
| | | { |
| | | return rsServerId; |
| | | } |
| | |
| | | MonitorMsg monitorMsg = (MonitorMsg) msg; |
| | | |
| | | // Extract and store replicas ServerStates |
| | | replicaStates = new HashMap<Integer, ServerState>(); |
| | | final Map<Integer, ServerState> newReplicaStates = |
| | | new HashMap<Integer, ServerState>(); |
| | | for (int srvId : toIterable(monitorMsg.ldapIterator())) |
| | | { |
| | | replicaStates.put(srvId, monitorMsg.getLDAPServerState(srvId)); |
| | | newReplicaStates.put(srvId, monitorMsg.getLDAPServerState(srvId)); |
| | | } |
| | | replicaStates = newReplicaStates; |
| | | |
| | | // Notify the sender that the response was received. |
| | | synchronized (monitorResponse) |
| | |
| | | @Override |
| | | public String toString() |
| | | { |
| | | return getClass().getSimpleName() + " " + baseDN + " " + serverId; |
| | | return getClass().getSimpleName() + " \"" + baseDN + " " + serverId + "\"," |
| | | + " groupId=" + groupId + ", genId=" + generationID |
| | | + ", bestRS(serverId=" + rsServerId + ", serverUrl=" + rsServerUrl |
| | | + ", groupId=" + rsGroupId + ")"; |
| | | } |
| | | } |