Added a Java API required and updated Javadoc comments.
authorG S Senthil Kumar <senthil.gs@samsung.com>
Tue, 1 Mar 2016 11:33:48 +0000 (17:03 +0530)
committerMadan Lanka <lanka.madan@samsung.com>
Thu, 3 Mar 2016 08:21:38 +0000 (08:21 +0000)
Java API added to change the attribute name after creation.

Change-Id: I94a29031aeb9ad9441430eaf5ef7cb8041e550f6
Signed-off-by: G S Senthil Kumar <senthil.gs@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/5275
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Madan Lanka <lanka.madan@samsung.com>
service/simulator/java/sdk/src/org/oic/simulator/SimulatorResourceAttribute.java
service/simulator/java/sdk/src/org/oic/simulator/client/SimulatorRemoteResource.java
service/simulator/java/sdk/src/org/oic/simulator/server/SimulatorResource.java
service/simulator/java/sdk/src/org/oic/simulator/server/SimulatorSingleResource.java

index 272316f..35c4fd1 100644 (file)
@@ -88,6 +88,16 @@ public class SimulatorResourceAttribute {
     }
 
     /**
+     * API to set the name of attribute.
+     *
+     * @param name
+     *            Name of the attribute.
+     */
+    public void setName(String name) {
+        this.mName = name;
+    }
+
+    /**
      * API to set the value of attribute.
      *
      * @param value
index 12a8615..8e5e46e 100644 (file)
@@ -293,8 +293,6 @@ public final class SimulatorRemoteResource {
     /**
      * API to start observing the resource.
      *
-     * @param type
-     *            Type of observation.
      * @param onObserveListener
      *            The handler method which will be invoked with a map of
      *            attribute names and values whenever there is a change in
@@ -314,8 +312,6 @@ public final class SimulatorRemoteResource {
     /**
      * API to start observing the resource.
      *
-     * @param type
-     *            Type of observation.
      * @param queryParams
      *            Map which can have the query parameter names and values.
      * @param onObserveListener
index 3a90584..0f63299 100644 (file)
@@ -64,10 +64,6 @@ public class SimulatorResource {
      * resource.
      *
      * @return True if the resource is collection, otherwise false.
-     *
-     * @throws SimulatorException
-     *             This exception will be thrown if the native resource object
-     *             does not exist or for some general errors.
      */
     public boolean isCollection() {
         return (this instanceof SimulatorCollectionResource);
@@ -78,10 +74,6 @@ public class SimulatorResource {
      * collection resource.
      *
      * @return Type of resource.
-     *
-     * @throws SimulatorException
-     *             This exception will be thrown if the native resource object
-     *             does not exist or for some general errors.
      */
     public Type getType() {
         if (this instanceof SimulatorSingleResource) {
@@ -287,6 +279,9 @@ public class SimulatorResource {
      * @throws InvalidArgsException
      *             This exception will be thrown if the interface type is
      *             invalid.
+     * @throws NoSupportException
+     *             This exception will be thrown if the interface type is
+     *             not supported by the resource.
      * @throws SimulatorException
      *             This exception will be thrown if the native resource object
      *             does not exist or for some general errors.
index bfc8a55..157668d 100644 (file)
@@ -77,6 +77,8 @@ public final class SimulatorSingleResource extends SimulatorResource {
      * @param attribute
      *            Attribute to be added to resource's representation model.
      *
+     * @return True if the attribute is added properly.
+     *
      * @throws InvalidArgsException
      *             This exception will be thrown on invalid input.
      * @throws SimulatorException
@@ -94,6 +96,8 @@ public final class SimulatorSingleResource extends SimulatorResource {
      * @param attrName
      *            Name of the attribute to be deleted.
      *
+     * @return True if the attribute is removed properly.
+     *
      * @throws InvalidArgsException
      *             This exception will be thrown on invalid input.
      * @throws SimulatorException
@@ -113,6 +117,8 @@ public final class SimulatorSingleResource extends SimulatorResource {
      * @param value
      *            New value of the attribute.
      *
+     * @return True if the attribute's value is updated properly.
+     *
      * @throws InvalidArgsException
      *             This exception will be thrown on invalid input.
      * @throws SimulatorException