com.ibm.zosconnect.spi

Interface Service

  • All Known Subinterfaces:
    ServiceController


    public interface Service
    Defines an OSGI service that provides a link between z/OS assets and clients trying to access those z/OS assets.

    If a data transformer has been defined to convert data on behalf of the service, it is expected that data conversion will be done for both input and output payloads by the defined data transformation service.

    If a data transformer has NOT been defined, input and output data conversion is expected to done by the service.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface and Description
      static class  Service.CallerType
      Enumeration for how the service provider is being invoked, either from a Service or an API.
    • Field Detail

      • IBM_ZOS_CONNECT_CALLER

        @Deprecated
        static final java.lang.String IBM_ZOS_CONNECT_CALLER
        Deprecated. Replaced by Data.getRequestType().
        Constant for the key in the requestStateMap that indicates whether the service is being invoked directly, or through an API.
        See Also:
        Constant Field Values
      • IBM_ZOS_CONNECT_ENCODING

        static final java.lang.String IBM_ZOS_CONNECT_ENCODING
        Constant for the key in the requestStateMap for encoding information.
        See Also:
        Constant Field Values
      • IBM_ZOS_CONNECT_TIMEOUT

        static final java.lang.String IBM_ZOS_CONNECT_TIMEOUT
        Constant for the key in the requestStateMap for the time remaining when a timeout has been specified on an asynchronous request. The requestStateMap will not contain this key if the asynchRequestTimeout is zero, indicating no timeout is set, or the operationMode is SYNC. The service provider can choose to terminate processing of a request after the specified timeout has expired. In this case, the service provider should return from the invoke method without throwing a service exception or setting the response data.
        See Also:
        Constant Field Values
    • Method Detail

      • getProviderName

        java.lang.String getProviderName()
        Returns the service provider's name.
        Returns:
        The service provider's name.
      • getData

        java.util.Map<java.lang.String,java.lang.Object> getData()
                                                          throws ServiceException
        Returns a map of JSON object compatible key value pairs representing information about the service.
        Returns:
        A map of key value pair values associated with a configured service.
        Throws:
        ServiceException - If there is a processing error.
      • getRequestSchema

        com.ibm.json.java.JSONObject getRequestSchema()
                                               throws ServiceException
        Queries the service for the data transformation request schema used.
        Returns:
        The JSON representation of the data transformation request schema.
        Throws:
        ServiceException - If there is a processing error.
      • getResponseSchema

        com.ibm.json.java.JSONObject getResponseSchema()
                                                throws ServiceException
        Queries the service for the data transformation response schema used.
        Returns:
        The JSON representation of the data transformation response schema.
        Throws:
        ServiceException - If there is a processing error.
      • getStatistics

        com.ibm.json.java.JSONObject getStatistics()
                                            throws ServiceException
        Queries the service for statistic data.
        Returns:
        The JSON representation of the data.
        Throws:
        ServiceException - If there is a processing error.
      • invoke

        void invoke(java.util.Map<java.lang.Object,java.lang.Object> requestStateMap,
                    HttpZosConnectRequest httpZosConnectRequest,
                    RequestData requestData,
                    ResponseData responseData)
             throws ServiceException
        Processes a service invocation action.
        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. Interceptor.preInvoke(), Inteceptor.postInvoke()). z/OS Connect 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 use.
        httpZosConnectRequest - A z/OS Connect representation of a HTTP servlet request.
        requestData - The request object to retrieve request data from.
        responseData - The response object to set response data to.
        Throws:
        ServiceException - If there is a processing error.
      • getServiceArchiveData

        @Deprecated
        java.util.List<ServiceArchiveData> getServiceArchiveData()
                                                                      throws ServiceException
        Deprecated. The z/OS Connect Enterprise Edition build toolkit should be used to generate service archives.
        Returns a list of data items the service provider wants to store in the service archive. Use ServiceArchiveProperty and ServiceArchiveObject for concrete implementations of ServiceArchiveData.

        Notes on the return value:
        • ServiceArchiveProperty files and ServiceArchiveObject files will be stored in different directories in the service archive. This means matching paths between a ServiceArchiveProperty and ServiceArchiveObject do not reference the same file.
        • If multiple ServiceArchiveProperty objects are returned with the same property name, only the first one will be used, subsequent properties are ignored.
        • More than one ServiceArchiveProperty can reference the same file, using the same path parameter value. The contents from the last ServiceArchiveProperty with a matching path will be used.
        • More than one ServiceArchiveObject can reference the same file, using the same path parameter value. The contents from the last ServiceArchiveObject with a matching path will be used.
        Returns:
        A list of ServiceArchiveData objects used to create a service archive. null if the Service provider does not support service archive creation.
        Throws:
        ServiceException - If there is a processing error.