2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.bgpcep.programming.spi;
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev130930.InstructionStatus;
11 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev130930.instruction.status.changed.Details;
16 public interface Instruction {
18 * Instruction executors are required to call this method prior to
19 * starting executing on the instruction. Implementations of this method
20 * are required to transition into Executing state and return true, or
21 * into Cancelled state and return false.
23 * @return Indication whether the instruction execution should proceed.
25 boolean checkedExecutionStart();
28 * Instruction executors can inform about execution hold ups which
29 * prevent an otherwise-ready instruction from executing by calling this
30 * method. It is recommended they check the return of this method to
31 * detect if a cancellation occurred asynchronously.
33 * @param details Details which execution is held up
34 * @return Indication whether the instruction execution should proceed.
35 * If this method returns false, all subsequent calls to this
36 * method as well as {@link checkedExecutionStart()} will return
39 boolean executionHeldUp(Details details);
42 * Instruction executors are required to call this method when execution
43 * has finished to provide the execution result to the end.
45 * @param status Execution result
46 * @param details Execution result details
48 void executionCompleted(InstructionStatus status, Details details);