use of org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor in project bgpcep by opendaylight.
the class TopologyProgramming method submitAddLsp.
@Override
public ListenableFuture<RpcResult<SubmitAddLspOutput>> submitAddLsp(final SubmitAddLspInput input) {
Preconditions.checkArgument(input.getNode() != null);
Preconditions.checkArgument(input.getName() != null);
final SubmitAddLspOutputBuilder b = new SubmitAddLspOutputBuilder();
b.setResult(AbstractInstructionExecutor.schedule(this.scheduler, new AbstractInstructionExecutor(input) {
@Override
protected ListenableFuture<OperationResult> invokeOperation() {
return TopologyProgramming.this.manager.addLsp(input);
}
}));
final RpcResult<SubmitAddLspOutput> res = SuccessfulRpcResult.create(b.build());
return Futures.immediateFuture(res);
}
use of org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor in project bgpcep by opendaylight.
the class TopologyProgramming method submitEnsureLspOperational.
@Override
public ListenableFuture<RpcResult<SubmitEnsureLspOperationalOutput>> submitEnsureLspOperational(final SubmitEnsureLspOperationalInput input) {
Preconditions.checkArgument(input.getNode() != null);
Preconditions.checkArgument(input.getName() != null);
Preconditions.checkArgument(input.getArguments() != null);
// FIXME: can we validate this early?
// Preconditions.checkArgument(input.getArguments().getOperational() != null);
final SubmitEnsureLspOperationalOutputBuilder b = new SubmitEnsureLspOperationalOutputBuilder();
b.setResult(AbstractInstructionExecutor.schedule(this.scheduler, new AbstractInstructionExecutor(input) {
@Override
protected ListenableFuture<OperationResult> invokeOperation() {
EnsureLspOperationalInputBuilder ensureLspOperationalInputBuilder = new EnsureLspOperationalInputBuilder();
ensureLspOperationalInputBuilder.fieldsFrom(input);
return TopologyProgramming.this.manager.ensureLspOperational(ensureLspOperationalInputBuilder.build());
}
}));
final RpcResult<SubmitEnsureLspOperationalOutput> res = SuccessfulRpcResult.create(b.build());
return Futures.immediateFuture(res);
}
use of org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor in project bgpcep by opendaylight.
the class TopologyProgramming method submitRemoveLsp.
@Override
public ListenableFuture<RpcResult<SubmitRemoveLspOutput>> submitRemoveLsp(final SubmitRemoveLspInput input) {
Preconditions.checkArgument(input.getNode() != null);
Preconditions.checkArgument(input.getName() != null);
final SubmitRemoveLspOutputBuilder b = new SubmitRemoveLspOutputBuilder();
b.setResult(AbstractInstructionExecutor.schedule(this.scheduler, new AbstractInstructionExecutor(input) {
@Override
protected ListenableFuture<OperationResult> invokeOperation() {
return TopologyProgramming.this.manager.removeLsp(input);
}
}));
final RpcResult<SubmitRemoveLspOutput> res = SuccessfulRpcResult.create(b.build());
return Futures.immediateFuture(res);
}
use of org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor in project bgpcep by opendaylight.
the class TopologyProgramming method submitTriggerSync.
@Override
public ListenableFuture<RpcResult<SubmitTriggerSyncOutput>> submitTriggerSync(final SubmitTriggerSyncInput input) {
Preconditions.checkArgument(input.getNode() != null);
final SubmitTriggerSyncOutputBuilder b = new SubmitTriggerSyncOutputBuilder();
b.setResult(AbstractInstructionExecutor.schedule(this.scheduler, new AbstractInstructionExecutor(input) {
@Override
protected ListenableFuture<OperationResult> invokeOperation() {
return TopologyProgramming.this.manager.triggerSync(input);
}
}));
final RpcResult<SubmitTriggerSyncOutput> res = SuccessfulRpcResult.create(b.build());
return Futures.immediateFuture(res);
}
use of org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor in project bgpcep by opendaylight.
the class TopologyProgramming method submitUpdateLsp.
@Override
public ListenableFuture<RpcResult<SubmitUpdateLspOutput>> submitUpdateLsp(final SubmitUpdateLspInput input) {
Preconditions.checkArgument(input.getNode() != null);
Preconditions.checkArgument(input.getName() != null);
final SubmitUpdateLspOutputBuilder b = new SubmitUpdateLspOutputBuilder();
b.setResult(AbstractInstructionExecutor.schedule(this.scheduler, new AbstractInstructionExecutor(input) {
@Override
protected ListenableFuture<OperationResult> invokeOperation() {
return TopologyProgramming.this.manager.updateLsp(input);
}
}));
final RpcResult<SubmitUpdateLspOutput> res = SuccessfulRpcResult.create(b.build());
return Futures.immediateFuture(res);
}
Aggregations