| | |
| | | getMsg("basedn-column"), |
| | | getMsg("backendid-column"), |
| | | getMsg("number-entries-column"), |
| | | getMsg("synchronized-column"), |
| | | getMsg("replicated-column"), |
| | | getMsg("missing-changes-column"), |
| | | getMsg("age-of-oldest-missing-change-column") |
| | | }; |
| | |
| | | |
| | | if (result == 0) |
| | | { |
| | | result = compareSync(desc1, desc2); |
| | | result = compareRepl(desc1, desc2); |
| | | } |
| | | |
| | | if (result == 0) |
| | |
| | | |
| | | if (result == 0) |
| | | { |
| | | result = compareSync(desc1, desc2); |
| | | result = compareRepl(desc1, desc2); |
| | | } |
| | | |
| | | if (result == 0) |
| | |
| | | |
| | | if (result == 0) |
| | | { |
| | | result = compareSync(desc1, desc2); |
| | | result = compareRepl(desc1, desc2); |
| | | } |
| | | |
| | | if (result == 0) |
| | |
| | | } |
| | | else if (sortColumn == 3) |
| | | { |
| | | result = compareSync(desc1, desc2); |
| | | result = compareRepl(desc1, desc2); |
| | | |
| | | if (result == 0) |
| | | { |
| | |
| | | |
| | | if (result == 0) |
| | | { |
| | | result = compareSync(desc1, desc2); |
| | | result = compareRepl(desc1, desc2); |
| | | } |
| | | |
| | | if (result == 0) |
| | |
| | | |
| | | if (result == 0) |
| | | { |
| | | result = compareSync(desc1, desc2); |
| | | result = compareRepl(desc1, desc2); |
| | | } |
| | | |
| | | if (result == 0) |
| | |
| | | } |
| | | else if (col == 3) |
| | | { |
| | | v = getStringForSyncState(desc); |
| | | v = getStringForReplState(desc); |
| | | } |
| | | else if (col == 4) |
| | | { |
| | |
| | | return desc1.getDn().compareTo(desc2.getDn()); |
| | | } |
| | | |
| | | private int compareSync(BaseDNDescriptor desc1, BaseDNDescriptor desc2) |
| | | private int compareRepl(BaseDNDescriptor desc1, BaseDNDescriptor desc2) |
| | | { |
| | | return (String.valueOf(desc1.getType()).compareTo( |
| | | String.valueOf(desc2.getType()))); |
| | |
| | | /** |
| | | * Returns the Object describing the number of missing changes of a given Base |
| | | * DN. The Object will be a String unless the base DN is |
| | | * synchronized and we could not find a valid value (in this case we return |
| | | * replicated and we could not find a valid value (in this case we return |
| | | * an Integer with the invalid value). |
| | | * @param rep the Base DN object to handle. |
| | | * @return the Object describing the number of missing changes of |
| | |
| | | private Object getValueForMissingChanges(BaseDNDescriptor rep) |
| | | { |
| | | Object v; |
| | | if (rep.getType() == BaseDNDescriptor.Type.SYNCHRONIZED) |
| | | if (rep.getType() == BaseDNDescriptor.Type.REPLICATED) |
| | | { |
| | | v = new Integer(rep.getMissingChanges()); |
| | | } |
| | |
| | | /** |
| | | * Returns the Object describing the age of oldest missing change of |
| | | * a given Base DN. The Object will be a String unless the base DN is |
| | | * synchronized and we could not find a valid value (in this case we return |
| | | * replicated and we could not find a valid value (in this case we return |
| | | * an Integer with the invalid value). |
| | | * @param rep the Base DN object to handle. |
| | | * @return the Object describing the age of oldest missing change of |
| | |
| | | private Object getValueForOldestMissingChange(BaseDNDescriptor rep) |
| | | { |
| | | Object v; |
| | | if (rep.getType() == BaseDNDescriptor.Type.SYNCHRONIZED) |
| | | if (rep.getType() == BaseDNDescriptor.Type.REPLICATED) |
| | | { |
| | | int age = rep.getAgeOfOldestMissingChange(); |
| | | if (age >= 0) |
| | |
| | | } |
| | | |
| | | /** |
| | | * Returns the localized String describing the synchronization state of |
| | | * Returns the localized String describing the replication state of |
| | | * a given Base DN. |
| | | * @param rep the Base DN object to handle. |
| | | * @return the localized String describing the synchronization state of |
| | | * @return the localized String describing the replication state of |
| | | * a given Base DN. |
| | | */ |
| | | private String getStringForSyncState(BaseDNDescriptor rep) |
| | | private String getStringForReplState(BaseDNDescriptor rep) |
| | | { |
| | | String s; |
| | | if (rep.getType() == BaseDNDescriptor.Type.SYNCHRONIZED) |
| | | if (rep.getType() == BaseDNDescriptor.Type.REPLICATED) |
| | | { |
| | | s = getMsg("suffix-synchronized-label"); |
| | | s = getMsg("suffix-replicated-label"); |
| | | } |
| | | else |
| | | { |
| | | s = getMsg("suffix-not-synchronized-label"); |
| | | s = getMsg("suffix-not-replicated-label"); |
| | | } |
| | | return s; |
| | | } |