Class PolarisClient
java.lang.Object
org.apache.polaris.service.it.env.PolarisClient
- All Implemented Interfaces:
AutoCloseable
This is a holder for the heavy-weight HTTP client for accessing Polaris APIs, and optionally,
platform APIs (such as metrics or health endpoints).
This class provides methods for constructing light-weight API wrappers for Iceberg REST APis, Polaris Management APIs, and platform APIs that reuse the same shared HTTP client.
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.ObjectMapperUtility method that creates anObjectMappersufficient for (de-)serializing client-side payloads for Iceberg REST and Polaris Management APIs.catalogApi(String authToken) voidvoidclose()genericTableApi(String authToken) managementApi(String authToken) newEntityName(String hint) This method should be used by test code to make top-level entity names.Requests an access token from the authorization server denoted by the issuer URL and token endpoint path.obtainToken(org.apache.polaris.core.admin.model.PrincipalWithCredentials credentials) Requests an access token from the Polaris server for the given principal.obtainToken(ClientCredentials credentials) Requests an access token from the Polaris server for the given credentials.obtainToken(ClientPrincipal principal) Requests an access token from the Polaris server for the given principal.booleanstatic PolarisClientpolarisClient(PolarisApiEndpoints endpoints) Builds aPolarisClientfor the givenPolarisApiEndpoints.static PolarisClientpolarisClient(PolarisApiEndpoints endpoints, PlatformApiEndpoints platformEndpoints)
-
Method Details
-
polarisClient
Builds aPolarisClientfor the givenPolarisApiEndpoints. The returned client cannot access platform endpoints; usepolarisClient(PolarisApiEndpoints, PlatformApiEndpoints)if platform endpoints are required by the test. -
polarisClient
public static PolarisClient polarisClient(PolarisApiEndpoints endpoints, PlatformApiEndpoints platformEndpoints) Builds aPolarisClientfor the givenPolarisApiEndpointsandPlatformApiEndpoints. The returned client can access both Polaris APIs and platform endpoints (e.g. metrics or health endpoints). -
buildObjectMapper
public static com.fasterxml.jackson.databind.ObjectMapper buildObjectMapper()Utility method that creates anObjectMappersufficient for (de-)serializing client-side payloads for Iceberg REST and Polaris Management APIs.It is recommended for
PolarisServerManagerimplementations to use thisObjectMapperif the make customclients. -
newEntityName
This method should be used by test code to make top-level entity names. The purpose of this method is two-fold:- Identify top-level entities for later clean-up by
cleanUp(String).- Allow
PolarisServerManagers to customize top-level entities per environment. - Identify top-level entities for later clean-up by
-
managementApi
-
catalogApi
-
catalogApiPlain
-
genericTableApi
-
policyApi
-
platformMetricsApi
-
obtainToken
Requests an access token from the Polaris server for the given principal. -
obtainToken
Requests an access token from the Polaris server for the given principal. -
obtainToken
Requests an access token from the Polaris server for the given credentials. -
obtainToken
Requests an access token from the authorization server denoted by the issuer URL and token endpoint path. -
ownedName
-
cleanUp
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-