code cleanup 94/19694/2
authorMartin Bobak <mbobak@cisco.com>
Wed, 6 May 2015 10:24:53 +0000 (12:24 +0200)
committerMartin Bobak <mbobak@cisco.com>
Wed, 6 May 2015 12:55:18 +0000 (14:55 +0200)
- removed unused imports and commented lines

Change-Id: I4b47b032536a45bf93289e6f7a008dc43dd2027f
Signed-off-by: Martin Bobak <mbobak@cisco.com>
16 files changed:
drop-test-karaf/src/main/java/org/opendaylight/openflowplugin/droptestkaraf/DropTestProviderImpl.java
drop-test-karaf/src/main/java/org/opendaylight/yang/gen/v1/urn/opendaylight/params/xml/ns/yang/config/openflow/test/droptest/rev150327/DropTestProviderModule.java
drop-test-karaf/src/main/resources/initial/69-drop-test.xml
drop-test-karaf/src/main/yang/drop-test.yang
drop-test/src/main/java/org/opendaylight/openflowplugin/droptest/DropTestActivator.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/OpenFlowPluginProvider.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/DeviceContext.java
openflowplugin-api/src/main/java/org/opendaylight/openflowplugin/api/openflow/device/DeviceManager.java
openflowplugin-controller-config/src/main/resources/initial/42-openflowplugin-new.xml
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceContextImpl.java
openflowplugin-impl/src/main/java/org/opendaylight/openflowplugin/impl/device/DeviceManagerImpl.java
openflowplugin-impl/src/main/yang/openflow-plugin-impl.yang
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestCommiter.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestDsProvider.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcProvider.java
test-common/src/main/java/org/opendaylight/openflowplugin/testcommon/DropTestRpcSender.java

index fd15c14d795cda18f7839923f7e4c3ef7672dca0..86701e8cfb50557a0d0318e33f520e7e596f18ce 100644 (file)
@@ -11,7 +11,6 @@ package org.opendaylight.openflowplugin.droptestkaraf;
 import com.google.common.base.Preconditions;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
 import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
index 62bfbcc19570528cdcf50ee03c4d00071d00e84f..8571428d6f081544db72a768edc2286c93f8a3df 100644 (file)
@@ -2,7 +2,6 @@ package org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.openflowplugin.droptestkaraf.DropTestProviderImpl;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
 import org.slf4j.Logger;
@@ -10,6 +9,7 @@ import org.slf4j.LoggerFactory;
 
 public class DropTestProviderModule extends org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.config.openflow.test.droptest.rev150327.AbstractDropTestProviderModule {
     private static final Logger LOG = LoggerFactory.getLogger(DropTestProviderModule.class);
+
     public DropTestProviderModule(org.opendaylight.controller.config.api.ModuleIdentifier identifier, org.opendaylight.controller.config.api.DependencyResolver dependencyResolver) {
         super(identifier, dependencyResolver);
     }
index 5ee576358106c03ef8f9f5e9bd04ef72026924ed..00a3cd6b8d3c69a6e36e46c73f1b048071db594c 100644 (file)
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-service</type>
                         <name>binding-notification-adapter</name>
                     </notification-adapter>
-                    <!--notification-service>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
-                        <name>binding-notification-broker</name>
-                    </notification-service-->
                 </module>
             </modules>
         </data>
index 7572210178b80603d3eb723023510ee4c737b5d2..512a37dda118450ac5239c99ebaf4af82a480014 100644 (file)
@@ -49,16 +49,6 @@ module drop-test-provider {
                     }
                 }
             }
-            /*
-            container notification-service {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity md-sal-binding:binding-notification-service;
-                    }
-                }
-            }
-            */
         }
     }
 }
index 3c8f06d75f04adf5f5ddd79329f05c3098954bc4..046be93bd3a4ebac679a5453d7a823f2ad53984e 100644 (file)
@@ -11,7 +11,6 @@ import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 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.openflowplugin.outputtest.OutputTestCommandProvider;
 import org.opendaylight.openflowplugin.testcommon.DropTestDsProvider;
 import org.opendaylight.openflowplugin.testcommon.DropTestRpcProvider;
index 6e97fcc274a1e1fd53e086513c3f287b1e9ce28d..83852de9dabad5c4bf8c138db11c6a27dad89ddc 100644 (file)
@@ -13,7 +13,6 @@ import org.opendaylight.controller.md.sal.binding.api.BindingService;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry;
 import org.opendaylight.openflowjava.protocol.spi.connection.SwitchConnectionProvider;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.openflowplugin.api.types.rev150327.OfpRole;
@@ -38,6 +37,7 @@ public interface OpenFlowPluginProvider extends AutoCloseable, BindingService {
     void setRpcProviderRegistry(RpcProviderRegistry rpcProviderRegistry);
 
     void setNotificationProviderService(NotificationService notificationProviderService);
+
     void setNotificationPublishService(NotificationPublishService notificationPublishService);
 
     /**
index 2d9b377bd2ceed728ac10ee51224a99493b201ab..84a78324ea93300e8c9578018a6e503628d9dac3 100644 (file)
@@ -14,7 +14,6 @@ import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.md.sal.binding.api.ReadTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.openflowplugin.api.openflow.OpenFlowPluginTimer;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceContextClosedHandler;
@@ -199,7 +198,7 @@ public interface DeviceContext extends AutoCloseable,
      */
     void setNotificationService(NotificationService notificationService);
 
-    void setNotificationPublishService(NotificationPublishService  notificationPublishService);
+    void setNotificationPublishService(NotificationPublishService notificationPublishService);
 
     MessageSpy getMessageSpy();
 
index 0283bcef393b9331060d07dce192ed85a69a2839..3407c26c9b914d1e0a506fa116fdec6911b5961a 100644 (file)
@@ -10,8 +10,6 @@ package org.opendaylight.openflowplugin.api.openflow.device;
 
 import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceConnectedHandler;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceContextClosedHandler;
 import org.opendaylight.openflowplugin.api.openflow.device.handlers.DeviceInitializationPhaseHandler;
@@ -22,7 +20,6 @@ import org.opendaylight.openflowplugin.api.openflow.translator.TranslatorLibrari
  * This interface is responsible for instantiating DeviceContext and
  * registering transaction chain for each DeviceContext. Each device
  * has its own device context managed by this manager.
- * <p>
  * Created by Martin Bobak &lt;mbobak@cisco.com&gt; on 25.2.2015.
  */
 public interface DeviceManager extends DeviceConnectedHandler,
@@ -32,15 +29,17 @@ public interface DeviceManager extends DeviceConnectedHandler,
 
     /**
      * Sets notification receiving service
+     *
      * @param notificationService
      */
     void setNotificationService(NotificationService notificationService);
 
     /**
      * Sets notification publish service
+     *
      * @param notificationPublishService
      */
-    void setNotificationPublishService(NotificationPublishService  notificationPublishService);
+    void setNotificationPublishService(NotificationPublishService notificationPublishService);
 
 }
 
index fa825b6f4d23ec896bc2e7477ba617d56b82c84a..4e44ba4cff626054d280697284583df1b7bca521 100644 (file)
@@ -74,10 +74,6 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-rpc-registry</type>
                         <name>binding-rpc-broker</name>
                     </rpc-registry>
-                    <!--notification-service>
-                        <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding">binding:binding-notification-service</type>
-                        <name>binding-notification-broker</name>
-                    </notification-service-->
                     <notification-adapter>
                         <type xmlns:binding="urn:opendaylight:params:xml:ns:yang:controller:md:sal:binding:impl">binding:binding-new-notification-service</type>
                         <name>binding-notification-adapter</name>
index b7e8d6477a881a2290c3e675c2ef505f8f67d3c4..fe21ede0792013ee5b725cdab8b150244d18509a 100644 (file)
@@ -245,7 +245,7 @@ public class DeviceContextImpl implements DeviceContext {
                 //TODO : this is the point, where we can discover that add flow operation failed and where we should
                 //TODO : remove this flow from deviceFlowRegistry
                 final Error error = (Error) ofHeader;
-                final String message = "Operation on device failed with xid "+ofHeader.getXid()+".";
+                final String message = "Operation on device failed with xid " + ofHeader.getXid() + ".";
                 rpcResult = RpcResultBuilder
                         .<OfHeader>failed()
                         .withError(RpcError.ErrorType.APPLICATION, message, new DeviceDataException(message, error))
@@ -364,7 +364,7 @@ public class DeviceContextImpl implements DeviceContext {
         final TranslatorKey translatorKey = new TranslatorKey(packetInMessage.getVersion(), PacketIn.class.getName());
         final MessageTranslator<PacketInMessage, PacketReceived> messageTranslator = translatorLibrary.lookupTranslator(translatorKey);
         final PacketReceived packetReceived = messageTranslator.translate(packetInMessage, this, null);
-        if (!notificationPublishService.offerNotification(packetReceived)){
+        if (!notificationPublishService.offerNotification(packetReceived)) {
             LOG.debug("Notification offer refused by notification service.");
         }
 
index e88f13788f63ea089a76e7d70cbf4bc1a55f4359..36769ce0c207ef0f07fe009b8eaca623c310e9bb 100644 (file)
@@ -30,7 +30,6 @@ import org.opendaylight.controller.md.sal.binding.api.NotificationPublishService
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.openflowplugin.api.OFConstants;
 import org.opendaylight.openflowplugin.api.openflow.connection.ConnectionContext;
 import org.opendaylight.openflowplugin.api.openflow.device.DeviceContext;
@@ -437,7 +436,7 @@ public class DeviceManagerImpl implements DeviceManager, AutoCloseable {
     }
 
     @Override
-    public void setNotificationPublishService (final NotificationPublishService notificationService) {
+    public void setNotificationPublishService(final NotificationPublishService notificationService) {
         this.notificationPublishService = notificationService;
     }
 
index fe2c97c06ac5a132aee931132c08067a682aa233..1d7e0fd1ccdb4387929c240407b201013b8af7a5 100644 (file)
@@ -63,16 +63,6 @@ module openflow-plugin-provider-impl {
                     }
                 }
             }
-            /*
-            container notification-service {
-                uses config:service-ref {
-                    refine type {
-                        mandatory true;
-                        config:required-identity md-sal-binding:binding-notification-service;
-                    }
-                }
-            }
-            */
             list openflow-switch-connection-provider {
                 uses config:service-ref {
                     refine type {
index 4aa347be4b4ed5458a52b78e022b9899795e918c..3a150721508fea59089673ba3cf78413171daf7e 100644 (file)
@@ -102,7 +102,7 @@ public class DropTestCommiter extends AbstractDropTest {
         final FlowBuilder fb = BUILDER.get();
         fb.setMatch(match);
         fb.setInstructions(instructions);
-        fb.setId(new FlowId(String.valueOf(fb.hashCode()) +"."+ ID_COUNTER.getAndIncrement()));
+        fb.setId(new FlowId(String.valueOf(fb.hashCode()) + "." + ID_COUNTER.getAndIncrement()));
 
         // Construct the flow instance id
         final InstanceIdentifier<Flow> flowInstanceId =
@@ -110,11 +110,11 @@ public class DropTestCommiter extends AbstractDropTest {
                 InstanceIdentifier.builder(Nodes.class)
                         // A particular node identified by nodeKey
                         .child(Node.class, node)
-                        // That is flow capable, only FlowCapableNodes have tables
+                                // That is flow capable, only FlowCapableNodes have tables
                         .augmentation(FlowCapableNode.class)
-                        // In the table identified by TableKey
+                                // In the table identified by TableKey
                         .child(Table.class, new TableKey((short) 0))
-                        // A flow identified by flowKey
+                                // A flow identified by flowKey
                         .child(Flow.class, new FlowKey(fb.getId()))
                         .build();
 
index 14e05d8bfdc140b61a4284dfbb546cf7d68446bf..ad74e8b7944f7806b7c3d4e0bca757e9c6b2eac6 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.openflowplugin.testcommon;
 
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index edf66e246e03516fcf70ef343f83f2a683792e42..24b04b55df4ffade695880a9833d5e524271ac58 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.openflowplugin.testcommon;
 
 import org.opendaylight.controller.md.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.service.rev130819.SalFlowService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
index a81cb20262ddfcceaa425af269e2fb29f87dc602..83b7b1161574a18c6dccce3c7c4197d50c30b190 100644 (file)
@@ -24,7 +24,6 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.N
 import org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey;
 import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
-import org.opendaylight.yangtools.yang.binding.NotificationListener;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -95,13 +94,12 @@ public class DropTestRpcSender extends AbstractDropTest {
         // Finally build our flow
         fb.setMatch(match);
         fb.setInstructions(instructions);
-        //fb.setId(new FlowId(Long.toString(fb.hashCode)));
 
         // Construct the flow instance id
         final InstanceIdentifier<Node> flowInstanceId = InstanceIdentifier
                 // File under nodes
                 .builder(Nodes.class)
-                // A particular node identified by nodeKey
+                        // A particular node identified by nodeKey
                 .child(Node.class, node).build();
         fb.setNode(new NodeRef(flowInstanceId));