aclservice dead code removal 86/75386/4
authorStephen Kitt <skitt@redhat.com>
Wed, 22 Aug 2018 18:02:56 +0000 (20:02 +0200)
committerSam Hague <shague@redhat.com>
Mon, 17 Sep 2018 00:25:29 +0000 (00:25 +0000)
This patch removes unused methods and classes.

Change-Id: Ife48d8574e75e537b94ce9e710cae09286e582db
Signed-off-by: Stephen Kitt <skitt@redhat.com>
12 files changed:
aclservice/api/src/main/java/org/opendaylight/netvirt/aclservice/api/AclServiceManager.java
aclservice/api/src/main/java/org/opendaylight/netvirt/aclservice/api/utils/AclInterface.java
aclservice/api/src/main/java/org/opendaylight/netvirt/aclservice/api/utils/IAclServiceUtil.java [deleted file]
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/AbstractAclServiceImpl.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/AclServiceImplFactory.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/AclServiceManagerImpl.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/EgressAclServiceImpl.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/IngressAclServiceImpl.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/utils/AclConstants.java
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/utils/AclServiceUtilFacade.java [deleted file]
aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/utils/AclServiceUtils.java
aclservice/impl/src/main/resources/org/opendaylight/blueprint/aclservice.xml

index 18985332ebe753b108a5978fc3b3852e8accf8c5..79cbae343c44063d1325aab99f794be6beea445c 100644 (file)
@@ -27,10 +27,6 @@ public interface AclServiceManager {
         MATCH_DESTINATION
     }
 
-    void addAclServiceListner(AclServiceListener aclServiceListner);
-
-    void removeAclServiceListner(AclServiceListener aclServiceListner);
-
     void notify(AclInterface port, AclInterface oldPort, Action action);
 
     void notifyAce(AclInterface port, Action action, String aclName, Ace ace);
index 656bc04aef166cdcbc8d105a2213dd3ed0764583..2aff16b2d599be0bb471a0b365aad2df263d1ab4 100644 (file)
@@ -13,8 +13,6 @@ import java.math.BigInteger;
 import java.util.List;
 import java.util.SortedSet;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.DirectionBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.DirectionEgress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.interfaces._interface.AllowedAddressPairs;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.port.subnets.port.subnet.SubnetInfo;
 
@@ -142,16 +140,6 @@ public final class AclInterface {
         return subnetInfo;
     }
 
-    /**
-     * Gets the remote acl tags.
-     *
-     * @param direction the direction
-     * @return the remote acl tags
-     */
-    public SortedSet<Integer> getRemoteAclTags(Class<? extends DirectionBase> direction) {
-        return DirectionEgress.class.equals(direction) ? egressRemoteAclTags : ingressRemoteAclTags;
-    }
-
     /**
      * Gets the egress remote acl tags.
      *
diff --git a/aclservice/api/src/main/java/org/opendaylight/netvirt/aclservice/api/utils/IAclServiceUtil.java b/aclservice/api/src/main/java/org/opendaylight/netvirt/aclservice/api/utils/IAclServiceUtil.java
deleted file mode 100644 (file)
index 6d732d3..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Copyright (c) 2017 Hewlett Packard Enterprise, Co. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.netvirt.aclservice.api.utils;
-
-import java.util.List;
-import java.util.Map;
-
-import org.opendaylight.genius.mdsalutil.MatchInfoBase;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.ace.Matches;
-
-public interface IAclServiceUtil {
-
-    Map<String, List<MatchInfoBase>> programIpFlow(Matches matches);
-
-}
index 213dc0fade9e4c881048fb85d10492076e109dc6..a2083b65b6ddeb56abf97905fb3a63650064d6ba 100644 (file)
@@ -71,7 +71,6 @@ public abstract class AbstractAclServiceImpl implements AclServiceListener {
     private static final Logger LOG = LoggerFactory.getLogger(AbstractAclServiceImpl.class);
 
     protected final IMdsalApiManager mdsalManager;
-    protected final DataBroker dataBroker;
     protected final ManagedNewTransactionRunner txRunner;
     protected final Class<? extends ServiceModeBase> serviceMode;
     protected final AclDataUtil aclDataUtil;
@@ -96,7 +95,6 @@ public abstract class AbstractAclServiceImpl implements AclServiceListener {
     public AbstractAclServiceImpl(Class<? extends ServiceModeBase> serviceMode, DataBroker dataBroker,
             IMdsalApiManager mdsalManager, AclDataUtil aclDataUtil, AclServiceUtils aclServiceUtils,
             JobCoordinator jobCoordinator, AclInterfaceCache aclInterfaceCache) {
-        this.dataBroker = dataBroker;
         this.txRunner = new ManagedNewTransactionRunnerImpl(dataBroker);
         this.mdsalManager = mdsalManager;
         this.serviceMode = serviceMode;
@@ -769,24 +767,6 @@ public abstract class AbstractAclServiceImpl implements AclServiceListener {
     protected abstract void programRemoteAclTableFlow(BigInteger dpId, Integer aclTag, AllowedAddressPairs aap,
             int addOrRemove);
 
-    protected String getOperAsString(int flowOper) {
-        String oper;
-        switch (flowOper) {
-            case NwConstants.ADD_FLOW:
-                oper = "Add";
-                break;
-            case NwConstants.DEL_FLOW:
-                oper = "Del";
-                break;
-            case NwConstants.MOD_FLOW:
-                oper = "Mod";
-                break;
-            default:
-                oper = "UNKNOWN";
-        }
-        return oper;
-    }
-
     protected Set<BigInteger> collectDpns(Map<String, Set<AclInterface>> mapAclWithPortSet) {
         Set<BigInteger> dpns = new HashSet<>();
         if (mapAclWithPortSet == null) {
@@ -999,10 +979,6 @@ public abstract class AbstractAclServiceImpl implements AclServiceListener {
 
     protected abstract boolean isValidDirection(Class<? extends DirectionBase> direction);
 
-    protected abstract short getAclAntiSpoofingTable();
-
-    protected abstract short getAclConntrackClassifierTable();
-
     protected abstract short getAclConntrackSenderTable();
 
     protected abstract short getAclForExistingTrafficTable();
index 3e79f4c0b1ce551691b7c2e900c719c642c78b0b..f3e3af62fa175467af38a113d05221d5483557d5 100644 (file)
@@ -17,7 +17,6 @@ import org.opendaylight.netvirt.aclservice.api.AclInterfaceCache;
 import org.opendaylight.netvirt.aclservice.utils.AclDataUtil;
 import org.opendaylight.netvirt.aclservice.utils.AclServiceUtils;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.config.rev160806.AclserviceConfig;
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -48,11 +47,6 @@ public class AclServiceImplFactory extends AbstractLifecycle {
         LOG.info("AclserviceConfig: {}", config);
     }
 
-    protected InstanceIdentifier<AclserviceConfig> getWildCardPath() {
-        return InstanceIdentifier
-                .create(AclserviceConfig.class);
-    }
-
     @Override
     protected void start() {
         LOG.info("{} start", getClass().getSimpleName());
index 931a4ca3992dc3851981252c846315f313ba4b0b..cac8c47441c7ae4573e3d30ff930207d4a16b83c 100644 (file)
@@ -38,16 +38,10 @@ public class AclServiceManagerImpl implements AclServiceManager {
         LOG.info("Just a test");
     }
 
-    @Override
-    public void addAclServiceListner(AclServiceListener aclServiceListner) {
+    private void addAclServiceListner(AclServiceListener aclServiceListner) {
         aclServiceListeners.add(aclServiceListner);
     }
 
-    @Override
-    public void removeAclServiceListner(AclServiceListener aclServiceListner) {
-        aclServiceListeners.remove(aclServiceListner);
-    }
-
     @Override
     public void notify(AclInterface port, AclInterface oldPort, Action action) {
         for (AclServiceListener aclServiceListener : aclServiceListeners) {
index 1a4a1f1766de85a9f057737b724150cb106d6c2b..5db508b0c317fb9b0f93790ecfffc76b239cc11b 100644 (file)
@@ -369,13 +369,11 @@ public class EgressAclServiceImpl extends AbstractAclServiceImpl {
         return direction.equals(DirectionEgress.class);
     }
 
-    @Override
-    protected short getAclAntiSpoofingTable() {
+    private short getAclAntiSpoofingTable() {
         return NwConstants.INGRESS_ACL_ANTI_SPOOFING_TABLE;
     }
 
-    @Override
-    protected short getAclConntrackClassifierTable() {
+    private short getAclConntrackClassifierTable() {
         return NwConstants.INGRESS_ACL_CONNTRACK_CLASSIFIER_TABLE;
     }
 
index 7ee5836b8d143e1804706d5c92e6700c3d6499bf..2de00749dc26e299275699c8d975418297e347b5 100644 (file)
@@ -357,13 +357,11 @@ public class IngressAclServiceImpl extends AbstractAclServiceImpl {
         return direction.equals(DirectionIngress.class);
     }
 
-    @Override
-    protected short getAclAntiSpoofingTable() {
+    private short getAclAntiSpoofingTable() {
         return NwConstants.EGRESS_ACL_ANTI_SPOOFING_TABLE;
     }
 
-    @Override
-    protected short getAclConntrackClassifierTable() {
+    private short getAclConntrackClassifierTable() {
         return NwConstants.EGRESS_ACL_CONNTRACK_CLASSIFIER_TABLE;
     }
 
index 07dfac453c0670c661ea4c64fb5ec732730d2eb5..06a51eec6109ddf613f3043ad7f3a41f43a6d930 100644 (file)
@@ -100,13 +100,6 @@ public interface AclConstants {
     int ICMPV6_TYPE_NA = 136;
     int ICMPV6_TYPE_MLD2_REPORT = 143;
 
-    String SECURITY_GROUP_TCP_IDLE_TO_KEY = "security-group-tcp-idle-timeout";
-    String SECURITY_GROUP_TCP_HARD_TO_KEY = "security-group-tcp-hard-timeout";
-    String SECURITY_GROUP_TCP_FIN_IDLE_TO_KEY = "security-group-tcp-fin-idle-timeout";
-    String SECURITY_GROUP_TCP_FIN_HARD_TO_KEY = "security-group-tcp-fin-hard-timeout";
-    String SECURITY_GROUP_UDP_IDLE_TO_KEY = "security-group-udp-idle-timeout";
-    String SECURITY_GROUP_UDP_HARD_TO_KEY = "security-group-udp-hard-timeout";
-
     int SECURITY_GROUP_ICMP_IDLE_TIME_OUT = 30;
 
     String ACL_TAG_POOL_NAME = "ACL-TAG-POOL";
@@ -133,11 +126,6 @@ public interface AclConstants {
     List<IPProtocols> PROTOCOLS_SUPPORTED_BY_CONNTRACK =
             ImmutableList.of(IPProtocols.TCP, IPProtocols.UDP, IPProtocols.ICMP, IPProtocols.IPV6ICMP);
 
-    enum PacketHandlingType {
-        PERMIT,
-        DENY
-    }
-
     static List<Integer> allowedIcmpv6NdList() {
         List<Integer> icmpv6NdList = new ArrayList<>();
         icmpv6NdList.add(ICMPV6_TYPE_RS);
diff --git a/aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/utils/AclServiceUtilFacade.java b/aclservice/impl/src/main/java/org/opendaylight/netvirt/aclservice/utils/AclServiceUtilFacade.java
deleted file mode 100644 (file)
index 7e7be30..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2017 Hewlett Packard Enterprise, Co. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-
-package org.opendaylight.netvirt.aclservice.utils;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.opendaylight.genius.mdsalutil.MatchInfoBase;
-import org.opendaylight.netvirt.aclservice.api.utils.IAclServiceUtil;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.ace.Matches;
-
-@Singleton
-public class AclServiceUtilFacade implements IAclServiceUtil {
-
-    @Inject
-    public AclServiceUtilFacade() {
-    }
-
-    @Override
-    public Map<String, List<MatchInfoBase>> programIpFlow(Matches matches) {
-        return AclServiceOFFlowBuilder.programIpFlow(matches);
-    }
-
-}
index 712598d48a1dab34cfe768f2066afbc0e5c4fbcf..ba90703de57498aadf446152dad21bdd845b9fc6 100644 (file)
@@ -21,12 +21,9 @@ import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Set;
 import java.util.SortedSet;
 import java.util.TreeSet;
@@ -43,14 +40,12 @@ import org.opendaylight.genius.infra.Datastore.Operational;
 import org.opendaylight.genius.infra.ManagedNewTransactionRunner;
 import org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl;
 import org.opendaylight.genius.infra.TypedWriteTransaction;
-import org.opendaylight.genius.interfacemanager.globals.InterfaceServiceUtil;
 import org.opendaylight.genius.mdsalutil.ActionInfo;
 import org.opendaylight.genius.mdsalutil.InstructionInfo;
 import org.opendaylight.genius.mdsalutil.MDSALUtil;
 import org.opendaylight.genius.mdsalutil.MatchInfoBase;
 import org.opendaylight.genius.mdsalutil.MetaDataUtil;
 import org.opendaylight.genius.mdsalutil.NwConstants;
-import org.opendaylight.genius.mdsalutil.NxMatchInfo;
 import org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack;
 import org.opendaylight.genius.mdsalutil.actions.ActionNxConntrack.NxCtAction;
 import org.opendaylight.genius.mdsalutil.instructions.InstructionApplyActions;
@@ -74,10 +69,7 @@ import org.opendaylight.infrautils.jobcoordinator.JobCoordinator;
 import org.opendaylight.infrautils.utils.concurrent.ListenableFutures;
 import org.opendaylight.netvirt.aclservice.api.AclServiceManager.MatchCriteria;
 import org.opendaylight.netvirt.aclservice.api.utils.AclInterface;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.AccessLists;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.Ipv4Acl;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.Acl;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.AclKey;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.AccessListEntries;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.Ace;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.access.control.list.rev160218.access.lists.acl.access.list.entries.ace.Matches;
@@ -88,7 +80,6 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6Prefix;
 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.InterfacesState;
-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.InterfaceKey;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
@@ -106,10 +97,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.
 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdInputBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.ReleaseIdOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetDpidFromInterfaceInput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetDpidFromInterfaceInputBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.GetDpidFromInterfaceOutput;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.rpcs.rev160406.OdlInterfaceRpcService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceBindings;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeBase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.interfacemanager.servicebinding.rev160406.ServiceModeEgress;
@@ -125,7 +112,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeCon
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.config.rev160806.AclserviceConfig;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.AclPortsLookup;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.DirectionBase;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.InterfaceAcl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.IpPrefixOrAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.IpPrefixOrAddressBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.aclservice.rev160608.IpVersionV6;
@@ -161,8 +147,6 @@ import org.slf4j.LoggerFactory;
 public final class AclServiceUtils {
 
     private static final Logger LOG = LoggerFactory.getLogger(AclServiceUtils.class);
-    public static final AclserviceConfig.DefaultBehavior DEFAULT_DENY = AclserviceConfig.DefaultBehavior.Deny;
-    public static final AclserviceConfig.DefaultBehavior DEFAULT_ALLOW = AclserviceConfig.DefaultBehavior.Allow;
 
     private final DataBroker dataBroker;
     private final ManagedNewTransactionRunner txRunner;
@@ -224,52 +208,6 @@ public final class AclServiceUtils {
         }
     }
 
-    /**
-     * Retrieves the acl matching the key from the data store.
-     *
-     * @param broker the data broker
-     * @param aclKey the acl key
-     * @return the acl
-     */
-    public static Acl getAcl(DataBroker broker, String aclKey) {
-        return read(broker, LogicalDatastoreType.CONFIGURATION, getAclInstanceIdentifier(aclKey)).orNull();
-    }
-
-    /** Creates the Acl instance identifier.
-     *
-     * @param aclKey the acl key
-     * @return the instance identifier
-     */
-    public static InstanceIdentifier<Acl> getAclInstanceIdentifier(String aclKey) {
-        return InstanceIdentifier.builder(AccessLists.class).child(Acl.class, new AclKey(aclKey, Ipv4Acl.class))
-                .build();
-    }
-
-    /**
-     * Get the data path number for the interface.
-     * @param interfaceManagerRpcService interfaceManagerRpcService instance.
-     * @param ifName the interface name.
-     * @return the dpn.
-     */
-    public static BigInteger getDpnForInterface(OdlInterfaceRpcService interfaceManagerRpcService, String ifName) {
-        BigInteger nodeId = BigInteger.ZERO;
-        try {
-            GetDpidFromInterfaceInput dpIdInput =
-                    new GetDpidFromInterfaceInputBuilder().setIntfName(ifName).build();
-            Future<RpcResult<GetDpidFromInterfaceOutput>> dpIdOutput =
-                    interfaceManagerRpcService.getDpidFromInterface(dpIdInput);
-            RpcResult<GetDpidFromInterfaceOutput> dpIdResult = dpIdOutput.get();
-            if (dpIdResult.isSuccessful()) {
-                nodeId = dpIdResult.getResult().getDpid();
-            } else {
-                LOG.error("Could not retrieve DPN Id for interface {}", ifName);
-            }
-        } catch (NullPointerException | InterruptedException | ExecutionException e) {
-            LOG.error("Exception when getting dpn for interface {}", ifName,  e);
-        }
-        return nodeId;
-    }
-
     /**
      * Retrieves the interface state.
      * @param dataBroker the data broker.
@@ -298,34 +236,6 @@ public final class AclServiceUtils {
         return idBuilder.build();
     }
 
-    /**
-     * Checks whether port security is enabled for the port.
-     * @param port the port.
-     * @return the port security is enabled/not.
-     */
-    public static boolean isPortSecurityEnabled(AclInterface port) {
-        return port.isPortSecurityEnabled();
-    }
-
-    /**
-     * Checks whether port security is enabled for the port.
-     * @param port the port.
-     * @return the list of security groups.
-     */
-    public static List<Uuid> getInterfaceAcls(Interface port) {
-        if (port == null) {
-            LOG.error("Port is Null");
-            return null;
-        }
-        InterfaceAcl aclInPort = port.augmentation(InterfaceAcl.class);
-        if (aclInPort == null) {
-            LOG.error("getSecurityGroupInPortList: no security group associated with port {}",
-                port.getName());
-            return null;
-        }
-        return aclInPort.getSecurityGroups();
-    }
-
     /**
      * Retrieves the security rule attribute augmentation from the access list.
      * @param ace the access list entry
@@ -496,19 +406,6 @@ public final class AclServiceUtils {
         return newAllowedAddressPairs;
     }
 
-    public static List<AllowedAddressPairs> getPortAllowedAddresses(Interface port) {
-        if (port == null) {
-            LOG.error("Port is Null");
-            return null;
-        }
-        InterfaceAcl aclInPort = port.augmentation(InterfaceAcl.class);
-        if (aclInPort == null) {
-            LOG.error("getSecurityGroupInPortList: no security group associated to Interface port: {}", port.getName());
-            return null;
-        }
-        return aclInPort.getAllowedAddressPairs();
-    }
-
     public static BigInteger getDpIdFromIterfaceState(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf
             .interfaces.rev140508.interfaces.state.Interface interfaceState) {
         BigInteger dpId = null;
@@ -776,36 +673,6 @@ public final class AclServiceUtils {
         return false;
     }
 
-    public static Map<String, List<MatchInfoBase>> getFlowForAllowedAddresses(
-            List<AllowedAddressPairs> syncAllowedAddresses, Map<String, List<MatchInfoBase>> flowMatchesMap,
-            boolean isSourceIpMacMatch) {
-        if (flowMatchesMap == null) {
-            return null;
-        }
-        Map<String, List<MatchInfoBase>> updatedFlowMatchesMap = new HashMap<>();
-        MatchInfoBase ipv4Match = MatchEthernetType.IPV4;
-        MatchInfoBase ipv6Match = MatchEthernetType.IPV6;
-        for (Entry<String, List<MatchInfoBase>> entry : flowMatchesMap.entrySet()) {
-            String flowName = entry.getKey();
-            List<MatchInfoBase> flows = entry.getValue();
-            // iterate over allow address pair and update match type
-            for (AllowedAddressPairs aap : syncAllowedAddresses) {
-                List<MatchInfoBase> matchInfoBaseList;
-                String flowId;
-                if (flows.contains(ipv4Match) && isIPv4Address(aap) && isNotIpv4AllNetwork(aap)) {
-                    matchInfoBaseList = updateAAPMatches(isSourceIpMacMatch, flows, aap);
-                    flowId = flowName + "_ipv4_remoteACL_interface_aap_" + getAapFlowId(aap);
-                    updatedFlowMatchesMap.put(flowId, matchInfoBaseList);
-                } else if (flows.contains(ipv6Match) && !isIPv4Address(aap) && isNotIpv6AllNetwork(aap)) {
-                    matchInfoBaseList = updateAAPMatches(isSourceIpMacMatch, flows, aap);
-                    flowId = flowName + "_ipv6_remoteACL_interface_aap_" + getAapFlowId(aap);
-                    updatedFlowMatchesMap.put(flowId, matchInfoBaseList);
-                }
-            }
-        }
-        return updatedFlowMatchesMap;
-    }
-
     public static boolean isNotIpv4AllNetwork(AllowedAddressPairs aap) {
         IpPrefix ipPrefix = aap.getIpAddress().getIpPrefix();
         if (ipPrefix != null && ipPrefix.getIpv4Prefix() != null
@@ -828,10 +695,6 @@ public final class AclServiceUtils {
         return isNotIpv4AllNetwork(aap) && isNotIpv6AllNetwork(aap);
     }
 
-    private static String getAapFlowId(AllowedAddressPairs aap) {
-        return aap.getMacAddress().getValue() + "_" + aap.getIpAddress().stringValue();
-    }
-
     public static Long getElanIdFromInterface(String elanInterfaceName,DataBroker broker) {
         ElanInterface elanInterface = getElanInterfaceByElanInterfaceName(elanInterfaceName, broker);
         if (null != elanInterface) {
@@ -880,39 +743,6 @@ public final class AclServiceUtils {
                 OPERATIONAL, tx -> tx.delete(id)), LOG, "Failed to delete subnet info for port: " + portId);
     }
 
-    private static List<MatchInfoBase> updateAAPMatches(boolean isSourceIpMacMatch, List<MatchInfoBase> flows,
-                                                        AllowedAddressPairs aap) {
-        List<MatchInfoBase> matchInfoBaseList;
-        if (isSourceIpMacMatch) {
-            matchInfoBaseList = AclServiceUtils.buildIpMatches(aap.getIpAddress(), MatchCriteria.MATCH_SOURCE);
-        } else {
-            matchInfoBaseList = AclServiceUtils.buildIpMatches(aap.getIpAddress(), MatchCriteria.MATCH_DESTINATION);
-        }
-        matchInfoBaseList.addAll(flows);
-        return matchInfoBaseList;
-    }
-
-    public static MatchInfoBase getMatchInfoByType(List<MatchInfoBase> flows, Class<? extends NxMatchInfo> type) {
-        for (MatchInfoBase mib : flows) {
-            if (type.isAssignableFrom(mib.getClass())) {
-                return mib;
-            }
-        }
-        return null;
-    }
-
-    public static boolean containsMatchFieldType(List<MatchInfoBase> flows, Class<? extends NxMatchInfo> type) {
-        return getMatchInfoByType(flows, type) != null;
-    }
-
-    public static boolean containsTcpMatchField(List<MatchInfoBase> flows) {
-        return flows.contains(MatchIpProtocol.TCP);
-    }
-
-    public static boolean containsUdpMatchField(List<MatchInfoBase> flows) {
-        return flows.contains(MatchIpProtocol.UDP);
-    }
-
     public static Integer allocateId(IdManagerService idManager, String poolName, String idKey, Integer defaultId) {
         AllocateIdInput getIdInput = new AllocateIdInputBuilder().setPoolName(poolName).setIdKey(idKey).build();
         try {
@@ -1128,22 +958,6 @@ public final class AclServiceUtils {
         return false;
     }
 
-    public static void addLportTagMetadataMatch(int lportTag, List<MatchInfoBase> flowMatches,
-            Class<? extends ServiceModeBase> serviceMode) {
-        MatchInfoBase lportMatch = buildLPortTagMatch(lportTag, serviceMode);
-        InterfaceServiceUtil.mergeMetadataMatchsOrAdd(flowMatches, lportMatch);
-    }
-
-    /**
-     * Returns ACL specific key for synchronization.
-     *
-     * @param key the generic key
-     * @return ACL key that can be used with synchronization
-     */
-    public static String getAclKeyForSynchronization(String key) {
-        return key + AclConstants.ACL_SYNC_KEY_EXT;
-    }
-
     /**
      * Builds the ip protocol matches.
      *
index 59cb9580d33124565056bad6ae7e6f9a77bc114a..dffcba3c5cf0efef1385e1b54f80ab786c05dc3c 100644 (file)
@@ -28,9 +28,6 @@
 
   <odl:rpc-implementation ref="aclLiveStatisticsRpcServiceImpl" />
 
-  <service ref="aclServiceUtilFacade"
-        interface="org.opendaylight.netvirt.aclservice.api.utils.IAclServiceUtil" />
-
   <service ref="aclDataUtil"
            interface="org.opendaylight.netvirt.aclservice.api.utils.AclDataCache" />