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 starting executing on the instruction.
19 * Implementations of this method are required to transition into Executing state and return true, or into Cancelled
20 * state and return false.
22 * @return Indication whether the instruction execution should proceed.
24 boolean checkedExecutionStart();
27 * Instruction executors can inform about execution hold ups which prevent an otherwise-ready instruction from
28 * executing by calling this method. It is recommended they check the return of this method to detect if a
29 * cancellation occurred asynchronously.
31 * @param details Details which execution is held up
32 * @return Indication whether the instruction execution should proceed. If this method returns false, all subsequent
33 * calls to this method as well as {@link checkedExecutionStart()} will return false.
35 boolean executionHeldUp(Details details);
38 * Instruction executors are required to call this method when execution has finished to provide the execution
41 * @param status Execution result
42 * @param details Execution result details
44 void executionCompleted(InstructionStatus status, Details details);