Monitoring interceptor interfaces

You create a monitoring interceptor by implementing the Interceptor interface and optionally, one or more of its sub-interfaces.
The IBM® z/OS® Connect SPI Interceptor sub-interfaces are:
com.ibm.zosconnect.spi.Interceptor
Required interface for obtaining monitoring data.
com.ibm.zosconnect.spi.ServiceProviderInterceptor
Implement this interface to obtain SoR specific monitoring data for API requests.
com.ibm.zosconnect.spi.EarlyFailureInterceptor
Implement this interface to monitor API requests that that fail authentication or are badly formed.
com.ibm.zosconnect.spi.TrackingInterceptor
Implement this interface to selectively track API requests that invoke a service in an SoR. It enables a stakeholder to add their stakeholder token to the tracking token sent to the SoR.

For the Java™ API documentation, see z/OS Connect SPI. This documentation is also available as a separate file at <installation_path>/doc/javadoc.oas3.zip.

IBM z/OS Connect provides five points where interceptors can monitor requests for the API provider, as illustrated in Figure 1.
Figure 1. Monitoring interceptor points for the API provider
When the request is received from the client, the preInvoke method is called. The preSorInvoke method is called when the request is sent to the system of record (SoR). The postSorInvoke method is called when the response is returned from the SoR and the postInvoke method is called just before the response is returned to the client.
one preInvoke
Required interface: Interceptor
The preInvoke method is called when a request is received from the client and initial validation of the request is complete. This method can throw an interceptor exception to reject the request at this point. For OpenAPI 3 servers, the exception does not cause the request to be rejected.
twopreSorInvoke
Required interface: ServiceProviderInterceptor
The preSorInvoke method is called when a request is sent to the SoR.
three postSorInvoke
Required interface: ServiceProviderInterceptor
The postSorInvoke method is called when a response is received from the SoR.
fourpostInvoke
Required interface: Interceptor
The postInvoke method is called just before a response is returned to the client.
fiveearlyFailure
Required interface: EarlyFailureInterceptor
The earlyFailure method is called when a request fails validation before the preInvoke method is called. No other interceptors are called. Early failures can be caused by errors such as incorrect URLs, or authentication or authorization failures.