Package cn.ucloud.common.middlewares
Class LogMiddleware
- java.lang.Object
-
- cn.ucloud.common.middleware.BaseMiddleware
-
- cn.ucloud.common.middlewares.LogMiddleware
-
- All Implemented Interfaces:
Middleware
public class LogMiddleware extends BaseMiddleware implements Middleware
LogMiddleware is the middleware to print logs
-
-
Constructor Summary
Constructors Constructor Description LogMiddleware()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleException(Context context)Handle the context includes exception objectRequesthandleRequest(Context context)Handle the context includes request objectResponsehandleResponse(Context context)Handle the context includes response object
-
-
-
Method Detail
-
handleRequest
public Request handleRequest(Context context) throws UCloudException
Description copied from interface:MiddlewareHandle the context includes request object- Specified by:
handleRequestin interfaceMiddleware- Overrides:
handleRequestin classBaseMiddleware- Parameters:
context- Context of invoking lifecycle- Returns:
- request object that modified
- Throws:
UCloudException- the exception during invoking
-
handleResponse
public Response handleResponse(Context context) throws UCloudException
Description copied from interface:MiddlewareHandle the context includes response object- Specified by:
handleResponsein interfaceMiddleware- Overrides:
handleResponsein classBaseMiddleware- Parameters:
context- Context of invoking lifecycle- Returns:
- response object that modified
- Throws:
UCloudException- the exception during invoking
-
handleException
public void handleException(Context context) throws UCloudException
Description copied from interface:MiddlewareHandle the context includes exception object- Specified by:
handleExceptionin interfaceMiddleware- Overrides:
handleExceptionin classBaseMiddleware- Parameters:
context- Context of invoking lifecycle- Throws:
UCloudException- the exception during invoking
-
-