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 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;
17 public interface InstructionScheduler extends Identifiable<ServiceGroupIdentifier>, Registration {
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.
23 * @param input Instruction scheduling information
24 * @return Scheduling future.
25 * @throws SchedulerException if a failure to schedule the instruction occurs.
27 ListenableFuture<Instruction> scheduleInstruction(SubmitInstructionInput input) throws SchedulerException;
30 * Returns InstructionID.
32 * @return Instruction ID
34 @NonNull String getInstructionID();