MBaaS サービスクラス.
[詳細]
#include "necbaas/nb_service.h"
MBaaS サービスクラス.
MBaaS 機能を提供するメインクラス.
| virtual necbaas::NbService::~NbService |
( |
| ) |
|
|
virtual |
| necbaas::NbService::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 |
|
) |
| |
|
protected |
| void necbaas::NbService::ClearSessionToken |
( |
| ) |
|
| static std::shared_ptr<NbService> necbaas::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 = "" |
|
) |
| |
|
static |
サービスインスタンス生成.
サービスインスタンスは、本メソッドを使用して取得する. proxy以外のパラメータは必須である。必須パラメータが空文字の場合はREST実行時にエラーが発生する。 proxyに空文字を設定した場合はProxyを使用しない。Proxyを使用する場合は必ず設定すること。
- 引数
-
| [in] | endpoint_url | Endpoint URI |
| [in] | tenant_id | テナントID |
| [in] | app_id | アプリケーションID |
| [in] | app_key | アプリケーションキー |
| [in] | proxy | Proxy URL "[scheme]://[hostname]:[port]"
デフォルト:Proxy無効(空文字)
例)"http://proxyhost:8080" |
- 戻り値
- サービスインスタンス
| NbResult<NbHttpResponse> necbaas::NbService::ExecuteCommon |
( |
std::function< NbHttpRequest(NbHttpRequestFactory &)> |
create_request, |
|
|
std::function< NbResult< NbHttpResponse >(NbRestExecutor *, const NbHttpRequest &)> |
executor_method |
|
) |
| |
|
protected |
REST実行(共通処理).
- 引数
-
| [in] | create_request | HTTPリクエスト作成関数ポインタ |
| [in] | executor_method | Executor関数ポインタ |
- 戻り値
- 処理結果
| NbResult<NbHttpResponse> necbaas::NbService::ExecuteFileDownload |
( |
std::function< NbHttpRequest(NbHttpRequestFactory &)> |
create_request, |
|
|
const std::string & |
file_path, |
|
|
int |
timeout |
|
) |
| |
| NbResult<NbHttpResponse> necbaas::NbService::ExecuteFileUpload |
( |
std::function< NbHttpRequest(NbHttpRequestFactory &)> |
create_request, |
|
|
const std::string & |
file_path, |
|
|
int |
timeout |
|
) |
| |
| NbResult<NbHttpResponse> necbaas::NbService::ExecuteRequest |
( |
std::function< NbHttpRequest(NbHttpRequestFactory &)> |
create_request, |
|
|
int |
timeout |
|
) |
| |
| const std::string& necbaas::NbService::GetAppId |
( |
| ) |
const |
アプリケーションID取得.
- 戻り値
- アプリケーションID
| const std::string& necbaas::NbService::GetAppKey |
( |
| ) |
const |
アプリケーションキー取得.
- 戻り値
- アプリケーションキー
| const std::string& necbaas::NbService::GetEndpointUrl |
( |
| ) |
const |
Endpoint URI 取得.
- 戻り値
- Endpoint URI
| NbHttpRequestFactory necbaas::NbService::GetHttpRequestFactory |
( |
| ) |
|
|
protected |
HTTPリクエストファクトリ取得.
- 引数
-
| [in] | executor | RESTタイムアウト(秒) |
- 戻り値
- リクエストファクトリ
| const std::string& necbaas::NbService::GetProxy |
( |
| ) |
const |
Proxy URL取得.
- 戻り値
- Proxy URL
| NbSessionToken necbaas::NbService::GetSessionToken |
( |
| ) |
|
| const std::string& necbaas::NbService::GetTenantId |
( |
| ) |
const |
| virtual NbRestExecutor* necbaas::NbService::PopRestExecutor |
( |
| ) |
|
|
protectedvirtual |
REST Executor 取り出し.
- 戻り値
- REST Executor
- 戻り値
-
| nullptr以外 | 取得成功 |
| nullptr | 同時接続数オーバー |
| virtual void necbaas::NbService::PushRestExecutor |
( |
NbRestExecutor * |
executor | ) |
|
|
protectedvirtual |
REST Executor 返却.
- 引数
-
| [in] | executor | REST Executor |
| static void necbaas::NbService::SetDebugLogEnabled |
( |
bool |
flag | ) |
|
|
static |
ロギング設定(デバッグログ).
プロセス内の全サービスに対して設定される。
default設定: Debug版: 有効、Release版: 無効
- 引数
-
| static void necbaas::NbService::SetErrorLogEnabled |
( |
bool |
flag | ) |
|
|
static |
ロギング設定(エラーログ).
プロセス内の全サービスに対して設定される。
default設定: Debug版: 有効、Release版: 無効
- 引数
-
| static void necbaas::NbService::SetRestLogEnabled |
( |
bool |
flag | ) |
|
|
static |
ロギング設定(RESTログ).
プロセス内の全サービスに対して設定される。
default設定: Debug版: 有効、Release版: 無効
- 引数
-
| virtual void necbaas::NbService::SetSessionToken |
( |
const NbSessionToken & |
token | ) |
|
|
virtual |
このクラスの説明は次のファイルから生成されました: