Search in sources :

Example 11 with ReadTransaction

use of org.opendaylight.mdsal.binding.api.ReadTransaction in project netvirt by opendaylight.

the class ElanGroupCache method getGroup.

public Optional<Group> getGroup(InstanceIdentifier<Group> key) throws InterruptedException, ExecutionException {
    if (groupsById.containsKey(key)) {
        return Optional.of(groupsById.get(key));
    }
    ReadTransaction transaction = dataBroker.newReadOnlyTransaction();
    Optional<Group> optional = transaction.read(LogicalDatastoreType.CONFIGURATION, key).get();
    transaction.close();
    return optional;
}
Also used : Group(org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group) ReadTransaction(org.opendaylight.mdsal.binding.api.ReadTransaction)

Aggregations

ReadTransaction (org.opendaylight.mdsal.binding.api.ReadTransaction)11 ExecutionException (java.util.concurrent.ExecutionException)7 Optional (java.util.Optional)6 ArrayList (java.util.ArrayList)4 ReadFailedException (org.opendaylight.mdsal.common.api.ReadFailedException)4 HashSet (java.util.HashSet)2 List (java.util.List)2 EgressElementCountersRequestConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.EgressElementCountersRequestConfig)2 IngressElementCountersRequestConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.IngressElementCountersRequestConfig)2 Nullable (org.eclipse.jdt.annotation.Nullable)1 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)1 IdPools (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.IdPools)1 IdPool (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.id.pools.IdPool)1 IdPoolKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.id.pools.IdPoolKey)1 ExternalTunnelList (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.op.rev160406.ExternalTunnelList)1 DcGatewayIpList (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.rev160406.DcGatewayIpList)1 Group (org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.groups.Group)1 VrfTables (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.fibmanager.rev150330.fibentries.VrfTables)1 EvpnRdToNetwork (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.evpn.rd.to.networks.EvpnRdToNetwork)1 EvpnRdToNetworkKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.l3vpn.rev130911.evpn.rd.to.networks.EvpnRdToNetworkKey)1