9ca8facad395db7554217d9cfdb44d87f66c1afb
[bgpcep.git] / programming / spi / src / main / java / org / opendaylight / bgpcep / programming / spi / InstructionScheduler.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.bgpcep.programming.spi;
9
10 import com.google.common.util.concurrent.ListenableFuture;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.opendaylight.mdsal.singleton.common.api.ServiceGroupIdentifier;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.SubmitInstructionInput;
14 import org.opendaylight.yangtools.concepts.Identifiable;
15 import org.opendaylight.yangtools.concepts.Registration;
16
17 public interface InstructionScheduler extends Identifiable<ServiceGroupIdentifier>, Registration {
18     /**
19      * Schedule a new instruction for execution. This method tries to enqueue an instruction. It will return a Future
20      * which represents the scheduling progress. When the future becomes successful, the requestor is expected to start
21      * executing on the instruction, as specified by the {@link Instruction} contract.
22      *
23      * @param input Instruction scheduling information
24      * @return Scheduling future.
25      * @throws SchedulerException if a failure to schedule the instruction occurs.
26      */
27     ListenableFuture<Instruction> scheduleInstruction(SubmitInstructionInput input) throws SchedulerException;
28
29     /**
30      * Returns InstructionID.
31      *
32      * @return Instruction ID
33      */
34     @NonNull String getInstructionID();
35 }