import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.genius.datastoreutils.AsyncClusteredDataTreeChangeListenerBase;
-import org.opendaylight.genius.srm.RecoverableListener;
-import org.opendaylight.genius.srm.ServiceRecoveryRegistry;
+import org.opendaylight.genius.mdsalutil.NwConstants;
import org.opendaylight.netvirt.neutronvpn.interfaces.INeutronVpnManager;
import org.opendaylight.netvirt.qosservice.recovery.QosServiceRecoveryHandler;
+import org.opendaylight.serviceutils.srm.RecoverableListener;
+import org.opendaylight.serviceutils.srm.ServiceRecoveryRegistry;
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.interfaces.rev140508.InterfacesState;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
this.neutronVpnManager = neutronVpnManager;
serviceRecoveryRegistry.addRecoverableListener(qosServiceRecoveryHandler.buildServiceRegistryKey(),
this);
- LOG.debug("{} created", getClass().getSimpleName());
+ LOG.trace("{} created", getClass().getSimpleName());
}
@PostConstruct
public void init() {
registerListener();
- LOG.debug("{} init and registerListener done", getClass().getSimpleName());
+ LOG.trace("{} init and registerListener done", getClass().getSimpleName());
}
@Override
@Override
@SuppressWarnings("checkstyle:IllegalCatch")
protected void add(InstanceIdentifier<Interface> identifier, Interface intrf) {
- try {
- if (L2vlan.class.equals(intrf.getType())) {
- final String interfaceName = intrf.getName();
- getNeutronPort(interfaceName).ifPresent(port -> {
- Network network = qosNeutronUtils.getNeutronNetwork(port.getNetworkId());
- LOG.trace("Qos Service : Received interface {} PORT UP event ", interfaceName);
- if (port.augmentation(QosPortExtension.class) != null) {
- Uuid portQosUuid = port.augmentation(QosPortExtension.class).getQosPolicyId();
- if (portQosUuid != null) {
- qosNeutronUtils.addToQosPortsCache(portQosUuid, port);
- qosNeutronUtils.handleQosInterfaceAdd(port, portQosUuid);
- }
- } else {
- if (network.augmentation(QosNetworkExtension.class) != null) {
- Uuid networkQosUuid = network.augmentation(QosNetworkExtension.class).getQosPolicyId();
- if (networkQosUuid != null) {
- qosNeutronUtils.handleQosInterfaceAdd(port, networkQosUuid);
- }
+ if (L2vlan.class.equals(intrf.getType())) {
+ final String interfaceName = intrf.getName();
+ getNeutronPort(interfaceName).ifPresent(port -> {
+ Network network = qosNeutronUtils.getNeutronNetwork(port.getNetworkId());
+ LOG.debug("Qos Service : Received interface {} PORT UP event ", interfaceName);
+ if (port.augmentation(QosPortExtension.class) != null) {
+ Uuid portQosUuid = port.augmentation(QosPortExtension.class).getQosPolicyId();
+ if (portQosUuid != null) {
+ qosNeutronUtils.addToQosPortsCache(portQosUuid, port);
+ qosNeutronUtils.handleQosInterfaceAdd(port, portQosUuid);
+ }
+ } else {
+ if (network.augmentation(QosNetworkExtension.class) != null) {
+ Uuid networkQosUuid = network.augmentation(QosNetworkExtension.class).getQosPolicyId();
+ if (networkQosUuid != null) {
+ qosNeutronUtils.handleQosInterfaceAdd(port, networkQosUuid);
}
}
- qosAlertManager.processInterfaceUpEvent(interfaceName);
- });
- }
- } catch (Exception e) {
- LOG.error("Qos:Exception caught in Interface Operational State Up event {}", e);
+ }
+ qosAlertManager.processInterfaceUpEvent(interfaceName);
+ });
}
}
return Optional.fromJavaUtil(uuid.toJavaUtil().map(qosNeutronUtils::getNeutronPort));
}
LOG.trace("Qos Service : interface {} clearing stale flow entries if any", portName);
- qosNeutronUtils.removeStaleFlowEntry(intrf);
+ qosNeutronUtils.removeStaleFlowEntry(intrf, NwConstants.ETHTYPE_IPV4);
+ qosNeutronUtils.removeStaleFlowEntry(intrf, NwConstants.ETHTYPE_IPV6);
}
return Optional.absent();
}