3853N/A/*
3853N/A * CDDL HEADER START
3853N/A *
3853N/A * The contents of this file are subject to the terms of the
3853N/A * Common Development and Distribution License, Version 1.0 only
3853N/A * (the "License"). You may not use this file except in compliance
3853N/A * with the License.
3853N/A *
3853N/A * You can obtain a copy of the license at
3853N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE
3853N/A * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
3853N/A * See the License for the specific language governing permissions
3853N/A * and limitations under the License.
3853N/A *
3853N/A * When distributing Covered Code, include this CDDL HEADER in each
3853N/A * file and include the License file at
3853N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
3853N/A * add the following below this CDDL HEADER, with the fields enclosed
3853N/A * by brackets "[]" replaced with your own identifying information:
3853N/A * Portions Copyright [yyyy] [name of copyright owner]
3853N/A *
3853N/A * CDDL HEADER END
3853N/A *
3853N/A *
3853N/A * Copyright 2008 Sun Microsystems, Inc.
3853N/A */
3853N/A
3853N/Apackage org.opends.guitools.controlpanel.event;
3853N/A
3853N/Aimport java.util.HashSet;
3853N/Aimport java.util.Set;
3853N/A
3853N/Aimport org.opends.guitools.controlpanel.datamodel.AbstractIndexDescriptor;
3853N/Aimport org.opends.guitools.controlpanel.datamodel.BackendDescriptor;
3853N/A
3853N/A/**
3853N/A * The event that describes a modification of the index.
3853N/A *
3853N/A */
3853N/Apublic class IndexModifiedEvent
3853N/A{
3853N/A private Set<AbstractIndexDescriptor> modifiedIndexes =
3853N/A new HashSet<AbstractIndexDescriptor>();
3853N/A
3853N/A /**
3853N/A * The constructor of the event.
3853N/A * @param modifiedIndex the modified indexes.
3853N/A */
3853N/A public IndexModifiedEvent(AbstractIndexDescriptor modifiedIndex)
3853N/A {
3853N/A this.modifiedIndexes.add(modifiedIndex);
3853N/A }
3853N/A
3853N/A /**
3853N/A * The event will contain all the indexes in a given backend.
3853N/A * @param backend the backend whose indexes have been modified.
3853N/A */
3853N/A public IndexModifiedEvent(BackendDescriptor backend)
3853N/A {
3853N/A this.modifiedIndexes.addAll(backend.getIndexes());
3853N/A this.modifiedIndexes.addAll(backend.getVLVIndexes());
3853N/A }
3853N/A
3853N/A /**
3853N/A * Returns list of indexes that have been modified.
3853N/A * @return list of indexes that have been modified.
3853N/A */
3853N/A public Set<AbstractIndexDescriptor> getIndexDescriptor()
3853N/A {
3853N/A return modifiedIndexes;
3853N/A }
3853N/A}