import org.opendaylight.genius.mdsalutil.ActionInfo;
import org.opendaylight.genius.mdsalutil.interfaces.IMdsalApiManager;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.iana._if.type.rev140508.L2vlan;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.Interfaces;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.Interface;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.InterfaceBuilder;
private InterfaceManagerRpcService interfaceManagerRpcService;
private BindingAwareBroker.RpcRegistration<OdlInterfaceRpcService> rpcRegistration;
private NodeConnectorStatsImpl nodeConnectorStatsManager;
+ private CacheInterfaceConfigListener cacheInterfaceConfigListener;
+ private CacheInterfaceStateListener cacheInterfaceStateListener;
public void setRpcProviderRegistry(RpcProviderRegistry rpcProviderRegistry) {
this.rpcProviderRegistry = rpcProviderRegistry;
this.notificationService = notificationService;
}
+ public DataBroker getDataBroker(){
+ return this.dataBroker;
+ }
+
@Override
public void onSessionInitiated(ProviderContext session) {
LOG.info("InterfacemgrProvider Session Initiated");
terminationPointStateListener = new TerminationPointStateListener(dataBroker);
terminationPointStateListener.registerListener(LogicalDatastoreType.OPERATIONAL, dataBroker);
- flowBasedServicesConfigListener = new FlowBasedServicesConfigListener(dataBroker);
+ flowBasedServicesConfigListener = new FlowBasedServicesConfigListener(this);
flowBasedServicesConfigListener.registerListener(LogicalDatastoreType.CONFIGURATION, dataBroker);
flowBasedServicesInterfaceStateListener =
alivenessMonitorListener = new org.opendaylight.genius.interfacemanager.listeners.AlivenessMonitorListener(dataBroker);
notificationService.registerNotificationListener(alivenessMonitorListener);
+ cacheInterfaceConfigListener = new CacheInterfaceConfigListener(dataBroker);
+
+ cacheInterfaceStateListener = new CacheInterfaceStateListener(dataBroker);
+
//Initialize nodeconnectorstatsimpl
nodeConnectorStatsManager = new NodeConnectorStatsImpl(dataBroker, notificationService,
session.getRpcService(OpendaylightPortStatisticsService.class), session.getRpcService(OpendaylightFlowTableStatisticsService.class));
LOG.info("InterfacemgrProvider Closed");
interfaceConfigListener.close();
rpcRegistration.close();
+ cacheInterfaceConfigListener.close();
+ cacheInterfaceStateListener.close();
}
public RpcProviderRegistry getRpcProviderRegistry() {
@Override
public InterfaceInfo getInterfaceInfo(String interfaceName) {
- //FIXME [ELANBE] This is not working yet, fix this
org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface
ifState = InterfaceManagerCommonUtils.getInterfaceStateFromOperDS(interfaceName, dataBroker);
NodeConnectorId ncId = IfmUtil.getNodeConnectorIdFromInterface(intf.getName(), dataBroker);
InterfaceInfo.InterfaceType interfaceType = IfmUtil.getInterfaceType(intf);
- InterfaceInfo interfaceInfo = null;
+ InterfaceInfo interfaceInfo = new InterfaceInfo(interfaceName);
BigInteger dpId = org.opendaylight.genius.interfacemanager.globals.IfmConstants.INVALID_DPID;
Integer portNo = org.opendaylight.genius.interfacemanager.globals.IfmConstants.INVALID_PORT_NO;
if (ncId != null) {
dpId = new BigInteger(IfmUtil.getDpnFromNodeConnectorId(ncId));
portNo = Integer.parseInt(IfmUtil.getPortNoFromNodeConnectorId(ncId));
}
-
if (interfaceType == InterfaceInfo.InterfaceType.VLAN_INTERFACE) {
interfaceInfo = IfmUtil.getVlanInterfaceInfo(interfaceName, intf, dpId);
- } else if (interfaceType == InterfaceInfo.InterfaceType.VXLAN_TRUNK_INTERFACE || interfaceType == InterfaceInfo.InterfaceType.GRE_TRUNK_INTERFACE) {/*
- trunkInterfaceInfo trunkInterfaceInfo = (TrunkInterfaceInfo) ConfigIfmUtil.getTrunkInterfaceInfo(ifName, ConfigIfmUtil.getInterfaceByIfName(dataBroker, ifName));
- String higherLayerIf = inf.getHigherLayerIf().get(0);
- Interface vlanInterface = ConfigIfmUtil.getInterfaceByIfName(dataBroker, higherLayerIf);
- trunkInterfaceInfo.setPortName(vlanInterface.getAugmentation(BaseConfig.class).getParentInterface());
- trunkInterfaceManager.updateTargetMacAddressInInterfaceInfo(trunkInterfaceInfo, trunkInterface);
- if (trunkInterface.getPhysAddress() != null) {
- trunkInterfaceInfo.setLocalMacAddress(trunkInterface.getPhysAddress().getValue());
- }
- interfaceInfo = trunkInterfaceInfo;
- interfaceInfo.setL2domainGroupId(IfmUtil.getGroupId(OperationalIfmUtil.getInterfaceStateByIfName(dataBroker, higherLayerIf).getIfIndex(), InterfaceType.VLAN_INTERFACE));
- */
+ } else if (interfaceType == InterfaceInfo.InterfaceType.VXLAN_TRUNK_INTERFACE ||
+ interfaceType == InterfaceInfo.InterfaceType.GRE_TRUNK_INTERFACE) {
+ // TODO : since there is no logical grouping for tunnel interfaces, there is no need
+ // for this code as of now. will be revisited once the support comes
+
} else {
LOG.error("Type of Interface {} is unknown", interfaceName);
return null;
return InterfaceManagerCommonUtils.getAllTunnelInterfaces(dataBroker,
InterfaceInfo.InterfaceType.VXLAN_TRUNK_INTERFACE);
}
-}
\ No newline at end of file
+}