Search in sources :

Example 1 with SubmitEnsureLspOperationalOutputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev181109.SubmitEnsureLspOperationalOutputBuilder 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.rev200120.OperationResult) SubmitEnsureLspOperationalOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev181109.SubmitEnsureLspOperationalOutput) EnsureLspOperationalInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.EnsureLspOperationalInputBuilder) AbstractInstructionExecutor(org.opendaylight.bgpcep.pcep.topology.spi.AbstractInstructionExecutor) SubmitEnsureLspOperationalOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev181109.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.rev181109.SubmitEnsureLspOperationalOutput)1 SubmitEnsureLspOperationalOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.programming.rev181109.SubmitEnsureLspOperationalOutputBuilder)1 EnsureLspOperationalInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.EnsureLspOperationalInputBuilder)1 OperationResult (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.rev200120.OperationResult)1