Package com.artisol.teneo.inquire.client
Class TeneoInquireClient
- java.lang.Object
-
- com.artisol.teneo.inquire.client.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 Summary
Constructors Constructor Description TeneoInquireClient(URL serverUrl)Creates a new Inquire client pointing to the specified Inquire server.TeneoInquireClient(URL serverUrl, com.artisol.teneo.manager.client.TeneoManagerClient teneoManagerClient)Create a new importer client pointing to the specified inquire server.TeneoInquireClient(URL serverUrl, com.artisol.teneo.manager.client.TeneoManagerClient teneoManagerClient, ExecutorService executorService)Creates a new Inquire client pointing to the specified Inquire server.TeneoInquireClient(URL serverUrl, String accessToken)Creates a new Inquire client pointing to the specified Inquire server.TeneoInquireClient(URL serverUrl, ExecutorService executorService)Creates a new Inquire client pointing to the specified Inquire server.TeneoInquireClient(URL serverUrl, ExecutorService executorService, String accessToken)Creates a new Inquire client pointing to the specified Inquire server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Cancel all pending TQL running queries.AugmentersResourceImplgetAugmenters()AuthResourceImplgetAuth()DataResourceImplgetData()ImportResourceImplgetImport()SavedResultsResourceImplgetSavedResults()SolutionsResourceImplgetSolutions()TqlResourceImplgetTql()StringgetVersion()Returns the current version of the Teneo Inquire backend.
-
-
-
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 serverteneoManagerClient-TeneoManagerClientto 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 serverexecutorService-ExecutorServicewhere 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 serverteneoManagerClient-TeneoManagerClientto be used for authenticationexecutorService-ExecutorServicewhere 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 serveraccessToken- 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 serverexecutorService-ExecutorServicewhere asynchronous query executions will be executedaccessToken- to be used for authentication- Throws:
IllegalArgumentException
-
-
Method Detail
-
getAuth
public AuthResourceImpl getAuth()
- Returns:
- A callable resource implementing
AuthResourceinterface
-
getAugmenters
public AugmentersResourceImpl getAugmenters()
- Returns:
- A callable resource implementing
AugmentersResourceinterface
-
getData
public DataResourceImpl getData()
- Returns:
- A callable resource implementing
DataResourceinterface
-
getImport
public ImportResourceImpl getImport()
- Returns:
- A callable resource implementing
ImportResourceinterface
-
getSavedResults
public SavedResultsResourceImpl getSavedResults()
- Returns:
- A callable resource implementing
SavedResultsResourceinterface
-
getSolutions
public SolutionsResourceImpl getSolutions()
- Returns:
- A callable resource implementing
SolutionsResourceinterface
-
getTql
public TqlResourceImpl getTql()
- Returns:
- A callable resource implementing
TqlResourceinterface
-
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 IOExceptionCancel 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException- Thrown if the executor service can't be stopped (look the ExecutorService JavaDocs for details)
-
-