public class HttpClient extends Object implements Closeable
Constructor and Description |
---|
HttpClient(ClientConfiguration config)
新たに、IIJ GIOストレージ&アナリシスサービス クライアントオブジェクトを、
設定とリクエスト・メトリック・コレクターを指定して
構築します。 (例えば 最大試行回数, プロキシ設定など).
|
Modifier and Type | Method and Description |
---|---|
void |
addRequestEventListener(SendRequestEventListener requestEventListener)
リクエストイベントリスナを追加します
|
void |
addResponseEventListener(ReceiveResponseEventListener responseEventListener)
レスポンスイベントリスナを追加します
|
void |
close()
このHTTP Clientオブジェクトをシャットダウンし、すべてのリソースをクローズします。
これはオプションメソッドで、通常は呼び出す必要はありませんが、明示的にリソースを
クローズしたい場合にしようできます。
一旦シャットダウンすると、クライアントは以降リクエストを発行することは出来ません
|
<T> T |
execute(Request<?> request,
HttpResponseHandler<IIJGIOWebServiceResponse<T>> responseHandler,
HttpResponseHandler<IIJGIOServiceException> errorResponseHandler,
ExecutionContext executionContext)
リクエストを実行し、結果を返します。
|
protected void |
finalize() |
ResponseMetadata |
getResponseMetadataForRequest(IIJGIOWebServiceRequest request)
実行されたリクエストに対する追加のレスポンスメタデータを返します。
レスポンスメタデータは操作に対する標準的な結果の一部ではなく、解析用として
用いられるもので、主にトラブルシューティングに使われます
|
boolean |
isClockSkewError(IIJGIOServiceException exception)
指定した例外が clock skew errorであれば、trueを返します。
|
static boolean |
isRequestEntityTooLargeException(IIJGIOServiceException ase)
指定した例外がrequest entity too large errorであれば、trueを返します。
|
static boolean |
isThrottlingException(IIJGIOServiceException ase)
指定した例外がThrottling(絞り)例外であれば、trueを返します。
|
void |
shutdown()
このHTTP Clientオブジェクトをシャットダウンし、すべてのリソースをクローズします。
これはオプションメソッドで、通常は呼び出す必要はありませんが、明示的にリソースを
クローズしたい場合にしようできます。
一旦シャットダウンすると、クライアントは以降リクエストを発行することは出来ません
|
public HttpClient(ClientConfiguration config)
config
- このクライアントのIIJ GIOストレージ&アナリシスサービス との
通信に関する設定(プロキシ設定、リトライ回数など)public static boolean isThrottlingException(IIJGIOServiceException ase)
ase
- The exception to test.public static boolean isRequestEntityTooLargeException(IIJGIOServiceException ase)
ase
- The exception to test.public ResponseMetadata getResponseMetadataForRequest(IIJGIOWebServiceRequest request)
request
- メタデータの取得対象となる実行済みの IIJGIOWebServiceRequest
オブジェクトpublic <T> T execute(Request<?> request, HttpResponseHandler<IIJGIOWebServiceResponse<T>> responseHandler, HttpResponseHandler<IIJGIOServiceException> errorResponseHandler, ExecutionContext executionContext) throws IIJGIOClientException
T
- リクエストの結果の型request
- リモートサーバに送信するIIJGIOWebServiceリクエストresponseHandler
- リモートサーバからの成功レスポンスを受信するレスポンスハンドラーerrorResponseHandler
- リモートサーバからの失敗レスポンスを受信するレスポンスハンドラーexecutionContext
- このWEBサービス呼び出しのコンテキストについての追加情報IIJGIOClientException
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public void shutdown()
public boolean isClockSkewError(IIJGIOServiceException exception)
exception
- The exception to test.protected void finalize() throws Throwable
public void addRequestEventListener(SendRequestEventListener requestEventListener)
requestEventListener
- 追加するリクエストイベントリスナpublic void addResponseEventListener(ReceiveResponseEventListener responseEventListener)
responseEventListener
- 追加するレスポンスイベントリスナCopyright © 2018. All rights reserved.