Search in sources :

Example 1 with AbstractInstructionExecutor

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);
}
Also used : SubmitAddLspOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitAddLspOutput) SubmitAddLspOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitAddLspOutputBuilder) OperationResult(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.OperationResult) AbstractInstructionExecutor(org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor)

Example 2 with AbstractInstructionExecutor

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);
}
Also used : OperationResult(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.OperationResult) SubmitEnsureLspOperationalOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitEnsureLspOperationalOutput) EnsureLspOperationalInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.EnsureLspOperationalInputBuilder) AbstractInstructionExecutor(org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor) SubmitEnsureLspOperationalOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitEnsureLspOperationalOutputBuilder)

Example 3 with AbstractInstructionExecutor

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);
}
Also used : SubmitRemoveLspOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitRemoveLspOutput) OperationResult(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.OperationResult) AbstractInstructionExecutor(org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor) SubmitRemoveLspOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitRemoveLspOutputBuilder)

Example 4 with AbstractInstructionExecutor

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);
}
Also used : SubmitTriggerSyncOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitTriggerSyncOutput) SubmitTriggerSyncOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitTriggerSyncOutputBuilder) OperationResult(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.OperationResult) AbstractInstructionExecutor(org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor)

Example 5 with AbstractInstructionExecutor

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);
}
Also used : SubmitUpdateLspOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitUpdateLspOutput) OperationResult(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.OperationResult) SubmitUpdateLspOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitUpdateLspOutputBuilder) AbstractInstructionExecutor(org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor)

Aggregations

AbstractInstructionExecutor (org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor)5 OperationResult (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.OperationResult)5 SubmitAddLspOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitAddLspOutput)1 SubmitAddLspOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitAddLspOutputBuilder)1 SubmitEnsureLspOperationalOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitEnsureLspOperationalOutput)1 SubmitEnsureLspOperationalOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitEnsureLspOperationalOutputBuilder)1 SubmitRemoveLspOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitRemoveLspOutput)1 SubmitRemoveLspOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitRemoveLspOutputBuilder)1 SubmitTriggerSyncOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitTriggerSyncOutput)1 SubmitTriggerSyncOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitTriggerSyncOutputBuilder)1 SubmitUpdateLspOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitUpdateLspOutput)1 SubmitUpdateLspOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitUpdateLspOutputBuilder)1 EnsureLspOperationalInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.EnsureLspOperationalInputBuilder)1