From ece42a33d9645c3091ad894b57ccb01316f63de5 Mon Sep 17 00:00:00 2001 From: Kinsey Andrea Nietzsche Date: Fri, 8 Apr 2016 14:08:58 +0200 Subject: [PATCH] Bug 5503 - remove package cyclic dependency in BGP-FS Change-Id: Ie99145df5ecc8c846c7552d1129153133250bfb9 Signed-off-by: Kinsey Andrea Nietzsche --- .../flowspec/AbstractFlowspecNlriParser.java | 3 +++ .../bgp/flowspec/FSDestinationPortHandler.java | 3 +++ .../protocol/bgp/flowspec/FSDscpHandler.java | 2 ++ .../bgp/flowspec/FSIcmpCodeHandler.java | 2 +- .../bgp/flowspec/FSIcmpTypeHandler.java | 1 + .../bgp/flowspec/FSIpProtocolHandler.java | 1 + .../bgp/flowspec/FSIpv6FlowLabelHandler.java | 4 ++-- .../bgp/flowspec/FSIpv6NextHeaderHandler.java | 1 + .../bgp/flowspec/FSPacketLengthHandler.java | 3 +++ .../protocol/bgp/flowspec/FSPortHandler.java | 6 +++--- .../bgp/flowspec/FSSourcePortHandler.java | 3 +++ .../bgp/flowspec/FSTcpFlagsHandler.java | 3 +++ .../flowspec/SimpleFlowspecIpv4NlriParser.java | 2 +- .../flowspec/SimpleFlowspecIpv6NlriParser.java | 2 +- .../handlers/AbstractFSFragmentHandler.java | 3 --- .../AbstractNumericByteOperandParser.java | 3 ++- .../AbstractNumericOperandParser.java | 17 +++++++++-------- .../{ => handlers}/AbstractOperandParser.java | 10 +++++----- .../{ => handlers}/BitmaskOperandParser.java | 7 ++++--- .../NumericOneByteOperandParser.java | 3 ++- .../NumericTwoByteOperandParser.java | 3 ++- .../bgp/flowspec/{ => handlers}/Util.java | 4 ++-- .../protocol/bgp/flowspec/OperandsTest.java | 2 ++ .../SimpleFlowspecIpv4NlriParserTest.java | 4 ++++ .../SimpleFlowspecIpv6NlriParserTest.java | 4 ++++ 25 files changed, 64 insertions(+), 32 deletions(-) rename bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/{ => handlers}/AbstractNumericByteOperandParser.java (95%) rename bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/{ => handlers}/AbstractNumericOperandParser.java (85%) rename bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/{ => handlers}/AbstractOperandParser.java (87%) rename bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/{ => handlers}/BitmaskOperandParser.java (94%) rename bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/{ => handlers}/NumericOneByteOperandParser.java (96%) rename bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/{ => handlers}/NumericTwoByteOperandParser.java (97%) rename bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/{ => handlers}/Util.java (91%) diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java index 3aab15b8ef..1db6478b7f 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractFlowspecNlriParser.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDestinationPortHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDestinationPortHandler.java index 2225973c82..44efa69bf6 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDestinationPortHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDestinationPortHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDscpHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDscpHandler.java index 6bfe74f73a..0f0148ece3 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDscpHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSDscpHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpCodeHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpCodeHandler.java index d2beddaa8f..b97ddb10d9 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpCodeHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpCodeHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpTypeHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpTypeHandler.java index 18ceec7388..d17f417028 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpTypeHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIcmpTypeHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpProtocolHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpProtocolHandler.java index 22a6dc2b73..b4218c071c 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpProtocolHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpProtocolHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpv6FlowLabelHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpv6FlowLabelHandler.java index 337eeccf04..1861e4f0b5 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpv6FlowLabelHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpv6FlowLabelHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpv6NextHeaderHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpv6NextHeaderHandler.java index 2fd7df214e..ffbffecbbf 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpv6NextHeaderHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSIpv6NextHeaderHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPacketLengthHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPacketLengthHandler.java index 29822f8b5b..6451c64ee5 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPacketLengthHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPacketLengthHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPortHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPortHandler.java index 09835d9173..8e4d025ad9 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPortHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSPortHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSSourcePortHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSSourcePortHandler.java index 89c8796246..77c8e2017c 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSSourcePortHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSSourcePortHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSTcpFlagsHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSTcpFlagsHandler.java index 91b684e970..720c71ba81 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSTcpFlagsHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/FSTcpFlagsHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParser.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParser.java index 65329ac7ce..370983e7af 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParser.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv4NlriParser.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParser.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParser.java index bbbfc7b68a..fc83549e49 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParser.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/SimpleFlowspecIpv6NlriParser.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractFSFragmentHandler.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractFSFragmentHandler.java index 80ea291bc3..8721df693a 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractFSFragmentHandler.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractFSFragmentHandler.java @@ -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; diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractNumericByteOperandParser.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractNumericByteOperandParser.java 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 09d2e144a3..883cb842f2 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractNumericByteOperandParser.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractNumericByteOperandParser.java @@ -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; /** diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractNumericOperandParser.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractNumericOperandParser.java 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 e19563cd5e..dce9989b8e 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/AbstractNumericOperandParser.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/AbstractNumericOperandParser.java @@ -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 numeric operand type */ -abstract class AbstractNumericOperandParser extends AbstractOperandParser { +abstract public class AbstractNumericOperandParser extends AbstractOperandParser { @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 extends AbstractOperandParser String toString(final List list); @Override - protected final NumericOperand create(final Set operandValues) { + public final NumericOperand create(final Set 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 extends AbstractOperandParser operand Type */ -abstract class AbstractOperandParser { +abstract public class AbstractOperandParser { @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 { 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)); } diff --git a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/BitmaskOperandParser.java b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/BitmaskOperandParser.java 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 c408810c33..b3071037a9 100644 --- a/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/BitmaskOperandParser.java +++ b/bgp/flowspec/src/main/java/org/opendaylight/protocol/bgp/flowspec/handlers/BitmaskOperandParser.java @@ -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