RELOAD APIs


1. static ReloadCMT* ReloadCMT::initializeReloadCMT(string config)

2. void ReloadCMT::putSingleValue(string resourceId, uint32_t kindId, string value)

3. void ReloadCMT::putArrayEntry(string resourceId, uint32_t kindId, uint32_t index, string value)

4. void ReloadCMT::putDictionaryEntry(string resourceId, uint32_t kindId, string key, string value)

5. string ReloadCMT::getSingleValue(string resourceId, uint32_t kindId)

6. string ReloadCMT::getArrayEntry(string resourceId, uint32_t kindId, uint32_t index)

7. string ReloadCMT::getDictionaryEntry(string resourceId, uint32_t kindId, string key)

8. void ReloadCMT::deleteSingleValue(string resourceId, uint32_t kindId)

9. void ReloadCMT::deleteArrayEntry(string resourceId, uint32_t kindId, uint32_t index)

10. void ReloadCMT::deleteDictionaryEntry(string resourceId, uint32_t kindId, string key)

11. StoreReq* ReloadCMT::createStoreReqFromJSON(string input)

12. FetchReq* ReloadCMT::createFetchReqFromJSON(string input)

13. string Message::toJSONString()

14. uint32_t Envelope::encode(uchar byteArray[], uint32_t maxLength)

15. void Envelope::decode(uchar byteArray[], uint32_t arrayLength)

16. void Transport::sendData(Message * message, string resourceId, ResponseHandler* respHandler)

API Description

1. static ReloadCMT* ReloadCMT::initializeReloadCMT(string config)

Loads the config file and initializes RELOAD Common Message Transport. Starts listening on the port specified in the config file for incoming messages.

Parameters:

config - Name of config file

Returns:

ReloadCMT object if initialization is successful. If error occurs e.g. config file is not present etc. then logs the message in RELOAD log file and stops the application.

2. void ReloadCMT::putSingleValue(string resourceId, uint32_t kindId, string value)

This method is used to store single_value data in the overlay network.

Parameters:

resourceId - resourceId of the element to be stored
kindId - kindId of the element to be stored
value - Value to be stored

Exceptions:

Throws Exception if error occurs during the operation e.g. remote side returned error response. You can get error description by invoking getDesc() function on exception object.

3. void ReloadCMT::putArrayEntry(string resourceId, uint32_t kindId, uint32_t index, string value)

This method is used to store array_entry in the overlay network.

Parameters:

resourceId - resourceId of the element to be stored
kindId - kindId of the element to be stored
index - Location in the array where the element is to be stored
value - Value to be stored

Exceptions:

Throws Exception if error occurs during the operation e.g. remote side returned error response. You can get error description by invoking getDesc() function on exception object.

4. void ReloadCMT::putDictionaryEntry(string resourceId, uint32_t kindId, string key, string value)

This method is used to store dictionary_entry in the overlay network.

Parameters:

resourceId - resourceId of the element to be stored
kindId - kindId of the element to be stored
key - Location in the dictionary where the element is to be stored
value - Value to be stored

Exceptions:

Throws Exception if error occurs during the operation e.g. remote side returned error response. You can get error description by invoking getDesc() function on exception object.

5. string ReloadCMT::getSingleValue(string resourceId, uint32_t kindId)

This method is used to retrieve single_value from the overlay network.

Parameters:

resourceId - resourceId of the element to be retrieved
kindId - kindId of the element to be retrieved

Returns:

Value of the requested entry

Exceptions:

Throws Exception if error occurs during the operation e.g. remote side returned error response. You can get error description by invoking getDesc() function on exception object.

6. string ReloadCMT::getArrayEntry(string resourceId, uint32_t kindId, uint32_t index)

This method is used to retrieve array_entry from the overlay network.

Parameters:

resourceId - resourceId of the element to be retrieved
kindId - kindId of the element to be retrieved
index - Location in the array of the element to be retrieved

Returns:

Value in the Array for given index

Exceptions:

Throws Exception if error occurs during the operation e.g. remote side returned error response. You can get error description by invoking getDesc() function on exception object.

7. string ReloadCMT::getDictionaryEntry(string resourceId, uint32_t kindId, string key)

This method is used to retrieve dictionary_entry from the overlay network.

Parameters:

resourceId - resourceId of the element to be retrieved
kindId - kindId of the element to be retrieved
key - Key of the entry to be retrieved

Returns:

Value in the Dictionary for given key

Exceptions:

Throws Exception if error occurs during the operation e.g. remote side returned error response. You can get error description by invoking getDesc() function on exception object.

8. void ReloadCMT::deleteSingleValue(string resourceId, uint32_t kindId)

Deletes single value entry from the overlay network.

Parameters:

resourceId - resourceId of the single value element to be deleted
kindId - kindId of the element to be deleted

Exceptions:

Throws Exception if error occurs during the operation e.g. remote side returned error response. You can get error description by invoking getDesc() function on exception object.

9. void ReloadCMT::deleteArrayEntry(string resourceId, uint32_t kindId, uint32_t index)

Deletes array entry from the overlay network.

Parameters:

resourceId - resourceId of the element to be deleted
kindId - kindId of the element to be deleted
index - Location in the array of the element to be deleted

Exceptions:

Throws Exception if error occurs during the operation e.g. remote side returned error response. You can get error description by invoking getDesc() function on exception object.

10. void ReloadCMT::deleteDictionaryEntry(string resourceId, uint32_t kindId, string key)

Deletes dictionary entry from the overlay network.

Parameters:

resourceId - resourceId of the element to be deleted
kindId - kindId of the element to be deleted
key - Key of the entry to be deleted

Exceptions:

Throws Exception if error occurs during the operation e.g. remote side returned error response. You can get error description by invoking getDesc() function on exception object.

11. StoreReq* ReloadCMT::createStoreReqFromJSON(string input)

Translates input JSON string into StoreReq cpp object.

Parameters:

input - JSON string representation of store request

Returns:

Returns pointer to StoreReq if no error occurs during JSON to cpp object translation.

Exceptions:

Throws Exception if error occurs during JSON to cpp object translation. You can get error description by invoking getDesc() function on exception object.

12. FetchReq* ReloadCMT::createFetchReqFromJSON(string input)

Translates input JSON string into FetchReq cpp object.

Parameters:

input - JSON string representation of fetch request

Returns:

Returns pointer to FetchReq if no error occurs during JSON to cpp object translation.

Exceptions:

Throws Exception if error occurs during JSON to cpp object translation. You can get error description by invoking getDesc() function on exception object.

13. string Message::toJSONString()

Converts RELOAD message object to JSON string.

Returns:

String containing JSON representation of RELOAD message object.

14. uint32_t Envelope::encode(uchar byteArray[], uint32_t maxLength)

Encodes the envelope object into raw byte stream for transmission over network.

Parameters:

byteArray[] - Holds the encoded byte stream
maxLength - Size of byteArray

Returns:

Number of bytes in the encoded stream if no error occurs during the operation.

Exceptions:

Throws Exception if error occurs during encode operation e.g. error such as insufficient buffer length. You can get error description by invoking getDesc() function on exception object.

15. void Envelope::decode(uchar byteArray[], uint32_t arrayLength)

Converts the raw byte stream into the Envelope object.

Parameters:

byteArray[] - Contains the encoded byte stream
arrayLength - Size of the encoded byte stream

Exceptions:

Throws Exception if error occurs during encode operation e.g. error such as insufficient buffer length. You can get error description by invoking getDesc() function on exception object.

16. void Transport::sendData(Message * message, string resourceId, ResponseHandler* respHandler)

Sends message to the resource identified by resourceId.

Parameters:

message - RELOAD message to be sent on network
resourceId - resourceId where the message is to be sent
respHandler - Handler which will process the response of this request

Exceptions:

Throws Exception if error occurs while sending the message. You can get error description by invoking getDesc() function on exception object.