001 /* 002 * CDDL HEADER START 003 * 004 * The contents of this file are subject to the terms of the 005 * Common Development and Distribution License, Version 1.0 only 006 * (the "License"). You may not use this file except in compliance 007 * with the License. 008 * 009 * You can obtain a copy of the license at 010 * trunk/opends/resource/legal-notices/OpenDS.LICENSE 011 * or https://OpenDS.dev.java.net/OpenDS.LICENSE. 012 * See the License for the specific language governing permissions 013 * and limitations under the License. 014 * 015 * When distributing Covered Code, include this CDDL HEADER in each 016 * file and include the License file at 017 * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable, 018 * add the following below this CDDL HEADER, with the fields enclosed 019 * by brackets "[]" replaced with your own identifying information: 020 * Portions Copyright [yyyy] [name of copyright owner] 021 * 022 * CDDL HEADER END 023 * 024 * 025 * Copyright 2008 Sun Microsystems, Inc. 026 */ 027 028 package org.opends.server.types; 029 030 /** 031 * Base for data structures that define configuration 032 * for operations. 033 */ 034 @org.opends.server.types.PublicAPI( 035 stability=org.opends.server.types.StabilityLevel.VOLATILE, 036 mayInstantiate=true, 037 mayExtend=false, 038 mayInvoke=true) 039 public abstract class OperationConfig { 040 041 // When true indicates that the operation should stop as soon as 042 // possible. 043 private boolean cancelled; 044 045 /** 046 * Indicates that this operation has been cancelled and the 047 * operation if executing should finish as soon as possible. 048 */ 049 public void cancel() 050 { 051 this.cancelled = true; 052 } 053 054 /** 055 * Indicates whether or not this operation has been 056 * cancelled. 057 * 058 * @return boolean where true indicates that this 059 * operation has been cancelled and if currently 060 * executing will finish as soon as possible 061 */ 062 public boolean isCancelled() 063 { 064 return this.cancelled; 065 } 066 }