Search in sources :

Example 1 with SubmitEnsureLspOperationalOutput

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev171025.SubmitEnsureLspOperationalOutput 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)

Aggregations

AbstractInstructionExecutor (org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor)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 EnsureLspOperationalInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.EnsureLspOperationalInputBuilder)1 OperationResult (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev171025.OperationResult)1