Search in sources :

Example 1 with PrefixSet

use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.prefix.set.PrefixSet in project bgpcep by opendaylight.

the class GenericConditionPolicyHandler method loadPrefixSets.

private List<Prefix> loadPrefixSets(final String key) throws ExecutionException, InterruptedException {
    final ReadOnlyTransaction tr = this.databroker.newReadOnlyTransaction();
    final com.google.common.base.Optional<PrefixSet> result = tr.read(LogicalDatastoreType.CONFIGURATION, PREFIXES_SET_IID.child(PrefixSet.class, new PrefixSetKey(key))).get();
    if (!result.isPresent()) {
        return Collections.emptyList();
    }
    return result.get().getPrefix();
}
Also used : ReadOnlyTransaction(org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction) PrefixSetKey(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.prefix.set.PrefixSetKey) MatchPrefixSet(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.generic.conditions.MatchPrefixSet) PrefixSet(org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.prefix.set.PrefixSet)

Aggregations

ReadOnlyTransaction (org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction)1 MatchPrefixSet (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.generic.conditions.MatchPrefixSet)1 PrefixSet (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.prefix.set.PrefixSet)1 PrefixSetKey (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.routing.policy.rev151009.prefix.set.PrefixSetKey)1