Search in sources :

Example 1 with RoutingPolicy

use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.routing.policy.top.RoutingPolicy in project bgpcep by opendaylight.

the class OpenconfigRoutingPolicyLoader method loadConfiguration.

@Override
public void loadConfiguration(final NormalizedNode<?, ?> dto) {
    final RoutingPolicy routingPolicy = (RoutingPolicy) this.bindingSerializer.fromNormalizedNode(this.routingPolicyYiid, dto).getValue();
    final WriteTransaction wtx = this.dataBroker.newWriteOnlyTransaction();
    wtx.merge(LogicalDatastoreType.CONFIGURATION, ROUTING_POLICY_IID, routingPolicy, WriteTransaction.CREATE_MISSING_PARENTS);
    try {
        wtx.submit().get();
    } catch (final ExecutionException | InterruptedException e) {
        LOG.warn("Failed to create Routing Policy config", e);
    }
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) RoutingPolicy(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.routing.policy.top.RoutingPolicy) ExecutionException(java.util.concurrent.ExecutionException)

Aggregations

ExecutionException (java.util.concurrent.ExecutionException)1 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)1 RoutingPolicy (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.routing.policy.top.RoutingPolicy)1