//
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
/**
* @file
*
- * This file contains the classes for creating Get & Set response for the Get & Set request.
+ * This file contains the declaration of classes and its members related to RCSResponse
*/
#ifndef SERVERBUILDER_RCSRESPONSE_H
#define SERVERBUILDER_RCSRESPONSE_H
-#include <cstdint>
#include <memory>
-#include <octypes.h>
-
namespace OIC
{
namespace Service
/**
* This class provides factory methods to create the response for a received get request.
- * The response consists of a result code, an error code and result attributes.
+ * The response consists of an error code and result attributes.
*
* @see RCSResourceObject
*/
public:
/**
* Creates a default RCSGetResponse.
- * The response will have OC_EH_OK for the result and 200 for the errorCode.
- * The attributes of RCSResourceObject will be set as the result attributes.
+ * The response will have 200 for the errorCode and the attributes of RCSResourceObject
+ * will be set as the result attributes.
*
*/
static RCSGetResponse defaultAction();
/**
- * Creates a RCSGetResponse with a result and error code passed.
+ * Creates a RCSGetResponse with error code passed.
* The attributes of the RCSResourceObject will be set as the result attributes.
*
- * @param result The response result.
* @param errorCode The error code to set in response.
*
*/
- static RCSGetResponse create(const OCEntityHandlerResult& result, int errorCode);
+ static RCSGetResponse create(int errorCode);
/**
* Creates a RCSGetResponse with custom attributes.
static RCSGetResponse create(RCSResourceAttributes&& attrs);
/**
- * Creates a RCSGetResponse with a result and error code passed.
+ * Creates a RCSGetResponse with error code passed.
* This sends the passed attributes as the result attributes
* instead of the one the RCSResourceObject holds.
*
* @param attrs The attributes to set.
- * @param result The response result.
* @param errorCode The error code for response.
*
* @see RCSResourceAttributes
*
*/
- static RCSGetResponse create(const RCSResourceAttributes& attrs,
- const OCEntityHandlerResult& result, int errorCode);
+ static RCSGetResponse create(const RCSResourceAttributes& attrs, int errorCode);
/**
* @override
*/
- static RCSGetResponse create(RCSResourceAttributes&& attrs,
- const OCEntityHandlerResult& result, int errorCode);
+ static RCSGetResponse create(RCSResourceAttributes&& attrs, int errorCode);
//! @cond
RequestHandler* getHandler() const;
/**
* This class provides factory methods to create the response for a received set request.
- * The response consists of a result code, an error code and result attributes.
+ * The response consists of an error code and result attributes.
*
- * AcceptanceMethod provides ways how to handle attributes from a request.
+ * AcceptanceMethod provides ways how the request will be handled.
*
* @see RCSResourceObject
*/
/**
* Creates a default RCSSetResponse that has AcceptanceMethod::DEFAULT.
- * The response will have OC_EH_OK for the result and 200 for the errorCode.
+ * The response will have 200 for the errorCode.
* The attributes of RCSResourceObject will be set as the result attributes.
*
*/
/**
* Creates a default RCSSetResponse that has AcceptanceMethod::ACCEPT.
- * The response will have OC_EH_OK for the result and 200 for the errorCode.
+ * The response will have 200 for the errorCode.
* The attributes of RCSResourceObject will be set as the result attributes.
*
*/
static RCSSetResponse accept();
/**
- * Creates a RCSSetResponse that has AcceptanceMethod::ACCEPT
- * with a result and error code passed.
+ * Creates a RCSSetResponse that has AcceptanceMethod::ACCEPT and error code passed.
* The attributes of the RCSResourceObject will be set as the result attributes.
*
- * @param result The response result.
* @param errorCode The error code to set in response.
*
*/
- static RCSSetResponse accept(const OCEntityHandlerResult& result, int errorCode);
+ static RCSSetResponse accept(int errorCode);
/**
* Creates a default RCSSetResponse that has AcceptanceMethod::IGNORE.
- * The response will have OC_EH_OK for the result and 200 for the errorCode.
+ * The response will have 200 for the errorCode.
* The attributes of RCSResourceObject will be set as the result attributes.
*
*/
static RCSSetResponse ignore();
/**
- * Creates a RCSSetResponse that has AcceptanceMethod::IGNORE
- * with a result and error code passed.
+ * Creates a RCSSetResponse that has AcceptanceMethod::IGNORE and error code passed.
* The attributes of the RCSResourceObject will be set as the result attributes.
*
- * @param result The response result.
* @param errorCode The error code to set in response.
*
*/
- static RCSSetResponse ignore(const OCEntityHandlerResult& result, int errorCode);
+ static RCSSetResponse ignore(int errorCode);
/**
- * Creates a RCSSetResponse that has AcceptanceMethod::DEFAULT
- * with a result and error code passed.
+ * Creates a RCSSetResponse that has AcceptanceMethod::DEFAULT and error code passed.
* The attributes of the RCSResourceObject will be set as the result attributes.
*
- * @param result The response result.
* @param errorCode The error code to set in response.
*
*/
- static RCSSetResponse create(const OCEntityHandlerResult& result, int errorCode);
+ static RCSSetResponse create(int errorCode);
/**
* Creates a RCSSetResponse that has AcceptanceMethod::DEFAULT with custom attributes.
/**
* @override
*/
- static RCSSetResponse create(RCSResourceAttributes &&attrs);
+ static RCSSetResponse create(RCSResourceAttributes&& attrs);
/**
- * Creates a RCSSetResponse with a result and error code passed.
+ * Creates a RCSSetResponse with error code passed.
* This sends the passed attributes as the result attributes
* instead of the one the RCSResourceObject holds.
*
* @param attrs The attributes to set.
- * @param result The response result.
* @param errorCode The error code for response.
*
* @see RCSResourceAttributes
*
*/
- static RCSSetResponse create(const RCSResourceAttributes& attrs,
- const OCEntityHandlerResult& result, int errorCode);
-
+ static RCSSetResponse create(const RCSResourceAttributes& attrs, int errorCode);
/**
* @override
*/
- static RCSSetResponse create(RCSResourceAttributes &&attrs,
- const OCEntityHandlerResult &result, int errorCode);
+ static RCSSetResponse create(RCSResourceAttributes&& attrs, int errorCode);
- //! @cond/
+ //! @cond
SetRequestHandler* getHandler() const;
//! @endcond
/**
* Sets the acceptance method for the RCSSetResponse.
*
- * @param method - AcceptanceMethod value to set
+ * @param method AcceptanceMethod value to set
*
* @return The reference to this RCSSetResponse
*