From 9c84370b9619f15c0f57bcb47025ec514052f376 Mon Sep 17 00:00:00 2001 From: G S Senthil Kumar Date: Tue, 1 Mar 2016 17:03:48 +0530 Subject: [PATCH] Added a Java API required and updated Javadoc comments. Java API added to change the attribute name after creation. Change-Id: I94a29031aeb9ad9441430eaf5ef7cb8041e550f6 Signed-off-by: G S Senthil Kumar Reviewed-on: https://gerrit.iotivity.org/gerrit/5275 Tested-by: jenkins-iotivity Reviewed-by: Madan Lanka --- .../org/oic/simulator/SimulatorResourceAttribute.java | 10 ++++++++++ .../oic/simulator/client/SimulatorRemoteResource.java | 4 ---- .../org/oic/simulator/server/SimulatorResource.java | 11 +++-------- .../oic/simulator/server/SimulatorSingleResource.java | 6 ++++++ 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/service/simulator/java/sdk/src/org/oic/simulator/SimulatorResourceAttribute.java b/service/simulator/java/sdk/src/org/oic/simulator/SimulatorResourceAttribute.java index 272316f6f..35c4fd16a 100644 --- a/service/simulator/java/sdk/src/org/oic/simulator/SimulatorResourceAttribute.java +++ b/service/simulator/java/sdk/src/org/oic/simulator/SimulatorResourceAttribute.java @@ -87,6 +87,16 @@ public class SimulatorResourceAttribute { return mProperty; } + /** + * 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. * diff --git a/service/simulator/java/sdk/src/org/oic/simulator/client/SimulatorRemoteResource.java b/service/simulator/java/sdk/src/org/oic/simulator/client/SimulatorRemoteResource.java index 12a861524..8e5e46ee1 100644 --- a/service/simulator/java/sdk/src/org/oic/simulator/client/SimulatorRemoteResource.java +++ b/service/simulator/java/sdk/src/org/oic/simulator/client/SimulatorRemoteResource.java @@ -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 diff --git a/service/simulator/java/sdk/src/org/oic/simulator/server/SimulatorResource.java b/service/simulator/java/sdk/src/org/oic/simulator/server/SimulatorResource.java index 3a9058496..0f632991e 100644 --- a/service/simulator/java/sdk/src/org/oic/simulator/server/SimulatorResource.java +++ b/service/simulator/java/sdk/src/org/oic/simulator/server/SimulatorResource.java @@ -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. diff --git a/service/simulator/java/sdk/src/org/oic/simulator/server/SimulatorSingleResource.java b/service/simulator/java/sdk/src/org/oic/simulator/server/SimulatorSingleResource.java index bfc8a5593..157668d75 100644 --- a/service/simulator/java/sdk/src/org/oic/simulator/server/SimulatorSingleResource.java +++ b/service/simulator/java/sdk/src/org/oic/simulator/server/SimulatorSingleResource.java @@ -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 -- 2.34.1