Package cn.ucloud.common.middleware
Class BaseMiddleware
- java.lang.Object
-
- cn.ucloud.common.middleware.BaseMiddleware
-
- All Implemented Interfaces:
Middleware
- Direct Known Subclasses:
CredentialMiddleware,LogMiddleware,ValidationMiddleware
public abstract class BaseMiddleware extends Object implements Middleware
-
-
Constructor Summary
Constructors Constructor Description BaseMiddleware()
-
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- 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- 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- Parameters:
context- Context of invoking lifecycle- Throws:
UCloudException- the exception during invoking
-
-