| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.replication.common; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * This class holds information about a DS connected to the topology. This |
| | |
| | | // Group id |
| | | private byte groupId = (byte) -1; |
| | | |
| | | private Set<String> eclIncludes = new HashSet<String>(); |
| | | |
| | | /** |
| | | * Creates a new instance of DSInfo with every given info. |
| | | * |
| | |
| | | * @param safeDataLevel DS safe data level |
| | | * @param groupId DS group id |
| | | * @param refUrls DS exported referrals URLs |
| | | * @param eclIncludes The list of entry attributes to include in the ECL. |
| | | */ |
| | | public DSInfo(short dsId, short rsId, long generationId, ServerStatus status, |
| | | boolean assuredFlag, AssuredMode assuredMode, byte safeDataLevel, |
| | | byte groupId, List<String> refUrls) |
| | | byte groupId, List<String> refUrls, Set<String> eclIncludes) |
| | | { |
| | | |
| | | this.dsId = dsId; |
| | |
| | | this.safeDataLevel = safeDataLevel; |
| | | this.groupId = groupId; |
| | | this.refUrls = refUrls; |
| | | this.eclIncludes = eclIncludes; |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * Get the entry attributes to be included in the ECL. |
| | | * @return a. |
| | | */ |
| | | public Set<String> getEclIncludes() |
| | | { |
| | | return eclIncludes; |
| | | } |
| | | |
| | | /** |
| | | * Test if the passed object is equal to this one. |
| | | * @param obj The object to test |
| | | * @return True if both objects are equal |
| | |
| | | (assuredMode == dsInfo.getAssuredMode()) && |
| | | (safeDataLevel == dsInfo.getSafeDataLevel()) && |
| | | (groupId == dsInfo.getGroupId()) && |
| | | (refUrls.equals(dsInfo.getRefUrls()))); |
| | | (refUrls.equals(dsInfo.getRefUrls())) && |
| | | (eclIncludes.equals(dsInfo.getEclIncludes()))); |
| | | } else |
| | | { |
| | | return false; |
| | |
| | | 73 * hash + (this.assuredMode != null ? this.assuredMode.hashCode() : 0); |
| | | hash = 73 * hash + this.safeDataLevel; |
| | | hash = 73 * hash + (this.refUrls != null ? this.refUrls.hashCode() : 0); |
| | | hash = 73 * hash + (this.eclIncludes != null ? eclIncludes.hashCode() : 0); |
| | | hash = 73 * hash + this.groupId; |
| | | return hash; |
| | | } |
| | |
| | | sb.append(groupId); |
| | | sb.append("\nReferral URLs: "); |
| | | sb.append(refUrls); |
| | | sb.append("\nECL Include: "); |
| | | sb.append(eclIncludes); |
| | | return sb.toString(); |
| | | } |
| | | |