refactor waveserver. Allow future drivers

Change-Id: I8ca4ed2435d42aaf5d58eb020aa3a6cfd17c6fa4
diff --git a/drivers/ciena/README.md b/drivers/ciena/README.md
new file mode 100644
index 0000000..7a29a1d
--- /dev/null
+++ b/drivers/ciena/README.md
@@ -0,0 +1,4 @@
+There is no BUCK or pom.xml file at this level because each driver 
+should be completely independent of each other. i.e. The will be 
+treated as individual applications. The 'microsemi' folder is only 
+a grouping mechanism at the directory level. 
\ No newline at end of file
diff --git a/drivers/ciena/BUCK b/drivers/ciena/waveserver/BUCK
similarity index 81%
rename from drivers/ciena/BUCK
rename to drivers/ciena/waveserver/BUCK
index efc3835..0f3e825 100644
--- a/drivers/ciena/BUCK
+++ b/drivers/ciena/waveserver/BUCK
@@ -16,7 +16,7 @@
 ]
 
 BUNDLES = [
-    ':onos-drivers-ciena',
+    ':onos-drivers-ciena-waveserver',
     '//drivers/utilities:onos-drivers-utilities',
 ]
 
@@ -34,11 +34,11 @@
 )
 
 onos_app (
-    app_name = 'org.onosproject.drivers.ciena',
-    title = 'Ciena Drivers',
+    app_name = 'org.onosproject.drivers.ciena.waveserver.rest',
+    title = 'Ciena Waveserver Drivers',
     category = 'Drivers',
     url = 'http://onosproject.org',
-    description = 'Adds support for Ciena devices.',
+    description = 'Adds support for Ciena Waveserver devices.',
     included_bundles = BUNDLES,
     required_apps = REQUIRED_APPS,
 )
diff --git a/drivers/ciena/waveserver/README.md b/drivers/ciena/waveserver/README.md
new file mode 100644
index 0000000..aef0dc9
--- /dev/null
+++ b/drivers/ciena/waveserver/README.md
@@ -0,0 +1,61 @@
+# Ciena Waveserver
+
+This driver allows connection to the Ciena Waveserver
+
+The User Guide for this product is available on request from Ciena, and gives a full explanation of the theory of operation, functionality and how all functions can be accessed through the REST interface.
+
+Currently only a subset of it's functionality is supported through ONOS, but this will expand to full functionality in future releases.
+
+## Compile and Installation
+
+Currently this driver is built using BUCK and uses version 2.1 of onos-yang-tools<br/>
+
+All that is required to activate the driver is to run the following at the ONOS CLI
+
+```bash
+app activate org.onosproject.drivers.ciena.waveserver.rest
+```
+
+## Usage
+
+### Creating Devices
+
+Ciena Waveserver Devices are not Openflow devices. The connectivity is initiated from ONOS. They have to be created through the network/configuration REST interface in ONOS.
+
+* The name must follow the format **rest:ipaddr:port**
+* The **ip** and **port** must correspond to the ip and port in the name (above).
+
+```bash
+curl -X POST
+  http://onos-ip:8181/onos/v1/network/configuration
+  -H 'Authorization: Basic b25vczpyb2Nrcw==' \
+  -H 'Content-Type: application/json' \
+  -d '{
+    "devices": {
+      "rest:10.181.66.217:443": {
+        "rest": {
+          "port": 443,
+          "ip": "10.181.66.217",
+          "username": "su",
+          "password": "cws",
+          "protocol": "https",
+          "url": "/yang-api/datastore/"
+        },
+        "basic": {
+          "driver": "ciena-waveserver-rest"
+        }
+      }
+    }
+}'
+```
+
+
+
+#### Verify Connected Device
+
+When the Waveserver is configured and connected is should be visible in ONOS through the `devices` command.
+
+```bash 
+onos> devices 
+id=rest:10.181.66.217:443, available=true, local-status=connected 32s ago, role=MASTER, type=SWITCH, mfr=unknown, hw=unknown, sw=unknown, serial=unknown, driver=ciena-waveserver-rest, ipaddress=10.181.66.217, locType=geo, name=rest:10.181.66.217:443, protocol=REST
+```
diff --git a/drivers/ciena/features.xml b/drivers/ciena/waveserver/features.xml
similarity index 100%
rename from drivers/ciena/features.xml
rename to drivers/ciena/waveserver/features.xml
diff --git a/drivers/ciena/pom.xml b/drivers/ciena/waveserver/pom.xml
similarity index 88%
rename from drivers/ciena/pom.xml
rename to drivers/ciena/waveserver/pom.xml
index 53c195b..ee214e6 100644
--- a/drivers/ciena/pom.xml
+++ b/drivers/ciena/waveserver/pom.xml
@@ -25,15 +25,15 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>onos-drivers-ciena</artifactId>
+    <artifactId>onos-drivers-ciena-waveserver-rest</artifactId>
     <packaging>bundle</packaging>
 
-    <description>Ciena device drivers</description>
+    <description>Ciena Waveserver device drivers</description>
 
     <properties>
-        <onos.app.name>org.onosproject.drivers.ciena</onos.app.name>
+        <onos.app.name>org.onosproject.drivers.ciena.waveserver.rest</onos.app.name>
         <onos.app.origin>ONOS Community</onos.app.origin>
-        <onos.app.title>Ciena Device Drivers</onos.app.title>
+        <onos.app.title>Ciena Waveserver Device Drivers</onos.app.title>
         <onos.app.category>Drivers</onos.app.category>
         <onos.app.url>http://onosproject.org</onos.app.url>
         <onos.app.requires>
diff --git a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaDriversLoader.java b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaDriversLoader.java
similarity index 94%
rename from drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaDriversLoader.java
rename to drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaDriversLoader.java
index 2fd72c5..11e3fc5 100644
--- a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaDriversLoader.java
+++ b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaDriversLoader.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.drivers.ciena;
+package org.onosproject.drivers.ciena.waveserver.rest;
 
 import org.apache.felix.scr.annotations.Component;
 import org.onosproject.net.driver.AbstractDriverLoader;
diff --git a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaFlowRuleProgrammable.java b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaFlowRuleProgrammable.java
similarity index 98%
rename from drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaFlowRuleProgrammable.java
rename to drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaFlowRuleProgrammable.java
index 5e05232..6dc0400 100644
--- a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaFlowRuleProgrammable.java
+++ b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaFlowRuleProgrammable.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.drivers.ciena;
+package org.onosproject.drivers.ciena.waveserver.rest;
 
 import org.onosproject.net.DeviceId;
 import org.onosproject.net.OchSignal;
diff --git a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaRestDevice.java b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaRestDevice.java
similarity index 99%
rename from drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaRestDevice.java
rename to drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaRestDevice.java
index 96f557f..ea02de3 100644
--- a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaRestDevice.java
+++ b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaRestDevice.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.drivers.ciena;
+package org.onosproject.drivers.ciena.waveserver.rest;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveServerAlarmConsumer.java b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveServerAlarmConsumer.java
similarity index 95%
rename from drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveServerAlarmConsumer.java
rename to drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveServerAlarmConsumer.java
index a274622..c1a6767 100644
--- a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveServerAlarmConsumer.java
+++ b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveServerAlarmConsumer.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.drivers.ciena;
+package org.onosproject.drivers.ciena.waveserver.rest;
 
 import org.onosproject.incubator.net.faultmanagement.alarm.Alarm;
 import org.onosproject.incubator.net.faultmanagement.alarm.AlarmConsumer;
diff --git a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveServerLambdaQuery.java b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveServerLambdaQuery.java
similarity index 96%
rename from drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveServerLambdaQuery.java
rename to drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveServerLambdaQuery.java
index 596d152..cb5d452 100644
--- a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveServerLambdaQuery.java
+++ b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveServerLambdaQuery.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.drivers.ciena;
+package org.onosproject.drivers.ciena.waveserver.rest;
 
 import org.onosproject.net.ChannelSpacing;
 import org.onosproject.net.OchSignal;
diff --git a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveserverDeviceDescription.java b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveserverDeviceDescription.java
similarity index 98%
rename from drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveserverDeviceDescription.java
rename to drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveserverDeviceDescription.java
index bd411c1..0cd3b2b 100644
--- a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveserverDeviceDescription.java
+++ b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveserverDeviceDescription.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.drivers.ciena;
+package org.onosproject.drivers.ciena.waveserver.rest;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.Lists;
diff --git a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveserverPortAdmin.java b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveserverPortAdmin.java
similarity index 97%
rename from drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveserverPortAdmin.java
rename to drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveserverPortAdmin.java
index a943f7a..d3895c1 100644
--- a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/CienaWaveserverPortAdmin.java
+++ b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/CienaWaveserverPortAdmin.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.drivers.ciena;
+package org.onosproject.drivers.ciena.waveserver.rest;
 
 import org.onlab.util.Tools;
 import org.onosproject.net.PortNumber;
diff --git a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/package-info.java b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/package-info.java
similarity index 92%
rename from drivers/ciena/src/main/java/org/onosproject/drivers/ciena/package-info.java
rename to drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/package-info.java
index fbd462f..220063b 100644
--- a/drivers/ciena/src/main/java/org/onosproject/drivers/ciena/package-info.java
+++ b/drivers/ciena/waveserver/src/main/java/org/onosproject/drivers/ciena/waveserver/rest/package-info.java
@@ -17,4 +17,4 @@
 /**
  * Package for Ciena device drivers.
  */
-package org.onosproject.drivers.ciena;
\ No newline at end of file
+package org.onosproject.drivers.ciena.waveserver.rest;
\ No newline at end of file
diff --git a/drivers/ciena/src/main/resources/ciena-drivers.xml b/drivers/ciena/waveserver/src/main/resources/ciena-drivers.xml
similarity index 68%
rename from drivers/ciena/src/main/resources/ciena-drivers.xml
rename to drivers/ciena/waveserver/src/main/resources/ciena-drivers.xml
index 378626b..1a779b1 100644
--- a/drivers/ciena/src/main/resources/ciena-drivers.xml
+++ b/drivers/ciena/waveserver/src/main/resources/ciena-drivers.xml
@@ -16,19 +16,19 @@
   -->
 <drivers>
     <!-- Waveserver supports flex grid, although this driver only enables 50 GHz fixed grid. -->
-    <driver name="restCiena" manufacturer="Ciena" hwVersion="1.0.0" swVersion="1.0.0">
+    <driver name="ciena-waveserver-rest" manufacturer="Ciena" hwVersion="1.0.0" swVersion="1.0.0">
         <behaviour api="org.onosproject.net.optical.OpticalDevice"
                    impl="org.onosproject.net.optical.DefaultOpticalDevice"/>
         <behaviour api="org.onosproject.net.device.DeviceDescriptionDiscovery"
-                   impl="org.onosproject.drivers.ciena.CienaWaveserverDeviceDescription"/>
+                   impl="org.onosproject.drivers.ciena.waveserver.rest.CienaWaveserverDeviceDescription"/>
         <behaviour api="org.onosproject.net.behaviour.PortAdmin"
-                   impl="org.onosproject.drivers.ciena.CienaWaveserverPortAdmin"/>
+                   impl="org.onosproject.drivers.ciena.waveserver.rest.CienaWaveserverPortAdmin"/>
         <behaviour api="org.onosproject.net.flow.FlowRuleProgrammable"
-                   impl="org.onosproject.drivers.ciena.CienaFlowRuleProgrammable"/>
+                   impl="org.onosproject.drivers.ciena.waveserver.rest.CienaFlowRuleProgrammable"/>
         <behaviour api="org.onosproject.net.behaviour.LambdaQuery"
-                   impl="org.onosproject.drivers.ciena.CienaWaveServerLambdaQuery"/>
+                   impl="org.onosproject.drivers.ciena.waveserver.rest.CienaWaveServerLambdaQuery"/>
         <behaviour api="org.onosproject.incubator.net.faultmanagement.alarm.AlarmConsumer"
-                   impl="org.onosproject.drivers.ciena.CienaWaveServerAlarmConsumer"/>
+                   impl="org.onosproject.drivers.ciena.waveserver.rest.CienaWaveServerAlarmConsumer"/>
     </driver>
 </drivers>
 
diff --git a/drivers/ciena/src/test/java/org/onosproject/drivers/ciena/CienaDriversLoaderTest.java b/drivers/ciena/waveserver/src/test/java/org/onosproject/drivers/ciena/waveserver/rest/CienaDriversLoaderTest.java
similarity index 93%
rename from drivers/ciena/src/test/java/org/onosproject/drivers/ciena/CienaDriversLoaderTest.java
rename to drivers/ciena/waveserver/src/test/java/org/onosproject/drivers/ciena/waveserver/rest/CienaDriversLoaderTest.java
index 198ff00..3a2786f 100644
--- a/drivers/ciena/src/test/java/org/onosproject/drivers/ciena/CienaDriversLoaderTest.java
+++ b/drivers/ciena/waveserver/src/test/java/org/onosproject/drivers/ciena/waveserver/rest/CienaDriversLoaderTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.onosproject.drivers.ciena;
+package org.onosproject.drivers.ciena.waveserver.rest;
 
 import org.junit.Before;
 import org.onosproject.net.driver.AbstractDriverLoaderTest;