X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=interfacemgr%2Finterfacemgr-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fvpnservice%2Finterfacemgr%2FInterfacemgrProvider.java;h=3b8f6b0623ae22f1ca71f03aa6885be17c851159;hb=63b42a3937b9ab3facfa83ac0fe954bf70ece35c;hp=656d5ef0148545e1211419533b366776a919d5be;hpb=87e2fa78b8c887ce9b68442ef3af219fef6126a7;p=vpnservice.git diff --git a/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/InterfacemgrProvider.java b/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/InterfacemgrProvider.java index 656d5ef0..3b8f6b06 100644 --- a/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/InterfacemgrProvider.java +++ b/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/InterfacemgrProvider.java @@ -102,7 +102,7 @@ public class InterfacemgrProvider implements BindingAwareProvider, AutoCloseable rpcRegistration = getRpcProviderRegistry().addRpcImplementation( OdlInterfaceRpcService.class, interfaceManagerRpcService); - interfaceConfigListener = new InterfaceConfigListener(dataBroker, idManager,alivenessManager); + interfaceConfigListener = new InterfaceConfigListener(dataBroker, idManager,alivenessManager, mdsalManager); interfaceConfigListener.registerListener(LogicalDatastoreType.CONFIGURATION, dataBroker); interfaceInventoryStateListener = new InterfaceInventoryStateListener(dataBroker, idManager, mdsalManager, alivenessManager); @@ -212,7 +212,7 @@ public class InterfacemgrProvider implements BindingAwareProvider, AutoCloseable } if(interfaceType == InterfaceInfo.InterfaceType.VLAN_INTERFACE){ - interfaceInfo = IfmUtil.getVlanInterfaceInfo(interfaceName, intf, dpId); + 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); @@ -243,21 +243,21 @@ public class InterfacemgrProvider implements BindingAwareProvider, AutoCloseable } @Override - public InterfaceInfo getInterfaceInfoFromOperationalDataStore(String interfaceName, InterfaceInfo.InterfaceType interfaceType) { - InterfaceInfo interfaceInfo = new InterfaceInfo(interfaceName); - org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState = InterfaceManagerCommonUtils - .getInterfaceStateFromOperDS(interfaceName, dataBroker); - if (ifState == null) { - LOG.error("Interface {} is not present", interfaceName); - return null; - } + public InterfaceInfo getInterfaceInfoFromOperationalDataStore(String interfaceName, InterfaceInfo.InterfaceType interfaceType) { + InterfaceInfo interfaceInfo = new InterfaceInfo(interfaceName); + org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface ifState = InterfaceManagerCommonUtils + .getInterfaceStateFromOperDS(interfaceName, dataBroker); + if (ifState == null) { + LOG.error("Interface {} is not present", interfaceName); + return null; + } Integer lportTag = ifState.getIfIndex(); - Interface intf = InterfaceManagerCommonUtils.getInterfaceFromConfigDS(new InterfaceKey(interfaceName), dataBroker); - NodeConnectorId ncId = IfmUtil.getNodeConnectorIdFromInterface(intf, dataBroker); - if (ncId != null) { - interfaceInfo.setDpId(new BigInteger(IfmUtil.getDpnFromNodeConnectorId(ncId))); - interfaceInfo.setPortNo(Integer.parseInt(IfmUtil.getPortNoFromNodeConnectorId(ncId))); - } + Interface intf = InterfaceManagerCommonUtils.getInterfaceFromConfigDS(new InterfaceKey(interfaceName), dataBroker); + NodeConnectorId ncId = IfmUtil.getNodeConnectorIdFromInterface(intf, dataBroker); + if (ncId != null) { + interfaceInfo.setDpId(new BigInteger(IfmUtil.getDpnFromNodeConnectorId(ncId))); + interfaceInfo.setPortNo(Integer.parseInt(IfmUtil.getPortNoFromNodeConnectorId(ncId))); + } interfaceInfo.setAdminState((intf.isEnabled() == true) ? InterfaceAdminState.ENABLED : InterfaceAdminState.DISABLED); interfaceInfo.setInterfaceName(interfaceName); interfaceInfo.setInterfaceTag(lportTag); @@ -267,7 +267,7 @@ public class InterfacemgrProvider implements BindingAwareProvider, AutoCloseable return interfaceInfo; - } + } @Override public BigInteger getDpnForInterface(String ifName) {