public class DatabaseClientFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DatabaseClientFactory.BasicAuthContext |
static class |
DatabaseClientFactory.Bean
A Database Client Factory Bean provides an
object for specifying configuration before creating a client to
make database requests.
|
static class |
DatabaseClientFactory.CertificateAuthContext |
static interface |
DatabaseClientFactory.ClientConfigurator<T>
A ClientConfigurator provides custom
configuration for the communication library used to sending client
requests and receiving server responses.
|
static class |
DatabaseClientFactory.DigestAuthContext |
static interface |
DatabaseClientFactory.HandleFactoryRegistry
A HandleFactoryRegistry associates IO
representation classes with handle factories.
|
static class |
DatabaseClientFactory.KerberosAuthContext |
static class |
DatabaseClientFactory.KerberosConfig |
static class |
DatabaseClientFactory.MarkLogicCloudAuthContext |
static class |
DatabaseClientFactory.OAuthContext |
static class |
DatabaseClientFactory.SAMLAuthContext
A SAMLAuthContext is used for authorization
using SAML.
|
static interface |
DatabaseClientFactory.SecurityContext |
static interface |
DatabaseClientFactory.SSLHostnameVerifier
An SSLHostnameVerifier checks whether a hostname
is acceptable during SSL authentication.
|
Modifier and Type | Method and Description |
---|---|
static void |
addConfigurator(DatabaseClientFactory.ClientConfigurator<?> configurator)
Adds a listener that provides custom
configuration when a communication library is created.
|
static void |
clearHandleRegistry()
Removes the current registered associations so
the handle registry is empty.
|
static DatabaseClientFactory.HandleFactoryRegistry |
getHandleRegistry()
Returns the default registry with factories for
creating handles as adapters for IO representations.
|
static DatabaseClient |
newClient(java.util.function.Function<java.lang.String,java.lang.Object> propertySource)
Creates a client to access the database by means
of a REST server with connection and authentication information
retrieved from the given
propertySource . |
static DatabaseClient |
newClient(java.lang.String host,
int port, DatabaseClientFactory.SecurityContext securityContext)
Creates a client to access the database by means
of a REST server.
|
static DatabaseClient |
newClient(java.lang.String host,
int port, DatabaseClientFactory.SecurityContext securityContext,
DatabaseClient.ConnectionType connectionType)
Creates a client to access the database by means
of a REST server.
|
static DatabaseClient |
newClient(java.lang.String host,
int port, java.lang.String database, DatabaseClientFactory.SecurityContext securityContext)
Creates a client to access the database by means
of a REST server.
|
static DatabaseClient |
newClient(java.lang.String host,
int port, java.lang.String database, DatabaseClientFactory.SecurityContext securityContext,
DatabaseClient.ConnectionType connectionType)
Creates a client to access the database by means
of a REST server.
|
static DatabaseClient |
newClient(java.lang.String host,
int port, java.lang.String basePath,
java.lang.String database, DatabaseClientFactory.SecurityContext securityContext,
DatabaseClient.ConnectionType connectionType)
Creates a client to access the database by means
of a REST server.
|
static void |
registerDefaultHandles()
Initializes a handle registry with the default
associations between the content handles provided by the API and
the supported IO representation classes.
|
static void |
removeConfigurators()
Removes any instances of
ClientConfigurator that were passed in via
addConfigurator . |
public static DatabaseClient newClient(java.util.function.Function<java.lang.String,java.lang.Object> propertySource)
propertySource
. The
propertySource
function will be invoked once for each
of the below properties, giving the function a chance to return a
value associated with the property if desired. The set of values
returned for the below property names will then be used to
construct and return a new DatabaseClient
instance.
ConnectionType
SecurityContext
; if set, then all other authentication
properties pertaining to the construction of a
SecurityContext
will be ignored, including the
properties pertaining to SSL; this is effectively an escape hatch
for providing a SecurityContext
in case an appropriate
one cannot be created via the other supported propertiesjavax.net.ssl.SSLContext
getInstance
method in
javax.net.ssl.SSLContext
SSLHostnameVerifier
or a String with a
value of either "any", "common", or "strict"javax.net.ssl.X509TrustManager
; if not specified and
an SSL context is configured, an attempt will be made to use the
JVM's default trust managerpropertySource
-public static DatabaseClient newClient(java.lang.String host, int port, DatabaseClientFactory.SecurityContext securityContext)
host
- the host with the REST serverport
- the port for the REST serversecurityContext
- the security context created
depending upon the authentication type and communication channel
type (SSL)public static DatabaseClient newClient(java.lang.String host, int port, DatabaseClientFactory.SecurityContext securityContext, DatabaseClient.ConnectionType connectionType)
host
- the host with the REST serverport
- the port for the REST serversecurityContext
- the security context created
depending upon the authentication type and communication channel
type (SSL)connectionType
- whether the client connects
directly to the MarkLogic host or using a gateway such as a load
balancerpublic static DatabaseClient newClient(java.lang.String host, int port, java.lang.String database, DatabaseClientFactory.SecurityContext securityContext)
host
- the host with the REST serverport
- the port for the REST serverdatabase
- the database to access (default:
configured database for the REST server)securityContext
- the security context created
depending upon the authentication type and communication channel
type (SSL)public static DatabaseClient newClient(java.lang.String host, int port, java.lang.String database, DatabaseClientFactory.SecurityContext securityContext, DatabaseClient.ConnectionType connectionType)
host
- the host with the REST serverport
- the port for the REST serverdatabase
- the database to access (default:
configured database for the REST server)securityContext
- the security context created
depending upon the authentication type and communication channel
type (SSL)connectionType
- whether the client connects
directly to the MarkLogic host or using a gateway such as a load
balancerpublic static DatabaseClient newClient(java.lang.String host, int port, java.lang.String basePath, java.lang.String database, DatabaseClientFactory.SecurityContext securityContext, DatabaseClient.ConnectionType connectionType)
host
- the host with the REST serverport
- the port for the REST serverbasePath
- optional base path, typically used when
connecting to MarkLogic via a reverse proxy; since 6.1.0database
- the database to access (default:
configured database for the REST server)securityContext
- the security context created
depending upon the authentication type and communication channel
type (SSL)connectionType
- whether the client connects
directly to the MarkLogic host or using a gateway such as a load
balancerpublic static DatabaseClientFactory.HandleFactoryRegistry getHandleRegistry()
public static void clearHandleRegistry()
public static void registerDefaultHandles()
public static void addConfigurator(DatabaseClientFactory.ClientConfigurator<?> configurator)
DatabaseClient
is constructed, configurators will be
invoked in the order they were passed in.configurator
- the listener for configuring the
communication libraryOkHttpClientConfigurator
public static void removeConfigurators()
ClientConfigurator
that were passed in via
addConfigurator
.Copyright © 2024 MarkLogic Corporation. All Rights Reserved.