Promote MessageRegistry to pcep-api 19/104019/2
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 14 Jan 2023 16:16:58 +0000 (17:16 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 14 Jan 2023 16:25:58 +0000 (17:25 +0100)
The base ability to parse messages is inherently tied to a
PCEPDispatcher. At the end up the day we will need to pass the parsing
registry when we create a server.

JIRA: BGPCEP-962
Change-Id: Ic80888f063ea7cab2a6b28ec9978f151313d64ce
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
173 files changed:
pcep/api/pom.xml
pcep/api/src/main/java/org/opendaylight/protocol/pcep/MessageRegistry.java [moved from pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/MessageRegistry.java with 96% similarity]
pcep/api/src/main/java/org/opendaylight/protocol/pcep/PCEPDeserializerException.java [moved from pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPDeserializerException.java with 96% similarity]
pcep/auto-bandwidth-extension/src/main/java/org/opendaylight/protocol/pcep/auto/bandwidth/extension/BandwidthUsageObjectCodec.java
pcep/auto-bandwidth-extension/src/test/java/org/opendaylight/protocol/pcep/auto/bandwidth/extension/PCEPBandwidthUsageObjectCodecTest.java
pcep/auto-bandwidth-extension/src/test/java/org/opendaylight/protocol/pcep/auto/bandwidth/extension/PcRptMessageCodecTest.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPCloseMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPErrorMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPKeepAliveMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPMonitoringReplyMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPMonitoringRequestMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPNotificationMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPOpenMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPReplyMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPRequestMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/message/PCEPStartTLSMessageParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/AbstractEROWithSubobjectsParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/AbstractRROWithSubobjectsParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/AbstractVendorInformationObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/AbstractXROWithSubobjectsParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPBandwidthObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPClassTypeObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPCloseObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPErrorObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPExcludeRouteObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPExistingBandwidthObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPExplicitRouteObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPGlobalConstraintsObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPIncludeRouteObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPLoadBalancingObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPLspaObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPMetricObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPMonitoringObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPNoPathObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPNotificationObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPObjectiveFunctionObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPOpenObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPOverloadObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPPathKeyObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPPccIdReqIPv4ObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPPccIdReqIPv6ObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPPceIdIPv4ObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPPceIdIPv6ObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPProcTimeObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPReportedRouteObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPRequestParameterObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPSecondaryExplicitRouteObjecParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPSecondaryRecordRouteObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPSvecObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/bnc/BranchNodeListObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/bnc/NonBranchNodeListObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/end/points/PCEPEndPointsIpv4ObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/end/points/PCEPEndPointsIpv6ObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/end/points/PCEPP2MPEndPointsIpv4ObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/end/points/PCEPP2MPEndPointsIpv6ObjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/unreach/PCEPIpv4UnreachDestinationParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/unreach/PCEPIpv6UnreachDestinationParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/AsNumberCaseParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/EROAsNumberSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/EROExplicitExclusionRouteSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/EROIpv4PrefixSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/EROIpv6PrefixSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/EROLabelSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/EROPathKey128SubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/EROPathKey32SubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/EROUnnumberedInterfaceSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/GeneralizedLabelParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/RROIpv4PrefixSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/RROIpv6PrefixSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/RROLabelSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/RROPathKey128SubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/RROPathKey32SubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/RROUnnumberedInterfaceSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/Type1LabelParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/WavebandSwitchingLabelParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/XROAsNumberSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/XROIpv4PrefixSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/XROIpv6PrefixSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/XROPathKey128SubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/XROPathKey32SubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/XROSrlgSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/subobject/XROUnnumberedInterfaceSubobjectParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/tlv/AbstractVendorInformationTlvParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/tlv/NoPathVectorTlvParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/tlv/OFListTlvParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/tlv/OrderTlvParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/tlv/OverloadedDurationTlvParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/tlv/PathSetupTypeTlvParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/tlv/ReqMissingTlvParser.java
pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/util/Util.java
pcep/ietf-p2mp-te-lsp/src/main/java/org/opendaylight/protocol/pcep/p2mp/te/lsp/P2MPTeLspCapabilityParser.java
pcep/ietf-p2mp-te-lsp/src/test/java/org/opendaylight/protocol/pcep/p2mp/te/lsp/P2MPTeLspTlvsParserTest.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/initiated/InitiatedPCInitiateMessageParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/PathBindingTlvParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulErrorMessageParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulLSPIdentifierIpv4TlvParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulLSPIdentifierIpv6TlvParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulLspObjectParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulLspSymbolicNameTlvParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulLspUpdateErrorTlvParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulPCReportMessageParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulPCUpdateRequestMessageParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulRSVPErrorSpecTlvParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulSrpObjectParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful/StatefulStatefulCapabilityTlvParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/sync/optimizations/LspDbVersionTlvParser.java
pcep/ietf-stateful/src/main/java/org/opendaylight/protocol/pcep/sync/optimizations/SpeakerEntityIdTlvParser.java
pcep/ietf-stateful/src/test/java/org/opendaylight/protocol/pcep/ietf/PCEPObjectParserTest.java
pcep/ietf-stateful/src/test/java/org/opendaylight/protocol/pcep/ietf/PCEPTlvParserTest.java
pcep/ietf-stateful/src/test/java/org/opendaylight/protocol/pcep/ietf/PCEPValidatorTest.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPByteToMessageDecoder.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImpl.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPHandlerFactory.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPMessageToByteEncoder.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/LabelSubobjectParserTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImplTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPObjectParserTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPParserTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPTlvParserTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PCEPValidatorTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PcepEROSubobjectParserTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PcepRROSubobjectParserTest.java
pcep/impl/src/test/java/org/opendaylight/protocol/pcep/impl/PcepXROSubobjectParserTest.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCEndPointIpv4ObjectParser.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/PCCsBuilder.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/protocol/PCCDispatcherImpl.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCDispatcherImplTest.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCEndPointIpv4ObjectParserTest.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCMockCommon.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/AbstractSrSubobjectParser.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SrEroSubobjectParser.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SrPceCapabilityTlvParser.java
pcep/segment-routing/src/main/java/org/opendaylight/protocol/pcep/segment/routing/SrRroSubobjectParser.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrEroSubobjectParserTest.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrObjectParserTest.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrRroSubobjectParserTest.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/SrTlvParserTest.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/AbstractEROPathKeySubobjectParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/AbstractMessageParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/AbstractObjectWithTlvsParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EROSubobjectParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EROSubobjectRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EnterpriseSpecificInformationParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/LabelParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/LabelRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/MessageParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/ObjectParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/ObjectRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPExtensionConsumerContext.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/RROSubobjectParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/RROSubobjectRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/TlvParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/TlvRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/VendorInformationObjectRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/VendorInformationTlvRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/XROSubobjectParser.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/XROSubobjectRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/DefaultPCEPExtensionConsumerContext.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleEROSubobjectRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleLabelRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleMessageRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleObjectRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimplePCEPExtensionProviderContext.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleRROSubobjectRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleTlvRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleVendorInformationObjectRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleVendorInformationTlvRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleXROSubobjectRegistry.java
pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/APITest.java
pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/AbstractMessageParserTest.java
pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/AbstractObjectWithTlvsTest.java
pcep/spi/src/test/java/org/opendaylight/protocol/pcep/spi/RegistryTest.java
pcep/testtool/src/main/java/org/opendaylight/protocol/pcep/testtool/Main.java

index 9775eb58db051192adee240bf9fb6996c8a031ee..1fcd04bbfba43c11485c79cb62bd915eaae69379 100644 (file)
             <groupId>io.netty</groupId>
             <artifactId>netty-transport</artifactId>
         </dependency>
+        <dependency>
+            <groupId>io.netty</groupId>
+            <artifactId>netty-buffer</artifactId>
+        </dependency>
         <dependency>
             <groupId>io.netty</groupId>
             <artifactId>netty-common</artifactId>
similarity index 96%
rename from pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/MessageRegistry.java
rename to pcep/api/src/main/java/org/opendaylight/protocol/pcep/MessageRegistry.java
index 2b5ed015bcf9c4dc1c90d24dc07a8d9fed64ad88..b99fc941231c01649daff03fe8ddc5170cd1792e 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.pcep.spi;
+package org.opendaylight.protocol.pcep;
 
 import io.netty.buffer.ByteBuf;
 import java.util.List;
similarity index 96%
rename from pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPDeserializerException.java
rename to pcep/api/src/main/java/org/opendaylight/protocol/pcep/PCEPDeserializerException.java
index 92c92b70191ac27c15dffb75e238f2afdb50ad39..46c7bd189c01dc501cb84f056e289cd39ed86753 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.pcep.spi;
+package org.opendaylight.protocol.pcep;
 
 /**
  * Used when something occurs during parsing bytes to java objects.
index 25f56e4e0b7d14f9273b6650ffbf8578ae63ec62..78f3cbe4a38c2402dff20ae14b02150e87c8b8dc 100644 (file)
@@ -8,17 +8,17 @@
 
 package org.opendaylight.protocol.pcep.auto.bandwidth.extension;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeFloat32;
 
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.auto.bandwidth.rev181109.bandwidth.usage.object.BandwidthUsage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.auto.bandwidth.rev181109.bandwidth.usage.object.BandwidthUsageBuilder;
@@ -38,8 +38,7 @@ public final class BandwidthUsageObjectCodec extends CommonObjectParser implemen
 
     @Override
     public BandwidthUsage parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
-        Preconditions.checkArgument(bytes != null && bytes.isReadable(),
-                "Array of bytes is mandatory. Can't be null or empty.");
+        checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         if (bytes.readableBytes() % BW_LENGTH != 0) {
             throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + bytes.readableBytes()
                     + "; Expected multiple of " + BW_LENGTH + ".");
@@ -57,7 +56,7 @@ public final class BandwidthUsageObjectCodec extends CommonObjectParser implemen
 
     @Override
     public void serializeObject(final Object object, final ByteBuf buffer) {
-        Preconditions.checkArgument(object instanceof BandwidthUsage,
+        checkArgument(object instanceof BandwidthUsage,
                 "Wrong instance of PCEPObject. Passed %s. Needed BandwidthUsage.", object.getClass());
         final List<Bandwidth> bwSample = ((BandwidthUsage) object).getBwSample();
         final ByteBuf body = Unpooled.buffer(bwSample.size() * BW_LENGTH);
index b27e6aa44023e28e49bdf199a3f615006b077cc7..98f0ead270f5b9e7084ada2151a3bb8622e8e405 100644 (file)
@@ -14,8 +14,8 @@ import com.google.common.collect.Lists;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.auto.bandwidth.rev181109.bandwidth.usage.object.BandwidthUsage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.auto.bandwidth.rev181109.bandwidth.usage.object.BandwidthUsageBuilder;
index 14e6f88a4d8f66d25a153f295595888d0795a34a..178f1465315808762689535a0a3db4353ef8e735 100644 (file)
@@ -21,9 +21,9 @@ import java.util.Queue;
 import javax.xml.bind.DatatypeConverter;
 import org.junit.Before;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.ietf.stateful.StatefulActivator;
 import org.opendaylight.protocol.pcep.parser.BaseParserExtensionActivator;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.auto.bandwidth.rev181109.Bandwidth1;
@@ -59,14 +59,14 @@ public class PcRptMessageCodecTest {
 
     @Before
     public void setUp() {
-        new BaseParserExtensionActivator().start(this.ctx);
-        new StatefulActivator().start(this.ctx);
-        new org.opendaylight.protocol.pcep.auto.bandwidth.extension.Activator().start(this.ctx);
+        new BaseParserExtensionActivator().start(ctx);
+        new StatefulActivator().start(ctx);
+        new org.opendaylight.protocol.pcep.auto.bandwidth.extension.Activator().start(ctx);
     }
 
     @Test
     public void testGetValidReportsPositive() {
-        final PcRptMessageCodec codec = new PcRptMessageCodec(this.ctx.getObjectHandlerRegistry());
+        final PcRptMessageCodec codec = new PcRptMessageCodec(ctx.getObjectHandlerRegistry());
         final BandwidthUsage bw = new BandwidthUsageBuilder().setBwSample(BW).build();
         final Ipv4Builder builder = new Ipv4Builder();
         builder.setIpv4TunnelSenderAddress(new Ipv4AddressNoZone("127.0.1.1"));
@@ -88,7 +88,7 @@ public class PcRptMessageCodecTest {
 
     @Test
     public void testGetValidReportsNegative() {
-        final PcRptMessageCodec codec = new PcRptMessageCodec(this.ctx.getObjectHandlerRegistry());
+        final PcRptMessageCodec codec = new PcRptMessageCodec(ctx.getObjectHandlerRegistry());
         final BandwidthUsage bw = new BandwidthUsageBuilder().setBwSample(BW).build();
         final Ipv4Builder builder = new Ipv4Builder();
         builder.setIpv4TunnelSenderAddress(new Ipv4AddressNoZone("127.0.1.1"));
@@ -103,7 +103,7 @@ public class PcRptMessageCodecTest {
 
     @Test
     public void testserializeObject() {
-        final PcRptMessageCodec codec = new PcRptMessageCodec(this.ctx.getObjectHandlerRegistry());
+        final PcRptMessageCodec codec = new PcRptMessageCodec(ctx.getObjectHandlerRegistry());
         final ByteBuf buffer = Unpooled.buffer();
         codec.serializeObject(new BandwidthBuilder()
             .addAugmentation(new Bandwidth1Builder().setBwSample(BW).build())
@@ -118,7 +118,7 @@ public class PcRptMessageCodecTest {
                         + "000d2004008490a0000d40a0000d4001f0006000005dd700000000710001401080a000706200001080a0000d420"
                         + "000910001400000000000000000000000005050100051000084998968005500008513a43b70810002401080a000"
                         + "0d42020030801010000000001080a00070620000308010100000000");
-        final Pcrpt msg = (Pcrpt) this.ctx.getMessageHandlerRegistry().parseMessage(10,
+        final Pcrpt msg = (Pcrpt) ctx.getMessageHandlerRegistry().parseMessage(10,
                 Unpooled.wrappedBuffer(parseHexBinary), Collections.emptyList());
         assertNotNull(msg.getPcrptMessage().getReports().get(0).getPath()
                 .getBandwidth().augmentation(Bandwidth1.class));
index c0559ec264672165f90f9a4c89969abf48901f4e..d47f07ef190ea8d408ea1bdabf122fa92f0490ce 100644 (file)
@@ -13,10 +13,10 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.Close;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.CloseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.CloseMessage;
index b282c7effe807334d0f119af03baaf6f2a765861..6482f99a6f18b1cd15c6a56e6ce5657c7bbdc1da 100644 (file)
@@ -9,17 +9,16 @@ package org.opendaylight.protocol.pcep.parser.message;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.PcerrBuilder;
@@ -54,11 +53,11 @@ public class PCEPErrorMessageParser extends AbstractMessageParser {
 
     @Override
     public void serializeMessage(final Message message, final ByteBuf out) {
-        Preconditions.checkArgument(message instanceof PcerrMessage,
+        checkArgument(message instanceof PcerrMessage,
                 "Wrong instance of Message. Passed instance of %s. Need PcerrMessage.", message.getClass());
         final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.pcerr.message
             .PcerrMessage err = ((PcerrMessage) message).getPcerrMessage();
-        Preconditions.checkArgument(err.getErrors() != null && !err.nonnullErrors().isEmpty(),
+        checkArgument(err.getErrors() != null && !err.nonnullErrors().isEmpty(),
                 "Errors should not be empty.");
         final ByteBuf buffer = Unpooled.buffer();
         serializeCases(err, buffer);
@@ -98,8 +97,7 @@ public class PCEPErrorMessageParser extends AbstractMessageParser {
         if (first instanceof ErrorObject) {
             errorObjects.add(new ErrorsBuilder().setErrorObject((ErrorObject) first).build());
             initialState = State.ERROR_IN;
-        } else if (first instanceof Rp) {
-            final Rp rp = (Rp) first;
+        } else if (first instanceof Rp rp) {
             if (rp.getProcessingRule()) {
                 errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET, Optional.empty()));
                 return null;
@@ -146,15 +144,13 @@ public class PCEPErrorMessageParser extends AbstractMessageParser {
             final List<Rps> requestParameters, final PcerrMessageBuilder msgBuilder) {
         switch (state) {
             case RP_IN:
-                if (obj instanceof Rp) {
-                    final Rp o = (Rp) obj;
+                if (obj instanceof Rp o) {
                     requestParameters.add(new RpsBuilder().setRp(o).build());
                     return State.RP_IN;
                 }
                 // fallthrough
             case ERROR_IN:
-                if (obj instanceof ErrorObject) {
-                    final ErrorObject o = (ErrorObject) obj;
+                if (obj instanceof ErrorObject o) {
                     errorObjects.add(new ErrorsBuilder().setErrorObject(o).build());
                     return State.ERROR_IN;
                 }
@@ -167,8 +163,7 @@ public class PCEPErrorMessageParser extends AbstractMessageParser {
                 }
                 // fallthrough
             case ERROR:
-                if (obj instanceof ErrorObject) {
-                    final ErrorObject o = (ErrorObject) obj;
+                if (obj instanceof ErrorObject o) {
                     errorObjects.add(new ErrorsBuilder().setErrorObject(o).build());
                     return State.ERROR;
                 }
index da1a64814317fcdb66e7f1f91f6b0e164828f40c..a335b2ccb61dd65237e99d81f1077f0cfd2954db 100644 (file)
@@ -7,15 +7,16 @@
  */
 package org.opendaylight.protocol.pcep.parser.message;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.KeepaliveBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.KeepaliveMessage;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message;
@@ -36,7 +37,7 @@ public class PCEPKeepAliveMessageParser extends AbstractMessageParser {
 
     @Override
     public void serializeMessage(final Message message, final ByteBuf out) {
-        Preconditions.checkArgument(message instanceof KeepaliveMessage,
+        checkArgument(message instanceof KeepaliveMessage,
                 "Wrong instance of Message. Passed instance of %s. Need KeepaliveMessage.", message.getClass());
         MessageUtil.formatMessage(TYPE, Unpooled.EMPTY_BUFFER, out);
     }
index 9be69652b0d652794b93488bf77f5bf7ca569a15..4c5a0d8cb525780ef1f8bd387a98a3ca2a9f0b20 100644 (file)
@@ -15,11 +15,11 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.parser.util.Util;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.Pcmonrep;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.PcmonrepBuilder;
index 9f6cad16d342d758344fd7121d8cb3f214ccae9d..e94fe6ce931167ff98fca6a04467432def951f63 100644 (file)
@@ -5,18 +5,19 @@
  * 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.pcep.parser.message;
 
+import static com.google.common.base.Preconditions.checkArgument;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
 import java.util.Optional;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.Pcmonreq;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.PcmonreqBuilder;
@@ -42,10 +43,10 @@ public class PCEPMonitoringRequestMessageParser extends PCEPRequestMessageParser
 
     @Override
     public void serializeMessage(final Message message, final ByteBuf out) {
-        Preconditions.checkArgument(message instanceof Pcmonreq,
+        checkArgument(message instanceof Pcmonreq,
                 "Wrong instance of Message. Passed instance of %s. Need Pcmonreq.", message.getClass());
         final PcreqMessage msg = ((Pcmonreq) message).getPcreqMessage();
-        Preconditions.checkArgument(msg.getMonitoringRequest() != null, "MONITORING object MUST be present.");
+        checkArgument(msg.getMonitoringRequest() != null, "MONITORING object MUST be present.");
         final ByteBuf buffer = Unpooled.buffer();
         serializeMonitoringRequest(msg.getMonitoringRequest(), buffer);
         if (msg.getSvec() != null) {
index eb0fe026a6b3807ac591ca2538664e0ce1d45802..fd0a47c7f197b8e0f1a2b5317fe9e566b79da62a 100644 (file)
@@ -15,10 +15,10 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.PcntfBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message;
@@ -68,8 +68,7 @@ public class PCEPNotificationMessageParser extends AbstractMessageParser {
             throw new PCEPDeserializerException("Notification message cannot be empty.");
         }
 
-        final List<Notifications> compositeNotifications = new ArrayList<>();
-
+        final var compositeNotifications = new ArrayList<Notifications>();
         while (!objects.isEmpty()) {
             final Notifications comObj = getValidNotificationComposite(objects, errors);
             if (comObj == null) {
@@ -121,8 +120,7 @@ public class PCEPNotificationMessageParser extends AbstractMessageParser {
                 .message.pcntf.message.notifications.Notifications> notifications) {
         switch (state) {
             case INIT:
-                if (obj instanceof Rp) {
-                    final Rp rp = (Rp) obj;
+                if (obj instanceof Rp rp) {
                     if (rp.getProcessingRule()) {
                         errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET, Optional.empty()));
                         return null;
@@ -132,8 +130,7 @@ public class PCEPNotificationMessageParser extends AbstractMessageParser {
                 }
                 // fallthrough
             case RP_IN:
-                if (obj instanceof CNotification) {
-                    final CNotification n = (CNotification) obj;
+                if (obj instanceof CNotification n) {
                     notifications.add(new NotificationsBuilder().setCNotification(n).build());
                     return State.RP_IN;
                 }
index 58eda092a6e10ea972e1c36271f2e4998bde11ff..2ea49d6dbb1e71668f9204baeaa12b8bbe223e17 100644 (file)
@@ -13,10 +13,10 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.OpenBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
index ca0751d2b5e2310a1c0c1629a3fa2ea724a2682e..4d018b5d2af4ce12ea9e8cf66926b526034e9893 100644 (file)
@@ -15,11 +15,11 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.parser.util.Util;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.Pcrep;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.PcrepBuilder;
@@ -153,7 +153,7 @@ public class PCEPReplyMessageParser extends AbstractMessageParser {
         }
         final List<Replies> replies = new ArrayList<>();
         while (!objects.isEmpty()) {
-            final Replies r = this.getValidReply(objects, errors);
+            final Replies r = getValidReply(objects, errors);
             if (r != null) {
                 replies.add(r);
             }
@@ -218,7 +218,7 @@ public class PCEPReplyMessageParser extends AbstractMessageParser {
     private Result handleNoPath(final NoPath noPath, final Queue<Object> objects) {
         final FailureCaseBuilder builder = new FailureCaseBuilder().setNoPath(noPath);
         for (Object obj = objects.peek(); obj != null && !(obj instanceof PceId); obj = objects.peek()) {
-            this.parseAttributes(builder, objects);
+            parseAttributes(builder, objects);
         }
         return builder.build();
     }
@@ -237,7 +237,7 @@ public class PCEPReplyMessageParser extends AbstractMessageParser {
             if (!vendorInfoObjects.isEmpty()) {
                 builder.setVendorInformationObject(vendorInfoObjects);
             }
-            this.parsePath(pBuilder, objects);
+            parsePath(pBuilder, objects);
             paths.add(pBuilder.build());
         }
         builder.setPaths(paths);
index 1dbbc65b7030e42b4a8a2aee37adc49a503f7007..4130b7037d63e7a37822b41e3b8648b5ed3a708b 100644 (file)
@@ -9,17 +9,16 @@ package org.opendaylight.protocol.pcep.parser.message;
 
 import static com.google.common.base.Preconditions.checkArgument;
 
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.Pcreq;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.PcreqBuilder;
@@ -218,7 +217,7 @@ public class PCEPRequestMessageParser extends AbstractMessageParser {
     @Override
     protected Message validate(final Queue<Object> objects, final List<Message> errors)
             throws PCEPDeserializerException {
-        Preconditions.checkArgument(objects != null, "Passed list can't be null.");
+        checkArgument(objects != null, "Passed list can't be null.");
         if (objects.isEmpty()) {
             throw new PCEPDeserializerException("Pcrep message cannot be empty.");
         }
@@ -431,8 +430,7 @@ public class PCEPRequestMessageParser extends AbstractMessageParser {
                 }
                 // fallthrough
             case OF_IN:
-                if (obj instanceof ClassType) {
-                    final ClassType classType = (ClassType) obj;
+                if (obj instanceof ClassType classType) {
                     if (!classType.getProcessingRule()) {
                         errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET, Optional.of(rp)));
                     } else {
index bca93cf46cd4cab8dc79deed723c4befef4c02bd..5b7d7504ebdedebd32d113213a7352dd5980f351 100644 (file)
@@ -7,15 +7,16 @@
  */
 package org.opendaylight.protocol.pcep.parser.message;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.StarttlsBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
@@ -33,7 +34,7 @@ public class PCEPStartTLSMessageParser extends AbstractMessageParser {
 
     @Override
     public void serializeMessage(final Message message, final ByteBuf out) {
-        Preconditions.checkArgument(message instanceof StartTlsMessage,
+        checkArgument(message instanceof StartTlsMessage,
                 "Wrong instance of Message. Passed instance of %s. Need StartTlsMessage.", message.getClass());
         MessageUtil.formatMessage(TYPE, Unpooled.EMPTY_BUFFER, out);
     }
index 93067c9beb0f090fcc6790abf2ef6db059faff1a..a9fa6e3090ccdd1d09a058b49fb95259969c822d 100644 (file)
@@ -7,17 +7,17 @@
  */
 package org.opendaylight.protocol.pcep.parser.object;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
 import java.util.ArrayList;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Values;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
 import org.slf4j.Logger;
@@ -38,7 +38,7 @@ public abstract class AbstractEROWithSubobjectsParser extends CommonObjectParser
 
     protected List<Subobject> parseSubobjects(final ByteBuf buffer) throws PCEPDeserializerException {
         // Explicit approval of empty ERO
-        Preconditions.checkArgument(buffer != null, "Array of bytes is mandatory. Can't be null.");
+        checkArgument(buffer != null, "Array of bytes is mandatory. Can't be null.");
         final List<Subobject> subs = new ArrayList<>();
         while (buffer.isReadable()) {
             final boolean loose = (buffer.getUnsignedByte(buffer.readerIndex()) & 1 << Values.FIRST_BIT_OFFSET) != 0;
@@ -49,7 +49,7 @@ public abstract class AbstractEROWithSubobjectsParser extends CommonObjectParser
                         "Wrong length specified. Passed: " + length + "; Expected: <= " + buffer.readableBytes());
             }
             LOG.debug("Attempt to parse subobject from bytes: {}", ByteBufUtil.hexDump(buffer));
-            final Subobject sub = this.subobjReg.parseSubobject(type, buffer.readSlice(length), loose);
+            final Subobject sub = subobjReg.parseSubobject(type, buffer.readSlice(length), loose);
             if (sub == null) {
                 LOG.warn("Parsing failed for subobject type: {}. Ignoring subobject.", type);
             } else {
@@ -63,7 +63,7 @@ public abstract class AbstractEROWithSubobjectsParser extends CommonObjectParser
     protected final void serializeSubobject(final List<Subobject> subobjects, final ByteBuf buffer) {
         if (subobjects != null) {
             for (final Subobject subobject : subobjects) {
-                this.subobjReg.serializeSubobject(subobject, buffer);
+                subobjReg.serializeSubobject(subobject, buffer);
             }
         }
     }
index e3ea391477b1d7984d51e227ef4211e005a1cc46..3ebcfc5c7e61ea3f9561eaa5ea3d9d96aa480609 100644 (file)
@@ -7,16 +7,16 @@
  */
 package org.opendaylight.protocol.pcep.parser.object;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
 import java.util.ArrayList;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.Subobject;
 import org.slf4j.Logger;
@@ -37,8 +37,7 @@ public abstract class AbstractRROWithSubobjectsParser extends CommonObjectParser
     }
 
     protected List<Subobject> parseSubobjects(final ByteBuf buffer) throws PCEPDeserializerException {
-        Preconditions.checkArgument(buffer != null && buffer.isReadable(),
-                "Array of bytes is mandatory. Can't be null or empty.");
+        checkArgument(buffer != null && buffer.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         final List<Subobject> subs = new ArrayList<>();
         while (buffer.isReadable()) {
             final int type = buffer.readUnsignedByte();
@@ -48,7 +47,7 @@ public abstract class AbstractRROWithSubobjectsParser extends CommonObjectParser
                         "Wrong length specified. Passed: " + length + "; Expected: <= " + buffer.readableBytes());
             }
             LOG.debug("Attempt to parse subobject from bytes: {}", ByteBufUtil.hexDump(buffer));
-            final Subobject sub = this.subobjReg.parseSubobject(type, buffer.readSlice(length));
+            final Subobject sub = subobjReg.parseSubobject(type, buffer.readSlice(length));
             if (sub == null) {
                 LOG.warn("Parsing failed for subobject type: {}. Ignoring subobject.", type);
             } else {
@@ -60,10 +59,9 @@ public abstract class AbstractRROWithSubobjectsParser extends CommonObjectParser
     }
 
     protected final void serializeSubobject(final List<Subobject> subobjects, final ByteBuf buffer) {
-        Preconditions.checkArgument(subobjects != null && !subobjects.isEmpty(),
-                "RRO must contain at least one subobject.");
+        checkArgument(subobjects != null && !subobjects.isEmpty(), "RRO must contain at least one subobject.");
         for (final Subobject subobject : subobjects) {
-            this.subobjReg.serializeSubobject(subobject, buffer);
+            subobjReg.serializeSubobject(subobject, buffer);
         }
     }
 }
index 6933b2b1a3f046b2f7bd16a7e6783e8b3188f39d..14ee35c29f8ddba6f86d1c74c1912c64912d3427 100644 (file)
@@ -13,11 +13,11 @@ import static org.opendaylight.protocol.pcep.spi.VendorInformationUtil.VENDOR_IN
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.EnterpriseSpecificInformationParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
index 6294070cfd7149416482055d654142d8224dbc22..77279f0b3416a50fa316a4ae5014bacfde2bb216 100644 (file)
@@ -7,17 +7,17 @@
  */
 package org.opendaylight.protocol.pcep.parser.object;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.base.Preconditions;
 import com.google.common.primitives.UnsignedBytes;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
 import java.util.ArrayList;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectRegistry;
 import org.opendaylight.protocol.util.Values;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.exclude.route.object.xro.Subobject;
@@ -39,8 +39,7 @@ public abstract class AbstractXROWithSubobjectsParser extends CommonObjectParser
     }
 
     protected List<Subobject> parseSubobjects(final ByteBuf buffer) throws PCEPDeserializerException {
-        Preconditions.checkArgument(buffer != null && buffer.isReadable(),
-            "Array of bytes is mandatory. Can't be null or empty.");
+        checkArgument(buffer != null && buffer.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         final List<Subobject> subs = new ArrayList<>();
         while (buffer.isReadable()) {
             final boolean mandatory =
@@ -53,7 +52,7 @@ public abstract class AbstractXROWithSubobjectsParser extends CommonObjectParser
                         + buffer.readableBytes());
             }
             LOG.debug("Attempt to parse subobject from bytes: {}", ByteBufUtil.hexDump(buffer));
-            final Subobject sub = this.subobjReg.parseSubobject(type, buffer.readSlice(length), mandatory);
+            final Subobject sub = subobjReg.parseSubobject(type, buffer.readSlice(length), mandatory);
             if (sub == null) {
                 LOG.warn("Parsing failed for subobject type: {}. Ignoring subobject.", type);
             } else {
@@ -65,10 +64,9 @@ public abstract class AbstractXROWithSubobjectsParser extends CommonObjectParser
     }
 
     protected final void serializeSubobject(final List<Subobject> subobjects, final ByteBuf buffer) {
-        Preconditions.checkArgument(subobjects != null && !subobjects.isEmpty(),
-            "XRO must contain at least one subobject.");
+        checkArgument(subobjects != null && !subobjects.isEmpty(), "XRO must contain at least one subobject.");
         for (final Subobject subobject : subobjects) {
-            this.subobjReg.serializeSubobject(subobject, buffer);
+            subobjReg.serializeSubobject(subobject, buffer);
         }
     }
 }
index 13ed96c34df47283ea13233e7a89b41c65af643a..95490d6ca17ec0397536ddd17d5b64b7080f7bc6 100644 (file)
@@ -12,10 +12,10 @@ import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeFloat32;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.bandwidth.object.Bandwidth;
index cd9f9d46121330f65bbdbe8e5c7e987cd6d50b9d..62bdf0ac8093a83750fd024bd8008edd6b740df3 100644 (file)
@@ -11,10 +11,10 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
index ef19b084c13fc4186659b599b783843343234c37..11928a2dceb4bbab24169775b89d9aacec381526 100644 (file)
@@ -12,9 +12,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
index 72baf064e18963229e1fcfb387591999cf6b281f..7a4a2c5a5c1cbe6124e03f9f17aecdf3a5ee220e 100644 (file)
@@ -12,9 +12,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
index 2e1a2e52d56719be5f2b1ed3caec9b089dd86308..d3fff5e5aa810ea2ee6aa4548c739a1ff4edc623 100644 (file)
@@ -11,8 +11,8 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
index 3ba6b39fc9c4d014e02459792399b46a2a33925e..abff1a3994cb09e5ced0ff3ebbe802d4eef826f1 100644 (file)
@@ -7,15 +7,15 @@
  */
 package org.opendaylight.protocol.pcep.parser.object;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeFloat32;
 
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reoptimization.bandwidth.object.ReoptimizationBandwidth;
@@ -37,8 +37,7 @@ public class PCEPExistingBandwidthObjectParser extends CommonObjectParser implem
     @Override
     public ReoptimizationBandwidth parseObject(final ObjectHeader header, final ByteBuf bytes)
             throws PCEPDeserializerException {
-        Preconditions.checkArgument(bytes != null && bytes.isReadable(),
-                "Array of bytes is mandatory. Can't be null or empty.");
+        checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         if (bytes.readableBytes() != PCEPBandwidthObjectParser.BANDWIDTH_F_LENGTH) {
             throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + bytes.readableBytes()
                     + "; Expected: " + PCEPBandwidthObjectParser.BANDWIDTH_F_LENGTH + ".");
@@ -56,7 +55,7 @@ public class PCEPExistingBandwidthObjectParser extends CommonObjectParser implem
     public void serializeObject(
             final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object object,
             final ByteBuf buffer) {
-        Preconditions.checkArgument(object instanceof ReoptimizationBandwidth,
+        checkArgument(object instanceof ReoptimizationBandwidth,
                 "Wrong instance of PCEPObject. Passed " + "%s. Needed ReoptimizationBandwidthObject.",
                 object.getClass());
         final ByteBuf body = Unpooled.buffer();
index 89e8be945a89e45b9694d95c950b868c348cad97..f424fa230ef6977e98429628a15e8b3ace34d9d4 100644 (file)
@@ -10,9 +10,9 @@ package org.opendaylight.protocol.pcep.parser.object;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.Ero;
index ebe0428caa79d924f834c9a631d9461c6653dbfc..455176c3b868e5b758e7d2d4420dbe2aa8517bd4 100644 (file)
@@ -12,9 +12,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
index 896d89d20dbc1066a15785f9340f4e8a5892f41c..611c80a03de97eaffd3dedd30637026d3d941aa2 100644 (file)
@@ -7,14 +7,15 @@
  */
 package org.opendaylight.protocol.pcep.parser.object;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.include.route.object.Iro;
@@ -36,8 +37,7 @@ public final class PCEPIncludeRouteObjectParser extends AbstractEROWithSubobject
 
     @Override
     public Iro parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
-        Preconditions.checkArgument(bytes != null && bytes.isReadable(),
-            "Array of bytes is mandatory. Can't be null or empty.");
+        checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         final List<Subobject> subs = new ArrayList<>();
         for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit
                 .route.object.ero.Subobject s : parseSubobjects(bytes)) {
@@ -55,8 +55,8 @@ public final class PCEPIncludeRouteObjectParser extends AbstractEROWithSubobject
 
     @Override
     public void serializeObject(final Object object, final ByteBuf buffer) {
-        Preconditions.checkArgument(object instanceof Iro,
-            "Wrong instance of PCEPObject. Passed %s. Needed IroObject.", object.getClass());
+        checkArgument(object instanceof Iro, "Wrong instance of PCEPObject. Passed %s. Needed IroObject.",
+            object.getClass());
         final Iro iro = (Iro) object;
         final ByteBuf body = Unpooled.buffer();
         final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit
index ffdd4d90172e6210ad47f1742c70b54c5c8f70d1..74cfc7e910d9bb2ccb4e8d34752725a4977f787e 100644 (file)
@@ -12,10 +12,10 @@ import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeFloat32;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.network.concepts.rev131125.Bandwidth;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
index 113ef8e81ffc90f37b3b7e2267c4708aab51d9c4..f02fc09df11ad866822bf1cbc52c1ea283cf9775 100644 (file)
@@ -12,9 +12,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.protocol.util.BitArray;
index 58aa8ad4feb25a78e74705e2e2068c68f581d124..dbef883849660b97d31e6adac43ce174079169c9 100644 (file)
@@ -12,10 +12,10 @@ import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeFloat32;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.BitArray;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ieee754.rev130819.Float32;
index ba90900050ba8f0c163f8db15856d17f3c48317d..524e99c489d832db039e853f3b53b4a58880047a 100644 (file)
@@ -12,9 +12,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.protocol.util.BitArray;
index fb5355082c6c976621116f5eac926d19a72fa4c0..9fb954c5a2757acf15dc5abe6e7753cc2435df64 100644 (file)
@@ -12,9 +12,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.protocol.util.BitArray;
index 2d504107837072a54fa8cf99a03d57a5d5572c58..971a494058bfa2bad4ab3662f73cc4a786523624 100644 (file)
@@ -12,9 +12,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
index c839761343de75e34296d4073948c4cc996e4434..c6eb59dd245ed4ecfb8ef75219834815166c9a5a 100644 (file)
@@ -12,9 +12,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
index 0f282cbef4150de3b6cd3a2f2d82fb856024f537..9df8dd202739d822340b813635b81aa7d32ac659 100644 (file)
@@ -12,9 +12,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
index 6415a0b38de9929e059c9c263a552eac23508ce8..1e1e580d6ad68d2d536de228c9009b950b7b3fb7 100644 (file)
@@ -11,10 +11,10 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.overload.object.Overload;
index b7561fdef9f5593791ffb352829014e26095ec3a..2547d90492c5305159db21e429d7f4e14133a23b 100644 (file)
@@ -7,14 +7,15 @@
  */
 package org.opendaylight.protocol.pcep.parser.object;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
@@ -39,8 +40,7 @@ public final class PCEPPathKeyObjectParser extends AbstractEROWithSubobjectsPars
 
     @Override
     public PathKey parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
-        Preconditions.checkArgument(bytes != null && bytes.isReadable(),
-            "Array of bytes is mandatory. Can't be null or empty.");
+        checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         final List<PathKeys> pk = new ArrayList<>();
         final List<Subobject> subs = parseSubobjects(bytes);
         for (final Subobject sub : subs) {
@@ -57,8 +57,8 @@ public final class PCEPPathKeyObjectParser extends AbstractEROWithSubobjectsPars
 
     @Override
     public void serializeObject(final Object object, final ByteBuf buffer) {
-        Preconditions.checkArgument(object instanceof PathKey,
-            "Wrong instance of PCEPObject. Passed %s. Needed PathKeyObject.", object.getClass());
+        checkArgument(object instanceof PathKey, "Wrong instance of PCEPObject. Passed %s. Needed PathKeyObject.",
+            object.getClass());
         final PathKey pkey = (PathKey) object;
         final ByteBuf body = Unpooled.buffer();
         final List<Subobject> subs = new ArrayList<>();
index 873180d0cc37ea763891e30c08637d3e61a74918..8025a56a118d8504a5063007310b49c06ace3d0b 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.protocol.pcep.parser.object;
 import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Ipv4Util;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
index 9d787c05960069684aa4863350e58eea740cd200..2f354f8d12df22d85ed621d236687074d6011448 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.protocol.pcep.parser.object;
 import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Ipv6Util;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
index 3fd2fcafa304ca0472f1623df5e441b09b6828ed..9deac483f10c4dfbb631d74eb88af1cf400d7e85 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.protocol.pcep.parser.object;
 import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Ipv4Util;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
index a36a72f58f767c8aa4740e094dbc60a8ac3dfc1d..f30dfaaa1020b503cf402eb525ab1d8b9bff845b 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.protocol.pcep.parser.object;
 import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Ipv6Util;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
index e8da9c76e0e12b70d00c2a4d561261dd5e814db4..963ffc24a01b3802f3d5f37610919d42cc9a23f9 100644 (file)
@@ -11,10 +11,10 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.BitArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
index 01aee5a255ab5c10327f3f44cebf194bc05a60e3..e699b84ecfc33933a0fcbc5e6ef8c420b60700b8 100644 (file)
@@ -7,11 +7,12 @@
  */
 package org.opendaylight.protocol.pcep.parser.object;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
@@ -31,8 +32,7 @@ public final class PCEPReportedRouteObjectParser extends AbstractRROWithSubobjec
 
     @Override
     public Rro parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException {
-        Preconditions.checkArgument(bytes != null && bytes.isReadable(),
-            "Array of bytes is mandatory. Can't be null or empty.");
+        checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         return new RroBuilder()
                 .setIgnore(header.getIgnore())
                 .setProcessingRule(header.getProcessingRule())
@@ -42,8 +42,8 @@ public final class PCEPReportedRouteObjectParser extends AbstractRROWithSubobjec
 
     @Override
     public void serializeObject(final Object object, final ByteBuf buffer) {
-        Preconditions.checkArgument(object instanceof Rro,
-            "Wrong instance of PCEPObject. Passed %s. Needed RroObject.", object.getClass());
+        checkArgument(object instanceof Rro, "Wrong instance of PCEPObject. Passed %s. Needed RroObject.",
+            object.getClass());
         final Rro obj = (Rro) object;
         final ByteBuf body = Unpooled.buffer();
         serializeSubobject(obj.getSubobject(), body);
index 7eefa33e6c2e366c15078b54881a6c200d4c2883..f451b8b996973358cf0abae08ad0469a74511197 100644 (file)
@@ -12,9 +12,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.protocol.util.BitArray;
index 7b2a0c3e5587a6cfc7408001b045ab398895ae9a..abd791ca57cfaf79c06c4a152b5137ce8d24ca25 100644 (file)
@@ -5,17 +5,17 @@
  * 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.pcep.parser.object;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
 import java.util.stream.Collectors;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
@@ -34,7 +34,7 @@ public final class PCEPSecondaryExplicitRouteObjecParser extends AbstractEROWith
 
     @Override
     public Sero parseObject(final ObjectHeader header, final ByteBuf buffer) throws PCEPDeserializerException {
-        Preconditions.checkArgument(buffer != null && buffer.isReadable(), EMPTY_ARRAY_ERROR);
+        checkArgument(buffer != null && buffer.isReadable(), EMPTY_ARRAY_ERROR);
 
         final SeroBuilder builder = new SeroBuilder();
         builder.setIgnore(header.getIgnore());
@@ -50,7 +50,7 @@ public final class PCEPSecondaryExplicitRouteObjecParser extends AbstractEROWith
 
     @Override
     public void serializeObject(final Object object, final ByteBuf buffer) {
-        Preconditions.checkArgument(object instanceof Sero,
+        checkArgument(object instanceof Sero,
             "Wrong instance of PCEPObject. Passed %s. Needed EroObject.", object.getClass());
         final Sero sero = (Sero) object;
         final ByteBuf body = Unpooled.buffer();
index e7d521a046ea7f854ad10b8cadf2b02abaf23c18..9628bb4ba12017eb55b744bb30039230ebd486ae 100644 (file)
@@ -5,16 +5,16 @@
  * 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.pcep.parser.object;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
 import java.util.stream.Collectors;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
@@ -34,7 +34,7 @@ public final class PCEPSecondaryRecordRouteObjectParser extends AbstractRROWithS
 
     @Override
     public Srro parseObject(final ObjectHeader header, final ByteBuf buffer) throws PCEPDeserializerException {
-        Preconditions.checkArgument(buffer != null && buffer.isReadable(), EMPTY_ARRAY_ERROR);
+        checkArgument(buffer != null && buffer.isReadable(), EMPTY_ARRAY_ERROR);
 
         final SrroBuilder builder = new SrroBuilder();
         builder.setIgnore(header.getIgnore());
@@ -54,7 +54,7 @@ public final class PCEPSecondaryRecordRouteObjectParser extends AbstractRROWithS
 
     @Override
     public void serializeObject(final Object object, final ByteBuf buffer) {
-        Preconditions.checkArgument(object instanceof Srro,
+        checkArgument(object instanceof Srro,
             "Wrong instance of PCEPObject. Passed %s. Needed EroObject.", object.getClass());
         final Srro sero = (Srro) object;
         final ByteBuf body = Unpooled.buffer();
index 6194ebfb698877bc509a643120993118946ef8c6..6216cd41af589f45a18ca419224a59805ce1a813 100644 (file)
@@ -13,10 +13,10 @@ import com.google.common.collect.ImmutableSet;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.Set;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.BitArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
index 0bc2280446ca2da6411e9d3f8b0fd8418df3ce7e..19b72c8a2eed568a5720ec741427588a82e37949 100644 (file)
@@ -7,13 +7,14 @@
  */
 package org.opendaylight.protocol.pcep.parser.object.bnc;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.parser.object.AbstractEROWithSubobjectsParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.branch.node.object.BranchNodeList;
@@ -30,9 +31,8 @@ public final class BranchNodeListObjectParser extends AbstractEROWithSubobjectsP
 
     @Override
     public BranchNodeList parseObject(final ObjectHeader header, final ByteBuf bytes)
-        throws PCEPDeserializerException {
-        Preconditions.checkArgument(bytes != null && bytes.isReadable(),
-            "Array of bytes is mandatory. Can't be null or empty.");
+            throws PCEPDeserializerException {
+        checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         return new BranchNodeListBuilder()
             .setIgnore(header.getIgnore())
             .setProcessingRule(header.getProcessingRule())
@@ -42,7 +42,7 @@ public final class BranchNodeListObjectParser extends AbstractEROWithSubobjectsP
 
     @Override
     public void serializeObject(final Object object, final ByteBuf buffer) {
-        Preconditions.checkArgument(object instanceof BranchNodeList,
+        checkArgument(object instanceof BranchNodeList,
             "Wrong instance of PCEPObject. Passed %s. Needed BranchNodeList.", object.getClass());
         final BranchNodeList nbnc = (BranchNodeList) object;
         final ByteBuf body = Unpooled.buffer();
index fd3609c35cb94c711ee1f0440850b343861ef4b7..e3c3731879142dc8e889e18c512b9e241f7147d0 100644 (file)
@@ -7,13 +7,14 @@
  */
 package org.opendaylight.protocol.pcep.parser.object.bnc;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.parser.object.AbstractEROWithSubobjectsParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.non.branch.node.object.NonBranchNodeList;
@@ -29,9 +30,8 @@ public final class NonBranchNodeListObjectParser extends AbstractEROWithSubobjec
 
     @Override
     public NonBranchNodeList parseObject(final ObjectHeader header, final ByteBuf bytes)
-        throws PCEPDeserializerException {
-        Preconditions.checkArgument(bytes != null && bytes.isReadable(),
-            "Array of bytes is mandatory. Can't be null or empty.");
+            throws PCEPDeserializerException {
+        checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         return new NonBranchNodeListBuilder()
             .setIgnore(header.getIgnore())
             .setProcessingRule(header.getProcessingRule())
@@ -41,7 +41,7 @@ public final class NonBranchNodeListObjectParser extends AbstractEROWithSubobjec
 
     @Override
     public void serializeObject(final Object object, final ByteBuf buffer) {
-        Preconditions.checkArgument(object instanceof NonBranchNodeList,
+        checkArgument(object instanceof NonBranchNodeList,
             "Wrong instance of PCEPObject. Passed %s. Needed NonBranchNodeList.", object.getClass());
         final NonBranchNodeList nbnc = (NonBranchNodeList) object;
         final ByteBuf body = Unpooled.buffer();
index b54b9059ad3fba6e9dbe0ae9a14b499fad27578a..4b5057607e84c7df33a850942d5029604918706b 100644 (file)
@@ -11,9 +11,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
 import org.opendaylight.protocol.util.Ipv4Util;
index 7c907738665a8fa81c6af89bbc89de8ede4484f2..747a8b0d725fb17e91fc2dd3acb1eadf2b989b00 100644 (file)
@@ -11,9 +11,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
 import org.opendaylight.protocol.util.Ipv6Util;
index baf337fe2e9c8b7d52b913ac9c821bc1a267fe75..6a57ef8c6c7cb8651852177f75b3dc5199209dac 100644 (file)
@@ -13,9 +13,9 @@ import com.google.common.collect.ImmutableSet;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.Set;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
 import org.opendaylight.protocol.util.Ipv4Util;
index 8ccf1a36ad665c5c8c2940cae63281155d88c308..f54a85edd96f34d8935c03aeadd8151c535e4b18 100644 (file)
@@ -13,9 +13,9 @@ import com.google.common.collect.ImmutableSet;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.Set;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
 import org.opendaylight.protocol.util.Ipv6Util;
index dd2d7574508cdfd56976a864595c148d20f27191..a8dc9c1d2d09992da328fca8e355207c63979e58 100644 (file)
@@ -13,9 +13,9 @@ import com.google.common.collect.ImmutableSet;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.Set;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Ipv4Util;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
@@ -46,7 +46,7 @@ public final class PCEPIpv4UnreachDestinationParser extends CommonObjectParser {
 
     @Override
     public UnreachDestinationObj parseObject(final ObjectHeader header, final ByteBuf bytes)
-        throws PCEPDeserializerException {
+            throws PCEPDeserializerException {
         checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         if (bytes.readableBytes() % Ipv4Util.IP4_LENGTH != 0) {
             throw new PCEPDeserializerException("Wrong length of array of bytes.");
index c7bfaac238fe55446cc76147c96d12ec7fedfbd1..80b028349b20b419919dda39a7fb8bb71f831ee1 100644 (file)
@@ -13,9 +13,9 @@ import com.google.common.collect.ImmutableSet;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.Set;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.CommonObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Ipv6Util;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv6AddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
index 336ae5e0d070de2dda66b69d7b6ef9bc2ce4ba0c..293bf27c7bd4528de98c3050b9485de95c3d3579 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AsNumberSubobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase;
index bcdc5d38f969cdffa6929487b5cf6af258a9dff5..2b2dcff1b16cc912554f9924e3b8d03d5227127a 100644 (file)
@@ -7,12 +7,13 @@
  */
 package org.opendaylight.protocol.pcep.parser.subobject;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.SubobjectBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase;
@@ -32,7 +33,7 @@ public class EROAsNumberSubobjectParser implements EROSubobjectParser, EROSubobj
 
     @Override
     public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
-        Preconditions.checkArgument(subobject.getSubobjectType() instanceof AsNumberCase,
+        checkArgument(subobject.getSubobjectType() instanceof AsNumberCase,
                 "Unknown subobject instance. Passed %s. Needed AsNumberCase.", subobject.getSubobjectType().getClass());
         final ByteBuf body = AsNumberCaseParser.serializeSubobject((AsNumberCase) subobject.getSubobjectType());
         EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
index 87b9fc26ddbda0bd3a1dc5f7f646650514a3999a..325e92f74f021d7bbe0f0ee9430f4aefe4371e0e 100644 (file)
@@ -7,15 +7,16 @@
  */
 package org.opendaylight.protocol.pcep.parser.subobject;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectRegistry;
 import org.opendaylight.protocol.util.Values;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
@@ -39,8 +40,7 @@ public class EROExplicitExclusionRouteSubobjectParser implements EROSubobjectPar
 
     @Override
     public Subobject parseSubobject(final ByteBuf buffer, final boolean loose) throws PCEPDeserializerException {
-        Preconditions.checkArgument(buffer != null && buffer.isReadable(),
-                "Array of bytes is mandatory. Can't be null or empty.");
+        checkArgument(buffer != null && buffer.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.exclude
             .route.object.xro.Subobject> xros = parseSubobject(buffer);
         final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.explicit
@@ -64,7 +64,7 @@ public class EROExplicitExclusionRouteSubobjectParser implements EROSubobjectPar
 
     private List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.exclude
         .route.object.xro.Subobject> parseSubobject(final ByteBuf buffer) throws PCEPDeserializerException {
-        Preconditions.checkArgument(buffer != null && buffer.isReadable(),
+        checkArgument(buffer != null && buffer.isReadable(),
                 "Array of bytes is mandatory. Can't be null or empty.");
         final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.exclude
             .route.object.xro.Subobject> xros = new ArrayList<>();
@@ -78,14 +78,14 @@ public class EROExplicitExclusionRouteSubobjectParser implements EROSubobjectPar
                 throw new PCEPDeserializerException("Wrong length specified. Passed: " + length + "; Expected: <= "
                         + buffer.readableBytes());
             }
-            xros.add(this.registry.parseSubobject(type, buffer.readSlice(length), mandatory));
+            xros.add(registry.parseSubobject(type, buffer.readSlice(length), mandatory));
         }
         return xros;
     }
 
     @Override
     public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
-        Preconditions.checkArgument(subobject.getSubobjectType() instanceof ExrsCase,
+        checkArgument(subobject.getSubobjectType() instanceof ExrsCase,
                 "Unknown subobject instance. Passed %s. Needed Exrs.", subobject.getSubobjectType().getClass());
         final Exrs exrs = ((ExrsCase) subobject.getSubobjectType()).getExrs();
         final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.exclude
@@ -111,7 +111,7 @@ public class EROExplicitExclusionRouteSubobjectParser implements EROSubobjectPar
                 .route.object.xro.Subobject> subobjects, final ByteBuf body) {
         for (final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.exclude
                 .route.object.xro.Subobject subobject : subobjects) {
-            this.registry.serializeSubobject(subobject, body);
+            registry.serializeSubobject(subobject, body);
         }
     }
 }
index 279e666284d78b05a585e60afe95c617104af930..24e0988b817df60893d2b70b166f8178b78a1750 100644 (file)
@@ -11,10 +11,10 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.protocol.util.Ipv4Util;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
index 9e775c905eef911a2bbdff33e0c78829c8f6e871..e47247339d9b6a3e0dfa476d99b99ebb6119e5a1 100644 (file)
@@ -11,10 +11,10 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.protocol.util.Ipv6Util;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpPrefix;
index c75fa148557eb2cfee186a06bcc90a7a54ced36e..865ce54c613080f35fa467dc076d2a1b5ac32016 100644 (file)
@@ -12,11 +12,11 @@ import static java.util.Objects.requireNonNull;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectUtil;
 import org.opendaylight.protocol.pcep.spi.LabelRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.BitArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.SubobjectBuilder;
@@ -46,7 +46,7 @@ public class EROLabelSubobjectParser implements EROSubobjectParser, EROSubobject
     private final LabelRegistry registry;
 
     public EROLabelSubobjectParser(final LabelRegistry labelReg) {
-        this.registry = requireNonNull(labelReg);
+        registry = requireNonNull(labelReg);
     }
 
     @Override
@@ -60,7 +60,7 @@ public class EROLabelSubobjectParser implements EROSubobjectParser, EROSubobject
         final BitArray reserved = BitArray.valueOf(buffer, FLAGS_SIZE);
         final short cType = buffer.readUnsignedByte();
 
-        final LabelType labelType = this.registry.parseLabel(cType, buffer.slice());
+        final LabelType labelType = registry.parseLabel(cType, buffer.slice());
         if (labelType == null) {
             LOG.warn("Ignoring ERO label subobject with unknown C-TYPE: {}", cType);
             return null;
@@ -81,7 +81,7 @@ public class EROLabelSubobjectParser implements EROSubobjectParser, EROSubobject
                 "Unknown subobject instance. Passed %s. Needed LabelCase.", subobject.getSubobjectType().getClass());
         final Label label = ((LabelCase) subobject.getSubobjectType()).getLabel();
         final ByteBuf body = Unpooled.buffer();
-        this.registry.serializeLabel(label.getUniDirectional(), false, label.getLabelType(), body);
+        registry.serializeLabel(label.getUniDirectional(), false, label.getLabelType(), body);
         EROSubobjectUtil.formatSubobject(TYPE, subobject.getLoose(), body, buffer);
     }
 }
index db11074f7db785576e268a4780d4681bda7006a2..ee4adf4cf6f6868034f1d408f222859b12628e08 100644 (file)
@@ -8,8 +8,8 @@
 package org.opendaylight.protocol.pcep.parser.subobject;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractEROPathKeySubobjectParser;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 
 public final class EROPathKey128SubobjectParser extends AbstractEROPathKeySubobjectParser {
index fda2a5736aacbd30ba71705a0fb974cdf0b860ba..5c208603085bdd430791d19940a349fabeb4b730 100644 (file)
@@ -8,8 +8,8 @@
 package org.opendaylight.protocol.pcep.parser.subobject;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractEROPathKeySubobjectParser;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 
 public final class EROPathKey32SubobjectParser extends AbstractEROPathKeySubobjectParser {
index bc9a0e022cc2d877179f8128661aaff98e7410d9..8d60c66268f00f9f8464ab03fec561273f26bb50 100644 (file)
@@ -11,10 +11,10 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.SubobjectBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.UnnumberedSubobject;
index 715e1ca2cf42cde614aeb0b9cc8a667d845e37cf..55fc017fdd2783c69828c3a4cbc58944d7507ea9 100644 (file)
@@ -7,13 +7,15 @@
  */
 package org.opendaylight.protocol.pcep.parser.subobject;
 
+import static com.google.common.base.Preconditions.checkArgument;
+
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.LabelParser;
 import org.opendaylight.protocol.pcep.spi.LabelSerializer;
 import org.opendaylight.protocol.pcep.spi.LabelUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.LabelType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.GeneralizedLabelCase;
@@ -30,8 +32,7 @@ public class GeneralizedLabelParser implements LabelParser, LabelSerializer {
 
     @Override
     public LabelType parseLabel(final ByteBuf buffer) throws PCEPDeserializerException {
-        Preconditions.checkArgument(buffer != null && buffer.isReadable(),
-                "Array of bytes is mandatory. Can't be null or empty.");
+        checkArgument(buffer != null && buffer.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         return new GeneralizedLabelCaseBuilder()
                 .setGeneralizedLabel(
                         new GeneralizedLabelBuilder().setGeneralizedLabel(ByteArray.readAllBytes(buffer)).build())
@@ -41,7 +42,7 @@ public class GeneralizedLabelParser implements LabelParser, LabelSerializer {
     @Override
     public void serializeLabel(final boolean unidirectional, final boolean global, final LabelType subobject,
             final ByteBuf buffer) {
-        Preconditions.checkArgument(subobject instanceof GeneralizedLabelCase,
+        checkArgument(subobject instanceof GeneralizedLabelCase,
                 "Unknown Label Subobject instance. Passed {}. Needed GeneralizedLabelCase.", subobject.getClass());
         final GeneralizedLabel gl = ((GeneralizedLabelCase) subobject).getGeneralizedLabel();
         Preconditions.checkArgument(gl != null, "GeneralizedLabel is mandatory.");
index 0b8e04c2499032a0c963c4b9fdd7cb93a7c15d5c..ec52978b344850ed8b680301d53426669a17d500 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectUtil;
index e96075f2cf7d4e303417c65e3e9c0c1db3f4dfc9..e377046b21149544ca5194ceb619e965971a0b1f 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectUtil;
index cd30750d9a622065741c6062bb1be9f5e0d6a3e5..00150ed2fa48ea556732a9de4e2e74133708f810 100644 (file)
@@ -7,13 +7,13 @@
  */
 package org.opendaylight.protocol.pcep.parser.subobject;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.LabelRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectUtil;
@@ -47,13 +47,12 @@ public class RROLabelSubobjectParser implements RROSubobjectParser, RROSubobject
     private final LabelRegistry registry;
 
     public RROLabelSubobjectParser(final LabelRegistry labelReg) {
-        this.registry = requireNonNull(labelReg);
+        registry = requireNonNull(labelReg);
     }
 
     @Override
     public Subobject parseSubobject(final ByteBuf buffer) throws PCEPDeserializerException {
-        Preconditions.checkArgument(buffer != null && buffer.isReadable(),
-                "Array of bytes is mandatory. Can't be null or empty.");
+        checkArgument(buffer != null && buffer.isReadable(), "Array of bytes is mandatory. Can't be null or empty.");
         if (buffer.readableBytes() < HEADER_LENGTH) {
             throw new PCEPDeserializerException("Wrong length of array of bytes. Passed: " + buffer.readableBytes()
                     + "; Expected: >" + HEADER_LENGTH + ".");
@@ -62,7 +61,7 @@ public class RROLabelSubobjectParser implements RROSubobjectParser, RROSubobject
 
         final short cType = buffer.readUnsignedByte();
 
-        final LabelType labelType = this.registry.parseLabel(cType, buffer.slice());
+        final LabelType labelType = registry.parseLabel(cType, buffer.slice());
         if (labelType == null) {
             LOG.warn("Ignoring RRO label subobject with unknown C-TYPE: {}", cType);
             return null;
@@ -82,7 +81,7 @@ public class RROLabelSubobjectParser implements RROSubobjectParser, RROSubobject
         requireNonNull(subobject.getSubobjectType(), "Subobject type cannot be empty.");
         final Label label = ((LabelCase) subobject.getSubobjectType()).getLabel();
         final ByteBuf body = Unpooled.buffer();
-        this.registry.serializeLabel(label.getUniDirectional(), label.getGlobal(), label.getLabelType(), body);
+        registry.serializeLabel(label.getUniDirectional(), label.getGlobal(), label.getLabelType(), body);
         RROSubobjectUtil.formatSubobject(TYPE, body, buffer);
     }
 }
index 7ad5315f16273819b5b556e501744d1640b49709..e03cf4692691afe4300d96f910f267fb566cc205 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectUtil;
 import org.opendaylight.protocol.util.ByteArray;
index 4e9e5a4af63dec28e32a3385ea253ab7dbc36545..75d3a68fd2b440bb0b13dc80071b18f3873a6457 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectUtil;
index a819439f9c10f856ef27c3200eef9a4cb62af20e..bb082d363522d8b3268682f2fb6b6131d9cb83e6 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectUtil;
index 30e77e49388358afce108b6a38195986850d1a42..fa76dc78ed4d884b4277021f3a4db4dfced5d297 100644 (file)
@@ -11,10 +11,10 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.LabelParser;
 import org.opendaylight.protocol.pcep.spi.LabelSerializer;
 import org.opendaylight.protocol.pcep.spi.LabelUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.LabelType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.Type1LabelCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.Type1LabelCaseBuilder;
index 7a1f2acd806e7f12ad8e0008ae2a2ed84697fa36..f4e9b56726d93fe579de3d5cd35a2e20e3146d83 100644 (file)
@@ -11,10 +11,10 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.LabelParser;
 import org.opendaylight.protocol.pcep.spi.LabelSerializer;
 import org.opendaylight.protocol.pcep.spi.LabelUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.LabelType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.WavebandSwitchingLabelCase;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.WavebandSwitchingLabelCaseBuilder;
index b6e333fa5ff22af522814707247627c950233cc2..a1bc99ff0e99e3452d6318b09af03d995eb776b1 100644 (file)
@@ -9,7 +9,7 @@ package org.opendaylight.protocol.pcep.parser.subobject;
 
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectUtil;
index 911c0810dc3d77e3a51d4c40b3ca0797194fc6dd..35ea6e52beacbb330fca73edd2c7ff71e1ade5f7 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectUtil;
index 856f72f8f389aacb889d9bae6f58b8e063df1824..0ba1a7584eb4af535ddc6078b6edef84abd31a7a 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectUtil;
index 5d4a792860bb10dbc7fcb1c76b26999491e02512..bdad36831bc1d4a161d25a1f910dba3a85362547 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectUtil;
 import org.opendaylight.protocol.util.ByteArray;
index d751a9ffdacdfc428aa88dc3d27dcab37a8c658b..52cef8a7b49d7c7f01ecb9fc6e1744418d858541 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectUtil;
index 52eba0323d5faaf319085e0cc4ab9c9fc3e581e1..0663339932de2a9dfba03534a73b768934c8dd70 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectUtil;
index 4757202db428a815e8d408dd85ee24bb3e262d62..95482de8082e3ff9ccd715a2de7bd3afdea982ad 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectUtil;
index 7580afc72a69f3f1feb74a7d46aa8fdfdab0edd0..815dd679fd43c85860cfcfdfed0c336aa63b6269 100644 (file)
@@ -12,8 +12,8 @@ import static org.opendaylight.protocol.pcep.spi.VendorInformationUtil.VENDOR_IN
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EnterpriseSpecificInformationParser;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 909a61641b6c30a285ade44d3a8e3ae396223e14..c59b9ded51ca1071b7c5729ae155afc4ba7cbdcd 100644 (file)
@@ -7,10 +7,11 @@
  */
 package org.opendaylight.protocol.pcep.parser.tlv;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
@@ -56,7 +57,7 @@ public class NoPathVectorTlvParser implements TlvParser, TlvSerializer {
 
     @Override
     public void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
-        Preconditions.checkArgument(tlv instanceof NoPathVector, "NoPathVectorTlv is mandatory.");
+        checkArgument(tlv instanceof NoPathVector, "NoPathVectorTlv is mandatory.");
         final NoPathVector noPath = (NoPathVector) tlv;
         final ByteBuf body = Unpooled.buffer();
         final BitArray flags = new BitArray(FLAGS_SIZE);
index 25ec06d864739e07a5b3eef0117cad8a3b6d813f..b99d986eeeb38f1c6a4ed432e85b05c57df462f8 100644 (file)
@@ -12,7 +12,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 import com.google.common.collect.ImmutableSet;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 7c7c5ef6bf1513c1058fabe38b13c175c66bf28b..011753702ddc4870a4ab5769bcf2bcdef7b8906e 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 73847c5436b3fc7c6f5224b5afc7246583e758ba..7f165860398b596f5ddfac2d6113f6d3d428899c 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 0a00e9d0a8fa05a1465b128a540c755ee0762b7e..c3572d93ccd1126d0c3dbea6d149546df51ba6bd 100644 (file)
@@ -13,7 +13,7 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.HashSet;
 import java.util.Set;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 7701c5772001211672849de2bc2aafc02544d063..4e0bb7f92e166364ff2f084402cd55474b2b9f77 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 700a6e372551004e38aad76c477b6b06bb62fecf..46d89e33659eb336dcc760821187dae09092d5cd 100644 (file)
@@ -8,7 +8,7 @@
 package org.opendaylight.protocol.pcep.parser.util;
 
 import java.util.Queue;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.monitoring.metrics.MetricPce;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.monitoring.metrics.MetricPceBuilder;
@@ -47,12 +47,11 @@ public final class Util {
     }
 
     public static MetricPce validateMonitoringMetrics(final Queue<Object> objects) throws PCEPDeserializerException {
-        final Object pceId = objects.poll();
-        if (!(pceId instanceof PceId)) {
+        if (!(objects.poll() instanceof PceId pceId)) {
             throw new PCEPDeserializerException("metric-pce-list must start with PCE-ID object.");
         }
 
-        final MetricPceBuilder metricPceBuilder = new MetricPceBuilder().setPceId((PceId) pceId);
+        final MetricPceBuilder metricPceBuilder = new MetricPceBuilder().setPceId(pceId);
         State state = State.START;
         for (Object obj = objects.peek(); obj != null; obj = objects.peek()) {
             state = insertObject(metricPceBuilder, state, obj);
index 6298034ff5cd429bb91b4b4334cbe31cc4b3cfbe..72340bd38e867080df86435c19f24e99d7195892 100644 (file)
@@ -7,11 +7,12 @@
  */
 package org.opendaylight.protocol.pcep.p2mp.te.lsp;
 
+import static com.google.common.base.Preconditions.checkArgument;
+
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
@@ -27,7 +28,7 @@ public final class P2MPTeLspCapabilityParser implements TlvParser, TlvSerializer
 
     @Override
     public void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
-        Preconditions.checkArgument(tlv instanceof P2mpPceCapability, "P2mpPceCapability is mandatory.");
+        checkArgument(tlv instanceof P2mpPceCapability, "P2mpPceCapability is mandatory.");
         final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
         body.writeShort(0);
         TlvUtil.formatTlv(TYPE, body, buffer);
index 960ce2704772e7e516bae5b125ff37749305e810..26da98d96d738d211ce54afac651b2c79732cf46 100644 (file)
@@ -14,7 +14,7 @@ import static org.opendaylight.protocol.pcep.p2mp.te.lsp.P2MPTeLspCapabilityPars
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Test;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 
 public class P2MPTeLspTlvsParserTest {
index 4853e174feb4786ec22d272b346db6a6b5fcce73..5ca3ae0e1dcc710037576ab861b5a93bf0348176 100644 (file)
@@ -15,10 +15,10 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.Pcinitiate;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.PcinitiateBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.initiated.rev200720.pcinitiate.message.PcinitiateMessageBuilder;
@@ -79,9 +79,9 @@ public class InitiatedPCInitiateMessageParser extends AbstractMessageParser {
             throws PCEPDeserializerException {
         checkArgument(objects != null, "Passed list can't be null.");
         final PcinitiateMessageBuilder builder = new PcinitiateMessageBuilder();
-        final List<Requests> reqs = new ArrayList<>();
+        final var reqs = new ArrayList<Requests>();
         while (!objects.isEmpty()) {
-            reqs.add(this.getValidRequest(objects));
+            reqs.add(getValidRequest(objects));
         }
         builder.setRequests(reqs);
         return new PcinitiateBuilder().setPcinitiateMessage(builder.build()).build();
@@ -92,7 +92,7 @@ public class InitiatedPCInitiateMessageParser extends AbstractMessageParser {
             .setSrp(consumeObject(objects, Srp.class))
             .setLsp(consumeObject(objects, Lsp.class));
 
-        final List<Metrics> metrics = new ArrayList<>();
+        final var metrics = new ArrayList<Metrics>();
         State state = State.INIT;
         for (Object obj = objects.peek(); obj != null; obj = objects.peek()) {
             state = insertObject(state, obj, builder, metrics);
index e9b9978ad94828efaa4c7cf0fa80b7b9185f21ae..472aa04d7d489b1ca23ef5f29da870ab966bbf82 100644 (file)
@@ -16,7 +16,7 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.Map;
 import org.eclipse.jdt.annotation.NonNull;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 13408b798f6bd2075fe7533111c227984e596235..e21db88143654e1829c2cf84aa02a7e8b17c357c 100644 (file)
@@ -14,9 +14,9 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.parser.message.PCEPErrorMessageParser;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcerr.pcerr.message.error.type.StatefulCase;
@@ -47,7 +47,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ
  * Parser for {@link PcerrMessage}.
  */
 public final class StatefulErrorMessageParser extends PCEPErrorMessageParser {
-
     public StatefulErrorMessageParser(final ObjectRegistry registry) {
         super(registry);
     }
@@ -55,15 +54,13 @@ public final class StatefulErrorMessageParser extends PCEPErrorMessageParser {
     @Override
     protected void serializeCases(final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types
             .rev181109.pcerr.message.PcerrMessage err, final ByteBuf buffer) {
-        if (err.getErrorType() instanceof RequestCase) {
-            final List<Rps> rps = ((RequestCase) err.getErrorType()).getRequest().getRps();
-            for (final Rps r : rps) {
+        if (err.getErrorType() instanceof RequestCase request) {
+            for (final Rps r : request.getRequest().nonnullRps()) {
                 serializeObject(r.getRp(), buffer);
             }
         }
-        if (err.getErrorType() instanceof StatefulCase) {
-            final List<Srps> srps = ((StatefulCase) err.getErrorType()).getStateful().getSrps();
-            for (final Srps s : srps) {
+        if (err.getErrorType() instanceof StatefulCase stateful) {
+            for (final Srps s : stateful.getStateful().nonnullSrps()) {
                 serializeObject(s.getSrp(), buffer);
             }
         }
@@ -78,16 +75,15 @@ public final class StatefulErrorMessageParser extends PCEPErrorMessageParser {
         if (first == null) {
             throw new PCEPDeserializerException("Error message is empty.");
         }
-        final List<Rps> requestParameters = new ArrayList<>();
-        final List<Srps> srps = new ArrayList<>();
-        final List<Errors> errorObjects = new ArrayList<>();
+        final var requestParameters = new ArrayList<Rps>();
+        final var srps = new ArrayList<Srps>();
+        final var errorObjects = new ArrayList<Errors>();
         final PcerrMessageBuilder b = new PcerrMessageBuilder();
         State state = State.INIT;
         if (first instanceof ErrorObject) {
             errorObjects.add(new ErrorsBuilder().setErrorObject((ErrorObject) first).build());
             state = State.ERROR_IN;
-        } else if (first instanceof Rp) {
-            final Rp rp = (Rp) first;
+        } else if (first instanceof Rp rp) {
             if (rp.getProcessingRule()) {
                 errors.add(createErrorMsg(PCEPErrors.P_FLAG_NOT_SET, Optional.empty()));
                 return null;
@@ -135,22 +131,19 @@ public final class StatefulErrorMessageParser extends PCEPErrorMessageParser {
             final List<Rps> requestParameters, final List<Srps> srps, final PcerrMessageBuilder builder) {
         switch (state) {
             case ERROR_IN:
-                if (obj instanceof ErrorObject) {
-                    final ErrorObject o = (ErrorObject) obj;
+                if (obj instanceof ErrorObject o) {
                     errorObjects.add(new ErrorsBuilder().setErrorObject(o).build());
                     return State.ERROR_IN;
                 }
                 // fall through
             case RP_IN:
-                if (obj instanceof Rp) {
-                    final Rp o = (Rp) obj;
+                if (obj instanceof Rp o) {
                     requestParameters.add(new RpsBuilder().setRp(o).build());
                     return State.RP_IN;
                 }
                 // fall through
             case SRP_IN:
-                if (obj instanceof Srp) {
-                    final Srp o = (Srp) obj;
+                if (obj instanceof Srp o) {
                     srps.add(new SrpsBuilder().setSrp(o).build());
                     return State.SRP_IN;
                 }
@@ -163,8 +156,7 @@ public final class StatefulErrorMessageParser extends PCEPErrorMessageParser {
                 }
                 // fall through
             case ERROR:
-                if (obj instanceof ErrorObject) {
-                    final ErrorObject o = (ErrorObject) obj;
+                if (obj instanceof ErrorObject o) {
                     errorObjects.add(new ErrorsBuilder().setErrorObject(o).build());
                     return State.ERROR;
                 }
index fcd78de171f44008344c237ef4a46cc3291e440d..dac1937699b5416ac30d3a1280f142caaaa7736a 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 9a0809f6e1b3e5b3e0efb7fdcc620d112393fa06..efd9db27fb5b3c7b49f734f311d433777c4ac494 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 04cf4fd4cc8dd77ee10d1bef82fc62022210daac..b2ebba52c464ca50e894ac0a71aeef72212a5987 100644 (file)
@@ -13,9 +13,9 @@ import com.google.common.primitives.UnsignedBytes;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.protocol.util.BitArray;
index 1342c7dd4cccabad44b71814f4424e85cf24557b..54d441dded7f4491dceedf92bd9bc48ce0024f6c 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 6206a4fb88e15da3a1937acae6a2a6ab6a1fa8a5..8bd078880b3b0ce08f2fb31e4e58e56b06a50f74 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 37832b7e33743fb47ea5601ff1bacc2dec22a061..2bca0b4efd52a1af5ff675b181278e2649d56b24 100644 (file)
@@ -15,10 +15,10 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.PSTUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.Pcrpt;
@@ -92,8 +92,7 @@ public class StatefulPCReportMessageParser extends AbstractMessageParser {
             throw new PCEPDeserializerException("Pcrpt message cannot be empty.");
         }
 
-        final List<Reports> reports = new ArrayList<>();
-
+        final var reports = new ArrayList<Reports>();
         while (!objects.isEmpty()) {
             final Reports report = getValidReports(objects, errors);
             if (report != null) {
@@ -108,8 +107,7 @@ public class StatefulPCReportMessageParser extends AbstractMessageParser {
 
         boolean lspViaSR = false;
         Object object = objects.remove();
-        if (object instanceof Srp) {
-            final Srp srp = (Srp) object;
+        if (object instanceof Srp srp) {
             final Tlvs tlvs = srp.getTlvs();
             if (tlvs != null) {
                 lspViaSR = PSTUtil.isDefaultPST(tlvs.getPathSetupType());
@@ -132,8 +130,7 @@ public class StatefulPCReportMessageParser extends AbstractMessageParser {
 
     private static boolean validateLsp(final Object object, final boolean lspViaSR, final List<Message> errors,
             final ReportsBuilder builder) {
-        if (object instanceof Lsp) {
-            final Lsp lsp = (Lsp) object;
+        if (object instanceof Lsp lsp) {
             final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.lsp
                 .object.lsp.Tlvs tlvs = lsp.getTlvs();
             if (!lspViaSR && lsp.getPlspId().getValue().toJava() != 0
@@ -155,8 +152,8 @@ public class StatefulPCReportMessageParser extends AbstractMessageParser {
             final ReportsBuilder builder) {
         final PathBuilder pBuilder = new PathBuilder();
         Object object = objects.remove();
-        if (object instanceof Ero) {
-            pBuilder.setEro((Ero) object);
+        if (object instanceof Ero ero) {
+            pBuilder.setEro(ero);
         } else {
             errors.add(createErrorMsg(PCEPErrors.ERO_MISSING, Optional.empty()));
             return false;
@@ -207,46 +204,46 @@ public class StatefulPCReportMessageParser extends AbstractMessageParser {
             final List<Metrics> pathMetrics) {
         switch (state) {
             case INIT:
-                if (obj instanceof Lspa) {
-                    builder.setLspa((Lspa) obj);
+                if (obj instanceof Lspa lspa) {
+                    builder.setLspa(lspa);
                     return State.LSPA_IN;
                 }
                 // fall through
             case LSPA_IN:
                 // Check presence for <intended-attribute-list> i.e LSPA, Bandwidth, Metrics, IRO ... as per old draft
-                if (obj instanceof Bandwidth) {
-                    builder.setBandwidth((Bandwidth) obj);
+                if (obj instanceof Bandwidth bandwidth) {
+                    builder.setBandwidth(bandwidth);
                     return State.LSPA_IN;
                 }
-                if (obj instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
-                        .reoptimization.bandwidth.object.ReoptimizationBandwidth) {
-                    builder.setReoptimizationBandwidth((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
-                            .pcep.types.rev181109.reoptimization.bandwidth.object.ReoptimizationBandwidth) obj);
+                if (obj
+                        instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
+                            .reoptimization.bandwidth.object.ReoptimizationBandwidth reoptBandwidth) {
+                    builder.setReoptimizationBandwidth(reoptBandwidth);
                     return State.LSPA_IN;
                 }
                 // fall through
             case BANDWIDTH_IN:
-                if (obj instanceof Metric) {
-                    pathMetrics.add(new MetricsBuilder().setMetric((Metric) obj).build());
+                if (obj instanceof Metric metric) {
+                    pathMetrics.add(new MetricsBuilder().setMetric(metric).build());
                     return State.BANDWIDTH_IN;
                 }
                 // fall through
             case METRIC_IN:
-                if (obj instanceof Iro) {
-                    builder.setIro((Iro) obj);
+                if (obj instanceof Iro iro) {
+                    builder.setIro(iro);
                     return State.IRO_IN;
                 }
                 // fall through
             case IRO_IN:
-                if (obj instanceof Rro) {
-                    builder.setRro((Rro) obj);
+                if (obj instanceof Rro rro) {
+                    builder.setRro(rro);
                     return State.RRO_IN;
                 }
                 // fall through
             case RRO_IN:
                 // Check presence for <intended-attribute-list> i.e LSPA, Bandwidth, Metrics, IRO ... as per RFC8231
-                if (obj instanceof Lspa) {
-                    builder.setLspa((Lspa) obj);
+                if (obj instanceof Lspa lspa) {
+                    builder.setLspa(lspa);
                     return State.LSPA_IN;
                 }
                 // fall through
index bdca0f91611a44a1a25613b417dbaa4b1ef74a85..fd630d26ac55b92be1a31479b31d1344fc86f740 100644 (file)
@@ -15,10 +15,10 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
 import java.util.Queue;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractMessageParser;
 import org.opendaylight.protocol.pcep.spi.MessageUtil;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.Pcupd;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.PcupdBuilder;
@@ -55,9 +55,8 @@ public class StatefulPCUpdateRequestMessageParser extends AbstractMessageParser
         checkArgument(message instanceof Pcupd, "Wrong instance of Message. Passed instance of %s. Need Pcupd.",
             message.getClass());
         final Pcupd msg = (Pcupd) message;
-        final List<Updates> updates = msg.getPcupdMessage().getUpdates();
         final ByteBuf buffer = Unpooled.buffer();
-        for (final Updates update : updates) {
+        for (final Updates update : msg.getPcupdMessage().nonnullUpdates()) {
             serializeUpdate(update, buffer);
         }
         MessageUtil.formatMessage(TYPE, buffer, out);
@@ -87,8 +86,7 @@ public class StatefulPCUpdateRequestMessageParser extends AbstractMessageParser
             throw new PCEPDeserializerException("Pcup message cannot be empty.");
         }
 
-        final List<Updates> updateRequests = new ArrayList<>();
-
+        final var updateRequests = new ArrayList<Updates>();
         while (!objects.isEmpty()) {
             final Updates upd = getValidUpdates(objects, errors);
             if (upd != null) {
@@ -105,8 +103,8 @@ public class StatefulPCUpdateRequestMessageParser extends AbstractMessageParser
         final UpdatesBuilder builder = new UpdatesBuilder();
 
         Object object = objects.remove();
-        if (object instanceof Srp) {
-            builder.setSrp((Srp) object);
+        if (object instanceof Srp srp) {
+            builder.setSrp(srp);
             object = objects.poll();
         } else {
             errors.add(createErrorMsg(PCEPErrors.SRP_MISSING, Optional.empty()));
@@ -125,8 +123,8 @@ public class StatefulPCUpdateRequestMessageParser extends AbstractMessageParser
     }
 
     private static boolean validateLsp(final Object object, final List<Message> errors, final UpdatesBuilder builder) {
-        if (object instanceof Lsp) {
-            builder.setLsp((Lsp) object);
+        if (object instanceof Lsp lsp) {
+            builder.setLsp(lsp);
         } else {
             errors.add(createErrorMsg(PCEPErrors.LSP_MISSING, Optional.empty()));
             return false;
@@ -138,8 +136,8 @@ public class StatefulPCUpdateRequestMessageParser extends AbstractMessageParser
             final UpdatesBuilder builder) {
         final PathBuilder pBuilder = new PathBuilder();
         Object object = objects.remove();
-        if (object instanceof Ero) {
-            pBuilder.setEro((Ero) object);
+        if (object instanceof Ero ero) {
+            pBuilder.setEro(ero);
         } else {
             errors.add(createErrorMsg(PCEPErrors.ERO_MISSING, Optional.empty()));
             return false;
@@ -150,7 +148,7 @@ public class StatefulPCUpdateRequestMessageParser extends AbstractMessageParser
     }
 
     private static void parsePath(final Queue<Object> objects, final PathBuilder pathBuilder) {
-        final List<Metrics> pathMetrics = new ArrayList<>();
+        final var pathMetrics = new ArrayList<Metrics>();
         State state = State.INIT;
         for (Object obj = objects.peek(); obj != null; obj = objects.peek()) {
             state = insertObject(state, obj, pathBuilder, pathMetrics);
@@ -170,32 +168,32 @@ public class StatefulPCUpdateRequestMessageParser extends AbstractMessageParser
             final List<Metrics> pathMetrics) {
         switch (state) {
             case INIT:
-                if (obj instanceof Lspa) {
-                    pathBuilder.setLspa((Lspa) obj);
+                if (obj instanceof Lspa lspa) {
+                    pathBuilder.setLspa(lspa);
                     return State.LSPA_IN;
                 }
                 // fall through
             case LSPA_IN:
-                if (obj instanceof Bandwidth) {
-                    pathBuilder.setBandwidth((Bandwidth) obj);
+                if (obj instanceof Bandwidth bandwidth) {
+                    pathBuilder.setBandwidth(bandwidth);
                     return State.LSPA_IN;
                 }
-                if (obj instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
-                        .reoptimization.bandwidth.object.ReoptimizationBandwidth) {
-                    pathBuilder.setReoptimizationBandwidth((org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns
-                            .yang.pcep.types.rev181109.reoptimization.bandwidth.object.ReoptimizationBandwidth) obj);
+                if (obj
+                        instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
+                            .reoptimization.bandwidth.object.ReoptimizationBandwidth reoptBandwidth) {
+                    pathBuilder.setReoptimizationBandwidth(reoptBandwidth);
                     return State.LSPA_IN;
                 }
                 // fall through
             case BANDWIDTH_IN:
-                if (obj instanceof Metric) {
-                    pathMetrics.add(new MetricsBuilder().setMetric((Metric) obj).build());
+                if (obj instanceof Metric metric) {
+                    pathMetrics.add(new MetricsBuilder().setMetric(metric).build());
                     return State.BANDWIDTH_IN;
                 }
                 // fall through
             case METRIC_IN:
-                if (obj instanceof Iro) {
-                    pathBuilder.setIro((Iro) obj);
+                if (obj instanceof Iro iro) {
+                    pathBuilder.setIro(iro);
                     return State.IRO_IN;
                 }
                 // fall through
index 2fa942cd3f60e1a1321513be48bcf797679852e6..315f7411624841eaeb3d0f4998140b241f60d9b9 100644 (file)
@@ -12,7 +12,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.nio.charset.StandardCharsets;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index cade4dbad675f9454324e8ba758d323216447f9b..32e08a78dd57597011e7d29f49a0294dc2e21241 100644 (file)
@@ -12,9 +12,9 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.AbstractObjectWithTlvsParser;
 import org.opendaylight.protocol.pcep.spi.ObjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720.SrpIdNumber;
@@ -68,11 +68,11 @@ public class StatefulSrpObjectParser extends AbstractObjectWithTlvsParser<TlvsBu
 
     @Override
     public void addTlv(final TlvsBuilder builder, final Tlv tlv) {
-        if (tlv instanceof SymbolicPathName) {
-            builder.setSymbolicPathName((SymbolicPathName) tlv);
+        if (tlv instanceof SymbolicPathName symbolic) {
+            builder.setSymbolicPathName(symbolic);
         }
-        if (tlv instanceof PathSetupType) {
-            builder.setPathSetupType((PathSetupType) tlv);
+        if (tlv instanceof PathSetupType setup) {
+            builder.setPathSetupType(setup);
         }
     }
 
index ccbfc00f9168b9fdb2f2317a73622ad441d14fc9..9ab41a0ccbe35e9c231c5539c586545422180992 100644 (file)
@@ -7,10 +7,11 @@
  */
 package org.opendaylight.protocol.pcep.ietf.stateful;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
@@ -51,7 +52,7 @@ public class StatefulStatefulCapabilityTlvParser implements TlvParser, TlvSerial
 
     @Override
     public void serializeTlv(final Tlv tlv, final ByteBuf buffer) {
-        Preconditions.checkArgument(tlv instanceof Stateful, "StatefulCapabilityTlv is mandatory.");
+        checkArgument(tlv instanceof Stateful, "StatefulCapabilityTlv is mandatory.");
         final Stateful sct = (Stateful) tlv;
         TlvUtil.formatTlv(TYPE, Unpooled.wrappedBuffer(serializeFlags(sct).array()), buffer);
     }
index 58a0f538d360269cfca565c3ddf656633aeaa55a..cbcdae53dcb7942560efc6b2d984816101451d52 100644 (file)
@@ -13,7 +13,7 @@ import static org.opendaylight.yangtools.yang.common.netty.ByteBufUtils.writeOrZ
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
@@ -34,9 +34,6 @@ public class LspDbVersionTlvParser implements TlvParser, TlvSerializer {
 
     @Override
     public Tlv parseTlv(final ByteBuf buffer) throws PCEPDeserializerException {
-        if (buffer == null) {
-            return null;
-        }
-        return new LspDbVersionBuilder().setLspDbVersionValue(readUint64(buffer)).build();
+        return buffer == null ? null : new LspDbVersionBuilder().setLspDbVersionValue(readUint64(buffer)).build();
     }
 }
index 70b18e65783357b04ad6ddcc7d600a6086bc42e3..366883dfc68dd11a73bc5ffca7fef143fa3ceb8a 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.protocol.pcep.sync.optimizations;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 962bb153b0fd007e302340da38c6193faa86c753..8100b95042a2a52f6975c1dc3c9610caf5cb8e3e 100644 (file)
@@ -15,12 +15,12 @@ import io.netty.buffer.Unpooled;
 import java.io.IOException;
 import org.junit.Before;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.ietf.initiated.InitiatedSrpObjectParser;
 import org.opendaylight.protocol.pcep.ietf.stateful.StatefulActivator;
 import org.opendaylight.protocol.pcep.ietf.stateful.StatefulLspObjectParser;
 import org.opendaylight.protocol.pcep.parser.BaseParserExtensionActivator;
 import org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
@@ -78,7 +78,7 @@ public class PCEPObjectParserTest {
 
     @Before
     public void setUp() {
-        new BaseParserExtensionActivator().start(this.ctx);
+        new BaseParserExtensionActivator().start(ctx);
     }
 
     @Test
@@ -86,7 +86,7 @@ public class PCEPObjectParserTest {
         new SyncOptimizationsActivator().start(ctx);
 
         final SyncOptimizationsOpenObjectParser parser = new SyncOptimizationsOpenObjectParser(
-            this.ctx.getTlvHandlerRegistry(), this.ctx.getVendorInformationTlvRegistry());
+            ctx.getTlvHandlerRegistry(), ctx.getVendorInformationTlvRegistry());
         final ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes(
             "src/test/resources/PCEPOpenObject1.bin"));
 
@@ -128,7 +128,7 @@ public class PCEPObjectParserTest {
         new SyncOptimizationsActivator().start(ctx);
 
         final SyncOptimizationsLspObjectParser parser = new SyncOptimizationsLspObjectParser(
-            this.ctx.getTlvHandlerRegistry(), this.ctx.getVendorInformationTlvRegistry());
+            ctx.getTlvHandlerRegistry(), ctx.getVendorInformationTlvRegistry());
         final ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes(
             "src/test/resources/PCEPLspObject1WithTLV.bin"));
 
@@ -165,7 +165,7 @@ public class PCEPObjectParserTest {
     public void testStatefulLspObjectWithTlv() throws IOException, PCEPDeserializerException {
         new StatefulActivator().start(ctx);
 
-        final StatefulLspObjectParser parser = new StatefulLspObjectParser(this.tlvRegistry, this.viTlvRegistry);
+        final StatefulLspObjectParser parser = new StatefulLspObjectParser(tlvRegistry, viTlvRegistry);
         final ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes(
             "src/test/resources/PCEPLspObject2WithTLV.bin"));
 
@@ -220,8 +220,8 @@ public class PCEPObjectParserTest {
 
     @Test
     public void testSrpObject() throws PCEPDeserializerException {
-        final InitiatedSrpObjectParser parser = new InitiatedSrpObjectParser(this.tlvRegistry,
-            this.viTlvRegistry);
+        final InitiatedSrpObjectParser parser = new InitiatedSrpObjectParser(tlvRegistry,
+            viTlvRegistry);
         final ByteBuf result = Unpooled.wrappedBuffer(new byte[] {
             (byte) 0x21, (byte) 0x10, (byte) 0x00, (byte) 0x0c, 0, 0, 0, (byte) 0x01, 0, 0, 0, (byte) 0x01
         });
@@ -246,8 +246,8 @@ public class PCEPObjectParserTest {
             0x0, 0x01,
             /* pst-tlv */
             0x0, 0x1C, 0x0, 0x4, 0x0, 0x0, 0x0, 0x0 };
-        final InitiatedSrpObjectParser parser = new InitiatedSrpObjectParser(this.tlvRegistry,
-            this.viTlvRegistry);
+        final InitiatedSrpObjectParser parser = new InitiatedSrpObjectParser(tlvRegistry,
+            viTlvRegistry);
         final SrpBuilder builder = new SrpBuilder()
                 .setProcessingRule(false)
                 .setIgnore(false)
index 3cc504da90572188ce409b9c38c4638b4ad6787b..7f43837165591714ac9280faf9445e0522f59eb1 100644 (file)
@@ -14,6 +14,7 @@ import static org.junit.Assert.fail;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.ietf.stateful.PathBindingTlvParser;
 import org.opendaylight.protocol.pcep.ietf.stateful.StatefulLSPIdentifierIpv4TlvParser;
 import org.opendaylight.protocol.pcep.ietf.stateful.StatefulLSPIdentifierIpv6TlvParser;
@@ -21,7 +22,6 @@ import org.opendaylight.protocol.pcep.ietf.stateful.StatefulLspSymbolicNameTlvPa
 import org.opendaylight.protocol.pcep.ietf.stateful.StatefulLspUpdateErrorTlvParser;
 import org.opendaylight.protocol.pcep.ietf.stateful.StatefulRSVPErrorSpecTlvParser;
 import org.opendaylight.protocol.pcep.ietf.stateful.StatefulStatefulCapabilityTlvParser;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsCapabilityTlvParser;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.protocol.util.Ipv4Util;
index 85c712febdb2f2d83daed6928e8a15546e1de96e..0bafd8783133a99022fb0f5c01d08bc37cbf8f88 100644 (file)
@@ -20,6 +20,7 @@ import java.util.Collections;
 import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.ietf.initiated.InitiatedActivator;
 import org.opendaylight.protocol.pcep.ietf.initiated.InitiatedPCInitiateMessageParser;
 import org.opendaylight.protocol.pcep.ietf.stateful.StatefulActivator;
@@ -29,7 +30,6 @@ import org.opendaylight.protocol.pcep.ietf.stateful.StatefulPCRequestMessagePars
 import org.opendaylight.protocol.pcep.ietf.stateful.StatefulPCUpdateRequestMessageParser;
 import org.opendaylight.protocol.pcep.parser.BaseParserExtensionActivator;
 import org.opendaylight.protocol.pcep.parser.message.PCEPOpenMessageParser;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
 import org.opendaylight.protocol.pcep.sync.optimizations.SyncOptimizationsActivator;
 import org.opendaylight.protocol.util.ByteArray;
@@ -195,11 +195,11 @@ public class PCEPValidatorTest {
 
     @Before
     public void setUp() {
-        this.ctx = new SimplePCEPExtensionProviderContext();
-        this.act = new BaseParserExtensionActivator();
-        this.act.start(this.ctx);
+        ctx = new SimplePCEPExtensionProviderContext();
+        act = new BaseParserExtensionActivator();
+        act.start(ctx);
 
-        this.lspa = new LspaBuilder()
+        lspa = new LspaBuilder()
                 .setProcessingRule(false)
                 .setIgnore(false)
                 .setLocalProtectionDesired(false)
@@ -212,7 +212,7 @@ public class PCEPValidatorTest {
                     .lspa.object.lspa.TlvsBuilder().build())
                 .build();
 
-        this.metrics = new MetricsBuilder()
+        metrics = new MetricsBuilder()
                 .setMetric(new MetricBuilder()
                     .setIgnore(false)
                     .setProcessingRule(false)
@@ -222,12 +222,12 @@ public class PCEPValidatorTest {
                     .setValue(new Float32(new byte[4])).build())
                 .build();
 
-        this.eroASSubobject = new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(
+        eroASSubobject = new AsNumberCaseBuilder().setAsNumber(new AsNumberBuilder().setAsNumber(
             new org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber(
                 Uint32.valueOf(0xFFFF)))
             .build()).build();
 
-        this.rroUnnumberedSub = new UnnumberedCaseBuilder()
+        rroUnnumberedSub = new UnnumberedCaseBuilder()
                 .setUnnumbered(new UnnumberedBuilder()
                     .setRouterId(Uint32.valueOf(0x00112233L))
                     .setInterfaceId(Uint32.valueOf(0x00ff00ffL))
@@ -238,9 +238,9 @@ public class PCEPValidatorTest {
                 .setIgnore(false)
                 .setProcessingRule(false);
         final List<Subobject> iroSubs = new ArrayList<>();
-        iroSubs.add(new SubobjectBuilder().setSubobjectType(this.eroASSubobject).setLoose(false).build());
+        iroSubs.add(new SubobjectBuilder().setSubobjectType(eroASSubobject).setLoose(false).build());
         iroBuilder.setSubobject(iroSubs);
-        this.iro = iroBuilder.build();
+        iro = iroBuilder.build();
 
         final EroBuilder eroBuilder = new EroBuilder();
         eroBuilder.setIgnore(false);
@@ -248,9 +248,9 @@ public class PCEPValidatorTest {
         final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route
             .object.ero.Subobject> eroSubs = new ArrayList<>();
         eroSubs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit
-            .route.object.ero.SubobjectBuilder().setSubobjectType(this.eroASSubobject).setLoose(false).build());
+            .route.object.ero.SubobjectBuilder().setSubobjectType(eroASSubobject).setLoose(false).build());
         eroBuilder.setSubobject(eroSubs);
-        this.ero = eroBuilder.build();
+        ero = eroBuilder.build();
 
         final RroBuilder rroBuilder = new RroBuilder();
         rroBuilder.setIgnore(false);
@@ -258,12 +258,12 @@ public class PCEPValidatorTest {
         final List<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route
             .object.rro.Subobject> rroSubs = new ArrayList<>();
         rroSubs.add(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported
-            .route.object.rro.SubobjectBuilder().setSubobjectType(this.rroUnnumberedSub).setProtectionAvailable(false)
+            .route.object.rro.SubobjectBuilder().setSubobjectType(rroUnnumberedSub).setProtectionAvailable(false)
             .setProtectionInUse(false).build());
         rroBuilder.setSubobject(rroSubs);
-        this.rro = rroBuilder.build();
+        rro = rroBuilder.build();
 
-        this.srp = new SrpBuilder()
+        srp = new SrpBuilder()
                 .setIgnore(false)
                 .setProcessingRule(false)
                 .setOperationId(new SrpIdNumber(Uint32.ONE))
@@ -284,8 +284,8 @@ public class PCEPValidatorTest {
                 .setTlvs(new TlvsBuilder().build())
                 .addAugmentation(new Lsp1Builder().setCreate(false).build());
 
-        this.lspSrp = lspBuilder.build();
-        this.lsp = lspBuilder.setTlvs(new TlvsBuilder()
+        lspSrp = lspBuilder.build();
+        lsp = lspBuilder.setTlvs(new TlvsBuilder()
             .setLspIdentifiers(new LspIdentifiersBuilder()
                 .setAddressFamily(new Ipv4CaseBuilder()
                     .setIpv4(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful
@@ -305,14 +305,14 @@ public class PCEPValidatorTest {
             .setSourceIpv4Address(new Ipv4AddressNoZone("255.255.255.255"))
             .setDestinationIpv4Address(new Ipv4AddressNoZone("255.255.255.255"));
 
-        this.bandwidth = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
+        bandwidth = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109
             .bandwidth.object.BandwidthBuilder()
                 .setIgnore(false)
                 .setProcessingRule(false)
                 .setBandwidth(new Bandwidth(new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00 }))
                 .build();
 
-        this.reoptimizationBandwidth = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types
+        reoptimizationBandwidth = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types
             .rev181109.reoptimization.bandwidth.object.ReoptimizationBandwidthBuilder()
                 .setIgnore(false)
                 .setProcessingRule(false)
@@ -322,11 +322,11 @@ public class PCEPValidatorTest {
 
     @Test
     public void testOpenMsg() throws IOException, PCEPDeserializerException {
-        new StatefulActivator().start(this.ctx);
+        new StatefulActivator().start(ctx);
 
         final ByteBuf result = Unpooled.wrappedBuffer(
             ByteArray.fileToBytes("src/test/resources/PCEPOpenMessage1.bin"));
-        final PCEPOpenMessageParser parser = new PCEPOpenMessageParser(this.ctx.getObjectHandlerRegistry());
+        final PCEPOpenMessageParser parser = new PCEPOpenMessageParser(ctx.getObjectHandlerRegistry());
         final OpenMessageBuilder builder = new OpenMessageBuilder()
             .setOpen(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.open
                 .object.OpenBuilder()
@@ -427,7 +427,7 @@ public class PCEPValidatorTest {
             .build();
 
         final StatefulPCRequestMessageParser parser = new StatefulPCRequestMessageParser(
-                this.ctx.getObjectHandlerRegistry());
+                ctx.getObjectHandlerRegistry());
         ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/PCReq.1.bin"));
         assertEquals(pcReq, parser.parseMessage(result.slice(4, result.readableBytes() - 4), Collections.emptyList()));
 
@@ -440,14 +440,14 @@ public class PCEPValidatorTest {
     public void testUpdMsg() throws IOException, PCEPDeserializerException {
         new InitiatedActivator().start(ctx);
         final StatefulPCUpdateRequestMessageParser parser = new StatefulPCUpdateRequestMessageParser(
-            this.ctx.getObjectHandlerRegistry());
+            ctx.getObjectHandlerRegistry());
 
         final PathBuilder pBuilder = new PathBuilder()
-            .setEro(this.ero)
-            .setLspa(this.lspa);
+            .setEro(ero)
+            .setLspa(lspa);
         final PcupdMessageBuilder builder = new PcupdMessageBuilder()
             .setUpdates(List.of(
-                new UpdatesBuilder().setSrp(this.srp).setLsp(this.lspSrp).setPath(pBuilder.build()).build()));
+                new UpdatesBuilder().setSrp(srp).setLsp(lspSrp).setPath(pBuilder.build()).build()));
 
         ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/PCUpd.2.bin"));
         assertEquals(new PcupdBuilder().setPcupdMessage(builder.build()).build(),
@@ -457,10 +457,10 @@ public class PCEPValidatorTest {
         assertArrayEquals(result.array(), buf.array());
 
         builder.setUpdates(List.of(
-            new UpdatesBuilder().setSrp(this.srp).setLsp(this.lspSrp).setPath(pBuilder.build()).build(),
-            new UpdatesBuilder().setSrp(this.srp).setLsp(this.lspSrp).setPath(new PathBuilder()
-                .setEro(this.ero)
-                .setLspa(this.lspa)
+            new UpdatesBuilder().setSrp(srp).setLsp(lspSrp).setPath(pBuilder.build()).build(),
+            new UpdatesBuilder().setSrp(srp).setLsp(lspSrp).setPath(new PathBuilder()
+                .setEro(ero)
+                .setLspa(lspa)
                 .build())
             .build()));
 
@@ -479,12 +479,12 @@ public class PCEPValidatorTest {
         ByteBuf result = Unpooled.wrappedBuffer(PCRT1);
 
         final StatefulPCReportMessageParser parser = new StatefulPCReportMessageParser(
-            this.ctx.getObjectHandlerRegistry());
+            ctx.getObjectHandlerRegistry());
 
         final PcrptMessageBuilder builder = new PcrptMessageBuilder();
 
         final List<Reports> reports = new ArrayList<>();
-        reports.add(new ReportsBuilder().setLsp(this.lsp).build());
+        reports.add(new ReportsBuilder().setLsp(lsp).build());
         builder.setReports(reports);
         final Message parseResult = parser.parseMessage(result.slice(4, result.readableBytes() - 4),
             List.of());
@@ -496,11 +496,11 @@ public class PCEPValidatorTest {
         result = Unpooled.wrappedBuffer(PCRT2);
 
         builder.setReports(List.of(new ReportsBuilder()
-            .setLsp(this.lsp)
+            .setLsp(lsp)
             .setPath(new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev200720
                 .pcrpt.message.pcrpt.message.reports.PathBuilder()
-                    .setEro(this.ero)
-                    .setLspa(this.lspa)
+                    .setEro(ero)
+                    .setLspa(lspa)
                     .build())
             .build()));
 
@@ -516,11 +516,11 @@ public class PCEPValidatorTest {
         final List<Reports> reports2 = new ArrayList<>();
         final var pBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful
             .rev200720.pcrpt.message.pcrpt.message.reports.PathBuilder();
-        pBuilder.setEro(this.ero);
-        pBuilder.setLspa(this.lspa);
-        pBuilder.setMetrics(Lists.newArrayList(this.metrics, this.metrics));
-        pBuilder.setRro(this.rro);
-        reports2.add(new ReportsBuilder().setSrp(this.srp).setLsp(this.lspSrp).setPath(pBuilder.build()).build());
+        pBuilder.setEro(ero);
+        pBuilder.setLspa(lspa);
+        pBuilder.setMetrics(Lists.newArrayList(metrics, metrics));
+        pBuilder.setRro(rro);
+        reports2.add(new ReportsBuilder().setSrp(srp).setLsp(lspSrp).setPath(pBuilder.build()).build());
         builder.setReports(reports2);
 
         assertEquals(new PcrptBuilder().setPcrptMessage(builder.build()).build(),
@@ -539,12 +539,12 @@ public class PCEPValidatorTest {
         final List<Reports> reports3 = new ArrayList<>();
         final var pBuilder1 = new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful
             .rev200720.pcrpt.message.pcrpt.message.reports.PathBuilder();
-        pBuilder1.setEro(this.ero);
-        pBuilder1.setLspa(this.lspa);
-        pBuilder1.setMetrics(Lists.newArrayList(this.metrics, this.metrics));
-        pBuilder1.setRro(this.rro);
-        reports3.add(new ReportsBuilder().setSrp(this.srp).setLsp(this.lspSrp).setPath(pBuilder.build()).build());
-        reports3.add(new ReportsBuilder().setSrp(this.srp).setLsp(this.lspSrp).setPath(pBuilder1.build()).build());
+        pBuilder1.setEro(ero);
+        pBuilder1.setLspa(lspa);
+        pBuilder1.setMetrics(Lists.newArrayList(metrics, metrics));
+        pBuilder1.setRro(rro);
+        reports3.add(new ReportsBuilder().setSrp(srp).setLsp(lspSrp).setPath(pBuilder.build()).build());
+        reports3.add(new ReportsBuilder().setSrp(srp).setLsp(lspSrp).setPath(pBuilder1.build()).build());
         builder.setReports(reports3);
 
         assertEquals(new PcrptBuilder().setPcrptMessage(builder.build()).build(),
@@ -556,10 +556,10 @@ public class PCEPValidatorTest {
         result = Unpooled.wrappedBuffer(PCRT3);
 
         final List<Reports> reports4 = new ArrayList<>();
-        reports4.add(new ReportsBuilder().setLsp(this.lsp).setPath(new org.opendaylight.yang.gen.v1.urn.opendaylight
+        reports4.add(new ReportsBuilder().setLsp(lsp).setPath(new org.opendaylight.yang.gen.v1.urn.opendaylight
             .params.xml.ns.yang.pcep.ietf.stateful.rev200720.pcrpt.message.pcrpt.message.reports.PathBuilder()
-            .setEro(this.ero).setLspa(this.lspa).setBandwidth(this.bandwidth)
-            .setReoptimizationBandwidth(this.reoptimizationBandwidth).build()).build());
+            .setEro(ero).setLspa(lspa).setBandwidth(bandwidth)
+            .setReoptimizationBandwidth(reoptimizationBandwidth).build()).build());
         builder.setReports(reports4);
 
         final ByteBuf input2 = result.slice(4, result.readableBytes() - 4);
@@ -577,16 +577,16 @@ public class PCEPValidatorTest {
         final ByteBuf result = Unpooled.wrappedBuffer(ByteArray.fileToBytes("src/test/resources/Pcinit.bin"));
 
         final InitiatedPCInitiateMessageParser parser = new InitiatedPCInitiateMessageParser(
-            this.ctx.getObjectHandlerRegistry());
+            ctx.getObjectHandlerRegistry());
 
         final PcinitiateMessageBuilder builder = new PcinitiateMessageBuilder()
             .setRequests(List.of(new RequestsBuilder()
-            .setSrp(this.srp)
-            .setLsp(this.lspSrp)
-            .setEro(this.ero)
-            .setLspa(this.lspa)
-            .setMetrics(List.of(this.metrics))
-            .setIro(this.iro)
+            .setSrp(srp)
+            .setLsp(lspSrp)
+            .setEro(ero)
+            .setLspa(lspa)
+            .setMetrics(List.of(metrics))
+            .setIro(iro)
             .build()));
 
         assertEquals(new PcinitiateBuilder().setPcinitiateMessage(builder.build()).build(),
@@ -601,7 +601,7 @@ public class PCEPValidatorTest {
         new StatefulActivator().start(ctx);
 
         final StatefulErrorMessageParser parser = new StatefulErrorMessageParser(
-            this.ctx.getObjectHandlerRegistry());
+            ctx.getObjectHandlerRegistry());
 
         ErrorObject error1 = new ErrorObjectBuilder().setIgnore(false).setProcessingRule(false)
             .setType(Uint8.valueOf(19)).setValue(Uint8.ONE).build();
@@ -722,7 +722,7 @@ public class PCEPValidatorTest {
         new StatefulActivator().start(ctx);
 
         final StatefulPCReportMessageParser parser = new StatefulPCReportMessageParser(
-            this.ctx.getObjectHandlerRegistry());
+            ctx.getObjectHandlerRegistry());
 
         final ByteBuf buf = Unpooled.wrappedBuffer(statefulMsg);
         final List<Message> errors = new ArrayList<>();
@@ -770,7 +770,7 @@ public class PCEPValidatorTest {
         new InitiatedActivator().start(ctx);
 
         final StatefulPCUpdateRequestMessageParser parser = new StatefulPCUpdateRequestMessageParser(
-            this.ctx.getObjectHandlerRegistry());
+            ctx.getObjectHandlerRegistry());
 
         final ByteBuf buf = Unpooled.wrappedBuffer(badUpdateMsg);
         final List<Message> errors = new ArrayList<>();
index 1077dee337842da533b0bc5fc28050e51708519a..c88c05f567e630bc711a027a63f332e32528e80d 100644 (file)
@@ -16,8 +16,8 @@ import io.netty.channel.ChannelHandlerContext;
 import io.netty.handler.codec.ByteToMessageDecoder;
 import java.util.ArrayList;
 import java.util.List;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.MessageRegistry;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPMessageConstants;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message;
 import org.slf4j.Logger;
index cf9d165caceeed1d0bd85254551c988457546ae2..df874bb25c0d54f01cf5aac2e89825b394825ec0 100644 (file)
@@ -33,11 +33,11 @@ import java.util.concurrent.TimeUnit;
 import org.checkerframework.checker.lock.qual.GuardedBy;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.protocol.concepts.KeyMapping;
+import org.opendaylight.protocol.pcep.MessageRegistry;
 import org.opendaylight.protocol.pcep.PCEPDispatcher;
 import org.opendaylight.protocol.pcep.PCEPDispatcherDependencies;
 import org.opendaylight.protocol.pcep.PCEPSession;
 import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactory;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index 3fe350d62fc1433318c36f95c487ea64e08b80ab..f98fc00bd40d14d7e0bdb3f6ef7b340c7bca2779 100644 (file)
@@ -11,7 +11,7 @@ import static java.util.Objects.requireNonNull;
 
 import io.netty.channel.ChannelHandler;
 import io.netty.channel.ChannelOutboundHandler;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
+import org.opendaylight.protocol.pcep.MessageRegistry;
 
 /**
  * PCEP specific factory for protocol inbound/outbound handlers.
index bbb7649dd28551735adbd73aa8b572b756b79870..0b542105dd8c45e83feaabda1e2200faf4871c65 100644 (file)
@@ -14,7 +14,7 @@ import io.netty.buffer.ByteBufUtil;
 import io.netty.channel.ChannelHandler.Sharable;
 import io.netty.channel.ChannelHandlerContext;
 import io.netty.handler.codec.MessageToByteEncoder;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
+import org.opendaylight.protocol.pcep.MessageRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 13ffd25cfa308672fe268a558d6a7bc6c48a4d68..a85daada0f276e5afc63cea379dd62cb6f2f1d3d 100644 (file)
@@ -14,10 +14,10 @@ import static org.junit.Assert.fail;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.parser.subobject.GeneralizedLabelParser;
 import org.opendaylight.protocol.pcep.parser.subobject.Type1LabelParser;
 import org.opendaylight.protocol.pcep.parser.subobject.WavebandSwitchingLabelParser;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.GeneralizedLabelCaseBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.Type1LabelCaseBuilder;
index cc94f6bd982499a49987a0d9c3f09915052e7908..4dd0067518105a4e57ea95abf9b631912c525de2 100644 (file)
@@ -46,12 +46,12 @@ import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.protocol.concepts.KeyMapping;
+import org.opendaylight.protocol.pcep.MessageRegistry;
 import org.opendaylight.protocol.pcep.PCEPDispatcherDependencies;
 import org.opendaylight.protocol.pcep.PCEPSession;
 import org.opendaylight.protocol.pcep.PCEPSessionListenerFactory;
 import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactory;
 import org.opendaylight.protocol.pcep.PCEPSessionProposalFactory;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
 import org.opendaylight.protocol.pcep.spi.pojo.DefaultPCEPExtensionConsumerContext;
 import org.opendaylight.protocol.util.InetSocketAddressUtil;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.config.rev230112.PcepSessionErrorPolicy;
index fe733215780d83913a61fe756ad7750cf928cca4..f292ceec4602bab9739e446d57069ea383be7388 100644 (file)
@@ -24,6 +24,7 @@ import java.util.List;
 import java.util.Set;
 import org.junit.Before;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.impl.TestVendorInformationTlvParser.TestEnterpriseSpecificInformation;
 import org.opendaylight.protocol.pcep.parser.BaseParserExtensionActivator;
 import org.opendaylight.protocol.pcep.parser.object.PCEPBandwidthObjectParser;
@@ -65,7 +66,6 @@ import org.opendaylight.protocol.pcep.parser.object.unreach.PCEPIpv4UnreachDesti
 import org.opendaylight.protocol.pcep.parser.object.unreach.PCEPIpv6UnreachDestinationParser;
 import org.opendaylight.protocol.pcep.parser.object.unreach.PCEPUnreachDestinationSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
index d8574917be4ce92a8878a5031e42ab59d6400a42..d66088d67daa215e3e0b71c547a1c9aaef1a3689 100644 (file)
@@ -16,7 +16,7 @@ import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.Test;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
+import org.opendaylight.protocol.pcep.MessageRegistry;
 import org.opendaylight.protocol.pcep.spi.pojo.DefaultPCEPExtensionConsumerContext;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.Close;
index f97b90b5297250cc63f60f215b55cc5a42ea228c..04664e1d29144aa662b21d58b6cd820dcd70ffbb 100644 (file)
@@ -15,6 +15,7 @@ import com.google.common.collect.ImmutableSet;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.impl.TestVendorInformationTlvParser.TestEnterpriseSpecificInformation;
 import org.opendaylight.protocol.pcep.parser.tlv.NoPathVectorTlvParser;
 import org.opendaylight.protocol.pcep.parser.tlv.OFListTlvParser;
@@ -22,7 +23,6 @@ import org.opendaylight.protocol.pcep.parser.tlv.OrderTlvParser;
 import org.opendaylight.protocol.pcep.parser.tlv.OverloadedDurationTlvParser;
 import org.opendaylight.protocol.pcep.parser.tlv.PathSetupTypeTlvParser;
 import org.opendaylight.protocol.pcep.parser.tlv.ReqMissingTlvParser;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.NoPathVectorTlv;
index 602b45ae640b2db3bd2cf550f608d8886d367a9d..9788cb5403196eedcf907d08936249e9e899fc6a 100644 (file)
@@ -20,6 +20,7 @@ import java.util.List;
 import java.util.Set;
 import org.junit.Before;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.impl.TestVendorInformationTlvParser.TestEnterpriseSpecificInformation;
 import org.opendaylight.protocol.pcep.parser.BaseParserExtensionActivator;
 import org.opendaylight.protocol.pcep.parser.message.PCEPCloseMessageParser;
@@ -33,7 +34,6 @@ import org.opendaylight.protocol.pcep.parser.message.PCEPReplyMessageParser;
 import org.opendaylight.protocol.pcep.parser.message.PCEPRequestMessageParser;
 import org.opendaylight.protocol.pcep.parser.message.PCEPStartTLSMessageParser;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
index b93ae3effb9aec17e33c9937da0021b7900f20bd..d069376132b251345e0a82caa66e1fc94eb983cd 100644 (file)
@@ -17,6 +17,7 @@ import java.util.ArrayList;
 import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.parser.BaseParserExtensionActivator;
 import org.opendaylight.protocol.pcep.parser.subobject.EROAsNumberSubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.EROExplicitExclusionRouteSubobjectParser;
@@ -26,7 +27,6 @@ import org.opendaylight.protocol.pcep.parser.subobject.EROLabelSubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.EROPathKey128SubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.EROPathKey32SubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.EROUnnumberedInterfaceSubobjectParser;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.protocol.util.Ipv6Util;
index 2289d6a2b48f873af66ec99b390e82a5d82c060d..fa85152e0d4b11514ffe001eaf2e613c4ca6c0c2 100644 (file)
@@ -14,6 +14,7 @@ import static org.junit.Assert.fail;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.parser.BaseParserExtensionActivator;
 import org.opendaylight.protocol.pcep.parser.subobject.RROIpv4PrefixSubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.RROIpv6PrefixSubobjectParser;
@@ -21,7 +22,6 @@ import org.opendaylight.protocol.pcep.parser.subobject.RROLabelSubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.RROPathKey128SubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.RROPathKey32SubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.RROUnnumberedInterfaceSubobjectParser;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.protocol.util.Ipv6Util;
index 782ae5fad46e7e9d74fc35953135628b42b88880..6cea8cf8f7b8acd642846018fbbac51815b2acf8 100644 (file)
@@ -14,6 +14,7 @@ import static org.junit.Assert.fail;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.parser.subobject.XROAsNumberSubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.XROIpv4PrefixSubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.XROIpv6PrefixSubobjectParser;
@@ -21,7 +22,6 @@ import org.opendaylight.protocol.pcep.parser.subobject.XROPathKey128SubobjectPar
 import org.opendaylight.protocol.pcep.parser.subobject.XROPathKey32SubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.XROSrlgSubobjectParser;
 import org.opendaylight.protocol.pcep.parser.subobject.XROUnnumberedInterfaceSubobjectParser;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.protocol.util.Ipv6Util;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
index f31442ad689d3d87009e9bb343e0877dbbfd11c6..018984545a1cc731ec4f504507af43955e7d5bf3 100644 (file)
@@ -10,8 +10,8 @@ package org.opendaylight.protocol.pcep.pcc.mock;
 import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.parser.object.end.points.PCEPEndPointsIpv4ObjectParser;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Ipv4Util;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
index 1441b2d126ac662127b78e144c70565e057ee642..184028155ff75e958415878e5712e2d66c103c0c 100644 (file)
@@ -19,6 +19,7 @@ import java.util.Optional;
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.opendaylight.protocol.concepts.KeyMapping;
+import org.opendaylight.protocol.pcep.MessageRegistry;
 import org.opendaylight.protocol.pcep.PCEPCapability;
 import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactory;
 import org.opendaylight.protocol.pcep.impl.BasePCEPSessionProposalFactory;
@@ -27,7 +28,6 @@ import org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager;
 import org.opendaylight.protocol.pcep.pcc.mock.protocol.MockPcepSessionErrorPolicy;
 import org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCDispatcherImpl;
 import org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
 import org.opendaylight.protocol.pcep.spi.pojo.DefaultPCEPExtensionConsumerContext;
 import org.opendaylight.yangtools.yang.common.Uint64;
 import org.opendaylight.yangtools.yang.common.Uint8;
index ec81fefc5ad67511335801edae5b5d6a4dbe9e6a..ebd93e3352054908f3dbe173a429b1997a872cbc 100755 (executable)
@@ -27,6 +27,7 @@ import java.net.InetSocketAddress;
 import java.util.concurrent.ExecutionException;
 import org.eclipse.jdt.annotation.NonNull;
 import org.opendaylight.protocol.concepts.KeyMapping;
+import org.opendaylight.protocol.pcep.MessageRegistry;
 import org.opendaylight.protocol.pcep.PCEPPeerProposal;
 import org.opendaylight.protocol.pcep.PCEPSession;
 import org.opendaylight.protocol.pcep.PCEPSessionListenerFactory;
@@ -34,7 +35,6 @@ import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactory;
 import org.opendaylight.protocol.pcep.PCEPSessionNegotiatorFactoryDependencies;
 import org.opendaylight.protocol.pcep.impl.PCEPHandlerFactory;
 import org.opendaylight.protocol.pcep.pcc.mock.api.PCCDispatcher;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
 import org.opendaylight.yangtools.yang.common.Uint64;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index 5ae9d216f0718a689af055252df66ea1bbb77f20..675d799063a8eb1f20577e87fdf5648053e9d38a 100644 (file)
@@ -27,6 +27,7 @@ import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.opendaylight.protocol.concepts.KeyMapping;
+import org.opendaylight.protocol.pcep.MessageRegistry;
 import org.opendaylight.protocol.pcep.PCEPDispatcher;
 import org.opendaylight.protocol.pcep.PCEPDispatcherDependencies;
 import org.opendaylight.protocol.pcep.PCEPSession;
@@ -36,7 +37,6 @@ import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory;
 import org.opendaylight.protocol.pcep.impl.PCEPDispatcherImpl;
 import org.opendaylight.protocol.pcep.pcc.mock.protocol.MockPcepSessionErrorPolicy;
 import org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCDispatcherImpl;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
 import org.opendaylight.protocol.pcep.spi.pojo.DefaultPCEPExtensionConsumerContext;
 import org.opendaylight.protocol.util.InetSocketAddressUtil;
 import org.opendaylight.yangtools.yang.common.Uint8;
index aa710b27aa81917abd3561e718ba4d4bd96ff22e..8cbcd60dfda9a2c1d308b4fd09963f79bd00bcea 100644 (file)
@@ -13,8 +13,8 @@ import static org.junit.Assert.assertFalse;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Ipv4Util;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4AddressNoZone;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
index 1c768eff3c1d34bdb9d6a75d8590bac4a91ebd2c..fdddbd57d421bef15d67d23d07dd27677ea7021a 100644 (file)
@@ -31,6 +31,7 @@ import java.util.ServiceLoader;
 import java.util.concurrent.TimeUnit;
 import org.junit.Before;
 import org.opendaylight.protocol.concepts.KeyMapping;
+import org.opendaylight.protocol.pcep.MessageRegistry;
 import org.opendaylight.protocol.pcep.PCEPCapability;
 import org.opendaylight.protocol.pcep.PCEPDispatcher;
 import org.opendaylight.protocol.pcep.PCEPDispatcherDependencies;
@@ -46,7 +47,6 @@ import org.opendaylight.protocol.pcep.pcc.mock.api.PCCTunnelManager;
 import org.opendaylight.protocol.pcep.pcc.mock.protocol.MockPcepSessionErrorPolicy;
 import org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCDispatcherImpl;
 import org.opendaylight.protocol.pcep.pcc.mock.protocol.PCCSessionListener;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
index b3f552b811183e98b65437d9d7168c2b92a0365d..8ca52005bf2ff6bfa23f53ef6818eb99e554c8ff 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.util.BitArray;
 import org.opendaylight.protocol.util.Ipv4Util;
 import org.opendaylight.protocol.util.Ipv6Util;
@@ -64,27 +64,27 @@ public abstract class AbstractSrSubobjectParser {
 
         @Override
         public Boolean getMFlag() {
-            return this.mflag;
+            return mflag;
         }
 
         @Override
         public Boolean getCFlag() {
-            return this.cflag;
+            return cflag;
         }
 
         @Override
         public NaiType getNaiType() {
-            return this.naiType;
+            return naiType;
         }
 
         @Override
         public Uint32 getSid() {
-            return this.sid;
+            return sid;
         }
 
         @Override
         public Nai getNai() {
-            return this.nai;
+            return nai;
         }
     }
 
@@ -172,36 +172,35 @@ public abstract class AbstractSrSubobjectParser {
     }
 
     private static Nai parseNai(final NaiType naiType, final ByteBuf buffer) {
-        switch (naiType) {
-            case Ipv4NodeId:
-                return new IpNodeIdBuilder().setIpAddress(new IpAddressNoZone(Ipv4Util.addressForByteBuf(buffer)))
-                        .build();
-            case Ipv6NodeId:
-                return new IpNodeIdBuilder().setIpAddress(new IpAddressNoZone(Ipv6Util.addressForByteBuf(buffer)))
-                        .build();
-            case Ipv4Adjacency:
-                return new IpAdjacencyBuilder()
-                        .setLocalIpAddress(new IpAddressNoZone(Ipv4Util.addressForByteBuf(buffer)))
-                        .setRemoteIpAddress(new IpAddressNoZone(Ipv4Util.addressForByteBuf(buffer))).build();
-            case Ipv6Adjacency:
-                return new IpAdjacencyBuilder()
-                        .setLocalIpAddress(new IpAddressNoZone(Ipv6Util.addressForByteBuf(buffer)))
-                        .setRemoteIpAddress(new IpAddressNoZone(Ipv6Util.addressForByteBuf(buffer))).build();
-            case Unnumbered:
-                return new UnnumberedAdjacencyBuilder()
-                        .setLocalNodeId(ByteBufUtils.readUint32(buffer))
-                        .setLocalInterfaceId(ByteBufUtils.readUint32(buffer))
-                        .setRemoteNodeId(ByteBufUtils.readUint32(buffer))
-                        .setRemoteInterfaceId(ByteBufUtils.readUint32(buffer)).build();
-            case Ipv6Local:
-                return new Ipv6LocalBuilder()
-                        .setLocalIpv6Address(Ipv6Util.addressForByteBuf(buffer))
-                        .setLocalId(ByteBufUtils.readUint32(buffer))
-                        .setRemoteIpv6Address(Ipv6Util.addressForByteBuf(buffer))
-                        .setRemoteId(ByteBufUtils.readUint32(buffer)).build();
-            default:
-                return null;
-        }
+        return switch (naiType) {
+            case Ipv4NodeId -> new IpNodeIdBuilder()
+                .setIpAddress(new IpAddressNoZone(Ipv4Util.addressForByteBuf(buffer)))
+                .build();
+            case Ipv6NodeId -> new IpNodeIdBuilder()
+                .setIpAddress(new IpAddressNoZone(Ipv6Util.addressForByteBuf(buffer)))
+                .build();
+            case Ipv4Adjacency -> new IpAdjacencyBuilder()
+                .setLocalIpAddress(new IpAddressNoZone(Ipv4Util.addressForByteBuf(buffer)))
+                .setRemoteIpAddress(new IpAddressNoZone(Ipv4Util.addressForByteBuf(buffer)))
+                .build();
+            case Ipv6Adjacency -> new IpAdjacencyBuilder()
+                .setLocalIpAddress(new IpAddressNoZone(Ipv6Util.addressForByteBuf(buffer)))
+                .setRemoteIpAddress(new IpAddressNoZone(Ipv6Util.addressForByteBuf(buffer)))
+                .build();
+            case Unnumbered -> new UnnumberedAdjacencyBuilder()
+                .setLocalNodeId(ByteBufUtils.readUint32(buffer))
+                .setLocalInterfaceId(ByteBufUtils.readUint32(buffer))
+                .setRemoteNodeId(ByteBufUtils.readUint32(buffer))
+                .setRemoteInterfaceId(ByteBufUtils.readUint32(buffer))
+                .build();
+            case Ipv6Local -> new Ipv6LocalBuilder()
+                .setLocalIpv6Address(Ipv6Util.addressForByteBuf(buffer))
+                .setLocalId(ByteBufUtils.readUint32(buffer))
+                .setRemoteIpv6Address(Ipv6Util.addressForByteBuf(buffer))
+                .setRemoteId(ByteBufUtils.readUint32(buffer))
+                .build();
+            default -> null;
+        };
     }
 
     protected static SrSubobject parseSrSubobject(final ByteBuf buffer) throws PCEPDeserializerException {
index 040be8a2f4235575bb16511da42ee00c010082c0..dc59423e8834e62dd456d2b4263489ee930020fc 100644 (file)
@@ -7,12 +7,13 @@
  */
 package org.opendaylight.protocol.pcep.segment.routing;
 
-import com.google.common.base.Preconditions;
+import static com.google.common.base.Preconditions.checkArgument;
+
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectUtil;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.SrSubobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.add.lsp.input.arguments.ero.subobject.subobject.type.SrEroTypeBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
@@ -29,23 +30,23 @@ public class SrEroSubobjectParser extends AbstractSrSubobjectParser implements E
     private final int type;
 
     SrEroSubobjectParser() {
-        this.type = IANA_TYPE;
+        type = IANA_TYPE;
     }
 
     @Deprecated
     SrEroSubobjectParser(final boolean isIanaAssignedType) {
-        this.type = isIanaAssignedType ? IANA_TYPE : LEGACY_TYPE;
+        type = isIanaAssignedType ? IANA_TYPE : LEGACY_TYPE;
     }
 
     @Override
     public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
-        Preconditions.checkArgument(subobject.getSubobjectType() instanceof SrSubobject,
+        checkArgument(subobject.getSubobjectType() instanceof SrSubobject,
                 "Unknown subobject instance. Passed %s. Needed SrSubobject.", subobject.getSubobjectType()
                         .getClass());
 
         final SrSubobject srSubobject = (SrSubobject) subobject.getSubobjectType();
         final ByteBuf body = serializeSubobject(srSubobject);
-        EROSubobjectUtil.formatSubobject(this.type, subobject.getLoose(), body, buffer);
+        EROSubobjectUtil.formatSubobject(type, subobject.getLoose(), body, buffer);
     }
 
     @Override
@@ -59,6 +60,6 @@ public class SrEroSubobjectParser extends AbstractSrSubobjectParser implements E
 
     @Deprecated
     public int getCodePoint() {
-        return this.type;
+        return type;
     }
 }
\ No newline at end of file
index 29445f7e31e25b9e0fd29fcb33d71e40e46efb46..b810dc7b19115c1eee2797770ca590a202272731 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.TlvUtil;
index 26b715b679efd56d626aad60019f9defb66e9677..ae6ca8177f12872e3a18cf27444b5464ae8ef995 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.protocol.pcep.segment.routing;
 import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectUtil;
@@ -31,34 +31,31 @@ public class SrRroSubobjectParser extends AbstractSrSubobjectParser implements R
     private final int type;
 
     SrRroSubobjectParser() {
-        this.type = IANA_TYPE;
+        type = IANA_TYPE;
     }
 
     @Deprecated
     SrRroSubobjectParser(final boolean isIanaAssignedType) {
-        this.type = isIanaAssignedType ? IANA_TYPE : LEGACY_TYPE;
+        type = isIanaAssignedType ? IANA_TYPE : LEGACY_TYPE;
     }
 
     @Override
-    public void serializeSubobject(Subobject subobject, ByteBuf buffer) {
+    public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
         final SubobjectType subobjType = subobject.getSubobjectType();
         checkArgument(subobjType instanceof SrSubobject, "Unknown subobject instance. Passed %s. Needed SrSubobject.",
             subobjType.getClass());
         final SrSubobject srSubobject = (SrSubobject) subobjType;
         final ByteBuf body = serializeSubobject(srSubobject);
-        RROSubobjectUtil.formatSubobject(this.type, body, buffer);
+        RROSubobjectUtil.formatSubobject(type, body, buffer);
     }
 
     @Override
     public Subobject parseSubobject(final ByteBuf buffer) throws PCEPDeserializerException {
-        final SrRroTypeBuilder srRroSubobjectBuilder = new SrRroTypeBuilder(parseSrSubobject(buffer));
-        final SubobjectBuilder subobjectBuilder = new SubobjectBuilder();
-        subobjectBuilder.setSubobjectType(srRroSubobjectBuilder.build());
-        return subobjectBuilder.build();
+        return new SubobjectBuilder().setSubobjectType(new SrRroTypeBuilder(parseSrSubobject(buffer)).build()).build();
     }
 
     @Deprecated
     public int getCodePoint() {
-        return this.type;
+        return type;
     }
 }
index 68bae5c1787f9bac9a75a69930735da9521e986b..15e007c6c93d70cd007a4aa0efd69a10ef5b22cd 100644 (file)
@@ -14,7 +14,7 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
@@ -101,10 +101,10 @@ public class SrEroSubobjectParserTest {
 
     @Before
     public void setUp() {
-        this.ctx = new SimplePCEPExtensionProviderContext();
-        this.act = new SegmentRoutingActivator();
-        this.act.start(this.ctx);
-        this.parser = new SrEroSubobjectParser();
+        ctx = new SimplePCEPExtensionProviderContext();
+        act = new SegmentRoutingActivator();
+        act.start(ctx);
+        parser = new SrEroSubobjectParser();
     }
 
     @Test
@@ -118,10 +118,10 @@ public class SrEroSubobjectParserTest {
                     .build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_ERO_SUBOBJECT_WITH_IPV4_NODEID, 2)), false));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_ERO_SUBOBJECT_WITH_IPV4_NODEID, ByteArray.getAllBytes(buffer));
     }
 
@@ -136,10 +136,10 @@ public class SrEroSubobjectParserTest {
                     new Ipv6AddressNoZone("fe80:cd00::211e:729c"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_ERO_SUBOBJECT_WITH_IPV6_NODEID, 2)), false));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_ERO_SUBOBJECT_WITH_IPV6_NODEID, ByteArray.getAllBytes(buffer));
     }
 
@@ -155,10 +155,10 @@ public class SrEroSubobjectParserTest {
                     .setRemoteIpAddress(new IpAddressNoZone(new Ipv4AddressNoZone("74.125.43.100"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_ERO_SUBOBJECT_WITH_IPV4_ADJ, 2)), false));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_ERO_SUBOBJECT_WITH_IPV4_ADJ, ByteArray.getAllBytes(buffer));
     }
 
@@ -175,10 +175,10 @@ public class SrEroSubobjectParserTest {
                     .build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_ERO_SUBOBJECT_WITH_IPV6_ADJ, 2)), false));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_ERO_SUBOBJECT_WITH_IPV6_ADJ, ByteArray.getAllBytes(buffer));
     }
 
@@ -195,10 +195,10 @@ public class SrEroSubobjectParserTest {
                     .build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_ERO_SUBOBJECT_WITH_UNNUMBERED, 2)), false));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_ERO_SUBOBJECT_WITH_UNNUMBERED, ByteArray.getAllBytes(buffer));
     }
 
@@ -211,10 +211,10 @@ public class SrEroSubobjectParserTest {
                 .setMFlag(false);
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_ERO_SUBOBJECT_WITHOUT_NAI, 2)), false));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_ERO_SUBOBJECT_WITHOUT_NAI, ByteArray.getAllBytes(buffer));
     }
 
@@ -228,10 +228,10 @@ public class SrEroSubobjectParserTest {
                     new Ipv4AddressNoZone("74.125.43.99"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_ERO_SUBOBJECT_WITHOUT_SID, 2)), false));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_ERO_SUBOBJECT_WITHOUT_SID, ByteArray.getAllBytes(buffer));
     }
 
@@ -246,10 +246,10 @@ public class SrEroSubobjectParserTest {
                     .build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build()).setLoose(false);
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_ERO_SUBOBJECT_WITH_IPV4_NODEID_MFLAG, 2)), false));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_ERO_SUBOBJECT_WITH_IPV4_NODEID_MFLAG_AFTER, ByteArray.getAllBytes(buffer));
     }
 }
index 0605520055c2e08841e099adce9e6b1cb4dd8836..e2d443a943d9afc7de30292457d4a0716f43bd29 100644 (file)
@@ -17,9 +17,9 @@ import java.util.ArrayList;
 import java.util.List;
 import org.junit.Before;
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.parser.object.PCEPExplicitRouteObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectHeaderImpl;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
@@ -66,17 +66,17 @@ public class SrObjectParserTest {
 
     @Before
     public void setUp() {
-        this.ctx = new SimplePCEPExtensionProviderContext();
-        this.act = new SegmentRoutingActivator();
-        this.act.start(this.ctx);
-        this.tlvRegistry = this.ctx.getTlvHandlerRegistry();
-        this.viTlvRegistry = this.ctx.getVendorInformationTlvRegistry();
+        ctx = new SimplePCEPExtensionProviderContext();
+        act = new SegmentRoutingActivator();
+        act.start(ctx);
+        tlvRegistry = ctx.getTlvHandlerRegistry();
+        viTlvRegistry = ctx.getVendorInformationTlvRegistry();
     }
 
     @Test
     public void testOpenObjectWithSpcTlv() throws PCEPDeserializerException {
-        final PcepOpenObjectWithSpcTlvParser parser = new PcepOpenObjectWithSpcTlvParser(this.tlvRegistry,
-            this.viTlvRegistry);
+        final PcepOpenObjectWithSpcTlvParser parser = new PcepOpenObjectWithSpcTlvParser(tlvRegistry,
+            viTlvRegistry);
 
         final OpenBuilder builder = new OpenBuilder()
                 .setProcessingRule(false)
@@ -108,7 +108,7 @@ public class SrObjectParserTest {
     @Test
     public void testSrEroObjectWithSubobjects() throws PCEPDeserializerException {
         final PCEPExplicitRouteObjectParser parser = new PCEPExplicitRouteObjectParser(
-            this.ctx.getEROSubobjectHandlerRegistry());
+            ctx.getEROSubobjectHandlerRegistry());
 
         final EroBuilder builder = new EroBuilder();
         builder.setProcessingRule(false);
@@ -139,7 +139,7 @@ public class SrObjectParserTest {
     @Test
     public void testSrEroSerializerWithUpdateLspAugmentation() throws PCEPDeserializerException {
         final PCEPExplicitRouteObjectParser parser = new PCEPExplicitRouteObjectParser(
-            this.ctx.getEROSubobjectHandlerRegistry());
+            ctx.getEROSubobjectHandlerRegistry());
 
         final EroBuilder builder = new EroBuilder();
         builder.setProcessingRule(false);
index e2b8b9457f5455c69feb79bb30a0347c7f8fb730..df83687a7655a381f19529cd7f64950681469f73 100644 (file)
@@ -14,7 +14,7 @@ import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Before;
 import org.junit.Test;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressNoZone;
@@ -90,10 +90,10 @@ public class SrRroSubobjectParserTest {
 
     @Before
     public void setUp() {
-        this.ctx = new SimplePCEPExtensionProviderContext();
-        this.act = new SegmentRoutingActivator();
-        this.act.start(this.ctx);
-        this.parser = new SrRroSubobjectParser();
+        ctx = new SimplePCEPExtensionProviderContext();
+        act = new SegmentRoutingActivator();
+        act.start(ctx);
+        parser = new SrRroSubobjectParser();
     }
 
     @Test
@@ -107,10 +107,10 @@ public class SrRroSubobjectParserTest {
                     .build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_RRO_SUBOBJECT_WITH_IPV4_NODEID, 2))));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_RRO_SUBOBJECT_WITH_IPV4_NODEID, ByteArray.getAllBytes(buffer));
     }
 
@@ -125,10 +125,10 @@ public class SrRroSubobjectParserTest {
                     new Ipv6AddressNoZone("fe80:cd00::211e:729c"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_RROR_SUBOBJECT_WITH_IPV6_NODEID, 2))));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_RROR_SUBOBJECT_WITH_IPV6_NODEID, ByteArray.getAllBytes(buffer));
     }
 
@@ -144,10 +144,10 @@ public class SrRroSubobjectParserTest {
                     .setRemoteIpAddress(new IpAddressNoZone(new Ipv4AddressNoZone("74.125.43.100"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_RRO_SUBOBJECT_WITH_IPV4_ADJ, 2))));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_RRO_SUBOBJECT_WITH_IPV4_ADJ, ByteArray.getAllBytes(buffer));
     }
 
@@ -163,10 +163,10 @@ public class SrRroSubobjectParserTest {
                     .setRemoteIpAddress(new IpAddressNoZone(new Ipv6AddressNoZone("fe80:cd00::211e:729d"))).build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_RRO_SUBOBJECT_WITH_IPV6_ADJ, 2))));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_RRO_SUBOBJECT_WITH_IPV6_ADJ, ByteArray.getAllBytes(buffer));
     }
 
@@ -183,10 +183,10 @@ public class SrRroSubobjectParserTest {
                     .build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_RRO_SUBOBJECT_WIT_UNNUMBERED, 2))));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_RRO_SUBOBJECT_WIT_UNNUMBERED, ByteArray.getAllBytes(buffer));
     }
 
@@ -199,10 +199,10 @@ public class SrRroSubobjectParserTest {
                 .setMFlag(true);
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_RRO_SUBOBJECT_WITHOUT_NAI, 2))));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_RRO_SUBOBJECT_WITHOUT_NAI, ByteArray.getAllBytes(buffer));
     }
 
@@ -216,10 +216,10 @@ public class SrRroSubobjectParserTest {
                     .build());
         final SubobjectBuilder subobjBuilder = new SubobjectBuilder().setSubobjectType(builder.build());
 
-        assertEquals(subobjBuilder.build(), this.parser.parseSubobject(Unpooled.wrappedBuffer(
+        assertEquals(subobjBuilder.build(), parser.parseSubobject(Unpooled.wrappedBuffer(
             ByteArray.cutBytes(SR_RRO_SUBOBJECT_WITHOUT_SID, 2))));
         final ByteBuf buffer = Unpooled.buffer();
-        this.parser.serializeSubobject(subobjBuilder.build(), buffer);
+        parser.serializeSubobject(subobjBuilder.build(), buffer);
         assertArrayEquals(SR_RRO_SUBOBJECT_WITHOUT_SID, ByteArray.getAllBytes(buffer));
     }
 }
index 361094a69bd3b8688c81dc5ed60f6ea92e770538..b283ba98a5cbdcbbc8735e7895106ba2a61a3406 100644 (file)
@@ -13,7 +13,7 @@ import static org.junit.Assert.assertEquals;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
 import org.junit.Test;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapability;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.segment.routing.rev200720.sr.pce.capability.tlv.SrPceCapabilityBuilder;
index c49a203a65c1395ac433ac5bb65e80be4032b7ea..13e4187746bc22dc15184a50936d8551db949e4e 100644 (file)
@@ -11,6 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.SubobjectBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.PathKey;
index c07d5462c27b44b43a656047ca20bdbd2e766e12..c04659cac19dc3790b57fd0dcb8b93d61cb65c32 100644 (file)
@@ -17,6 +17,7 @@ import java.util.List;
 import java.util.Optional;
 import java.util.Queue;
 import org.eclipse.jdt.annotation.Nullable;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.util.BitArray;
 import org.opendaylight.protocol.util.ByteArray;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
index 0c688f9bae83fc0329a30c89bc827e34e328c1d4..e0f24c26401452cd0e104c4472298ffe3f5f7892 100644 (file)
@@ -15,6 +15,7 @@ import io.netty.buffer.ByteBufUtil;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Tlv;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.vendor.information.tlvs.VendorInformationTlv;
index 3f653f9bef8533018ed6d7a42d090da5c9cbb9c9..d175f2f6a65551047f9ed2b56eeacbffe5b3132e 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
 
 /**
index 6dd6c2b52b55dbcb3f75af9b5234d0b139101436..adc7f7e5968aa8071f5f03fd470578685d1f93e5 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
 
 /**
index 1bcaa1c77d65472d04cdd8c4b8acabe1b63968cb..c7ea156f6a0c91b8f556ed4dbc8d693726273cfd 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.vendor.information.EnterpriseSpecificInformation;
 
index 381bc9a73ff32c3b606b1ef0f6dce4324c4dcc00..de1c20228be98e1c5bb2ac7b861e7281bb851053 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.LabelType;
 
 public interface LabelParser {
index 06dd76116f826f1564a87adeb75354d5b856d377..9308d86c33ffcd6fc49a9841890a048dea78dea1 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.LabelType;
 
 public interface LabelRegistry {
index d2e4e7b01a60cdc9df52dd607708f5fe2208edfe..c70be962a98896bb919ced27c1554567b69044e1 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
 import java.util.List;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message;
 
 public interface MessageParser {
index 50f8fa2b51bc96fea366c9e1cc4ea76b405ad1aa..d9dc914ed20d4696fafbc986c4e3e50ab8cf4e6c 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
 
index 00d49cbe620a3810b4202910fcb772a10d407e96..fd908de8b081ee6b1239b5dc15d428c6d8c94b24 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
 
index cd1255dffbf383f51732aae890710e1f76d3cae1..6ddf22019d451d6692cd0fa74cb8381e907b4302 100644 (file)
@@ -7,6 +7,8 @@
  */
 package org.opendaylight.protocol.pcep.spi;
 
+import org.opendaylight.protocol.pcep.MessageRegistry;
+
 public interface PCEPExtensionConsumerContext {
 
     LabelRegistry getLabelHandlerRegistry();
index 5a8a4e8a5d1e642220c244a8099551939d8cf95c..8b6964eba5ea5799e46388c3443a207ec163f6b8 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.Subobject;
 
 /**
index 09c8f478840163bdb8c578cad69730cbb880a08b..4bb0c15cbf1c0798dd4b048cca8ed8d45b2b462f 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.reported.route.object.rro.Subobject;
 
 /**
index 0485b3ee5ea009c299ba0a617cf628caad93ca0b..d1ba094a443c3b7a4e0416bf7448192e6c39d89d 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Tlv;
 
 public interface TlvParser {
index 47e341735a5c1106dc515100742158cdb03743b6..f42beeaedb6f353cbed701b799b7d4281a3126ee 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Tlv;
 
 public interface TlvRegistry {
index 672a314cd80dfa5b4ba6a6f17bebac3edd7d17fd..5fbcf3103a0f733ae2879cf5602b486862d1bed5 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
 import java.util.Optional;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
index 259e0b6c36f011dd61fb6b4ccf2cb3e0006795ed..9269b25bb4a5c4b0d5a0d03e77f3094e3cf0624f 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
 import java.util.Optional;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.vendor.information.tlvs.VendorInformationTlv;
 
index acd3ac016b01b26d8f894620b2a1345141055ee0..6a3a60f757fe299d7398b6b97266a9e38d3c4d1b 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.exclude.route.object.xro.Subobject;
 
 public interface XROSubobjectParser {
index 98b7cfa34266f0e910c14b81df0c6261829ec3ad..252aa473410382308fd16f5ec340dfdf9126cfc8 100644 (file)
@@ -8,6 +8,7 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import io.netty.buffer.ByteBuf;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.exclude.route.object.xro.Subobject;
 
 public interface XROSubobjectRegistry {
index f682f12abb374cad23403340b8c303038241a3ce..96fa1f67f6ea1c0c8d71f45f8695e4ffcab1933c 100644 (file)
@@ -15,9 +15,9 @@ import javax.inject.Inject;
 import javax.inject.Singleton;
 import org.eclipse.jdt.annotation.NonNull;
 import org.kohsuke.MetaInfServices;
+import org.opendaylight.protocol.pcep.MessageRegistry;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.LabelRegistry;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionConsumerContext;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
index bcd50e57427794d2216070210a854f9e89d3f763..c3203d10f8991476b86af56704a1ae369795beeb 100644 (file)
@@ -11,10 +11,10 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.concepts.HandlerRegistry;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Values;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.explicit.route.object.ero.Subobject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.SubobjectType;
index a047a4cef4a9083149a22bce3f533c53aba46234..2b669ce103a0097540986dd1944da38e22166e09 100644 (file)
@@ -11,10 +11,10 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.concepts.HandlerRegistry;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.LabelParser;
 import org.opendaylight.protocol.pcep.spi.LabelRegistry;
 import org.opendaylight.protocol.pcep.spi.LabelSerializer;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Values;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.LabelType;
 import org.opendaylight.yangtools.concepts.Registration;
index 400908732b327cdae12852f20e14e680ef7a6ecf..0d0d7c28bd93f52857f964d29db5c4a440472319 100644 (file)
@@ -12,10 +12,10 @@ import static com.google.common.base.Preconditions.checkArgument;
 import io.netty.buffer.ByteBuf;
 import java.util.List;
 import org.opendaylight.protocol.concepts.HandlerRegistry;
+import org.opendaylight.protocol.pcep.MessageRegistry;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.MessageParser;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
 import org.opendaylight.protocol.pcep.spi.MessageSerializer;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.util.Values;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Message;
 import org.opendaylight.yangtools.concepts.Registration;
index 127fe3683600df0ff8f2608ea65464fe1d54037e..5ceb65c01e276c6de3b2e640f4610b0392b3a4a5 100644 (file)
@@ -13,10 +13,10 @@ import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import java.util.Optional;
 import org.opendaylight.protocol.concepts.HandlerRegistry;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.ObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
 import org.opendaylight.protocol.pcep.spi.VendorInformationObjectRegistry;
index 08a5952e6a1e25d6aa5cf918ee6a83c81f02ffca..76ff6d823161ec2a035ecc23ee02fb38a86f229d 100644 (file)
@@ -7,6 +7,7 @@
  */
 package org.opendaylight.protocol.pcep.spi.pojo;
 
+import org.opendaylight.protocol.pcep.MessageRegistry;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
@@ -14,7 +15,6 @@ import org.opendaylight.protocol.pcep.spi.LabelParser;
 import org.opendaylight.protocol.pcep.spi.LabelRegistry;
 import org.opendaylight.protocol.pcep.spi.LabelSerializer;
 import org.opendaylight.protocol.pcep.spi.MessageParser;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
 import org.opendaylight.protocol.pcep.spi.MessageSerializer;
 import org.opendaylight.protocol.pcep.spi.ObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectRegistry;
index c02d942a3b03a6cab31f3db4849c88a0c3375924..b8497ef7c7855288c88d34b02af439675125d223 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.concepts.HandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
index c848ddd2cc4d58d66c4582a58a7989f70374bae7..51a8afc05ff1c25eb6bf0157baf1eb36c05bbd9b 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.concepts.HandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvRegistry;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
index 9597d0f757624ba3aac2f13fa2e1c0d601c14ae6..f66fb585e33d11b9abcd905dbd40cbe07bff17ef 100644 (file)
@@ -10,9 +10,9 @@ package org.opendaylight.protocol.pcep.spi.pojo;
 import io.netty.buffer.ByteBuf;
 import java.util.Optional;
 import org.opendaylight.protocol.concepts.HandlerRegistry;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.ObjectParser;
 import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.PCEPErrors;
 import org.opendaylight.protocol.pcep.spi.UnknownObject;
 import org.opendaylight.protocol.pcep.spi.VendorInformationObjectRegistry;
index b5da4d22826e9d0c69089ce999f77f66ecf047d2..ed7935f0442a3e72b0cbcb8fe61f13d0b1873a5b 100644 (file)
@@ -10,7 +10,7 @@ package org.opendaylight.protocol.pcep.spi.pojo;
 import io.netty.buffer.ByteBuf;
 import java.util.Optional;
 import org.opendaylight.protocol.concepts.HandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
 import org.opendaylight.protocol.pcep.spi.VendorInformationTlvRegistry;
index f435aa4cfcfb8898d7635615a7cd7d1ed36fe8e0..9a19d836c30af70f6bef9ae4e14917cd6c552540 100644 (file)
@@ -11,7 +11,7 @@ import static com.google.common.base.Preconditions.checkArgument;
 
 import io.netty.buffer.ByteBuf;
 import org.opendaylight.protocol.concepts.HandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectRegistry;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer;
index 320e08657c1888c0b23c6c3ddd046b4bc21a116f..2003cab97bea9eb39a575409bde399af27fff73d 100644 (file)
@@ -13,6 +13,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
 import org.junit.Test;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.close.object.CCloseBuilder;
 
index ec424a4839f9f44fa57ae82719b8a997b2e4285d..a039744c79c086b522b036c11854a2e4b9dd6912 100644 (file)
@@ -27,6 +27,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.Pcerr;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.Pcrep;
index b1bf06f64ae6ec25cd035830c4a557e26a827782..c7f4e1f51cc40da04fd59e9dbd8636c65c463f1d 100644 (file)
@@ -25,6 +25,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
index adf1b4e35a970926494b13b204cb32526a6d63c7..c691324ef8b7d2bf3a826df1f07bb68ba8c043ed 100644 (file)
@@ -22,6 +22,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
+import org.opendaylight.protocol.pcep.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.pojo.SimplePCEPExtensionProviderContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.iana.rev130816.EnterpriseNumber;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.message.rev181109.Keepalive;
index a532e1c4f1d50d207eee5b41768c97215000dead..7a532859eecdfeba0bd8aba5f2f410cf245ef289 100644 (file)
@@ -15,13 +15,13 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.ServiceLoader;
 import java.util.concurrent.ExecutionException;
+import org.opendaylight.protocol.pcep.MessageRegistry;
 import org.opendaylight.protocol.pcep.PCEPCapability;
 import org.opendaylight.protocol.pcep.PCEPSessionProposalFactory;
 import org.opendaylight.protocol.pcep.ietf.stateful.PCEPStatefulCapability;
 import org.opendaylight.protocol.pcep.impl.BasePCEPSessionProposalFactory;
 import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory;
 import org.opendaylight.protocol.pcep.impl.PCEPDispatcherImpl;
-import org.opendaylight.protocol.pcep.spi.MessageRegistry;
 import org.opendaylight.protocol.pcep.spi.PCEPExtensionConsumerContext;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.config.rev230112.PcepSessionErrorPolicy;
 import org.opendaylight.yangtools.yang.common.Uint16;