Additions to the L2 monitoring for CFM and SOAM

Change-Id: I2d39dd9e1c4841c87cb0a27d82bb303ffd9c08fc
diff --git a/apps/cfm/src/main/java/org/onosproject/cfm/impl/CfmWebApplication.java b/apps/cfm/src/main/java/org/onosproject/cfm/rest/CfmWebApplication.java
similarity index 88%
rename from apps/cfm/src/main/java/org/onosproject/cfm/impl/CfmWebApplication.java
rename to apps/cfm/src/main/java/org/onosproject/cfm/rest/CfmWebApplication.java
index f21b66d..13157f2 100644
--- a/apps/cfm/src/main/java/org/onosproject/cfm/impl/CfmWebApplication.java
+++ b/apps/cfm/src/main/java/org/onosproject/cfm/rest/CfmWebApplication.java
@@ -14,13 +14,13 @@
  * limitations under the License.
  */
 
-package org.onosproject.cfm.impl;
+package org.onosproject.cfm.rest;
 
 import java.util.Set;
 
 import org.onlab.rest.AbstractWebApplication;
-import org.onosproject.soam.impl.DmWebResource;
-import org.onosproject.soam.impl.LmWebResource;
+import org.onosproject.soam.rest.DmWebResource;
+import org.onosproject.soam.rest.LmWebResource;
 
 /**
  * CFM REST API web application.
diff --git a/apps/cfm/src/main/java/org/onosproject/cfm/impl/MaWebResource.java b/apps/cfm/src/main/java/org/onosproject/cfm/rest/MaWebResource.java
similarity index 98%
rename from apps/cfm/src/main/java/org/onosproject/cfm/impl/MaWebResource.java
rename to apps/cfm/src/main/java/org/onosproject/cfm/rest/MaWebResource.java
index c861314..85b7ac4 100644
--- a/apps/cfm/src/main/java/org/onosproject/cfm/impl/MaWebResource.java
+++ b/apps/cfm/src/main/java/org/onosproject/cfm/rest/MaWebResource.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.cfm.impl;
+package org.onosproject.cfm.rest;
 
 import java.io.InputStream;
 import java.net.URI;
@@ -121,6 +121,7 @@
     /**
      * Create Maintenance Association by MD and MA name.
      *
+     * @onos.rsModel MaCreate
      * @param mdName The name of a Maintenance Domain
      * @param input A JSON formatted input stream specifying the MA parameters
      * @return 200 OK or 500 on error
diff --git a/apps/cfm/src/main/java/org/onosproject/cfm/impl/MdWebResource.java b/apps/cfm/src/main/java/org/onosproject/cfm/rest/MdWebResource.java
similarity index 98%
rename from apps/cfm/src/main/java/org/onosproject/cfm/impl/MdWebResource.java
rename to apps/cfm/src/main/java/org/onosproject/cfm/rest/MdWebResource.java
index ecf1fe9..c642f4a 100644
--- a/apps/cfm/src/main/java/org/onosproject/cfm/impl/MdWebResource.java
+++ b/apps/cfm/src/main/java/org/onosproject/cfm/rest/MdWebResource.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.cfm.impl;
+package org.onosproject.cfm.rest;
 
 import java.io.InputStream;
 import java.net.URI;
@@ -125,6 +125,7 @@
     /**
      * Create Maintenance Domain.
      *
+     * @onos.rsModel MdCreate
      * @param input A JSON formatted input stream specifying the MA parameters
      * @return 200 OK, 304 if MD already exists or 500 on error
      */
diff --git a/apps/cfm/src/main/java/org/onosproject/cfm/impl/MepWebResource.java b/apps/cfm/src/main/java/org/onosproject/cfm/rest/MepWebResource.java
similarity index 98%
rename from apps/cfm/src/main/java/org/onosproject/cfm/impl/MepWebResource.java
rename to apps/cfm/src/main/java/org/onosproject/cfm/rest/MepWebResource.java
index 2486df0..fa8c728 100644
--- a/apps/cfm/src/main/java/org/onosproject/cfm/impl/MepWebResource.java
+++ b/apps/cfm/src/main/java/org/onosproject/cfm/rest/MepWebResource.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.onosproject.cfm.impl;
+package org.onosproject.cfm.rest;
 
 import java.io.InputStream;
 import java.net.URI;
@@ -164,6 +164,7 @@
     /**
      * Create MEP with MD name, MA name and Mep Json.
      *
+     * @onos.rsModel MepCreate
      * @param mdName The name of a Maintenance Domain
      * @param maName The name of a Maintenance Association belonging to the MD
      * @param input A JSON formatted input stream specifying the Mep parameters
@@ -207,6 +208,7 @@
     /**
      * Transmit Loopback on MEP with MD name, MA name and Mep Id.
      *
+     * @onos.rsModel MepLbTransmit
      * @param mdName The name of a Maintenance Domain
      * @param maName The name of a Maintenance Association belonging to the MD
      * @param mepIdShort The id of a MEP belonging to the MA
@@ -296,6 +298,7 @@
     /**
      * Transmit Linktrace on MEP with MD name, MA name and Mep Id.
      *
+     * @onos.rsModel MepLtTransmit
      * @param mdName The name of a Maintenance Domain
      * @param maName The name of a Maintenance Association belonging to the MD
      * @param mepIdShort The id of a MEP belonging to the MA
diff --git a/apps/cfm/src/main/java/org/onosproject/cfm/impl/package-info.java b/apps/cfm/src/main/java/org/onosproject/cfm/rest/package-info.java
similarity index 94%
rename from apps/cfm/src/main/java/org/onosproject/cfm/impl/package-info.java
rename to apps/cfm/src/main/java/org/onosproject/cfm/rest/package-info.java
index 798317d..18fef69 100644
--- a/apps/cfm/src/main/java/org/onosproject/cfm/impl/package-info.java
+++ b/apps/cfm/src/main/java/org/onosproject/cfm/rest/package-info.java
@@ -16,4 +16,4 @@
 /**
  * REST Web Application for CFM.
  */
-package org.onosproject.cfm.impl;
\ No newline at end of file
+package org.onosproject.cfm.rest;
\ No newline at end of file
diff --git a/apps/cfm/src/main/java/org/onosproject/cfm/web/RMepCodec.java b/apps/cfm/src/main/java/org/onosproject/cfm/web/RMepCodec.java
index 7edb204..ff4f775 100644
--- a/apps/cfm/src/main/java/org/onosproject/cfm/web/RMepCodec.java
+++ b/apps/cfm/src/main/java/org/onosproject/cfm/web/RMepCodec.java
@@ -53,10 +53,10 @@
             return null;
         }
 
-        JsonNode vidNode = json.get("rmep");
+        JsonNode rmepNode = json.get("rmep");
 
-        return MepId.valueOf(
-                    nullIsIllegal((short) vidNode.asInt(), "rmep is required"));
+        return MepId.valueOf((short)
+                    nullIsIllegal(rmepNode, "rmep is required").asInt());
 
     }