Interface IServerServicesInterceptorHelper
public interface IServerServicesInterceptorHelper
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
getCompressedResponseData
(String uncompressedData) Compresses the String response body and returns a byte array compressed in the GZIP file formatgetDecompressedResponseData
(byte[] compressedResponse) Decompresses the response data which is in the GZIP file format and returns the uncompressed response body in String formatgetOperationName
(IInterceptorRequest request, IInterceptorResponse response) Get service operation from the requestgetServiceName
(IInterceptorRequest request, IInterceptorResponse response) Get service name from the requestgetServiceType
(IInterceptorRequest request, IInterceptorResponse response) Get service type from the requestgetUsername
(IInterceptorRequest request, IInterceptorResponse response) Get username from the requestgetUserRole
(IInterceptorRequest request, IInterceptorResponse response) Get list of roles of the current user from the requestboolean
isOutputStreamCompressed
(IInterceptorRequest request, IInterceptorResponse response) Returns whether the response data is in compressed format or notboolean
isRestRequest
(IInterceptorRequest request, IServerServicesInterceptorChain interceptorChain) Check if the request is a REST request or not
-
Method Details
-
getUsername
Get username from the request- Parameters:
request
- the request to pass along the chain.response
- the response to pass along the chain.- Returns:
- Username if available
-
getUserRole
Get list of roles of the current user from the request- Parameters:
request
- the request to pass along the chain.response
- the response to pass along the chain.- Returns:
- User role if available
-
getServiceType
Get service type from the request- Parameters:
request
- the request to pass along the chain.response
- the response to pass along the chain.- Returns:
- Service type if available
-
getServiceName
Get service name from the request- Parameters:
request
- the request to pass along the chain.response
- the response to pass along the chain.- Returns:
- Service name
-
getOperationName
Get service operation from the request- Parameters:
request
- the request to pass along the chain.response
- the response to pass along the chain.- Returns:
- Operation name if available
-
isRestRequest
boolean isRestRequest(IInterceptorRequest request, IServerServicesInterceptorChain interceptorChain) Check if the request is a REST request or not- Parameters:
request
- the request to pass along the chain.interceptorChain
- the chain object to pass the request along the chain.- Returns:
- Flag indicating if REST request or not
-
getDecompressedResponseData
Decompresses the response data which is in the GZIP file format and returns the uncompressed response body in String format- Parameters:
compressedResponse
- compressed byte array representing the response data- Returns:
- Return the decompressed response string
- Throws:
IOException
-
getCompressedResponseData
Compresses the String response body and returns a byte array compressed in the GZIP file format- Parameters:
uncompressedData
- uncompressed response string- Returns:
- Return the compressed response byte array
- Throws:
IOException
-
isOutputStreamCompressed
Returns whether the response data is in compressed format or not- Parameters:
request
- the request to pass along the chain.response
- the response to pass along the chain.- Returns:
- Boolean indicating whether response is compressed or not
-