Use named constants for PolicyAceFlowWrapper 84/57984/2
authorStephen Kitt <skitt@redhat.com>
Mon, 29 May 2017 13:56:40 +0000 (15:56 +0200)
committerSam Hague <shague@redhat.com>
Thu, 1 Jun 2017 23:54:17 +0000 (23:54 +0000)
Instead of commenting each use of true or false, use constants.

Change-Id: Ibf8b19b67dc54e99e6caffe8056a0e04b62601c2
Signed-off-by: Stephen Kitt <skitt@redhat.com>
vpnservice/policyservice/impl/src/main/java/org/opendaylight/netvirt/policyservice/PolicyAceFlowProgrammer.java
vpnservice/policyservice/impl/src/main/java/org/opendaylight/netvirt/policyservice/PolicyAceFlowWrapper.java

index a09dd241f9940c5106fe0b8f32d41f2d98bb5f92..597860664139ce04e50d603079dbae03cbb9880f 100644 (file)
@@ -190,7 +190,7 @@ public class PolicyAceFlowProgrammer {
             Optional<String> vlanMemberInterfaceOpt = policyServiceUtil.getVlanMemberInterface(interfaceName, vlanId);
             if (!vlanMemberInterfaceOpt.isPresent()) {
                 LOG.debug("Vlan member {} missing for trunk {}", vlanId.getValue(), interfaceName);
-                return Optional.of(new PolicyAceFlowWrapper(flowName, /* isPartial*/ true));
+                return Optional.of(new PolicyAceFlowWrapper(flowName, PolicyAceFlowWrapper.PARTIAL));
             }
 
             interfaceName = vlanMemberInterfaceOpt.get();
@@ -200,7 +200,7 @@ public class PolicyAceFlowProgrammer {
         List<MatchInfoBase> matches = policyFlowUtil.getIngressInterfaceMatches(interfaceName);
         if (matches == null || matches.isEmpty()) {
             LOG.debug("Failed to get ingress interface {} matches", interfaceName);
-            return Optional.of(new PolicyAceFlowWrapper(flowName, /* isPartial */ true));
+            return Optional.of(new PolicyAceFlowWrapper(flowName, PolicyAceFlowWrapper.PARTIAL));
         }
 
         BigInteger dpId = Optional.fromNullable(interfaceManager.getDpnForInterface(interfaceName)).or(BigInteger.ZERO);
@@ -219,7 +219,7 @@ public class PolicyAceFlowProgrammer {
             String flowName = "L2VPN_" + serviceName;
             List<MatchInfoBase> elanMatches = policyFlowUtil.getElanInstanceMatches(serviceName);
             if (elanMatches == null || elanMatches.isEmpty()) {
-                return Optional.of(new PolicyAceFlowWrapper(flowName, /* isPartial */ true));
+                return Optional.of(new PolicyAceFlowWrapper(flowName, PolicyAceFlowWrapper.PARTIAL));
             }
 
             return Optional.of(new PolicyAceFlowWrapper(flowName, elanMatches,
@@ -230,7 +230,7 @@ public class PolicyAceFlowProgrammer {
             String flowName = "L3VPN_" + serviceName;
             List<MatchInfoBase> vpnMatches = policyFlowUtil.getVpnInstanceMatches(serviceName);
             if (vpnMatches == null || vpnMatches.isEmpty()) {
-                return Optional.of(new PolicyAceFlowWrapper(flowName, /* isPartial */ true));
+                return Optional.of(new PolicyAceFlowWrapper(flowName, PolicyAceFlowWrapper.PARTIAL));
             }
 
             return Optional.of(new PolicyAceFlowWrapper(flowName, vpnMatches,
index 6edc8f9625fca95cacb05f0a55c43f4d2c9f8a71..1f5dc47d5031447a017dcab0bca54f09e4652fee 100644 (file)
@@ -16,6 +16,9 @@ import org.opendaylight.genius.mdsalutil.NwConstants;
 
 public class PolicyAceFlowWrapper {
 
+    public static boolean PARTIAL = true;
+    public static boolean COMPLETE = false;
+
     private String flowName;
     private List<MatchInfoBase> matches;
     private int priority;