NCBI C++ ToolKit
|
#include <string>
#include <connect/services/json_over_uttp.hpp>
#include <connect/services/netstorage.hpp>
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
struct | SCommonRequestArguments |
struct | SICacheSettings |
struct | SUserKey |
Variables | |
const string | kStatusOK = "OK" |
const string | kStatusError = "ERROR" |
const string | kMessageTypeReply = "REPLY" |
const string | kScopeStdException = "std::exception" |
const string | kScopeUnknownException = "unknown_exception" |
const string | kScopeIMessage = "IMessage" |
const string | kScopeLogic = "logic" |
void AppendError | ( | CJsonNode & | message, |
Int8 | code, | ||
const string & | error_message, | ||
const string & | scope, | ||
Int8 | sub_code, | ||
bool | update_status = true |
||
) |
Definition at line 223 of file nst_protocol_utils.cpp.
References CJsonNode::Append(), CreateIssue(), CJsonNode::GetByKey(), CJsonNode::HasKey(), kStatusError, CJsonNode::NewArrayNode(), CJsonNode::SetByKey(), and CJsonNode::SetString().
Referenced by CNetStorageHandler::x_OptionalExpirationUpdate(), CNetStorageHandler::x_ProcessGetObjectInfo(), CNetStorageHandler::x_ProcessGetUsersInfo(), CNetStorageHandler::x_ProcessRead(), CNetStorageHandler::x_ProcessRelocate(), CNetStorageHandler::x_ProcessSetExpTime(), and CNetStorageHandler::x_SendWriteConfirmation().
void AppendWarning | ( | CJsonNode & | message, |
Int8 | code, | ||
const string & | warning_message, | ||
const string & | scope, | ||
Int8 | sub_code | ||
) |
Definition at line 206 of file nst_protocol_utils.cpp.
References CJsonNode::Append(), CreateIssue(), CJsonNode::GetByKey(), CJsonNode::HasKey(), CJsonNode::NewArrayNode(), and CJsonNode::SetByKey().
Referenced by CNetStorageHandler::x_ProcessAckAlert(), CNetStorageHandler::x_ProcessDelAttr(), CNetStorageHandler::x_ProcessGetClientsInfo(), CNetStorageHandler::x_ProcessGetObjectInfo(), CNetStorageHandler::x_ProcessHealth(), CNetStorageHandler::x_ProcessLockFTPath(), and CNetStorageHandler::x_ProcessReconfigure().
CJsonNode CreateErrorResponseMessage | ( | Int8 | serial_number, |
Int8 | error_code, | ||
const string & | error_message, | ||
const string & | scope, | ||
Int8 | sub_code | ||
) |
Definition at line 184 of file nst_protocol_utils.cpp.
References CJsonNode::Append(), CreateIssue(), kMessageTypeReply, kStatusError, CJsonNode::NewArrayNode(), CJsonNode::NewObjectNode(), CJsonNode::SetByKey(), CJsonNode::SetInteger(), and CJsonNode::SetString().
Referenced by CNetStorageHandler::x_OnData(), CNetStorageHandler::x_OnMessage(), and CNetStorageHandler::x_ProcessRead().
CJsonNode CreateIssue | ( | Int8 | error_code, |
const string & | error_message, | ||
const string & | scope, | ||
Int8 | sub_code | ||
) |
Definition at line 244 of file nst_protocol_utils.cpp.
References CJsonNode::NewObjectNode(), CJsonNode::SetInteger(), and CJsonNode::SetString().
Referenced by AppendError(), AppendWarning(), and CreateErrorResponseMessage().
Definition at line 171 of file nst_protocol_utils.cpp.
References kMessageTypeReply, kStatusOK, CJsonNode::NewObjectNode(), CJsonNode::SetInteger(), and CJsonNode::SetString().
Referenced by CRelocateCallback::Callback(), CNetStorageHandler::x_ProcessAckAlert(), CNetStorageHandler::x_ProcessBye(), CNetStorageHandler::x_ProcessConfiguration(), CNetStorageHandler::x_ProcessCreate(), CNetStorageHandler::x_ProcessDelAttr(), CNetStorageHandler::x_ProcessDelete(), CNetStorageHandler::x_ProcessExists(), CNetStorageHandler::x_ProcessGetAttr(), CNetStorageHandler::x_ProcessGetAttrList(), CNetStorageHandler::x_ProcessGetClientObjects(), CNetStorageHandler::x_ProcessGetClientsInfo(), CNetStorageHandler::x_ProcessGetMetadataInfo(), CNetStorageHandler::x_ProcessGetObjectInfo(), CNetStorageHandler::x_ProcessGetSize(), CNetStorageHandler::x_ProcessGetUserObjects(), CNetStorageHandler::x_ProcessGetUsersInfo(), CNetStorageHandler::x_ProcessHealth(), CNetStorageHandler::x_ProcessHello(), CNetStorageHandler::x_ProcessInfo(), CNetStorageHandler::x_ProcessLockFTPath(), CNetStorageHandler::x_ProcessRead(), CNetStorageHandler::x_ProcessReconfigure(), CNetStorageHandler::x_ProcessRelocate(), CNetStorageHandler::x_ProcessSetAttr(), CNetStorageHandler::x_ProcessSetExpTime(), CNetStorageHandler::x_ProcessShutdown(), CNetStorageHandler::x_ProcessWrite(), and CNetStorageHandler::x_SendWriteConfirmation().
SCommonRequestArguments ExtractCommonFields | ( | const CJsonNode & | message | ) |
Definition at line 95 of file nst_protocol_utils.cpp.
References CJsonNode::GetInteger(), CJsonNode::GetString(), NCBI_THROW, result, and CException::what().
Referenced by CNetStorageHandler::x_OnMessage().
SICacheSettings ExtractICacheSettings | ( | const CJsonNode & | message | ) |
Definition at line 139 of file nst_protocol_utils.cpp.
References CJsonNode::GetByKey(), CJsonNode::GetString(), CJsonNode::HasKey(), and result.
Referenced by CNetStorageHandler::x_GetStorageParams(), CNetStorageHandler::x_ProcessCreate(), and CNetStorageHandler::x_ProcessRelocate().
TNetStorageFlags ExtractStorageFlags | ( | const CJsonNode & | message | ) |
Definition at line 113 of file nst_protocol_utils.cpp.
References flags, fNST_Cacheable, fNST_Fast, fNST_FileTrack, fNST_Movable, fNST_NetCache, fNST_NoMetaData, fNST_Persistent, CJsonNode::GetByKey(), CJsonNode::HasKey(), and result.
Referenced by CNetStorageHandler::x_DetectMetaDBNeedOnGetObjectInfo(), CNetStorageHandler::x_DetectMetaDBNeedUpdate(), CNetStorageHandler::x_GetStorageParams(), CNetStorageHandler::x_ProcessCreate(), CNetStorageHandler::x_ProcessRelocate(), and CNetStorageHandler::x_ValidateWriteMetaDBAccess().
Definition at line 155 of file nst_protocol_utils.cpp.
References CJsonNode::GetByKey(), CJsonNode::GetString(), CJsonNode::HasKey(), and result.
Referenced by CNetStorageHandler::x_GetStorageParams().
bool GetReplyMessageProperties | ( | const exception & | ex, |
string * | error_scope, | ||
Int8 * | error_code, | ||
unsigned int * | error_sub_code | ||
) |
Definition at line 260 of file nst_protocol_utils.cpp.
References CException::GetErrCode(), CException::GetType(), kScopeStdException, NCBI_ERRCODE_X_NAME, and NULL.
Referenced by CNetStorageHandler::x_OnData(), CNetStorageHandler::x_OnMessage(), CNetStorageHandler::x_OptionalExpirationUpdate(), CNetStorageHandler::x_ProcessGetClientsInfo(), CNetStorageHandler::x_ProcessGetObjectInfo(), CNetStorageHandler::x_ProcessRead(), CNetStorageHandler::x_ProcessRelocate(), CNetStorageHandler::x_ProcessSetExpTime(), and CNetStorageHandler::x_SendWriteConfirmation().
Definition at line 46 of file nst_protocol_utils.cpp.
References context, CRequestContext_PassThrough::Deserialize(), CRequestContext_PassThrough::eFormat_UrlEncoded, ERR_POST, eSAF_IP, CSocket::GetPeerAddress(), CDiagContext::GetRequestContext(), CJsonNode::GetString(), CJsonNode::HasKey(), CRequestContext::SetClientIP(), CRequestContext::SetHitID(), and CRequestContext::SetSessionID().
Referenced by CNetStorageHandler::x_PrintMessageRequestStart().
Definition at line 48 of file nst_protocol_utils.hpp.
Referenced by CreateErrorResponseMessage(), and CreateResponseMessage().
Definition at line 53 of file nst_protocol_utils.hpp.
Referenced by CNetStorageHandler::x_ProcessLockFTPath().
Definition at line 54 of file nst_protocol_utils.hpp.
Referenced by CNetStorageHandler::x_OnMessage(), CNetStorageHandler::x_ProcessAckAlert(), CNetStorageHandler::x_ProcessDelAttr(), CNetStorageHandler::x_ProcessGetClientsInfo(), CNetStorageHandler::x_ProcessGetUsersInfo(), and CNetStorageHandler::x_ProcessReconfigure().
Definition at line 51 of file nst_protocol_utils.hpp.
Referenced by GetReplyMessageProperties(), CNetStorageHandler::x_OnData(), CNetStorageHandler::x_OnMessage(), CNetStorageHandler::x_ProcessGetUsersInfo(), and CNetStorageHandler::x_ProcessHealth().
Definition at line 52 of file nst_protocol_utils.hpp.
Referenced by CNetStorageHandler::x_OnData(), CNetStorageHandler::x_OnMessage(), CNetStorageHandler::x_OptionalExpirationUpdate(), CNetStorageHandler::x_ProcessGetClientsInfo(), CNetStorageHandler::x_ProcessGetObjectInfo(), CNetStorageHandler::x_ProcessGetUsersInfo(), CNetStorageHandler::x_ProcessHealth(), CNetStorageHandler::x_ProcessRead(), CNetStorageHandler::x_ProcessRelocate(), CNetStorageHandler::x_ProcessSetExpTime(), and CNetStorageHandler::x_SendWriteConfirmation().
Definition at line 47 of file nst_protocol_utils.hpp.
Referenced by AppendError(), and CreateErrorResponseMessage().
Definition at line 46 of file nst_protocol_utils.hpp.
Referenced by CreateResponseMessage().