/******************************************************************************* * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html * *******************************************************************************/ package com.cisco.yangide.core.indexing; import org.eclipse.core.runtime.IProgressMonitor; /** * @author Konstantin Zaitsev * @date Jul 1, 2014 */ public interface IJob { /* Waiting policies */ int ForceImmediate = 1; int CancelIfNotReady = 2; int WaitUntilReady = 3; /* Job's result */ boolean FAILED = false; boolean COMPLETE = true; /** * Answer true if the job belongs to a given family (tag) */ public boolean belongsTo(String jobFamily); /** * Asks this job to cancel its execution. The cancellation can take an undertermined amount of * time. */ public void cancel(); /** * Ensures that this job is ready to run. */ public void ensureReadyToRun(); /** * Execute the current job, answer whether it was successful. */ public boolean execute(IProgressMonitor progress); /** * Returns this job's family */ public String getJobFamily(); }