OPNFLWPLUG-1032: Neon-MRI: Bump odlparent, yangtools, mdsal
[openflowplugin.git] / test-provider / src / main / java / org / opendaylight / openflowplugin / test / OpenflowpluginMeterTestServiceProvider.java
index b4b5438efaf206b7916c92120961529c66557597..cf89034d30740db2672a4c09b97fa671d96a7c07 100644 (file)
@@ -8,11 +8,11 @@
 
 package org.opendaylight.openflowplugin.test;
 
-import java.util.concurrent.Future;
+import com.google.common.util.concurrent.ListenableFuture;
 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.controller.sal.binding.api.RpcProviderRegistry;
 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;
@@ -42,7 +42,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
     private NotificationProviderService notificationService;
 
     /**
-     * get data service
+     * Gets the data service.
      *
      * @return {@link #dataService}
      */
@@ -51,16 +51,14 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * set {@link #dataService}
-     *
-     * @param dataService
+     * Sets the {@link #dataService}.
      */
     public void setDataService(final DataBroker dataService) {
         this.dataService = dataService;
     }
 
     /**
-     * get meter registration
+     * Gets the meter registration.
      *
      * @return {@link #meterRegistration}
      */
@@ -69,9 +67,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * set {@link #meterRegistration}
-     *
-     * @param meterRegistration
+     * Sets the {@link #meterRegistration}.
      */
     public void setMeterRegistration(
             final RoutedRpcRegistration<SalMeterService> meterRegistration) {
@@ -79,7 +75,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * get notification service
+     * Gets the notification service.
      *
      * @return {@link #notificationService}
      */
@@ -88,9 +84,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
     }
 
     /**
-     * set {@link #notificationService}
-     *
-     * @param notificationService
+     * Sets the {@link #notificationService}.
      */
     public void setNotificationService(
             final NotificationProviderService notificationService) {
@@ -107,6 +101,7 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
      *
      * @see java.lang.AutoCloseable#close()
      */
+    @Override
     public void close() {
         OpenflowpluginMeterTestServiceProvider.LOG
                 .info("SalMeterServiceProvide stopped.");
@@ -122,9 +117,9 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
      * #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);
+    @Override
+    public ListenableFuture<RpcResult<AddMeterOutput>> addMeter(final AddMeterInput input) {
+        OpenflowpluginMeterTestServiceProvider.LOG.info("addMeter - {}", input);
         return null;
     }
 
@@ -137,10 +132,10 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
      * #removeMeter(org.opendaylight.yang.gen.v1.urn.opendaylight
      * .meter.service.rev130918.RemoveMeterInput)
      */
-    public Future<RpcResult<RemoveMeterOutput>> removeMeter(
+    @Override
+    public ListenableFuture<RpcResult<RemoveMeterOutput>> removeMeter(
             final RemoveMeterInput input) {
-        String plus = ("removeMeter - " + input);
-        OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
+        OpenflowpluginMeterTestServiceProvider.LOG.info("removeMeter - {}", input);
         return null;
     }
 
@@ -153,34 +148,29 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
      * #updateMeter(org.opendaylight.yang.gen.v1.urn.opendaylight
      * .meter.service.rev130918.UpdateMeterInput)
      */
-    public Future<RpcResult<UpdateMeterOutput>> updateMeter(
+    @Override
+    public ListenableFuture<RpcResult<UpdateMeterOutput>> updateMeter(
             final UpdateMeterInput input) {
-        String plus = ("updateMeter - " + input);
-        OpenflowpluginMeterTestServiceProvider.LOG.info(plus);
+        OpenflowpluginMeterTestServiceProvider.LOG.info("updateMeter - {}", input);
         return null;
     }
 
-    /**
-     * @param ctx
-     * @return {@link ObjectRegistration}
-     */
     public ObjectRegistration<OpenflowpluginMeterTestServiceProvider> register(
-            final ProviderContext ctx) {
+            final RpcProviderRegistry rpcRegistry) {
 
-        RoutedRpcRegistration<SalMeterService> addRoutedRpcImplementation = ctx
-                .<SalMeterService> addRoutedRpcImplementation(
+        RoutedRpcRegistration<SalMeterService> addRoutedRpcImplementation = rpcRegistry.addRoutedRpcImplementation(
                         SalMeterService.class, this);
 
         setMeterRegistration(addRoutedRpcImplementation);
 
         InstanceIdentifierBuilder<Nodes> builder1 = InstanceIdentifier
-                .<Nodes> builder(Nodes.class);
+                .<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);
+                .<Node, NodeKey>child(Node.class, nodeKey);
 
         InstanceIdentifier<Node> instance = nodeIndentifier.build();
 
@@ -197,5 +187,4 @@ public class OpenflowpluginMeterTestServiceProvider implements AutoCloseable,
             }
         };
     }
-
 }