use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.BridgeEntry in project netvirt by opendaylight.
the class QosNeutronUtils method getBridgeEntryFromConfigDS.
@Nullable
private BridgeEntry getBridgeEntryFromConfigDS(BigInteger dpnId) {
BridgeEntryKey bridgeEntryKey = new BridgeEntryKey(dpnId);
InstanceIdentifier<BridgeEntry> bridgeEntryInstanceIdentifier = getBridgeEntryIdentifier(bridgeEntryKey);
LOG.debug("Trying to retrieve bridge entry from config for Id: {}", bridgeEntryInstanceIdentifier);
return getBridgeEntryFromConfigDS(bridgeEntryInstanceIdentifier);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.BridgeEntry in project netvirt by opendaylight.
the class QosNeutronUtils method getBridgeRefEntryFromOperDS.
@Nullable
private OvsdbBridgeRef getBridgeRefEntryFromOperDS(BigInteger dpId) {
BridgeRefEntryKey bridgeRefEntryKey = new BridgeRefEntryKey(dpId);
InstanceIdentifier<BridgeRefEntry> bridgeRefEntryIid = getBridgeRefEntryIdentifier(bridgeRefEntryKey);
BridgeRefEntry bridgeRefEntry = getBridgeRefEntryFromOperDS(bridgeRefEntryIid);
if (bridgeRefEntry == null) {
// bridge ref entry will be null if the bridge is disconnected from controller.
// In that case, fetch bridge reference from bridge interface entry config DS
BridgeEntry bridgeEntry = getBridgeEntryFromConfigDS(dpId);
if (bridgeEntry == null) {
return null;
}
return bridgeEntry.getBridgeReference();
}
return bridgeRefEntry.getBridgeReference();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.BridgeEntry in project genius by opendaylight.
the class SouthboundUtils method addAllPortsToBridge.
/*
* Add all tunnels ports corresponding to the bridge to the topology config DS.
*/
public void addAllPortsToBridge(BridgeEntry bridgeEntry, InterfaceManagerCommonUtils interfaceManagerCommonUtils, InstanceIdentifier<OvsdbBridgeAugmentation> bridgeIid, OvsdbBridgeAugmentation bridgeNew) {
String bridgeName = bridgeNew.getBridgeName().getValue();
LOG.debug("adding all ports to bridge: {}", bridgeName);
List<BridgeInterfaceEntry> bridgeInterfaceEntries = bridgeEntry.getBridgeInterfaceEntry();
if (bridgeInterfaceEntries != null) {
for (BridgeInterfaceEntry bridgeInterfaceEntry : bridgeInterfaceEntries) {
String portName = bridgeInterfaceEntry.getInterfaceName();
InterfaceKey interfaceKey = new InterfaceKey(portName);
Interface iface = interfaceManagerCommonUtils.getInterfaceFromConfigDS(interfaceKey);
if (iface != null) {
IfTunnel ifTunnel = iface.getAugmentation(IfTunnel.class);
if (ifTunnel != null) {
if (!(interfacemgrProvider.isItmDirectTunnelsEnabled() && ifTunnel.isInternal())) {
addTunnelPortToBridge(ifTunnel, bridgeIid, iface, portName);
}
if (isOfTunnel(ifTunnel)) {
LOG.debug("Using OFTunnel. Only one tunnel port will be added");
return;
}
}
} else {
LOG.debug("Interface {} not found in config DS", portName);
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.BridgeEntry in project genius by opendaylight.
the class InterfaceManagerServiceImpl method getEndpointIpForDpn.
@Override
public ListenableFuture<GetEndpointIpForDpnOutput> getEndpointIpForDpn(GetEndpointIpForDpnInput input) {
BridgeEntryKey bridgeEntryKey = new BridgeEntryKey(input.getDpid());
InstanceIdentifier<BridgeEntry> bridgeEntryInstanceIdentifier = InterfaceMetaUtils.getBridgeEntryIdentifier(bridgeEntryKey);
BridgeEntry bridgeEntry = interfaceMetaUtils.getBridgeEntryFromConfigDS(bridgeEntryInstanceIdentifier);
// local ip of any of the bridge interface entry will be the dpn end
// point ip
BridgeInterfaceEntry bridgeInterfaceEntry = bridgeEntry.getBridgeInterfaceEntry().get(0);
InterfaceKey interfaceKey = new InterfaceKey(bridgeInterfaceEntry.getInterfaceName());
Interface interfaceInfo = interfaceManagerCommonUtils.getInterfaceFromConfigDS(interfaceKey);
IfTunnel tunnel = interfaceInfo.getAugmentation(IfTunnel.class);
return Futures.immediateFuture(new GetEndpointIpForDpnOutputBuilder().setLocalIps(Collections.singletonList(tunnel.getTunnelSource())).build());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.meta.rev160406.bridge._interface.info.BridgeEntry in project genius by opendaylight.
the class InterfaceMetaUtils method getBridgeEntryFromConfigDS.
public BridgeEntry getBridgeEntryFromConfigDS(BigInteger dpnId) {
BridgeEntry bridgeEntry = getBridgeEntryFromCache(dpnId);
if (bridgeEntry != null) {
return bridgeEntry;
}
BridgeEntryKey bridgeEntryKey = new BridgeEntryKey(dpnId);
InstanceIdentifier<BridgeEntry> bridgeEntryInstanceIdentifier = InterfaceMetaUtils.getBridgeEntryIdentifier(bridgeEntryKey);
LOG.debug("Trying to retrieve bridge entry from config for Id: {}", bridgeEntryInstanceIdentifier);
bridgeEntry = readBridgeEntryFromConfigDS(bridgeEntryInstanceIdentifier);
if (bridgeEntry != null) {
addBridgeEntryToCache(dpnId, bridgeEntry);
}
return bridgeEntry;
}
Aggregations