Merge "Fixed YANG union type resolving in yang model parser."
authorGiovanni Meo <gmeo@cisco.com>
Thu, 4 Apr 2013 08:02:28 +0000 (08:02 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 4 Apr 2013 08:02:28 +0000 (08:02 +0000)
43 files changed:
opendaylight/northbound/flowprogrammer/enunciate.xml
opendaylight/northbound/flowprogrammer/pom.xml
opendaylight/northbound/hosttracker/enunciate.xml
opendaylight/northbound/hosttracker/pom.xml
opendaylight/northbound/staticrouting/enunciate.xml
opendaylight/northbound/staticrouting/pom.xml
opendaylight/northbound/statistics/enunciate.xml
opendaylight/northbound/statistics/pom.xml
opendaylight/northbound/subnets/enunciate.xml
opendaylight/northbound/subnets/pom.xml
opendaylight/northbound/switchmanager/enunciate.xml
opendaylight/northbound/switchmanager/pom.xml
opendaylight/northbound/topology/enunciate.xml
opendaylight/northbound/topology/pom.xml
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DataPacketMuxDemux.java
opendaylight/routing/dijkstra_implementation/src/main/java/org/opendaylight/controller/routing/dijkstra_implementation/internal/DijkstraImplementation.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ComponentActivatorAbstractBase.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/GlobalConstants.java
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/DataPacketService.java
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/FlowProgrammerService.java
opendaylight/sal/implementation/src/main/java/org/opendaylight/controller/sal/implementation/internal/ReadService.java
opendaylight/sal/yang-prototype/sal/pom.xml
opendaylight/sal/yang-prototype/sal/sal-binding-broker-impl/pom.xml
opendaylight/sal/yang-prototype/sal/sal-binding-broker-impl/src/main/java/org/opendaylight/controller/sal/binding/impl/BrokerUtils.java [deleted file]
opendaylight/sal/yang-prototype/sal/sal-binding-broker-impl/src/main/java/org/opendaylight/controller/sal/binding/impl/NotificationModule.java
opendaylight/sal/yang-prototype/sal/sal-broker-impl/pom.xml
opendaylight/sal/yang-prototype/sal/sal-broker-impl/src/main/java/org/opendaylight/controller/sal/core/impl/BrokerImpl.java
opendaylight/sal/yang-prototype/sal/sal-broker-impl/src/main/java/org/opendaylight/controller/sal/core/impl/Utils.java [deleted file]
opendaylight/sal/yang-prototype/sal/sal-broker-impl/src/main/java/org/opendaylight/controller/sal/core/impl/notify/NotificationModule.java
opendaylight/web/devices/pom.xml
opendaylight/web/devices/src/main/resources/WEB-INF/spring/servlet/security.xml
opendaylight/web/devices/src/main/resources/js/page.js
opendaylight/web/flows/pom.xml
opendaylight/web/flows/src/main/resources/WEB-INF/spring/servlet/security.xml
opendaylight/web/flows/src/main/resources/js/page.js
opendaylight/web/root/src/main/resources/WEB-INF/spring/servlet/security.xml
opendaylight/web/root/src/main/resources/js/one-topology.js
opendaylight/web/root/src/main/resources/js/one.js
opendaylight/web/topology/pom.xml
opendaylight/web/topology/src/main/resources/WEB-INF/spring/servlet/security.xml
opendaylight/web/troubleshoot/pom.xml
opendaylight/web/troubleshoot/src/main/resources/WEB-INF/spring/servlet/security.xml
opendaylight/web/troubleshoot/src/main/resources/js/page.js

index 7bff1021b3905ce3170bb4f89ca01f84c3e6a89d..a49d9f8265f4b0a9da8b24387a4a9d58337997f9 100644 (file)
@@ -3,7 +3,7 @@
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
   
   <services>
-    <rest defaultRestSubcontext="/one/nb/v2/flow"/>
+    <rest defaultRestSubcontext="/controller/nb/v2/flow"/>
   </services>
 
   <modules>
index 14a77ae53daa8f375711072bc72baa44a62bdeba..c0f03edf5c11a1685b207ca874da5ad3e9b56ce7 100644 (file)
@@ -58,7 +58,7 @@
             </Import-Package>
             <Export-Package>
             </Export-Package>
-            <Web-ContextPath>/one/nb/v2/flow</Web-ContextPath>
+            <Web-ContextPath>/controller/nb/v2/flow</Web-ContextPath>
           </instructions>
         </configuration>
       </plugin>
index 43a01e5a33cbfcf64fbf1518037137ab7fae2bb8..8f0d7e6ab8f9b5a865d4d0b5eabbc2e6c3220ae8 100644 (file)
@@ -3,7 +3,7 @@
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
   
   <services>
-    <rest defaultRestSubcontext="/one/nb/v2/host"/>
+    <rest defaultRestSubcontext="/controller/nb/v2/host"/>
   </services>
 
   <modules>
index 297f699efb30f08a62913a39cec58d2311710669..4cb9919b9c771a60d81418898f7f2b53c29b81a8 100644 (file)
@@ -59,7 +59,7 @@
               org.slf4j,
               !org.codehaus.enunciate.jaxrs
             </Import-Package>
-            <Web-ContextPath>/one/nb/v2/host</Web-ContextPath>
+            <Web-ContextPath>/controller/nb/v2/host</Web-ContextPath>
           </instructions>
         </configuration>
       </plugin>
index b79b3e8c96c04123ec10beeb3909cbbf55ac54ed..4d6bed028a0fc3d30ff0ab932c9552af4409f902 100644 (file)
@@ -3,7 +3,7 @@
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
   
   <services>
-    <rest defaultRestSubcontext="/one/nb/v2/staticroute"/>
+    <rest defaultRestSubcontext="/controller/nb/v2/staticroute"/>
   </services>
 
   <modules>
index 7382d9d9869577b74c40c425c38d26c30b3fa7d4..c35c5e622089c71bba297d9fa0142806e843b93c 100644 (file)
@@ -60,7 +60,7 @@
             </Import-Package>
             <Export-Package>
             </Export-Package>
-            <Web-ContextPath>/one/nb/v2/staticroute</Web-ContextPath>
+            <Web-ContextPath>/controller/nb/v2/staticroute</Web-ContextPath>
           </instructions>
         </configuration>
       </plugin>
index 422ebda816481e0439878311703ee2300f45c8ac..3f2759dceaa37641f4fac291417bb58949c5e787 100644 (file)
@@ -3,7 +3,7 @@
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
   
   <services>
-    <rest defaultRestSubcontext="/one/nb/v2/statistics"/>
+    <rest defaultRestSubcontext="/controller/nb/v2/statistics"/>
   </services>
 
   <modules>
index a40c201379fb2f464a319ae91c2de571a02d4c51..b3fe26f6a06ea884af140754561ea5c6c9d782c9 100644 (file)
@@ -68,7 +68,7 @@
             </Import-Package>
             <Export-Package>
             </Export-Package>
-            <Web-ContextPath>/one/nb/v2/statistics</Web-ContextPath>
+            <Web-ContextPath>/controller/nb/v2/statistics</Web-ContextPath>
           </instructions>
         </configuration>
       </plugin>
index 275e4d0a32883e4acd83ded755c3d891eba9f559..5ff13ffe805381e9abc83a08a71e67ae0eaaf6c5 100644 (file)
@@ -3,7 +3,7 @@
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
 
   <services>
-    <rest defaultRestSubcontext="/one/nb/v2/subnet"/>
+    <rest defaultRestSubcontext="/controller/nb/v2/subnet"/>
   </services>
 
   <modules>
index 9efdabe16135882223b9334fac4e9a0f3ab00a25..aa18909f48af4a7681977d0e8cb09cc061fb932b 100644 (file)
@@ -74,7 +74,7 @@
             </Import-Package>
             <Export-Package>
             </Export-Package>
-            <Web-ContextPath>/one/nb/v2/subnet</Web-ContextPath>
+            <Web-ContextPath>/controller/nb/v2/subnet</Web-ContextPath>
           </instructions>
         </configuration>
       </plugin>
index 5f8f9c941189fd515d714dd252b4f06dec11c5d1..9338b55826b81852f4c0c881fe7beaa49bdc0298 100644 (file)
@@ -3,7 +3,7 @@
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
   
   <services>
-    <rest defaultRestSubcontext="/one/nb/v2/switch"/>
+    <rest defaultRestSubcontext="/controller/nb/v2/switch"/>
   </services>
 
   <modules>
index 55c836d2f436048d44f67a085390c48ef6d80b22..4a8504bef09ac2918fb64325bae1fe01c2f81609 100644 (file)
@@ -59,7 +59,7 @@
               org.slf4j,
               !org.codehaus.enunciate.jaxrs
             </Import-Package>
-            <Web-ContextPath>/one/nb/v2/switch</Web-ContextPath>
+            <Web-ContextPath>/controller/nb/v2/switch</Web-ContextPath>
           </instructions>
         </configuration>
       </plugin>
index 7103df953e2ed1bbb50b566bc2a2bd807ea55316..c955d8cc5c3ae549f7ff021db27d02ddaf9f8fd6 100644 (file)
@@ -3,7 +3,7 @@
     xsi:noNamespaceSchemaLocation="http://enunciate.codehaus.org/schemas/enunciate-1.26.xsd">
   
   <services>
-    <rest defaultRestSubcontext="/one/nb/v2/topology"/>
+    <rest defaultRestSubcontext="/controller/nb/v2/topology"/>
   </services>
 
   <modules>
index c6963b8a7e2831e9df7a937c0ca57ff7c3503127..82eaf4e580f3096bc7565be0da45bee45ad28329 100644 (file)
@@ -61,7 +61,7 @@
               org.springframework.security.web.authentication.www,
               !org.codehaus.enunciate.jaxrs
             </Import-Package>
-            <Web-ContextPath>/one/nb/v2/topology</Web-ContextPath>
+            <Web-ContextPath>/controller/nb/v2/topology</Web-ContextPath>
           </instructions>
           </configuration>
       </plugin>
index 93e7840b01c203a741b3610e0e30f5d86236580e..cc8bcfa6b9c7c25fe828a4c7d8346dc161df4405 100644 (file)
@@ -94,7 +94,7 @@ public class DataPacketMuxDemux implements IContainerListener,
             // replication is done in the SAL implementation toward
             // the different APPS
             this.pluginOutDataPacketServices.put(containerName, s);
-            logger.debug("New outService for container:" + containerName);
+            logger.debug("New outService for container: {}", containerName);
         }
     }
 
@@ -111,7 +111,7 @@ public class DataPacketMuxDemux implements IContainerListener,
         }
         if (this.pluginOutDataPacketServices != null) {
             this.pluginOutDataPacketServices.remove(containerName);
-            logger.debug("Removed outService for container:" + containerName);
+            logger.debug("Removed outService for container: {}", containerName);
         }
     }
 
@@ -158,6 +158,8 @@ public class DataPacketMuxDemux implements IContainerListener,
         if (sw == null || msg == null
                 || this.pluginOutDataPacketServices == null) {
             // Something fishy, we cannot do anything
+               logger.debug("sw: {} and/or msg: {} and/or pluginOutDataPacketServices: {} is null!",
+                                       new Object[]{sw, msg, this.pluginOutDataPacketServices});
             return;
         }
         if (msg instanceof OFPacketIn) {
@@ -191,10 +193,8 @@ public class DataPacketMuxDemux implements IContainerListener,
                         .get(GlobalConstants.DEFAULT.toString());
                 if (defaultOutService != null) {
                     defaultOutService.receiveDataPacket(dataPacket);
-                    logger.trace("Dispatched to apps a frame of size: "
-                            + ofPacket.getPacketData().length
-                            + " on container: "
-                            + GlobalConstants.DEFAULT.toString());
+                    logger.trace("Dispatched to apps a frame of size: {} on container: {}",
+                            ofPacket.getPacketData().length, GlobalConstants.DEFAULT.toString());
                 }
                 // Now check the mapping between nodeConnector and
                 // Container and later on optinally filter based on
@@ -208,9 +208,8 @@ public class DataPacketMuxDemux implements IContainerListener,
                         if (s != null) {
                             // TODO add filtering on a per-flowSpec base
                             s.receiveDataPacket(dataPacket);
-                            logger.trace("Dispatched to apps a frame of size: "
-                                    + ofPacket.getPacketData().length
-                                    + " on container: " + container);
+                            logger.trace("Dispatched to apps a frame of size: {} on container: {}",
+                                    ofPacket.getPacketData().length, GlobalConstants.DEFAULT.toString());
 
                         }
                     }
@@ -234,17 +233,20 @@ public class DataPacketMuxDemux implements IContainerListener,
     public void transmitDataPacket(RawPacket outPkt) {
         // Sanity check area
         if (outPkt == null) {
+               logger.debug("outPkt is null!");
             return;
         }
 
         NodeConnector outPort = outPkt.getOutgoingNodeConnector();
         if (outPort == null) {
+               logger.debug("outPort is null! outPkt: {}", outPkt);
             return;
         }
 
         if (!outPort.getType().equals(
                 NodeConnector.NodeConnectorIDType.OPENFLOW)) {
             // The output Port is not of type OpenFlow
+               logger.debug("outPort is not OF Type! outPort: {}", outPort);
             return;
         }
 
@@ -255,6 +257,7 @@ public class DataPacketMuxDemux implements IContainerListener,
         if (sw == null) {
             // If we cannot get the controller descriptor we cannot even
             // send out the frame
+               logger.debug("swID: {} - sw is null!", swID);
             return;
         }
 
@@ -272,29 +275,37 @@ public class DataPacketMuxDemux implements IContainerListener,
         po.setPacketData(data);
 
         sw.asyncSend(po);
-        logger.trace("Transmitted a frame of size:" + data.length);
+        logger.trace("Transmitted a frame of size: {}", data.length);
     }
 
     public void addNode(Node node, Set<Property> props) {
-        if (node == null)
+        if (node == null) {
+               logger.debug("node is null!");
             return;
+        } 
 
         long sid = (Long) node.getID();
         ISwitch sw = controller.getSwitches().get(sid);
-        if (sw != null) {
-            this.swID2ISwitch.put(sw.getId(), sw);
+        if (sw == null) {
+               logger.debug("sid: {} - sw is null!", sid);
+               return;
         }
+        this.swID2ISwitch.put(sw.getId(), sw);
     }
 
     public void removeNode(Node node) {
-        if (node == null)
+        if (node == null) {
+               logger.debug("node is null!");
             return;
+        }
 
         long sid = (Long) node.getID();
         ISwitch sw = controller.getSwitches().get(sid);
-        if (sw != null) {
-            this.swID2ISwitch.remove(sw.getId());
+        if (sw == null) {
+               logger.debug("sid: {} - sw is null!", sid);
+               return;
         }
+        this.swID2ISwitch.remove(sw.getId());
     }
 
     @Override
@@ -315,7 +326,6 @@ public class DataPacketMuxDemux implements IContainerListener,
         if (fSpecs == null) {
             fSpecs = new CopyOnWriteArrayList<ContainerFlow>();
         }
-        boolean updateMap = false;
         switch (t) {
         case ADDED:
             if (!fSpecs.contains(previousFlow)) {
@@ -330,13 +340,6 @@ public class DataPacketMuxDemux implements IContainerListener,
         case CHANGED:
             break;
         }
-        if (updateMap) {
-            if (fSpecs.isEmpty()) {
-                this.container2FlowSpecs.remove(containerName);
-            } else {
-                this.container2FlowSpecs.put(containerName, fSpecs);
-            }
-        }
     }
 
     @Override
index 34cfd4b223625389bc6ca81841bf61f017c592cc..1fed3e1c036d53b89c2bb9ee6689128f3d937234 100644 (file)
@@ -66,7 +66,7 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
             this.routingAware = new HashSet<IListenRoutingUpdates>();
         }
         if (this.routingAware != null) {
-            log.debug("Adding routingAware listener: " + i);
+            log.debug("Adding routingAware listener: {}", i);
             this.routingAware.add(i);
         }
     }
@@ -140,10 +140,8 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
                             : avlDstThruPut;
 
                     if (avlThruPut <= 0) {
-                        log
-                                .trace(
-                                        "Edge {}: Available Throughput {} is Zero/Negative",
-                                        e, avlThruPut);
+                        log.debug("Edge {}: Available Throughput {} <= 0!",
+                                         e, avlThruPut);
                         return (double) -1;
                     }
                     return (double) (Bandwidth.BW1Pbps / avlThruPut);
@@ -177,8 +175,7 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
     @Override
     public synchronized Path getMaxThroughputRoute(Node src, Node dst) {
         if (mtp == null) {
-            log
-                    .error("Max Throughput Path Calculation has not been Initialized!");
+            log.error("Max Throughput Path Calculation Uninitialized!");
             return null;
         }
 
@@ -186,16 +183,16 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
         try {
             path = mtp.getMaxThroughputPath(src, dst);
         } catch (IllegalArgumentException ie) {
-            log.debug("A vertex is yet not known between " + src.toString()
-                    + " " + dst.toString());
+            log.debug("A vertex is yet not known between {} {}", src.toString(),
+                          dst.toString());
             return null;
         }
         Path res;
         try {
             res = new Path(path);
         } catch (ConstructionException e) {
-            log.debug("A vertex is yet not known between " + src.toString()
-                    + " " + dst.toString());
+            log.debug("A vertex is yet not known between {} {}", src.toString(),
+                         dst.toString());
             return null;
         }
         return res;
@@ -210,16 +207,16 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
         try {
             path = spt.getPath(src, dst);
         } catch (IllegalArgumentException ie) {
-            log.debug("A vertex is yet not known between " + src.toString()
-                    + " " + dst.toString());
+               log.debug("A vertex is yet not known between {} {}", src.toString(),
+                          dst.toString());
             return null;
         }
         Path res;
         try {
             res = new Path(path);
         } catch (ConstructionException e) {
-            log.debug("A vertex is yet not known between " + src.toString()
-                    + " " + dst.toString());
+               log.debug("A vertex is yet not known between {} {}", src.toString(),
+                          dst.toString());
             return null;
         }
         return res;
@@ -298,14 +295,14 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
                 if (topo.containsVertex(src.getNode())
                         && topo.inDegree(src.getNode()) == 0
                         && topo.outDegree(src.getNode()) == 0) {
-                    log.debug("Removing vertex " + src);
+                    log.debug("Removing vertex {}", src);
                     topo.removeVertex(src.getNode());
                 }
 
                 if (topo.containsVertex(dst.getNode())
                         && topo.inDegree(dst.getNode()) == 0
                         && topo.outDegree(dst.getNode()) == 0) {
-                    log.debug("Removing vertex " + dst);
+                    log.debug("Removing vertex {}", dst);
                     topo.removeVertex(dst.getNode());
                 }
             }
@@ -314,8 +311,7 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
                 clearMaxThroughput();
             }
         } else {
-            log.error("Cannot find topology for BW " + bw
-                    + " this is unexpected!");
+            log.error("Cannot find topology for BW {} this is unexpected!", bw);
         }
         return edgePresentInGraph;
     }
@@ -348,7 +344,7 @@ public class DijkstraImplementation implements IRouting, ITopologyManagerAware {
         if (props != null)
             props.remove(bw);
 
-        log.debug("edgeUpdate: " + e.toString() + " bw: " + bw.getValue());
+        log.debug("edgeUpdate: {} bw: {}", e.toString(), bw.getValue());
 
         Short baseBW = Short.valueOf((short) 0);
         boolean add = (type == UpdateType.ADDED) ? true : false;
index d04e67b304666c88c840e7733aeeb53d5e29a1d2..88a829ba0464ab7c57e2c0d320666df78d2a7175 100644 (file)
@@ -178,7 +178,7 @@ abstract public class ComponentActivatorAbstractBase implements
     public void containerCreate(String containerName) {
         try {
             Object[] imps = getImplementations();
-            logger.trace("Creating instance " + containerName);
+            logger.trace("Creating instance {}", containerName);
             if (imps != null) {
                 for (int i = 0; i < imps.length; i++) {
                     ImmutablePair<String, Object> key = new ImmutablePair<String, Object>(
@@ -193,9 +193,8 @@ abstract public class ComponentActivatorAbstractBase implements
                         // Set the implementation so the component can manage
                         // its lifecycle
                         if (c.getService() == null) {
-                            logger
-                                    .trace("Setting implementation to:"
-                                            + imps[i]);
+                            logger.trace("Setting implementation to: {}",
+                                          imps[i]);
                             c.setImplementation(imps[i]);
                         }
 
@@ -246,7 +245,7 @@ abstract public class ComponentActivatorAbstractBase implements
     public void containerDestroy(String containerName) {
         try {
             Object[] imps = getImplementations();
-            logger.trace("Destroying instance " + containerName);
+            logger.trace("Destroying instance {}", containerName);
             if (imps != null) {
                 for (int i = 0; i < imps.length; i++) {
                     ImmutablePair<String, Object> key = new ImmutablePair<String, Object>(
@@ -330,8 +329,8 @@ abstract public class ComponentActivatorAbstractBase implements
                             // Set the implementation so the component
                             // can manage its lifesycle
                             if (c.getService() == null) {
-                                logger.trace("Setting implementation to:"
-                                        imps[i]);
+                                logger.trace("Setting implementation to: {}",
+                                        imps[i]);
                                 c.setImplementation(imps[i]);
                             }
 
@@ -397,8 +396,8 @@ abstract public class ComponentActivatorAbstractBase implements
                 try {
                     Component c = this.dbInstances.get(key);
                     if (c != null) {
-                        logger.trace("Remove component on container:"
-                                + key.getLeft() + " Object:" + key.getRight());
+                        logger.trace("Remove component on container: {} Object: {}",
+                                key.getLeft(), key.getRight());
                         this.dm.remove(c);
                     }
                 } catch (Exception nex) {
@@ -415,7 +414,7 @@ abstract public class ComponentActivatorAbstractBase implements
                 try {
                     Component c = this.dbGlobalInstances.get(key);
                     if (c != null) {
-                        logger.trace("Remove component for Object:" + key);
+                        logger.trace("Remove component for Object: {}" , key);
                         this.dm.remove(c);
                     }
                 } catch (Exception nex) {
index abc0c23ae93861ef21035b165db97f8e54e03cab..6f60a522fdb5ba5780dc5034c9be45efee931528 100644 (file)
@@ -14,9 +14,12 @@ package org.opendaylight.controller.sal.utils;
  *
  */
 public enum GlobalConstants {
-    DEFAULT("default"), CONTAINERMANAGER("containermanager"), CONTAINERNAME(
-            "name"), STATICVLAN("staticvlan"), CLUSTERINGSERVICES("clusteringservices"), ONECONTROLLER(
-            "onecontroller"), STARTUPHOME("configuration/startup/");
+    DEFAULT("default"), 
+    CONTAINERMANAGER("containermanager"), 
+    CONTAINERNAME("name"), 
+    STATICVLAN("staticvlan"), 
+    CLUSTERINGSERVICES("clusteringservices"), 
+    STARTUPHOME("configuration/startup/");
 
     private GlobalConstants(String name) {
         this.name = name;
index fe525bb081f4db9c568da0975249f1f46879de9a..78fedee36ad420fa75957268e0a9ae01219790b9 100644 (file)
@@ -236,8 +236,7 @@ public class DataPacketService implements IPluginOutDataPacketService,
         logger.trace("Received setPluginInDataService request");
         for (Object e : props.entrySet()) {
             Map.Entry entry = (Map.Entry) e;
-            logger.trace("Prop key:(" + entry.getKey() + ") value:("
-                    + entry.getValue() + ")");
+            logger.trace("Prop key:({}) value:({})",entry.getKey(), entry.getValue());
         }
 
         Object value = props.get("protocolPluginType");
@@ -249,7 +248,7 @@ public class DataPacketService implements IPluginOutDataPacketService,
                     + "protocolPluginType provided");
         } else {
             this.pluginInDataService.put(type, s);
-            logger.debug("Stored the PluginInDataService for type:" + type);
+            logger.debug("Stored the PluginInDataService for type: {}", type);
         }
     }
 
@@ -263,8 +262,7 @@ public class DataPacketService implements IPluginOutDataPacketService,
         logger.trace("Received unsetPluginInDataService request");
         for (Object e : props.entrySet()) {
             Map.Entry entry = (Map.Entry) e;
-            logger.trace("Prop key:(" + entry.getKey() + ") value:("
-                    + entry.getValue() + ")");
+            logger.trace("Prop key:({}) value:({})",entry.getKey(), entry.getValue());
         }
 
         Object value = props.get("protocoloPluginType");
@@ -276,7 +274,7 @@ public class DataPacketService implements IPluginOutDataPacketService,
                     + "protocolPluginType provided");
         } else if (this.pluginInDataService.get(type).equals(s)) {
             this.pluginInDataService.remove(type);
-            logger.debug("Removed the PluginInDataService for type:" + type);
+            logger.debug("Removed the PluginInDataService for type: {}", type);
         }
     }
 
@@ -288,8 +286,7 @@ public class DataPacketService implements IPluginOutDataPacketService,
         logger.trace("Received setListenDataPacket request");
         for (Object e : props.entrySet()) {
             Map.Entry entry = (Map.Entry) e;
-            logger.trace("Prop key:(" + entry.getKey() + ") value:("
-                    + entry.getValue() + ")");
+            logger.trace("Prop key:({}) value:({})",entry.getKey(), entry.getValue());
         }
 
         String listenerName = null;
@@ -331,7 +328,7 @@ public class DataPacketService implements IPluginOutDataPacketService,
             if (this.indexDataPacket.contains(l)) {
                 logger.error("trying to add an existing element");
             } else {
-                logger.debug("adding listener: " + listenerName);
+                logger.debug("adding listener: {}", listenerName);
                 CopyOnWriteArrayList<DataPacketListener> serialListeners = new CopyOnWriteArrayList<DataPacketListener>();
                 serialListeners.add(l);
                 this.listenDataPacket.add(serialListeners);
@@ -343,7 +340,7 @@ public class DataPacketService implements IPluginOutDataPacketService,
             if (this.indexDataPacket.contains(l)) {
                 logger.error("trying to add an existing element");
             } else {
-                logger.debug("adding listener: " + listenerName);
+                logger.debug("adding listener: {}", listenerName);
                 // Lets find the set with the dependency in it, if we
                 // find it lets just add our dependency at the end of
                 // the list.
@@ -373,8 +370,7 @@ public class DataPacketService implements IPluginOutDataPacketService,
         logger.trace("Received UNsetListenDataPacket request");
         for (Object e : props.entrySet()) {
             Map.Entry entry = (Map.Entry) e;
-            logger.trace("Prop key:(" + entry.getKey() + ") value:("
-                    + entry.getValue() + ")");
+            logger.trace("Prop key:({}) value:({})",entry.getKey(), entry.getValue());
         }
 
         String listenerName = null;
@@ -395,7 +391,7 @@ public class DataPacketService implements IPluginOutDataPacketService,
         if (!this.indexDataPacket.contains(l)) {
             logger.error("trying to remove a non-existing element");
         } else {
-            logger.debug("removing listener: " + listenerName);
+            logger.debug("removing listener: {}", listenerName);
             for (List<DataPacketListener> serialListeners : this.listenDataPacket) {
                 int i = 0;
                 boolean done = false;
index cb0a5c77a6979a0872fe63f0896c65d2a6a0d4e8..d2a49b9208fac68118ca27e70086ef9b0f59738a 100644 (file)
@@ -113,8 +113,8 @@ public class FlowProgrammerService implements IFlowProgrammerService,
         String type = null;
         for (Object e : props.entrySet()) {
             Map.Entry entry = (Map.Entry) e;
-            logger.trace("Prop key:(" + entry.getKey() + ") value:("
-                    + entry.getValue() + ")");
+            logger.trace("Prop key:({}) value:({})",entry.getKey(),
+                         entry.getValue());
         }
 
         Object value = props.get("protocolPluginType");
@@ -126,7 +126,7 @@ public class FlowProgrammerService implements IFlowProgrammerService,
                     + "protocolPluginType provided");
         } else {
             this.pluginFlowProgrammer.put(type, s);
-            logger.debug("Stored the pluginFlowProgrammer for type:" + type);
+            logger.debug("Stored the pluginFlowProgrammer for type: {}",type);
         }
     }
 
@@ -141,8 +141,8 @@ public class FlowProgrammerService implements IFlowProgrammerService,
         logger.debug("Received unsetpluginFlowProgrammer request");
         for (Object e : props.entrySet()) {
             Map.Entry entry = (Map.Entry) e;
-            logger.trace("Prop key:(" + entry.getKey() + ") value:("
-                    + entry.getValue() + ")");
+            logger.trace("Prop key:({}) value:({})",entry.getKey(),
+                       entry.getValue());
         }
 
         Object value = props.get("protocoloPluginType");
@@ -154,7 +154,7 @@ public class FlowProgrammerService implements IFlowProgrammerService,
                     + "protocolPluginType provided");
         } else if (this.pluginFlowProgrammer.get(type).equals(s)) {
             this.pluginFlowProgrammer.remove(type);
-            logger.debug("Removed the pluginFlowProgrammer for type:" + type);
+            logger.debug("Removed the pluginFlowProgrammer for type: {}", type);
         }
     }
 
index 81bfa5b63fb48b7a8fa18b05ea5b2a4340cad344..da725f010cffedc7646edb82f2d5087a947252ae 100644 (file)
@@ -109,8 +109,8 @@ public class ReadService implements IReadService, CommandProvider {
         String type = null;
         for (Object e : props.entrySet()) {
             Map.Entry entry = (Map.Entry) e;
-            logger.trace("Prop key:(" + entry.getKey() + ") value:("
-                    + entry.getValue() + ")");
+            logger.trace("Prop key:({}) value:({})", entry.getKey(),
+                       entry.getValue());
         }
 
         Object value = props.get("protocolPluginType");
@@ -122,7 +122,7 @@ public class ReadService implements IReadService, CommandProvider {
                     + "protocolPluginType provided");
         } else {
             this.pluginReader.put(type, s);
-            logger.debug("Stored the pluginReader for type:" + type);
+            logger.debug("Stored the pluginReader for type: {}", type);
         }
     }
 
@@ -136,8 +136,8 @@ public class ReadService implements IReadService, CommandProvider {
         logger.debug("Received unsetpluginReader request");
         for (Object e : props.entrySet()) {
             Map.Entry entry = (Map.Entry) e;
-            logger.trace("Prop key:(" + entry.getKey() + ") value:("
-                    + entry.getValue() + ")");
+            logger.trace("Prop key:({}) value:({})", entry.getKey(),
+                       entry.getValue());
         }
 
         Object value = props.get("protocoloPluginType");
@@ -149,7 +149,7 @@ public class ReadService implements IReadService, CommandProvider {
                     + "protocolPluginType provided");
         } else if (this.pluginReader.get(type).equals(s)) {
             this.pluginReader.remove(type);
-            logger.debug("Removed the pluginReader for type:" + type);
+            logger.debug("Removed the pluginReader for type: {}", type);
         }
     }
 
@@ -161,7 +161,7 @@ public class ReadService implements IReadService, CommandProvider {
                     .readFlow(node, flow, true);
             }
         }
-        logger.warn("Plugin unuvailable");
+        logger.warn("Plugin unavailable");
         return null;
     }
 
@@ -173,7 +173,7 @@ public class ReadService implements IReadService, CommandProvider {
                     .readFlow(node, flow, false);
             }
         }
-        logger.warn("Plugin unuvailable");
+        logger.warn("Plugin unavailable");
         return null;
     }
 
@@ -185,7 +185,7 @@ public class ReadService implements IReadService, CommandProvider {
                     .readAllFlow(node, true);
             }
         }
-        logger.warn("Plugin unuvailable");
+        logger.warn("Plugin unavailable");
         return null;
     }
 
@@ -197,7 +197,7 @@ public class ReadService implements IReadService, CommandProvider {
                     .readAllFlow(node, false);
             }
         }
-        logger.warn("Plugin unuvailable");
+        logger.warn("Plugin unavailable");
         return null;
     }
 
@@ -209,7 +209,7 @@ public class ReadService implements IReadService, CommandProvider {
                     .readDescription(node, true);
             }
         }
-        logger.warn("Plugin unuvailable");
+        logger.warn("Plugin unavailable");
         return null;
     }
 
@@ -221,7 +221,7 @@ public class ReadService implements IReadService, CommandProvider {
                     .readDescription(node, false);
             }
         }
-        logger.warn("Plugin unuvailable");
+        logger.warn("Plugin unavailable");
         return null;
     }
 
@@ -234,7 +234,7 @@ public class ReadService implements IReadService, CommandProvider {
                     .readNodeConnector(connector, true);
             }
         }
-        logger.warn("Plugin unuvailable");
+        logger.warn("Plugin unavailable");
         return null;
     }
 
@@ -248,7 +248,7 @@ public class ReadService implements IReadService, CommandProvider {
                     .readNodeConnector(connector, false);
             }
         }
-        logger.warn("Plugin unuvailable");
+        logger.warn("Plugin unavailable");
         return null;
     }
 
@@ -260,7 +260,7 @@ public class ReadService implements IReadService, CommandProvider {
                     .readAllNodeConnector(node, true);
             }
         }
-        logger.warn("Plugin unuvailable");
+        logger.warn("Plugin unavailable");
         return null;
     }
 
@@ -272,7 +272,7 @@ public class ReadService implements IReadService, CommandProvider {
                     .readAllNodeConnector(node, false);
             }
         }
-        logger.warn("Plugin unuvailable");
+        logger.warn("Plugin unavailable");
         return null;
     }
 
@@ -285,7 +285,7 @@ public class ReadService implements IReadService, CommandProvider {
                     .getTransmitRate(connector);
             }
         }
-        logger.warn("Plugin unuvailable");
+        logger.warn("Plugin unavailable");
         return 0;
     }
 
index 2c494e6bb94704ff73753ad047d9e59f0e241574..1b633b4a25ae78f1cb32710a3c9590921e987fb2 100644 (file)
                <module>sal-core-demo</module>\r
        </modules>\r
 \r
-       <dependencies>\r
+       <dependencyManagement>\r
+               <dependencies>\r
+                       <dependency>\r
+                               <groupId>com.google.guava</groupId>\r
+                               <artifactId>guava</artifactId>\r
+                               <version>14.0.1</version>\r
+                               <type>jar</type>\r
+                       </dependency>\r
+                       <dependency>\r
+                               <groupId>org.slf4j</groupId>\r
+                               <artifactId>slf4j-api</artifactId>\r
+                               <version>1.7.2</version>\r
+                       </dependency>\r
+               </dependencies>\r
+       </dependencyManagement>\r
 \r
+       <dependencies>\r
                <dependency>\r
                        <groupId>junit</groupId>\r
                        <artifactId>junit</artifactId>\r
                        <optional>true</optional>\r
                </dependency>\r
                <dependency>\r
-                       <groupId>org.slf4j</groupId>\r
-                       <artifactId>slf4j-api</artifactId>\r
-                       <version>1.7.2</version>\r
-               </dependency>\r
-               <dependency>\r
-                       <groupId>org.slf4j</groupId>\r
-                       <artifactId>slf4j-simple</artifactId>\r
-                       <version>1.7.2</version>\r
+                       <groupId>org.mockito</groupId>\r
+                       <artifactId>mockito-all</artifactId>\r
+                       <version>1.9.5</version>\r
+                       <scope>test</scope>\r
                </dependency>\r
        </dependencies>\r
        <build>\r
index 9c5552edbd8278a88763eb251c34822889f6b3a5..f126744652b78f8a4b87cf14a3b8adf5852c0137 100644 (file)
@@ -1,35 +1,41 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
-  <modelVersion>4.0.0</modelVersion>\r
-  <parent>\r
-    <groupId>org.opendaylight.controller</groupId>\r
-    <artifactId>sal</artifactId>\r
-    <version>1.0-SNAPSHOT</version>\r
-  </parent>\r
-   <artifactId>sal-binding-broker-impl</artifactId>\r
-   \r
-   \r
-   \r
-   <dependencies>\r
-       <dependency>\r
-               <groupId>org.opendaylight.controller</groupId>\r
-               <artifactId>sal-binding-api</artifactId>\r
-               <version>1.0-SNAPSHOT</version>\r
-       </dependency>\r
-               <dependency>\r
-               <groupId>org.opendaylight.controller</groupId>\r
-               <artifactId>sal-binding-spi</artifactId>\r
-               <version>1.0-SNAPSHOT</version>\r
-       </dependency>\r
-       <dependency>\r
-               <groupId>org.opendaylight.controller</groupId>\r
-               <artifactId>sal-core-api</artifactId>\r
-               <version>1.0-SNAPSHOT</version>\r
-       </dependency>\r
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+       xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">\r
+       <modelVersion>4.0.0</modelVersion>\r
+       <parent>\r
+               <groupId>org.opendaylight.controller</groupId>\r
+               <artifactId>sal</artifactId>\r
+               <version>1.0-SNAPSHOT</version>\r
+       </parent>\r
+       <artifactId>sal-binding-broker-impl</artifactId>\r
 \r
-       <dependency>\r
-               <groupId>org.slf4j</groupId>\r
-               <artifactId>slf4j-api</artifactId>\r
-               <version>1.6.4</version>\r
-       </dependency>\r
-   </dependencies>\r
+\r
+\r
+       <dependencies>\r
+               <dependency>\r
+                       <groupId>org.opendaylight.controller</groupId>\r
+                       <artifactId>sal-binding-api</artifactId>\r
+                       <version>1.0-SNAPSHOT</version>\r
+               </dependency>\r
+               <dependency>\r
+                       <groupId>org.opendaylight.controller</groupId>\r
+                       <artifactId>sal-binding-spi</artifactId>\r
+                       <version>1.0-SNAPSHOT</version>\r
+               </dependency>\r
+               <dependency>\r
+                       <groupId>org.opendaylight.controller</groupId>\r
+                       <artifactId>sal-core-api</artifactId>\r
+                       <version>1.0-SNAPSHOT</version>\r
+               </dependency>\r
+\r
+               <dependency>\r
+                       <groupId>org.slf4j</groupId>\r
+                       <artifactId>slf4j-api</artifactId>\r
+               </dependency>\r
+\r
+               <dependency>\r
+                       <groupId>com.google.guava</groupId>\r
+                       <artifactId>guava</artifactId>\r
+                       <type>jar</type>\r
+               </dependency>\r
+       </dependencies>\r
 </project>
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/sal/sal-binding-broker-impl/src/main/java/org/opendaylight/controller/sal/binding/impl/BrokerUtils.java b/opendaylight/sal/yang-prototype/sal/sal-binding-broker-impl/src/main/java/org/opendaylight/controller/sal/binding/impl/BrokerUtils.java
deleted file mode 100644 (file)
index e174559..0000000
+++ /dev/null
@@ -1,40 +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.controller.sal.binding.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-public class BrokerUtils {
-    private BrokerUtils() {
-        
-    }
-    
-    
-    public static <K,V> void addToMap(Map<Class<? extends K>, List<V>> map, Class<? extends K> key, V value) {
-        List<V> list = map.get(key);
-        if (list == null) {
-            list = new ArrayList<V>();
-            map.put(key, list);
-        }
-        list.add(value);
-    }
-
-    public static <K,V> void removeFromMap(Map<Class<? extends K>, List<V>> map, Class<? extends K> key,
-            V value) {
-        List<V> list = map.get(key);
-        if (list == null) {
-            return;
-        }
-        list.remove(value);
-        if (list.isEmpty()) {
-            map.remove(key);
-        }
-    }
-}
index f029a2f9f4bdcb3ec872338b0a56323c5511dd43..89c44643edc1bb995f5f1f60cdd0ce5fcba8b9c3 100644 (file)
-/*
- * 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.controller.sal.binding.impl;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;
-import org.opendaylight.controller.sal.binding.api.BindingAwareService;
-import org.opendaylight.controller.sal.binding.api.NotificationProviderService;
-import org.opendaylight.controller.sal.binding.api.NotificationService;
-import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerSession;
-import org.opendaylight.controller.sal.binding.spi.SALBindingModule;
-import org.opendaylight.controller.sal.binding.spi.Mapper;
-import org.opendaylight.controller.sal.binding.spi.MappingProvider;
-import org.opendaylight.controller.sal.binding.spi.MappingProvider.MappingExtensionFactory;
-
-import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;
-import org.opendaylight.controller.yang.binding.DataObject;
-import org.opendaylight.controller.yang.binding.Notification;
-import org.opendaylight.controller.yang.binding.NotificationListener;
-import org.opendaylight.controller.yang.common.QName;
-import org.opendaylight.controller.yang.data.api.CompositeNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NotificationModule implements SALBindingModule {
-
-    private ProviderSession biSession;
-    private org.opendaylight.controller.sal.core.api.notify.NotificationProviderService biNotifyService;
-    private BindingAwareBroker broker;
-    private MappingProvider mappingProvider;
-
-    private Map<Class<? extends Notification>, List<NotificationListener>> listeners = new HashMap<Class<? extends Notification>, List<NotificationListener>>();
-    private Set<QName> biNotifications = new HashSet<QName>();
-    private static final Logger log = LoggerFactory
-            .getLogger(NotificationModule.class);
-    private final BindingIndependentListener biListener = new BindingIndependentListener();
-
-    @Override
-    public Set<Class<? extends BindingAwareService>> getProvidedServices() {
-
-        Set<Class<? extends BindingAwareService>> ret = new HashSet<Class<? extends BindingAwareService>>();
-        ret.add(NotificationService.class);
-        ret.add(NotificationProviderService.class);
-        return ret;
-    }
-
-    @Override
-    public <T extends BindingAwareService> T getServiceForSession(
-            Class<T> service, ConsumerSession session) {
-        if (service == null)
-            throw new IllegalArgumentException("Service should not be null");
-        if (session == null)
-            throw new IllegalArgumentException("Session should not be null");
-
-        if (NotificationProviderSession.class.equals(service)) {
-            if (session instanceof org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderSession) {
-                @SuppressWarnings("unchecked")
-                T ret = (T) new NotificationProviderSession(session);
-                return ret;
-            } else {
-                throw new IllegalArgumentException(
-                        "NotificationProviderService is available only to ProviderSession");
-            }
-        }
-
-        if (NotificationService.class.equals(service)) {
-            @SuppressWarnings("unchecked")
-            T ret = (T) new NotificationSession(session);
-            return ret;
-        }
-        return null;
-    }
-
-    @Override
-    public Set<Class<? extends org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality>> getSupportedProviderFunctionality() {
-        return Collections.emptySet();
-    }
-
-    @Override
-    public void setBroker(BindingAwareBroker broker) {
-        this.broker = broker;
-    }
-
-    @Override
-    public void setMappingProvider(MappingProvider provider) {
-        this.mappingProvider = provider;
-    }
-
-    @Override
-    public void onBISessionAvailable(ProviderSession session) {
-        biSession = session;
-        if (biSession != null) {
-            biNotifyService = session
-                    .getService(org.opendaylight.controller.sal.core.api.notify.NotificationProviderService.class);
-        }
-    }
-
-    private void notify(Notification notification) {
-        notifyBindingIndependent(notification);
-        notifyBindingAware(notification);
-    }
-
-    private void notifyBindingAware(Notification notification) {
-        Class<? extends Notification> type = notification.getClass();
-        List<NotificationListener> toNotify = listeners.get(type);
-
-        // Invocation of notification on registered listeners
-        if (toNotify != null) {
-
-            // We get factory for Notification Invoker
-            MappingExtensionFactory<NotificationInvoker> invokerFactory = mappingProvider
-                    .getExtensionFactory(NotificationInvoker.class);
-
-            // We get generated invoker for NoficiationListener interface
-            // associated to Notification Type
-            NotificationInvoker invoker = invokerFactory.forClass(type);
-            for (NotificationListener listener : toNotify) {
-                try {
-                    // Invoker invokes the right method on subtype of
-                    // NotificationListener
-                    // associated to the type of notification
-                    invoker.notify(notification, listener);
-                } catch (Exception e) {
-
-                }
-            }
-        }
-    }
-
-    private void notifyBindingIndependent(Notification notification) {
-        Class<? extends Notification> type = notification.getClass();
-
-        if (biSession == null) {
-            return;
-        }
-        if (biSession.isClosed()) {
-            return;
-        }
-        if (biNotifyService == null) {
-            return;
-        }
-
-        // FIXME: Somehow we need to resolve this for class hierarchy.
-        // probably use type.getInterfaces()
-        Mapper<? extends Notification> mapper = mappingProvider.getMapper(type);
-        CompositeNode domNotification = mapper.domFromObject(notification);
-
-        biNotifyService.sendNotification(domNotification);
-    }
-
-    private void addBAListener(Class<? extends Notification> notificationType,
-            NotificationListener listener) {
-
-        BrokerUtils.addToMap(listeners, notificationType, listener);
-        Mapper<? extends Notification> mapper = mappingProvider
-                .getMapper(notificationType);
-        QName biType = mapper.getQName();
-        if (false == biNotifications.contains(biType)) {
-            // The listener is not registered for binding independent
-            // notification
-            biNotifications.add(biType);
-
-            if (biNotifyService != null) {
-                biNotifyService.addNotificationListener(biType, biListener);
-            }
-        }
-
-    }
-
-    private void removeBAListener(
-            Class<? extends Notification> notificationType,
-            NotificationListener listener) {
-        BrokerUtils.removeFromMap(listeners, notificationType, listener);
-    }
-
-    private class NotificationSession implements NotificationService {
-        private final ConsumerSession session;
-
-        public NotificationSession(ConsumerSession session) {
-            this.session = session;
-        }
-
-        private Map<Class<? extends Notification>, List<NotificationListener>> sessionListeners = new HashMap<Class<? extends Notification>, List<NotificationListener>>();
-
-        @Override
-        public void addNotificationListener(
-                Class<? extends Notification> notificationType,
-                NotificationListener listener) {
-
-            NotificationModule.this.addBAListener(notificationType, listener);
-            BrokerUtils.addToMap(sessionListeners, notificationType, listener);
-
-        }
-
-        @Override
-        public void removeNotificationListener(
-                Class<? extends Notification> notificationType,
-                NotificationListener listener) {
-            BrokerUtils.removeFromMap(sessionListeners, notificationType,
-                    listener);
-            NotificationModule.this
-                    .removeBAListener(notificationType, listener);
-        }
-
-    }
-
-    private class NotificationProviderSession extends NotificationSession
-            implements NotificationProviderService {
-
-        public NotificationProviderSession(ConsumerSession session) {
-            super(session);
-        }
-
-        @Override
-        public void notify(Notification notification) {
-            NotificationModule.this.notify(notification);
-        }
-
-    }
-
-    private class BindingIndependentListener
-            implements
-            org.opendaylight.controller.sal.core.api.notify.NotificationListener {
-
-        @Override
-        public Set<QName> getSupportedNotifications() {
-            return biNotifications;
-        }
-
-        @Override
-        public void onNotification(CompositeNode notification) {
-            NotificationModule.this
-                    .onBindingIndependentNotification(notification);
-        }
-
-    }
-
-    private void onBindingIndependentNotification(CompositeNode biNotification) {
-        QName biType = biNotification.getNodeType();
-
-        Mapper<DataObject> mapper = mappingProvider.getMapper(biType);
-        if (mapper == null) {
-            log.info("Received notification does not have a binding defined.");
-            return;
-        }
-        Class<DataObject> type = mapper.getDataObjectClass();
-
-        // We check if the received QName / type is really Notification
-        if (Notification.class.isAssignableFrom(type)) {
-            Notification notification = (Notification) mapper
-                    .objectFromDom(biNotification);
-            notifyBindingAware(notification);
-        } else {
-            // The generated type for this QName does not inherits from
-            // notification something went wrong - generated APIs and/or 
-            // provider sending notification
-            // which was incorectly described in the YANG schema.
-            log.error("Received notification " + biType
-                    + " is not binded as notification");
-        }
-
-    }
-}
+/*\r
+ * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+package org.opendaylight.controller.sal.binding.impl;\r
+\r
+import java.util.Collection;\r
+import java.util.Collections;\r
+import java.util.HashSet;\r
+import java.util.Set;\r
+\r
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker;\r
+import org.opendaylight.controller.sal.binding.api.BindingAwareService;\r
+import org.opendaylight.controller.sal.binding.api.NotificationProviderService;\r
+import org.opendaylight.controller.sal.binding.api.NotificationService;\r
+import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerSession;\r
+import org.opendaylight.controller.sal.binding.spi.SALBindingModule;\r
+import org.opendaylight.controller.sal.binding.spi.Mapper;\r
+import org.opendaylight.controller.sal.binding.spi.MappingProvider;\r
+import org.opendaylight.controller.sal.binding.spi.MappingProvider.MappingExtensionFactory;\r
+\r
+import org.opendaylight.controller.sal.core.api.Broker.ProviderSession;\r
+import org.opendaylight.controller.yang.binding.DataObject;\r
+import org.opendaylight.controller.yang.binding.Notification;\r
+import org.opendaylight.controller.yang.binding.NotificationListener;\r
+import org.opendaylight.controller.yang.common.QName;\r
+import org.opendaylight.controller.yang.data.api.CompositeNode;\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+import com.google.common.collect.HashMultimap;\r
+import com.google.common.collect.Multimap;\r
+\r
+public class NotificationModule implements SALBindingModule {\r
+\r
+    private ProviderSession biSession;\r
+    private org.opendaylight.controller.sal.core.api.notify.NotificationProviderService biNotifyService;\r
+    private MappingProvider mappingProvider;\r
+\r
+    private Multimap<Class<? extends Notification>, NotificationListener> listeners = HashMultimap\r
+            .create();\r
+    private Set<QName> biNotifications = new HashSet<QName>();\r
+    private static final Logger log = LoggerFactory\r
+            .getLogger(NotificationModule.class);\r
+    private final BindingIndependentListener biListener = new BindingIndependentListener();\r
+    private BindingAwareBroker broker;\r
+\r
+    @Override\r
+    public Set<Class<? extends BindingAwareService>> getProvidedServices() {\r
+\r
+        Set<Class<? extends BindingAwareService>> ret = new HashSet<Class<? extends BindingAwareService>>();\r
+        ret.add(NotificationService.class);\r
+        ret.add(NotificationProviderService.class);\r
+        return ret;\r
+    }\r
+\r
+    @Override\r
+    public <T extends BindingAwareService> T getServiceForSession(\r
+            Class<T> service, ConsumerSession session) {\r
+        if (service == null)\r
+            throw new IllegalArgumentException("Service should not be null");\r
+        if (session == null)\r
+            throw new IllegalArgumentException("Session should not be null");\r
+\r
+        if (NotificationProviderSession.class.equals(service)) {\r
+            if (session instanceof org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderSession) {\r
+                @SuppressWarnings("unchecked")\r
+                T ret = (T) new NotificationProviderSession(session);\r
+                return ret;\r
+            } else {\r
+                throw new IllegalArgumentException(\r
+                        "NotificationProviderService is available only to ProviderSession");\r
+            }\r
+        }\r
+\r
+        if (NotificationService.class.equals(service)) {\r
+            @SuppressWarnings("unchecked")\r
+            T ret = (T) new NotificationSession(session);\r
+            return ret;\r
+        }\r
+        return null;\r
+    }\r
+\r
+    @Override\r
+    public Set<Class<? extends org.opendaylight.controller.sal.binding.api.BindingAwareProvider.ProviderFunctionality>> getSupportedProviderFunctionality() {\r
+        return Collections.emptySet();\r
+    }\r
+\r
+    @Override\r
+    public void setBroker(BindingAwareBroker broker) {\r
+        this.broker = broker;\r
+    }\r
+\r
+    @Override\r
+    public void setMappingProvider(MappingProvider provider) {\r
+        this.mappingProvider = provider;\r
+    }\r
+\r
+    @Override\r
+    public void onBISessionAvailable(ProviderSession session) {\r
+        biSession = session;\r
+        if (biSession != null) {\r
+            biNotifyService = session\r
+                    .getService(org.opendaylight.controller.sal.core.api.notify.NotificationProviderService.class);\r
+        }\r
+    }\r
+\r
+    private void notify(Notification notification) {\r
+        notifyBindingIndependent(notification);\r
+        notifyBindingAware(notification);\r
+    }\r
+\r
+    private void notifyBindingAware(Notification notification) {\r
+        Class<? extends Notification> type = notification.getClass();\r
+        Collection<NotificationListener> toNotify = listeners.get(type);\r
+\r
+        // Invocation of notification on registered listeners\r
+        if (toNotify != null) {\r
+\r
+            // We get factory for Notification Invoker\r
+            MappingExtensionFactory<NotificationInvoker> invokerFactory = mappingProvider\r
+                    .getExtensionFactory(NotificationInvoker.class);\r
+\r
+            // We get generated invoker for NoficiationListener interface\r
+            // associated to Notification Type\r
+            NotificationInvoker invoker = invokerFactory.forClass(type);\r
+            for (NotificationListener listener : toNotify) {\r
+                try {\r
+                    // Invoker invokes the right method on subtype of\r
+                    // NotificationListener\r
+                    // associated to the type of notification\r
+                    invoker.notify(notification, listener);\r
+                } catch (Exception e) {\r
+\r
+                }\r
+            }\r
+        }\r
+    }\r
+\r
+    private void notifyBindingIndependent(Notification notification) {\r
+        Class<? extends Notification> type = notification.getClass();\r
+\r
+        if (biSession == null) {\r
+            return;\r
+        }\r
+        if (biSession.isClosed()) {\r
+            return;\r
+        }\r
+        if (biNotifyService == null) {\r
+            return;\r
+        }\r
+\r
+        // FIXME: Somehow we need to resolve this for class hierarchy.\r
+        // probably use type.getInterfaces()\r
+        Mapper<? extends Notification> mapper = mappingProvider\r
+                .mapperForClass(type);\r
+        CompositeNode domNotification = mapper.domFromObject(notification);\r
+\r
+        biNotifyService.sendNotification(domNotification);\r
+    }\r
+\r
+    private void addBAListener(Class<? extends Notification> notificationType,\r
+            NotificationListener listener) {\r
+\r
+        listeners.put(notificationType, listener);\r
+        Mapper<? extends Notification> mapper = mappingProvider\r
+                .mapperForClass(notificationType);\r
+        QName biType = mapper.getQName();\r
+        if (false == biNotifications.contains(biType)) {\r
+            // The listener is not registered for binding independent\r
+            // notification\r
+            biNotifications.add(biType);\r
+\r
+            if (biNotifyService != null) {\r
+                biNotifyService.addNotificationListener(biType, biListener);\r
+            }\r
+        }\r
+\r
+    }\r
+\r
+    private void removeBAListener(\r
+            Class<? extends Notification> notificationType,\r
+            NotificationListener listener) {\r
+        listeners.remove(notificationType, listener);\r
+    }\r
+\r
+    private class NotificationSession implements NotificationService {\r
+        private final ConsumerSession session;\r
+        private Multimap<Class<? extends Notification>, NotificationListener> sessionListeners = HashMultimap\r
+                .create();\r
+\r
+        public NotificationSession(ConsumerSession session) {\r
+            this.session = session;\r
+        }\r
+\r
+        @Override\r
+        public void addNotificationListener(\r
+                Class<? extends Notification> notificationType,\r
+                NotificationListener listener) {\r
+\r
+            NotificationModule.this.addBAListener(notificationType, listener);\r
+            sessionListeners.put(notificationType, listener);\r
+\r
+        }\r
+\r
+        @Override\r
+        public void removeNotificationListener(\r
+                Class<? extends Notification> notificationType,\r
+                NotificationListener listener) {\r
+            sessionListeners.remove(notificationType, listener);\r
+            NotificationModule.this\r
+                    .removeBAListener(notificationType, listener);\r
+        }\r
+\r
+    }\r
+\r
+    private class NotificationProviderSession extends NotificationSession\r
+            implements NotificationProviderService {\r
+\r
+        public NotificationProviderSession(ConsumerSession session) {\r
+            super(session);\r
+        }\r
+\r
+        @Override\r
+        public void notify(Notification notification) {\r
+            NotificationModule.this.notify(notification);\r
+        }\r
+\r
+    }\r
+\r
+    private class BindingIndependentListener\r
+            implements\r
+            org.opendaylight.controller.sal.core.api.notify.NotificationListener {\r
+\r
+        @Override\r
+        public Set<QName> getSupportedNotifications() {\r
+            return biNotifications;\r
+        }\r
+\r
+        @Override\r
+        public void onNotification(CompositeNode notification) {\r
+            NotificationModule.this\r
+                    .onBindingIndependentNotification(notification);\r
+        }\r
+\r
+    }\r
+\r
+    private void onBindingIndependentNotification(CompositeNode biNotification) {\r
+        QName biType = biNotification.getNodeType();\r
+\r
+        Mapper<DataObject> mapper = mappingProvider.mapperForQName(biType);\r
+        if (mapper == null) {\r
+            log.info("Received notification does not have a binding defined.");\r
+            return;\r
+        }\r
+        Class<DataObject> type = mapper.getDataObjectClass();\r
+\r
+        // We check if the received QName / type is really Notification\r
+        if (Notification.class.isAssignableFrom(type)) {\r
+            Notification notification = (Notification) mapper\r
+                    .objectFromDom(biNotification);\r
+            notifyBindingAware(notification);\r
+        } else {\r
+            // The generated type for this QName does not inherits from\r
+            // notification something went wrong - generated APIs and/or\r
+            // provider sending notification\r
+            // which was incorectly described in the YANG schema.\r
+            log.error("Received notification " + biType\r
+                    + " is not binded as notification");\r
+        }\r
+\r
+    }\r
+}\r
index 131c00dc2ab30ae7264240931bf0ec566bda7c4e..d81c6ac2ff9ad30a523c6814bf06effea2563330 100644 (file)
                <dependency>\r
                        <groupId>org.slf4j</groupId>\r
                        <artifactId>slf4j-api</artifactId>\r
-                       <version>1.6.4</version>\r
+               </dependency>\r
+               <dependency>\r
+                       <groupId>com.google.guava</groupId>\r
+                       <artifactId>guava</artifactId>\r
+                       <type>jar</type>\r
                </dependency>\r
        </dependencies>
 </project>
\ No newline at end of file
index 97879fb969d9a96ede9e04c806f06798bd1e63ea..84bc0569504272704d3ea68605d42f6c13de0afe 100644 (file)
@@ -12,7 +12,6 @@ import java.util.HashMap;
 import java.util.HashSet;\r
 import java.util.Map;\r
 import java.util.Set;\r
-import java.util.concurrent.ExecutorService;\r
 import java.util.concurrent.Future;\r
 \r
 import org.opendaylight.controller.sal.core.api.Broker;\r
diff --git a/opendaylight/sal/yang-prototype/sal/sal-broker-impl/src/main/java/org/opendaylight/controller/sal/core/impl/Utils.java b/opendaylight/sal/yang-prototype/sal/sal-broker-impl/src/main/java/org/opendaylight/controller/sal/core/impl/Utils.java
deleted file mode 100644 (file)
index 810049f..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*\r
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.\r
- *\r
- * This program and the accompanying materials are made available under the\r
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
- * and is available at http://www.eclipse.org/legal/epl-v10.html\r
- */\r
-package org.opendaylight.controller.sal.core.impl;\r
-\r
-import java.util.ArrayList;\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-import org.opendaylight.controller.yang.common.QName;\r
-\r
-\r
-public class Utils {\r
-\r
-    public static <T> void addToMap(Map<QName, List<T>> map, QName key, T value) {\r
-        List<T> list = map.get(key);\r
-        if (list == null) {\r
-            list = new ArrayList<T>();\r
-            map.put(key, list);\r
-        }\r
-        list.add(value);\r
-    }\r
-\r
-    public static <T> void removeFromMap(Map<QName, List<T>> map, QName key,\r
-            T value) {\r
-        List<T> list = map.get(key);\r
-        if (list == null) {\r
-            return;\r
-        }\r
-        list.remove(value);\r
-        if (list.isEmpty()) {\r
-            map.remove(key);\r
-        }\r
-    }\r
-}\r
-
index fd19e7e6bc2ef50bd8c787bcdee94a04be810189..8f9632be9e3a843a1d15f5b38c78640cbfe883e2 100644 (file)
@@ -7,10 +7,9 @@
  */\r
 package org.opendaylight.controller.sal.core.impl.notify;\r
 \r
+import java.util.Collection;\r
 import java.util.Collections;\r
-import java.util.HashMap;\r
 import java.util.HashSet;\r
-import java.util.List;\r
 import java.util.Map;\r
 import java.util.Map.Entry;\r
 import java.util.Set;\r
@@ -24,28 +23,30 @@ import org.opendaylight.controller.sal.core.api.notify.NotificationListener;
 import org.opendaylight.controller.sal.core.api.notify.NotificationProviderService;\r
 import org.opendaylight.controller.sal.core.api.notify.NotificationService;\r
 import org.opendaylight.controller.sal.core.impl.BrokerServiceImpl;\r
-import org.opendaylight.controller.sal.core.impl.Utils;\r
 import org.opendaylight.controller.sal.core.spi.BrokerModule;\r
 import org.opendaylight.controller.yang.common.QName;\r
 import org.opendaylight.controller.yang.data.api.CompositeNode;\r
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
 \r
-\r
+import com.google.common.collect.HashMultimap;\r
+import com.google.common.collect.ImmutableSet;\r
+import com.google.common.collect.Multimap;\r
 \r
 public class NotificationModule implements BrokerModule {\r
     private static Logger log = LoggerFactory\r
             .getLogger(NotificationModule.class);\r
 \r
-    private Map<QName, List<NotificationListener>> listeners = new HashMap<QName, List<NotificationListener>>();\r
+    private Multimap<QName, NotificationListener> listeners = HashMultimap\r
+            .create();\r
+\r
+    private static final Set<Class<? extends BrokerService>> providedServices = ImmutableSet\r
+            .of((Class<? extends BrokerService>) NotificationService.class,\r
+                    NotificationProviderService.class);\r
 \r
     @Override\r
     public Set<Class<? extends BrokerService>> getProvidedServices() {\r
-        // FIXME Refactor\r
-        Set<Class<? extends BrokerService>> ret = new HashSet<Class<? extends BrokerService>>();\r
-        ret.add(NotificationService.class);\r
-        ret.add(NotificationProviderService.class);\r
-        return ret;\r
+        return providedServices;\r
     }\r
 \r
     @Override\r
@@ -77,7 +78,7 @@ public class NotificationModule implements BrokerModule {
 \r
     private void sendNotification(CompositeNode notification) {\r
         QName type = notification.getNodeType();\r
-        List<NotificationListener> toNotify = listeners.get(type);\r
+        Collection<NotificationListener> toNotify = listeners.get(type);\r
         log.info("Publishing notification " + type);\r
 \r
         if (toNotify == null) {\r
@@ -109,7 +110,8 @@ public class NotificationModule implements BrokerModule {
     private class NotificationConsumerSessionImpl extends BrokerServiceImpl\r
             implements NotificationService {\r
 \r
-        Map<QName, List<NotificationListener>> consumerListeners = new HashMap<QName, List<NotificationListener>>();\r
+        private Multimap<QName, NotificationListener> consumerListeners = HashMultimap\r
+                .create();\r
         private boolean closed = false;\r
 \r
         @Override\r
@@ -124,8 +126,8 @@ public class NotificationModule implements BrokerModule {
                 throw new IllegalArgumentException("Listener must not be null.");\r
             }\r
 \r
-            Utils.addToMap(consumerListeners, notification, listener);\r
-            Utils.addToMap(listeners, notification, listener);\r
+            consumerListeners.put(notification, listener);\r
+            listeners.put(notification, listener);\r
             log.info("Registered listener for notification: " + notification);\r
         }\r
 \r
@@ -140,17 +142,18 @@ public class NotificationModule implements BrokerModule {
             if (listener == null) {\r
                 throw new IllegalArgumentException("Listener must not be null.");\r
             }\r
-            Utils.removeFromMap(consumerListeners, notification, listener);\r
-            Utils.removeFromMap(listeners, notification, listener);\r
+            consumerListeners.remove(notification, listener);\r
+            listeners.remove(notification, listener);\r
         }\r
 \r
         @Override\r
         public void closeSession() {\r
             closed = true;\r
-            Set<Entry<QName, List<NotificationListener>>> toRemove = consumerListeners\r
-                    .entrySet();\r
-            for (Entry<QName, List<NotificationListener>> entry : toRemove) {\r
-                listeners.get(entry.getKey()).removeAll(entry.getValue());\r
+            Map<QName, Collection<NotificationListener>> toRemove = consumerListeners\r
+                    .asMap();\r
+            for (Entry<QName, Collection<NotificationListener>> entry : toRemove\r
+                    .entrySet()) {\r
+                listeners.remove(entry.getKey(), entry.getValue());\r
             }\r
         }\r
 \r
@@ -179,4 +182,3 @@ public class NotificationModule implements BrokerModule {
         return Collections.emptySet();\r
     }\r
 }\r
-
index 00360c3e2b7ab637594bc16d8b0b9ca153091df0..3500cd2eafa662b3c218ae5023990d5fda42867e 100644 (file)
@@ -94,7 +94,7 @@
                                                        org.springframework.security.web.authentication.logout,
                                                        org.springframework.dao
                                                </Import-Package>
-                                               <Web-ContextPath>/one/devices</Web-ContextPath>
+                                               <Web-ContextPath>/controller/web/devices</Web-ContextPath>
                                        </instructions>
                                </configuration>
                        </plugin>
index 641042c53f76dc51768248d714cac5c8a43b2c36..18ac6e7ecb1cc84d7f3b85ecbb74207a713382a5 100644 (file)
@@ -10,9 +10,9 @@
        <http pattern="/js/**" security="none" />
        <http pattern="/images/**" security="none" />
        <http pattern="/favicon.ico" security="none" />
-       <http pattern="/one/css/**" security="none" />
-       <http pattern="/one/js/**" security="none" />
-       <http pattern="/one/images/**" security="none" />
+       <http pattern="/controller/web/css/**" security="none" />
+       <http pattern="/controller/web/js/**" security="none" />
+       <http pattern="/controller/web/images/**" security="none" />
 
 
        <http auto-config="false" authentication-manager-ref="authenticationManager"
index 57ca7b3f8186c046533b34c975abfda37b71befc..d21f8d83a79d2d9ec52ca365289dc8d442b5bc6d 100644 (file)
@@ -50,7 +50,7 @@ one.f.menu = {
 
 /**Devices Modules */
 one.f.switchmanager = {
-       rootUrl: "one/devices",
+       rootUrl: "controller/web/devices",
        createTable: function(columnNames, body) {
                var tableAttributes = ["table-striped", "table-bordered", "table-condensed"];
                var $table = one.lib.dashlet.table.table(tableAttributes);
index 62c8922eadedc851a9c25c57a61db8ef5b61bbe0..891f951f503f8781fe15f3056136b461d9112ef2 100644 (file)
@@ -94,7 +94,7 @@
                                                        org.springframework.security.web.authentication.logout,
                                                        org.springframework.dao\r
                                                </Import-Package>
-                                               <Web-ContextPath>/one/flows</Web-ContextPath>
+                                               <Web-ContextPath>/controller/web/flows</Web-ContextPath>
                                        </instructions>
                                </configuration>
                        </plugin>
index 641042c53f76dc51768248d714cac5c8a43b2c36..18ac6e7ecb1cc84d7f3b85ecbb74207a713382a5 100644 (file)
@@ -10,9 +10,9 @@
        <http pattern="/js/**" security="none" />
        <http pattern="/images/**" security="none" />
        <http pattern="/favicon.ico" security="none" />
-       <http pattern="/one/css/**" security="none" />
-       <http pattern="/one/js/**" security="none" />
-       <http pattern="/one/images/**" security="none" />
+       <http pattern="/controller/web/css/**" security="none" />
+       <http pattern="/controller/web/js/**" security="none" />
+       <http pattern="/controller/web/images/**" security="none" />
 
 
        <http auto-config="false" authentication-manager-ref="authenticationManager"
index 13884fbb8387f426de7f73010e0072291ec70cd2..c24b9d1346e6f172beedf386e82008c073f3a58c 100644 (file)
@@ -44,7 +44,7 @@ one.f.menu = {
 };
 
 one.f.address = {
-    root : "/one/flows",
+    root : "/controller/web/flows",
     flows : {
         main : "/main",
                flows : "/node-flows",
index 641042c53f76dc51768248d714cac5c8a43b2c36..18ac6e7ecb1cc84d7f3b85ecbb74207a713382a5 100644 (file)
@@ -10,9 +10,9 @@
        <http pattern="/js/**" security="none" />
        <http pattern="/images/**" security="none" />
        <http pattern="/favicon.ico" security="none" />
-       <http pattern="/one/css/**" security="none" />
-       <http pattern="/one/js/**" security="none" />
-       <http pattern="/one/images/**" security="none" />
+       <http pattern="/controller/web/css/**" security="none" />
+       <http pattern="/controller/web/js/**" security="none" />
+       <http pattern="/controller/web/images/**" security="none" />
 
 
        <http auto-config="false" authentication-manager-ref="authenticationManager"
index df36ea4b572229117927f61bb569fa800ad470ca..fc06a8c9882ec2e20aec2c75563a10ceda3422e4 100644 (file)
@@ -134,7 +134,7 @@ one.topology.init = function(json) {
                                var data = {};
                                data['x'] = ps.x;
                                data['y'] = ps.y;
-                               $.post('/one/topology/node/' + did, data);
+                               $.post('/controller/web/topology/node/' + did, data);
                        },
                        onClick: function(node, eventInfo, e) {
                                return false;
@@ -207,12 +207,12 @@ one.topology.init = function(json) {
 
 one.topology.update = function() {
        $('#topology').empty();
-       $.getJSON(one.global.remoteAddress+"one/topology/visual.json", function(data) {
+       $.getJSON(one.global.remoteAddress+"controller/web/topology/visual.json", function(data) {
                one.topology.init(data);
        });
 }
 
 /** INIT */
-$.getJSON(one.global.remoteAddress+"one/topology/visual.json", function(data) {
+$.getJSON(one.global.remoteAddress+"controller/web/topology/visual.json", function(data) {
        one.topology.init(data);
 });
\ No newline at end of file
index d582a9da56b3a30ee19ae9e5aa580e3f98b44b50..b996e732332af1d821b6e92c28ab6f4f6d993484 100644 (file)
@@ -290,7 +290,7 @@ one.main = {};
 one.main.constants = {
     address : {
         menu : "/web.json",
-        prefix : "/one",
+        prefix : "/controller/web",
         save : "/save"
     }
 }
index f4533588ecc2363e346e94c3c9d3e514201f5482..daef22cf23675ef4b1e1d27bbd07d5aab3ce6187 100644 (file)
@@ -97,7 +97,7 @@
                                                        org.springframework.security.web.authentication.logout,
                                                        org.springframework.dao
                                                </Import-Package>
-                                               <Web-ContextPath>/one/topology</Web-ContextPath>
+                                               <Web-ContextPath>/controller/web/topology</Web-ContextPath>
                                        </instructions>
                                </configuration>
                        </plugin>
index 56302def77247de9d498bd8524f58e7086563bc7..6ddae0119bd6f962003c2e411ea7beaaa88d2558 100644 (file)
@@ -10,9 +10,9 @@
        <http pattern="/js/**" security="none" />
        <http pattern="/images/**" security="none" />
        <http pattern="/favicon.ico" security="none" />
-       <http pattern="/one/css/**" security="none" />
-       <http pattern="/one/js/**" security="none" />
-       <http pattern="/one/images/**" security="none" />
+       <http pattern="/controller/web/css/**" security="none" />
+       <http pattern="/controller/web/js/**" security="none" />
+       <http pattern="/controller/web/images/**" security="none" />
 
 
        <http auto-config="false" authentication-manager-ref="authenticationManager"
index 0fa2ddac9af628f5cf744eeae562e1ba095efaf6..8aab6d5fb781e5b5c6e3032b1ac9b172ddda7c3d 100644 (file)
@@ -96,7 +96,7 @@
                                                        org.springframework.security.web.authentication.logout,
                                                        org.springframework.dao
                                                </Import-Package>
-                                               <Web-ContextPath>/one/troubleshoot</Web-ContextPath>
+                                               <Web-ContextPath>/controller/web/troubleshoot</Web-ContextPath>
                                        </instructions>
                                </configuration>
                        </plugin>
index 641042c53f76dc51768248d714cac5c8a43b2c36..18ac6e7ecb1cc84d7f3b85ecbb74207a713382a5 100644 (file)
@@ -10,9 +10,9 @@
        <http pattern="/js/**" security="none" />
        <http pattern="/images/**" security="none" />
        <http pattern="/favicon.ico" security="none" />
-       <http pattern="/one/css/**" security="none" />
-       <http pattern="/one/js/**" security="none" />
-       <http pattern="/one/images/**" security="none" />
+       <http pattern="/controller/web/css/**" security="none" />
+       <http pattern="/controller/web/js/**" security="none" />
+       <http pattern="/controller/web/images/**" security="none" />
 
 
        <http auto-config="false" authentication-manager-ref="authenticationManager"
index dba84771f00d9b8ab1c8af7fc34e42b1d0c075f2..e258b4003e18c091805aaee58effaa08f23f66ea 100644 (file)
@@ -63,7 +63,7 @@ $(one.f.menu.right.bottom).each(function(index, value) {
 
 /**Troubleshoot modules*/
 one.f.troubleshooting = {
-       rootUrl: "/one/troubleshoot",
+       rootUrl: "/controller/web/troubleshoot",
        rightBottomDashlet: { 
                get: function() {
                        var $rightBottomDashlet = $("#right-bottom").find(".dashlet");