bug 2493 - eliminate the use of xtend and remove dependecies 38/13738/3
authorary <jatoth@cisco.com>
Wed, 17 Dec 2014 16:19:07 +0000 (11:19 -0500)
committerary <jatoth@cisco.com>
Wed, 21 Jan 2015 10:50:48 +0000 (11:50 +0100)
Signed-off-by: ary <jatoth@cisco.com>
Change-Id: I2b2c49d93daf90c90e024d3af727f87957a8427e

13 files changed:
openflowplugin-it/pom.xml
pom.xml
test-provider/pom.xml
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.java [new file with mode: 0644]
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.xtend [deleted file]
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.java [new file with mode: 0644]
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.xtend [deleted file]
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.java [new file with mode: 0644]
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.xtend [deleted file]
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.java [new file with mode: 0644]
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.xtend [deleted file]
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.java [new file with mode: 0644]
test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.xtend [deleted file]

index ccfb159ca41756c4543fc9caec5b9d48fcdd7af2..3e10e906f4394d9de925ad03cca7e790b9487796 100644 (file)
             <artifactId>javassist</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools.thirdparty</groupId>
-            <artifactId>xtend-lib-osgi</artifactId>
-            <scope>test</scope>
-        </dependency>
         <dependency>
             <groupId>org.ops4j.pax.exam</groupId>
             <artifactId>pax-exam-container-forked</artifactId>
diff --git a/pom.xml b/pom.xml
index 7453fef29f35dcc242ef820b1a1932b2fb15bff3..270e579d3b7cf97e120e54ad241a9b2643e70b6f 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -54,7 +54,6 @@
       <netconf.parent.version>0.3.0-SNAPSHOT</netconf.parent.version>
       <config.parent.version>0.3.0-SNAPSHOT</config.parent.version>
       <build.helper.version>1.8</build.helper.version>
-      <xtend.dstdir>src/main/xtend-gen</xtend.dstdir>
       <jmxGeneratorPath>src/main/yang-gen-config</jmxGeneratorPath>
       <salGeneratorPath>src/main/yang-gen-sal</salGeneratorPath>
       <exi.nagasena.version>0000.0002.0038.0</exi.nagasena.version>
             <artifactId>xml-apis</artifactId>
             <version>1.4.01</version>
         </dependency>
-        <dependency>
-            <groupId>org.opendaylight.yangtools.thirdparty</groupId>
-            <artifactId>xtend-lib-osgi</artifactId>
-            <version>2.4.3</version>
-            <scope>test</scope>
-        </dependency>
       </dependencies>
     </dependencyManagement>
 
               <artifactId>maven-paxexam-plugin</artifactId>
               <version>1.2.4</version>
             </plugin>
-            <plugin>
-              <groupId>org.eclipse.xtend</groupId>
-              <artifactId>xtend-maven-plugin</artifactId>
-              <version>${xtend.version}</version>
-              <executions>
-                  <execution>
-                      <goals>
-                          <goal>compile</goal>
-                      </goals>
-                      <configuration>
-                          <outputDirectory>${xtend.dstdir}</outputDirectory>
-                      </configuration>
-                  </execution>
-              </executions>
-          </plugin>
           <plugin>
               <artifactId>maven-clean-plugin</artifactId>
               <configuration>
                   <filesets>
-                      <fileset>
-                          <directory>${xtend.dstdir}</directory>
-                          <includes>
-                              <include>**</include>
-                          </includes>
-                      </fileset>
                       <fileset>
                           <directory>${jmxGeneratorPath}</directory>
                           <includes>
                       <sources>
                          <source>${jmxGeneratorPath}</source>
                          <source>${salGeneratorPath}</source>
-                         <source>${xtend.dstdir}</source>
                       </sources>
                    </configuration>
                 </execution>
index c63174911659252cb4b45b1419a1904d0e5338b4..11b3bfab8b05d5e0f969ecdb5c6ba46ea066d8fb 100644 (file)
                <dependency>
             <groupId>org.opendaylight.controller.model</groupId>
             <artifactId>model-flow-statistics</artifactId>
-        </dependency>   
-        <dependency>
-            <groupId>org.eclipse.xtend</groupId>
-            <artifactId>org.eclipse.xtend.lib</artifactId>
-            <version>${xtend.version}</version>
         </dependency>
          <dependency>
                <groupId>equinoxSDK381</groupId>
                     </instructions>
                 </configuration>
             </plugin>
-            <plugin>
-                <groupId>org.eclipse.xtend</groupId>
-                <artifactId>xtend-maven-plugin</artifactId>
-            </plugin>
         </plugins>
     </build>
 </project>
diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.java
new file mode 100644 (file)
index 0000000..eb3f938
--- /dev/null
@@ -0,0 +1,179 @@
+/**
+ * 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.openflowplugin.test;
+
+import java.util.concurrent.Future;
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration.CompositeObjectRegistrationBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenflowpluginGroupTestServiceProvider implements AutoCloseable,
+        SalGroupService {
+
+    private final static Logger LOG = LoggerFactory
+            .getLogger(OpenflowpluginGroupTestServiceProvider.class);
+    private RoutedRpcRegistration<SalGroupService> groupRegistration;
+    private NotificationProviderService notificationService;
+
+    /**
+     * get group registration
+     * 
+     * @return {@link #groupRegistration}
+     */
+    public RoutedRpcRegistration<SalGroupService> getGroupRegistration() {
+        return groupRegistration;
+    }
+
+    /**
+     * set {@link #groupRegistration}
+     * 
+     * @param groupRegistration
+     */
+    public void setGroupRegistration(
+            final RoutedRpcRegistration<SalGroupService> groupRegistration) {
+        this.groupRegistration = groupRegistration;
+    }
+
+    /**
+     * get notification service
+     * 
+     * @return {@link #notificationService}
+     */
+    public NotificationProviderService getNotificationService() {
+        return notificationService;
+    }
+
+    /**
+     * set {@link #notificationService}
+     * 
+     * @param notificationService
+     */
+    public void setNotificationService(
+            final NotificationProviderService notificationService) {
+        this.notificationService = notificationService;
+    }
+
+    public void start() {
+        OpenflowpluginGroupTestServiceProvider.LOG
+                .info("SalGroupServiceProvider Started.");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.AutoCloseable#close()
+     */
+    @Override
+    public void close() throws Exception {
+        OpenflowpluginGroupTestServiceProvider.LOG
+                .info("SalGroupServiceProvide stopped.");
+        groupRegistration.close();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918
+     * .SalGroupService
+     * #addGroup(org.opendaylight.yang.gen.v1.urn.opendaylight.group
+     * .service.rev130918.AddGroupInput)
+     */
+    @Override
+    public Future<RpcResult<AddGroupOutput>> addGroup(AddGroupInput input) {
+        String plus = ("addGroup - " + input);
+        OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918
+     * .SalGroupService
+     * #removeGroup(org.opendaylight.yang.gen.v1.urn.opendaylight
+     * .group.service.rev130918.RemoveGroupInput)
+     */
+    @Override
+    public Future<RpcResult<RemoveGroupOutput>> removeGroup(
+            RemoveGroupInput input) {
+        String plus = ("removeGroup - " + input);
+        OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918
+     * .SalGroupService
+     * #updateGroup(org.opendaylight.yang.gen.v1.urn.opendaylight
+     * .group.service.rev130918.UpdateGroupInput)
+     */
+    @Override
+    public Future<RpcResult<UpdateGroupOutput>> updateGroup(
+            UpdateGroupInput input) {
+        String plus = ("updateGroup - " + input);
+        OpenflowpluginGroupTestServiceProvider.LOG.info(plus);
+        return null;
+    }
+
+    /**
+     * @param ctx
+     * @return {@link CompositeObjectRegistrationBuilder #toInstance()}
+     */
+    public CompositeObjectRegistration<OpenflowpluginGroupTestServiceProvider> register(
+            final ProviderContext ctx) {
+        CompositeObjectRegistrationBuilder<OpenflowpluginGroupTestServiceProvider> builder = CompositeObjectRegistration
+                .<OpenflowpluginGroupTestServiceProvider> builderFor(this);
+
+        RoutedRpcRegistration<SalGroupService> addRoutedRpcImplementation = ctx
+                .<SalGroupService> addRoutedRpcImplementation(
+                        SalGroupService.class, this);
+        setGroupRegistration(addRoutedRpcImplementation);
+
+        InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
+                .<Nodes> builder(Nodes.class);
+
+        NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
+        NodeKey nodeKey = new NodeKey(nodeId);
+
+        InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
+                .<Node, NodeKey> child(Node.class, nodeKey);
+        InstanceIdentifier<Node> instance = nodeIndentifier.build();
+        groupRegistration.registerPath(NodeContext.class, instance);
+        RoutedRpcRegistration<SalGroupService> groupRegistration1 = this
+                .getGroupRegistration();
+        builder.add(groupRegistration1);
+        return builder.build();
+    }
+
+}
diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.xtend b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginGroupTestServiceProvider.xtend
deleted file mode 100644 (file)
index 853a247..0000000
+++ /dev/null
@@ -1,81 +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.openflowplugin.test
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.AddGroupInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.RemoveGroupInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalGroupService
-import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.UpdateGroupInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-import org.opendaylight.yangtools.concepts.CompositeObjectRegistration
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.slf4j.LoggerFactory
-
-class OpenflowpluginGroupTestServiceProvider implements AutoCloseable, SalGroupService {
-
-
-    static val LOG = LoggerFactory.getLogger(OpenflowpluginGroupTestServiceProvider);
-    
-    @Property
-    RoutedRpcRegistration<SalGroupService> groupRegistration;
-        
-
-    @Property
-    NotificationProviderService notificationService;
-
-
-    def void start() {
-        LOG.info("SalGroupServiceProvider Started.");
-        
-    }
-
-
-    override close() {
-       LOG.info("SalGroupServiceProvide stopped.");
-        groupRegistration.close;
-    }
-    
-    override addGroup(AddGroupInput input) {
-        LOG.info("addGroup - " + input);
-        return null;
-        
-    }
-    
-    override removeGroup(RemoveGroupInput input) {
-        LOG.info("removeGroup - " + input);
-        return null;
-    }
-    
-    override updateGroup(UpdateGroupInput input) {
-        LOG.info("updateGroup - " + input);
-        return null;
-    }
-    
-    
-    def CompositeObjectRegistration<OpenflowpluginGroupTestServiceProvider> register(ProviderContext ctx) {
-        val builder = CompositeObjectRegistration
-                .<OpenflowpluginGroupTestServiceProvider> builderFor(this);
-
-        groupRegistration = ctx.addRoutedRpcImplementation(SalGroupService, this);
-        val nodeIndentifier = InstanceIdentifier.builder(Nodes).child(Node, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)));
-        groupRegistration.registerPath(NodeContext, nodeIndentifier.toInstance());
-        builder.add(groupRegistration);
-
-        return builder.toInstance();
-    }
-    
-}
-
-
diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.java
new file mode 100644 (file)
index 0000000..c2feaf2
--- /dev/null
@@ -0,0 +1,200 @@
+/**
+ * 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.openflowplugin.test;
+
+import java.util.concurrent.Future;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterOutput;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration.CompositeObjectRegistrationBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
+        SalMeterService {
+    private final static Logger LOG = LoggerFactory
+            .getLogger(OpenflowpluginMeterTestServiceProvider.class);
+    private DataBroker dataService;
+    private RoutedRpcRegistration<SalMeterService> meterRegistration;
+    private NotificationProviderService notificationService;
+
+    /**
+     * get data service
+     * 
+     * @return {@link #dataService}
+     */
+    public DataBroker getDataService() {
+        return this.dataService;
+    }
+
+    /**
+     * set {@link #dataService}
+     * 
+     * @param dataService
+     */
+    public void setDataService(final DataBroker dataService) {
+        this.dataService = dataService;
+    }
+
+    /**
+     * get meter registration
+     * 
+     * @return {@link #meterRegistration}
+     */
+    public RoutedRpcRegistration<SalMeterService> getMeterRegistration() {
+        return this.meterRegistration;
+    }
+
+    /**
+     * set {@link #meterRegistration}
+     * 
+     * @param meterRegistration
+     */
+    public void setMeterRegistration(
+            final RoutedRpcRegistration<SalMeterService> meterRegistration) {
+        this.meterRegistration = meterRegistration;
+    }
+
+    /**
+     * get notification service
+     * 
+     * @return {@link #notificationService}
+     */
+    public NotificationProviderService getNotificationService() {
+        return this.notificationService;
+    }
+
+    /**
+     * set {@link #notificationService}
+     * 
+     * @param notificationService
+     */
+    public void setNotificationService(
+            final NotificationProviderService notificationService) {
+        this.notificationService = notificationService;
+    }
+
+    public void start() {
+        OpenflowpluginMeterTestServiceProvider.LOG
+                .info("SalMeterServiceProvider Started.");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.AutoCloseable#close()
+     */
+    public void close() {
+        OpenflowpluginMeterTestServiceProvider.LOG
+                .info("SalMeterServiceProvide stopped.");
+        meterRegistration.close();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918
+     * .SalMeterService
+     * #addMeter(org.opendaylight.yang.gen.v1.urn.opendaylight.meter
+     * .service.rev130918.AddMeterInput)
+     */
+    public Future<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
+        String plus = ("addMeter - " + input);
+        OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918
+     * .SalMeterService
+     * #removeMeter(org.opendaylight.yang.gen.v1.urn.opendaylight
+     * .meter.service.rev130918.RemoveMeterInput)
+     */
+    public Future<RpcResult<RemoveMeterOutput>> removeMeter(
+            final RemoveMeterInput input) {
+        String plus = ("removeMeter - " + input);
+        OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918
+     * .SalMeterService
+     * #updateMeter(org.opendaylight.yang.gen.v1.urn.opendaylight
+     * .meter.service.rev130918.UpdateMeterInput)
+     */
+    public Future<RpcResult<UpdateMeterOutput>> updateMeter(
+            final UpdateMeterInput input) {
+        String plus = ("updateMeter - " + input);
+        OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
+        return null;
+    }
+
+    /**
+     * @param ctx
+     * @return {@link CompositeObjectRegistrationBuilder #toInstance()}
+     */
+    public CompositeObjectRegistration<OpenflowpluginMeterTestServiceProvider> register(
+            final ProviderContext ctx) {
+        CompositeObjectRegistrationBuilder<OpenflowpluginMeterTestServiceProvider> builder = CompositeObjectRegistration
+                .<OpenflowpluginMeterTestServiceProvider> builderFor(this);
+
+        RoutedRpcRegistration<SalMeterService> addRoutedRpcImplementation = ctx
+                .<SalMeterService> addRoutedRpcImplementation(
+                        SalMeterService.class, this);
+
+        setMeterRegistration(addRoutedRpcImplementation);
+
+        InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
+                .<Nodes> builder(Nodes.class);
+
+        NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
+        NodeKey nodeKey = new NodeKey(nodeId);
+
+        InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
+                .<Node, NodeKey> child(Node.class, nodeKey);
+
+        InstanceIdentifier<Node> instance = nodeIndentifier.build();
+
+        meterRegistration.registerPath(NodeContext.class, instance);
+
+        RoutedRpcRegistration<SalMeterService> meterRegistration1 = this
+                .getMeterRegistration();
+
+        builder.add(meterRegistration1);
+
+        return builder.build();
+    }
+
+}
diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.xtend b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginMeterTestServiceProvider.xtend
deleted file mode 100644 (file)
index b87ff42..0000000
+++ /dev/null
@@ -1,84 +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.openflowplugin.test
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService
-import org.opendaylight.controller.md.sal.binding.api.DataBroker
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.AddMeterInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.RemoveMeterInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.SalMeterService
-import org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.UpdateMeterInput
-import org.opendaylight.yangtools.concepts.CompositeObjectRegistration
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.slf4j.LoggerFactory
-
-class OpenflowpluginMeterTestServiceProvider implements AutoCloseable, SalMeterService {
-
-
-    static val LOG = LoggerFactory.getLogger(OpenflowpluginMeterTestServiceProvider);
-
-    @Property
-    DataBroker dataService;
-    
-    @Property
-    RoutedRpcRegistration<SalMeterService> meterRegistration;
-        
-
-    @Property
-    NotificationProviderService notificationService;
-
-
-    def void start() {
-        LOG.info("SalMeterServiceProvider Started.");
-        
-    }
-
-
-    override close() {
-       LOG.info("SalMeterServiceProvide stopped.");
-        meterRegistration.close;
-    }
-    
-    override addMeter(AddMeterInput input) {
-        LOG.info("addMeter - " + input);
-        return null;
-        
-    }
-    
-    override removeMeter(RemoveMeterInput input) {
-        LOG.info("removeMeter - " + input);
-        return null;
-    }
-    
-    override updateMeter(UpdateMeterInput input) {
-        LOG.info("updateMeter - " + input);
-        return null;
-    }
-    
-    
-    def CompositeObjectRegistration<OpenflowpluginMeterTestServiceProvider> register(ProviderContext ctx) {
-        val builder = CompositeObjectRegistration
-                .<OpenflowpluginMeterTestServiceProvider> builderFor(this);
-
-        meterRegistration = ctx.addRoutedRpcImplementation(SalMeterService, this);
-        val nodeIndentifier = InstanceIdentifier.builder(Nodes).child(Node, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)));
-        meterRegistration.registerPath(NodeContext, nodeIndentifier.toInstance());
-        builder.add(meterRegistration);
-        return builder.toInstance();
-    }
-    
-}
-
-
diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.java
new file mode 100644 (file)
index 0000000..2d9df29
--- /dev/null
@@ -0,0 +1,148 @@
+/**
+ * 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.openflowplugin.test;
+
+import java.util.concurrent.Future;
+
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableOutput;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration.CompositeObjectRegistrationBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenflowpluginTableFeaturesTestServiceProvider implements
+        AutoCloseable, SalTableService {
+
+    private final static Logger LOG = LoggerFactory
+            .getLogger(OpenflowpluginTableFeaturesTestServiceProvider.class);
+    private RoutedRpcRegistration<SalTableService> tableRegistration;
+    private NotificationProviderService notificationService;
+
+    /**
+     * get table registration
+     * 
+     * @return {@link #tableRegistration}
+     */
+    public RoutedRpcRegistration<SalTableService> getTableRegistration() {
+        return this.tableRegistration;
+    }
+
+    /**
+     * set {@link #tableRegistration}
+     * 
+     * @param tableRegistration
+     */
+    public void setTableRegistration(
+            final RoutedRpcRegistration<SalTableService> tableRegistration) {
+        this.tableRegistration = tableRegistration;
+    }
+
+    /**
+     * get notification service
+     * 
+     * @return {@link #notificationService}
+     */
+    public NotificationProviderService getNotificationService() {
+        return this.notificationService;
+    }
+
+    /**
+     * set {@link #notificationService}
+     * 
+     * @param notificationService
+     */
+    public void setNotificationService(
+            final NotificationProviderService notificationService) {
+        this.notificationService = notificationService;
+    }
+
+    public void start() {
+        OpenflowpluginTableFeaturesTestServiceProvider.LOG
+                .info("SalTableServiceProvider Started.");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.AutoCloseable#close()
+     */
+    @Override
+    public void close() throws Exception {
+        OpenflowpluginTableFeaturesTestServiceProvider.LOG
+                .info("SalTableServiceProvider stopped.");
+        tableRegistration.close();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026
+     * .SalTableService
+     * #updateTable(org.opendaylight.yang.gen.v1.urn.opendaylight
+     * .table.service.rev131026.UpdateTableInput)
+     */
+    @Override
+    public Future<RpcResult<UpdateTableOutput>> updateTable(
+            UpdateTableInput input) {
+        String plus = ("updateTable - " + input);
+        OpenflowpluginTableFeaturesTestServiceProvider.LOG.info(plus);
+        return null;
+    }
+
+    /**
+     * @param ctx
+     * @return {@link CompositeObjectRegistrationBuilder #toInstance()}
+     */
+    public CompositeObjectRegistration<OpenflowpluginTableFeaturesTestServiceProvider> register(
+            final ProviderContext ctx) {
+        CompositeObjectRegistrationBuilder<OpenflowpluginTableFeaturesTestServiceProvider> builder = CompositeObjectRegistration
+                .<OpenflowpluginTableFeaturesTestServiceProvider> builderFor(this);
+
+        RoutedRpcRegistration<SalTableService> addRoutedRpcImplementation = ctx
+                .<SalTableService> addRoutedRpcImplementation(
+                        SalTableService.class, this);
+
+        setTableRegistration(addRoutedRpcImplementation);
+
+        InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
+                .<Nodes> builder(Nodes.class);
+
+        NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
+        NodeKey nodeKey = new NodeKey(nodeId);
+
+        InstanceIdentifierBuilder<Node> nodeIndentifier = builder1
+                .<Node, NodeKey> child(Node.class, nodeKey);
+
+        InstanceIdentifier<Node> instance = nodeIndentifier.build();
+
+        tableRegistration.registerPath(NodeContext.class, instance);
+
+        RoutedRpcRegistration<SalTableService> tableRegistration1 = this
+                .getTableRegistration();
+
+        builder.add(tableRegistration1);
+
+        return builder.build();
+    }
+
+}
diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.xtend b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTableFeaturesTestServiceProvider.xtend
deleted file mode 100644 (file)
index 9bdfbc1..0000000
+++ /dev/null
@@ -1,71 +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.openflowplugin.test
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService
-import org.opendaylight.controller.md.sal.binding.api.DataBroker
-
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.SalTableService
-//import org.opendaylight.yang.gen.v1.urn.opendaylight.group.service.rev130918.SalTableService
-import org.opendaylight.yang.gen.v1.urn.opendaylight.table.service.rev131026.UpdateTableInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-import org.opendaylight.yangtools.concepts.CompositeObjectRegistration
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.slf4j.LoggerFactory
-
-
-class OpenflowpluginTableFeaturesTestServiceProvider implements AutoCloseable, SalTableService {
-
-
-    static val LOG = LoggerFactory.getLogger(OpenflowpluginTableFeaturesTestServiceProvider);
-    
-    @Property
-    RoutedRpcRegistration<SalTableService> tableRegistration;
-        
-
-    @Property
-    NotificationProviderService notificationService;
-
-
-    def void start() {
-        LOG.info("SalTableServiceProvider Started.");
-        
-    }
-
-
-    override close() {
-       LOG.info("SalTableServiceProvider stopped.");
-        tableRegistration.close;
-    }
-    
-      
-    override updateTable(UpdateTableInput input) {
-        LOG.info("updateTable - " + input);
-        return null;
-    }
-    
-    
-    def CompositeObjectRegistration<OpenflowpluginTableFeaturesTestServiceProvider> register(ProviderContext ctx) {
-        val builder = CompositeObjectRegistration
-                .<OpenflowpluginTableFeaturesTestServiceProvider> builderFor(this);
-
-        tableRegistration = ctx.addRoutedRpcImplementation(SalTableService, this);
-        val nodeIndentifier = InstanceIdentifier.builder(Nodes).child(Node, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)));
-        tableRegistration.registerPath(NodeContext, nodeIndentifier.toInstance());
-        builder.add(tableRegistration);
-
-        return builder.toInstance();
-    }
-    
-}
\ No newline at end of file
diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.java
new file mode 100644 (file)
index 0000000..36feb97
--- /dev/null
@@ -0,0 +1,137 @@
+/**
+ * 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.openflowplugin.test;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.osgi.framework.BundleContext;
+
+public class OpenflowpluginTestActivator extends AbstractBindingAwareProvider {
+
+    private static OpenflowpluginTestServiceProvider provider = new OpenflowpluginTestServiceProvider();
+    private static OpenflowpluginGroupTestServiceProvider groupProvider = new OpenflowpluginGroupTestServiceProvider();
+    private static OpenflowpluginMeterTestServiceProvider meterProvider = new OpenflowpluginMeterTestServiceProvider();
+    private static OpenflowpluginTableFeaturesTestServiceProvider tableProvider = new OpenflowpluginTableFeaturesTestServiceProvider();
+
+    private OpenflowpluginTestCommandProvider cmdProvider;
+
+    private OpenflowpluginGroupTestCommandProvider cmdGroupProvider;
+
+    private OpenflowpluginMeterTestCommandProvider cmdMeterProvider;
+
+    private OpenflowpluginTableFeaturesTestCommandProvider cmdTableProvider;
+
+    private OpenflowpluginStatsTestCommandProvider cmdStatsProvider;
+
+    private OpenflowpluginTestNodeConnectorNotification cmdNodeConnectorNotification;
+
+    private OpenflowpluginTestTopologyNotification cmdTopologyNotification;
+
+    private OpenflowPluginBulkTransactionProvider bulkCmdProvider;
+
+    private OpenflowPluginBulkGroupTransactionProvider groupCmdProvider;
+
+    public final static String NODE_ID = "foo:node:1";
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.opendaylight.controller.sal.binding.api.BindingAwareProvider#
+     * onSessionInitiated
+     * (org.opendaylight.controller.sal.binding.api.BindingAwareBroker
+     * .ProviderContext)
+     */
+    @Override
+    public void onSessionInitiated(ProviderContext session) {
+        DataBroker salService = session
+                .<DataBroker> getSALService(DataBroker.class);
+        OpenflowpluginTestActivator.provider.setDataService(salService);
+
+        NotificationProviderService salService1 = session
+                .<NotificationProviderService> getSALService(NotificationProviderService.class);
+
+        OpenflowpluginTestActivator.provider
+                .setNotificationService(salService1);
+        OpenflowpluginTestActivator.provider.start();
+        OpenflowpluginTestActivator.provider.register(session);
+
+        OpenflowpluginTestActivator.groupProvider.register(session);
+        OpenflowpluginTestActivator.meterProvider.register(session);
+        OpenflowpluginTestActivator.tableProvider.register(session);
+
+        this.cmdProvider.onSessionInitiated(session);
+        this.cmdGroupProvider.onSessionInitiated(session);
+        this.cmdMeterProvider.onSessionInitiated(session);
+        this.cmdTableProvider.onSessionInitiated(session);
+        this.cmdStatsProvider.onSessionInitiated(session);
+        this.cmdNodeConnectorNotification.onSessionInitiated(session);
+        this.cmdTopologyNotification.onSessionInitiated(session);
+        this.bulkCmdProvider.onSessionInitiated(session);
+        this.groupCmdProvider.onSessionInitiated(session);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.controller.sal.binding.api.AbstractBrokerAwareActivator
+     * #startImpl(org.osgi.framework.BundleContext)
+     */
+    public void startImpl(final BundleContext ctx) {
+        super.startImpl(ctx);
+
+        OpenflowpluginTestCommandProvider _openflowpluginTestCommandProvider = new OpenflowpluginTestCommandProvider(
+                ctx);
+        this.cmdProvider = _openflowpluginTestCommandProvider;
+        OpenflowpluginGroupTestCommandProvider _openflowpluginGroupTestCommandProvider = new OpenflowpluginGroupTestCommandProvider(
+                ctx);
+        this.cmdGroupProvider = _openflowpluginGroupTestCommandProvider;
+        OpenflowpluginMeterTestCommandProvider _openflowpluginMeterTestCommandProvider = new OpenflowpluginMeterTestCommandProvider(
+                ctx);
+        this.cmdMeterProvider = _openflowpluginMeterTestCommandProvider;
+        OpenflowpluginTableFeaturesTestCommandProvider _openflowpluginTableFeaturesTestCommandProvider = new OpenflowpluginTableFeaturesTestCommandProvider(
+                ctx);
+        this.cmdTableProvider = _openflowpluginTableFeaturesTestCommandProvider;
+        OpenflowpluginStatsTestCommandProvider _openflowpluginStatsTestCommandProvider = new OpenflowpluginStatsTestCommandProvider(
+                ctx);
+        this.cmdStatsProvider = _openflowpluginStatsTestCommandProvider;
+        OpenflowpluginTestNodeConnectorNotification _openflowpluginTestNodeConnectorNotification = new OpenflowpluginTestNodeConnectorNotification(
+                ctx);
+        this.cmdNodeConnectorNotification = _openflowpluginTestNodeConnectorNotification;
+        OpenflowpluginTestTopologyNotification _openflowpluginTestTopologyNotification = new OpenflowpluginTestTopologyNotification(
+                ctx);
+        this.cmdTopologyNotification = _openflowpluginTestTopologyNotification;
+        OpenflowPluginBulkTransactionProvider _openflowPluginBulkTransactionProvider = new OpenflowPluginBulkTransactionProvider(
+                ctx);
+        this.bulkCmdProvider = _openflowPluginBulkTransactionProvider;
+        OpenflowPluginBulkGroupTransactionProvider _openflowPluginBulkGroupTransactionProvider = new OpenflowPluginBulkGroupTransactionProvider(
+                ctx);
+        this.groupCmdProvider = _openflowPluginBulkGroupTransactionProvider;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.controller.sal.binding.api.AbstractBrokerAwareActivator
+     * #stopImpl(org.osgi.framework.BundleContext)
+     */
+    protected void stopImpl(final BundleContext context) {
+
+        try {
+            OpenflowpluginTestActivator.provider.close();
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+}
diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.xtend b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestActivator.xtend
deleted file mode 100644 (file)
index 1231cf1..0000000
+++ /dev/null
@@ -1,69 +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.openflowplugin.test
-
-import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService
-import org.opendaylight.controller.md.sal.binding.api.DataBroker
-import org.osgi.framework.BundleContext
-
-class OpenflowpluginTestActivator extends AbstractBindingAwareProvider {
-
-    static var OpenflowpluginTestServiceProvider provider = new OpenflowpluginTestServiceProvider();
-    static var OpenflowpluginGroupTestServiceProvider groupProvider = new OpenflowpluginGroupTestServiceProvider();
-    static var OpenflowpluginMeterTestServiceProvider meterProvider = new OpenflowpluginMeterTestServiceProvider();
-    static var OpenflowpluginTableFeaturesTestServiceProvider tableProvider = new OpenflowpluginTableFeaturesTestServiceProvider();
-    var OpenflowpluginTestCommandProvider cmdProvider;
-    var OpenflowpluginGroupTestCommandProvider cmdGroupProvider;
-    var OpenflowpluginMeterTestCommandProvider cmdMeterProvider;
-    var OpenflowpluginTableFeaturesTestCommandProvider cmdTableProvider;
-    var OpenflowpluginStatsTestCommandProvider cmdStatsProvider;
-    var OpenflowpluginTestNodeConnectorNotification cmdNodeConnectorNotification;
-    var OpenflowpluginTestTopologyNotification cmdTopologyNotification;
-    var OpenflowPluginBulkTransactionProvider bulkCmdProvider;
-    var OpenflowPluginBulkGroupTransactionProvider groupCmdProvider;
-    public static final String NODE_ID =  "foo:node:1";
-
-    override onSessionInitiated(ProviderContext session) {
-        provider.dataService = session.getSALService(DataBroker)
-        provider.notificationService = session.getSALService(NotificationProviderService)
-        provider.start();
-        provider.register(session);
-        groupProvider.register(session);
-        meterProvider.register(session);
-        tableProvider.register(session);
-        cmdProvider.onSessionInitiated(session);
-        cmdGroupProvider.onSessionInitiated(session);
-        cmdMeterProvider.onSessionInitiated(session);
-        cmdTableProvider.onSessionInitiated(session);
-        cmdStatsProvider.onSessionInitiated(session);      
-        cmdNodeConnectorNotification.onSessionInitiated(session);
-        cmdTopologyNotification.onSessionInitiated(session);
-        bulkCmdProvider.onSessionInitiated(session);
-        groupCmdProvider.onSessionInitiated(session);
-    }
-    
-    override startImpl(BundleContext ctx) {
-        super.startImpl(ctx);
-        cmdProvider = new OpenflowpluginTestCommandProvider(ctx);
-        cmdGroupProvider = new OpenflowpluginGroupTestCommandProvider(ctx);
-        cmdMeterProvider = new OpenflowpluginMeterTestCommandProvider(ctx);
-        cmdTableProvider = new OpenflowpluginTableFeaturesTestCommandProvider(ctx);
-        cmdStatsProvider = new OpenflowpluginStatsTestCommandProvider(ctx);
-        cmdNodeConnectorNotification = new OpenflowpluginTestNodeConnectorNotification(ctx);
-       cmdTopologyNotification = new OpenflowpluginTestTopologyNotification(ctx);
-       bulkCmdProvider = new OpenflowPluginBulkTransactionProvider(ctx);
-       groupCmdProvider = new OpenflowPluginBulkGroupTransactionProvider(ctx);
-    }
-
-    override protected stopImpl(BundleContext context) {
-        provider.close();
-    }
-
-}
diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.java b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.java
new file mode 100644 (file)
index 0000000..0901b0a
--- /dev/null
@@ -0,0 +1,202 @@
+/**
+ * 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.openflowplugin.test;
+
+import java.util.concurrent.Future;
+
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext;
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration;
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowOutput;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration;
+import org.opendaylight.yangtools.concepts.CompositeObjectRegistration.CompositeObjectRegistrationBuilder;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.opendaylight.yangtools.yang.binding.InstanceIdentifier.InstanceIdentifierBuilder;
+import org.opendaylight.yangtools.yang.common.RpcResult;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OpenflowpluginTestServiceProvider implements AutoCloseable,
+        SalFlowService {
+
+    private final static Logger LOG = LoggerFactory
+            .getLogger(OpenflowpluginTestServiceProvider.class);
+
+    private DataBroker dataService;
+    private RoutedRpcRegistration<SalFlowService> flowRegistration;
+    private NotificationProviderService notificationProviderService;
+
+    /**
+     * get data service
+     * 
+     * @return {@link #dataService}
+     */
+    public DataBroker getDataService() {
+        return dataService;
+    }
+
+    /**
+     * set {@link #dataService}
+     * 
+     * @param dataService
+     */
+    public void setDataService(final DataBroker dataService) {
+        this.dataService = dataService;
+    }
+
+    /**
+     * get flow registration
+     * 
+     * @return {@link #flowRegistration}
+     */
+    public RoutedRpcRegistration<SalFlowService> getFlowRegistration() {
+        return flowRegistration;
+    }
+
+    /**
+     * set {@link #flowRegistration}
+     * 
+     * @param flowRegistration
+     */
+    public void setFlowRegistration(
+            final RoutedRpcRegistration<SalFlowService> flowRegistration) {
+        this.flowRegistration = flowRegistration;
+    }
+
+    /**
+     * get notification service
+     * 
+     * @return {@link #notificationProviderService}
+     */
+    public NotificationProviderService getNotificationService() {
+        return notificationProviderService;
+    }
+
+    /**
+     * set {@link #notificationProviderService}
+     * 
+     * @param notificationProviderService
+     */
+    public void setNotificationService(
+            final NotificationProviderService notificationProviderService) {
+        this.notificationProviderService = notificationProviderService;
+    }
+
+    public void start() {
+        OpenflowpluginTestServiceProvider.LOG
+                .info("SalFlowServiceProvider Started.");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see java.lang.AutoCloseable#close()
+     */
+    @Override
+    public void close() throws Exception {
+        OpenflowpluginTestServiceProvider.LOG
+                .info("SalFlowServiceProvide stopped.");
+        flowRegistration.close();
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.
+     * SalFlowService
+     * #addFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.
+     * service.rev130819.AddFlowInput)
+     */
+    @Override
+    public Future<RpcResult<AddFlowOutput>> addFlow(AddFlowInput input) {
+        String plus = ("addFlow - " + input);
+        OpenflowpluginTestServiceProvider.LOG.info(plus);
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.
+     * SalFlowService
+     * #removeFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow
+     * .service.rev130819.RemoveFlowInput)
+     */
+    @Override
+    public Future<RpcResult<RemoveFlowOutput>> removeFlow(RemoveFlowInput input) {
+        String plus = ("removeFlow - " + input);
+        OpenflowpluginTestServiceProvider.LOG.info(plus);
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.
+     * SalFlowService
+     * #updateFlow(org.opendaylight.yang.gen.v1.urn.opendaylight.flow
+     * .service.rev130819.UpdateFlowInput)
+     */
+    @Override
+    public Future<RpcResult<UpdateFlowOutput>> updateFlow(UpdateFlowInput input) {
+        String plus = ("updateFlow - " + input);
+        OpenflowpluginTestServiceProvider.LOG.info(plus);
+        return null;
+    }
+
+    /**
+     * @param ctx
+     * @return {@link CompositeObjectRegistrationBuilder #toInstance()}
+     */
+    public CompositeObjectRegistration<OpenflowpluginTestServiceProvider> register(
+            final ProviderContext ctx) {
+        CompositeObjectRegistrationBuilder<OpenflowpluginTestServiceProvider> builder = CompositeObjectRegistration
+                .<OpenflowpluginTestServiceProvider> builderFor(this);
+
+        RoutedRpcRegistration<SalFlowService> addRoutedRpcImplementation = ctx
+                .<SalFlowService> addRoutedRpcImplementation(
+                        SalFlowService.class, this);
+
+        setFlowRegistration(addRoutedRpcImplementation);
+
+        InstanceIdentifierBuilder<Nodes> builderII = InstanceIdentifier
+                .<Nodes> builder(Nodes.class);
+
+        NodeId nodeId = new NodeId(OpenflowpluginTestActivator.NODE_ID);
+        NodeKey nodeKey = new NodeKey(nodeId);
+
+        InstanceIdentifierBuilder<Node> nodeIdentifier = builderII
+                .<Node, NodeKey> child(Node.class, nodeKey);
+
+        InstanceIdentifier<Node> instance = nodeIdentifier.build();
+
+        flowRegistration.registerPath(NodeContext.class, instance);
+
+        RoutedRpcRegistration<SalFlowService> flowRegistration2 = getFlowRegistration();
+
+        builder.add(flowRegistration2);
+
+        return builder.build();
+    }
+}
diff --git a/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.xtend b/test-provider/src/main/java/org/opendaylight/openflowplugin/test/OpenflowpluginTestServiceProvider.xtend
deleted file mode 100644 (file)
index 538f633..0000000
+++ /dev/null
@@ -1,84 +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.openflowplugin.test
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.RoutedRpcRegistration
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService
-import org.opendaylight.controller.md.sal.binding.api.DataBroker
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.AddFlowInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.RemoveFlowInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService
-import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.UpdateFlowInput
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeContext
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.Nodes
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node
-import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
-import org.opendaylight.yangtools.concepts.CompositeObjectRegistration
-import org.opendaylight.yangtools.yang.binding.InstanceIdentifier
-import org.slf4j.LoggerFactory
-
-class OpenflowpluginTestServiceProvider implements AutoCloseable, SalFlowService {
-
-
-    static val LOG = LoggerFactory.getLogger(OpenflowpluginTestServiceProvider);
-
-    @Property
-    DataBroker dataService;
-    
-    @Property
-    RoutedRpcRegistration<SalFlowService> flowRegistration;
-        
-
-    @Property
-    NotificationProviderService notificationService;
-
-
-    def void start() {
-        LOG.info("SalFlowServiceProvider Started.");
-        
-    }
-
-    override close() {
-       LOG.info("SalFlowServiceProvide stopped.");
-        flowRegistration.close;
-    }
-    
-    override addFlow(AddFlowInput input) {
-        LOG.info("addFlow - " + input);
-        return null;
-        
-    }
-    
-    override removeFlow(RemoveFlowInput input) {
-        LOG.info("removeFlow - " + input);
-        return null;
-    }
-    
-    override updateFlow(UpdateFlowInput input) {
-        LOG.info("updateFlow - " + input);
-        return null;
-    }
-    
-    
-    def CompositeObjectRegistration<OpenflowpluginTestServiceProvider> register(ProviderContext ctx) {
-        val builder = CompositeObjectRegistration
-                .<OpenflowpluginTestServiceProvider> builderFor(this);
-
-        flowRegistration = ctx.addRoutedRpcImplementation(SalFlowService, this);
-        val nodeIndentifier = InstanceIdentifier.builder(Nodes).child(Node, new NodeKey(new NodeId(OpenflowpluginTestActivator.NODE_ID)));
-        flowRegistration.registerPath(NodeContext, nodeIndentifier.toInstance());
-        builder.add(flowRegistration);
-
-        return builder.toInstance();
-    }
-    
-}
-
-