* loss of user code.
*
*/
-public class PceIdBuilder {
+public final class PceIdBuilder {
private PceIdBuilder() {
throw new UnsupportedOperationException();
}
final List<Plr> list = detourObject.getPlr();
serializeAttributeHeader(list.size() * 2 * Ipv4Util.IP4_LENGTH, CLASS_NUM, CTYPE, byteAggregator);
- for (Plr plr : list) {
+ for (final Plr plr : list) {
ByteBufWriteUtil.writeIpv4Address(plr.getPlrId(), byteAggregator);
ByteBufWriteUtil.writeIpv4Address(plr.getAvoidNode(), byteAggregator);
}
serializeAttributeHeader((pList.size() * Ipv6Util.IPV6_LENGTH) + (aList.size() * Ipv6Util.IPV6_LENGTH), CLASS_NUM,
CTYPE, byteAggregator);
- for (PlrId plrId : pList) {
+ for (final PlrId plrId : pList) {
byteAggregator.writeBytes(Ipv6Util.byteBufForAddress(plrId.getPlrId()));
}
- for (AvoidNode avoidNode : aList) {
+ for (final AvoidNode avoidNode : aList) {
byteAggregator.writeBytes(Ipv6Util.byteBufForAddress(avoidNode.getAvoidNode()));
}
}
private static final int FLAGS_SIZE = 8;
private static final Logger LOG = LoggerFactory.getLogger(ProtectionCommonParser.class);
- protected static final void serializeBodyType1(final ProtectionSubobject protObj, final ByteBuf output) {
+ protected static void serializeBodyType1(final ProtectionSubobject protObj, final ByteBuf output) {
final BitArray flagBitArray = new BitArray(FLAGS_SIZE);
flagBitArray.set(SECONDARY, protObj.isSecondary());
flagBitArray.toByteBuf(output);
output.writeByte(protObj.getLinkFlags().getIntValue());
}
- protected static final void serializeBodyType2(final ProtectionSubobject protObj, final ByteBuf output) {
+ protected static void serializeBodyType2(final ProtectionSubobject protObj, final ByteBuf output) {
final BitArray flagBitArray = new BitArray(FLAGS_SIZE);
flagBitArray.set(SECONDARY, protObj.isSecondary());
flagBitArray.set(PROTECTING, protObj.isProtecting());
output.writeZero(ByteBufWriteUtil.SHORT_BYTES_LENGTH);
}
- protected static final ProtectionSubobject parseCommonProtectionBodyType2(final ByteBuf byteBuf) throws RSVPParsingException {
+ protected static ProtectionSubobject parseCommonProtectionBodyType2(final ByteBuf byteBuf) throws RSVPParsingException {
if (byteBuf.readableBytes() != CONTENT_LENGTH_C2) {
throw new RSVPParsingException("Wrong length of array of bytes. Passed: " + byteBuf.readableBytes() + "; Expected: " + CONTENT_LENGTH_C2 + ".");
}
return sub.build();
}
- protected static final ProtectionSubobject parseCommonProtectionBodyType1(final ByteBuf byteBuf) {
- BitArray bitArray = BitArray.valueOf(byteBuf.readByte());
- ProtectionSubobjectBuilder sub = new ProtectionSubobjectBuilder();
+ protected static ProtectionSubobject parseCommonProtectionBodyType1(final ByteBuf byteBuf) {
+ final BitArray bitArray = BitArray.valueOf(byteBuf.readByte());
+ final ProtectionSubobjectBuilder sub = new ProtectionSubobjectBuilder();
sub.setSecondary(bitArray.get(SECONDARY));
//Skip Reserved
byteBuf.skipBytes(ByteBufWriteUtil.SHORT_BYTES_LENGTH);
- int linkFlags = byteBuf.readByte();
+ final int linkFlags = byteBuf.readByte();
sub.setLinkFlags(LinkFlags.forValue(linkFlags));
return sub.build();
}
public static final short CLASS_NUM = 21;
public static final short CTYPE = 1;
- public RecordRouteObjectParser(RROSubobjectRegistry subobjReg) {
+ public RecordRouteObjectParser(final RROSubobjectRegistry subobjReg) {
super(subobjReg);
}
final ByteBuf bufferAux = Unpooled.buffer();
int lenght = 0;
- for (SubobjectContainer subObject : lspAttributesObject.getLspAttributesObject().getSubobjectContainer()) {
+ for (final SubobjectContainer subObject : lspAttributesObject.getLspAttributesObject().getSubobjectContainer()) {
final LspSubobject lspSubonject = subObject.getLspSubobject();
if (lspSubonject instanceof FlagsTlv) {
final ByteBuf flagTLVValue = Unpooled.buffer();
public static final short CLASS_NUM = 201;
public static final short CTYPE = 1;
- public SecondaryRecordRouteObjectParser(RROSubobjectRegistry subobjReg) {
+ public SecondaryRecordRouteObjectParser(final RROSubobjectRegistry subobjReg) {
super(subobjReg);
}
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import java.util.List;
+import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.generalized.label._case.GeneralizedLabelBuilder;
public class EROSubobjectParserTest {
- private static final byte[] ip4PrefixBytes = {(byte) 0x81, (byte) 0x08, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ private static final byte[] IP_4_PREFIX_BYTES = {(byte) 0x81, (byte) 0x08, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0x16, (byte) 0x00};
- private static final byte[] ip6PrefixBytes = {(byte) 0x02, (byte) 0x14, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
+ private static final byte[] IP_6_PREFIX_BYTES = {(byte) 0x02, (byte) 0x14, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0xFF, (byte) 0xFF, (byte) 0x16, (byte) 0x00};
- private static final byte[] asNumberBytes = {(byte) 0xa0, (byte) 0x04, (byte) 0x00, (byte) 0x64};
- private static final byte[] unnumberedBytes = {(byte) 0x84, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x12, (byte) 0x34,
+ private static final byte[] AS_NUMBER_BYTES = {(byte) 0xa0, (byte) 0x04, (byte) 0x00, (byte) 0x64};
+ private static final byte[] UNNUMBERED_BYTES = {(byte) 0x84, (byte) 0x0c, (byte) 0x00, (byte) 0x00, (byte) 0x12, (byte) 0x34,
(byte) 0x50, (byte) 0x00, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF};
- private static final byte[] pathKey32Bytes = {(byte) 0xc0, (byte) 0x08, (byte) 0x12, (byte) 0x34, (byte) 0x12, (byte) 0x34,
+ private static final byte[] PATH_KEY_32_BYTES = {(byte) 0xc0, (byte) 0x08, (byte) 0x12, (byte) 0x34, (byte) 0x12, (byte) 0x34,
(byte) 0x50, (byte) 0x00};
- private static final byte[] pathKey128Bytes = {(byte) 0xc1, (byte) 0x14, (byte) 0x12, (byte) 0x34, (byte) 0x12, (byte) 0x34,
+ private static final byte[] PATH_KEY_128_BYTES = {(byte) 0xc1, (byte) 0x14, (byte) 0x12, (byte) 0x34, (byte) 0x12, (byte) 0x34,
(byte) 0x56, (byte) 0x78, (byte) 0x9A, (byte) 0xBC, (byte) 0xDE, (byte) 0x12, (byte) 0x34, (byte) 0x54, (byte) 0x00, (byte) 0x00,
(byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00};
- private static final byte[] labelBytes = {(byte) 0x83, (byte) 0x08, (byte) 0x80, (byte) 0x02, (byte) 0x12, (byte) 0x00, (byte) 0x25,
+ private static final byte[] LABEL_BYTES = {(byte) 0x83, (byte) 0x08, (byte) 0x80, (byte) 0x02, (byte) 0x12, (byte) 0x00, (byte) 0x25,
(byte) 0xFF};
- private static final byte[] exrsBytes = {(byte) 0xa1, (byte) 0x06, (byte) 0xa0, (byte) 0x04, (byte) 0x00, (byte) 0x64};
+ private static final byte[] EXRS_BYTES = {(byte) 0xa1, (byte) 0x06, (byte) 0xa0, (byte) 0x04, (byte) 0x00, (byte) 0x64};
private SimpleRSVPExtensionProviderContext ctx;
private RSVPActivator act;
this.act.start(this.ctx);
}
+ @After
+ public void tearDown() {
+ this.act.close();
+ }
+
@Test
public void testEROIp4PrefixSubobject() throws RSVPParsingException {
final EROIpv4PrefixSubobjectParser parser = new EROIpv4PrefixSubobjectParser();
subs.setLoose(true);
subs.setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("255.255.255.255/22"))).build()).build());
- assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(ip4PrefixBytes, 2)), true));
+ assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(IP_4_PREFIX_BYTES, 2)), true));
final ByteBuf buff = Unpooled.buffer();
parser.serializeSubobject(subs.build(), buff);
- Assert.assertArrayEquals(ip4PrefixBytes, ByteArray.getAllBytes(buff));
+ Assert.assertArrayEquals(IP_4_PREFIX_BYTES, ByteArray.getAllBytes(buff));
try {
parser.parseSubobject(null, true);
(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF,
(byte) 0xFF, (byte) 0xFF, (byte) 0xFF}, 22))).build()).build());
subs.setLoose(false);
- assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(ip6PrefixBytes, 2)), false));
+ assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(IP_6_PREFIX_BYTES, 2)), false));
final ByteBuf buff = Unpooled.buffer();
parser.serializeSubobject(subs.build(), buff);
- Assert.assertArrayEquals(ip6PrefixBytes, ByteArray.getAllBytes(buff));
+ Assert.assertArrayEquals(IP_6_PREFIX_BYTES, ByteArray.getAllBytes(buff));
try {
parser.parseSubobject(null, true);
final SubobjectContainerBuilder subs = new SubobjectContainerBuilder();
subs.setLoose(true);
subs.setSubobjectType(new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(new AsNumber(0x64L)).build()).build());
- assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(asNumberBytes, 2)), true));
+ assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(AS_NUMBER_BYTES, 2)), true));
final ByteBuf buff = Unpooled.buffer();
parser.serializeSubobject(subs.build(), buff);
- Assert.assertArrayEquals(asNumberBytes, ByteArray.getAllBytes(buff));
+ Assert.assertArrayEquals(AS_NUMBER_BYTES, ByteArray.getAllBytes(buff));
try {
parser.parseSubobject(null, true);
subs.setLoose(true);
subs.setSubobjectType(new UnnumberedCaseBuilder().setUnnumbered(
new UnnumberedBuilder().setRouterId(0x12345000L).setInterfaceId(0xffffffffL).build()).build());
- assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(unnumberedBytes, 2)), true));
+ assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(UNNUMBERED_BYTES, 2)), true));
final ByteBuf buff = Unpooled.buffer();
parser.serializeSubobject(subs.build(), buff);
- Assert.assertArrayEquals(unnumberedBytes, ByteArray.getAllBytes(buff));
+ Assert.assertArrayEquals(UNNUMBERED_BYTES, ByteArray.getAllBytes(buff));
try {
parser.parseSubobject(null, true);
pBuilder.setPceId(new PceId(new byte[]{(byte) 0x12, (byte) 0x34, (byte) 0x50, (byte) 0x00}));
pBuilder.setPathKey(new PathKey(4660));
subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
- assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(pathKey32Bytes, 2)), true));
+ assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY_32_BYTES, 2)), true));
final ByteBuf buff = Unpooled.buffer();
parser.serializeSubobject(subs.build(), buff);
- Assert.assertArrayEquals(pathKey32Bytes, ByteArray.getAllBytes(buff));
+ Assert.assertArrayEquals(PATH_KEY_32_BYTES, ByteArray.getAllBytes(buff));
try {
parser.parseSubobject(null, true);
(byte) 0x12, (byte) 0x34, (byte) 0x54, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00}));
pBuilder.setPathKey(new PathKey(4660));
subs.setSubobjectType(new PathKeyCaseBuilder().setPathKey(pBuilder.build()).build());
- assertEquals(subs.build(), parser128.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(pathKey128Bytes, 2)), true));
+ assertEquals(subs.build(), parser128.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(PATH_KEY_128_BYTES, 2)), true));
final ByteBuf buff = Unpooled.buffer();
parser.serializeSubobject(subs.build(), buff);
- Assert.assertArrayEquals(pathKey128Bytes, ByteArray.getAllBytes(buff));
+ Assert.assertArrayEquals(PATH_KEY_128_BYTES, ByteArray.getAllBytes(buff));
try {
parser128.parseSubobject(null, true);
new GeneralizedLabelCaseBuilder().setGeneralizedLabel(
new GeneralizedLabelBuilder().setGeneralizedLabel(
new byte[]{(byte) 0x12, (byte) 0x00, (byte) 0x25, (byte) 0xFF}).build()).build()).build()).build());
- assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(labelBytes, 2)), true));
+ assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(LABEL_BYTES, 2)), true));
final ByteBuf buff = Unpooled.buffer();
parser.serializeSubobject(subs.build(), buff);
- Assert.assertArrayEquals(labelBytes, ByteArray.getAllBytes(buff));
+ Assert.assertArrayEquals(LABEL_BYTES, ByteArray.getAllBytes(buff));
try {
parser.parseSubobject(null, true);
builder.setSubobjectType(new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(new AsNumber(0x64L)).build()).build());
list.add(builder.build());
subs.setSubobjectType(new ExrsCaseBuilder().setExrs(new ExrsBuilder().setExrs(list).build()).build());
- assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(exrsBytes, 2)), true));
+ assertEquals(subs.build(), parser.parseSubobject(Unpooled.wrappedBuffer(ByteArray.cutBytes(EXRS_BYTES, 2)), true));
final ByteBuf buff = Unpooled.buffer();
parser.serializeSubobject(subs.build(), buff);
- Assert.assertArrayEquals(exrsBytes, ByteArray.getAllBytes(buff));
+ Assert.assertArrayEquals(EXRS_BYTES, ByteArray.getAllBytes(buff));
try {
parser.parseSubobject(null, true);
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.waveband.switching.label._case.WavebandSwitchingLabelBuilder;
public class LabelSubobjectParserTest {
- private static final byte[] generalizedLabelBytes = {(byte) 0x80, 0x02, 0x00, 0x04, 0x12, 0x00, 0x25, (byte) 0xFF};
+ private static final byte[] GENERALIZED_LABEL_BYTES = {(byte) 0x80, 0x02, 0x00, 0x04, 0x12, 0x00, 0x25, (byte) 0xFF};
- private static final byte[] typeOneLabelBytes = {(byte) 0x81, 0x01, 0x12, 0x00, 0x25, (byte) 0xFF};
+ private static final byte[] TYPE_ONE_LABEL_BYTES = {(byte) 0x81, 0x01, 0x12, 0x00, 0x25, (byte) 0xFF};
- private static final byte[] wavebandLabelBytes = {0x01, 0x03, 0x00, 0x00, 0x12, 0x34, 0x00, 0x00, (byte) 0x99, (byte) 0x99, 0x00,
+ private static final byte[] WAVEBAND_LABEL_BYTES = {0x01, 0x03, 0x00, 0x00, 0x12, 0x34, 0x00, 0x00, (byte) 0x99, (byte) 0x99, 0x00,
0x00, 0x11, 0x11};
@Test
public void testGeneralizedLabel() throws RSVPParsingException {
final GeneralizedLabelParser parser = new GeneralizedLabelParser();
final GeneralizedLabelBuilder iBuilder = new GeneralizedLabelBuilder();
- iBuilder.setGeneralizedLabel(ByteArray.cutBytes(generalizedLabelBytes, 2));
+ iBuilder.setGeneralizedLabel(ByteArray.cutBytes(GENERALIZED_LABEL_BYTES, 2));
final GeneralizedLabelCaseBuilder builder = new GeneralizedLabelCaseBuilder().setGeneralizedLabel(iBuilder.build());
- assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(generalizedLabelBytes, 2))));
+ assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(GENERALIZED_LABEL_BYTES, 2))));
final ByteBuf buff = Unpooled.buffer();
parser.serializeLabel(true, false, builder.build(), buff);
- assertArrayEquals(generalizedLabelBytes, ByteArray.getAllBytes(buff));
+ assertArrayEquals(GENERALIZED_LABEL_BYTES, ByteArray.getAllBytes(buff));
try {
parser.parseLabel(null);
iBuilder.setStartLabel(0x9999L);
iBuilder.setEndLabel(0x1111L);
final WavebandSwitchingLabelCaseBuilder builder = new WavebandSwitchingLabelCaseBuilder().setWavebandSwitchingLabel(iBuilder.build());
- assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(wavebandLabelBytes, 2))));
+ assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(WAVEBAND_LABEL_BYTES, 2))));
final ByteBuf buff = Unpooled.buffer();
parser.serializeLabel(false, true, builder.build(), buff);
- assertArrayEquals(wavebandLabelBytes, ByteArray.getAllBytes(buff));
+ assertArrayEquals(WAVEBAND_LABEL_BYTES, ByteArray.getAllBytes(buff));
try {
parser.parseLabel(null);
final Type1LabelBuilder iBuilder = new Type1LabelBuilder();
iBuilder.setType1Label(0x120025ffL);
final Type1LabelCaseBuilder builder = new Type1LabelCaseBuilder().setType1Label(iBuilder.build());
- assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(typeOneLabelBytes, 2))));
+ assertEquals(builder.build(), parser.parseLabel(Unpooled.wrappedBuffer(ByteArray.cutBytes(TYPE_ONE_LABEL_BYTES, 2))));
final ByteBuf buff = Unpooled.buffer();
parser.serializeLabel(true, true, builder.build(), buff);
- assertArrayEquals(typeOneLabelBytes, ByteArray.getAllBytes(buff));
+ assertArrayEquals(TYPE_ONE_LABEL_BYTES, ByteArray.getAllBytes(buff));
try {
parser.parseLabel(null);
package org.opendaylight.protocol.rsvp.parser.impl.te;
-public class TEObjectUtil {
+final class TEObjectUtil {
/**
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |R| Reserved |T|A|D|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_ADMIN_STATUS = {
+ static final byte[] TE_LSP_ADMIN_STATUS = {
0x00, (byte) 0x04, (byte) 0xc4, 0x01, // Lenght, Class, Ctype
(byte) 0x80, // Reflect
0x00, 0x00, // Reserved
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_SESSION_C1 = {
+ static final byte[] TE_LSP_SESSION_C1 = {
0x00, (byte) 0x14, (byte) 0xcf, 0x01, // Lenght, Class, Ctype
0x01, 0x01, 0x01, 0x01,
0x02, 0x02, 0x02, 0x02,
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_SESSION_C7 = {
+ static final byte[] TE_LSP_SESSION_C7 = {
0x00, (byte) 0x08, (byte) 0xcf, 0x07, // Lenght, Class, Ctype
0x01, 0x02, 0x04, 0x04,
(byte) 0x41, (byte) 0x41, (byte) 0x41, (byte) 0x41,};
* | Bandwidth |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_BANDWIDTH_1 = {
+ static final byte[] TE_LSP_BANDWIDTH_1 = {
0x00, (byte) 0x04, (byte) 0x05, 0x01, // Lenght, Class, Ctype
0x01, 0x02, 0x03, 0x04,};
/**
* | Bandwidth |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_BANDWIDTH_2 = {
+ static final byte[] TE_LSP_BANDWIDTH_2 = {
0x00, (byte) 0x04, (byte) 0x05, 0x02, // Lenght, Class, Ctype
0x01, 0x02, 0x03, 0x04,};
* | IPv4 Association Source |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_ASSOCIATION_1 = {
+ static final byte[] TE_LSP_ASSOCIATION_1 = {
0x00, (byte) 0x08, (byte) 0xc7, 0x01, // Lenght, Class, Ctype
0x00, 0x01, 0x00, 0x02,
0x01, 0x02, 0x03, 0x04,};
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_ASSOCIATION_2 = {
+ static final byte[] TE_LSP_ASSOCIATION_2 = {
0x00, (byte) 0x14, (byte) 0xc7, 0x02, // Lenght, Class, Ctype
0x00, 0x01, 0x00, 0x02,
0x01, 0x02, 0x03, 0x04,
* | Include-all |
* +-------------+-------------+-------------+-------------+
*/
- public static final byte[] TE_LSP_FAST_REROUTE1 = {
+ static final byte[] TE_LSP_FAST_REROUTE1 = {
0x00, (byte) 0x14, (byte) 0xcd, 0x01, // Lenght, Class, Ctype
(byte) 0x01, (byte) 0x02, (byte) 0x10, (byte) 0x02,
0x01, 0x01, 0x01, 0x01,
* | Exclude-any |
* +-------------+-------------+-------------+-------------+
*/
- public static final byte[] TE_LSP_FAST_REROUTE7 = {
+ static final byte[] TE_LSP_FAST_REROUTE7 = {
0x00, (byte) 0x10, (byte) 0xcd, 0x07, // Lenght, Class, Ctype
(byte) 0x01, (byte) 0x02, (byte) 0x10, 0x00,
0x01, 0x01, 0x01, 0x01,
* | metric-value |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_METRIC = {
+ static final byte[] TE_LSP_METRIC = {
0x00, (byte) 0x08, (byte) 0x06, 0x01, // Lenght, Class, Ctype
0x00, 0x00, 0x03, 0x02,
0x01, 0x02, 0x03, 0x04,};
* |S| Reserved | Link Flags|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_PROTECTION_C1 = {
+ static final byte[] TE_LSP_PROTECTION_C1 = {
0x00, (byte) 0x04, (byte) 0x25, 0x01, // Lenght, Class, Ctype
(byte) 0x80, 0x00, 0x00, (byte) 0x0a,};
* |I|R| Reserved | Seg.Flags | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_PROTECTION_C2 = {
+ static final byte[] TE_LSP_PROTECTION_C2 = {
0x00, (byte) 0x08, (byte) 0x25, 0x02, // Lenght, Class, Ctype
(byte) 0xf0, 0x08, 0x00, (byte) 0x0a,
(byte) 0xc0, 0x04, 0x00, (byte) 0x00,};
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_ATTRIBUTES = {
+ static final byte[] TE_LSP_ATTRIBUTES = {
0x00, (byte) 0x0c, (byte) 0xc5, 0x01, // Lenght, Class, Ctype
0x00, 0x01, 0x00, 0x08,
(byte) 0x09, 0x07, 0x03, 0x01,
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_REQUIRED_ATTRIBUTES = {
+ static final byte[] TE_LSP_REQUIRED_ATTRIBUTES = {
0x00, (byte) 0x0c, 0x43, 0x01, // Lenght, Class, Ctype
0x00, 0x01, 0x00, 0x08,
(byte) 0x09, 0x07, 0x03, 0x01,
* | Avoid_Node_ID n |
* +-------------+-------------+-------------+-------------+
*/
- public static final byte[] TE_LSP_DETOUR7 = {
+ static final byte[] TE_LSP_DETOUR7 = {
0x00, (byte) 0x20, (byte) 0x3f, 0x07, // Lenght, Class, Ctype
0x00, 0x00, 0x00, 0x01,
0x01, 0x02, 0x03, 0x01,
* // .... //
* +-------------+-------------+-------------+-------------+
*/
- public static final byte[] TE_LSP_DETOUR8 = {
+ static final byte[] TE_LSP_DETOUR8 = {
0x00, (byte) 0x40, (byte) 0x3f, 0x08, // Lenght, Class, Ctype
0x00, 0x00, 0x00, 0x01,
0x00, 0x00, 0x00, 0x02,
* | Maximum Packet Size [M] (32-bit integer) |
* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_SENDER_TSPEC = {
+ static final byte[] TE_LSP_SENDER_TSPEC = {
0x00, (byte) 0x20, (byte) 0x0c, 0x02, // Lenght, Class, Ctype
0x00, 0x00, 0x00, 0x07,
0x01, 0x00, 0x00, 0x06,
* | Maximum Packet Size [M] (32-bit integer) |
* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_FLOWSPEC_H5 = {
+ static final byte[] TE_LSP_FLOWSPEC_H5 = {
0x00, (byte) 0x20, (byte) 0x09, 0x02, // Lenght, Class, Ctype
0x00, 0x00, 0x00, 0x07,
0x05, 0x00, 0x00, 0x06,
* | Slack Term [S] (32-bit integer) |
* -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_FLOWSPEC_H2 = {
+ static final byte[] TE_LSP_FLOWSPEC_H2 = {
0x00, (byte) 0x2c, (byte) 0x09, 0x02, // Lenght, Class, Ctype
0x00, 0x00, 0x00, 0x0a,
0x02, 0x00, 0x00, 0x09,
* | SRLG Id (continued) | Reserved |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_EXCLUDE_ROUTE = {
+ static final byte[] TE_LSP_EXCLUDE_ROUTE = {
0x00, (byte) 0x34, (byte) 0xe8, 0x01, // Lenght, Class, Ctype
(byte) 0x81, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x01,
(byte) 0x82, (byte) 0x14,
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_PRIMARY_PATH_ROUTE = {
+ static final byte[] TE_LSP_PRIMARY_PATH_ROUTE = {
0x00, (byte) 0x30, (byte) 0x26, 0x01, // Lenght, Class, Ctype
(byte) 0x01, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x00,
(byte) 0x02, (byte) 0x14,
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_EXPLICIT = {
+ static final byte[] TE_LSP_EXPLICIT = {
0x00, (byte) 0x20, (byte) 0x14, 0x01, // Lenght, Class, Ctype
(byte) 0x81, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x00,
(byte) 0x82, (byte) 0x14,
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_SECONDARY_EXPLICIT = {
+ static final byte[] TE_LSP_SECONDARY_EXPLICIT = {
0x00, (byte) 0x2c, (byte) 0xc8, 0x01, // Lenght, Class, Ctype
(byte) 0x81, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x00,
(byte) 0x82, (byte) 0x14,
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_RECORD_ROUTE = {
+ static final byte[] TE_LSP_RECORD_ROUTE = {
0x00, (byte) 0x24, (byte) 0x15, 0x01, // Lenght, Class, Ctype
(byte) 0x01, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x01,
(byte) 0x02, (byte) 0x14,
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
- public static final byte[] TE_LSP_SECONDARY_RECORD_ROUTE = {
+ static final byte[] TE_LSP_SECONDARY_RECORD_ROUTE = {
0x00, (byte) 0x30, (byte) 0xc9, 0x01, // Lenght, Class, Ctype
(byte) 0x01, 0x08, 0x01, 0x02, 0x03, 0x04, (byte) 0x20, 0x01,
(byte) 0x02, (byte) 0x14,
(byte) 0xf0, 0x04, 0x00, 0x08,
(byte) 0xc0, 0x04, 0x00, 0x00,
};
- public static final byte[] TE_LSP_DYNAMIC_SRRO_PROTECTION = {
+ static final byte[] TE_LSP_DYNAMIC_SRRO_PROTECTION = {
(byte) 0x25, 0x0c, 0x00, 0x02,
(byte) 0xf0, 0x04, 0x00, 0x08,
(byte) 0xc0, 0x04, 0x00, 0x00,
};
- public static final byte[] TE_LSP_BASIC_SRRO_PROTECTION = {
+ static final byte[] TE_LSP_BASIC_SRRO_PROTECTION = {
(byte) 0x25, 0x08, 0x00, 0x01,
(byte) 0x00, 0x00, 0x00, 0x08,
};
- public static final byte[] TE_LSP_DYNAMIC_SERO_PROTECTION = {
+ static final byte[] TE_LSP_DYNAMIC_SERO_PROTECTION = {
(byte) 0xa5, 0x0c, 0x00, 0x02,
(byte) 0xf0, 0x04, 0x00, 0x08,
(byte) 0xc0, 0x04, 0x00, 0x00,
};
- public static final byte[] TE_LSP_BASIC_SERO_PROTECTION = {
+ static final byte[] TE_LSP_BASIC_SERO_PROTECTION = {
(byte) 0xa5, 0x08, 0x00, 0x01,
(byte) 0x00, 0x00, 0x00, 0x08,
};
throw new UnsupportedOperationException();
}
- public static void formatSubobject(int type, final Boolean loose, final ByteBuf body, final ByteBuf buffer) {
+ public static void formatSubobject(final int type, final Boolean loose, final ByteBuf body, final ByteBuf buffer) {
if (loose == null) {
buffer.writeByte(type);
} else {
public final synchronized void setMaximumCachedObjects(final int maximumCachedObjects) {
Preconditions.checkArgument(maximumCachedObjects >= 0);
- Cache<Object, Object> newCache = CacheBuilder.newBuilder().maximumSize(maximumCachedObjects).build();
+ final Cache<Object, Object> newCache = CacheBuilder.newBuilder().maximumSize(maximumCachedObjects).build();
newCache.putAll(this.cacheRef.get().asMap());
this.cacheRef.set(newCache);
}
}
@Test(expected = IllegalArgumentException.class)
- public void testParseWrongType() {
+ public void testParseWrongType() throws RSVPParsingException {
final int wrongType = 65536;
- try {
- this.simpleEROSubobjectRegistry.parseSubobject(wrongType, this.input, false);
- } catch (final RSVPParsingException e) {
- }
+ this.simpleEROSubobjectRegistry.parseSubobject(wrongType, this.input, false);
}
@Test(expected = IllegalArgumentException.class)
}
@Test(expected = IllegalArgumentException.class)
- public void testParseWrongType() {
+ public void testParseWrongType() throws RSVPParsingException {
final int wrongType = 65536;
- try {
- this.simpleLabelRegistry.parseLabel(wrongType, this.input);
- } catch (RSVPParsingException e) {
- }
+ this.simpleLabelRegistry.parseLabel(wrongType, this.input);
}
@Test(expected = IllegalArgumentException.class)
}
@Test(expected = IllegalArgumentException.class)
- public void testParseWrongType() {
+ public void testParseWrongType() throws RSVPParsingException {
final int wrongType = 65536;
- try {
- this.simpleRROSubobjectRegistry.parseSubobject(wrongType, this.input);
- } catch (final RSVPParsingException e) {
- }
+ this.simpleRROSubobjectRegistry.parseSubobject(wrongType, this.input);
}
@Test(expected = IllegalArgumentException.class)
}
@Test(expected = IllegalArgumentException.class)
- public void testParseWrongType() {
+ public void testParseWrongType() throws RSVPParsingException {
final int wrongType = 65536;
- try {
- this.simpleXROSubobjectRegistry.parseSubobject(wrongType, this.input, false);
- } catch (final RSVPParsingException e) {
- }
+ this.simpleXROSubobjectRegistry.parseSubobject(wrongType, this.input, false);
}
@Test(expected = IllegalArgumentException.class)
public class CUISubobjectParserTest {
private final Long routerId = 3735928559L;
private final Long interfaceId = 3736059631L;
- CommonUnnumberedInterfaceSubobjectParser parser = new CommonUnnumberedInterfaceSubobjectParser();
+ final CommonUnnumberedInterfaceSubobjectParser parser = new CommonUnnumberedInterfaceSubobjectParser();
final Unnumbered unnumbered1 = new UnnumberedBuilder().setRouterId(null).build();
final Unnumbered unnumbered2 = new UnnumberedBuilder().setRouterId(1L).setInterfaceId(null).build();