NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Functions | Variables
nc_utils.hpp File Reference
#include <util/simple_buffer.hpp>
+ Include dependency graph for nc_utils.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  TNCBufferType
 
class  CNCAlerts
 

Macros

#define ATTR_PACKED   NCBI_PACKED
 
#define ATTR_ALIGNED_8
 

Typedefs

typedef map< string, stringTStringMap
 
typedef map< Uint8, stringTNCPeerList
 
typedef vector< Uint8TServersList
 

Enumerations

enum  ENCAccessType {
  eNCNone = 0 , eNCRead , eNCReadData , eNCCreate ,
  eNCCopyCreate
}
 Type of access to NetCache blob. More...
 
enum  EHTTPStatus {
  eStatus_SyncBList = 121 , eStatus_SyncEvents = 122 , eStatus_NewerBlob = 123 , eStatus_SyncBusy = 124 ,
  eStatus_CrossSync = 125 , eStatus_OK = 200 , eStatus_Created = 201 , eStatus_PartialContent = 206 ,
  eStatus_BadCmd = 400 , eStatus_BadPassword = 401 , eStatus_Disabled = 403 , eStatus_NotFound = 404 ,
  eStatus_NotAllowed = 405 , eStatus_NeedAdmin = 407 , eStatus_CmdTimeout = 408 , eStatus_RaceCond = 409 ,
  sStatus_BlobVersion = 410 , eStatus_CondFailed = 412 , eStatus_BlobTooBig = 413 , eStatus_PrematureClose = 499 ,
  eStatus_ServerError = 500 , eStatus_CmdAborted = 500 , eStatus_NoImpl = 501 , eStatus_BadPeer = 502 ,
  eStatus_ShuttingDown = 503 , eStatus_ServiceUnavailable = 503 , eStatus_JustStarted = 503 , eStatus_PeerError = 504 ,
  eStatus_NoDiskSpace = 507 , eStatus_SyncAborted = 520
}
 Statuses of commands to be set in diagnostics' request context Additional statuses can be taken from http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html. More...
 

Functions

void InitClientMessages (void)
 Initializes maps between status codes and error texts sent to client to explain these codes. More...
 
EHTTPStatus GetStatusByMessage (const string &msg, EHTTPStatus def)
 
const stringGetMessageByStatus (EHTTPStatus sts)
 

Variables

static const char *const kNCPeerClientName = "nc_peer"
 

Macro Definition Documentation

◆ ATTR_ALIGNED_8

#define ATTR_ALIGNED_8

Definition at line 48 of file nc_utils.hpp.

◆ ATTR_PACKED

#define ATTR_PACKED   NCBI_PACKED

Definition at line 39 of file nc_utils.hpp.

Typedef Documentation

◆ TNCPeerList

Definition at line 60 of file nc_utils.hpp.

◆ TServersList

typedef vector<Uint8> TServersList

Definition at line 61 of file nc_utils.hpp.

◆ TStringMap

Definition at line 59 of file nc_utils.hpp.

Enumeration Type Documentation

◆ EHTTPStatus

Statuses of commands to be set in diagnostics' request context Additional statuses can be taken from http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html.

Enumerator
eStatus_SyncBList 

SYNC_START: synchronization by blobs list will be performed.

eStatus_SyncEvents 

SYNC_START: synchronization by events will be performed.

eStatus_NewerBlob 

Same or newer blob is present on the server.

eStatus_SyncBusy 

Synchronization cannot start because server is busy doing cleaning or some other synchronization on this slot.

eStatus_CrossSync 

Synchronization is rejected because both servers tried to start it simultaneously.

eStatus_OK 

Command is ok and execution is good.

eStatus_Created 

New resource has been created.

eStatus_PartialContent 

The server is delivering only part of the resource.

eStatus_BadCmd 

Command is incorrect.

eStatus_BadPassword 

Bad password for accessing the blob.

eStatus_Disabled 

Client was disabled in configuration.

eStatus_NotFound 

Blob was not found.

eStatus_NotAllowed 

Operation not allowed with current settings (e.g.

password given but ini-file says that only blobs without password are allowed)

eStatus_NeedAdmin 

Command requires admin privileges.

eStatus_CmdTimeout 

Command timeout is exceeded.

eStatus_RaceCond 

SETVALID cannot be executed as new version was already written.

sStatus_BlobVersion 

Blob version did not match.

eStatus_CondFailed 

Precondition stated in command has failed (size of blob was given but data has a different size)

eStatus_BlobTooBig 

Blob size exceeds the allowed maximum.

eStatus_PrematureClose 

Connection was closed too early (client didn't send all data or didn't get confirmation about successful execution).

eStatus_ServerError 

Internal server error.

eStatus_CmdAborted 
eStatus_NoImpl 

Command is not implemented.

eStatus_BadPeer 

Peer returned something wrong.

eStatus_ShuttingDown 

operation canceled because server needs to shutdown.

eStatus_ServiceUnavailable 
eStatus_JustStarted 

Command cannot be executed because NetCache didn't cache the database contents yet.

eStatus_PeerError 

Command should be proxied to peers but it's impossible to connect to any.

eStatus_NoDiskSpace 

There's not enough disk space to execute the command.

eStatus_SyncAborted 

Synchronization is aborted because something went wrong.

Definition at line 98 of file nc_utils.hpp.

◆ ENCAccessType

Type of access to NetCache blob.

Enumerator
eNCNone 
eNCRead 

Read meta information only.

eNCReadData 

Read blob data.

eNCCreate 

Create blob or re-write its contents.

eNCCopyCreate 

(Re-)write blob from another NetCache (as opposed to writing from client)

Definition at line 85 of file nc_utils.hpp.

Function Documentation

◆ GetMessageByStatus()

const string& GetMessageByStatus ( EHTTPStatus  sts)

◆ GetStatusByMessage()

EHTTPStatus GetStatusByMessage ( const string msg,
EHTTPStatus  def 
)

◆ InitClientMessages()

void InitClientMessages ( void  )

Initializes maps between status codes and error texts sent to client to explain these codes.

Definition at line 74 of file nc_utils.cpp.

References i, SStatusMsg::msg, s_MsgForStatus, s_StatusForMsg, s_StatusMessages, and SStatusMsg::status.

Referenced by s_Initialize().

Variable Documentation

◆ kNCPeerClientName

const char* const kNCPeerClientName = "nc_peer"
static

Definition at line 56 of file nc_utils.hpp.

Referenced by CNCActiveHandler::Initialize(), and CNCMessageHandler::x_StartCommand().

Modified on Sun Apr 14 05:25:07 2024 by modify_doxy.py rev. 669887