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 Details

    • getUsername

      String getUsername(IInterceptorRequest request, IInterceptorResponse response)
      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

      List<String> getUserRole(IInterceptorRequest request, IInterceptorResponse response)
      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

      String getServiceType(IInterceptorRequest request, IInterceptorResponse response)
      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

      String getServiceName(IInterceptorRequest request, IInterceptorResponse response)
      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

      String getServiceProviderType(IInterceptorRequest request, IInterceptorResponse response)
      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

      String getOperationName(IInterceptorRequest request, IInterceptorResponse response)
      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

      String getDecompressedResponseData(byte[] compressedResponse) throws IOException
      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

      byte[] getCompressedResponseData(String uncompressedData) throws IOException
      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

      boolean isOutputStreamCompressed(IInterceptorRequest request, IInterceptorResponse response)
      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