BUG-113: convert PCEP to use activators 70/1970/2
authorRobert Varga <rovarga@cisco.com>
Thu, 17 Oct 2013 13:27:48 +0000 (15:27 +0200)
committerRobert Varga <rovarga@cisco.com>
Sat, 19 Oct 2013 12:38:08 +0000 (14:38 +0200)
Change-Id: If0dcf681de77fc3a991a8ff14cab692ec8214fe2
Signed-off-by: Robert Varga <rovarga@cisco.com>
36 files changed:
bgp/parser-impl/pom.xml
bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/BundleActivator.java [moved from bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/OSGiActivator.java with 91% similarity]
integration-tests/pom.xml
pcep/impl/pom.xml
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/Activator.java [new file with mode: 0644]
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/BundleActivator.java [new file with mode: 0644]
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPDispatcherImpl.java
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPImplActivator.java [deleted file]
pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SingletonPCEPProviderContext.java [deleted file]
pcep/impl/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator [new file with mode: 0644]
pcep/spi/pom.xml
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/EROSubobjectHandlerRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/LabelHandlerRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/MessageHandlerRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/ObjectHandlerRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPExtensionConsumerActivator.java [moved from pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPProviderActivator.java with 77% similarity]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPExtensionConsumerContext.java [moved from pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPProviderContext.java with 94% similarity]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPExtensionProviderActivator.java [new file with mode: 0644]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPExtensionProviderContext.java [new file with mode: 0644]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/RROSubobjectHandlerRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/TlvHandlerRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/XROSubobjectHandlerRegistry.java
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/AbstractOSGiPCEPExtensionConsumerActivator.java [new file with mode: 0644]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/AbstractOSGiPCEPExtensionProviderActivator.java [new file with mode: 0644]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/OSGiPCEPExtensionConsumerContext.java [new file with mode: 0644]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/OSGiPCEPExtensionProviderContext.java [new file with mode: 0644]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/PCEPExtensionProviderContextImpl.java [new file with mode: 0644]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleEROSubobjectHandlerRegistry.java [moved from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleEROSubobjectHandlerFactory.java with 92% similarity]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleLabelHandlerRegistry.java [moved from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleLabelHandlerRegistry.java with 96% similarity]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleMessageHandlerRegistry.java [moved from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleMessageHandlerRegistry.java with 96% similarity]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleObjectHandlerRegistry.java [moved from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleObjectHandlerRegistry.java with 96% similarity]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleRROSubobjectHandlerRegistry.java [moved from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleRROSubobjectHandlerFactory.java with 92% similarity]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleTlvHandlerRegistry.java [moved from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleTlvHandlerRegistry.java with 95% similarity]
pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleXROSubobjectHandlerRegistry.java [moved from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleXROSubobjectHandlerFactory.java with 92% similarity]
pcep/testtool/src/main/java/org/opendaylight/protocol/pcep/testtool/Main.java
pcep/testtool/src/test/java/org/opendaylight/protocol/pcep/testtool/PCCMock.java

index de615fc472b8756a0d4c50c26de19cbc27b78628..02a508c508e38505a5cb27ee1a6580c2a718c070 100644 (file)
                                                <Export-Package>
                                                        org.opendaylight.protocol.bgp.parser.impl.*
                                                </Export-Package>
-                        <Activator>org.opendaylight.protocol.bgp.parser.impl.OSGiActivator</Activator>
+                        <Activator>org.opendaylight.protocol.bgp.parser.impl.BundleActivator</Activator>
                                        </instructions>
                                </configuration>
                        </plugin>
similarity index 91%
rename from bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/OSGiActivator.java
rename to bgp/parser-impl/src/main/java/org/opendaylight/protocol/bgp/parser/impl/BundleActivator.java
index c07792e848f0f01f3ffe9e74f6f58773fc74615c..b528a0da903ce1cafa5e74e2ecf3db7eba5528df 100644 (file)
@@ -11,7 +11,7 @@ import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderActivator;
 import org.opendaylight.protocol.bgp.parser.spi.BGPExtensionProviderContext;
 import org.opendaylight.protocol.bgp.parser.spi.osgi.AbstractOSGiBGPExtensionProviderActivator;
 
-public final class OSGiActivator extends AbstractOSGiBGPExtensionProviderActivator {
+public final class BundleActivator extends AbstractOSGiBGPExtensionProviderActivator {
        private final BGPExtensionProviderActivator activator = new Activator();
 
        @Override
index 0da09394d18f40bc45a464a04547ba7279e658ad..3345a435694570d29ca8b2a9ce714ed5e06942e5 100644 (file)
             <scope>test</scope>
         </dependency>
 
+        <dependency>
+                       <groupId>${project.groupId}</groupId>
+            <artifactId>programming-api</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+                       <groupId>${project.groupId}</groupId>
+            <artifactId>programming-tunnel-api</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+                       <groupId>${project.groupId}</groupId>
+            <artifactId>topology-api</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+                       <groupId>${project.groupId}</groupId>
+            <artifactId>topology-segment-routing</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+                       <groupId>${project.groupId}</groupId>
+            <artifactId>topology-tunnel-api</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+                       <groupId>${project.groupId}</groupId>
+            <artifactId>topology-tunnel-pcep</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.opendaylight.controller</groupId>
             <artifactId>sal-binding-broker-impl</artifactId>
index 39aa9f233bd0bbf23f2dd1f6fcfddb2eaf9e56ac..ef682fd2c093288e83d4c8a72f1fa4f5fc6ed9db 100644 (file)
             <groupId>org.opendaylight.yangtools.model</groupId>
             <artifactId>ietf-inet-types</artifactId>
             <version>2010.09.24-SNAPSHOT</version>
+        </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>${osgi.version}</version>
+            <scope>provided</scope>
         </dependency>
                <dependency>
                        <groupId>org.mockito</groupId>
                                <configuration>
                                        <instructions>
                                                <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
-                                               <Export-Package>
+                                               <Private-Package>
                                                        org.opendaylight.protocol.pcep.impl.*,
-                                               </Export-Package>
+                                               </Private-Package>
+                        <Activator>org.opendaylight.protocol.pcep.parser.impl.BundleActivator</Activator>
                                        </instructions>
                                </configuration>
                        </plugin>
diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/Activator.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/Activator.java
new file mode 100644 (file)
index 0000000..02a7d2e
--- /dev/null
@@ -0,0 +1,337 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.opendaylight.protocol.pcep.impl.message.PCCreateMessageParser;
+import org.opendaylight.protocol.pcep.impl.message.PCEPCloseMessageParser;
+import org.opendaylight.protocol.pcep.impl.message.PCEPErrorMessageParser;
+import org.opendaylight.protocol.pcep.impl.message.PCEPKeepAliveMessageParser;
+import org.opendaylight.protocol.pcep.impl.message.PCEPNotificationMessageParser;
+import org.opendaylight.protocol.pcep.impl.message.PCEPOpenMessageParser;
+import org.opendaylight.protocol.pcep.impl.message.PCEPReplyMessageParser;
+import org.opendaylight.protocol.pcep.impl.message.PCEPReportMessageParser;
+import org.opendaylight.protocol.pcep.impl.message.PCEPRequestMessageParser;
+import org.opendaylight.protocol.pcep.impl.message.PCEPUpdateRequestMessageParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPBandwidthObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPClassTypeObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPCloseObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPEndPointsObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPErrorObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPExcludeRouteObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPExplicitRouteObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPGlobalConstraintsObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPIncludeRouteObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPLoadBalancingObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPLspObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPLspaObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPMetricObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPNoPathObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPNotificationObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPObjectiveFunctionObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPOpenObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPPathKeyObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPReportedRouteObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPRequestParameterObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPSrpObjectParser;
+import org.opendaylight.protocol.pcep.impl.object.PCEPSvecObjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.EROAsNumberSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.EROIpPrefixSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.EROLabelSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.EROPathKeySubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.EROUnnumberedInterfaceSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.GeneralizedLabelChannelSetParser;
+import org.opendaylight.protocol.pcep.impl.subobject.GeneralizedLabelParser;
+import org.opendaylight.protocol.pcep.impl.subobject.RROAsNumberSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.RROIpPrefixSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.RROLabelSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.RROPathKeySubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.RROUnnumberedInterfaceSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.Type1LabelParser;
+import org.opendaylight.protocol.pcep.impl.subobject.WavebandSwitchingLabelParser;
+import org.opendaylight.protocol.pcep.impl.subobject.XROAsNumberSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.XROIpPrefixSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.XROPathKeySubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.XROSRLGSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.subobject.XROUnnumberedInterfaceSubobjectParser;
+import org.opendaylight.protocol.pcep.impl.tlv.LSPIdentifierIPv4TlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.LSPIdentifierIPv6TlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.LspDbVersionTlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.LspSymbolicNameTlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.LspUpdateErrorTlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.NoPathVectorTlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.OFListTlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.OrderTlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.OverloadedDurationTlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.PCEStatefulCapabilityTlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.PredundancyGroupTlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.RSVPErrorSpecTlvParser;
+import org.opendaylight.protocol.pcep.impl.tlv.ReqMissingTlvParser;
+import org.opendaylight.protocol.pcep.spi.EROSubobjectHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.LabelHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
+import org.opendaylight.protocol.pcep.spi.RROSubobjectHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.XROSubobjectHandlerRegistry;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.BandwidthObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ClasstypeObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.CloseMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.CloseObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.EndpointsObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ExcludeRouteObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ExplicitRouteObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.GcObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.IncludeRouteObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.KeepaliveMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LoadBalancingObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspDbVersionTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspErrorCodeTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspIdentifiersTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspaObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.MetricObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.NoPathObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.NoPathVectorTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.NotificationObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OfListTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OfObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OpenMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OpenObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OrderTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OverloadDurationTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PathKeyObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PathKeySubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcepErrorObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcerrMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcinitiateMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcntfMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcrepMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcreqMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcrptMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcupdMessage;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PredundancyGroupIdTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ReportedRouteObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ReqMissingTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.RpObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.RsvpErrorSpecTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.SrpObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.StatefulCapabilityTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.SvecObject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.SymbolicPathNameTlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.AsNumberSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.GeneralizedChannelSetLabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.GeneralizedLabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.IpPrefixSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.LabelSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.SrlgSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.Type1Label;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.UnnumberedSubobject;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.WavebandSwitchingLabel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.base.Preconditions;
+
+public final class Activator implements PCEPExtensionProviderActivator {
+       private static final Logger logger = LoggerFactory.getLogger(Activator.class);
+       private List<AutoCloseable> registrations;
+
+       @Override
+       public void start(final PCEPExtensionProviderContext context) {
+               Preconditions.checkState(this.registrations == null);
+               final List<AutoCloseable> regs = new ArrayList<>();
+
+               final LabelHandlerRegistry labelReg = context.getLabelHandlerRegistry();
+               context.registerLabelParser(Type1LabelParser.CTYPE, new Type1LabelParser());
+               context.registerLabelParser(GeneralizedLabelParser.CTYPE, new GeneralizedLabelParser());
+               context.registerLabelParser(WavebandSwitchingLabelParser.CTYPE, new WavebandSwitchingLabelParser());
+               context.registerLabelParser(GeneralizedLabelChannelSetParser.CTYPE, new GeneralizedLabelChannelSetParser());
+
+               context.registerLabelSerializer(Type1Label.class, new Type1LabelParser());
+               context.registerLabelSerializer(GeneralizedLabel.class, new GeneralizedLabelParser());
+               context.registerLabelSerializer(WavebandSwitchingLabel.class, new WavebandSwitchingLabelParser());
+               context.registerLabelSerializer(GeneralizedChannelSetLabel.class, new GeneralizedLabelChannelSetParser());
+
+               final EROSubobjectHandlerRegistry eroSubReg = context.getEROSubobjectHandlerRegistry();
+               context.registerEROSubobjectParser(EROIpPrefixSubobjectParser.TYPE, new EROIpPrefixSubobjectParser());
+               context.registerEROSubobjectParser(EROIpPrefixSubobjectParser.TYPE6, new EROIpPrefixSubobjectParser());
+               context.registerEROSubobjectParser(EROAsNumberSubobjectParser.TYPE, new EROAsNumberSubobjectParser());
+               context.registerEROSubobjectParser(EROLabelSubobjectParser.TYPE, new EROLabelSubobjectParser(labelReg));
+               context.registerEROSubobjectParser(EROUnnumberedInterfaceSubobjectParser.TYPE, new EROUnnumberedInterfaceSubobjectParser());
+               context.registerEROSubobjectParser(EROPathKeySubobjectParser.TYPE, new EROPathKeySubobjectParser());
+               context.registerEROSubobjectParser(EROPathKeySubobjectParser.TYPE128, new EROPathKeySubobjectParser());
+
+               context.registerEROSubobjectSerializer(IpPrefixSubobject.class, new EROIpPrefixSubobjectParser());
+               context.registerEROSubobjectSerializer(AsNumberSubobject.class, new EROAsNumberSubobjectParser());
+               context.registerEROSubobjectSerializer(LabelSubobject.class, new EROLabelSubobjectParser(labelReg));
+               context.registerEROSubobjectSerializer(UnnumberedSubobject.class, new EROUnnumberedInterfaceSubobjectParser());
+               context.registerEROSubobjectSerializer(PathKeySubobject.class, new EROPathKeySubobjectParser());
+
+               final RROSubobjectHandlerRegistry rroSubReg = context.getRROSubobjectHandlerRegistry();
+               context.registerRROSubobjectParser(RROIpPrefixSubobjectParser.TYPE, new RROIpPrefixSubobjectParser());
+               context.registerRROSubobjectParser(RROIpPrefixSubobjectParser.TYPE6, new RROIpPrefixSubobjectParser());
+               context.registerRROSubobjectParser(RROLabelSubobjectParser.TYPE, new RROLabelSubobjectParser(labelReg));
+               context.registerRROSubobjectParser(RROAsNumberSubobjectParser.TYPE, new RROAsNumberSubobjectParser());
+               context.registerRROSubobjectParser(RROUnnumberedInterfaceSubobjectParser.TYPE, new RROUnnumberedInterfaceSubobjectParser());
+               context.registerRROSubobjectParser(RROPathKeySubobjectParser.TYPE, new RROPathKeySubobjectParser());
+               context.registerRROSubobjectParser(RROPathKeySubobjectParser.TYPE128, new RROPathKeySubobjectParser());
+
+               context.registerRROSubobjectSerializer(IpPrefixSubobject.class, new RROIpPrefixSubobjectParser());
+               context.registerRROSubobjectSerializer(LabelSubobject.class, new RROLabelSubobjectParser(labelReg));
+               context.registerRROSubobjectSerializer(AsNumberSubobject.class, new RROAsNumberSubobjectParser());
+               context.registerRROSubobjectSerializer(UnnumberedSubobject.class, new RROUnnumberedInterfaceSubobjectParser());
+               context.registerRROSubobjectSerializer(PathKeySubobject.class, new RROPathKeySubobjectParser());
+
+               final XROSubobjectHandlerRegistry xroSubReg = context.getXROSubobjectHandlerRegistry();
+               context.registerXROSubobjectParser(XROIpPrefixSubobjectParser.TYPE, new XROIpPrefixSubobjectParser());
+               context.registerXROSubobjectParser(XROIpPrefixSubobjectParser.TYPE6, new XROIpPrefixSubobjectParser());
+               context.registerXROSubobjectParser(XROAsNumberSubobjectParser.TYPE, new XROAsNumberSubobjectParser());
+               context.registerXROSubobjectParser(XROSRLGSubobjectParser.TYPE, new XROSRLGSubobjectParser());
+               context.registerXROSubobjectParser(XROUnnumberedInterfaceSubobjectParser.TYPE, new XROUnnumberedInterfaceSubobjectParser());
+               context.registerXROSubobjectParser(XROPathKeySubobjectParser.TYPE, new XROPathKeySubobjectParser());
+               context.registerXROSubobjectParser(XROPathKeySubobjectParser.TYPE128, new XROPathKeySubobjectParser());
+
+               context.registerXROSubobjectSerializer(IpPrefixSubobject.class, new XROIpPrefixSubobjectParser());
+               context.registerXROSubobjectSerializer(AsNumberSubobject.class, new XROAsNumberSubobjectParser());
+               context.registerXROSubobjectSerializer(SrlgSubobject.class, new XROSRLGSubobjectParser());
+               context.registerXROSubobjectSerializer(UnnumberedSubobject.class, new XROUnnumberedInterfaceSubobjectParser());
+               context.registerXROSubobjectSerializer(PathKeySubobject.class, new XROPathKeySubobjectParser());
+
+               final TlvHandlerRegistry tlvReg = context.getTlvHandlerRegistry();
+               context.registerTlvParser(NoPathVectorTlvParser.TYPE, new NoPathVectorTlvParser());
+               context.registerTlvParser(OverloadedDurationTlvParser.TYPE, new OverloadedDurationTlvParser());
+               context.registerTlvParser(ReqMissingTlvParser.TYPE, new ReqMissingTlvParser());
+               context.registerTlvParser(OFListTlvParser.TYPE, new OFListTlvParser());
+               context.registerTlvParser(OrderTlvParser.TYPE, new OrderTlvParser());
+               context.registerTlvParser(PCEStatefulCapabilityTlvParser.TYPE, new PCEStatefulCapabilityTlvParser());
+               context.registerTlvParser(LspSymbolicNameTlvParser.TYPE, new LspSymbolicNameTlvParser());
+               context.registerTlvParser(LSPIdentifierIPv4TlvParser.TYPE, new LSPIdentifierIPv4TlvParser());
+               context.registerTlvParser(LSPIdentifierIPv6TlvParser.TYPE, new LSPIdentifierIPv6TlvParser());
+               context.registerTlvParser(LspUpdateErrorTlvParser.TYPE, new LspUpdateErrorTlvParser());
+               context.registerTlvParser(RSVPErrorSpecTlvParser.TYPE, new RSVPErrorSpecTlvParser());
+               context.registerTlvParser(LspDbVersionTlvParser.TYPE, new LspDbVersionTlvParser());
+               context.registerTlvParser(PredundancyGroupTlvParser.TYPE, new PredundancyGroupTlvParser());
+
+               context.registerTlvSerializer(NoPathVectorTlv.class, new NoPathVectorTlvParser());
+               context.registerTlvSerializer(OverloadDurationTlv.class, new OverloadedDurationTlvParser());
+               context.registerTlvSerializer(ReqMissingTlv.class, new ReqMissingTlvParser());
+               context.registerTlvSerializer(OfListTlv.class, new OFListTlvParser());
+               context.registerTlvSerializer(OrderTlv.class, new OrderTlvParser());
+               context.registerTlvSerializer(StatefulCapabilityTlv.class, new PCEStatefulCapabilityTlvParser());
+               context.registerTlvSerializer(SymbolicPathNameTlv.class, new LspSymbolicNameTlvParser());
+               context.registerTlvSerializer(LspIdentifiersTlv.class, new LSPIdentifierIPv4TlvParser());
+               context.registerTlvSerializer(LspErrorCodeTlv.class, new LspUpdateErrorTlvParser());
+               context.registerTlvSerializer(RsvpErrorSpecTlv.class, new RSVPErrorSpecTlvParser());
+               context.registerTlvSerializer(LspDbVersionTlv.class, new LspDbVersionTlvParser());
+               context.registerTlvSerializer(PredundancyGroupIdTlv.class, new PredundancyGroupTlvParser());
+
+               final ObjectHandlerRegistry objReg = context.getObjectHandlerRegistry();
+               context.registerObjectParser(PCEPOpenObjectParser.CLASS, PCEPOpenObjectParser.TYPE, new PCEPOpenObjectParser(tlvReg));
+               context.registerObjectParser(PCEPRequestParameterObjectParser.CLASS, PCEPRequestParameterObjectParser.TYPE,
+                               new PCEPRequestParameterObjectParser(tlvReg));
+               context.registerObjectParser(PCEPNoPathObjectParser.CLASS, PCEPNoPathObjectParser.TYPE, new PCEPNoPathObjectParser(tlvReg));
+               context.registerObjectParser(PCEPEndPointsObjectParser.CLASS, PCEPEndPointsObjectParser.TYPE, new PCEPEndPointsObjectParser(tlvReg));
+               context.registerObjectParser(PCEPEndPointsObjectParser.CLASS_6, PCEPEndPointsObjectParser.TYPE_6,
+                               new PCEPEndPointsObjectParser(tlvReg));
+               context.registerObjectParser(PCEPBandwidthObjectParser.CLASS, PCEPBandwidthObjectParser.TYPE, new PCEPBandwidthObjectParser(tlvReg));
+               context.registerObjectParser(PCEPBandwidthObjectParser.E_CLASS, PCEPBandwidthObjectParser.E_TYPE,
+                               new PCEPBandwidthObjectParser(tlvReg));
+               context.registerObjectParser(PCEPMetricObjectParser.CLASS, PCEPMetricObjectParser.TYPE, new PCEPMetricObjectParser(tlvReg));
+
+               context.registerObjectParser(PCEPExplicitRouteObjectParser.CLASS, PCEPExplicitRouteObjectParser.TYPE,
+                               new PCEPExplicitRouteObjectParser(eroSubReg));
+               context.registerObjectParser(PCEPReportedRouteObjectParser.CLASS, PCEPReportedRouteObjectParser.TYPE,
+                               new PCEPReportedRouteObjectParser(rroSubReg));
+               context.registerObjectParser(PCEPLspaObjectParser.CLASS, PCEPLspaObjectParser.TYPE, new PCEPLspaObjectParser(tlvReg));
+               context.registerObjectParser(PCEPIncludeRouteObjectParser.CLASS, PCEPIncludeRouteObjectParser.TYPE,
+                               new PCEPIncludeRouteObjectParser(eroSubReg));
+               context.registerObjectParser(PCEPSvecObjectParser.CLASS, PCEPSvecObjectParser.TYPE, new PCEPSvecObjectParser(tlvReg));
+               context.registerObjectParser(PCEPNotificationObjectParser.CLASS, PCEPNotificationObjectParser.TYPE,
+                               new PCEPNotificationObjectParser(tlvReg));
+               context.registerObjectParser(PCEPErrorObjectParser.CLASS, PCEPErrorObjectParser.TYPE, new PCEPErrorObjectParser(tlvReg));
+               context.registerObjectParser(PCEPLoadBalancingObjectParser.CLASS, PCEPLoadBalancingObjectParser.TYPE,
+                               new PCEPLoadBalancingObjectParser(tlvReg));
+               context.registerObjectParser(PCEPCloseObjectParser.CLASS, PCEPCloseObjectParser.TYPE, new PCEPCloseObjectParser(tlvReg));
+               context.registerObjectParser(PCEPPathKeyObjectParser.CLASS, PCEPPathKeyObjectParser.TYPE, new PCEPPathKeyObjectParser(tlvReg));
+               context.registerObjectParser(PCEPObjectiveFunctionObjectParser.CLASS, PCEPObjectiveFunctionObjectParser.TYPE,
+                               new PCEPObjectiveFunctionObjectParser(tlvReg));
+               context.registerObjectParser(PCEPClassTypeObjectParser.CLASS, PCEPClassTypeObjectParser.TYPE, new PCEPClassTypeObjectParser(tlvReg));
+
+               context.registerObjectParser(PCEPGlobalConstraintsObjectParser.CLASS, PCEPGlobalConstraintsObjectParser.TYPE,
+                               new PCEPGlobalConstraintsObjectParser(tlvReg));
+               context.registerObjectParser(PCEPLspObjectParser.CLASS, PCEPLspObjectParser.TYPE, new PCEPLspObjectParser(tlvReg));
+               context.registerObjectParser(PCEPSrpObjectParser.CLASS, PCEPSrpObjectParser.TYPE, new PCEPSrpObjectParser(tlvReg));
+               context.registerObjectParser(PCEPExcludeRouteObjectParser.CLASS, PCEPExcludeRouteObjectParser.TYPE,
+                               new PCEPExcludeRouteObjectParser(xroSubReg));
+
+               context.registerObjectSerializer(OpenObject.class, new PCEPOpenObjectParser(tlvReg));
+               context.registerObjectSerializer(RpObject.class, new PCEPRequestParameterObjectParser(tlvReg));
+               context.registerObjectSerializer(NoPathObject.class, new PCEPNoPathObjectParser(tlvReg));
+               context.registerObjectSerializer(EndpointsObject.class, new PCEPEndPointsObjectParser(tlvReg));
+               context.registerObjectSerializer(BandwidthObject.class, new PCEPBandwidthObjectParser(tlvReg));
+               context.registerObjectSerializer(MetricObject.class, new PCEPMetricObjectParser(tlvReg));
+               context.registerObjectSerializer(ExplicitRouteObject.class, new PCEPExplicitRouteObjectParser(eroSubReg));
+               context.registerObjectSerializer(ReportedRouteObject.class, new PCEPReportedRouteObjectParser(rroSubReg));
+               context.registerObjectSerializer(LspaObject.class, new PCEPLspaObjectParser(tlvReg));
+               context.registerObjectSerializer(IncludeRouteObject.class, new PCEPIncludeRouteObjectParser(eroSubReg));
+               context.registerObjectSerializer(SvecObject.class, new PCEPSvecObjectParser(tlvReg));
+               context.registerObjectSerializer(NotificationObject.class, new PCEPNotificationObjectParser(tlvReg));
+               context.registerObjectSerializer(PcepErrorObject.class, new PCEPErrorObjectParser(tlvReg));
+               context.registerObjectSerializer(LoadBalancingObject.class, new PCEPLoadBalancingObjectParser(tlvReg));
+               context.registerObjectSerializer(CloseObject.class, new PCEPCloseObjectParser(tlvReg));
+               context.registerObjectSerializer(PathKeyObject.class, new PCEPPathKeyObjectParser(tlvReg));
+               context.registerObjectSerializer(OfObject.class, new PCEPObjectiveFunctionObjectParser(tlvReg));
+               context.registerObjectSerializer(ClasstypeObject.class, new PCEPClassTypeObjectParser(tlvReg));
+               context.registerObjectSerializer(GcObject.class, new PCEPGlobalConstraintsObjectParser(tlvReg));
+               context.registerObjectSerializer(LspObject.class, new PCEPLspObjectParser(tlvReg));
+               context.registerObjectSerializer(SrpObject.class, new PCEPSrpObjectParser(tlvReg));
+               context.registerObjectSerializer(ExcludeRouteObject.class, new PCEPExcludeRouteObjectParser(xroSubReg));
+
+               context.registerMessageParser(PCEPOpenMessageParser.TYPE, new PCEPOpenMessageParser(objReg));
+               context.registerMessageParser(PCEPKeepAliveMessageParser.TYPE, new PCEPKeepAliveMessageParser(objReg));
+               context.registerMessageParser(PCEPReplyMessageParser.TYPE, new PCEPReplyMessageParser(objReg));
+               context.registerMessageParser(PCEPRequestMessageParser.TYPE, new PCEPRequestMessageParser(objReg));
+               context.registerMessageParser(PCEPErrorMessageParser.TYPE, new PCEPErrorMessageParser(objReg));
+               context.registerMessageParser(PCEPCloseMessageParser.TYPE, new PCEPCloseMessageParser(objReg));
+               context.registerMessageParser(PCEPUpdateRequestMessageParser.TYPE, new PCEPUpdateRequestMessageParser(objReg));
+               context.registerMessageParser(PCEPReportMessageParser.TYPE, new PCEPReportMessageParser(objReg));
+               context.registerMessageParser(PCCreateMessageParser.TYPE, new PCCreateMessageParser(objReg));
+
+               context.registerMessageSerializer(OpenMessage.class, new PCEPOpenMessageParser(objReg));
+               context.registerMessageSerializer(PcntfMessage.class, new PCEPNotificationMessageParser(objReg));
+               context.registerMessageSerializer(KeepaliveMessage.class, new PCEPKeepAliveMessageParser(objReg));
+               context.registerMessageSerializer(PcrepMessage.class, new PCEPReplyMessageParser(objReg));
+               context.registerMessageSerializer(PcreqMessage.class, new PCEPRequestMessageParser(objReg));
+               context.registerMessageSerializer(PcerrMessage.class, new PCEPErrorMessageParser(objReg));
+               context.registerMessageSerializer(CloseMessage.class, new PCEPCloseMessageParser(objReg));
+               context.registerMessageSerializer(PcupdMessage.class, new PCEPUpdateRequestMessageParser(objReg));
+               context.registerMessageSerializer(PcrptMessage.class, new PCEPReportMessageParser(objReg));
+               context.registerMessageSerializer(PcinitiateMessage.class, new PCCreateMessageParser(objReg));
+
+               this.registrations = regs;
+       }
+
+       @Override
+       public void stop() {
+               Preconditions.checkState(this.registrations != null);
+
+               for (final AutoCloseable r : this.registrations) {
+                       try {
+                               r.close();
+                       } catch (final Exception e) {
+                               logger.warn("Failed to close registration", e);
+                       }
+               }
+
+               this.registrations = null;
+       }
+}
diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/BundleActivator.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/BundleActivator.java
new file mode 100644 (file)
index 0000000..7318b7f
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.impl;
+
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
+import org.opendaylight.protocol.pcep.spi.osgi.AbstractOSGiPCEPExtensionProviderActivator;
+
+public final class BundleActivator extends AbstractOSGiPCEPExtensionProviderActivator {
+       private final PCEPExtensionProviderActivator activator = new Activator();
+
+       @Override
+       public void start(final PCEPExtensionProviderContext context) throws Exception {
+               activator.start(context);
+       }
+
+       @Override
+       public void stop() throws Exception {
+               activator.stop();
+       }
+}
index 8e39d4f84412ca905c8b26a83086da5ab25413ff..0e3351fd8b1a0bb2358e1c8157d32abdf455fa9b 100644 (file)
@@ -19,6 +19,7 @@ import org.opendaylight.protocol.framework.SessionListenerFactory;
 import org.opendaylight.protocol.framework.SessionNegotiatorFactory;
 import org.opendaylight.protocol.pcep.PCEPDispatcher;
 import org.opendaylight.protocol.pcep.PCEPSessionListener;
+import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
 
 import com.google.common.base.Preconditions;
@@ -29,17 +30,17 @@ import com.google.common.base.Preconditions;
 public class PCEPDispatcherImpl extends AbstractDispatcher<PCEPSessionImpl, PCEPSessionListener> implements PCEPDispatcher {
 
        private final SessionNegotiatorFactory<Message, PCEPSessionImpl, PCEPSessionListener> snf;
-
-       private final PCEPHandlerFactory hf = new PCEPHandlerFactory(SingletonPCEPProviderContext.getInstance().getMessageHandlerRegistry());
+       private final PCEPHandlerFactory hf;
 
        /**
         * Creates an instance of PCEPDispatcherImpl, gets the default selector and opens it.
         * 
         * @throws IOException if some error occurred during opening the selector
         */
-       public PCEPDispatcherImpl(final SessionNegotiatorFactory<Message, PCEPSessionImpl, PCEPSessionListener> negotiatorFactory) {
+       public PCEPDispatcherImpl(final MessageHandlerRegistry registry, final SessionNegotiatorFactory<Message, PCEPSessionImpl, PCEPSessionListener> negotiatorFactory) {
                super();
                this.snf = Preconditions.checkNotNull(negotiatorFactory);
+               this.hf = new PCEPHandlerFactory(registry);
        }
 
        @Override
diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPImplActivator.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPImplActivator.java
deleted file mode 100644 (file)
index 6772c4a..0000000
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.opendaylight.protocol.pcep.impl.message.PCCreateMessageParser;
-import org.opendaylight.protocol.pcep.impl.message.PCEPCloseMessageParser;
-import org.opendaylight.protocol.pcep.impl.message.PCEPErrorMessageParser;
-import org.opendaylight.protocol.pcep.impl.message.PCEPKeepAliveMessageParser;
-import org.opendaylight.protocol.pcep.impl.message.PCEPNotificationMessageParser;
-import org.opendaylight.protocol.pcep.impl.message.PCEPOpenMessageParser;
-import org.opendaylight.protocol.pcep.impl.message.PCEPReplyMessageParser;
-import org.opendaylight.protocol.pcep.impl.message.PCEPReportMessageParser;
-import org.opendaylight.protocol.pcep.impl.message.PCEPRequestMessageParser;
-import org.opendaylight.protocol.pcep.impl.message.PCEPUpdateRequestMessageParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPBandwidthObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPClassTypeObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPCloseObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPEndPointsObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPErrorObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPExcludeRouteObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPExplicitRouteObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPGlobalConstraintsObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPIncludeRouteObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPLoadBalancingObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPLspObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPLspaObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPMetricObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPNoPathObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPNotificationObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPObjectiveFunctionObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPOpenObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPPathKeyObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPReportedRouteObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPRequestParameterObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPSrpObjectParser;
-import org.opendaylight.protocol.pcep.impl.object.PCEPSvecObjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.EROAsNumberSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.EROIpPrefixSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.EROLabelSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.EROPathKeySubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.EROUnnumberedInterfaceSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.GeneralizedLabelChannelSetParser;
-import org.opendaylight.protocol.pcep.impl.subobject.GeneralizedLabelParser;
-import org.opendaylight.protocol.pcep.impl.subobject.RROAsNumberSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.RROIpPrefixSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.RROLabelSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.RROPathKeySubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.RROUnnumberedInterfaceSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.Type1LabelParser;
-import org.opendaylight.protocol.pcep.impl.subobject.WavebandSwitchingLabelParser;
-import org.opendaylight.protocol.pcep.impl.subobject.XROAsNumberSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.XROIpPrefixSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.XROPathKeySubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.XROSRLGSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.subobject.XROUnnumberedInterfaceSubobjectParser;
-import org.opendaylight.protocol.pcep.impl.tlv.LSPIdentifierIPv4TlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.LSPIdentifierIPv6TlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.LspDbVersionTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.LspSymbolicNameTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.LspUpdateErrorTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.NoPathVectorTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.OFListTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.OrderTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.OverloadedDurationTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.PCEStatefulCapabilityTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.PredundancyGroupTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.RSVPErrorSpecTlvParser;
-import org.opendaylight.protocol.pcep.impl.tlv.ReqMissingTlvParser;
-import org.opendaylight.protocol.pcep.spi.EROSubobjectHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.LabelHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPProviderActivator;
-import org.opendaylight.protocol.pcep.spi.PCEPProviderContext;
-import org.opendaylight.protocol.pcep.spi.RROSubobjectHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.XROSubobjectHandlerRegistry;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.BandwidthObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ClasstypeObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.CloseMessage;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.CloseObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.EndpointsObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ExcludeRouteObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ExplicitRouteObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.GcObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.IncludeRouteObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.KeepaliveMessage;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LoadBalancingObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspDbVersionTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspErrorCodeTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspIdentifiersTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.LspaObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.MetricObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.NoPathObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.NoPathVectorTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.NotificationObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OfListTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OfObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OpenMessage;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OpenObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OrderTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OverloadDurationTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PathKeyObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PathKeySubobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcepErrorObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcerrMessage;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcinitiateMessage;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcntfMessage;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcrepMessage;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcreqMessage;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcrptMessage;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PcupdMessage;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.PredundancyGroupIdTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ReportedRouteObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.ReqMissingTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.RpObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.RsvpErrorSpecTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.SrpObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.StatefulCapabilityTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.SvecObject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.SymbolicPathNameTlv;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.AsNumberSubobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.GeneralizedChannelSetLabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.GeneralizedLabel;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.IpPrefixSubobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.LabelSubobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.SrlgSubobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.Type1Label;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.UnnumberedSubobject;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.WavebandSwitchingLabel;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.google.common.base.Preconditions;
-
-public final class PCEPImplActivator implements PCEPProviderActivator {
-       private static final Logger logger = LoggerFactory.getLogger(PCEPImplActivator.class);
-       private List<AutoCloseable> registrations;
-
-       @Override
-       public void start(final PCEPProviderContext context) {
-               Preconditions.checkState(this.registrations == null);
-               final List<AutoCloseable> regs = new ArrayList<>();
-
-               final LabelHandlerRegistry labelReg = context.getLabelHandlerRegistry();
-               labelReg.registerLabelParser(Type1LabelParser.CTYPE, new Type1LabelParser());
-               labelReg.registerLabelParser(GeneralizedLabelParser.CTYPE, new GeneralizedLabelParser());
-               labelReg.registerLabelParser(WavebandSwitchingLabelParser.CTYPE, new WavebandSwitchingLabelParser());
-               labelReg.registerLabelParser(GeneralizedLabelChannelSetParser.CTYPE, new GeneralizedLabelChannelSetParser());
-
-               labelReg.registerLabelSerializer(Type1Label.class, new Type1LabelParser());
-               labelReg.registerLabelSerializer(GeneralizedLabel.class, new GeneralizedLabelParser());
-               labelReg.registerLabelSerializer(WavebandSwitchingLabel.class, new WavebandSwitchingLabelParser());
-               labelReg.registerLabelSerializer(GeneralizedChannelSetLabel.class, new GeneralizedLabelChannelSetParser());
-
-               final EROSubobjectHandlerRegistry eroSubReg = context.getEROSubobjectHandlerRegistry();
-               eroSubReg.registerSubobjectParser(EROIpPrefixSubobjectParser.TYPE, new EROIpPrefixSubobjectParser());
-               eroSubReg.registerSubobjectParser(EROIpPrefixSubobjectParser.TYPE6, new EROIpPrefixSubobjectParser());
-               eroSubReg.registerSubobjectParser(EROAsNumberSubobjectParser.TYPE, new EROAsNumberSubobjectParser());
-               eroSubReg.registerSubobjectParser(EROLabelSubobjectParser.TYPE, new EROLabelSubobjectParser(labelReg));
-               eroSubReg.registerSubobjectParser(EROUnnumberedInterfaceSubobjectParser.TYPE, new EROUnnumberedInterfaceSubobjectParser());
-               eroSubReg.registerSubobjectParser(EROPathKeySubobjectParser.TYPE, new EROPathKeySubobjectParser());
-               eroSubReg.registerSubobjectParser(EROPathKeySubobjectParser.TYPE128, new EROPathKeySubobjectParser());
-
-               eroSubReg.registerSubobjectSerializer(IpPrefixSubobject.class, new EROIpPrefixSubobjectParser());
-               eroSubReg.registerSubobjectSerializer(AsNumberSubobject.class, new EROAsNumberSubobjectParser());
-               eroSubReg.registerSubobjectSerializer(LabelSubobject.class, new EROLabelSubobjectParser(labelReg));
-               eroSubReg.registerSubobjectSerializer(UnnumberedSubobject.class, new EROUnnumberedInterfaceSubobjectParser());
-               eroSubReg.registerSubobjectSerializer(PathKeySubobject.class, new EROPathKeySubobjectParser());
-
-               final RROSubobjectHandlerRegistry rroSubReg = context.getRROSubobjectHandlerRegistry();
-               rroSubReg.registerSubobjectParser(RROIpPrefixSubobjectParser.TYPE, new RROIpPrefixSubobjectParser());
-               rroSubReg.registerSubobjectParser(RROIpPrefixSubobjectParser.TYPE6, new RROIpPrefixSubobjectParser());
-               rroSubReg.registerSubobjectParser(RROLabelSubobjectParser.TYPE, new RROLabelSubobjectParser(labelReg));
-               rroSubReg.registerSubobjectParser(RROAsNumberSubobjectParser.TYPE, new RROAsNumberSubobjectParser());
-               rroSubReg.registerSubobjectParser(RROUnnumberedInterfaceSubobjectParser.TYPE, new RROUnnumberedInterfaceSubobjectParser());
-               rroSubReg.registerSubobjectParser(RROPathKeySubobjectParser.TYPE, new RROPathKeySubobjectParser());
-               rroSubReg.registerSubobjectParser(RROPathKeySubobjectParser.TYPE128, new RROPathKeySubobjectParser());
-
-               rroSubReg.registerSubobjectSerializer(IpPrefixSubobject.class, new RROIpPrefixSubobjectParser());
-               rroSubReg.registerSubobjectSerializer(LabelSubobject.class, new RROLabelSubobjectParser(labelReg));
-               rroSubReg.registerSubobjectSerializer(AsNumberSubobject.class, new RROAsNumberSubobjectParser());
-               rroSubReg.registerSubobjectSerializer(UnnumberedSubobject.class, new RROUnnumberedInterfaceSubobjectParser());
-               rroSubReg.registerSubobjectSerializer(PathKeySubobject.class, new RROPathKeySubobjectParser());
-
-               final XROSubobjectHandlerRegistry xroSubReg = context.getXROSubobjectHandlerRegistry();
-               xroSubReg.registerSubobjectParser(XROIpPrefixSubobjectParser.TYPE, new XROIpPrefixSubobjectParser());
-               xroSubReg.registerSubobjectParser(XROIpPrefixSubobjectParser.TYPE6, new XROIpPrefixSubobjectParser());
-               xroSubReg.registerSubobjectParser(XROAsNumberSubobjectParser.TYPE, new XROAsNumberSubobjectParser());
-               xroSubReg.registerSubobjectParser(XROSRLGSubobjectParser.TYPE, new XROSRLGSubobjectParser());
-               xroSubReg.registerSubobjectParser(XROUnnumberedInterfaceSubobjectParser.TYPE, new XROUnnumberedInterfaceSubobjectParser());
-               xroSubReg.registerSubobjectParser(XROPathKeySubobjectParser.TYPE, new XROPathKeySubobjectParser());
-               xroSubReg.registerSubobjectParser(XROPathKeySubobjectParser.TYPE128, new XROPathKeySubobjectParser());
-
-               xroSubReg.registerSubobjectSerializer(IpPrefixSubobject.class, new XROIpPrefixSubobjectParser());
-               xroSubReg.registerSubobjectSerializer(AsNumberSubobject.class, new XROAsNumberSubobjectParser());
-               xroSubReg.registerSubobjectSerializer(SrlgSubobject.class, new XROSRLGSubobjectParser());
-               xroSubReg.registerSubobjectSerializer(UnnumberedSubobject.class, new XROUnnumberedInterfaceSubobjectParser());
-               xroSubReg.registerSubobjectSerializer(PathKeySubobject.class, new XROPathKeySubobjectParser());
-
-               final TlvHandlerRegistry tlvReg = context.getTlvHandlerRegistry();
-               tlvReg.registerTlvParser(NoPathVectorTlvParser.TYPE, new NoPathVectorTlvParser());
-               tlvReg.registerTlvParser(OverloadedDurationTlvParser.TYPE, new OverloadedDurationTlvParser());
-               tlvReg.registerTlvParser(ReqMissingTlvParser.TYPE, new ReqMissingTlvParser());
-               tlvReg.registerTlvParser(OFListTlvParser.TYPE, new OFListTlvParser());
-               tlvReg.registerTlvParser(OrderTlvParser.TYPE, new OrderTlvParser());
-               tlvReg.registerTlvParser(PCEStatefulCapabilityTlvParser.TYPE, new PCEStatefulCapabilityTlvParser());
-               tlvReg.registerTlvParser(LspSymbolicNameTlvParser.TYPE, new LspSymbolicNameTlvParser());
-               tlvReg.registerTlvParser(LSPIdentifierIPv4TlvParser.TYPE, new LSPIdentifierIPv4TlvParser());
-               tlvReg.registerTlvParser(LSPIdentifierIPv6TlvParser.TYPE, new LSPIdentifierIPv6TlvParser());
-               tlvReg.registerTlvParser(LspUpdateErrorTlvParser.TYPE, new LspUpdateErrorTlvParser());
-               tlvReg.registerTlvParser(RSVPErrorSpecTlvParser.TYPE, new RSVPErrorSpecTlvParser());
-               tlvReg.registerTlvParser(LspDbVersionTlvParser.TYPE, new LspDbVersionTlvParser());
-               tlvReg.registerTlvParser(PredundancyGroupTlvParser.TYPE, new PredundancyGroupTlvParser());
-
-               tlvReg.registerTlvSerializer(NoPathVectorTlv.class, new NoPathVectorTlvParser());
-               tlvReg.registerTlvSerializer(OverloadDurationTlv.class, new OverloadedDurationTlvParser());
-               tlvReg.registerTlvSerializer(ReqMissingTlv.class, new ReqMissingTlvParser());
-               tlvReg.registerTlvSerializer(OfListTlv.class, new OFListTlvParser());
-               tlvReg.registerTlvSerializer(OrderTlv.class, new OrderTlvParser());
-               tlvReg.registerTlvSerializer(StatefulCapabilityTlv.class, new PCEStatefulCapabilityTlvParser());
-               tlvReg.registerTlvSerializer(SymbolicPathNameTlv.class, new LspSymbolicNameTlvParser());
-               tlvReg.registerTlvSerializer(LspIdentifiersTlv.class, new LSPIdentifierIPv4TlvParser());
-               tlvReg.registerTlvSerializer(LspErrorCodeTlv.class, new LspUpdateErrorTlvParser());
-               tlvReg.registerTlvSerializer(RsvpErrorSpecTlv.class, new RSVPErrorSpecTlvParser());
-               tlvReg.registerTlvSerializer(LspDbVersionTlv.class, new LspDbVersionTlvParser());
-               tlvReg.registerTlvSerializer(PredundancyGroupIdTlv.class, new PredundancyGroupTlvParser());
-
-               final ObjectHandlerRegistry objReg = context.getObjectHandlerRegistry();
-               objReg.registerObjectParser(PCEPOpenObjectParser.CLASS, PCEPOpenObjectParser.TYPE, new PCEPOpenObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPRequestParameterObjectParser.CLASS, PCEPRequestParameterObjectParser.TYPE,
-                               new PCEPRequestParameterObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPNoPathObjectParser.CLASS, PCEPNoPathObjectParser.TYPE, new PCEPNoPathObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPEndPointsObjectParser.CLASS, PCEPEndPointsObjectParser.TYPE, new PCEPEndPointsObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPEndPointsObjectParser.CLASS_6, PCEPEndPointsObjectParser.TYPE_6,
-                               new PCEPEndPointsObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPBandwidthObjectParser.CLASS, PCEPBandwidthObjectParser.TYPE, new PCEPBandwidthObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPBandwidthObjectParser.E_CLASS, PCEPBandwidthObjectParser.E_TYPE,
-                               new PCEPBandwidthObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPMetricObjectParser.CLASS, PCEPMetricObjectParser.TYPE, new PCEPMetricObjectParser(tlvReg));
-
-               objReg.registerObjectParser(PCEPExplicitRouteObjectParser.CLASS, PCEPExplicitRouteObjectParser.TYPE,
-                               new PCEPExplicitRouteObjectParser(eroSubReg));
-               objReg.registerObjectParser(PCEPReportedRouteObjectParser.CLASS, PCEPReportedRouteObjectParser.TYPE,
-                               new PCEPReportedRouteObjectParser(rroSubReg));
-               objReg.registerObjectParser(PCEPLspaObjectParser.CLASS, PCEPLspaObjectParser.TYPE, new PCEPLspaObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPIncludeRouteObjectParser.CLASS, PCEPIncludeRouteObjectParser.TYPE,
-                               new PCEPIncludeRouteObjectParser(eroSubReg));
-               objReg.registerObjectParser(PCEPSvecObjectParser.CLASS, PCEPSvecObjectParser.TYPE, new PCEPSvecObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPNotificationObjectParser.CLASS, PCEPNotificationObjectParser.TYPE,
-                               new PCEPNotificationObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPErrorObjectParser.CLASS, PCEPErrorObjectParser.TYPE, new PCEPErrorObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPLoadBalancingObjectParser.CLASS, PCEPLoadBalancingObjectParser.TYPE,
-                               new PCEPLoadBalancingObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPCloseObjectParser.CLASS, PCEPCloseObjectParser.TYPE, new PCEPCloseObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPPathKeyObjectParser.CLASS, PCEPPathKeyObjectParser.TYPE, new PCEPPathKeyObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPObjectiveFunctionObjectParser.CLASS, PCEPObjectiveFunctionObjectParser.TYPE,
-                               new PCEPObjectiveFunctionObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPClassTypeObjectParser.CLASS, PCEPClassTypeObjectParser.TYPE, new PCEPClassTypeObjectParser(tlvReg));
-
-               objReg.registerObjectParser(PCEPGlobalConstraintsObjectParser.CLASS, PCEPGlobalConstraintsObjectParser.TYPE,
-                               new PCEPGlobalConstraintsObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPLspObjectParser.CLASS, PCEPLspObjectParser.TYPE, new PCEPLspObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPSrpObjectParser.CLASS, PCEPSrpObjectParser.TYPE, new PCEPSrpObjectParser(tlvReg));
-               objReg.registerObjectParser(PCEPExcludeRouteObjectParser.CLASS, PCEPExcludeRouteObjectParser.TYPE,
-                               new PCEPExcludeRouteObjectParser(xroSubReg));
-
-               objReg.registerObjectSerializer(OpenObject.class, new PCEPOpenObjectParser(tlvReg));
-               objReg.registerObjectSerializer(RpObject.class, new PCEPRequestParameterObjectParser(tlvReg));
-               objReg.registerObjectSerializer(NoPathObject.class, new PCEPNoPathObjectParser(tlvReg));
-               objReg.registerObjectSerializer(EndpointsObject.class, new PCEPEndPointsObjectParser(tlvReg));
-               objReg.registerObjectSerializer(BandwidthObject.class, new PCEPBandwidthObjectParser(tlvReg));
-               objReg.registerObjectSerializer(MetricObject.class, new PCEPMetricObjectParser(tlvReg));
-               objReg.registerObjectSerializer(ExplicitRouteObject.class, new PCEPExplicitRouteObjectParser(eroSubReg));
-               objReg.registerObjectSerializer(ReportedRouteObject.class, new PCEPReportedRouteObjectParser(rroSubReg));
-               objReg.registerObjectSerializer(LspaObject.class, new PCEPLspaObjectParser(tlvReg));
-               objReg.registerObjectSerializer(IncludeRouteObject.class, new PCEPIncludeRouteObjectParser(eroSubReg));
-               objReg.registerObjectSerializer(SvecObject.class, new PCEPSvecObjectParser(tlvReg));
-               objReg.registerObjectSerializer(NotificationObject.class, new PCEPNotificationObjectParser(tlvReg));
-               objReg.registerObjectSerializer(PcepErrorObject.class, new PCEPErrorObjectParser(tlvReg));
-               objReg.registerObjectSerializer(LoadBalancingObject.class, new PCEPLoadBalancingObjectParser(tlvReg));
-               objReg.registerObjectSerializer(CloseObject.class, new PCEPCloseObjectParser(tlvReg));
-               objReg.registerObjectSerializer(PathKeyObject.class, new PCEPPathKeyObjectParser(tlvReg));
-               objReg.registerObjectSerializer(OfObject.class, new PCEPObjectiveFunctionObjectParser(tlvReg));
-               objReg.registerObjectSerializer(ClasstypeObject.class, new PCEPClassTypeObjectParser(tlvReg));
-               objReg.registerObjectSerializer(GcObject.class, new PCEPGlobalConstraintsObjectParser(tlvReg));
-               objReg.registerObjectSerializer(LspObject.class, new PCEPLspObjectParser(tlvReg));
-               objReg.registerObjectSerializer(SrpObject.class, new PCEPSrpObjectParser(tlvReg));
-               objReg.registerObjectSerializer(ExcludeRouteObject.class, new PCEPExcludeRouteObjectParser(xroSubReg));
-
-               final MessageHandlerRegistry msgReg = context.getMessageHandlerRegistry();
-               msgReg.registerMessageParser(PCEPOpenMessageParser.TYPE, new PCEPOpenMessageParser(objReg));
-               msgReg.registerMessageParser(PCEPKeepAliveMessageParser.TYPE, new PCEPKeepAliveMessageParser(objReg));
-               msgReg.registerMessageParser(PCEPReplyMessageParser.TYPE, new PCEPReplyMessageParser(objReg));
-               msgReg.registerMessageParser(PCEPRequestMessageParser.TYPE, new PCEPRequestMessageParser(objReg));
-               msgReg.registerMessageParser(PCEPErrorMessageParser.TYPE, new PCEPErrorMessageParser(objReg));
-               msgReg.registerMessageParser(PCEPCloseMessageParser.TYPE, new PCEPCloseMessageParser(objReg));
-               msgReg.registerMessageParser(PCEPUpdateRequestMessageParser.TYPE, new PCEPUpdateRequestMessageParser(objReg));
-               msgReg.registerMessageParser(PCEPReportMessageParser.TYPE, new PCEPReportMessageParser(objReg));
-               msgReg.registerMessageParser(PCCreateMessageParser.TYPE, new PCCreateMessageParser(objReg));
-
-               msgReg.registerMessageSerializer(OpenMessage.class, new PCEPOpenMessageParser(objReg));
-               msgReg.registerMessageSerializer(PcntfMessage.class, new PCEPNotificationMessageParser(objReg));
-               msgReg.registerMessageSerializer(KeepaliveMessage.class, new PCEPKeepAliveMessageParser(objReg));
-               msgReg.registerMessageSerializer(PcrepMessage.class, new PCEPReplyMessageParser(objReg));
-               msgReg.registerMessageSerializer(PcreqMessage.class, new PCEPRequestMessageParser(objReg));
-               msgReg.registerMessageSerializer(PcerrMessage.class, new PCEPErrorMessageParser(objReg));
-               msgReg.registerMessageSerializer(CloseMessage.class, new PCEPCloseMessageParser(objReg));
-               msgReg.registerMessageSerializer(PcupdMessage.class, new PCEPUpdateRequestMessageParser(objReg));
-               msgReg.registerMessageSerializer(PcrptMessage.class, new PCEPReportMessageParser(objReg));
-               msgReg.registerMessageSerializer(PcinitiateMessage.class, new PCCreateMessageParser(objReg));
-
-               this.registrations = regs;
-       }
-
-       @Override
-       public void stop() {
-               Preconditions.checkState(this.registrations != null);
-
-               for (final AutoCloseable r : this.registrations) {
-                       try {
-                               r.close();
-                       } catch (final Exception e) {
-                               logger.warn("Failed to close registration", e);
-                       }
-               }
-
-               this.registrations = null;
-       }
-}
diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SingletonPCEPProviderContext.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SingletonPCEPProviderContext.java
deleted file mode 100644 (file)
index 59b3867..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.impl;
-
-import javax.annotation.concurrent.ThreadSafe;
-
-import org.opendaylight.protocol.pcep.spi.EROSubobjectHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.LabelHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.PCEPProviderContext;
-import org.opendaylight.protocol.pcep.spi.RROSubobjectHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
-import org.opendaylight.protocol.pcep.spi.XROSubobjectHandlerRegistry;
-
-/**
- *
- */
-@ThreadSafe
-public final class SingletonPCEPProviderContext implements PCEPProviderContext {
-       private static final class Holder {
-               private static final PCEPProviderContext INSTANCE;
-
-               static {
-                       final PCEPProviderContext pc = new SingletonPCEPProviderContext();
-                       new PCEPImplActivator().start(pc);
-                       INSTANCE = pc;
-               }
-       }
-
-       private final LabelHandlerRegistry labelReg = new SimpleLabelHandlerRegistry();
-       private final MessageHandlerRegistry msgReg = new SimpleMessageHandlerRegistry();
-       private final ObjectHandlerRegistry objReg = new SimpleObjectHandlerRegistry();
-       private final EROSubobjectHandlerRegistry eroSubReg = new SimpleEROSubobjectHandlerFactory();
-       private final RROSubobjectHandlerRegistry rroSubReg = new SimpleRROSubobjectHandlerFactory();
-       private final XROSubobjectHandlerRegistry xroSubReg = new SimpleXROSubobjectHandlerFactory();
-       private final TlvHandlerRegistry tlvReg = new SimpleTlvHandlerRegistry();
-
-       private SingletonPCEPProviderContext() {
-
-       }
-
-       public static PCEPProviderContext getInstance() {
-               return Holder.INSTANCE;
-       }
-
-       @Override
-       public LabelHandlerRegistry getLabelHandlerRegistry() {
-               return labelReg;
-       }
-
-       @Override
-       public MessageHandlerRegistry getMessageHandlerRegistry() {
-               return this.msgReg;
-       }
-
-       @Override
-       public ObjectHandlerRegistry getObjectHandlerRegistry() {
-               return this.objReg;
-       }
-
-       @Override
-       public EROSubobjectHandlerRegistry getEROSubobjectHandlerRegistry() {
-               return this.eroSubReg;
-       }
-
-       @Override
-       public RROSubobjectHandlerRegistry getRROSubobjectHandlerRegistry() {
-               return this.rroSubReg;
-       }
-
-       @Override
-       public XROSubobjectHandlerRegistry getXROSubobjectHandlerRegistry() {
-               return this.xroSubReg;
-       }
-
-       @Override
-       public TlvHandlerRegistry getTlvHandlerRegistry() {
-               return this.tlvReg;
-       }
-}
diff --git a/pcep/impl/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator b/pcep/impl/src/main/resources/META-INF/services/org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator
new file mode 100644 (file)
index 0000000..ca22928
--- /dev/null
@@ -0,0 +1 @@
+org.opendaylight.protocol.pcep.impl.Activator
index 6adf2e98ec8dc4bb947b6d4b926c115cd1f7e436..9492692d90c801b0e42ba0a9d7cd79fe1b9eaf81 100644 (file)
             <version>${project.version}</version>
                        <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.core</artifactId>
+            <version>${osgi.version}</version>
+            <scope>provided</scope>
+        </dependency>
        </dependencies>
 
        <build>
                        <Bundle-Name>${project.groupId}.${project.artifactId}</Bundle-Name>
                        <Export-Package>
                            org.opendaylight.protocol.pcep.spi,
+                           org.opendaylight.protocol.pcep.spi.osgi,
                        </Export-Package>
+                       <Private-Package>
+                           org.opendaylight.protocol.pcep.spi.pojo,
+                       </Private-Package>
                    </instructions>
                </configuration>
            </plugin>
index f50b8baced77dd99d9209100afe3bfb23f720334..83d7e24eb008e8ed12144a0ceac2ac4cf0fcb3b9 100644 (file)
@@ -8,14 +8,8 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.explicit.route.object.Subobjects;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CSubobject;
 
 public interface EROSubobjectHandlerRegistry {
-       public AutoCloseable registerSubobjectParser(int subobjectType, EROSubobjectParser parser);
-
        public EROSubobjectParser getSubobjectParser(int subobjectType);
-
-       public AutoCloseable registerSubobjectSerializer(Class<? extends CSubobject> subobjectClass, EROSubobjectSerializer serializer);
-
        public EROSubobjectSerializer getSubobjectSerializer(Subobjects subobject);
 }
index 3f0d4c6b582de75c4de3d1eb5cb319a0200c935e..18c43c9546dcd0f1bfb3a3414bc2e9fa30bd1c1a 100644 (file)
@@ -10,9 +10,6 @@ package org.opendaylight.protocol.pcep.spi;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CLabel;
 
 public interface LabelHandlerRegistry {
-       public AutoCloseable registerLabelParser(int cType, LabelParser parser);
        public LabelParser getLabelParser(int cType);
-
-       public AutoCloseable registerLabelSerializer(Class<? extends CLabel> labelClass, LabelSerializer serializer);
        public LabelSerializer getLabelSerializer(CLabel label);
 }
index bd3c136dc61ffdd00d1bbc39c4bdd91c08476638..e9a513009239c093c8fa2e2f9131a4a6e09a0427 100644 (file)
@@ -10,9 +10,6 @@ package org.opendaylight.protocol.pcep.spi;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
 
 public interface MessageHandlerRegistry {
-       public AutoCloseable registerMessageParser(int messageType, MessageParser parser);
-       public AutoCloseable registerMessageSerializer(Class<? extends Message> msgClass, MessageSerializer serializer);
-
        public MessageParser getMessageParser(int messageType);
        public MessageSerializer getMessageSerializer(Message message);
 }
index a003177891accfd0993bdb56680b80f1e00d1b34..0d5ca0c838f8ff6f2c402fc7ba5a5a9befe494c2 100644 (file)
@@ -10,9 +10,6 @@ package org.opendaylight.protocol.pcep.spi;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
 
 public interface ObjectHandlerRegistry {
-       public AutoCloseable registerObjectParser(int objectClass, int objectType, ObjectParser parser);
-       public AutoCloseable registerObjectSerializer(Class<? extends Object> objClass, ObjectSerializer serializer);
-
        public ObjectParser getObjectParser(int objectClass, int objectType);
        public ObjectSerializer getObjectSerializer(Object object);
 }
similarity index 77%
rename from pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPProviderActivator.java
rename to pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPExtensionConsumerActivator.java
index 4facaeaa2e3179bfb47b74cfb2b65bc643d6d5b0..8759908a8d89206dbe6bb01fbb81b2b305ff8f9f 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.protocol.pcep.spi;
 
-public interface PCEPProviderActivator {
-       public void start(PCEPProviderContext context);
+public interface PCEPExtensionConsumerActivator {
+       public void start(PCEPExtensionConsumerContext context);
        public void stop();
 }
\ No newline at end of file
similarity index 94%
rename from pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPProviderContext.java
rename to pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPExtensionConsumerContext.java
index 45b8f44d9cff71ecf36b3bbc1600fb94e877a674..f4db40b8e08713114fc27f0f85545352c8da4b38 100644 (file)
@@ -7,7 +7,7 @@
  */
 package org.opendaylight.protocol.pcep.spi;
 
-public interface PCEPProviderContext {
+public interface PCEPExtensionConsumerContext {
 
        public LabelHandlerRegistry getLabelHandlerRegistry();
        
diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPExtensionProviderActivator.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPExtensionProviderActivator.java
new file mode 100644 (file)
index 0000000..d2e4e65
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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;
+
+public interface PCEPExtensionProviderActivator {
+       public void start(PCEPExtensionProviderContext context) throws Exception;
+       public void stop() throws Exception;
+}
\ No newline at end of file
diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPExtensionProviderContext.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/PCEPExtensionProviderContext.java
new file mode 100644 (file)
index 0000000..3d3d64b
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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;
+
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CLabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CSubobject;
+
+public interface PCEPExtensionProviderContext extends PCEPExtensionConsumerContext {
+       public AutoCloseable registerLabelSerializer(Class<? extends CLabel> labelClass, LabelSerializer serializer);
+       public AutoCloseable registerLabelParser(int cType, LabelParser parser);
+
+       public AutoCloseable registerEROSubobjectParser(int subobjectType, EROSubobjectParser parser);
+       public AutoCloseable registerEROSubobjectSerializer(Class<? extends CSubobject> subobjectClass, EROSubobjectSerializer serializer);
+
+       public AutoCloseable registerMessageParser(int messageType, MessageParser parser);
+       public AutoCloseable registerMessageSerializer(Class<? extends Message> msgClass, MessageSerializer serializer);
+
+       public AutoCloseable registerObjectParser(int objectClass, int objectType, ObjectParser parser);
+       public AutoCloseable registerObjectSerializer(Class<? extends Object> objClass, ObjectSerializer serializer);
+
+       public AutoCloseable registerRROSubobjectParser(int subobjectType, RROSubobjectParser parser);
+       public AutoCloseable registerRROSubobjectSerializer(Class<? extends CSubobject> subobjectClass, RROSubobjectSerializer serializer);
+
+       public AutoCloseable registerTlvSerializer(Class<? extends Tlv> tlvClass, TlvSerializer serializer);
+       public AutoCloseable registerTlvParser(int tlvType, TlvParser parser);
+
+       public AutoCloseable registerXROSubobjectSerializer(Class<? extends CSubobject> subobjectClass, XROSubobjectSerializer serializer);
+       public AutoCloseable registerXROSubobjectParser(int subobjectType, XROSubobjectParser parser);
+}
index 34194f15b92c60e31a64cb95a2ccc9a9271e77c4..53602058d6fff2a7518207fcae55e7e3fece5784 100644 (file)
@@ -8,14 +8,8 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.reported.route.object.Subobjects;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CSubobject;
 
 public interface RROSubobjectHandlerRegistry {
-       public AutoCloseable registerSubobjectParser(int subobjectType, RROSubobjectParser parser);
-
        public RROSubobjectParser getSubobjectParser(int subobjectType);
-
-       public AutoCloseable registerSubobjectSerializer(Class<? extends CSubobject> subobjectClass, RROSubobjectSerializer serializer);
-
        public RROSubobjectSerializer getSubobjectSerializer(Subobjects subobject);
 }
index 5ad71a0b7c724da837facca95a4f15bab09fe81c..6274f08111a13ccabfc15b2f3e163b40a03dfd65 100644 (file)
@@ -10,9 +10,6 @@ package org.opendaylight.protocol.pcep.spi;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
 
 public interface TlvHandlerRegistry {
-       public AutoCloseable registerTlvParser(int tlvType, TlvParser parser);
        public TlvParser getTlvParser(int tlvType);
-
-       public AutoCloseable registerTlvSerializer(Class<? extends Tlv> tlvClass, TlvSerializer serializer);
        public TlvSerializer getTlvSerializer(Tlv tlv);
 }
index cca8615d9436383cb27144fce555aac1a60d4067..2e4637077476c95bf7c7ae6707dbab702a6818cd 100644 (file)
@@ -8,15 +8,8 @@
 package org.opendaylight.protocol.pcep.spi;
 
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.exclude.route.object.Subobjects;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CSubobject;
 
 public interface XROSubobjectHandlerRegistry {
-
-       public AutoCloseable registerSubobjectParser(int subobjectType, XROSubobjectParser parser);
-
        public XROSubobjectParser getSubobjectParser(int subobjectType);
-
-       public AutoCloseable registerSubobjectSerializer(Class<? extends CSubobject> subobjectClass, XROSubobjectSerializer serializer);
-
        public XROSubobjectSerializer getSubobjectSerializer(Subobjects subobject);
 }
diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/AbstractOSGiPCEPExtensionConsumerActivator.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/AbstractOSGiPCEPExtensionConsumerActivator.java
new file mode 100644 (file)
index 0000000..b1230c7
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.osgi;
+
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionConsumerActivator;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionConsumerContext;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import com.google.common.base.Preconditions;
+
+public abstract class AbstractOSGiPCEPExtensionConsumerActivator implements BundleActivator, PCEPExtensionConsumerActivator {
+       private PCEPExtensionConsumerContext consumerContext;
+
+       @Override
+       public final void start(final BundleContext context) throws Exception {
+               Preconditions.checkState(consumerContext == null);
+               final PCEPExtensionConsumerContext consumerContext = new OSGiPCEPExtensionConsumerContext(context);
+               start(consumerContext);
+               this.consumerContext = consumerContext;
+       }
+
+       @Override
+       public final void stop(final BundleContext context) throws Exception {
+               Preconditions.checkState(consumerContext != null);
+               try {
+                       stop();
+               } finally {
+                       consumerContext = null;
+               }
+       }
+}
diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/AbstractOSGiPCEPExtensionProviderActivator.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/AbstractOSGiPCEPExtensionProviderActivator.java
new file mode 100644 (file)
index 0000000..f59071a
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.osgi;
+
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+import com.google.common.base.Preconditions;
+
+public abstract class AbstractOSGiPCEPExtensionProviderActivator implements BundleActivator, PCEPExtensionProviderActivator {
+       private PCEPExtensionProviderContext providerContext;
+
+       @Override
+       public final void start(final BundleContext context) throws Exception {
+               Preconditions.checkState(providerContext == null);
+               final PCEPExtensionProviderContext providerContext = new OSGiPCEPExtensionProviderContext(context);
+               start(providerContext);
+               this.providerContext = providerContext;
+       }
+
+       @Override
+       public final void stop(final BundleContext context) throws Exception {
+               Preconditions.checkState(providerContext != null);
+               try {
+                       stop();
+               } finally {
+                       providerContext = null;
+               }
+       }
+}
diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/OSGiPCEPExtensionConsumerContext.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/OSGiPCEPExtensionConsumerContext.java
new file mode 100644 (file)
index 0000000..80b2891
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.osgi;
+
+import org.opendaylight.protocol.pcep.spi.EROSubobjectHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.LabelHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionConsumerContext;
+import org.opendaylight.protocol.pcep.spi.RROSubobjectHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.XROSubobjectHandlerRegistry;
+import org.osgi.framework.BundleContext;
+
+import com.google.common.base.Preconditions;
+
+class OSGiPCEPExtensionConsumerContext implements PCEPExtensionConsumerContext {
+       protected final BundleContext bundleContext;
+
+       public OSGiPCEPExtensionConsumerContext(final BundleContext context) {
+               this.bundleContext = Preconditions.checkNotNull(context);
+       }
+
+       @Override
+       public LabelHandlerRegistry getLabelHandlerRegistry() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public MessageHandlerRegistry getMessageHandlerRegistry() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public ObjectHandlerRegistry getObjectHandlerRegistry() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public EROSubobjectHandlerRegistry getEROSubobjectHandlerRegistry() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public RROSubobjectHandlerRegistry getRROSubobjectHandlerRegistry() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public XROSubobjectHandlerRegistry getXROSubobjectHandlerRegistry() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public TlvHandlerRegistry getTlvHandlerRegistry() {
+               // TODO Auto-generated method stub
+               return null;
+       }
+}
diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/OSGiPCEPExtensionProviderContext.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/osgi/OSGiPCEPExtensionProviderContext.java
new file mode 100644 (file)
index 0000000..0ffc8d6
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.osgi;
+
+import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
+import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
+import org.opendaylight.protocol.pcep.spi.LabelParser;
+import org.opendaylight.protocol.pcep.spi.LabelSerializer;
+import org.opendaylight.protocol.pcep.spi.MessageParser;
+import org.opendaylight.protocol.pcep.spi.MessageSerializer;
+import org.opendaylight.protocol.pcep.spi.ObjectParser;
+import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
+import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
+import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
+import org.opendaylight.protocol.pcep.spi.TlvParser;
+import org.opendaylight.protocol.pcep.spi.TlvSerializer;
+import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
+import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CLabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CSubobject;
+import org.osgi.framework.BundleContext;
+
+class OSGiPCEPExtensionProviderContext extends OSGiPCEPExtensionConsumerContext implements PCEPExtensionProviderContext {
+       OSGiPCEPExtensionProviderContext(final BundleContext context) {
+               super(context);
+       }
+
+       @Override
+       public AutoCloseable registerLabelSerializer(final Class<? extends CLabel> labelClass, final LabelSerializer serializer) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerLabelParser(final int cType, final LabelParser parser) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerEROSubobjectParser(final int subobjectType, final EROSubobjectParser parser) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerEROSubobjectSerializer(final Class<? extends CSubobject> subobjectClass, final EROSubobjectSerializer serializer) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerMessageParser(final int messageType, final MessageParser parser) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerMessageSerializer(final Class<? extends Message> msgClass, final MessageSerializer serializer) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerObjectParser(final int objectClass, final int objectType, final ObjectParser parser) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerObjectSerializer(final Class<? extends Object> objClass, final ObjectSerializer serializer) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerRROSubobjectParser(final int subobjectType, final RROSubobjectParser parser) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerRROSubobjectSerializer(final Class<? extends CSubobject> subobjectClass, final RROSubobjectSerializer serializer) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerTlvSerializer(final Class<? extends Tlv> tlvClass, final TlvSerializer serializer) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerTlvParser(final int tlvType, final TlvParser parser) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerXROSubobjectSerializer(final Class<? extends CSubobject> subobjectClass, final XROSubobjectSerializer serializer) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       @Override
+       public AutoCloseable registerXROSubobjectParser(final int subobjectType, final XROSubobjectParser parser) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+}
diff --git a/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/PCEPExtensionProviderContextImpl.java b/pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/PCEPExtensionProviderContextImpl.java
new file mode 100644 (file)
index 0000000..722d6b3
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ * This program and the accompanying materials are made available under the
+ * 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.pojo;
+
+import java.util.ServiceLoader;
+
+import javax.annotation.concurrent.ThreadSafe;
+
+import org.opendaylight.protocol.pcep.spi.EROSubobjectHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.EROSubobjectParser;
+import org.opendaylight.protocol.pcep.spi.EROSubobjectSerializer;
+import org.opendaylight.protocol.pcep.spi.LabelHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.LabelParser;
+import org.opendaylight.protocol.pcep.spi.LabelSerializer;
+import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.MessageParser;
+import org.opendaylight.protocol.pcep.spi.MessageSerializer;
+import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.ObjectParser;
+import org.opendaylight.protocol.pcep.spi.ObjectSerializer;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderActivator;
+import org.opendaylight.protocol.pcep.spi.PCEPExtensionProviderContext;
+import org.opendaylight.protocol.pcep.spi.RROSubobjectHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.RROSubobjectParser;
+import org.opendaylight.protocol.pcep.spi.RROSubobjectSerializer;
+import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.TlvParser;
+import org.opendaylight.protocol.pcep.spi.TlvSerializer;
+import org.opendaylight.protocol.pcep.spi.XROSubobjectHandlerRegistry;
+import org.opendaylight.protocol.pcep.spi.XROSubobjectParser;
+import org.opendaylight.protocol.pcep.spi.XROSubobjectSerializer;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Object;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Tlv;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CLabel;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev130820.CSubobject;
+
+/**
+ *
+ */
+@ThreadSafe
+public final class PCEPExtensionProviderContextImpl implements PCEPExtensionProviderContext {
+       private static final class Holder {
+               private static final PCEPExtensionProviderContext INSTANCE;
+
+               static {
+                       try {
+                               INSTANCE = PCEPExtensionProviderContextImpl.create();
+                       } catch (Exception e) {
+                               throw new ExceptionInInitializerError(e);
+                       }
+               }
+       }
+
+       private final SimpleLabelHandlerRegistry labelReg = new SimpleLabelHandlerRegistry();
+       private final SimpleMessageHandlerRegistry msgReg = new SimpleMessageHandlerRegistry();
+       private final SimpleObjectHandlerRegistry objReg = new SimpleObjectHandlerRegistry();
+       private final SimpleEROSubobjectHandlerRegistry eroSubReg = new SimpleEROSubobjectHandlerRegistry();
+       private final SimpleRROSubobjectHandlerRegistry rroSubReg = new SimpleRROSubobjectHandlerRegistry();
+       private final SimpleXROSubobjectHandlerRegistry xroSubReg = new SimpleXROSubobjectHandlerRegistry();
+       private final SimpleTlvHandlerRegistry tlvReg = new SimpleTlvHandlerRegistry();
+
+       protected PCEPExtensionProviderContextImpl() {
+
+       }
+
+       public static PCEPExtensionProviderContext create() throws Exception {
+               final PCEPExtensionProviderContext ctx = new PCEPExtensionProviderContextImpl();
+
+               final ServiceLoader<PCEPExtensionProviderActivator> loader = ServiceLoader.load(PCEPExtensionProviderActivator.class);
+               for (PCEPExtensionProviderActivator a : loader) {
+                       a.start(ctx);
+               }
+
+               return ctx;
+
+       }
+
+       public static PCEPExtensionProviderContext getSingletonInstance() {
+               return Holder.INSTANCE;
+       }
+
+       @Override
+       public LabelHandlerRegistry getLabelHandlerRegistry() {
+               return labelReg;
+       }
+
+       @Override
+       public MessageHandlerRegistry getMessageHandlerRegistry() {
+               return this.msgReg;
+       }
+
+       @Override
+       public ObjectHandlerRegistry getObjectHandlerRegistry() {
+               return this.objReg;
+       }
+
+       @Override
+       public EROSubobjectHandlerRegistry getEROSubobjectHandlerRegistry() {
+               return this.eroSubReg;
+       }
+
+       @Override
+       public RROSubobjectHandlerRegistry getRROSubobjectHandlerRegistry() {
+               return this.rroSubReg;
+       }
+
+       @Override
+       public XROSubobjectHandlerRegistry getXROSubobjectHandlerRegistry() {
+               return this.xroSubReg;
+       }
+
+       @Override
+       public TlvHandlerRegistry getTlvHandlerRegistry() {
+               return this.tlvReg;
+       }
+
+       @Override
+       public AutoCloseable registerLabelSerializer(final Class<? extends CLabel> labelClass, final LabelSerializer serializer) {
+               return labelReg.registerLabelSerializer(labelClass, serializer);
+       }
+
+       @Override
+       public AutoCloseable registerLabelParser(final int cType, final LabelParser parser) {
+               return labelReg.registerLabelParser(cType, parser);
+       }
+
+       @Override
+       public AutoCloseable registerEROSubobjectParser(final int subobjectType, final EROSubobjectParser parser) {
+               return eroSubReg.registerSubobjectParser(subobjectType, parser);
+       }
+
+       @Override
+       public AutoCloseable registerEROSubobjectSerializer(final Class<? extends CSubobject> subobjectClass, final EROSubobjectSerializer serializer) {
+               return eroSubReg.registerSubobjectSerializer(subobjectClass, serializer);
+       }
+
+       @Override
+       public AutoCloseable registerMessageParser(final int messageType, final MessageParser parser) {
+               return msgReg.registerMessageParser(messageType, parser);
+       }
+
+       @Override
+       public AutoCloseable registerMessageSerializer(final Class<? extends Message> msgClass, final MessageSerializer serializer) {
+               return msgReg.registerMessageSerializer(msgClass, serializer);
+       }
+
+       @Override
+       public AutoCloseable registerObjectParser(final int objectClass, final int objectType, final ObjectParser parser) {
+               return objReg.registerObjectParser(objectClass, objectType, parser);
+       }
+
+       @Override
+       public AutoCloseable registerObjectSerializer(final Class<? extends Object> objClass, final ObjectSerializer serializer) {
+               return objReg.registerObjectSerializer(objClass, serializer);
+       }
+
+       @Override
+       public AutoCloseable registerRROSubobjectParser(final int subobjectType, final RROSubobjectParser parser) {
+               return rroSubReg.registerSubobjectParser(subobjectType, parser);
+       }
+
+       @Override
+       public AutoCloseable registerRROSubobjectSerializer(final Class<? extends CSubobject> subobjectClass, final RROSubobjectSerializer serializer) {
+               return rroSubReg.registerSubobjectSerializer(subobjectClass, serializer);
+       }
+
+       @Override
+       public AutoCloseable registerTlvParser(final int tlvType, final TlvParser parser) {
+               return tlvReg.registerTlvParser(tlvType, parser);
+       }
+
+       @Override
+       public AutoCloseable registerTlvSerializer(final Class<? extends Tlv> tlvClass, final TlvSerializer serializer) {
+               return tlvReg.registerTlvSerializer(tlvClass, serializer);
+       }
+
+       @Override
+       public AutoCloseable registerXROSubobjectParser(final int subobjectType, final XROSubobjectParser parser) {
+               return xroSubReg.registerSubobjectParser(subobjectType, parser);
+       }
+
+       @Override
+       public AutoCloseable registerXROSubobjectSerializer(final Class<? extends CSubobject> subobjectClass, final XROSubobjectSerializer serializer) {
+               return xroSubReg.registerSubobjectSerializer(subobjectClass, serializer);
+       }
+}
similarity index 92%
rename from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleEROSubobjectHandlerFactory.java
rename to pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleEROSubobjectHandlerRegistry.java
index f0aeb62d3b0faa5a89fe05a7351ae8043a65c626..ed342330bc2d429289038596dd14b8c9a2e73dc1 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.impl;
+package org.opendaylight.protocol.pcep.spi.pojo;
 
 import org.opendaylight.protocol.concepts.HandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.EROSubobjectHandlerRegistry;
@@ -17,27 +17,25 @@ import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 import com.google.common.base.Preconditions;
 
-public final class SimpleEROSubobjectHandlerFactory implements EROSubobjectHandlerRegistry {
+public final class SimpleEROSubobjectHandlerRegistry implements EROSubobjectHandlerRegistry {
        private final HandlerRegistry<DataContainer, EROSubobjectParser, EROSubobjectSerializer> handlers = new HandlerRegistry<>();
 
-       @Override
        public AutoCloseable registerSubobjectParser(final int subobjectType, final EROSubobjectParser parser) {
                Preconditions.checkArgument(subobjectType >= 0 && subobjectType <= 65535);
                return this.handlers.registerParser(subobjectType, parser);
        }
 
+       public AutoCloseable registerSubobjectSerializer(final Class<? extends CSubobject> subobjectClass,
+                       final EROSubobjectSerializer serializer) {
+               return this.handlers.registerSerializer(subobjectClass, serializer);
+       }
+
        @Override
        public EROSubobjectParser getSubobjectParser(final int subobjectType) {
                Preconditions.checkArgument(subobjectType >= 0 && subobjectType <= 65535);
                return this.handlers.getParser(subobjectType);
        }
 
-       @Override
-       public AutoCloseable registerSubobjectSerializer(final Class<? extends CSubobject> subobjectClass,
-                       final EROSubobjectSerializer serializer) {
-               return this.handlers.registerSerializer(subobjectClass, serializer);
-       }
-
        @Override
        public EROSubobjectSerializer getSubobjectSerializer(final Subobjects subobject) {
                return this.handlers.getSerializer(subobject.getImplementedInterface());
similarity index 96%
rename from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleLabelHandlerRegistry.java
rename to pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleLabelHandlerRegistry.java
index 1d34690a9584ba3cce2c9e87248ac6267e7ab637..169db72fbfbd2a65869d8b6ab919ad2925bca4b2 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.impl;
+package org.opendaylight.protocol.pcep.spi.pojo;
 
 import org.opendaylight.protocol.concepts.HandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.LabelHandlerRegistry;
@@ -19,23 +19,21 @@ import com.google.common.base.Preconditions;
 public class SimpleLabelHandlerRegistry implements LabelHandlerRegistry {
        private final HandlerRegistry<DataContainer, LabelParser, LabelSerializer> handlers = new HandlerRegistry<>();
 
-       @Override
        public AutoCloseable registerLabelParser(final int cType, final LabelParser parser) {
                Preconditions.checkArgument(cType >= 0 && cType <= 255);
                return handlers.registerParser(cType, parser);
        }
 
+       public AutoCloseable registerLabelSerializer(final Class<? extends CLabel> labelClass, final LabelSerializer serializer) {
+               return handlers.registerSerializer(labelClass, serializer);
+       }
+
        @Override
        public LabelParser getLabelParser(final int cType) {
                Preconditions.checkArgument(cType >= 0 && cType <= 255);
                return handlers.getParser(cType);
        }
 
-       @Override
-       public AutoCloseable registerLabelSerializer(final Class<? extends CLabel> labelClass, final LabelSerializer serializer) {
-               return handlers.registerSerializer(labelClass, serializer);
-       }
-
        @Override
        public LabelSerializer getLabelSerializer(final CLabel label) {
                return handlers.getSerializer(label.getImplementedInterface());
similarity index 96%
rename from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleMessageHandlerRegistry.java
rename to pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleMessageHandlerRegistry.java
index e64697d5c28af0674243569398432594a3d480f4..6c7a07a629597cc9b9b9fb8a4e09123af05a9ce9 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.impl;
+package org.opendaylight.protocol.pcep.spi.pojo;
 
 import org.opendaylight.protocol.concepts.HandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.MessageHandlerRegistry;
@@ -20,13 +20,11 @@ public final class SimpleMessageHandlerRegistry implements MessageHandlerRegistr
 
        private final HandlerRegistry<DataContainer, MessageParser, MessageSerializer> handlers = new HandlerRegistry<>();
 
-       @Override
        public AutoCloseable registerMessageParser(final int messageType, final MessageParser parser) {
                Preconditions.checkArgument(messageType >= 0 && messageType <= 255);
                return this.handlers.registerParser(messageType, parser);
        }
 
-       @Override
        public AutoCloseable registerMessageSerializer(final Class<? extends Message> msgClass, final MessageSerializer serializer) {
                return this.handlers.registerSerializer(msgClass, serializer);
        }
similarity index 96%
rename from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleObjectHandlerRegistry.java
rename to pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleObjectHandlerRegistry.java
index c58df47b13d7d8f25e177e2098b0d244e999b281..709452bbae49a9c4e2421b50aa341366e5b46d70 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.impl;
+package org.opendaylight.protocol.pcep.spi.pojo;
 
 import org.opendaylight.protocol.concepts.HandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.ObjectHandlerRegistry;
@@ -28,14 +28,12 @@ public final class SimpleObjectHandlerRegistry implements ObjectHandlerRegistry
                return (objectClass << 4) | objectType;
        }
 
-       @Override
        public AutoCloseable registerObjectParser(final int objectClass, final int objectType, final ObjectParser parser) {
                Preconditions.checkArgument(objectClass >= 0 && objectClass <= 255);
                Preconditions.checkArgument(objectType >= 0 && objectType <= 15);
                return handlers.registerParser(createKey(objectClass, objectType), parser);
        }
 
-       @Override
        public AutoCloseable registerObjectSerializer(final Class<? extends Object> objClass, final ObjectSerializer serializer) {
                return handlers.registerSerializer(objClass, serializer);
        }
similarity index 92%
rename from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleRROSubobjectHandlerFactory.java
rename to pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleRROSubobjectHandlerRegistry.java
index 8252929a008ade4223205206a9f7c184b00c3d20..6981dcb2ef29d9d2328d04e0f695d2159d8dbf72 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.impl;
+package org.opendaylight.protocol.pcep.spi.pojo;
 
 import org.opendaylight.protocol.concepts.HandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.RROSubobjectHandlerRegistry;
@@ -17,10 +17,9 @@ import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 import com.google.common.base.Preconditions;
 
-public final class SimpleRROSubobjectHandlerFactory implements RROSubobjectHandlerRegistry {
+public final class SimpleRROSubobjectHandlerRegistry implements RROSubobjectHandlerRegistry {
        private final HandlerRegistry<DataContainer, RROSubobjectParser, RROSubobjectSerializer> handlers = new HandlerRegistry<>();
 
-       @Override
        public AutoCloseable registerSubobjectParser(final int subobjectType, final RROSubobjectParser parser) {
                Preconditions.checkArgument(subobjectType >= 0 && subobjectType <= 65535);
                return this.handlers.registerParser(subobjectType, parser);
@@ -32,7 +31,6 @@ public final class SimpleRROSubobjectHandlerFactory implements RROSubobjectHandl
                return this.handlers.getParser(subobjectType);
        }
 
-       @Override
        public AutoCloseable registerSubobjectSerializer(final Class<? extends CSubobject> subobjectClass,
                        final RROSubobjectSerializer serializer) {
                return this.handlers.registerSerializer(subobjectClass, serializer);
similarity index 95%
rename from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleTlvHandlerRegistry.java
rename to pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleTlvHandlerRegistry.java
index 00de0bde21eeac68cc65fa87cf52a397055a1cc2..fd3ad8292cef412f775bad79dbc969c23b0a3873 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.impl;
+package org.opendaylight.protocol.pcep.spi.pojo;
 
 import org.opendaylight.protocol.concepts.HandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.TlvHandlerRegistry;
@@ -22,20 +22,18 @@ import com.google.common.base.Preconditions;
 public final class SimpleTlvHandlerRegistry implements TlvHandlerRegistry {
        private final HandlerRegistry<DataContainer, TlvParser, TlvSerializer> handlers = new HandlerRegistry<>();
 
-       @Override
        public AutoCloseable registerTlvParser(final int tlvType, final TlvParser parser) {
                Preconditions.checkArgument(tlvType >= 0 && tlvType < 65535);
                return handlers.registerParser(tlvType, parser);
        }
 
-       @Override
-       public TlvParser getTlvParser(final int tlvType) {
-               return handlers.getParser(tlvType);
+       public AutoCloseable registerTlvSerializer(final Class<? extends Tlv> tlvClass, final TlvSerializer serializer) {
+               return handlers.registerSerializer(tlvClass, serializer);
        }
 
        @Override
-       public AutoCloseable registerTlvSerializer(final Class<? extends Tlv> tlvClass, final TlvSerializer serializer) {
-               return handlers.registerSerializer(tlvClass, serializer);
+       public TlvParser getTlvParser(final int tlvType) {
+               return handlers.getParser(tlvType);
        }
 
        @Override
similarity index 92%
rename from pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/SimpleXROSubobjectHandlerFactory.java
rename to pcep/spi/src/main/java/org/opendaylight/protocol/pcep/spi/pojo/SimpleXROSubobjectHandlerRegistry.java
index 9ef5b9dd9f283b379f567fc12880abc98d661855..ebfe100a0ea8b32b2cefc72d9a79221485a4c0bc 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.impl;
+package org.opendaylight.protocol.pcep.spi.pojo;
 
 import org.opendaylight.protocol.concepts.HandlerRegistry;
 import org.opendaylight.protocol.pcep.spi.XROSubobjectHandlerRegistry;
@@ -17,27 +17,25 @@ import org.opendaylight.yangtools.yang.binding.DataContainer;
 
 import com.google.common.base.Preconditions;
 
-public final class SimpleXROSubobjectHandlerFactory implements XROSubobjectHandlerRegistry {
+public final class SimpleXROSubobjectHandlerRegistry implements XROSubobjectHandlerRegistry {
        private final HandlerRegistry<DataContainer, XROSubobjectParser, XROSubobjectSerializer> handlers = new HandlerRegistry<>();
 
-       @Override
        public AutoCloseable registerSubobjectParser(final int subobjectType, final XROSubobjectParser parser) {
                Preconditions.checkArgument(subobjectType >= 0 && subobjectType <= 65535);
                return this.handlers.registerParser(subobjectType, parser);
        }
 
+       public AutoCloseable registerSubobjectSerializer(final Class<? extends CSubobject> subobjectClass,
+                       final XROSubobjectSerializer serializer) {
+               return this.handlers.registerSerializer(subobjectClass, serializer);
+       }
+
        @Override
        public XROSubobjectParser getSubobjectParser(final int subobjectType) {
                Preconditions.checkArgument(subobjectType >= 0 && subobjectType <= 65535);
                return this.handlers.getParser(subobjectType);
        }
 
-       @Override
-       public AutoCloseable registerSubobjectSerializer(final Class<? extends CSubobject> subobjectClass,
-                       final XROSubobjectSerializer serializer) {
-               return this.handlers.registerSerializer(subobjectClass, serializer);
-       }
-
        @Override
        public XROSubobjectSerializer getSubobjectSerializer(final Subobjects subobject) {
                return this.handlers.getSerializer(subobject.getImplementedInterface());
index 006d336288677fa85da92c70aaeb885456ab1daa..9edb26705ac4b0f7f6ee1d033591478734927abc 100644 (file)
@@ -16,6 +16,7 @@ import org.opendaylight.protocol.pcep.PCEPSessionProposalFactory;
 import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory;
 import org.opendaylight.protocol.pcep.impl.PCEPDispatcherImpl;
 import org.opendaylight.protocol.pcep.impl.PCEPSessionProposalFactoryImpl;
+import org.opendaylight.protocol.pcep.spi.pojo.PCEPExtensionProviderContextImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OpenObject;
 
 public class Main {
@@ -117,7 +118,9 @@ public class Main {
 
                final OpenObject prefs = spf.getSessionProposal(address, 0);
 
-               final PCEPDispatcherImpl dispatcher = new PCEPDispatcherImpl(new DefaultPCEPSessionNegotiatorFactory(new HashedWheelTimer(), prefs, 5));
+               final PCEPDispatcherImpl dispatcher = new PCEPDispatcherImpl(
+                               PCEPExtensionProviderContextImpl.getSingletonInstance().getMessageHandlerRegistry(),
+                               new DefaultPCEPSessionNegotiatorFactory(new HashedWheelTimer(), prefs, 5));
 
                dispatcher.createServer(address, new TestingSessionListenerFactory()).get();
        }
index a5324f860e6325b4ac1e38c8d7650f779d8928f7..6934e98d3171869d9d23422ae2120899e0894e77 100644 (file)
@@ -28,7 +28,7 @@ import org.opendaylight.protocol.pcep.PCEPSessionListener;
 import org.opendaylight.protocol.pcep.impl.DefaultPCEPSessionNegotiatorFactory;
 import org.opendaylight.protocol.pcep.impl.PCEPHandlerFactory;
 import org.opendaylight.protocol.pcep.impl.PCEPSessionImpl;
-import org.opendaylight.protocol.pcep.impl.SingletonPCEPProviderContext;
+import org.opendaylight.protocol.pcep.spi.pojo.PCEPExtensionProviderContextImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.message.open.message.OpenBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.open.object.TlvsBuilder;
@@ -67,7 +67,7 @@ public class PCCMock<M, S extends ProtocolSession<M>, L extends SessionListener<
                                (short) 30).setDeadTimer((short) 120).setSessionId((short) 0).setTlvs(builder.build()).build(), 0);
 
                final PCCMock<Message, PCEPSessionImpl, PCEPSessionListener> pcc = new PCCMock<>(snf,
-                               new PCEPHandlerFactory(SingletonPCEPProviderContext.getInstance().getMessageHandlerRegistry()),
+                               new PCEPHandlerFactory(PCEPExtensionProviderContextImpl.getSingletonInstance().getMessageHandlerRegistry()),
                                new DefaultPromise<PCEPSessionImpl>(GlobalEventExecutor.INSTANCE));
 
                pcc.createClient(new InetSocketAddress("127.0.0.3", 12345), new NeverReconnectStrategy(GlobalEventExecutor.INSTANCE, 2000),