+ BridgeRefEntryKey bridgeRefEntryKey = new BridgeRefEntryKey(dpId);
+ InstanceIdentifier<BridgeRefEntry> bridgeRefEntryIid =
+ InterfaceMetaUtils.getBridgeRefEntryIdentifier(bridgeRefEntryKey);
+ BridgeRefEntry bridgeRefEntry = getBridgeRefEntryFromOperDS(bridgeRefEntryIid, dataBroker);
+ 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, dataBroker);
+ if(bridgeEntry == null){
+ return null;
+ }
+ return bridgeEntry.getBridgeReference();
+ }
+ return bridgeRefEntry.getBridgeReference();
+ }
+
+ public static BridgeRefEntry getBridgeReferenceForInterface(Interface interfaceInfo,
+ DataBroker dataBroker) {