Package nablarch.fw.jaxrs
Class JaxRsAccessLogHandler
java.lang.Object
nablarch.fw.jaxrs.JaxRsAccessLogHandler
- All Implemented Interfaces:
Handler<HttpRequest,HttpResponse>
RESTfulウェブサービスのアクセスログを出力するハンドラ。
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected JaxRsAccessLogFormattercreateLogFormatter(Map<String, String> props) 使用するJaxRsAccessLogFormatterを生成します。protected Object[]getRequestOptions(HttpRequest request, ExecutionContext context) リクエスト処理開始時のログ出力で使用するオプション情報を取得する。protected Object[]getResponseOptions(HttpRequest request, HttpResponse response, ExecutionContext context) リクエスト処理終了時のログ出力で使用するオプション情報を取得する。handle(HttpRequest request, ExecutionContext context) HTTPアクセスログを出力する。protected voidリクエスト処理開始時のログを出力する。protected voidリクエスト処理終了時のログを出力する。
-
Constructor Details
-
JaxRsAccessLogHandler
public JaxRsAccessLogHandler()コンストラクタ。
-
-
Method Details
-
handle
HTTPアクセスログを出力する。- Specified by:
handlein interfaceHandler<HttpRequest,HttpResponse> - Parameters:
request-HttpRequestcontext-ExecutionContext- Returns:
- 次のハンドラの処理結果
- Throws:
ClassCastException- context の型がServletExecutionContextでない場合。
-
createLogFormatter
使用するJaxRsAccessLogFormatterを生成します。- Returns:
JaxRsAccessLogFormatter
-
writeBeginLog
リクエスト処理開始時のログを出力する。- Parameters:
logContext-JaxRsAccessLogFormatter.JaxRsAccessLogContext
-
writeEndLog
リクエスト処理終了時のログを出力する。- Parameters:
logContext-JaxRsAccessLogFormatter.JaxRsAccessLogContext
-
getRequestOptions
リクエスト処理開始時のログ出力で使用するオプション情報を取得する。- Parameters:
request-HttpRequestcontext-ExecutionContext- Returns:
- オプション情報。空の場合は
nullを返す。
-
getResponseOptions
protected Object[] getResponseOptions(HttpRequest request, HttpResponse response, ExecutionContext context) リクエスト処理終了時のログ出力で使用するオプション情報を取得する。- Parameters:
request-HttpRequestresponse-HttpResponsecontext-ExecutionContext- Returns:
- オプション情報。空の場合は
nullを返す。
-