Merge branch '1.1-rel'
[platform/upstream/iotivity.git] / cloud / account / src / main / java / org / iotivity / cloud / accountserver / util / CoapMessageBuilder.java
index 190b8a4..30029dc 100644 (file)
@@ -32,18 +32,39 @@ import org.iotivity.cloud.base.protocols.coap.enums.CoapStatus;
 
 /**
  * 
- * This class provides utility for making CoAP request and response.
+ * This class provides a set of APIs to build build data of CoAP request and
+ * response type.
  * 
  */
 public class CoapMessageBuilder {
 
     public static final int APPLICATION_JSON = 50;
 
+    /**
+     * API for building data of CoAP response type without payload.
+     * 
+     * @param token
+     *            token
+     * @param status
+     *            response status
+     * @return CoapResponse - data of CoAP response type
+     */
     public CoapResponse buildCoapResponse(byte[] token, CoapStatus status) {
 
         return buildCoapResponse(token, null, status);
     }
 
+    /**
+     * API for building data of CoAP response type with payload.
+     * 
+     * @param token
+     *            token
+     * @param jsonString
+     *            payload data
+     * @param status
+     *            response status
+     * @return CoapResponse - data of CoAP response type
+     */
     public CoapResponse buildCoapResponse(byte[] token, String jsonString,
             CoapStatus status) {
 
@@ -62,6 +83,15 @@ public class CoapMessageBuilder {
         return coapResponse;
     }
 
+    /**
+     * API for building data of CoAP requeset type with payload.
+     * 
+     * @param token
+     *            token
+     * @param jsonString
+     *            payload data
+     * @return CoapRequest - data of CoAP request type
+     */
     public CoapRequest buildCoapRequest(byte[] token, String jsonString) {
 
         CoapRequest coapRequest = new CoapRequest(CoapMethod.GET);