Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/group__NetStorage.html below:
NCBI C++ ToolKit: NetStorage
enum CNetStorageException::EErrCode {
CNetStorageException::eInvalidArg , CNetStorageException::eNotExists , CNetStorageException::eAuthError , CNetStorageException::eIOError ,
CNetStorageException::eServerError , CNetStorageException::eTimeout , CNetStorageException::eExpired , CNetStorageException::eNotSupported ,
CNetStorageException::eInterrupted , CNetStorageException::eUnknown
} enum ENetStorageObjectLocation { eNFL_Unknown , eNFL_NotFound , eNFL_NetCache , eNFL_FileTrack } Enumeration that indicates the current location of the object. More...
enum ENetStorageFlags {
fNST_NetCache = (1 << 0) , fNST_FileTrack = (1 << 1) , fNST_V1 , fNST_V2 = (fNST_V1 - 1) << 1 ,
fNST_Fast = fNST_NetCache , fNST_Persistent = fNST_FileTrack , fNST_AnyLoc = (fNST_V2 - 1) , fNST_Movable = (fNST_V2 << 0) ,
fNST_Cacheable = (fNST_V2 << 1) , fNST_NoMetaData = (fNST_V2 << 2) , fNST_V3 , fNST_V4 = (fNST_V3 - 1) << 1 ,
fNST_AnyAttr = (fNST_V4 - 1) ^ fNST_AnyLoc
} Blob storage allocation and access strategy. More...
enum ENetStorageRemoveResult { eNSTRR_NotFound , eNSTRR_Removed } Result returned by Remove() methods. More...
virtual const char * CNetStorageException::GetErrCodeString () const override Get error code interpreted as text. More...
CNetStorageException::NCBI_EXCEPTION_DEFAULT (CNetStorageException, CNetServiceException) CNetStorageObjectInfo::CNetStorageObjectInfo (EVoid) CNetStorageObjectInfo::CNetStorageObjectInfo (SNetStorageObjectInfoImpl *impl) CNetStorageObjectInfo & CNetStorageObjectInfo::operator= (SNetStorageObjectInfoImpl *impl) CNetStorageObjectInfo::operator SNetStorageObjectInfoImpl * () CNetStorageObjectInfo::operator const SNetStorageObjectInfoImpl * () const SNetStorageObjectInfoImpl & CNetStorageObjectInfo::operator-- (int) const SNetStorageObjectInfoImpl & CNetStorageObjectInfo::operator-- (int) const SNetStorageObjectInfoImpl * CNetStorageObjectInfo::operator-> () const SNetStorageObjectInfoImpl * CNetStorageObjectInfo::operator-> () const CNetStorageObjectInfo::CNetStorageObjectInfo () ENetStorageObjectLocation CNetStorageObjectInfo::GetLocation () const Return a ENetStorageObjectLocation constant that corresponds to the storage back-end where the object currently resides. More...
CJsonNode CNetStorageObjectInfo::GetObjectLocInfo () const Return a JSON object containing the fields of the object ID. More...
CTime CNetStorageObjectInfo::GetCreationTime () const Return object creation time reported by the storage back-end. More...
Uint8 CNetStorageObjectInfo::GetSize () const Return object size in bytes. More...
CJsonNode CNetStorageObjectInfo::GetStorageSpecificInfo () const Return a JSON object containing storage-specific information about the object. More...
CJsonNode CNetStorageObjectInfo::ToJSON () Pack the whole structure in a single JSON object. More...
CNetStorageObject::CNetStorageObject (EVoid) CNetStorageObject::CNetStorageObject (SNetStorageObjectImpl *impl) CNetStorageObject & CNetStorageObject::operator= (SNetStorageObjectImpl *impl) CNetStorageObject::operator SNetStorageObjectImpl * () CNetStorageObject::operator const SNetStorageObjectImpl * () const SNetStorageObjectImpl & CNetStorageObject::operator-- (int) const SNetStorageObjectImpl & CNetStorageObject::operator-- (int) const SNetStorageObjectImpl * CNetStorageObject::operator-> () const SNetStorageObjectImpl * CNetStorageObject::operator-> () const CNetStorageObject::CNetStorageObject () string CNetStorageObject::GetLoc (void) const Return object locator. More...
size_t CNetStorageObject::Read (void *buffer, size_t buf_size) Read no more than 'buf_size' bytes of the object contents (starting at the current position) More...
void CNetStorageObject::Read (string *data) Read object (starting at the current position) and put the read data into a string. More...
IReader & CNetStorageObject::GetReader () Get a reference to the IReader interface for reading the data stream of this object. More...
bool CNetStorageObject::Eof (void) Check if the last Read() has hit EOF. More...
void CNetStorageObject::Write (const void *buffer, size_t buf_size) Write data to the object (starting at the current position) More...
IEmbeddedStreamWriter & CNetStorageObject::GetWriter () Get a reference to the IWriter interface for storing data into this object. More...
CNcbiIostream * CNetStorageObject::GetRWStream () Get an iostream instance for reading the data stream of this NetStorage object as well as storing data into this object. More...
void CNetStorageObject::Write (const string &data) Write string to the object (starting at the current position) More...
void CNetStorageObject::Close (void) Finalize and close the current object stream. More...
Uint8 CNetStorageObject::GetSize (void) Return size of the object. More...
TAttributeList CNetStorageObject::GetAttributeList () const string CNetStorageObject::GetAttribute (const string &attr_name) const Get the current value of the specified attribute. More...
void CNetStorageObject::SetAttribute (const string &attr_name, const string &attr_value) Set the new value for the specified attribute. More...
CNetStorageObjectInfo CNetStorageObject::GetInfo (void) Return detailed information about the object. More...
void CNetStorageObject::SetExpiration (const CTimeout &ttl) Updates expiration on the object. More...
CNetStorage::CNetStorage (EVoid) CNetStorage::CNetStorage (SNetStorageImpl *impl) CNetStorage & CNetStorage::operator= (SNetStorageImpl *impl) CNetStorage::operator SNetStorageImpl * () CNetStorage::operator const SNetStorageImpl * () const SNetStorageImpl & CNetStorage::operator-- (int) const SNetStorageImpl & CNetStorage::operator-- (int) const SNetStorageImpl * CNetStorage::operator-> () const SNetStorageImpl * CNetStorage::operator-> () const CNetStorage::CNetStorage (const string &init_string, TNetStorageFlags default_flags=0) Construct a CNetStorage object. More...
CNetStorageObject CNetStorage::Create (TNetStorageFlags flags=0) Create new NetStorage object. More...
CNetStorageObject CNetStorage::Open (const string &object_loc) Open an existing NetStorage object for reading. More...
string CNetStorage::Relocate (const string &object_loc, TNetStorageFlags flags, TNetStorageProgressCb cb=TNetStorageProgressCb()) Relocate a object according to the specified combination of flags. More...
bool CNetStorage::Exists (const string &object_loc) Check if the object addressed by 'object_loc' exists. More...
ENetStorageRemoveResult CNetStorage::Remove (const string &object_loc) Remove the object addressed by 'object_loc'. More...
CNetStorageByKey::CNetStorageByKey (EVoid) CNetStorageByKey::CNetStorageByKey (SNetStorageByKeyImpl *impl) CNetStorageByKey & CNetStorageByKey::operator= (SNetStorageByKeyImpl *impl) CNetStorageByKey::operator SNetStorageByKeyImpl * () CNetStorageByKey::operator const SNetStorageByKeyImpl * () const SNetStorageByKeyImpl & CNetStorageByKey::operator-- (int) const SNetStorageByKeyImpl & CNetStorageByKey::operator-- (int) const SNetStorageByKeyImpl * CNetStorageByKey::operator-> () const SNetStorageByKeyImpl * CNetStorageByKey::operator-> () const CNetStorageByKey::CNetStorageByKey (const string &init_string, TNetStorageFlags default_flags=0) Construct a CNetStorageByKey object. More...
CNetStorageObject CNetStorageByKey::Open (const string &unique_key, TNetStorageFlags flags=0) Create a new object or open an existing object using the supplied unique key. More...
string CNetStorageByKey::Relocate (const string &unique_key, TNetStorageFlags flags, TNetStorageFlags old_flags=0, TNetStorageProgressCb cb=TNetStorageProgressCb()) Relocate a object according to the specified combination of flags. More...
bool CNetStorageByKey::Exists (const string &key, TNetStorageFlags flags=0) Check if a object with the specified key exists in the storage hinted by 'flags'. More...
ENetStorageRemoveResult CNetStorageByKey::Remove (const string &key, TNetStorageFlags flags=0) Remove a object addressed by a key and a set of flags. More...
◆ TAttributeList
Get list of names of all attributes set on this object.
To get value of particular attribute, GetAttribute should be called.
-
Exceptions
-
Definition at line 300 of file netstorage.hpp.
◆ TInstance [1/4] ◆ TInstance [2/4] ◆ TInstance [3/4] ◆ TInstance [4/4] ◆ TNetStorageFlags ◆ TNetStorageProgressCb ◆ EErrCode Enumerator eInvalidArg
Caller passed invalid arguments to the API.
eNotExists
Illegal op applied to non-existent object.
eAuthError
Authentication error (e.g. no FileTrack API key)
eIOError
I/O error encountered while performing an op.
eServerError
NetStorage server error.
eTimeout
Timeout encountered while performing an op.
eExpired
Object has expired on server.
eNotSupported
Feature is not supported.
eInterrupted
Operation has been interrupted.
eUnknown
Unknown error.
Definition at line 69 of file netstorage.hpp.
◆ ENetStorageFlags
Blob storage allocation and access strategy.
Enumerator fNST_NetCache
Use NetCache as the primary storage.
fNST_FileTrack
Use FileTrack as the primary storage.
fNST_V1 fNST_V2 fNST_Fast fNST_Persistent fNST_AnyLoc
Any location (all location bits are set)
fNST_Movable
Allow the object to move between storages.
fNST_Cacheable
Has no effect at the moment.
fNST_NoMetaData
Do not use NetStorage relational database to track ownership & changes.
Attributes and querying will also be disabled.
fNST_V3 fNST_V4 fNST_AnyAttr
Definition at line 129 of file netstorage.hpp.
◆ ENetStorageObjectLocation
Enumeration that indicates the current location of the object.
Enumerator eNFL_Unknown eNFL_NotFound eNFL_NetCache eNFL_FileTrack
Definition at line 86 of file netstorage.hpp.
◆ ENetStorageRemoveResult ◆ Close() void CNetStorageObject::Close ( void )
Finalize and close the current object stream.
If the operation is successful, then the state (including the current position, if applicable) of the 'CNetStorageObject' is reset, and you can start reading from (or writing to) the object all anew, as if the 'CNetStorageObject' object had just been created by 'CNetStorage'.
-
Exceptions
-
Definition at line 321 of file netstorage.cpp.
References CNetStorageObject::m_Impl.
Referenced by CProjectStorage::Clone(), CGridCommandLineInterfaceApp::Cmd_Download(), CGridCommandLineInterfaceApp::Cmd_Upload(), CNetCacheBlobFetchApp::ProcessRequest(), CNetStorageObject::Read(), CProjectStorage::SaveObject(), CProjectStorage::SaveProject(), CProjectStorage::SaveRawData(), CProjectStorage::SaveStream(), CProjectStorage::SaveString(), CNetStorageHandler::x_ProcessRead(), CNetStorageHandler::x_SendWriteConfirmation(), and SNetStorageObjectRWStream::~SNetStorageObjectRWStream().
◆ CNetStorage() [1/3]
Construct a CNetStorage object.
-
Parameters
-
init_string Initialization string that contains client identification, network service locations, etc. The string must be a sequence of apersand-separated pairs of attribute names and their values. Within each pair, the name and the value of the attribute must be separated by the equality sign, and the value must be URL-encoded. The following attributes are recoginzed: * namespace - Application domain. This parameter is required. * client - Application name. If omitted, generated from the executable pathname. * nst - NetStorage server address or LBSM service name pointing to a group of NetStorage servers. * metadata - Whether to request or disable the metadata DB. Valid options:
- required - Database access must be enabled for the specified NetStorage service name in the server configuration.
- disabled - Database access is disabled for all operations.
- monitoring - Read-only access to the metadata database. * nc - NetCache service name or server address. * cache - Synonym for "namespace". Example: "client=MyApp&nst=NST_Test&nc=NC_MyApp_TEST&cache=myapp"
default_flags Default storage preferences for the created objects.
Definition at line 326 of file netstorage.cpp.
◆ CNetStorage() [2/3] ◆ CNetStorage() [3/3] ◆ CNetStorageByKey() [1/3]
Construct a CNetStorageByKey object.
-
Parameters
-
init_string Initialization string that contains client identification, network service locations, etc. The string must be a sequence of apersand-separated pairs of attribute names and their values. Within each pair, the name and the value of the attribute must be separated by the equality sign, and the value must be URL-encoded. The following attributes are recoginzed: * namespace - Namespace name, within which the keys passed to the methods of this class must be unique. This parameter is required. * domain - Synonym for "namespace". * client - Application name. * nst - NetStorage server address or LBSM service name pointing to a group of NetStorage servers. Example: "client=MyApp&nst=NST_Test&namespace=myapp" default_flags Default storage preferences for objects created by this object.
Definition at line 361 of file netstorage.cpp.
◆ CNetStorageByKey() [2/3] ◆ CNetStorageByKey() [3/3] ◆ CNetStorageObject() [1/3] CNetStorageObject::CNetStorageObject ( ) inline
Definition at line 168 of file netstorage.hpp.
◆ CNetStorageObject() [2/3] ◆ CNetStorageObject() [3/3] ◆ CNetStorageObjectInfo() [1/3] CNetStorageObjectInfo::CNetStorageObjectInfo ( ) inline
Definition at line 97 of file netstorage.hpp.
◆ CNetStorageObjectInfo() [2/3] CNetStorageObjectInfo::CNetStorageObjectInfo ( EVoid ) inline
Definition at line 97 of file netstorage.hpp.
◆ CNetStorageObjectInfo() [3/3] ◆ Create() ◆ Eof() bool CNetStorageObject::Eof ( void ) ◆ Exists() [1/2] ◆ Exists() [2/2] ◆ GetAttribute() ◆ GetAttributeList() ◆ GetCreationTime() CTime CNetStorageObjectInfo::GetCreationTime ( ) const ◆ GetErrCodeString() const char * CNetStorageException::GetErrCodeString ( void ) const overridevirtual
Get error code interpreted as text.
Reimplemented from CNetServiceException.
Definition at line 58 of file netstorage_rpc.cpp.
References CNetStorageException::eAuthError, CNetStorageException::eExpired, CNetStorageException::eInterrupted, CNetStorageException::eInvalidArg, CNetStorageException::eIOError, CNetStorageException::eNotExists, CNetStorageException::eNotSupported, CNetStorageException::eServerError, CNetStorageException::eTimeout, CNetStorageException::eUnknown, CException::GetErrCode(), and CException::GetErrCodeString().
◆ GetInfo() ◆ GetLoc() string CNetStorageObject::GetLoc ( void ) const ◆ GetLocation() TLocation CNetStorageObjectInfo::GetLocation ( void ) const
Return a ENetStorageObjectLocation constant that corresponds to the storage back-end where the object currently resides.
If the object cannot be found in any of the predictable locations, eNFL_NotFound is returned. If the object is found, the returned value reflects the storage back-end that supplied the rest of information about the object.
Definition at line 250 of file netstorageobjectinfo.cpp.
References CNetStorageObjectInfo::m_Impl.
◆ GetObjectLocInfo() CJsonNode CNetStorageObjectInfo::GetObjectLocInfo ( ) const ◆ GetReader() IReader & CNetStorageObject::GetReader ( ) ◆ GetRWStream() ◆ GetSize() [1/2] Uint8 CNetStorageObjectInfo::GetSize ( void ) const ◆ GetSize() [2/2] Uint8 CNetStorageObject::GetSize ( void ) ◆ GetStorageSpecificInfo() CJsonNode CNetStorageObjectInfo::GetStorageSpecificInfo ( ) const ◆ GetWriter() ◆ NCBI_EXCEPTION_DEFAULT() ◆ Open() [1/2] ◆ Open() [2/2] ◆ operator const SNetStorageByKeyImpl *() ◆ operator const SNetStorageImpl *() ◆ operator const SNetStorageObjectImpl *() ◆ operator const SNetStorageObjectInfoImpl *() ◆ operator SNetStorageByKeyImpl *() ◆ operator SNetStorageImpl *() ◆ operator SNetStorageObjectImpl *() ◆ operator SNetStorageObjectInfoImpl *() ◆ operator--() [1/8] ◆ operator--() [2/8] ◆ operator--() [3/8] ◆ operator--() [4/8] ◆ operator--() [5/8] ◆ operator--() [6/8] ◆ operator--() [7/8] ◆ operator--() [8/8] ◆ operator->() [1/8] ◆ operator->() [2/8] ◆ operator->() [3/8] ◆ operator->() [4/8] ◆ operator->() [5/8] ◆ operator->() [6/8] ◆ operator->() [7/8] ◆ operator->() [8/8] ◆ operator=() [1/4] ◆ operator=() [2/4] ◆ operator=() [3/4] ◆ operator=() [4/4] ◆ Read() [1/2] void CNetStorageObject::Read ( string * data ) ◆ Read() [2/2] size_t CNetStorageObject::Read ( void * buffer, size_t buf_size ) ◆ Relocate() [1/2]
Relocate a object according to the specified combination of flags.
-
Parameters
-
object_loc An existing object to relocate flags Combination of flags that defines the new object location (storage) cb Relocation progress callback (
-
See also
-
TNetStorageProgressCb). CJsonNode input argument (object) will contain two subnodes: number 'BytesRelocated' and string 'Message'
-
Returns
-
New object ID that fully reflects the new object location. If possible, this new ID should be used for further access to the object. Note however that its original ID still can be used as well.
Definition at line 343 of file netstorage.cpp.
References flags, and CNetStorage::Open().
Referenced by CGridCommandLineInterfaceApp::Cmd_Relocate().
◆ Relocate() [2/2] ◆ Remove() [1/2] ◆ Remove() [2/2] ◆ SetAttribute() ◆ SetExpiration() ◆ ToJSON() ◆ Write() [1/2] ◆ Write() [2/2] void CNetStorageObject::Write ( const void * buffer, size_t buf_size ) ◆ m_Impl [1/4] ◆ m_Impl [2/4]
Definition at line 168 of file netstorage.hpp.
Referenced by CDirectNetStorageObject::CancelRelocate(), CNetStorageObject::Close(), CNetStorageObject::Eof(), CDirectNetStorageObject::FileTrack_Path(), CNetStorageObject::GetAttribute(), CNetStorageObject::GetAttributeList(), CNetStorageObject::GetInfo(), CNetStorageObject::GetLoc(), CNetStorageObject::GetReader(), CNetStorageObject::GetRWStream(), CNetStorageObject::GetSize(), CDirectNetStorageObject::GetUserInfo(), CNetStorageObject::GetWriter(), CDirectNetStorageObject::Locator(), CNetStorageObject::Read(), CDirectNetStorageObject::Relocate(), CDirectNetStorageObject::Remove(), CNetStorageObject::SetAttribute(), CNetStorageObject::SetExpiration(), and CNetStorageObject::Write().
◆ m_Impl [3/4] ◆ m_Impl [4/4]
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4