Creating a z/OS Connect interceptor

Use z/OS® Connect SPI to create interceptor preInvoke and postInvoke implementations that manage service requests such as invoke, status, start, and stop. Interceptors are OSGi services that implement the com.ibm.wsspi.zos.connect.Interceptor SPI provided by z/OS Connect.

About this task

z/OS Connect includes several interceptors. The com.ibm.wsspi.zos.connect.Authorization interceptor provides z/OS SAF and LDAP authorization checks z/OS Connect operations, such as start, stop, and invoke. The com.ibm.wsspi.zos.connect.Audit implementation, logs z/OS SMF recording of request data on z/OS Connect operations.

Interceptors can be used to perform some action before and after a request invocation. A copy of the payload along with other request data is provided to interceptors.

An interceptor that is implemented for z/OS Connect is an OSGi service that connects and interacts with z/OS Connect through the OSGi framework.

Procedure

  1. Create an OSGi service that implements the z/OS Connect com.ibm.wsspi.zos.connect.Interceptor SPI.
  2. To integrate the new z/OS Connect Interceptor SPI implementation with z/OS Connect, add ibm:objectClass="com.ibm.ws.zos.connect.interceptorType" to the interceptor configuration element definition in the associated metatype. The attribute definition goes under the new interceptor's configuration element in the associated metatype.
        <OCD id="custom.banking.interceptor" ibm:alias="bankingInterceptor" name="bankingInterceptor" description="Banking Interceptor" ibm:objectClass="com.ibm.ws.zos.connect.interceptorType">
            ...
        </OCD>
    If the z/OS Connect Interface implementation is being developed to run on WebSphere Application Server 8.5.5.9 or earlier, add the following attribute definition instead: <AD id="com.ibm.ws.zos.connect.interceptorType" required="false" type="String"ibm:final="true"name="internal"description="internal use only"/>. The attribute definition goes under the new interceptor's configuration element in the associated metatype.
    <OCD id="custom.banking.interceptor" ibm:alias="bankingInterceptor" name="bankingInterceptor" description="Banking Interceptor">
       <AD id="com.ibm.ws.zos.connect.interceptorType" required="false" type="String"ibm:final="true"name="internal"description="internal use only"/>
       ...
    </OCD>

    The ibm:final attribute indicates that the value cannot be specified in the configuration, and the name="internal" attribute indicates that tools do not display this property.

    The Java™ API documentation for each Liberty SPI is available in a separate .zip file in one of the Javadoc subdirectories of the ${wlp.install.dir}/dev directory.

    For more information, see the documentation on extending Liberty.

    Note: The Java API documentation for each Liberty SPI is detailed in the Programming interfaces (Javadoc) section of the documentation, and is also available as a separate .zip file in one of the Javadoc subdirectories of the ${wlp.install.dir}/dev directory.

Icon that indicates the type of topic Task topic

File name: twlp_zconnect_create_interceptor.html