public class TectonClient
extends java.lang.Object
Note: Each method throws TectonServiceException when it receives an error response from the API and a TectonClientException when an error or exception is encountered by the client. The message included in the exception will provide more information about the error.
| Modifier and Type | Class and Description |
|---|---|
static class |
TectonClient.Builder
A Builder class for creating an instance of
TectonClient object with specific
configurations |
| Constructor and Description |
|---|
TectonClient(java.lang.String url,
java.lang.String apiKey)
Constructor for a simple Tecton Client
|
TectonClient(java.lang.String url,
java.lang.String apiKey,
okhttp3.OkHttpClient httpClient)
Constructor for a Tecton Client with a custom OkHttpClient
|
TectonClient(java.lang.String url,
java.lang.String apiKey,
TectonClientOptions tectonClientOptions)
Constructor for a Tecton Client with custom configurations
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Releases all resources (connection pool, threads) held by the Tecton Client.
|
GetFeaturesResponse |
getFeatures(GetFeaturesRequest getFeaturesRequest)
Makes a request to the /get-features endpoint and returns the response in the form of a
GetFeaturesResponse object |
GetFeaturesBatchResponse |
getFeaturesBatch(GetFeaturesBatchRequest batchRequest)
Makes a batch request to retrieve a list of feature vector and metadata for a given workspace
and feature service
|
GetFeatureServiceMetadataResponse |
getFeatureServiceMetadata(GetFeatureServiceMetadataRequest getFeatureServiceMetadataRequest)
Makes a request to the /metadata endpoint and returns the response in the form of a
GetFeatureServiceMetadataResponse object |
boolean |
isClosed()
Returns true if the Tecton Client has been closed, false otherwise
|
public TectonClient(java.lang.String url,
java.lang.String apiKey)
url - The Tecton Base UrlapiKey - API Key for authenticating with the FeatureService API. See Authenticating
with an API key for more informationpublic TectonClient(java.lang.String url,
java.lang.String apiKey,
TectonClientOptions tectonClientOptions)
url - The Tecton Base UrlapiKey - API Key for authenticating with the FeatureService API. See Authenticating
with an API key for more informationtectonClientOptions - A TectonClientOptions object with custom configurationspublic TectonClient(java.lang.String url,
java.lang.String apiKey,
okhttp3.OkHttpClient httpClient)
url - The Tecton Base UrlapiKey - API Key for authenticating with the FeatureService API. See Authenticating
with an API key for more informationhttpClient - An OkHttpClient for making requests and receiving responses from the Feature
Service API. Please refer to OkHttp
Documentation for recommendations on creating and maintaining an OkHttp Client in your
application. Tecton recommends configuring the ConnectionPool
in the OkHttpClient for efficiently managing HTTP connections. If you intend to use the
GetFeaturesBatchRequest to send parallel requests to Tecton, please also configure
the maxRequestsPerHost
in the client's Dispatcher.public GetFeaturesResponse getFeatures(GetFeaturesRequest getFeaturesRequest) throws TectonClientException, TectonServiceException
GetFeaturesResponse objectgetFeaturesRequest - A GetFeaturesRequest object with the request parametersGetFeaturesResponse object representing the response from the HTTP APITectonClientException - when the client is already closed or encounters an error while
building the request or parsing the responseTectonServiceException - when the client receives an error response from the HTTP APIpublic GetFeatureServiceMetadataResponse getFeatureServiceMetadata(GetFeatureServiceMetadataRequest getFeatureServiceMetadataRequest) throws TectonClientException, TectonServiceException
GetFeatureServiceMetadataResponse objectgetFeatureServiceMetadataRequest - A GetFeatureServiceMetadataRequest object with
the request parametersGetFeatureServiceMetadataResponse object representing the response from the
HTTP APITectonClientException - when the client is already closed or encounters an error while
building the request or parsing the responseTectonServiceException - when the client receives an error response from the HTTP APIpublic GetFeaturesBatchResponse getFeaturesBatch(GetFeaturesBatchRequest batchRequest) throws TectonClientException, TectonServiceException
batchRequest - The GetFeaturesRequest object with the request parametersGetFeaturesBatchResponse object wih the list of feature vector and metadata (if
requested)TectonClientException - when the client is already closed or the client encounters an
error while building the request or parsing the responseTectonServiceException - when the client receives an error response from the HTTP APIpublic void close()
public boolean isClosed()