| | |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.forgerock.opendj.ldap.EntryNotFoundException; |
| | | import org.forgerock.opendj.ldap.requests.Requests; |
| | | import org.forgerock.opendj.ldap.requests.SearchRequest; |
| | | import org.forgerock.opendj.ldap.responses.SearchResultEntry; |
| | | import org.forgerock.opendj.ldif.ConnectionEntryReader; |
| | |
| | | import static com.forgerock.opendj.cli.Utils.*; |
| | | |
| | | import static org.forgerock.opendj.ldap.SearchScope.*; |
| | | import static org.forgerock.opendj.ldap.requests.Requests.*; |
| | | import static org.opends.admin.ads.util.ConnectionUtils.*; |
| | | import static org.opends.messages.QuickSetupMessages.*; |
| | | |
| | | /** |
| | | * This class allows to read the configuration of the different servers that are |
| | | * registered in a given ADS server. It provides a read only view of the |
| | |
| | | throws NamingException, IOException |
| | | { |
| | | ServerLoader loader = getServerLoader(replicationServer.getAdsProperties()); |
| | | SearchRequest request = Requests.newSearchRequest("cn=monitor", WHOLE_SUBTREE, "(missing-changes=*)", |
| | | // only replicas have "server-id", but not replication servers |
| | | SearchRequest request = newSearchRequest("cn=monitor", WHOLE_SUBTREE, "(&(missing-changes=*)(server-id=*))", |
| | | "domain-name", |
| | | "server-id", |
| | | "missing-changes", |
| | |
| | | int replicaId = -1; |
| | | try |
| | | { |
| | | Integer sid = asInteger(sr, "server-id"); |
| | | if (sid == null) |
| | | { |
| | | // This is not a replica, but a replication server. Skip it |
| | | continue; |
| | | } |
| | | replicaId = Integer.valueOf(sid); |
| | | replicaId = sr.getAttribute("server-id").parse().asInteger(); |
| | | } |
| | | catch (Throwable t) |
| | | { |
| | |
| | | |
| | | for (ReplicaDescriptor replica : candidateReplicas) |
| | | { |
| | | if (dn.equals(replica.getSuffix().getDN()) |
| | | && replica.isReplicated() |
| | | if (replica.isReplicated() |
| | | && dn.equals(replica.getSuffix().getDN()) |
| | | && replica.getReplicationId() == replicaId) |
| | | { |
| | | // This statistic is optional. |
| | | setAgeOfOldestMissingChange(replica, sr); |
| | | setMissingChanges(replica, sr); |
| | | updatedReplicas.add(replica); |
| | | break; |
| | | } |
| | | } |
| | | } |