Configuring API requester-specific interceptors

zosConnect-2.0 Applies to zosConnect-2.0.

The IBM® z/OS® Connect administrator can configure a user-defined set of interceptors for an API requester.

Interceptors that are called for an API requester must implement the com.ibm.zosconnect.spi.InterceptorRequester Service Provider Interface (SPI) that is provided by z/OS Connect.

The apiRequester element represents a single API requester definition that is made available at run time by the server that is associated with a specific server.xml configuration file. This element accepts an interceptorsRef attribute, which can be used by the z/OS Connect administrator to configure the API requester with a user-defined set of interceptors. These interceptors are invoked whenever a request is matched to that API requester for invocation (preInvokeRequester), and before the result is returned to the caller (postInvokeRequester). For example,
<zosconnect_apiRequesters>
    <apiRequester name="apiRequester1" interceptorsRef="interceptorList1" />
    <apiRequester name="apiRequester2" interceptorsRef="interceptorList2" />
    <apiRequester name="apiRequester3" interceptorsRef="interceptorList3" />
</zosconnect_apiRequesters>
This example implies the existence of three zosConnectInterceptor definitions, which are located in server.xml:
<zosconnect_zosConnectInterceptors id="interceptorList1" interceptorRef=".....
<zosconnect_zosConnectInterceptors id="interceptorList2" interceptorRef=".....
<zosconnect_zosConnectInterceptors id="interceptorList3" interceptorRef=".....

For more information, see Configuring interceptors.

Excluding specific API requesters from the Global interceptors

The runGlobalInterceptors element accepts values true or false, and defaults to true. You can use this element to exclude individual API requesters from a configured global interceptor. For example, the following configuration would exclude the apiRequester1 API requester from any global interceptor definition:
<zosconnect_apiRequesters>
    <apiRequester name="apiRequester1" interceptorsRef="interceptorList1" runGlobalInterceptors="false" />
    <apiRequester name="apiRequester2" interceptorsRef="interceptorList2" />
    <apiRequester name="apiRequester3" interceptorsRef="interceptorList3" />
</zosconnect_apiRequesters>