37 #define MAX_NETCACHE_PASSWORD_LENGTH 64
43 m_DefinedParameters(0),
53 SetTTL(Get<unsigned>(optional));
82 if ((
m_TTL = blob_ttl) == 0)
90 if (password.empty()) {
100 eAuthenticationError,
"Password is too long");
111 if (!mirroring_mode.empty()) {
126 if (!server_check.empty())
133 if (!server_check_hint.empty())
137 #define NETCACHE_API_GET_PARAM_IMPL(param_name) \
138 return m_Defaults == NULL || (m_DefinedParameters & eDP_##param_name) ? \
139 m_##param_name : m_Defaults->Get##param_name()
156 #define NETCACHE_API_GET_PARAM_REVERSE_IMPL(param_name, target_var) \
157 if (m_Defaults != NULL && m_Defaults->Get##param_name(target_var)) \
159 if ((m_DefinedParameters & eDP_##param_name) == 0) \
161 *target_var = m_##param_name; \
221 return default_value;
const CNamedParameterList * m_MoreParams
NetCache internal exception.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void SetUseCompoundID(bool use_compound_id)
ECachingMode
Allows to define caching behavior on a per-call basis.
unsigned * GetActualBlobAgePtr() const
CNetCacheAPI::EMirroringMode GetMirroringMode() const
void SetCacheName(const string &cache_name)
void SetActualBlobAgePtr(unsigned *actual_age_ptr)
void SetServerCheck(ESwitch server_check)
std::string GetPassword() const
EMirroringMode
Mirroring modes.
bool GetTryAllServers() const
void SetMirroringMode(CNetCacheAPI::EMirroringMode mirroring_mode)
bool GetUseCompoundID() const
void SetServerLastUsedPtr(CNetServer *server_last_used_ptr)
TDefinedParameters m_DefinedParameters
CNetCacheAPI::ECachingMode GetCachingMode() const
bool GetServerCheck(ESwitch *server_check) const
static bool StringToBool(const string &bool_str, bool default_value=false)
CNetServer * GetServerLastUsedPtr() const
void SetMaxBlobAge(unsigned max_age)
void SetTTL(unsigned blob_ttl)
unsigned TDefinedParameters
void LoadNamedParameters(const CNamedParameterList *optional)
CNetCacheAPIParameters(EVoid)
void SetPassword(const string &password)
void SetServerToUse(CNetServer::TInstance server_to_use)
CNetServer GetServerToUse() const
unsigned GetMaxBlobAge() const
void SetTryAllServers(bool try_all_servers)
string GetCacheName() const
void SetServerCheckHint(bool server_check_hint)
bool GetServerCheckHint(bool *server_check_hint) const
void SetCachingMode(CNetCacheAPI::ECachingMode caching_mode)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool StringToBool(const CTempString str)
Convert string to bool.
static string PrintableString(const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)
Get a printable version of the specified string.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
enum ENcbiSwitch ESwitch
Aux.
#define NETCACHE_API_GET_PARAM_IMPL(param_name)
#define MAX_NETCACHE_PASSWORD_LENGTH
#define NETCACHE_API_GET_PARAM_REVERSE_IMPL(param_name, target_var)
NetCache client parameters.