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 responseBadRequestException - If the HTTP status code is 400 (Bad Request).UnauthorizedException - If the HTTP status code is 401 (Unauthorized).ForbiddenException - If the HTTP status code is 403 (Forbidden).ResourceNotFoundException - If the HTTP status code is 404 (Resource Not Found).ResourceExhaustedException - If the HTTP status code is 429 (Resource Exhausted).InternalServerErrorException - If HTTP the status code is 500 (Internal Server Error).ServiceUnavailableException - If HTTP the status code is 503 (Service Unavailable).GatewayTimeoutException - If HTTP the status code is 504 (Gateway Timeout).TectonServiceException - If Tecton returns an error response with other status codespublic 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 responseBadRequestException - If the HTTP status code is 400 (Bad Request).UnauthorizedException - If the HTTP status code is 401 (Unauthorized).ForbiddenException - If the HTTP status code is 403 (Forbidden).ResourceNotFoundException - If the HTTP status code is 404 (Resource Not Found).ResourceExhaustedException - If the HTTP status code is 429 (Resource Exhausted).InternalServerErrorException - If HTTP the status code is 500 (Internal Server Error).ServiceUnavailableException - If HTTP the status code is 503 (Service Unavailable).GatewayTimeoutException - If HTTP the status code is 504 (Gateway Timeout).TectonServiceException - If Tecton returns an error response with other status codespublic GetFeaturesBatchResponse getFeaturesBatch(GetFeaturesBatchRequest batchRequest) throws TectonClientException, TectonServiceException
batchRequest - The GetFeaturesRequest object with the request parametersGetFeaturesBatchResponse object with 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 responseBadRequestException - If the HTTP status code is 400 (Bad Request).UnauthorizedException - If the HTTP status code is 401 (Unauthorized).ForbiddenException - If the HTTP status code is 403 (Forbidden).ResourceNotFoundException - If the HTTP status code is 404 (Resource Not Found).ResourceExhaustedException - If the HTTP status code is 429 (Resource Exhausted).InternalServerErrorException - If HTTP the status code is 500 (Internal Server Error).ServiceUnavailableException - If HTTP the status code is 503 (Service Unavailable).GatewayTimeoutException - If HTTP the status code is 504 (Gateway Timeout).TectonServiceException - If Tecton returns an error response with other status codespublic void close()
public boolean isClosed()