Search in sources :

Example 6 with BridgeRefEntryKey

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntryKey in project genius by opendaylight.

the class InterfaceMetaUtils method deleteBridgeRefEntry.

public static void deleteBridgeRefEntry(BigInteger dpnId, WriteTransaction tx) {
    LOG.debug("Deleting bridge ref entry for dpn: {}", dpnId);
    BridgeRefEntryKey bridgeRefEntryKey = new BridgeRefEntryKey(dpnId);
    InstanceIdentifier<BridgeRefEntry> bridgeEntryId = InterfaceMetaUtils.getBridgeRefEntryIdentifier(bridgeRefEntryKey);
    tx.delete(LogicalDatastoreType.OPERATIONAL, bridgeEntryId);
}
Also used : BridgeRefEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntry) BridgeRefEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntryKey)

Example 7 with BridgeRefEntryKey

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntryKey in project genius by opendaylight.

the class InterfaceMetaUtils method getBridgeRefEntryFromOperationalDS.

public BridgeRefEntry getBridgeRefEntryFromOperationalDS(BigInteger dpId) {
    BridgeRefEntryKey bridgeRefEntryKey = new BridgeRefEntryKey(dpId);
    InstanceIdentifier<BridgeRefEntry> bridgeRefEntryIid = InterfaceMetaUtils.getBridgeRefEntryIdentifier(bridgeRefEntryKey);
    BridgeRefEntry bridgeRefEntry = IfmUtil.read(LogicalDatastoreType.OPERATIONAL, bridgeRefEntryIid, dataBroker).orNull();
    if (bridgeRefEntry != null) {
        addBridgeRefEntryToCache(dpId, bridgeRefEntry);
    }
    return bridgeRefEntry;
}
Also used : BridgeRefEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntry) BridgeRefEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntryKey)

Example 8 with BridgeRefEntryKey

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntryKey in project genius by opendaylight.

the class InterfaceMetaUtils method getBridgeRefEntryFromOperDS.

public BridgeRefEntry getBridgeRefEntryFromOperDS(BigInteger dpId) {
    BridgeRefEntry bridgeRefEntry = getBridgeRefEntryFromCache(dpId);
    if (bridgeRefEntry != null) {
        return bridgeRefEntry;
    }
    BridgeRefEntryKey bridgeRefEntryKey = new BridgeRefEntryKey(dpId);
    InstanceIdentifier<BridgeRefEntry> bridgeRefEntryIid = InterfaceMetaUtils.getBridgeRefEntryIdentifier(bridgeRefEntryKey);
    bridgeRefEntry = IfmUtil.read(LogicalDatastoreType.OPERATIONAL, bridgeRefEntryIid, dataBroker).orNull();
    if (bridgeRefEntry != null) {
        addBridgeRefEntryToCache(dpId, bridgeRefEntry);
    }
    return bridgeRefEntry;
}
Also used : BridgeRefEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntry) BridgeRefEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntryKey)

Example 9 with BridgeRefEntryKey

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntryKey in project netvirt by opendaylight.

the class TransportZoneNotificationUtil method getPortsNode.

@SuppressWarnings("unchecked")
private Optional<Node> getPortsNode(BigInteger dpnId, ReadTransaction tx) throws ReadFailedException {
    InstanceIdentifier<BridgeRefEntry> bridgeRefInfoPath = InstanceIdentifier.create(BridgeRefInfo.class).child(BridgeRefEntry.class, new BridgeRefEntryKey(dpnId));
    // FIXME: Read this through a cache
    Optional<BridgeRefEntry> optionalBridgeRefEntry = tx.read(LogicalDatastoreType.OPERATIONAL, bridgeRefInfoPath).checkedGet();
    if (!optionalBridgeRefEntry.isPresent()) {
        LOG.error("no bridge ref entry found for dpnId {}", dpnId);
        return Optional.absent();
    }
    InstanceIdentifier<Node> nodeId = optionalBridgeRefEntry.get().getBridgeReference().getValue().firstIdentifierOf(Node.class);
    // FIXME: Read this through a cache
    Optional<Node> optionalNode = tx.read(LogicalDatastoreType.OPERATIONAL, nodeId).checkedGet();
    if (!optionalNode.isPresent()) {
        LOG.error("missing node for dpnId {}", dpnId);
    }
    return optionalNode;
}
Also used : BridgeRefInfo(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.BridgeRefInfo) BridgeRefEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntry) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) BridgeRefEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntryKey)

Example 10 with BridgeRefEntryKey

use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntryKey in project genius by opendaylight.

the class DirectTunnelUtils method createOvsBridgeRefEntry.

public void createOvsBridgeRefEntry(BigInteger dpnId, InstanceIdentifier<?> bridgeIid) {
    LOG.debug("Creating bridge ref entry for dpn: {} bridge: {}", dpnId, bridgeIid);
    OvsBridgeRefEntryKey bridgeRefEntryKey = new OvsBridgeRefEntryKey(dpnId);
    InstanceIdentifier<OvsBridgeRefEntry> bridgeEntryId = getOvsBridgeRefEntryIdentifier(bridgeRefEntryKey);
    OvsBridgeRefEntryBuilder tunnelDpnBridgeEntryBuilder = new OvsBridgeRefEntryBuilder().setKey(bridgeRefEntryKey).setDpid(dpnId).setOvsBridgeReference(new OvsdbBridgeRef(bridgeIid));
    jobCoordinator.enqueueJob(ENTITY, () -> Collections.singletonList(txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.put(LogicalDatastoreType.OPERATIONAL, bridgeEntryId, tunnelDpnBridgeEntryBuilder.build(), true))));
}
Also used : OvsBridgeRefEntry(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.meta.rev171210.ovs.bridge.ref.info.OvsBridgeRefEntry) OvsBridgeRefEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.meta.rev171210.ovs.bridge.ref.info.OvsBridgeRefEntryBuilder) OvsBridgeRefEntryKey(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.meta.rev171210.ovs.bridge.ref.info.OvsBridgeRefEntryKey) OvsdbBridgeRef(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeRef)

Aggregations

BridgeRefEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntry)10 BridgeRefEntryKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntryKey)10 BridgeRefInfo (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.BridgeRefInfo)2 OvsBridgeRefEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.meta.rev171210.ovs.bridge.ref.info.OvsBridgeRefEntry)2 OvsBridgeRefEntryKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.meta.rev171210.ovs.bridge.ref.info.OvsBridgeRefEntryKey)2 OvsdbBridgeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeRef)2 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)2 Nullable (javax.annotation.Nullable)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1 ExpectedTerminationPoint (org.opendaylight.genius.interfacemanager.test.xtend.ExpectedTerminationPoint)1 AssertDataObjects.assertEqualBeans (org.opendaylight.mdsal.binding.testutils.AssertDataObjects.assertEqualBeans)1 Tunnel (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.Tunnel)1 Interface (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface)1 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)1 BridgeEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.BridgeEntry)1 BridgeEntryKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.BridgeEntryKey)1 BridgeInterfaceEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.bridge.entry.BridgeInterfaceEntry)1 BridgeInterfaceEntryKey (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.bridge.entry.BridgeInterfaceEntryKey)1 BridgeRefEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge.ref.info.BridgeRefEntryBuilder)1