All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Public Member Functions | List of all members
net::ProtocolHandler Class Reference

Convenience class to simplify the protocol messages handling. This class is useful to parse the "raw" message received by the server into much more handy ResponseMessage objects. It also features convenience function to create INSERT and SEARCH requests. More...

#include <client_protocol.h>

Public Member Functions

std::string createInsertRequest (const std::string &dssName, std::map< std::string, std::string > &sdFields, const std::map< std::string, std::string > &dataItems)
 
std::string createRemoveRequest (const std::string &sequenceNumber, const std::string &dssName)
 
std::string createGetRequest (const std::string &sequenceNumber, const std::string &dssName)
 
std::string createSearchRequest (const std::string &dssName, std::map< std::string, std::string > &sdQueryFields)
 
std::string createInsertRequest (const std::string &input, std::map< std::string, std::string > &dataItems)
 
std::string createRemoveRequest (const std::string &input)
 
std::string createGetRequest (const std::string &input)
 
std::string createSearchRequest (const std::string &input)
 
ResponseMessage parseResponseMessage (const std::string &response)
 
InsertResponse parseInsertResponse (const std::string &response)
 
GetResponse parseGetResponse (const std::string &response)
 
SearchResponse parseSearchResponse (const std::string &response)
 
SpeclistResponse parseSpeclistResponse (const std::string &response)
 
std::string getExtendedErrorMessage (ResponseCode code)
 
RequestMessageparseRequest (const std::string &request)
 
std::string createGetResponse (int sequenceNumber, const std::map< std::string, std::string > &sdFields, const std::map< std::string, std::string > &dataItems)
 
std::string createSearchResponse (const std::vector< entity::SetDescriptor > &descriptorList)
 

Detailed Description

Convenience class to simplify the protocol messages handling. This class is useful to parse the "raw" message received by the server into much more handy ResponseMessage objects. It also features convenience function to create INSERT and SEARCH requests.

Convenience class to simplify the protocol messages handling. This class is useful to parse the "raw" message received by the client into much more handy RequestMessage objects. It also features convenience function to create response messages to GET and SEARCH requests.

Member Function Documentation

string ProtocolHandler::getExtendedErrorMessage ( ResponseCode  code)

Translate a response code from enum to an extended error message.

Parameters
codea ResponseCode of a certain server response.
Returns
An extended error message (if code is different from "0 OK"), otherwise the "OK" string.
RequestMessage * ProtocolHandler::parseRequest ( const std::string &  request)

Parse a "raw" client request into a RequestMessage object.

Parameters
requestString with the "raw" request message.
Returns
Pointer to the resulting RequestMessage object.

The documentation for this class was generated from the following files: