com.ibm.zosconnect.spi

Interface EndpointInterceptor

  • All Superinterfaces:
    Interceptor, InterceptorRequester


    public interface EndpointInterceptor
    extends InterceptorRequester
    Defines an extension of the InterceptorRequester interface, and provides the ability to be invoked before and after the call to an API endpoint by an API requester call.

    When more than one interceptor is configured, the order of execution is determined by a sequence number. See Interceptor.getSequence().

    The postEndpointInvoke methods of interceptors are processed in the opposite order to that in which the preEndpointInvoke methods were called. If interceptors specify invalid sequence numbers or the same sequence numbers, the processing order is undefined.

    If an API requester is invoked while a refresh is in progress, interceptor calls might not occur as expected. For example, you change the server.xml file to add an interceptor, and issue the refresh command. While the refresh occurs, an API requester is invoked. The preEndpointInvoke does not occur because the refresh has not finished. After the refresh is complete, the postEndpointInvoke for the API is called because it now exists.

    This interface is available from z/OS Connect EE V3.0.39.0.

    • Method Detail

      • preEndpointInvoke

        void preEndpointInvoke(java.util.Map<java.lang.Object,java.lang.Object> requestStateMap,
                               DataRequester data)
        Runs implementor specific logic. This method is invoked immediately prior to the call to the API endpoint. Note, preEndpointInvoke and postEndpointInvoke are called twice for a single API requester call if the request to the endpoint fails with a 401 HTTP response code and the request is retried with a fresh access token. In this event the REQUEST_RETRIED flag is set on the second attempt.
        Parameters:
        requestStateMap - A map object that holds implementor data that can be retrieved and/or updated by artifacts that have a reference to it (e.g. InterceptorRequester.preInvokeRequester(), InteceptorRequester.postInvokeRequester()). z/OS Connect EE creates a new map and makes it available to the consuming artifacts per request. Prefix key strings with your own unique identifier to avoid clashes with those created by other interceptor providers. Key string entries starting with "IBM_ZOS_CONNECT" are reserved for z/OS Connect EE use.
        data - Common request specific data.
      • postEndpointInvoke

        void postEndpointInvoke(java.util.Map<java.lang.Object,java.lang.Object> requestStateMap,
                                DataRequester data)
        Runs implementor specific logic. This method is invoked immediately after the call to the API endpoint.
        Parameters:
        requestStateMap - A map object that holds implementor data that can be retrieved and/or updated by artifacts that have a reference to it (e.g. InterceptorRequester.preInvokeRequester(), InteceptorRequester.postInvokeRequester()). z/OS Connect EE creates a new map and makes it available to the consuming artifacts per request. Prefix key strings with your own unique identifier to avoid clashes with those created by other interceptor providers. Key string entries starting with "IBM_ZOS_CONNECT" are reserved for z/OS Connect EE use.
        data - Common response specific data.