| | |
| | | |
| | | package org.opends.statuspanel; |
| | | |
| | | import java.util.Set; |
| | | import java.util.SortedSet; |
| | | |
| | | /** |
| | | * This class is used to represent a Database and is aimed to be used by the |
| | |
| | | public class DatabaseDescriptor |
| | | { |
| | | private String backendID; |
| | | private Set<BaseDNDescriptor> baseDns; |
| | | private SortedSet<BaseDNDescriptor> baseDns; |
| | | private int entries; |
| | | |
| | | /** |
| | |
| | | * @param baseDns the base DNs associated with the Database. |
| | | * @param entries the number of entries in the Database. |
| | | */ |
| | | public DatabaseDescriptor(String backendID, Set<BaseDNDescriptor> baseDns, |
| | | public DatabaseDescriptor(String backendID, |
| | | SortedSet<BaseDNDescriptor> baseDns, |
| | | int entries) |
| | | { |
| | | this.backendID = backendID; |
| | |
| | | * Returns the Base DN objects associated with the database. |
| | | * @return the Base DN objects associated with the database. |
| | | */ |
| | | public Set<BaseDNDescriptor> getBaseDns() |
| | | public SortedSet<BaseDNDescriptor> getBaseDns() |
| | | { |
| | | return baseDns; |
| | | } |
| | |
| | | |
| | | if (equals) |
| | | { |
| | | equals = baseDns.equals(desc.getBaseDns()); |
| | | equals = desc.getBaseDns().equals(getBaseDns()); |
| | | } |
| | | } |
| | | } |
| | |
| | | StringBuilder buf = new StringBuilder(); |
| | | for (BaseDNDescriptor rep: getBaseDns()) |
| | | { |
| | | buf.append(rep.getDn()); |
| | | buf.append(rep.hashCode()+";"); |
| | | } |
| | | return (getBackendID() + buf.toString() + getEntries()).hashCode(); |
| | | buf.append(getBackendID() + getEntries()); |
| | | |
| | | return buf.toString().hashCode(); |
| | | } |
| | | } |