Search in sources :

Example 1 with InstructionsQueueKey

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.InstructionsQueueKey in project bgpcep by opendaylight.

the class ProgrammingServiceImpl method instantiateServiceInstance.

@Override
public synchronized void instantiateServiceInstance() {
    LOG.info("Instruction Queue service {} instantiated", this.sgi.getValue());
    this.reg = this.rpcProviderRegistry.addRpcImplementation(ProgrammingService.class, this);
    final WriteTransaction wt = this.dataProvider.newWriteOnlyTransaction();
    wt.put(LogicalDatastoreType.OPERATIONAL, this.qid, new InstructionsQueueBuilder().setKey(new InstructionsQueueKey(this.instructionId)).setInstruction(Collections.emptyList()).build());
    Futures.addCallback(wt.submit(), new FutureCallback<Void>() {

        @Override
        public void onSuccess(final Void result) {
            LOG.debug("Instruction Queue {} added", ProgrammingServiceImpl.this.qid);
        }

        @Override
        public void onFailure(final Throwable trw) {
            LOG.error("Failed to add Instruction Queue {}", ProgrammingServiceImpl.this.qid, trw);
        }
    }, MoreExecutors.directExecutor());
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) InstructionsQueueKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.InstructionsQueueKey) ProgrammingService(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.ProgrammingService) InstructionsQueueBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.InstructionsQueueBuilder)

Aggregations

WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)1 InstructionsQueueBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.InstructionsQueueBuilder)1 InstructionsQueueKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.InstructionsQueueKey)1 ProgrammingService (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.programming.rev150720.ProgrammingService)1