Class TeneoInquireClient

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class TeneoInquireClient
    extends Object
    implements Closeable
    Common client for Teneo Inquire backend in Importer and/or Query mode.

    There are two options for the client authentication:

    • First, an initialized TeneoManagerClient instance may be provided. In this case, that instance would be in charge of login and token generation. This option would be usually used only by applications that integrate with other components of the Teneo platform, and which integrate this client as part of their code.
    • Another option is to manage the session in the Client itself, letting the user control the login process, and storing the retrieved tokens in the client. This option is more suitable for lightweight clients or integrations that don't make other uses of Teneo Manager.
    • Constructor Detail

      • TeneoInquireClient

        public TeneoInquireClient​(URL serverUrl)
                           throws IllegalArgumentException
        Creates a new Inquire client pointing to the specified Inquire server. The server URL usually looks like: http://{machine-name}:{port}/teneo-inquire/
        Parameters:
        serverUrl - URL of Inquire server
        Throws:
        IllegalArgumentException
      • TeneoInquireClient

        public TeneoInquireClient​(URL serverUrl,
                                  com.artisol.teneo.manager.client.TeneoManagerClient teneoManagerClient)
                           throws IllegalArgumentException
        Create a new importer client pointing to the specified inquire server. The server URL usually looks like: http://{machine-name}:{port}/teneo-inquire/
        Parameters:
        serverUrl - URL of Inquire server
        teneoManagerClient - TeneoManagerClient to be used for authentication
        Throws:
        IllegalArgumentException
      • TeneoInquireClient

        public TeneoInquireClient​(URL serverUrl,
                                  ExecutorService executorService)
                           throws IllegalArgumentException
        Creates a new Inquire client pointing to the specified Inquire server. The server URL usually looks like: http://{machine-name}:{port}/teneo-inquire/
        Parameters:
        serverUrl - URL of Inquire server
        executorService - ExecutorService where asynchronous query executions will be executed
        Throws:
        IllegalArgumentException
      • TeneoInquireClient

        public TeneoInquireClient​(URL serverUrl,
                                  com.artisol.teneo.manager.client.TeneoManagerClient teneoManagerClient,
                                  ExecutorService executorService)
                           throws IllegalArgumentException
        Creates a new Inquire client pointing to the specified Inquire server. The server URL usually looks like: http://{machine-name}:{port}/teneo-inquire/
        Parameters:
        serverUrl - URL of Inquire server
        teneoManagerClient - TeneoManagerClient to be used for authentication
        executorService - ExecutorService where asynchronous query executions will be executed
        Throws:
        IllegalArgumentException
      • TeneoInquireClient

        public TeneoInquireClient​(URL serverUrl,
                                  String accessToken)
                           throws IllegalArgumentException
        Creates a new Inquire client pointing to the specified Inquire server. The server URL usually looks like: http://{machine-name}:{port}/teneo-inquire/
        Parameters:
        serverUrl - URL of Inquire server
        accessToken - to be used for authentication
        Throws:
        IllegalArgumentException
      • TeneoInquireClient

        public TeneoInquireClient​(URL serverUrl,
                                  ExecutorService executorService,
                                  String accessToken)
                           throws IllegalArgumentException
        Creates a new Inquire client pointing to the specified Inquire server. The server URL usually looks like: http://{machine-name}:{port}/teneo-inquire/
        Parameters:
        serverUrl - URL of Inquire server
        executorService - ExecutorService where asynchronous query executions will be executed
        accessToken - to be used for authentication
        Throws:
        IllegalArgumentException
    • Method Detail

      • getAuth

        public AuthResourceImpl getAuth()
        Returns:
        A callable resource implementing AuthResource interface
      • getAugmenters

        public AugmentersResourceImpl getAugmenters()
        Returns:
        A callable resource implementing AugmentersResource interface
      • getData

        public DataResourceImpl getData()
        Returns:
        A callable resource implementing DataResource interface
      • getImport

        public ImportResourceImpl getImport()
        Returns:
        A callable resource implementing ImportResource interface
      • getSavedResults

        public SavedResultsResourceImpl getSavedResults()
        Returns:
        A callable resource implementing SavedResultsResource interface
      • getSolutions

        public SolutionsResourceImpl getSolutions()
        Returns:
        A callable resource implementing SolutionsResource interface
      • getTql

        public TqlResourceImpl getTql()
        Returns:
        A callable resource implementing TqlResource interface
      • getVersion

        public String getVersion()
                          throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Returns the current version of the Teneo Inquire backend.
        Returns:
        A String with the JSON version of the application
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - if an unexpected error occurs during the method execution
      • close

        public void close()
                   throws IOException
        Cancel all pending TQL running queries. Do not call it if the executionService has been given in the constructor as this method is closing it.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Throws:
        IOException - Thrown if the executor service can't be stopped (look the ExecutorService JavaDocs for details)