Bulk-add copyright headers to java files
[controller.git] / opendaylight / protocol_plugins / stub / src / main / java / org / opendaylight / controller / protocol_plugins / stub / internal / ReadService.java
index 27ba897fdfc57b44e0d2d4c2ae391ffeae9364c3..0ff60835c8b70d98357c7fa734c237bfef967780 100644 (file)
@@ -1,16 +1,17 @@
+/*
+ * Copyright (c) 2014 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.controller.protocol_plugins.stub.internal;
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
-import java.util.Dictionary;
 import java.util.List;
 
-import org.apache.felix.dm.Component;
-//import org.opendaylight.controller.protocol_plugin_stubs.IPluginReadServiceFilter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
 import org.opendaylight.controller.sal.action.Action;
 import org.opendaylight.controller.sal.action.Controller;
 import org.opendaylight.controller.sal.action.Drop;
@@ -45,10 +46,12 @@ import org.opendaylight.controller.sal.reader.IPluginInReadService;
 import org.opendaylight.controller.sal.reader.NodeConnectorStatistics;
 import org.opendaylight.controller.sal.reader.NodeDescription;
 import org.opendaylight.controller.sal.reader.NodeTableStatistics;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 /**
  * Stub Implementation for IPluginInReadService used by SAL
- * 
- * 
+ *
+ *
  */
 public class ReadService implements IPluginInReadService {
     private static final Logger logger = LoggerFactory
@@ -57,7 +60,7 @@ public class ReadService implements IPluginInReadService {
     /**
      * Function called by the dependency manager when all the required
      * dependencies are satisfied
-     * 
+     *
      */
     void init() {
     }
@@ -66,7 +69,7 @@ public class ReadService implements IPluginInReadService {
      * Function called by the dependency manager when at least one dependency
      * become unsatisfied or when the component is shutting down because for
      * example bundle is being stopped.
-     * 
+     *
      */
     void destroy() {
     }
@@ -74,7 +77,7 @@ public class ReadService implements IPluginInReadService {
     /**
      * Function called by dependency manager after "init ()" is called and after
      * the services provided by the class are registered in the service registry
-     * 
+     *
      */
     void start() {
     }
@@ -83,7 +86,7 @@ public class ReadService implements IPluginInReadService {
      * Function called by the dependency manager before the services exported by
      * the component are unregistered, this will be followed by a "destroy ()"
      * calls
-     * 
+     *
      */
     void stop() {
     }
@@ -104,7 +107,7 @@ public class ReadService implements IPluginInReadService {
 
         ArrayList<FlowOnNode> list = new ArrayList<FlowOnNode>();
         ArrayList<Action> actionList = new ArrayList<Action>();
-        actionList.add(new Drop());
+        actionList.add(new Drop()); //IT assumes this is first element
         actionList.add(new Loopback());
         actionList.add(new Flood());
         actionList.add(new FloodAll());
@@ -139,6 +142,7 @@ public class ReadService implements IPluginInReadService {
         actionList.add(new SetTpSrc(4201));
         actionList.add(new SetTpDst(8080));
 
+        short priority = 3500; //IT assumes this value
         for (Action a : actionList) {
             Flow flow = new Flow();
             Match match = new Match();
@@ -152,7 +156,7 @@ public class ReadService implements IPluginInReadService {
             List<Action> actions = new ArrayList<Action>();
             actions.add(a);
             flow.setActions(actions);
-            flow.setPriority((short) 3500);
+            flow.setPriority(priority++);
             flow.setIdleTimeout((short) 1000);
             flow.setHardTimeout((short) 2000);
             flow.setId(12345);