13 #ifndef NECBAAS_NBSERVICE_H
14 #define NECBAAS_NBSERVICE_H
18 #include "necbaas/internal/nb_session_token.h"
19 #include "necbaas/internal/nb_rest_executor.h"
20 #include "necbaas/internal/nb_rest_executor_pool.h"
21 #include "necbaas/internal/nb_http_request_factory.h"
45 static std::shared_ptr<NbService>
CreateService(
const std::string &endpoint_url,
const std::string &tenant_id,
46 const std::string &app_id,
const std::string &app_key,
47 const std::string &proxy =
"");
106 const std::string &
GetProxy()
const;
151 const std::string &file_path,
int timeout);
163 const std::string &file_path,
int timeout);
166 std::string app_key_;
167 std::string endpoint_url_;
168 std::string tenant_id_;
170 NbSessionToken session_token_;
171 NbRestExecutorPool rest_executor_pool_;
172 std::mutex session_token_mutex_;
178 NbService(
const std::string &endpoint_url,
const std::string &tenant_id,
const std::string &app_id,
179 const std::string &app_key,
const std::string &proxy);
209 std::function<NbHttpRequest(NbHttpRequestFactory &)> create_request,
213 #endif // NECBAAS_NBSERVICE_H
const std::string & GetAppKey() const
アプリケーションキー取得.
const std::string & GetTenantId() const
テナントID取得.
NbSessionToken GetSessionToken()
[内部処理用]
static std::shared_ptr< NbService > CreateService(const std::string &endpoint_url, const std::string &tenant_id, const std::string &app_id, const std::string &app_key, const std::string &proxy="")
サービスインスタンス生成.
MBaaS サービスクラス.
Definition: nb_service.h:29
NbResult< NbHttpResponse > ExecuteCommon(std::function< NbHttpRequest(NbHttpRequestFactory &)> create_request, std::function< NbResult< NbHttpResponse >(NbRestExecutor *, const NbHttpRequest &)> executor_method)
REST実行(共通処理).
void ClearSessionToken()
[内部処理用]
virtual NbRestExecutor * PopRestExecutor()
REST Executor 取り出し.
virtual ~NbService()
デストラクタ.
static void SetRestLogEnabled(bool flag)
ロギング設定(RESTログ).
static void SetDebugLogEnabled(bool flag)
ロギング設定(デバッグログ).
REST API処理結果クラス.
Definition: nb_result.h:32
NbService(const std::string &endpoint_url, const std::string &tenant_id, const std::string &app_id, const std::string &app_key, const std::string &proxy)
コンストラクタ.
NbResult< NbHttpResponse > ExecuteRequest(std::function< NbHttpRequest(NbHttpRequestFactory &)> create_request, int timeout)
[内部処理用]
virtual void PushRestExecutor(NbRestExecutor *executor)
REST Executor 返却.
NbResult< NbHttpResponse > ExecuteFileDownload(std::function< NbHttpRequest(NbHttpRequestFactory &)> create_request, const std::string &file_path, int timeout)
[内部処理用]
const std::string & GetProxy() const
Proxy URL取得.
const std::string & GetEndpointUrl() const
Endpoint URI 取得.
NbResult< NbHttpResponse > ExecuteFileUpload(std::function< NbHttpRequest(NbHttpRequestFactory &)> create_request, const std::string &file_path, int timeout)
[内部処理用]
NbHttpRequestFactory GetHttpRequestFactory()
HTTPリクエストファクトリ取得.
virtual void SetSessionToken(const NbSessionToken &token)
[内部処理用]
static void SetErrorLogEnabled(bool flag)
ロギング設定(エラーログ).
const std::string & GetAppId() const
アプリケーションID取得.