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 void
close()
Cancel all pending TQL running queries.AugmentersResourceImpl
getAugmenters()
AuthResourceImpl
getAuth()
DataResourceImpl
getData()
ImportResourceImpl
getImport()
SavedResultsResourceImpl
getSavedResults()
SolutionsResourceImpl
getSolutions()
TqlResourceImpl
getTql()
String
getVersion()
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
-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 serverexecutorService
-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 serverteneoManagerClient
-TeneoManagerClient
to be used for authenticationexecutorService
-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 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
-ExecutorService
where asynchronous query executions will be executedaccessToken
- 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 interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- Thrown if the executor service can't be stopped (look the ExecutorService JavaDocs for details)
-
-