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 *
5133N/A * Copyright 2008-2010 Sun Microsystems, Inc.
3853N/A */
3853N/A
3853N/Apackage org.opends.guitools.controlpanel.browser;
3853N/A
3853N/Aimport org.opends.guitools.controlpanel.ui.nodes.BasicNode;
3853N/A
3853N/A/**
3853N/A * This is an abstract class that is extended to search for nodes or
3853N/A * to refresh the contents of the nodes.
3853N/A */
3853N/Apublic abstract class AbstractNodeTask implements Runnable {
3853N/A
3853N/A BasicNode node;
3853N/A boolean cancelled;
3853N/A
3853N/A /**
3853N/A * The constructor of the node searcher.
3853N/A * @param node the node to be searched/refreshed.
3853N/A */
3853N/A protected AbstractNodeTask(BasicNode node) {
3853N/A this.node = node;
3853N/A cancelled = false;
3853N/A }
3853N/A
3853N/A
3853N/A /**
3853N/A * Returns the node that is being searched/refreshed.
3853N/A * @return the node that is being searched/refreshed.
3853N/A */
3853N/A public BasicNode getNode() {
3853N/A return node;
3853N/A }
3853N/A
3853N/A
3853N/A /**
3853N/A * Cancels the searching/refreshing process.
3853N/A *
3853N/A */
3853N/A public void cancel() {
3853N/A cancelled = true;
3853N/A }
3853N/A
3853N/A /**
3853N/A * Tells whether the search/refresh operation is cancelled.
3853N/A * @return <CODE>true</CODE> if the operation is cancelled and
3853N/A * <CODE>false</CODE> otherwise.
3853N/A */
5133N/A public boolean isCanceled() {
3853N/A return cancelled;
3853N/A }
3853N/A
3853N/A /**
3853N/A * The method that is called to refresh/search the node.
3853N/A */
3853N/A public abstract void run();
3853N/A}