Merge "Add snapshots/releases setting to all maven repos."
authorGiovanni Meo <gmeo@cisco.com>
Mon, 9 Sep 2013 20:11:46 +0000 (20:11 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Mon, 9 Sep 2013 20:11:46 +0000 (20:11 +0000)
42 files changed:
opendaylight/commons/opendaylight/pom.xml
opendaylight/configuration/integrationtest/src/test/java/org/opendaylight/controller/configuration/internal/ConfigurationIT.java
opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini
opendaylight/forwardingrulesmanager/integrationtest/src/test/java/org/opendaylight/controller/forwardingrulesmanager/internal/ForwardingRulesManagerIT.java
opendaylight/hosttracker/api/src/main/java/org/opendaylight/controller/hosttracker/IfIptoHost.java
opendaylight/hosttracker/implementation/src/main/java/org/opendaylight/controller/hosttracker/internal/HostTracker.java
opendaylight/hosttracker/integrationtest/src/test/java/org/opendaylight/controller/hosttracker/internal/HostTrackerIT.java
opendaylight/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/RestMessages.java
opendaylight/northbound/hosttracker/src/main/java/org/opendaylight/controller/hosttracker/northbound/HostTrackerNorthbound.java
opendaylight/northbound/integrationtest/pom.xml
opendaylight/northbound/integrationtest/src/test/java/org/opendaylight/controller/northbound/integrationtest/NorthboundIT.java
opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/SwitchNorthbound.java
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Actions.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Bandwidth.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Buffers.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Capabilities.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Config.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Description.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/ForwardingMode.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Latency.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/MacAddress.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Name.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Property.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/State.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Tables.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/Tier.java
opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/core/TimeStamp.java
opendaylight/statisticsmanager/integrationtest/src/test/java/org/opendaylight/controller/statisticsmanager/internal/StatisticsManagerIT.java
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManager.java
opendaylight/switchmanager/implementation/src/main/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerCLI.java
opendaylight/switchmanager/integrationtest/src/test/java/org/opendaylight/controller/switchmanager/internal/SwitchManagerIT.java
opendaylight/web/devices/src/main/resources/js/page.js
opendaylight/web/root/pom.xml
opendaylight/web/root/src/main/java/org/opendaylight/controller/web/ClusterNodeBean.java [new file with mode: 0644]
opendaylight/web/root/src/main/java/org/opendaylight/controller/web/DaylightWebAdmin.java
opendaylight/web/root/src/main/java/org/opendaylight/controller/web/NodeBean.java [new file with mode: 0644]
opendaylight/web/root/src/main/resources/WEB-INF/jsp/main.jsp
opendaylight/web/root/src/main/resources/css/one.less
opendaylight/web/root/src/main/resources/img/topology_view_1033_16.png [new file with mode: 0644]
opendaylight/web/root/src/main/resources/js/lib.js
opendaylight/web/root/src/main/resources/js/open.js

index 75b78cf015d08759e247a15da5691f39020e331b..f6282d86a2e1e11967521e76aa277fabcd8a406d 100644 (file)
         </configuration>
         <executions>
           <execution>
+            <id>failsafe-integration-tests</id>
+            <phase>integration-test</phase>
             <goals>
               <goal>integration-test</goal>
             </goals>
           </execution>
+          <execution>
+            <id>failsafe-verify</id>
+            <phase>verify</phase>
+            <goals>
+              <goal>verify</goal>
+            </goals>
+          </execution>
         </executions>
       </plugin>
       <plugin>
index 956028b73c09b40029d9ef3a8140bc14d5e4ebca..a2f22973255f7e4bfb10ce911e0d1d8682a00923 100644 (file)
@@ -16,7 +16,6 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.opendaylight.controller.clustering.services.IClusterServices;
 import org.opendaylight.controller.configuration.IConfigurationService;
 import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.Status;
@@ -38,7 +37,6 @@ public class ConfigurationIT {
     // get the OSGI bundle context
     @Inject
     private BundleContext bc;
-    private IClusterServices clusterService = null;
     private IConfigurationService configService = null;
 
     // Configure the OSGi container
@@ -53,59 +51,34 @@ public class ConfigurationIT {
                 // Set the systemPackages (used by clustering)
                 systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
                 // List framework bundles
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console",
-                        "1.0.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util",
-                        "1.0.400.v20120522-2049"),
-                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services",
-                        "3.3.100.v20120522-1822"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds",
-                        "1.4.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command",
-                        "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime",
-                        "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell",
-                        "0.8.0.v201110170705"),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject(),
                 // List logger bundles
-                mavenBundle("org.slf4j", "slf4j-api", "1.7.2"),
-                mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.2"),
-                mavenBundle("ch.qos.logback", "logback-core", "1.0.9"),
-                mavenBundle("ch.qos.logback", "logback-classic", "1.0.9"),
-                mavenBundle("org.apache.commons", "commons-lang3", "3.1"),
-                mavenBundle("org.jboss.spec.javax.transaction",
-                        "jboss-transaction-api_1.1_spec", "1.0.1.Final"),
+                mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
+                mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),
+                mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),
+                mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
+                mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),
+                mavenBundle("org.jboss.spec.javax.transaction", "jboss-transaction-api_1.1_spec").versionAsInProject(),
                 mavenBundle("eclipselink", "javax.resource").versionAsInProject(),
-                mavenBundle("org.apache.felix",
-                        "org.apache.felix.dependencymanager", "3.1.0"),
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
                 // List all the bundles on which the test case depends
-                mavenBundle("org.opendaylight.controller", "sal",
-                        "0.5.0-SNAPSHOT"), // SAL connects the protocols
-                                           // plug-ins to other stuff
-                mavenBundle("org.opendaylight.controller",
-                        "sal.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller",
-                        "protocol_plugins.stub", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller", "sal").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "protocol_plugins.stub").versionAsInProject(),
                 // needed bundles by switchmanager
-                mavenBundle("org.opendaylight.controller", "containermanager",
-                        "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller",
-                        "containermanager.implementation", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller", "containermanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "containermanager.implementation").versionAsInProject(),
                 // needed bundles by configuration
-                mavenBundle("org.opendaylight.controller",
-                        "clustering.services", "0.4.0-SNAPSHOT"), // what are
-                                                                  // the
-                                                                  // clustering
-                                                                  // services
-                                                                  // for
-                mavenBundle("org.opendaylight.controller", "clustering.stub",
-                        "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller",
-                        "clustering.services-implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "configuration",
-                        "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller",
-                        "configuration.implementation", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller", "clustering.services").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "clustering.stub").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "configuration").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "configuration.implementation").versionAsInProject(),
                 junitBundles());
     }
 
@@ -143,14 +116,6 @@ public class ConfigurationIT {
 
         // Assert if true, if false we are good to go!
         assertFalse(debugit);
-        ServiceReference r = bc.getServiceReference(IClusterServices.class
-                .getName());
-        if (r != null) {
-            this.clusterService = (IClusterServices) bc.getService(r);
-        }
-        // If StatisticsManager is null, cannot run tests.
-        assertNotNull(this.clusterService);
-
     }
 
     @Before
index 5501be46b2e59afb2743d70aad90c549ad5a4ae7..ba1a54b662f3f4c68d328bc5390c57239c2d451e 100644 (file)
@@ -70,8 +70,8 @@ org.eclipse.gemini.web.tomcat.config.path=configuration/tomcat-server.xml
 # of.discoveryTimeoutMultiple=2
 # For newly added ports, allow one more retry if the elapsed time exceeds this threshold (default 30 sec)
 # of.discoveryThreshold=30
-# The maximum number of ports handled in one discovery batch (default 1024)
-# of.discoveryBatchMaxPorts=1024
+# The maximum number of ports handled in one discovery batch (default 512)
+# of.discoveryBatchMaxPorts=512
 
 # TLS configuration
 # To enable TLS, set secureChannelEnabled=true and specify the location of controller Java KeyStore and TrustStore files.
index 67377c1ccadacf52e3841b0d9ac40046e2eeb233..4fc3afc726e1b5fdcd4c6f0d6399210cb4b4a66f 100644 (file)
@@ -63,20 +63,13 @@ public class ForwardingRulesManagerIT {
                 // Set the systemPackages (used by clustering)
                 systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
                 // List framework bundles
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console",
-                        "1.0.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util",
-                        "1.0.400.v20120522-2049"),
-                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services",
-                        "3.3.100.v20120522-1822"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds",
-                        "1.4.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command",
-                        "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime",
-                        "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell",
-                        "0.8.0.v201110170705"),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject(),
                 // List logger bundles
                 mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
                 mavenBundle("org.slf4j", "log4j-over-slf4j")
index 995ee575152f35f4f93bfe4983df771245af7d08..2451e196f2eaf962a32d8cc53db9b0983b206bcc 100644 (file)
@@ -120,7 +120,7 @@ public interface IfIptoHost {
      * @param nc
      *            NodeConnector to which the host is attached
      * @param vlan
-     *            VLAN the host belongs to
+     *            VLAN the host belongs to (null or empty for no vlan)
      * @return The status object as described in {@code Status} indicating the
      *         result of this action.
      */
index e4704d30489b2a212538ebc1d1503a95b4064784..9f0cd893b09902a2781fb82480cee345413847b4 100644 (file)
@@ -307,7 +307,7 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
     @Override
     public Future<HostNodeConnector> discoverHost(InetAddress networkAddress) {
         if (executor == null) {
-            logger.error("discoverHost: Null executor");
+            logger.debug("discoverHost: Null executor");
             return null;
         }
         Callable<HostNodeConnector> worker = new HostTrackerCallable(this, networkAddress);
@@ -348,12 +348,7 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
 
     @Override
     public Set<HostNodeConnector> getAllHosts() {
-        Set<HostNodeConnector> allHosts = new HashSet<HostNodeConnector>();
-        for (Entry<InetAddress, HostNodeConnector> entry : hostsDB.entrySet()) {
-            HostNodeConnector host = entry.getValue();
-            allHosts.add(host);
-        }
-        logger.debug("Exiting getAllHosts, Found {} Hosts", allHosts.size());
+        Set<HostNodeConnector> allHosts = new HashSet<HostNodeConnector>(hostsDB.values());
         return allHosts;
     }
 
@@ -366,17 +361,12 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
                 list.add(host);
             }
         }
-        logger.debug("getActiveStaticHosts(): Found {} Hosts", list.size());
         return list;
     }
 
     @Override
     public Set<HostNodeConnector> getInactiveStaticHosts() {
-        Set<HostNodeConnector> list = new HashSet<HostNodeConnector>();
-        for (Entry<NodeConnector, HostNodeConnector> entry : inactiveStaticHosts.entrySet()) {
-            list.add(entry.getValue());
-        }
-        logger.debug("getInactiveStaticHosts(): Found {} Hosts", list.size());
+        Set<HostNodeConnector> list = new HashSet<HostNodeConnector>(inactiveStaticHosts.values());
         return list;
     }
 
@@ -549,7 +539,7 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
                             ta.notifyHTClientHostRemoved(host);
                         }
                     } catch (Exception e) {
-                        logger.error("Exception on callback", e);
+                        logger.error("Exception on new host notification", e);
                     }
                 }
             }
@@ -1034,7 +1024,7 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
                          * probe. However, continue the age out the hosts since
                          * we don't know if the host is indeed out there or not.
                          */
-                        logger.warn("ARPHandler is not avaialable, can't send the probe");
+                        logger.trace("ARPHandler is not avaialable, can't send the probe");
                         continue;
                     }
                     hostFinder.probe(host);
@@ -1062,7 +1052,7 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
      *         indicating the result of this action.
      */
 
-    public Status addStaticHostReq(InetAddress networkAddr, byte[] dataLayerAddress, NodeConnector nc, short vlan) {
+    protected Status addStaticHostReq(InetAddress networkAddr, byte[] dataLayerAddress, NodeConnector nc, short vlan) {
         if (dataLayerAddress.length != NetUtils.MACAddrLengthInBytes) {
             return new Status(StatusCode.BADREQUEST, "Invalid MAC address");
         }
@@ -1078,13 +1068,13 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
                 // northbound request
                 HostNodeConnector transHost = hostsDB.get(networkAddr);
                 transHost.setStaticHost(true);
-                return new Status(StatusCode.SUCCESS, null);
+                return new Status(StatusCode.SUCCESS);
             }
 
             if (hostsDB.get(networkAddr) != null) {
                 // There is already a host with this IP address (but behind
                 // a different (switch, port, vlan) tuple. Return an error
-                return new Status(StatusCode.CONFLICT, "Existing IP, Use PUT to update");
+                return new Status(StatusCode.CONFLICT, "Host with this IP already exists.");
             }
             host.setStaticHost(true);
             /*
@@ -1108,7 +1098,7 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
                 logger.debug("Switch or switchport is not up, adding host {} to inactive list",
                         networkAddr.getHostName());
             }
-            return new Status(StatusCode.SUCCESS, null);
+            return new Status(StatusCode.SUCCESS);
         } catch (ConstructionException e) {
             logger.error("", e);
             return new Status(StatusCode.INTERNALERROR, "Host could not be created");
@@ -1291,25 +1281,33 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
     public Status addStaticHost(String networkAddress, String dataLayerAddress, NodeConnector nc, String vlan) {
         try {
             InetAddress ip = InetAddress.getByName(networkAddress);
-            if (nc == null) {
-                return new Status(StatusCode.BADREQUEST, "Invalid NodeId");
+            short vl = 0;
+            if (vlan != null && !vlan.isEmpty()) {
+                vl = Short.decode(vlan);
+                if (vl < 1 || vl > 4095) {
+                    return new Status(StatusCode.BADREQUEST, "Host vlan out of range [1 - 4095]");
+                }
             }
-            return addStaticHostReq(ip, HexEncode.bytesFromHexString(dataLayerAddress), nc, Short.valueOf(vlan));
+
+            return addStaticHostReq(ip, HexEncode.bytesFromHexString(dataLayerAddress), nc, vl);
+
         } catch (UnknownHostException e) {
-            logger.error("", e);
-            return new Status(StatusCode.BADREQUEST, "Invalid Address");
+            logger.debug("Invalid host IP specified when adding static host", e);
+            return new Status(StatusCode.BADREQUEST, "Invalid Host IP Address");
+        } catch (NumberFormatException nfe) {
+            logger.debug("Invalid host vlan or MAC specified when adding static host", nfe);
+            return new Status(StatusCode.BADREQUEST, "Invalid Host vLan/MAC");
         }
     }
 
     @Override
     public Status removeStaticHost(String networkAddress) {
-        InetAddress address;
         try {
-            address = InetAddress.getByName(networkAddress);
+            InetAddress address = InetAddress.getByName(networkAddress);
             return removeStaticHostReq(address);
         } catch (UnknownHostException e) {
-            logger.error("", e);
-            return new Status(StatusCode.BADREQUEST, "Invalid Address");
+            logger.debug("Invalid IP Address when trying to remove host", e);
+            return new Status(StatusCode.BADREQUEST, "Invalid IP Address when trying to remove host");
         }
     }
 
@@ -1317,11 +1315,11 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
         ARPPending arphost;
         HostNodeConnector host = null;
 
-        logger.debug("handleNodeConnectorStatusUp {}", nodeConnector);
+        logger.trace("handleNodeConnectorStatusUp {}", nodeConnector);
 
         for (Entry<InetAddress, ARPPending> entry : failedARPReqList.entrySet()) {
             arphost = entry.getValue();
-            logger.debug("Sending the ARP from FailedARPReqList fors IP: {}", arphost.getHostIP().getHostAddress());
+            logger.trace("Sending the ARP from FailedARPReqList fors IP: {}", arphost.getHostIP().getHostAddress());
             if (hostFinder == null) {
                 logger.warn("ARPHandler is not available at interface  up");
                 logger.warn("Since this event is missed, host(s) connected to interface {} may not be discovered",
@@ -1340,7 +1338,6 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
                         arphost.getHostIP(), nodeConnector);
                 logger.error("", e);
             }
-            logger.debug("Done. handleNodeConnectorStatusUp {}", nodeConnector);
         }
 
         host = inactiveStaticHosts.get(nodeConnector);
@@ -1353,7 +1350,7 @@ public class HostTracker implements IfIptoHost, IfHostListener, ISwitchManagerAw
     }
 
     private void handleNodeConnectorStatusDown(NodeConnector nodeConnector) {
-        logger.debug("handleNodeConnectorStatusDown {}", nodeConnector);
+        logger.trace("handleNodeConnectorStatusDown {}", nodeConnector);
 
         for (Entry<InetAddress, HostNodeConnector> entry : hostsDB.entrySet()) {
             HostNodeConnector host = entry.getValue();
index 3734a63e56c5106c58efdbe5145304fc657f1db6..57e2714ff1c23bf3aded4c40d4b98ae96ed0135c 100644 (file)
@@ -69,13 +69,13 @@ public class HostTrackerIT {
                 // Set the systemPackages (used by clustering)
                 systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
                 // List framework bundles
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console", "1.0.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util", "1.0.400.v20120522-2049"),
-                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services","3.3.100.v20120522-1822"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds", "1.4.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command", "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime", "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell", "0.8.0.v201110170705"),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject(),
                 // List logger bundles
                 mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
                 mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),
@@ -174,9 +174,9 @@ public class HostTrackerIT {
         NodeConnector nc1_2 = NodeConnectorCreator.createOFNodeConnector((short) 2, node1);
 
         // test addStaticHost(), store into inactive host DB
-        Status st = this.hosttracker.addStaticHost("192.168.0.8", "11:22:33:44:55:66", nc1_1, "0");
+        Status st = this.hosttracker.addStaticHost("192.168.0.8", "11:22:33:44:55:66", nc1_1, null);
         Assert.assertTrue(st.isSuccess());
-        st = this.hosttracker.addStaticHost("192.168.0.13", "11:22:33:44:55:77", nc1_2, "0");
+        st = this.hosttracker.addStaticHost("192.168.0.13", "11:22:33:44:55:77", nc1_2, "");
         Assert.assertTrue(st.isSuccess());
 
         // check inactive DB
@@ -213,8 +213,11 @@ public class HostTrackerIT {
         NodeConnector nc1_2 = NodeConnectorCreator.createOFNodeConnector((short) 2, node1);
 
         // test addStaticHost(), put into inactive host DB if not verifiable
-        Status st = this.hosttracker.addStaticHost("192.168.0.8", "11:22:33:44:55:66", nc1_1, "0");
+        Status st = this.hosttracker.addStaticHost("192.168.0.8", "11:22:33:44:55:66", nc1_1, null);
+        Assert.assertTrue(st.isSuccess());
         st = this.hosttracker.addStaticHost("192.168.0.13", "11:22:33:44:55:77", nc1_2, "0");
+        Assert.assertFalse(st.isSuccess());
+
 
         this.invtoryListener.notifyNodeConnector(nc1_1, UpdateType.ADDED, null);
 
@@ -251,8 +254,8 @@ public class HostTrackerIT {
         NodeConnector nc1_2 = NodeConnectorCreator.createOFNodeConnector((short) 2, node1);
 
         // test addStaticHost(), put into inactive host DB if not verifiable
-        Status st = this.hosttracker.addStaticHost("192.168.0.8", "11:22:33:44:55:66", nc1_1, "0");
-        st = this.hosttracker.addStaticHost("192.168.0.13", "11:22:33:44:55:77", nc1_2, "0");
+        Status st = this.hosttracker.addStaticHost("192.168.0.8", "11:22:33:44:55:66", nc1_1, null);
+        st = this.hosttracker.addStaticHost("192.168.0.13", "11:22:33:44:55:77", nc1_2, "");
 
         HostNodeConnector hnc_1 = this.hosttracker.hostFind(InetAddress.getByName("192.168.0.8"));
         assertNull(hnc_1);
index 668efbc7ee3868b2ea3b8e1c22a3ce9c9b305e78..ba2476a137a249ebdf5b53981f866cf32714aa43 100644 (file)
@@ -15,7 +15,7 @@ public enum RestMessages {
             "Operation failed due to Resource Conflict"), NODEFAULT("Container default is not a custom container"), DEFAULTDISABLED(
             "Container(s) are configured. Container default is not operational"), NOTALLOWEDONDEFAULT(
             "Container default is a static resource, no modification allowed on it"), UNKNOWNACTION("Unknown action"), INVALIDJSON(
-            "JSON message is invalid"), INVALIDADDRESS("invalid InetAddress"), AVAILABLESOON(
+            "JSON message is invalid"), INVALIDADDRESS("Invalid InetAddress"), AVAILABLESOON(
             "Resource is not implemented yet"), INTERNALERROR("Internal Error"), SERVICEUNAVAILABLE(
             "Service is not available. Could be down for maintanence"), INVALIDDATA(
             "Data is invalid or conflicts with URI");
index 769461167c1036812ea33f17d0ffcf8f2b21a6c5..91185bb40573eea09b8e26c5aeb596e32eb23ab4 100644 (file)
@@ -25,6 +25,7 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
 import javax.xml.bind.JAXBElement;
 
 import org.codehaus.enunciate.jaxrs.ResponseCode;
@@ -34,12 +35,11 @@ import org.opendaylight.controller.containermanager.IContainerManager;
 import org.opendaylight.controller.hosttracker.IfIptoHost;
 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
 import org.opendaylight.controller.northbound.commons.RestMessages;
-import org.opendaylight.controller.northbound.commons.exception.InternalServerErrorException;
+import org.opendaylight.controller.northbound.commons.exception.BadRequestException;
 import org.opendaylight.controller.northbound.commons.exception.ResourceConflictException;
 import org.opendaylight.controller.northbound.commons.exception.ResourceNotFoundException;
 import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
 import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
-import org.opendaylight.controller.northbound.commons.exception.UnsupportedMediaTypeException;
 import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
 import org.opendaylight.controller.sal.authorization.Privilege;
 import org.opendaylight.controller.sal.core.Node;
@@ -47,7 +47,6 @@ import org.opendaylight.controller.sal.core.NodeConnector;
 import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.ServiceHelper;
 import org.opendaylight.controller.sal.utils.Status;
-import org.opendaylight.controller.sal.utils.StatusCode;
 import org.opendaylight.controller.switchmanager.ISwitchManager;
 
 /**
@@ -86,11 +85,10 @@ public class HostTrackerNorthbound {
     }
 
     private IfIptoHost getIfIpToHostService(String containerName) {
-        IContainerManager containerManager = (IContainerManager) ServiceHelper
-                .getGlobalInstance(IContainerManager.class, this);
+        IContainerManager containerManager = (IContainerManager) ServiceHelper.getGlobalInstance(
+                IContainerManager.class, this);
         if (containerManager == null) {
-            throw new ServiceUnavailableException("Container "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
+            throw new ServiceUnavailableException("Container " + RestMessages.SERVICEUNAVAILABLE.toString());
         }
 
         boolean found = false;
@@ -98,20 +96,17 @@ public class HostTrackerNorthbound {
         for (String cName : containerNames) {
             if (cName.trim().equalsIgnoreCase(containerName.trim())) {
                 found = true;
+                break;
             }
         }
 
-        if (found == false) {
-            throw new ResourceNotFoundException(containerName + " "
-                    + RestMessages.NOCONTAINER.toString());
+        if (!found) {
+            throw new ResourceNotFoundException(containerName + " " + RestMessages.NOCONTAINER.toString());
         }
 
-        IfIptoHost hostTracker = (IfIptoHost) ServiceHelper.getInstance(
-                IfIptoHost.class, containerName, this);
-
+        IfIptoHost hostTracker = (IfIptoHost) ServiceHelper.getInstance(IfIptoHost.class, containerName, this);
         if (hostTracker == null) {
-            throw new ServiceUnavailableException("Host Tracker "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
+            throw new ServiceUnavailableException("Host Tracker " + RestMessages.SERVICEUNAVAILABLE.toString());
         }
 
         return hostTracker;
@@ -207,17 +202,11 @@ public class HostTrackerNorthbound {
             @ResponseCode(code = 503, condition = "One or more of Controller Services are unavailable") })
     public Hosts getActiveHosts(@PathParam("containerName") String containerName) {
 
-        if (!NorthboundUtils.isAuthorized(
-                getUserName(), containerName, Privilege.READ, this)) {
-            throw new UnauthorizedException(
-                    "User is not authorized to perform this operation on container "
-                            + containerName);
+        if (!NorthboundUtils.isAuthorized(getUserName(), containerName, Privilege.READ, this)) {
+            throw new UnauthorizedException("User is not authorized to perform this operation on container "
+                    + containerName);
         }
         IfIptoHost hostTracker = getIfIpToHostService(containerName);
-        if (hostTracker == null) {
-            throw new ServiceUnavailableException("Host Tracker "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
         return convertHosts(hostTracker.getAllHosts());
     }
 
@@ -300,17 +289,11 @@ public class HostTrackerNorthbound {
             @ResponseCode(code = 503, condition = "One or more of Controller Services are unavailable") })
     public Hosts getInactiveHosts(
             @PathParam("containerName") String containerName) {
-        if (!NorthboundUtils.isAuthorized(
-                getUserName(), containerName, Privilege.READ, this)) {
-            throw new UnauthorizedException(
-                    "User is not authorized to perform this operation on container "
-                            + containerName);
+        if (!NorthboundUtils.isAuthorized(getUserName(), containerName, Privilege.READ, this)) {
+            throw new UnauthorizedException("User is not authorized to perform this operation on container "
+                    + containerName);
         }
         IfIptoHost hostTracker = getIfIpToHostService(containerName);
-        if (hostTracker == null) {
-            throw new ServiceUnavailableException("Host Tracker "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
         return convertHosts(hostTracker.getInactiveStaticHosts());
     }
 
@@ -364,30 +347,23 @@ public class HostTrackerNorthbound {
     @TypeHint(HostConfig.class)
     @StatusCodes({
             @ResponseCode(code = 200, condition = "Operation successful"),
+            @ResponseCode(code = 400, condition = "Invalid IP specified in networkAddress parameter"),
             @ResponseCode(code = 404, condition = "The containerName is not found"),
-            @ResponseCode(code = 415, condition = "Invalid IP Address passed in networkAddress parameter"),
             @ResponseCode(code = 503, condition = "One or more of Controller Services are unavailable") })
     public HostConfig getHostDetails(
             @PathParam("containerName") String containerName,
             @PathParam("networkAddress") String networkAddress) {
-        if (!NorthboundUtils.isAuthorized(
-                getUserName(), containerName, Privilege.READ, this)) {
-            throw new UnauthorizedException(
-                    "User is not authorized to perform this operation on container "
-                            + containerName);
+        if (!NorthboundUtils.isAuthorized(getUserName(), containerName, Privilege.READ, this)) {
+            throw new UnauthorizedException("User is not authorized to perform this operation on container "
+                    + containerName);
         }
         IfIptoHost hostTracker = getIfIpToHostService(containerName);
-        if (hostTracker == null) {
-            throw new ServiceUnavailableException("Host Tracker "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
 
         InetAddress ip;
         try {
             ip = InetAddress.getByName(networkAddress);
         } catch (UnknownHostException e) {
-            throw new UnsupportedMediaTypeException(networkAddress + " "
-                    + RestMessages.INVALIDADDRESS.toString());
+            throw new BadRequestException(RestMessages.INVALIDADDRESS.toString() + " " + networkAddress);
         }
         for (HostNodeConnector host : hostTracker.getAllHosts()) {
             if (host.getNetworkAddress().equals(ip)) {
@@ -450,63 +426,44 @@ public class HostTrackerNorthbound {
     @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @StatusCodes({
             @ResponseCode(code = 201, condition = "Static host created successfully"),
-            @ResponseCode(code = 404, condition = "The Container Name or nodeId or configuration name is not found"),
-            @ResponseCode(code = 406, condition = "Cannot operate on Default Container when other Containers are active"),
-            @ResponseCode(code = 415, condition = "Invalid IP Address passed in networkAddress parameter"),
-            @ResponseCode(code = 500, condition = "Failed to create Static Host entry. Failure Reason included in HTTP Error response"),
+            @ResponseCode(code = 400, condition = "Invalid parameters specified, see response body for details"),
+            @ResponseCode(code = 404, condition = "The container or resource is not found"),
+            @ResponseCode(code = 409, condition = "Resource conflict, see response body for details"),
             @ResponseCode(code = 503, condition = "One or more of Controller services are unavailable") })
-    public Response addHost(@PathParam("containerName") String containerName,
+    public Response addHost(@Context UriInfo uriInfo, @PathParam("containerName") String containerName,
             @PathParam("networkAddress") String networkAddress,
             @TypeHint(HostConfig.class) JAXBElement<HostConfig> hostConfig) {
 
-        if (!NorthboundUtils.isAuthorized(
-                getUserName(), containerName, Privilege.WRITE, this)) {
-            throw new UnauthorizedException(
-                    "User is not authorized to perform this operation on container "
-                            + containerName);
+        if (!NorthboundUtils.isAuthorized(getUserName(), containerName, Privilege.WRITE, this)) {
+            return Response.status(Response.Status.UNAUTHORIZED)
+                    .entity("User is not authorized to perform this operation on container " + containerName)
+                    .build();
         }
         handleDefaultDisabled(containerName);
 
         IfIptoHost hostTracker = getIfIpToHostService(containerName);
-        if (hostTracker == null) {
-            throw new ServiceUnavailableException("Host Tracker "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
 
         HostConfig hc = hostConfig.getValue();
-        Node node = handleNodeAvailability(containerName, hc.getNodeType(), hc.getNodeId());
-        if (node == null) {
-            throw new InternalServerErrorException(
-                    RestMessages.NONODE.toString());
+        if (!networkAddress.equals(hc.getNetworkAddress())) {
+            return Response.status(Response.Status.CONFLICT)
+                    .entity("Resource name in config object doesn't match URI")
+                    .build();
         }
-
-        try {
-            InetAddress.getByName(networkAddress);
-        } catch (UnknownHostException e) {
-            throw new UnsupportedMediaTypeException(networkAddress + " "
-                    + RestMessages.INVALIDADDRESS.toString());
-        }
-        if(!networkAddress.equals(hc.getNetworkAddress())) {
-            throw new UnsupportedMediaTypeException(networkAddress + " is not the same as "
-                    + hc.getNetworkAddress());
-        }
-        if(!hc.isStaticHost()) {
-            throw new UnsupportedMediaTypeException("StaticHost flag must be true");
+        if (!hc.isStaticHost()) {
+            return Response.status(Response.Status.BAD_REQUEST)
+                    .entity("Can only add static host.")
+                    .build();
         }
+        Node node = handleNodeAvailability(containerName, hc.getNodeType(), hc.getNodeId());
         NodeConnector nc = NodeConnector.fromStringNoNode(hc.getNodeConnectorType(), hc.getNodeConnectorId(), node);
-        if (nc == null) {
-            throw new ResourceNotFoundException(hc.getNodeConnectorType() + "|"
-                    + hc.getNodeConnectorId() + " : " + RestMessages.NONODE.toString());
-        }
-        Status status = hostTracker.addStaticHost(networkAddress,
-                hc.getDataLayerAddress(), nc, hc.getVlan());
+
+        Status status = hostTracker.addStaticHost(networkAddress, hc.getDataLayerAddress(), nc, hc.getVlan());
         if (status.isSuccess()) {
             NorthboundUtils.auditlog("Static Host", username, "added", networkAddress, containerName);
-            return Response.status(Response.Status.CREATED).build();
-        } else if (status.getCode().equals(StatusCode.BADREQUEST)) {
-            throw new UnsupportedMediaTypeException(status.getDescription());
+            return Response.created(uriInfo.getRequestUri()).build();
         }
-        throw new InternalServerErrorException(status.getDescription());
+
+        return NorthboundUtils.getResponse(status);
     }
 
     /**
@@ -524,42 +481,28 @@ public class HostTrackerNorthbound {
     @DELETE
     @Consumes({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @StatusCodes({
-            @ResponseCode(code = 200, condition = "Flow Config deleted successfully"),
-            @ResponseCode(code = 404, condition = "The Container Name or Node-id or Flow Name passed is not found"),
+            @ResponseCode(code = 204, condition = "Static host deleted successfully"),
+            @ResponseCode(code = 404, condition = "The container or a specified resource was not found"),
             @ResponseCode(code = 406, condition = "Cannot operate on Default Container when other Containers are active"),
-            @ResponseCode(code = 415, condition = "Invalid IP Address passed in networkAddress parameter"),
-            @ResponseCode(code = 500, condition = "Failed to delete Flow config. Failure Reason included in HTTP Error response"),
             @ResponseCode(code = 503, condition = "One or more of Controller service is unavailable") })
-    public Response deleteFlow(
+    public Response deleteHost(
             @PathParam(value = "containerName") String containerName,
             @PathParam(value = "networkAddress") String networkAddress) {
 
-        if (!NorthboundUtils.isAuthorized(
-                getUserName(), containerName, Privilege.WRITE, this)) {
-            throw new UnauthorizedException(
-                    "User is not authorized to perform this operation on container "
-                            + containerName);
+        if (!NorthboundUtils.isAuthorized(getUserName(), containerName, Privilege.WRITE, this)) {
+            return Response.status(Response.Status.UNAUTHORIZED)
+                    .entity("User is not authorized to perform this operation on container " + containerName)
+                    .build();
         }
         handleDefaultDisabled(containerName);
         IfIptoHost hostTracker = getIfIpToHostService(containerName);
-        if (hostTracker == null) {
-            throw new ServiceUnavailableException("Host Tracker "
-                    + RestMessages.SERVICEUNAVAILABLE.toString());
-        }
-
-        try {
-            InetAddress.getByName(networkAddress);
-        } catch (UnknownHostException e) {
-            throw new UnsupportedMediaTypeException(networkAddress + " "
-                    + RestMessages.INVALIDADDRESS.toString());
-        }
 
         Status status = hostTracker.removeStaticHost(networkAddress);
         if (status.isSuccess()) {
             NorthboundUtils.auditlog("Static Host", username, "removed", networkAddress, containerName);
-            return Response.ok().build();
+            return Response.noContent().build();
         }
-        throw new InternalServerErrorException(status.getDescription());
+        return NorthboundUtils.getResponse(status);
 
     }
 
@@ -567,8 +510,8 @@ public class HostTrackerNorthbound {
         IContainerManager containerManager = (IContainerManager) ServiceHelper
                 .getGlobalInstance(IContainerManager.class, this);
         if (containerManager == null) {
-            throw new InternalServerErrorException(
-                    RestMessages.INTERNALERROR.toString());
+            throw new ServiceUnavailableException(
+                    RestMessages.SERVICEUNAVAILABLE.toString());
         }
         if (containerName.equals(GlobalConstants.DEFAULT.toString())
                 && containerManager.hasNonDefaultContainer()) {
@@ -577,8 +520,7 @@ public class HostTrackerNorthbound {
         }
     }
 
-    private Node handleNodeAvailability(String containerName, String nodeType,
-            String nodeId) {
+    private Node handleNodeAvailability(String containerName, String nodeType, String nodeId) {
 
         Node node = Node.fromString(nodeType, nodeId);
         if (node == null) {
index 4d0f663dea73f8f90d659371a9bbb1e17fb648b4..88cff5ed835e1475e7c0f7acaf80e40b06ca348b 100644 (file)
@@ -5,9 +5,9 @@
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <groupId>org.opendaylight.controller</groupId>
-    <artifactId>commons.opendaylight</artifactId>
-    <version>1.4.0-SNAPSHOT</version>
-    <relativePath>../../commons/opendaylight</relativePath>
+    <artifactId>commons.integrationtest</artifactId>
+    <version>0.5.0-SNAPSHOT</version>
+    <relativePath>../../commons/integrationtest</relativePath>
   </parent>
   <scm>
     <connection>scm:git:ssh://git.opendaylight.org:29418/controller.git</connection>
       <artifactId>usermanager</artifactId>
       <version>0.4.0-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>usermanager.implementation</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>security</artifactId>
       <artifactId>commons-fileupload</artifactId>
       <version>1.2.2</version>
     </dependency>
+    <dependency>
+      <groupId>commons-codec</groupId>
+      <artifactId>commons-codec</artifactId>
+      <version>1.8</version>
+    </dependency>
     <dependency>
       <groupId>equinoxSDK381</groupId>
       <artifactId>javax.servlet</artifactId>
index f4adc71fa2f3a2cd81babd05ac62c2c9fd0a4678..f7ebfe438fb82f577581664301fa90b3a7f079ff 100644 (file)
@@ -903,7 +903,7 @@ public class NorthboundIT {
         Integer nodeId_1 = 3366;
         String nodeConnectorType_1 = "STUB";
         Integer nodeConnectorId_1 = 12;
-        String vlan_1 = "4";
+        String vlan_1 = "";
 
         // 2nd host
         String networkAddress_2 = "10.1.1.1";
@@ -912,7 +912,7 @@ public class NorthboundIT {
         Integer nodeId_2 = 4477;
         String nodeConnectorType_2 = "STUB";
         Integer nodeConnectorId_2 = 34;
-        String vlan_2 = "0";
+        String vlan_2 = "123";
 
         String baseURL = "http://127.0.0.1:8080/controller/nb/v2/host/default";
 
@@ -969,7 +969,7 @@ public class NorthboundIT {
                 Assert.assertTrue(host_jo.getInt("nodeConnectorId") == nodeConnectorId_1);
                 Assert.assertTrue(host_jo.getString("nodeType").equalsIgnoreCase(nodeType_1));
                 Assert.assertTrue(host_jo.getInt("nodeId") == nodeId_1);
-                Assert.assertTrue(host_jo.getString("vlan").equalsIgnoreCase(vlan_1));
+                Assert.assertTrue(host_jo.getString("vlan").equals("0"));
                 Assert.assertTrue(host_jo.getBoolean("staticHost"));
             } else if (networkAddress.equalsIgnoreCase(networkAddress_2)) {
                 Assert.assertTrue(host_jo.getString("dataLayerAddress").equalsIgnoreCase(dataLayerAddress_2));
@@ -1030,13 +1030,13 @@ public class NorthboundIT {
         Assert.assertTrue(json.getInt("nodeConnectorId") == nodeConnectorId_1);
         Assert.assertTrue(json.getString("nodeType").equalsIgnoreCase(nodeType_1));
         Assert.assertTrue(json.getInt("nodeId") == nodeId_1);
-        Assert.assertTrue(json.getString("vlan").equalsIgnoreCase(vlan_1));
+        Assert.assertTrue(json.getString("vlan").equals("0"));
         Assert.assertTrue(json.getBoolean("staticHost"));
 
         // test DELETE method for deleteFlow()
 
         result = getJsonResult(baseURL + "/" + networkAddress_1, "DELETE");
-        Assert.assertTrue(httpResponseCode == 200);
+        Assert.assertTrue(httpResponseCode == 204);
 
         // verify host_1 removed from active host DB
         // test GET method: getActiveHosts() - no host expected
@@ -1274,160 +1274,160 @@ public class NorthboundIT {
 
                 // Set the systemPackages (used by clustering)
                 systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
-                mavenBundle("javax.servlet", "servlet-api", "2.5"),
-
-                mavenBundle("org.slf4j", "jcl-over-slf4j", "1.7.2"),
-                mavenBundle("org.slf4j", "slf4j-api", "1.7.2"),
-                mavenBundle("org.slf4j", "log4j-over-slf4j", "1.7.2"),
-                mavenBundle("ch.qos.logback", "logback-core", "1.0.9"),
-                mavenBundle("ch.qos.logback", "logback-classic", "1.0.9"),
-                mavenBundle("org.apache.commons", "commons-lang3", "3.1"),
-                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager", "3.1.0"),
+                mavenBundle("org.slf4j", "jcl-over-slf4j").versionAsInProject(),
+                mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
+                mavenBundle("org.slf4j", "log4j-over-slf4j").versionAsInProject(),
+                mavenBundle("ch.qos.logback", "logback-core").versionAsInProject(),
+                mavenBundle("ch.qos.logback", "logback-classic").versionAsInProject(),
+                mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
 
                 // the plugin stub to get data for the tests
-                mavenBundle("org.opendaylight.controller", "protocol_plugins.stub", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller", "protocol_plugins.stub").versionAsInProject(),
 
                 // List all the opendaylight modules
-                mavenBundle("org.opendaylight.controller", "configuration", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "configuration.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "containermanager", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "containermanager.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "clustering.services", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "clustering.services-implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "security", "0.4.0-SNAPSHOT").noStart(),
-                mavenBundle("org.opendaylight.controller", "sal", "0.5.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "sal.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "sal.connection", "0.1.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "sal.connection.implementation", "0.1.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "switchmanager", "0.5.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "connectionmanager", "0.1.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "connectionmanager.implementation", "0.1.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "switchmanager.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "forwardingrulesmanager", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "forwardingrulesmanager.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "statisticsmanager", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "statisticsmanager.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "arphandler", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "hosttracker", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "hosttracker.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "arphandler", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "routing.dijkstra_implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "topologymanager", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "usermanager", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "usermanager.implementation", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "logging.bridge", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "clustering.test", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "forwarding.staticrouting", "0.4.0-SNAPSHOT"),
+                mavenBundle("org.opendaylight.controller", "configuration").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "configuration.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "containermanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "containermanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "clustering.services").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "clustering.services-implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "security").versionAsInProject().noStart(),
+                mavenBundle("org.opendaylight.controller", "sal").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.connection").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "sal.connection.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "switchmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "connectionmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "connectionmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "switchmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "forwardingrulesmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller",
+                            "forwardingrulesmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "statisticsmanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "statisticsmanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "arphandler").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "hosttracker").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "hosttracker.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "arphandler").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "routing.dijkstra_implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "topologymanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "usermanager").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "usermanager.implementation").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "logging.bridge").versionAsInProject(),
+//                mavenBundle("org.opendaylight.controller", "clustering.test").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "forwarding.staticrouting").versionAsInProject(),
 
                 // Northbound bundles
-                mavenBundle("org.opendaylight.controller", "commons.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "forwarding.staticrouting.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "statistics.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "topology.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "hosttracker.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "switchmanager.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "flowprogrammer.northbound", "0.4.0-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller", "subnets.northbound", "0.4.0-SNAPSHOT"),
-
-                mavenBundle("org.codehaus.jackson", "jackson-mapper-asl", "1.9.8"),
-                mavenBundle("org.codehaus.jackson", "jackson-core-asl", "1.9.8"),
-                mavenBundle("org.codehaus.jackson", "jackson-jaxrs", "1.9.8"),
-                mavenBundle("org.codehaus.jettison", "jettison", "1.3.3"),
-
-                mavenBundle("commons-io", "commons-io", "2.3"),
-
-                mavenBundle("commons-fileupload", "commons-fileupload", "1.2.2"),
-
-                mavenBundle("equinoxSDK381", "javax.servlet", "3.0.0.v201112011016"),
-                mavenBundle("equinoxSDK381", "javax.servlet.jsp", "2.2.0.v201112011158"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds", "1.4.0.v20120522-1841"),
-                mavenBundle("orbit", "javax.xml.rpc", "1.1.0.v201005080400"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util", "1.0.400.v20120522-2049"),
-                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services", "3.3.100.v20120522-1822"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command", "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime", "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell", "0.8.0.v201110170705"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.cm", "1.0.400.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console", "1.0.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.launcher", "1.3.0.v20120522-1813"),
-
-                mavenBundle("geminiweb", "org.eclipse.gemini.web.core", "2.2.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.gemini.web.extender", "2.2.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.gemini.web.tomcat", "2.2.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.kernel.equinox.extensions", "3.6.0.RELEASE").noStart(),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.common", "3.6.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.io", "3.6.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.math", "3.6.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi", "3.6.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi.manifest", "3.6.0.RELEASE"),
-                mavenBundle("geminiweb", "org.eclipse.virgo.util.parser.manifest", "3.6.0.RELEASE"),
-
-                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager", "3.1.0"),
-                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager.shell", "3.0.1"),
-
-                mavenBundle("com.google.code.gson", "gson", "2.1"),
-                mavenBundle("org.jboss.spec.javax.transaction", "jboss-transaction-api_1.1_spec", "1.0.1.Final"),
-                mavenBundle("org.apache.felix", "org.apache.felix.fileinstall", "3.1.6"),
-                mavenBundle("org.apache.commons", "commons-lang3", "3.1"),
-                mavenBundle("commons-codec", "commons-codec"),
-                mavenBundle("virgomirror", "org.eclipse.jdt.core.compiler.batch", "3.8.0.I20120518-2145"),
-                mavenBundle("eclipselink", "javax.persistence", "2.0.4.v201112161009"),
-                mavenBundle("eclipselink", "javax.resource", "1.5.0.v200906010428"),
-
-                mavenBundle("orbit", "javax.activation", "1.1.0.v201211130549"),
-                mavenBundle("orbit", "javax.annotation", "1.1.0.v201209060031"),
-                mavenBundle("orbit", "javax.ejb", "3.1.1.v201204261316"),
-                mavenBundle("orbit", "javax.el", "2.2.0.v201108011116"),
-                mavenBundle("orbit", "javax.mail.glassfish", "1.4.1.v201108011116"),
-                mavenBundle("orbit", "javax.xml.rpc", "1.1.0.v201005080400"),
-                mavenBundle("orbit", "org.apache.catalina", "7.0.32.v201211201336"),
+                mavenBundle("org.opendaylight.controller", "commons.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "forwarding.staticrouting.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "statistics.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "topology.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "hosttracker.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "switchmanager.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "flowprogrammer.northbound").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller", "subnets.northbound").versionAsInProject(),
+
+                mavenBundle("org.codehaus.jackson", "jackson-mapper-asl").versionAsInProject(),
+                mavenBundle("org.codehaus.jackson", "jackson-core-asl").versionAsInProject(),
+                mavenBundle("org.codehaus.jackson", "jackson-jaxrs").versionAsInProject(),
+                mavenBundle("org.codehaus.jettison", "jettison").versionAsInProject(),
+
+                mavenBundle("commons-io", "commons-io").versionAsInProject(),
+
+                mavenBundle("commons-fileupload", "commons-fileupload").versionAsInProject(),
+
+                mavenBundle("equinoxSDK381", "javax.servlet").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "javax.servlet.jsp").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
+                mavenBundle("orbit", "javax.xml.rpc").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.cm").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.launcher").versionAsInProject(),
+
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.core").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.extender").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.gemini.web.tomcat").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.kernel.equinox.extensions").versionAsInProject().noStart(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.common").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.io").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.math").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.osgi.manifest").versionAsInProject(),
+                mavenBundle("geminiweb", "org.eclipse.virgo.util.parser.manifest").versionAsInProject(),
+
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.dependencymanager.shell").versionAsInProject(),
+
+                mavenBundle("com.google.code.gson", "gson").versionAsInProject(),
+                mavenBundle("org.jboss.spec.javax.transaction", "jboss-transaction-api_1.1_spec").versionAsInProject(),
+                mavenBundle("org.apache.felix", "org.apache.felix.fileinstall").versionAsInProject(),
+                mavenBundle("org.apache.commons", "commons-lang3").versionAsInProject(),
+                mavenBundle("commons-codec", "commons-codec").versionAsInProject(),
+                mavenBundle("virgomirror", "org.eclipse.jdt.core.compiler.batch").versionAsInProject(),
+                mavenBundle("eclipselink", "javax.persistence").versionAsInProject(),
+                mavenBundle("eclipselink", "javax.resource").versionAsInProject(),
+
+                mavenBundle("orbit", "javax.activation").versionAsInProject(),
+                mavenBundle("orbit", "javax.annotation").versionAsInProject(),
+                mavenBundle("orbit", "javax.ejb").versionAsInProject(),
+                mavenBundle("orbit", "javax.el").versionAsInProject(),
+                mavenBundle("orbit", "javax.mail.glassfish").versionAsInProject(),
+                mavenBundle("orbit", "javax.xml.rpc").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.catalina").versionAsInProject(),
                 // these are bundle fragments that can't be started on its own
-                mavenBundle("orbit", "org.apache.catalina.ha", "7.0.32.v201211201952").noStart(),
-                mavenBundle("orbit", "org.apache.catalina.tribes", "7.0.32.v201211201952").noStart(),
-                mavenBundle("orbit", "org.apache.coyote", "7.0.32.v201211201952").noStart(),
-                mavenBundle("orbit", "org.apache.jasper", "7.0.32.v201211201952").noStart(),
-
-                mavenBundle("orbit", "org.apache.el", "7.0.32.v201211081135"),
-                mavenBundle("orbit", "org.apache.juli.extras", "7.0.32.v201211081135"),
-                mavenBundle("orbit", "org.apache.tomcat.api", "7.0.32.v201211081135"),
-                mavenBundle("orbit", "org.apache.tomcat.util", "7.0.32.v201211201952").noStart(),
-                mavenBundle("orbit", "javax.servlet.jsp.jstl", "1.2.0.v201105211821"),
-                mavenBundle("orbit", "javax.servlet.jsp.jstl.impl", "1.2.0.v201210211230"),
-
-                mavenBundle("org.ops4j.pax.exam", "pax-exam-container-native"),
-                mavenBundle("org.ops4j.pax.exam", "pax-exam-junit4"),
-                mavenBundle("org.ops4j.pax.exam", "pax-exam-link-mvn"),
-                mavenBundle("org.ops4j.pax.url", "pax-url-aether"),
-
-                mavenBundle("org.springframework", "org.springframework.asm", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.aop", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.context", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.context.support", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.core", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.beans", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.expression", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.web", "3.1.3.RELEASE"),
-
-                mavenBundle("org.aopalliance", "com.springsource.org.aopalliance", "1.0.0"),
-                mavenBundle("org.springframework", "org.springframework.web.servlet", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework.security", "spring-security-config", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework.security", "spring-security-core", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework.security", "spring-security-web", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework.security", "spring-security-taglibs", "3.1.3.RELEASE"),
-                mavenBundle("org.springframework", "org.springframework.transaction", "3.1.3.RELEASE"),
-
-                mavenBundle("org.ow2.chameleon.management", "chameleon-mbeans", "1.0.0"),
-                mavenBundle("org.opendaylight.controller.thirdparty", "net.sf.jung2", "2.0.1-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller.thirdparty", "com.sun.jersey.jersey-servlet", "1.17-SNAPSHOT"),
-                mavenBundle("org.opendaylight.controller.thirdparty", "org.apache.catalina.filters.CorsFilter",
-                            "7.0.42-SNAPSHOT").noStart(),
+                mavenBundle("orbit", "org.apache.catalina.ha").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.catalina.tribes").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.coyote").versionAsInProject().noStart(),
+                mavenBundle("orbit", "org.apache.jasper").versionAsInProject().noStart(),
+
+                mavenBundle("orbit", "org.apache.el").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.juli.extras").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.tomcat.api").versionAsInProject(),
+                mavenBundle("orbit", "org.apache.tomcat.util").versionAsInProject().noStart(),
+                mavenBundle("orbit", "javax.servlet.jsp.jstl").versionAsInProject(),
+                mavenBundle("orbit", "javax.servlet.jsp.jstl.impl").versionAsInProject(),
+
+                mavenBundle("org.ops4j.pax.exam", "pax-exam-container-native").versionAsInProject(),
+                mavenBundle("org.ops4j.pax.exam", "pax-exam-junit4").versionAsInProject(),
+                mavenBundle("org.ops4j.pax.exam", "pax-exam-link-mvn").versionAsInProject(),
+                mavenBundle("org.ops4j.pax.url", "pax-url-aether").versionAsInProject(),
+
+                mavenBundle("org.springframework", "org.springframework.asm").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.aop").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.context").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.context.support").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.core").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.beans").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.expression").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.web").versionAsInProject(),
+
+                mavenBundle("org.aopalliance", "com.springsource.org.aopalliance").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.web.servlet").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-config").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-core").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-web").versionAsInProject(),
+                mavenBundle("org.springframework.security", "spring-security-taglibs").versionAsInProject(),
+                mavenBundle("org.springframework", "org.springframework.transaction").versionAsInProject(),
+
+                mavenBundle("org.ow2.chameleon.management", "chameleon-mbeans").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller.thirdparty", "net.sf.jung2").versionAsInProject(),
+                mavenBundle("org.opendaylight.controller.thirdparty", "com.sun.jersey.jersey-servlet")
+                .versionAsInProject(),
+                mavenBundle("org.opendaylight.controller.thirdparty", "org.apache.catalina.filters.CorsFilter")
+                .versionAsInProject().noStart(),
 
                 // Jersey needs to be started before the northbound application
                 // bundles, using a lower start level
-                mavenBundle("com.sun.jersey", "jersey-client", "1.17"),
-                mavenBundle("com.sun.jersey", "jersey-server", "1.17").startLevel(2),
-                mavenBundle("com.sun.jersey", "jersey-core", "1.17").startLevel(2),
-                mavenBundle("com.sun.jersey", "jersey-json", "1.17").startLevel(2), junitBundles());
+                mavenBundle("com.sun.jersey", "jersey-client").versionAsInProject(),
+                mavenBundle("com.sun.jersey", "jersey-server").versionAsInProject().startLevel(2),
+                mavenBundle("com.sun.jersey", "jersey-core").versionAsInProject().startLevel(2),
+                mavenBundle("com.sun.jersey", "jersey-json").versionAsInProject().startLevel(2), junitBundles());
     }
 
 }
index 0f263ff38c4a4916f9745214b7022b5fdd37e328..1edd945dfa708f7d68f5f6a081c3795f3bcefff8 100644 (file)
@@ -27,6 +27,7 @@ import javax.ws.rs.core.Context;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.SecurityContext;
+import javax.ws.rs.core.UriInfo;
 
 import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
@@ -254,6 +255,7 @@ public class SwitchNorthbound {
             @ResponseCode(code = 409, condition = "Unable to update configuration due to cluster conflict or conflicting description property"),
             @ResponseCode(code = 503, condition = "One or more of Controller services are unavailable") })
     public Response addNodeProperty(
+            @Context UriInfo uriInfo,
             @PathParam("containerName") String containerName,
             @PathParam("nodeType") String nodeType,
             @PathParam("nodeId") String nodeId,
@@ -288,7 +290,7 @@ public class SwitchNorthbound {
         SwitchConfig newSwitchConfig = new SwitchConfig(node.toString(), nodeProperties);
         Status status = switchManager.updateNodeConfig(newSwitchConfig);
         if (status.isSuccess()) {
-            return Response.status(Response.Status.CREATED).build();
+            return Response.created(uriInfo.getRequestUri()).build();
         }
         return NorthboundUtils.getResponse(status);
     }
@@ -534,6 +536,7 @@ public class SwitchNorthbound {
             @ResponseCode(code = 409, condition = "Unable to add property due to cluster conflict"),
             @ResponseCode(code = 503, condition = "One or more of Controller services are unavailable") })
     public Response addNodeConnectorProperty(
+            @Context UriInfo uriInfo,
             @PathParam("containerName") String containerName,
             @PathParam("nodeType") String nodeType,
             @PathParam("nodeId") String nodeId,
@@ -574,7 +577,7 @@ public class SwitchNorthbound {
 
         Status ret = switchManager.addNodeConnectorProp(nc, prop);
         if (ret.isSuccess()) {
-            return Response.status(Response.Status.CREATED).build();
+            return Response.created(uriInfo.getRequestUri()).build();
         }
         throw new InternalServerErrorException(ret.getDescription());
     }
index 1938cb1ae68e66efe8bb68b12f42e3fcf1373703..0895d9af27c85132965a98ea23cd166784a3e538 100644 (file)
@@ -131,6 +131,7 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa
 
     class DiscoveryTransmit implements Runnable {
         private final BlockingQueue<NodeConnector> transmitQ;
+        private int count = 0;
 
         DiscoveryTransmit(BlockingQueue<NodeConnector> transmitQ) {
             this.transmitQ = transmitQ;
@@ -144,6 +145,9 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa
                     RawPacket outPkt = createDiscoveryPacket(nodeConnector);
                     sendDiscoveryPacket(nodeConnector, outPkt);
                     nodeConnector = null;
+                    if ((++count & 0x7f) == 0) {
+                        Thread.sleep(10);
+                    }
                 } catch (InterruptedException e1) {
                     logger.warn("DiscoveryTransmit interupted", e1.getMessage());
                     if (shuttingDown) {
@@ -1679,7 +1683,7 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa
      */
     private int getDiscoveryBatchMaxPorts() {
         String val = System.getProperty("of.discoveryBatchMaxPorts");
-        int ports = 1024;
+        int ports = 512;
 
         if (val != null) {
             try {
index c26800890bb933d4dd5702dda513bcdec4b37e5f..7b934edfa78df7ad08cf427545c8d1b3f6f502ff 100644 (file)
@@ -105,4 +105,9 @@ public class Actions extends Property {
     public String toString() {
         return "Actions[" + actionsValue + "]";
     }
+
+    @Override
+    public String getStringValue() {
+        return Integer.toHexString(actionsValue);
+    }
 }
index 1282d5ef9c2c18259077390a32a4d6840c8ac068..8c3a97751804215414c9ae9aaa0c3206482921a1 100644 (file)
@@ -105,24 +105,25 @@ public class Bandwidth extends Property {
 
     @Override
     public String toString() {
-        StringBuffer sb = new StringBuffer();
+        return "BandWidth[" + getStringValue() + "]";
+    }
 
-        sb.append("BandWidth[");
+    @Override
+    public String getStringValue() {
         if (this.bandwidthValue == 0) {
-            sb.append("UnKnown");
+            return("UnKnown");
         } else if (this.bandwidthValue < BW1Kbps) {
-            sb.append(this.bandwidthValue + "bps");
+            return(this.bandwidthValue + "bps");
         } else if (this.bandwidthValue < BW1Mbps) {
-            sb.append(Long.toString(this.bandwidthValue / BW1Kbps) + "Kbps");
+            return(Long.toString(this.bandwidthValue / BW1Kbps) + "Kbps");
         } else if (this.bandwidthValue < BW1Gbps) {
-            sb.append(Long.toString(this.bandwidthValue / BW1Mbps) + "Mbps");
+            return(Long.toString(this.bandwidthValue / BW1Mbps) + "Mbps");
         } else if (this.bandwidthValue < BW1Tbps) {
-            sb.append(Long.toString(this.bandwidthValue / BW1Gbps) + "Gbps");
+            return(Long.toString(this.bandwidthValue / BW1Gbps) + "Gbps");
         } else if (this.bandwidthValue < BW1Pbps) {
-            sb.append(Long.toString(this.bandwidthValue / BW1Tbps) + "Tbps");
+            return(Long.toString(this.bandwidthValue / BW1Tbps) + "Tbps");
+        } else {
+            return(this.bandwidthValue + "bps");
         }
-
-        sb.append("]");
-        return sb.toString();
     }
 }
index 6d7369d72bb6f25480cc2d40f359b240eeaed8f8..4c6e08102b214341f237e01d6280d375aaf30eeb 100644 (file)
@@ -81,4 +81,9 @@ public class Buffers extends Property {
     public String toString() {
         return "Buffers[" + buffersValue + "]";
     }
+
+    @Override
+    public String getStringValue() {
+        return Integer.toHexString(buffersValue);
+    }
 }
index 7867b93a683d48f565b65cf03ba3a710b7fe3e5c..b2005913d0dc214d5f2ef9d496969d1452020fde 100644 (file)
@@ -98,4 +98,9 @@ public class Capabilities extends Property {
     public String toString() {
         return "Capabilities[" + capabilitiesValue + "]";
     }
+
+    @Override
+    public String getStringValue() {
+        return Integer.toHexString(capabilitiesValue);
+    }
 }
index ef6efc58211577fb9799509c1d998949a44364dc..651c2f44e12ac8f3a93612b6dda5c3e8ca820e1c 100644 (file)
@@ -75,4 +75,17 @@ public class Config extends Property {
     public String toString() {
         return "Config["+ configValue +"]";
     }
+
+    @Override
+    public String getStringValue() {
+        if (configValue == 0) {
+            return "ADMIN_DOWN";
+        } else if (configValue == 1) {
+            return "ADMIN_UP";
+        } else if (configValue == 0x7fff) {
+            return "ADMIN_UNDEF";
+        } else {
+            return String.valueOf(configValue);
+        }
+    }
 }
index 6915404e24ab43af15299c1469695101b53a6984..ebc12cdbf7a28d86cdafce135e0e98881846806b 100644 (file)
@@ -65,4 +65,9 @@ public class Description extends Property {
     public String toString() {
         return "Description[" + descriptionValue + "]";
     }
+
+    @Override
+    public String getStringValue() {
+        return descriptionValue;
+    }
 }
index a1d4ff9db735476fa593f0fe2f2c577b13b9d473..1b19f19778ddba6c21ae8437d5e06be44b7d3898 100644 (file)
@@ -71,4 +71,9 @@ public class ForwardingMode extends Property {
     public String toString() {
         return "Mode[" + modeValue + "]";
     }
+
+    @Override
+    public String getStringValue() {
+        return (modeValue == ForwardingMode.PROACTIVE_FORWARDING) ? "Proactive" : "Reactive";
+    }
 }
\ No newline at end of file
index a0ba47b29d2458aadcffa90e115f0c1a218602e6..a64ee105cf0efab3f7f6559a89f85deb6639872b 100644 (file)
@@ -112,4 +112,21 @@ public class Latency extends Property {
         sb.append("]");
         return sb.toString();
     }
+
+    @Override
+    public String getStringValue() {
+        if (this.latencyValue == 0) {
+            return("UnKnown");
+        } else if (this.latencyValue < LATENCY1ns) {
+            return(this.latencyValue + "psec");
+        } else if (this.latencyValue < LATENCY1us) {
+            return(Long.toString(this.latencyValue / LATENCY1ns) + "nsec");
+        } else if (this.latencyValue < LATENCY1ms) {
+            return(Long.toString(this.latencyValue / LATENCY1us) + "usec");
+        } else if (this.latencyValue < LATENCY1s) {
+            return(Long.toString(this.latencyValue / LATENCY1ms) + "msec");
+        } else {
+            return Long.toString(this.latencyValue) + "sec";
+        }
+    }
 }
index 27e74e08008094759bda6bc5c6c846f40eef262c..2dfa9168fe91905b52a2312e6f493692fe6d6172 100644 (file)
@@ -109,4 +109,9 @@ public class MacAddress extends Property implements Cloneable {
     public String toString() {
         return "MacAddress[" + address + "]";
     }
+
+    @Override
+    public String getStringValue() {
+        return address;
+    }
 }
index d35610add0f6b2df7101dd6e3422f6252d272e4e..92c8454a4d6d77d92bb1b669883a252fe7237087 100644 (file)
@@ -74,4 +74,9 @@ public class Name extends Property {
     public String toString() {
         return "Name[" + nameValue + "]";
     }
+
+    @Override
+    public String getStringValue() {
+        return nameValue;
+    }
 }
index 574f6d02381303afba11f827aed6bbd972cd00fd..a5deb547e351c1f154fd0eade864173aa82c011b 100644 (file)
@@ -53,6 +53,8 @@ abstract public class Property implements Serializable, Cloneable {
         return this.name;
     }
 
+    public abstract String getStringValue();
+
     /**
      * Used to copy the Property in a polymorphic way
      *
index 058adb63e2156172879dbf7b6d512f7258d2a725..e47542a7bef9f259bfab5ca21bbca82fc528e980 100644 (file)
@@ -76,4 +76,17 @@ public class State extends Property {
     public String toString() {
         return "State[" + stateValue + "]";
     }
+
+    @Override
+    public String getStringValue() {
+        if (stateValue == 0) {
+            return ("EDGE_DOWN");
+        } else if (stateValue == 1) {
+            return ("EDGE_UP");
+        } else if (stateValue == 0x7fff) {
+            return ("EDGE_UNK");
+        } else {
+            return String.valueOf(stateValue);
+        }
+    }
 }
index bd50cf9be067aea6b842e7c9d1e3d8da1b9c746b..b92c4b693c063bb6e9a093b84ee32c62de19f8fa 100644 (file)
@@ -80,4 +80,9 @@ public class Tables extends Property {
     public String toString() {
         return "Tables[" + tablesValue + "]";
     }
+
+    @Override
+    public String getStringValue() {
+        return String.format("%02x", tablesValue);
+    }
 }
index 6756a8213547b1851c1457432827f8934e8b1979..d1af778526bce58b9a1e8841a3cb8d2d64aa5712 100644 (file)
@@ -72,4 +72,9 @@ public class Tier extends Property {
     public String toString() {
         return "Tier[" + tierValue + "]";
     }
+
+    @Override
+    public String getStringValue() {
+        return String.valueOf(tierValue);
+    }
 }
index b38ec8582b17db2d765a35c9df4d3b888ed96228..a2d3d36c6f044a286e37e8eaf7674f72c5f7950e 100644 (file)
@@ -9,6 +9,8 @@
 
 package org.opendaylight.controller.sal.core;
 
+import java.util.Date;
+
 import javax.xml.bind.annotation.XmlElement;
 import javax.xml.bind.annotation.XmlRootElement;
 
@@ -103,4 +105,9 @@ public class TimeStamp extends Property {
     public String toString() {
         return "TimeStamp[" + timestampName + ": " + timestamp +"]";
     }
+
+    @Override
+    public String getStringValue() {
+        return timestampName + ": " + new Date(timestamp);
+    }
 }
index 00629a43b11470f66b6b1f2045e4ae3d3aabbf76..43c297da1827f66fb98cb0d78ba6387b04ad6b22 100644 (file)
@@ -67,20 +67,13 @@ public class StatisticsManagerIT {
                 // Set the systemPackages (used by clustering)
                 systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
                 // List framework bundles
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console",
-                        "1.0.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util",
-                        "1.0.400.v20120522-2049"),
-                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services",
-                        "3.3.100.v20120522-1822"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds",
-                        "1.4.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command",
-                        "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime",
-                        "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell",
-                        "0.8.0.v201110170705"),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject(),
                 // List logger bundles
                 mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
                 mavenBundle("org.slf4j", "log4j-over-slf4j")
@@ -326,4 +319,4 @@ public class StatisticsManagerIT {
         }
     }
 
-}
\ No newline at end of file
+}
index d3d41be19f8d6061d2f5f9502c0678fe71cf332e..1390f94b494c423198abde7736b4e77f965046d0 100644 (file)
@@ -772,6 +772,10 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
                         propMap.put(Description.propertyName, desc);
                     }
                     continue;
+                } else if (prop.equals(ForwardingMode.name)) {
+                    Property defaultMode = new ForwardingMode(ForwardingMode.REACTIVE_FORWARDING);
+                    propMap.put(ForwardingMode.name, defaultMode);
+                    continue;
                 }
                 propMap.remove(prop);
             }
@@ -911,8 +915,8 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
             }
         }
 
-        // copy node properties from config
         boolean proactiveForwarding = false;
+        // copy node properties from config
         if (nodeConfigList != null) {
             String nodeId = node.toString();
             SwitchConfig conf = nodeConfigList.get(nodeId);
@@ -926,6 +930,10 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
             }
         }
 
+        if (!propMap.containsKey(ForwardingMode.name)) {
+            Property defaultMode = new ForwardingMode(ForwardingMode.REACTIVE_FORWARDING);
+            propMap.put(ForwardingMode.name, defaultMode);
+        }
         boolean result = false;
         if (propMapCurr == null) {
             if (nodeProps.putIfAbsent(node, propMap) == null) {
@@ -1096,7 +1104,7 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
     @Override
     public Set<Node> getNodes() {
         return (nodeProps != null) ? new HashSet<Node>(nodeProps.keySet())
-                : null;
+                : new HashSet<Node>();
     }
 
     /*
@@ -1758,8 +1766,6 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
     public String getHelp() {
         StringBuffer help = new StringBuffer();
         help.append("---Switch Manager---\n");
-        help.append("\t pns                    - Print connected nodes\n");
-        help.append("\t pncs <node id>         - Print node connectors for a given node\n");
         help.append("\t pencs <node id>        - Print enabled node connectors for a given node\n");
         help.append("\t pdm <node id>          - Print switch ports in device map\n");
         help.append("\t snt <node id> <tier>   - Set node tier number\n");
@@ -1768,37 +1774,6 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
         return help.toString();
     }
 
-    public void _pns(CommandInterpreter ci) {
-        ci.println("           Node               Type           MAC            Name      Tier");
-        if (nodeProps == null) {
-            return;
-        }
-        Set<Node> nodeSet = nodeProps.keySet();
-        if (nodeSet == null) {
-            return;
-        }
-        List<String> nodeArray = new ArrayList<String>();
-        for (Node node : nodeSet) {
-            nodeArray.add(node.toString());
-        }
-        Collections.sort(nodeArray);
-        for (String str: nodeArray) {
-            Node node = Node.fromString(str);
-            Description desc = ((Description) getNodeProp(node,
-                    Description.propertyName));
-            Tier tier = ((Tier) getNodeProp(node, Tier.TierPropName));
-            String nodeName = (desc == null) ? "" : desc.getValue();
-            MacAddress mac = (MacAddress) getNodeProp(node,
-                    MacAddress.name);
-            String macAddr = (mac == null) ? "" : HexEncode
-                    .bytesToHexStringFormat(mac.getMacAddress());
-            int tierNum = (tier == null) ? 0 : tier.getValue();
-            ci.println(node + "     " + node.getType() + "     " + macAddr
-                    + "     " + nodeName + "     " + tierNum);
-        }
-        ci.println("Total number of Nodes: " + nodeSet.size());
-    }
-
     public void _pencs(CommandInterpreter ci) {
         String st = ci.nextArgument();
         if (st == null) {
@@ -1825,43 +1800,6 @@ public class SwitchManager implements ISwitchManager, IConfigurationContainerAwa
         ci.println("Total number of NodeConnectors: " + nodeConnectorSet.size());
     }
 
-    public void _pncs(CommandInterpreter ci) {
-        String st = ci.nextArgument();
-        if (st == null) {
-            ci.println("Please enter node id");
-            return;
-        }
-
-        Node node = Node.fromString(st);
-        if (node == null) {
-            ci.println("Please enter node id");
-            return;
-        }
-
-        ci.println("          NodeConnector               BandWidth(Gbps)     Admin     State");
-        Set<NodeConnector> nodeConnectorSet = getNodeConnectors(node);
-        if (nodeConnectorSet == null) {
-            return;
-        }
-        for (NodeConnector nodeConnector : nodeConnectorSet) {
-            if (nodeConnector == null) {
-                continue;
-            }
-            Map<String, Property> propMap = getNodeConnectorProps(nodeConnector);
-            Bandwidth bw = (Bandwidth) propMap.get(Bandwidth.BandwidthPropName);
-            Config config = (Config) propMap.get(Config.ConfigPropName);
-            State state = (State) propMap.get(State.StatePropName);
-            String out = nodeConnector + "           ";
-            out += (bw != null) ? bw.getValue() / Math.pow(10, 9) : "    ";
-            out += "             ";
-            out += (config != null) ? config.getValue() : " ";
-            out += "          ";
-            out += (state != null) ? state.getValue() : " ";
-            ci.println(out);
-        }
-        ci.println("Total number of NodeConnectors: " + nodeConnectorSet.size());
-    }
-
     public void _pdm(CommandInterpreter ci) {
         String st = ci.nextArgument();
         if (st == null) {
index bcf9fd6d0b33e47da103e5646a86be8566b78176..268e45ad85891f0c1d274447dfca0e66520bb1c7 100644 (file)
@@ -11,23 +11,17 @@ package org.opendaylight.controller.switchmanager.internal;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Dictionary;
+import java.util.HashSet;
 import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 import org.apache.felix.service.command.Descriptor;
-import org.opendaylight.controller.sal.core.Bandwidth;
-import org.opendaylight.controller.sal.core.Config;
-import org.opendaylight.controller.sal.core.Description;
-import org.opendaylight.controller.sal.core.MacAddress;
 import org.opendaylight.controller.sal.core.Node;
 import org.opendaylight.controller.sal.core.NodeConnector;
 import org.opendaylight.controller.sal.core.Property;
-import org.opendaylight.controller.sal.core.State;
-import org.opendaylight.controller.sal.core.Tier;
 import org.opendaylight.controller.sal.utils.GlobalConstants;
-import org.opendaylight.controller.sal.utils.HexEncode;
 import org.opendaylight.controller.sal.utils.ServiceHelper;
 import org.opendaylight.controller.switchmanager.ISwitchManager;
 import org.osgi.framework.ServiceRegistration;
@@ -70,28 +64,34 @@ public class SwitchManagerCLI {
             return;
         }
 
-        System.out.println("           Node               Type           MAC            Name      Tier");
-
         Set<Node> nodes = sm.getNodes();
         if (nodes == null || nodes.isEmpty()) {
             return;
         }
 
-        List<String> nodeArray = new ArrayList<String>();
+        Set<String> propertyList = new HashSet<String>();
         for (Node node : nodes) {
-            nodeArray.add(node.toString());
+            Map<String, Property> propList = sm.getNodeProps(node);
+            propertyList.addAll(propList.keySet());
+        }
+        List<String> sortedProps = new ArrayList<String>(propertyList);
+        Collections.sort(sortedProps);
+        String properties = String.format("%-26s  ", "Node");
+        for (String s : sortedProps) {
+            properties = properties.concat(String.format("%-18s ", s));
         }
-        Collections.sort(nodeArray);
-        for (String str : nodeArray) {
-            Node node = Node.fromString(str);
-            Description desc = ((Description) sm.getNodeProp(node, Description.propertyName));
-            Tier tier = ((Tier) sm.getNodeProp(node, Tier.TierPropName));
-            String nodeName = (desc == null) ? "" : desc.getValue();
-            MacAddress mac = (MacAddress) sm.getNodeProp(node, MacAddress.name);
-            String macAddr = (mac == null) ? "" : HexEncode.bytesToHexStringFormat(mac.getMacAddress());
-            int tierNum = (tier == null) ? 0 : tier.getValue();
-            System.out.println(node + "     " + node.getType() + "     " + macAddr + "     " + nodeName + "     "
-                    + tierNum);
+        System.out.println(properties);
+        for (Node node : nodes) {
+            String nodeProp = String.format("%-26s  ", node);
+            Map<String, Property> propList = sm.getNodeProps(node);
+            for (String s : sortedProps) {
+                if (propList.containsKey(s)) {
+                    nodeProp = nodeProp.concat(String.format("%-18s ", propList.get(s).getStringValue()));
+                } else {
+                    nodeProp = nodeProp.concat(String.format("%-18s ", "null"));
+                }
+            }
+            System.out.println(nodeProp);
         }
         System.out.println("Total number of Nodes: " + nodes.size());
     }
@@ -113,26 +113,34 @@ public class SwitchManagerCLI {
             return;
         }
 
-        System.out.println("          NodeConnector               BandWidth(Gbps)     Admin     State");
         Set<NodeConnector> nodeConnectorSet = sm.getNodeConnectors(target);
-        if (nodeConnectorSet == null) {
+        if (nodeConnectorSet == null || nodeConnectorSet.isEmpty()) {
             return;
         }
+
+        Set<String> propertyList = new HashSet<String>();
+        for (NodeConnector nodeConnector : nodeConnectorSet) {
+            Map<String, Property> propList = sm.getNodeConnectorProps(nodeConnector);
+            propertyList.addAll(propList.keySet());
+        }
+        List<String> sortedProps = new ArrayList<String>(propertyList);
+        Collections.sort(sortedProps);
+        String properties = String.format("%-33s  ", "NodeConnector");
+        for (String s : sortedProps) {
+            properties = properties.concat(String.format("%-18s ", s));
+        }
+        System.out.println(properties);
         for (NodeConnector nodeConnector : nodeConnectorSet) {
-            if (nodeConnector == null) {
-                continue;
+            String ncProp = String.format("%-33s  ", nodeConnector);
+            Map<String, Property> ncProperties = sm.getNodeConnectorProps(nodeConnector);
+            for (String s : sortedProps) {
+                if (ncProperties.containsKey(s)) {
+                    ncProp = ncProp.concat(String.format("%-18s ", ncProperties.get(s).getStringValue()));
+                } else {
+                    ncProp = ncProp.concat(String.format("%-18s ", "null"));
+                }
             }
-            Map<String, Property> propMap = sm.getNodeConnectorProps(nodeConnector);
-            Bandwidth bw = (Bandwidth) propMap.get(Bandwidth.BandwidthPropName);
-            Config config = (Config) propMap.get(Config.ConfigPropName);
-            State state = (State) propMap.get(State.StatePropName);
-            String out = nodeConnector + "           ";
-            out += (bw != null) ? bw.getValue() / Math.pow(10, 9) : "    ";
-            out += "             ";
-            out += (config != null) ? config.getValue() : " ";
-            out += "          ";
-            out += (state != null) ? state.getValue() : " ";
-            System.out.println(out);
+            System.out.println(ncProp);
         }
         System.out.println("Total number of NodeConnectors: " + nodeConnectorSet.size());
     }
index 54dbbdcce0b0b2d59b1494bb241829a9c17633e4..eb8a07e70773ca0dbcbf42958d7a03c105ac8e2f 100644 (file)
@@ -68,20 +68,13 @@ public class SwitchManagerIT {
                 // Set the systemPackages (used by clustering)
                 systemPackages("sun.reflect", "sun.reflect.misc", "sun.misc"),
                 // List framework bundles
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console",
-                        "1.0.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util",
-                        "1.0.400.v20120522-2049"),
-                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services",
-                        "3.3.100.v20120522-1822"),
-                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds",
-                        "1.4.0.v20120522-1841"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command",
-                        "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime",
-                        "0.8.0.v201108120515"),
-                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell",
-                        "0.8.0.v201110170705"),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.console").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.util").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.osgi.services").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.eclipse.equinox.ds").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.command").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.runtime").versionAsInProject(),
+                mavenBundle("equinoxSDK381", "org.apache.felix.gogo.shell").versionAsInProject(),
                 // List logger bundles
                 mavenBundle("org.slf4j", "slf4j-api").versionAsInProject(),
                 mavenBundle("org.slf4j", "log4j-over-slf4j")
index 103757264cce50de08747b6d43c2f44a20bfdcba..9524a76b012a1cb2d6a568aba3c51cb3ad975ac9 100644 (file)
@@ -464,6 +464,7 @@ one.f.switchmanager.subnetGatewayConfig = {
         }, 
         modal: {
             modal: "one_f_switchmanager_subnetGatewayConfig_id_modal_modal",
+                       ports : "one_f_switchmanager_subnetGatewayConfig_id_modal_ports",
             save: "one_f_switchmanager_subnetGatewayConfig_id_modal_save",
             form: {
                 name : "one_f_switchmanager_subnetGatewayConfig_id_modal_form_gatewayname",
@@ -586,7 +587,7 @@ one.f.switchmanager.subnetGatewayConfig = {
             ports: function() {
                 var h3 = "Add Ports";
                 var footer = one.f.switchmanager.subnetGatewayConfig.modal.footer();
-                var $modal = one.lib.modal.spawn(one.f.switchmanager.subnetGatewayConfig.id.modal.modal, h3, "", footer);
+                var $modal = one.lib.modal.spawn(one.f.switchmanager.subnetGatewayConfig.id.modal.ports, h3, "", footer);
                 // bind save button
                 $('#' + one.f.switchmanager.subnetGatewayConfig.id.modal.save, $modal).click(function() {
                     one.f.switchmanager.subnetGatewayConfig.modal.save.ports($modal);
index 6000efadc7444148ab5c51e7dcba9147e8e4840f..bc5c73a7d804c63b422295297685886a3636d368 100644 (file)
@@ -34,6 +34,9 @@
               org.opendaylight.controller.sal.utils,
               org.opendaylight.controller.usermanager,
               org.opendaylight.controller.containermanager,
+              org.opendaylight.controller.clustering.services,
+              org.opendaylight.controller.connectionmanager,
+              org.opendaylight.controller.switchmanager,
               com.google.gson,
               javax.annotation,
               javax.naming,
     </plugins>
   </build>
   <dependencies>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>clustering.services</artifactId>
+      <version>0.4.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>connectionmanager</artifactId>
+      <version>0.1.0-SNAPSHOT</version>
+    </dependency>
     <dependency>
       <groupId>org.opendaylight.controller</groupId>
       <artifactId>configuration</artifactId>
       <artifactId>containermanager</artifactId>
       <version>0.4.0-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>org.opendaylight.controller</groupId>
+      <artifactId>switchmanager</artifactId>
+      <version>0.5.0-SNAPSHOT</version>
+    </dependency>
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
diff --git a/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/ClusterNodeBean.java b/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/ClusterNodeBean.java
new file mode 100644 (file)
index 0000000..5e4f22a
--- /dev/null
@@ -0,0 +1,50 @@
+package org.opendaylight.controller.web;
+
+import java.net.InetAddress;
+
+/**
+ * Information about a clustered controller to send to the UI frontend
+ * @author andrekim
+ */
+public class ClusterNodeBean {
+    private final byte[] address;
+    private final String name;
+    private final Boolean me;
+    private final Boolean coordinator;
+
+    public static class Builder {
+        // required params
+        private final byte[] address;
+        private final String name;
+
+        // optional params
+        private Boolean me = null;
+        private Boolean coordinator = null;
+
+        public Builder(InetAddress address) {
+            this.address = address.getAddress();
+            this.name = address.getHostAddress();
+        }
+
+        public Builder highlightMe() {
+            this.me = true;
+            return this;
+        }
+
+        public Builder iAmCoordinator() {
+            this.coordinator = true;
+            return this;
+        }
+
+        public ClusterNodeBean build() {
+            return new ClusterNodeBean(this);
+        }
+    }
+
+    private ClusterNodeBean(Builder builder) {
+        this.address = builder.address;
+        this.name = builder.name;
+        this.me = builder.me;
+        this.coordinator = builder.coordinator;
+    }
+}
\ No newline at end of file
index 524cb62b3a2175d24596f4b5727a5d7a57310005..3b0b85c065cc8cf2de88205525aaaf6f89e84868 100644 (file)
@@ -8,14 +8,24 @@
 
 package org.opendaylight.controller.web;
 
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.ArrayList;
 import java.util.List;
+import java.util.Set;
 
 import javax.servlet.http.HttpServletRequest;
 
+import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
+import org.opendaylight.controller.connectionmanager.IConnectionManager;
 import org.opendaylight.controller.sal.authorization.UserLevel;
+import org.opendaylight.controller.sal.core.Description;
+import org.opendaylight.controller.sal.core.Node;
+import org.opendaylight.controller.sal.utils.GlobalConstants;
 import org.opendaylight.controller.sal.utils.ServiceHelper;
 import org.opendaylight.controller.sal.utils.Status;
 import org.opendaylight.controller.sal.utils.StatusCode;
+import org.opendaylight.controller.switchmanager.ISwitchManager;
 import org.opendaylight.controller.usermanager.IUserManager;
 import org.opendaylight.controller.usermanager.UserConfig;
 import org.springframework.stereotype.Controller;
@@ -30,14 +40,96 @@ import com.google.gson.Gson;
 @Controller
 @RequestMapping("/admin")
 public class DaylightWebAdmin {
+    Gson gson = new Gson();
 
+    /**
+     * Returns list of clustered controllers. Highlights "this" controller and
+     * if controller is coordinator
+     * @return List<ClusterBean>
+     */
+    @RequestMapping("/cluster")
+    @ResponseBody
+    public String getClusteredControllers() {
+        IClusterGlobalServices clusterServices = (IClusterGlobalServices) ServiceHelper.getGlobalInstance(
+                IClusterGlobalServices.class, this);
+        if (clusterServices == null) {
+            return null;
+        }
+
+        List<ClusterNodeBean> clusterNodes = new ArrayList<ClusterNodeBean>();
+
+        List<InetAddress> controllers = clusterServices.getClusteredControllers();
+        for (InetAddress controller : controllers) {
+            ClusterNodeBean.Builder clusterBeanBuilder = new ClusterNodeBean.Builder(controller);
+            if (controller.equals(clusterServices.getMyAddress())) {
+                clusterBeanBuilder.highlightMe();
+            }
+            if (clusterServices.getCoordinatorAddress().equals(controller)) {
+                clusterBeanBuilder.iAmCoordinator();
+            }
+            clusterNodes.add(clusterBeanBuilder.build());
+        }
 
+        return gson.toJson(clusterNodes);
+    }
+
+    /**
+     * Return nodes connected to controller {controller}
+     * @param controller
+     *            - byte[] of the address of the controller
+     * @return List<NodeBean>
+     */
+    @RequestMapping("/cluster/controller/{controller}")
+    @ResponseBody
+    public String getNodesConnectedToController(@PathVariable("controller") String controller) {
+        IClusterGlobalServices clusterServices = (IClusterGlobalServices) ServiceHelper.getGlobalInstance(
+                IClusterGlobalServices.class, this);
+        if (clusterServices == null) {
+            return null;
+        }
+        IConnectionManager connectionManager = (IConnectionManager) ServiceHelper.getGlobalInstance(
+                IConnectionManager.class, this);
+        if (connectionManager == null) {
+            return null;
+        }
+        ISwitchManager switchManager = (ISwitchManager) ServiceHelper.getInstance(ISwitchManager.class,
+                GlobalConstants.DEFAULT.toString(), this);
+        if (switchManager == null) {
+            return null;
+        }
+
+        byte[] address = gson.fromJson(controller, byte[].class);
+        InetAddress controllerAddress = null;
+        try {
+            controllerAddress = InetAddress.getByAddress(address);
+        } catch (UnknownHostException e) {
+            return null;
+        }
+
+        List<NodeBean> result = new ArrayList<NodeBean>();
+
+        Set<Node> nodes = connectionManager.getNodes(controllerAddress);
+        if (nodes == null) {
+            return gson.toJson(result);
+        }
+        for (Node node : nodes) {
+            Description description = (Description) switchManager.getNodeProp(node, Description.propertyName);
+            NodeBean nodeBean;
+            if (description == null || description.getValue().equals("None")) {
+                nodeBean = new NodeBean(node);
+            } else {
+                nodeBean = new NodeBean(node, description.getValue());
+            }
+            result.add(nodeBean);
+        }
+
+        return gson.toJson(result);
+    }
 
     @RequestMapping("/users")
     @ResponseBody
     public List<UserConfig> getUsers() {
-        IUserManager userManager = (IUserManager) ServiceHelper
-                .getGlobalInstance(IUserManager.class, this);
+        IUserManager userManager = (IUserManager) ServiceHelper.getGlobalInstance(IUserManager.class, this);
         if (userManager == null) {
             return null;
         }
@@ -52,13 +144,10 @@ public class DaylightWebAdmin {
      */
     @RequestMapping(value = "/users", method = RequestMethod.POST)
     @ResponseBody
-    public String saveLocalUserConfig(
-            @RequestParam(required = true) String json,
-            @RequestParam(required = true) String action,
-            HttpServletRequest request) {
+    public String saveLocalUserConfig(@RequestParam(required = true) String json,
+            @RequestParam(required = true) String action, HttpServletRequest request) {
 
-        IUserManager userManager = (IUserManager) ServiceHelper
-                .getGlobalInstance(IUserManager.class, this);
+        IUserManager userManager = (IUserManager) ServiceHelper.getGlobalInstance(IUserManager.class, this);
         if (userManager == null) {
             return "Internal Error";
         }
@@ -70,10 +159,9 @@ public class DaylightWebAdmin {
         Gson gson = new Gson();
         UserConfig config = gson.fromJson(json, UserConfig.class);
 
-        Status result = (action.equals("add")) ? userManager
-                .addLocalUser(config) : userManager.removeLocalUser(config);
-        if(result.getCode().equals(StatusCode.SUCCESS)) {
-            String userAction=(action.equals("add")) ? "added":"removed";
+        Status result = (action.equals("add")) ? userManager.addLocalUser(config) : userManager.removeLocalUser(config);
+        if (result.isSuccess()) {
+            String userAction = (action.equals("add")) ? "added" : "removed";
             DaylightWebUtil.auditlog("User", request.getUserPrincipal().getName(), userAction, config.getUser());
             return "Success";
         }
@@ -82,16 +170,14 @@ public class DaylightWebAdmin {
 
     @RequestMapping(value = "/users/{username}", method = RequestMethod.POST)
     @ResponseBody
-    public String removeLocalUser(@PathVariable("username") String userName,
-            HttpServletRequest request) {
+    public String removeLocalUser(@PathVariable("username") String userName, HttpServletRequest request) {
 
         String username = request.getUserPrincipal().getName();
         if (username.equals(userName)) {
             return "Invalid Request: User cannot delete itself";
         }
 
-        IUserManager userManager = (IUserManager) ServiceHelper
-                .getGlobalInstance(IUserManager.class, this);
+        IUserManager userManager = (IUserManager) ServiceHelper.getGlobalInstance(IUserManager.class, this);
         if (userManager == null) {
             return "Internal Error";
         }
@@ -101,7 +187,7 @@ public class DaylightWebAdmin {
         }
 
         Status result = userManager.removeLocalUser(userName);
-        if(result.getCode().equals(StatusCode.SUCCESS)) {
+        if (result.isSuccess()) {
             DaylightWebUtil.auditlog("User", request.getUserPrincipal().getName(), "removed", userName);
             return "Success";
         }
@@ -112,8 +198,7 @@ public class DaylightWebAdmin {
     @ResponseBody
     public Status changePassword(@PathVariable("username") String username, HttpServletRequest request,
             @RequestParam("currentPassword") String currentPassword, @RequestParam("newPassword") String newPassword) {
-        IUserManager userManager = (IUserManager) ServiceHelper
-                .getGlobalInstance(IUserManager.class, this);
+        IUserManager userManager = (IUserManager) ServiceHelper.getGlobalInstance(IUserManager.class, this);
         if (userManager == null) {
             return new Status(StatusCode.GONE, "User Manager not found");
         }
@@ -127,7 +212,7 @@ public class DaylightWebAdmin {
         }
 
         Status status = userManager.changeLocalUserPassword(username, currentPassword, newPassword);
-        if(status.isSuccess()){
+        if (status.isSuccess()) {
             DaylightWebUtil.auditlog("User", request.getUserPrincipal().getName(), "changed password for", username);
         }
         return status;
@@ -135,11 +220,9 @@ public class DaylightWebAdmin {
 
     /**
      * Is the operation permitted for the given level
-     *
      * @param level
      */
-    private boolean authorize(IUserManager userManager, UserLevel level,
-            HttpServletRequest request) {
+    private boolean authorize(IUserManager userManager, UserLevel level, HttpServletRequest request) {
         String username = request.getUserPrincipal().getName();
         UserLevel userLevel = userManager.getUserLevel(username);
         return userLevel.toNumber() <= level.toNumber();
diff --git a/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/NodeBean.java b/opendaylight/web/root/src/main/java/org/opendaylight/controller/web/NodeBean.java
new file mode 100644 (file)
index 0000000..21d9310
--- /dev/null
@@ -0,0 +1,21 @@
+package org.opendaylight.controller.web;
+
+import org.opendaylight.controller.sal.core.Node;
+
+/**
+ * Information about a node connected to a controller to send to the UI frontend
+ * @author andrekim
+ */
+public class NodeBean {
+    private final String node;
+    private final String description;
+
+    public NodeBean(Node node) {
+        this(node, node.toString());
+    }
+
+    public NodeBean(Node node, String description) {
+        this.node = node.toString();
+        this.description = description;
+    }
+}
index c7c3ef16c3fb037c55e0405ff0b46e5ef09c08fb..c795a5d56b920de6111141bea501a8b3dbcfaa57 100644 (file)
       <div class="icon-user"></div> ${username} <span class="caret"></span>
      </a>
      <ul class="dropdown-menu">
-      <li><a href="#admin" id="admin" data-role="${role}"><div
-         class="icon-users"></div> Users</a></li>
-      <li><a href="#save" id="save"><div class="icon-save"></div>
-        Save</a></li>
-      <li><a href="#logout" id="logout"><div
-         class="icon-logout"></div> Logout</a></li>
+      <li><a href="#admin" id="admin" data-role="${role}"><div class="icon-users"></div> Users</a></li>
+      <li><a href="#cluster" id="cluster"><div class="icon-cluster"></div>Cluster</a></li>
+      <li><a href="#save" id="save"><div class="icon-save"></div>Save</a></li>
+      <li><a href="#logout" id="logout"><div class="icon-logout"></div> Logout</a></li>
      </ul>
     </div>
    </div>
index 6ec818c18ca95ca60ec8d56b5d8080544ba09502..db9d7632d57550c66abb7bbdf801e5e18d6d7273 100644 (file)
                                .icon;
                                background-image: url('../img/user_group_0107_16.png');
                        }
+                       .icon-cluster {
+                               .icon;
+                               background-image: url('../img/topology_view_1033_16.png');
+                       }
                        .icon-save {
                                .icon;
                                background-image: url('../img/save_as_0106_16.png');
diff --git a/opendaylight/web/root/src/main/resources/img/topology_view_1033_16.png b/opendaylight/web/root/src/main/resources/img/topology_view_1033_16.png
new file mode 100644 (file)
index 0000000..1a13254
Binary files /dev/null and b/opendaylight/web/root/src/main/resources/img/topology_view_1033_16.png differ
index 90fd49772a71f0027811817cd3a07671db19f0d1..64dc09890d6382dec4caacb2a26acd64296a37fd 100644 (file)
@@ -26,6 +26,17 @@ one.lib.dashlet = {
         $h4.text(header);
         return $h4;
     },
+    label : function(name, type) {
+       var $span = $(document.createElement('span'));
+       $span.addClass('label');
+       if (type !== undefined) {
+               $span.addClass(type);
+       } else if (type !== null) {
+               $span.addClass('label-info');
+       }
+       $span.append(name);
+       return $span;
+    },
     list : function(list) {
         var $ul = $(document.createElement('ul'));
         $(list).each(function(index, value) {
@@ -251,7 +262,7 @@ one.lib.modal = {
 one.lib.form = {
     // create select-option form element
     select : {
-        create : function(options, multiple) {
+        create : function(options, multiple, sort) {
             // assert - auto assign
             if (options == undefined)
                 options = {};
@@ -261,6 +272,24 @@ one.lib.form = {
                 $select.attr("multiple", "multiple");
             }
             var optionArray = one.lib.form.select.options(options);
+
+            // If specified, sort the option elements based on their text field
+            if (sort == true && optionArray.length > 1) {
+                var shifted = true;
+                var limit = optionArray.length;
+                while (shifted) {
+                    shifted = false;
+                    for ( var i = 1; i < limit; i++) {
+                        if (optionArray[i - 1].text() > optionArray[i].text()) {
+                            var swap = optionArray[i - 1];
+                            optionArray[i - 1] = optionArray[i];
+                            optionArray[i] = swap;
+                            shifted = true;
+                        }
+                    }
+                }
+            }
+
             $(optionArray).each(function(index, value) {
                 $select.append(value);
             });
index b82a85a74aeb1c28ee9a12027ac83b3b708400f2..85e4d472ef0d5f89e3e274543e4040a3b2e22ae2 100644 (file)
@@ -175,12 +175,9 @@ one.main.admin = {
         },
         footer : function() {
             var footer = [];
-
-            var closeButton = one.lib.dashlet.button.single("Close",
-                    one.main.admin.id.modal.close, "", "");
+            var closeButton = one.lib.dashlet.button.single('Close', one.main.admin.id.modal.close, '', '');
             var $closeButton = one.lib.dashlet.button.button(closeButton);
             footer.push($closeButton);
-
             return footer;
         }
     },
@@ -257,76 +254,53 @@ one.main.admin = {
                 var $body = one.main.admin.remove.body();
                 var $modal = one.lib.modal.spawn(one.main.admin.id.modal.user,
                         h3, $body, footer);
-
                 // close binding
-                $('#' + one.main.admin.id.modal.remove.close, $modal).click(
-                        function() {
-                            $modal.modal('hide');
-                        });
-
+                $('#'+one.main.admin.id.modal.remove.close, $modal).click(function() {
+                                       $modal.modal('hide');
+                               });
                 // remove binding
-                $('#' + one.main.admin.id.modal.remove.user, $modal)
-                        .click(
-                                function() {
-                                    one.main.admin.remove.modal
-                                            .ajax(
-                                                    id,
-                                                    function(result) {
-                                                        if (result == 'Success') {
-                                                            $modal
-                                                                    .modal('hide');
-                                                            // body inject
-                                                            var $admin = $('#'
-                                                                    + one.main.admin.id.modal.main);
-                                                            one.main.admin.ajax
-                                                                    .users(function($body) {
-                                                                        one.lib.modal.inject
-                                                                                .body(
-                                                                                        $admin,
-                                                                                        $body);
-                                                                    });
-                                                        } else
-                                                            alert("Failed to remove user: "
-                                                                    + result);
-                                                    });
-                                });
-
+                $('#' + one.main.admin.id.modal.remove.user, $modal).click(function() {
+                                       one.main.admin.remove.modal.ajax(id, function(result) {
+                                               if (result == 'Success') {
+                                                       $modal.modal('hide');
+                                                       // body inject
+                                                       var $admin = $('#'+one.main.admin.id.modal.main);
+                                                       one.main.admin.ajax.users(function($body) {
+                                                               one.lib.modal.inject.body($admin, $body);
+                                                       });
+                                               } else {
+                                                       alert("Failed to remove user: " + result);
+                                               }
+                                       });
+                               });
                                // change password binding
                                $('#' + one.main.admin.id.modal.remove.password, $modal).click(function() {
                                        one.main.admin.password.initialize(id, function() {
                                                $modal.modal('hide');
                                        });
                                });
-
                 $modal.modal();
             },
             ajax : function(id, callback) {
-                $.post(one.main.admin.address.root
-                        + one.main.admin.address.users + '/' + id,
-                        function(data) {
-                            callback(data);
-                        });
+                $.post(one.main.admin.address.root + one.main.admin.address.users + '/' + id, function(data) {
+                       callback(data);
+                });
             },
         },
-
         footer : function() {
             var footer = [];
-
             var removeButton = one.lib.dashlet.button.single("Remove User",
                     one.main.admin.id.modal.remove.user, "btn-danger", "");
             var $removeButton = one.lib.dashlet.button.button(removeButton);
             footer.push($removeButton);
-
                        var change = one.lib.dashlet.button.single('Change Password',
                                        one.main.admin.id.modal.remove.password, 'btn-success', '');
                        var $change = one.lib.dashlet.button.button(change);
                        footer.push($change);
-
             var closeButton = one.lib.dashlet.button.single("Close",
                     one.main.admin.id.modal.remove.close, "", "");
             var $closeButton = one.lib.dashlet.button.button(closeButton);
             footer.push($closeButton);
-
             return footer;
         },
         body : function() {
@@ -343,40 +317,25 @@ one.main.admin = {
                 var $body = one.main.admin.add.body();
                 var $modal = one.lib.modal.spawn(one.main.admin.id.modal.user,
                         h3, $body, footer);
-
                 // close binding
-                $('#' + one.main.admin.id.modal.add.close, $modal).click(
-                        function() {
-                            $modal.modal('hide');
-                        });
-
+                $('#' + one.main.admin.id.modal.add.close, $modal).click(function() {
+                                       $modal.modal('hide');
+                               });
                 // add binding
-                $('#' + one.main.admin.id.modal.add.user, $modal)
-                        .click(
-                                function() {
-                                    one.main.admin.add.modal
-                                            .add(
-                                                    $modal,
-                                                    function(result) {
-                                                        if (result == 'Success') {
-                                                            $modal
-                                                                    .modal('hide');
-                                                            // body inject
-                                                            var $admin = $('#'
-                                                                    + one.main.admin.id.modal.main);
-                                                            one.main.admin.ajax
-                                                                    .users(function($body) {
-                                                                        one.lib.modal.inject
-                                                                                .body(
-                                                                                        $admin,
-                                                                                        $body);
-                                                                    });
-                                                        } else
-                                                            alert("Failed to add user: "
-                                                                    + result);
-                                                    });
-                                });
-
+                $('#' + one.main.admin.id.modal.add.user, $modal).click(function() {
+                                       one.main.admin.add.modal.add($modal, function(result) {
+                                               if (result == 'Success') {
+                                                       $modal.modal('hide');
+                                                       // body inject
+                                                       var $admin = $('#'+one.main.admin.id.modal.main);
+                                                       one.main.admin.ajax.users(function($body) {
+                                                               one.lib.modal.inject.body($admin, $body);
+                                                       });
+                                               } else {
+                                                       alert("Failed to add user: "+result);
+                                               }
+                                       });
+                               });
                 $modal.modal();
             },
             add : function($modal, callback) {
@@ -550,6 +509,155 @@ one.main.admin = {
        }
 }
 
+one.main.cluster = {
+       id : { // one.main.cluster.id
+               modal : 'one-main-cluster-id-modal',
+               close : 'one-main-cluster-id-close',
+               datagrid : 'one-main-cluster-id-datagrid'
+       },
+       initialize : function() {
+               var h3 = 'Cluster Management';
+               var footer = one.main.cluster.footer();
+               var $body = '';
+               var $modal = one.lib.modal.spawn(one.main.cluster.id.modal, h3, $body, footer); 
+
+               // close
+               $('#'+one.main.cluster.id.close, $modal).click(function() {
+                       $modal.modal('hide');
+               });
+
+               // body
+               $.getJSON('/admin/cluster', function(data) {
+                       var $gridHTML = one.lib.dashlet.datagrid.init(one.main.cluster.id.datagrid, {
+                               searchable: true,
+                               filterable: false,
+                               pagination: true,
+                               flexibleRowsPerPage: true
+                       }, 'table-striped table-condensed table-cursor');
+                       var source = one.main.cluster.data(data);
+                       $gridHTML.datagrid({dataSource : source}).on('loaded', function() {
+                               $(this).find('tbody tr').click(function() {
+                                       var $tr = $(this);
+                                       if ($tr.find('td:nth-child(1)').attr('colspan') === '1') {
+                                               return false;
+                                       }
+                                       var address = $tr.find('.ux-id').text();
+                                       one.main.cluster.nodes.initialize(address);
+                               });
+                       });
+                       one.lib.modal.inject.body($modal, $gridHTML);
+               });
+
+               $modal.modal();
+       },
+       data : function(data) {
+               var tdata = [];
+               var registry = [];
+               $(data).each(function(idx, val) {
+                       var name = val.name;
+                       var address = val.address;
+                       var $registry = $(document.createElement('span'));
+                       $registry
+                               .append(JSON.stringify(address))
+                               .css('display', 'none')
+                               .addClass('ux-id');
+                       name = one.lib.dashlet.label(name, null)[0].outerHTML;
+                       name += $registry[0].outerHTML;
+                       if (val.me === true) {
+                               var me = one.lib.dashlet.label('*', 'label-inverse')[0].outerHTML;
+                               name += '&nbsp;'+me;
+                       }
+                       if (val.coordinator === true) {
+                               var coord = one.lib.dashlet.label('C')[0].outerHTML;
+                               name += '&nbsp;'+coord;
+                       }
+                       tdata.push({
+                               'controller' : name
+                       });
+               });
+               var source = new StaticDataSource({
+                       columns : [
+                               {
+                                       property : 'controller',
+                                       label : 'Controller',
+                                       sortable : true
+                               }
+                       ],
+                       data : tdata,
+                       delay : 0
+               });
+               return source;
+       },
+       footer : function() {
+               var footer = [];
+               var close = one.lib.dashlet.button.single('Close', one.main.cluster.id.close, '', '');
+               var $close = one.lib.dashlet.button.button(close);
+               footer.push($close);
+               return footer;
+       }
+}
+
+one.main.cluster.nodes = {
+       id : { // one.main.cluster.nodes.id
+               modal : 'one-main-cluster-nodes-id-modal',
+               close : 'one-main-cluster-nodes-id-close',
+               datagrid : 'one-main-cluser-nodes-id-datagrid'
+       },
+       initialize : function(address) { // one.main.cluster.nodes.initialize
+               var h3 = 'Connected Nodes';
+               var footer = one.main.cluster.nodes.footer();
+               var $body = '';
+               var $modal = one.lib.modal.spawn(one.main.cluster.nodes.id.modal, h3, $body, footer);
+
+               // close
+               $('#'+one.main.cluster.nodes.id.close, $modal).click(function() {
+                       $modal.modal('hide');
+               });
+               
+               // body
+               $.getJSON('/admin/cluster/controller/'+address, function(data) {
+                       var $gridHTML = one.lib.dashlet.datagrid.init(one.main.cluster.nodes.id.datagrid, {
+                               searchable: true,
+                               filterable: false,
+                               pagination: true,
+                               flexibleRowsPerPage: true
+                       }, 'table-striped table-condensed');
+                       var source = one.main.cluster.nodes.data(data);
+                       $gridHTML.datagrid({dataSource : source});
+                       one.lib.modal.inject.body($modal, $gridHTML);
+               });
+
+               $modal.modal();
+       },
+       data : function(data) {
+               var tdata = [];
+               $(data).each(function(idx, val) {
+                       tdata.push({
+                               'node' : val.description
+                       });
+               });
+               var source = new StaticDataSource({
+                       columns : [
+                               {
+                                       property : 'node',
+                                       label : 'Node',
+                                       sortable : true
+                               }
+                       ],
+                       data : tdata,
+                       delay : 0
+               });
+               return source;
+       },
+       footer : function() { // one.main.cluster.nodes.footer
+               var footer = [];
+               var close = one.lib.dashlet.button.single('Close', one.main.cluster.nodes.id.close, '', '');
+               var $close = one.lib.dashlet.button.button(close);
+               footer.push($close);
+               return footer;
+       }
+}
+
 one.main.dashlet = {
     left : {
         top : $("#left-top .dashlet"),
@@ -581,6 +689,11 @@ $("#admin").click(function() {
     });
 });
 
+// cluster
+$('#cluster').click(function() {
+       one.main.cluster.initialize();
+});
+
 // save
 $("#save").click(function() {
     $.post(one.main.constants.address.save, function(data) {