Interface IServerServicesInterceptorHelper
public interface IServerServicesInterceptorHelper
The
IServerServicesInterceptorHelper interface provides utility methods to assist
interceptor implementations in extracting user, service, and request metadata, as well as
handling response data compression and decompression within the ArcGIS Enterprise server
services framework.
Implementations of this interface enable interceptors to:
- Retrieve user information such as username and roles from the request context
- Access service metadata including type, name, provider, and operation
- Determine if a request is a REST request
- Compress and decompress response data using GZIP format
- Check if the response output stream is compressed
These helper methods facilitate common operations required by interceptors to process and manipulate HTTP requests and responses efficiently.
-
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 requestgetServiceProviderType(IInterceptorRequest request, IInterceptorResponse response) Get service provider type 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 requestbooleanisOutputStreamCompressed(IInterceptorRequest request, IInterceptorResponse response) Returns whether the response data is in compressed format or notbooleanisRestRequest(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
-
getServiceProviderType
Get service provider type from the request- Parameters:
request- the request to pass along the chain.response- the response to pass along the chain.- Returns:
- Service provider type
-
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
-