Bug 5503 - remove package cyclic dependency in BGP-FS 21/37321/4
authorKinsey Andrea Nietzsche <knietzsc@cisco.com>
Fri, 8 Apr 2016 12:08:58 +0000 (14:08 +0200)
committerMilos Fabian <milfabia@cisco.com>
Fri, 22 Apr 2016 12:55:27 +0000 (12:55 +0000)
Change-Id: Ie99145df5ecc8c846c7552d1129153133250bfb9
Signed-off-by: Kinsey Andrea Nietzsche <kinsey.nietzsche@pantheon.sk>
25 files changed:
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDestinationPortHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDscpHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpCodeHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpTypeHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpProtocolHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpv6FlowLabelHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpv6NextHeaderHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPacketLengthHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPortHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSSourcePortHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSTcpFlagsHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParser.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParser.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractFSFragmentHandler.java
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractNumericByteOperandParser.java [moved from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractNumericByteOperandParser.java with 95% similarity]
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractNumericOperandParser.java [moved from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractNumericOperandParser.java with 85% similarity]
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractOperandParser.java [moved from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractOperandParser.java with 87% similarity]
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/BitmaskOperandParser.java [moved from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/BitmaskOperandParser.java with 94% similarity]
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/NumericOneByteOperandParser.java [moved from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/NumericOneByteOperandParser.java with 96% similarity]
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/NumericTwoByteOperandParser.java [moved from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/NumericTwoByteOperandParser.java with 97% similarity]
bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/Util.java [moved from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/Util.java with 91% similarity]
bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/OperandsTest.java
bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParserTest.java
bgp/flowspec/src/test/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParserTest.java

index 3aab15b8ef5b34a135c33c9cfbea131b28974e75..1db6478b7fe6331583574218180ac5365136d896 100644 (file)
@@ -18,6 +18,9 @@ import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
+import org.opendaylight.protocol.bgp.flowspec.handlers.BitmaskOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericTwoByteOperandParser;
 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.bgp.parser.spi.NlriParser;
 import org.opendaylight.protocol.bgp.parser.spi.NlriSerializer;
index 2225973c8234df001a524e39e7c06c4712710598..44efa69bf660eeef49fe2ce5ea472efda6a26c2d 100644 (file)
@@ -11,8 +11,11 @@ import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
 import java.util.List;
+import org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericTwoByteOperandParser;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
index 6bfe74f73ab5c5c59c019899bec89945eae9f7a0..0f0148ece3c27bd6a7eacb550b705c298aa2271d 100644 (file)
@@ -13,6 +13,8 @@ import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.Util;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.flowspec.type.DscpCase;
index d2beddaa8f780f0d9e6e65e01e9693127d024806..b97ddb10d92ce1be6364278bf9f77454fe4517a3 100644 (file)
@@ -11,9 +11,9 @@ import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
 import java.util.List;
-import org.opendaylight.protocol.bgp.flowspec.NumericOneByteOperandParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.flowspec.type.IcmpCodeCase;
index 18ceec7388b60af821c92b41efd403669ca43cb3..d17f417028a01e8900fb6d5b8cc888c2eb2f80db 100644 (file)
@@ -13,6 +13,7 @@ import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.flowspec.type.IcmpTypeCase;
index 22a6dc2b735370f930525f5a9fe0805a86f81f7f..b4218c071ca13922ddddeb488717dc68e53df16d 100644 (file)
@@ -13,6 +13,7 @@ import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.ipv4.flowspec.flowspec.type.ProtocolIpCase;
index 337eeccf04234e50804aeb6b34066d689385f66e..1861e4f0b5046683fc8a511a70f3e1d905b61673 100644 (file)
@@ -12,8 +12,8 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
-import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
-import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
+
+import org.opendaylight.protocol.bgp.flowspec.handlers.*;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
index 2fd7df214e1aa372d09342e2fa4e45577f6d3da2..ffbffecbbf26d698afe17b7b3b17259a6a1e80d7 100644 (file)
@@ -13,6 +13,7 @@ import java.util.ArrayList;
 import java.util.List;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.ipv6.flowspec.flowspec.type.NextHeaderCase;
index 29822f8b5b4371dcc4fb7fb060fd95cb7bdcdab5..6451c64ee5edea1ba4eaa9fa8069dc9ad195c91f 100644 (file)
@@ -11,8 +11,11 @@ import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
 import java.util.List;
+import org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericTwoByteOperandParser;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
index 09835d9173925a1906fcf242f18f7cf3bfcea510..8e4d025ad933fbe139a22ee479f25ecd237520c0 100644 (file)
@@ -11,11 +11,11 @@ import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
 import java.util.List;
-import org.opendaylight.protocol.bgp.flowspec.AbstractOperandParser;
-import org.opendaylight.protocol.bgp.flowspec.NumericOneByteOperandParser;
-import org.opendaylight.protocol.bgp.flowspec.NumericTwoByteOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericTwoByteOperandParser;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
index 89c879624698afaf1fe72af5f50b6063d3786110..77c8e2017c29631a4f2540a778a97254f2fab50f 100644 (file)
@@ -11,8 +11,11 @@ import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
 import java.util.List;
+import org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericTwoByteOperandParser;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
index 91b684e97051b2b57a44c298158bf29d8d4d82a1..720c71ba8126bb08be4eb0c81e0014fcbdb158df 100644 (file)
@@ -12,8 +12,11 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
+import org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.BitmaskOperandParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
 import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
+import org.opendaylight.protocol.bgp.flowspec.handlers.Util;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.BitmaskOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
index 65329ac7ce78b7b9c0bcf3d946d1e2be27838cae..370983e7af73c6687f0a61beba0d42853029a30c 100644 (file)
@@ -13,7 +13,7 @@ import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
-import org.opendaylight.protocol.bgp.flowspec.SimpleFlowspecTypeRegistry;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.Flowspec;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.FlowspecBuilder;
index bbbfc7b68a67a45b18b678f98d28b74a796588dc..fc83549e4914b0d0f914debc1409853282491dec 100644 (file)
@@ -12,7 +12,7 @@ import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
-import org.opendaylight.protocol.bgp.flowspec.SimpleFlowspecTypeRegistry;
+import org.opendaylight.protocol.bgp.flowspec.handlers.NumericOneByteOperandParser;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.Flowspec;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.FlowspecBuilder;
index 80ea291bc379989ca3cc4b359446e3d39403a60a..8721df693a92599e888d894d7df42b051e9a1626 100644 (file)
@@ -11,9 +11,6 @@ import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.ArrayList;
 import java.util.List;
-import org.opendaylight.protocol.bgp.flowspec.BitmaskOperandParser;
-import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeParser;
-import org.opendaylight.protocol.bgp.flowspec.handlers.FlowspecTypeSerializer;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.BitmaskOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.Fragment;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.flowspec.destination.flowspec.FlowspecType;
similarity index 95%
rename from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractNumericByteOperandParser.java
rename to bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractNumericByteOperandParser.java
index 09d2e144a327545f5e802abc623e7288527f8fd6..883cb842f27dd101777e6d50efd8f7c46950280d 100644 (file)
@@ -5,9 +5,10 @@
  * 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.protocol.bgp.flowspec;
+package org.opendaylight.protocol.bgp.flowspec.handlers;
 
 import java.util.List;
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 
 /**
similarity index 85%
rename from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractNumericOperandParser.java
rename to bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractNumericOperandParser.java
index e19563cd5e9d964fab00afbf9bb5018ce6504316..dce9989b8eed009faf7df376eb82f78c92efae37 100644 (file)
@@ -5,12 +5,13 @@
  * 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.protocol.bgp.flowspec;
+package org.opendaylight.protocol.bgp.flowspec.handlers;
 
 import com.google.common.annotations.VisibleForTesting;
 import io.netty.buffer.ByteBuf;
 import java.util.List;
 import java.util.Set;
+
 import org.opendaylight.protocol.util.BitArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 
@@ -19,14 +20,14 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flow
  *
  * @param <N> numeric operand type
  */
-abstract class AbstractNumericOperandParser<N> extends AbstractOperandParser<NumericOperand> {
+abstract public class AbstractNumericOperandParser<N> extends AbstractOperandParser<NumericOperand> {
 
     @VisibleForTesting
-    static final String EQUALS_VALUE = "equals";
+    public static final String EQUALS_VALUE = "equals";
     @VisibleForTesting
-    static final String GREATER_THAN_VALUE = "greater-than";
+    public static final String GREATER_THAN_VALUE = "greater-than";
     @VisibleForTesting
-    static final String LESS_THAN_VALUE = "less-than";
+    public static final String LESS_THAN_VALUE = "less-than";
 
     protected static final int LESS_THAN = 5;
     protected static final int GREATER_THAN = 6;
@@ -43,7 +44,7 @@ abstract class AbstractNumericOperandParser<N> extends AbstractOperandParser<Num
     protected abstract <T extends N> String toString(final List<T> list);
 
     @Override
-    protected final NumericOperand create(final Set<String> operandValues) {
+    public final NumericOperand create(final Set<String> operandValues) {
         return new NumericOperand(operandValues.contains(AND_BIT_VALUE), operandValues.contains(END_OF_LIST_VALUE), operandValues.contains(EQUALS_VALUE), operandValues.contains(GREATER_THAN_VALUE), operandValues.contains(LESS_THAN_VALUE));
     }
 
@@ -60,13 +61,13 @@ abstract class AbstractNumericOperandParser<N> extends AbstractOperandParser<Num
     }
 
     @Override
-    protected final NumericOperand parse(final byte operand) {
+    public final NumericOperand parse(final byte operand) {
         final BitArray operandValues = BitArray.valueOf(operand);
         return new NumericOperand(operandValues.get(AND_BIT), operandValues.get(END_OF_LIST), operandValues.get(EQUAL), operandValues.get(GREATER_THAN), operandValues.get(LESS_THAN));
     }
 
     @Override
-    protected String toString(final NumericOperand operand, final boolean isFirst) {
+    public String toString(final NumericOperand operand, final boolean isFirst) {
         final StringBuilder buffer = new StringBuilder();
         if (operand.isAndBit()) {
             buffer.append("and ");
similarity index 87%
rename from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractOperandParser.java
rename to bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractOperandParser.java
index 5a5a1068731aaddc3299eebae0f8bd5017454e6e..f78088b12906dfe06c49921c7a24477ea6ab4586 100644 (file)
@@ -5,7 +5,7 @@
  * 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.protocol.bgp.flowspec;
+package org.opendaylight.protocol.bgp.flowspec.handlers;
 
 import com.google.common.annotations.VisibleForTesting;
 import io.netty.buffer.ByteBuf;
@@ -16,12 +16,12 @@ import java.util.Set;
  *
  * @param <T> operand Type
  */
-abstract class AbstractOperandParser<T> {
+abstract public class AbstractOperandParser<T> {
 
     @VisibleForTesting
-    static final String AND_BIT_VALUE = "and-bit";
+    public static final String AND_BIT_VALUE = "and-bit";
     @VisibleForTesting
-    static final String END_OF_LIST_VALUE = "end-of-list";
+    public static final String END_OF_LIST_VALUE = "end-of-list";
 
     protected static final int OPERAND_LENGTH = 8;
 
@@ -33,7 +33,7 @@ abstract class AbstractOperandParser<T> {
     private static final int LENGTH_BITMASK = 48;
 
     @VisibleForTesting
-    static final short parseLength(final byte op) {
+    public static final short parseLength(final byte op) {
         return (short) (1 << ((op & LENGTH_BITMASK) >> LENGTH_SHIFT));
     }
 
similarity index 94%
rename from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/BitmaskOperandParser.java
rename to bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/BitmaskOperandParser.java
index c408810c33fa982bf217288e898b7d42eea96afe..b3071037a991534b3913ad0141ae761aecd6dd3b 100644 (file)
@@ -5,11 +5,12 @@
  * 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.protocol.bgp.flowspec;
+package org.opendaylight.protocol.bgp.flowspec.handlers;
 
 import com.google.common.annotations.VisibleForTesting;
 import io.netty.buffer.ByteBuf;
 import java.util.Set;
+
 import org.opendaylight.protocol.util.BitArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.BitmaskOperand;
 
@@ -25,9 +26,9 @@ public final class BitmaskOperandParser extends AbstractOperandParser<BitmaskOpe
     }
 
     @VisibleForTesting
-    static final String MATCH_VALUE = "match";
+    public static final String MATCH_VALUE = "match";
     @VisibleForTesting
-    static final String NOT_VALUE = "not";
+    public static final String NOT_VALUE = "not";
 
     private static final int NOT = 6;
     private static final int MATCH = 7;
similarity index 96%
rename from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/NumericOneByteOperandParser.java
rename to bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/NumericOneByteOperandParser.java
index a635d27f66138b55e974ab5597f0a54fe0a083b8..abb2a0de3cbc93ad6b2583ce68ccf7a393318aa5 100644 (file)
@@ -5,10 +5,11 @@
  * 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.protocol.bgp.flowspec;
+package org.opendaylight.protocol.bgp.flowspec.handlers;
 
 import io.netty.buffer.ByteBuf;
 import java.util.List;
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOneByteValue;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 
similarity index 97%
rename from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/NumericTwoByteOperandParser.java
rename to bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/NumericTwoByteOperandParser.java
index dbce50e5dcfd159c1b4ac67cd13761914c9ce29b..324886a7894a9a5ca3a04d075def30f24b510d90 100644 (file)
@@ -5,11 +5,12 @@
  * 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.protocol.bgp.flowspec;
+package org.opendaylight.protocol.bgp.flowspec.handlers;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericOperand;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev150807.NumericTwoByteValue;
 
similarity index 91%
rename from bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/Util.java
rename to bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/Util.java
index 27169e2d5c099061ebf3b4d8186470b70a40b93a..f723c741353ab50d94d9b7d0afe46b364ac72b74 100644 (file)
@@ -5,7 +5,7 @@
  * 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.protocol.bgp.flowspec;
+package org.opendaylight.protocol.bgp.flowspec.handlers;
 
 import com.google.common.primitives.UnsignedBytes;
 import com.google.common.primitives.UnsignedInts;
@@ -27,7 +27,7 @@ public final class Util {
      * @param value integer to be written
      * @param buffer ByteBuf where the value will be written
      */
-    protected static void writeShortest(final int value, final ByteBuf buffer) {
+    public static void writeShortest(final int value, final ByteBuf buffer) {
         if (value <= Values.UNSIGNED_BYTE_MAX_VALUE) {
             buffer.writeByte(UnsignedBytes.checkedCast(value));
         } else if (value <= Values.UNSIGNED_SHORT_MAX_VALUE) {
index 55e003242c757194c0ae959d23a3e49eb6ce2cc9..7b88ddecd8949f534c10e08bf143462fc3ac778d 100644 (file)
@@ -8,7 +8,9 @@
 package org.opendaylight.protocol.bgp.flowspec;
 
 import static org.junit.Assert.assertEquals;
+
 import org.junit.Test;
+import org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser;
 
 public class OperandsTest {
 
index 36157259674eb8852c89d880728819ab518be297..35f4e7d74bfaf6a3373724ef82aab798b6efd083 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.protocol.bgp.flowspec;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
+
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import io.netty.buffer.ByteBuf;
@@ -16,6 +17,9 @@ import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Test;
+import org.opendaylight.protocol.bgp.flowspec.handlers.AbstractNumericOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.BitmaskOperandParser;
 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Prefix;
index d3d6a4a17bba14cb148ccf93e63e2452dff790b5..586e0d5f7d4a35a9d4ec85120c247b479cea7de4 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.protocol.bgp.flowspec;
 
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
+
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import io.netty.buffer.ByteBuf;
@@ -16,6 +17,9 @@ import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Test;
+import org.opendaylight.protocol.bgp.flowspec.handlers.AbstractNumericOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.AbstractOperandParser;
+import org.opendaylight.protocol.bgp.flowspec.handlers.BitmaskOperandParser;
 import org.opendaylight.protocol.bgp.parser.BGPParsingException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv6Prefix;