Creates a client to access the database by means
of a REST server with connection and authentication information
retrieved from the given propertySource.
Initializes a handle registry with the default
associations between the content handles provided by the API and
the supported IO representation classes.
Creates a client to access the database by means
of a REST server with connection and authentication information
retrieved from the given 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.
marklogic.client.host = required; must be a String
marklogic.client.port = required; must be an int, Integer, or
String that can be parse as an int
marklogic.client.basePath = must be a String
marklogic.client.database = must be a String
marklogic.client.connectionType = must be a String or instance
of ConnectionType
marklogic.client.disableGzippedResponses = can be a String or
Boolean; if "true" or true, the client will not send an
"Accept-Encoding" request header with a value of "gzip" on each
request; supported since 6.3.0.
marklogic.client.securityContext = an instance of
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 properties
marklogic.client.authType = determines the type of
authentication to use; required if marklogic.client.securityContext
is not set; must be a String and one of "basic", "digest", "cloud",
"kerberos", "certificate", or "saml"
marklogic.client.username = must be a String; required for
basic and digest authentication
marklogic.client.password = must be a String; required for
basic and digest authentication
marklogic.client.connectionString = must be a String; must fit
format of "username:password@host:port/optionalDatabaseName".
Defaults the authentication type to "digest"; since 7.1.0.
marklogic.client.certificate.file = must be a String; optional
for certificate authentication
marklogic.client.certificate.password = must be a String;
optional for certificate authentication
marklogic.client.cloud.apiKey = must be a String; required for
cloud authentication
marklogic.client.cloud.tokenDuration = must be a number;
optional for configuring the duration in minutes for which an
access token lasts; supported since 6.3.0.
marklogic.client.kerberos.principal = must be a String;
required for Kerberos authentication
marklogic.client.saml.token = must be a String; required for
SAML authentication
marklogic.client.oauth.token = must be a String; required for
OAuth authentication; supported since 6.6.0.
marklogic.client.sslContext = must be an instance of
javax.net.ssl.SSLContext
marklogic.client.sslProtocol = must be a String; if "default',
then uses the JVM default SSL context; else, the value is passed to
the getInstance method in
javax.net.ssl.SSLContext
marklogic.client.sslHostnameVerifier = must either be an
instance of SSLHostnameVerifier or a String with a
value of either "any", "common", or "strict"
marklogic.client.trustManager = must be an instance of
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 manager
marklogic.client.ssl.keystore.path = must be a String; enables
2-way SSL if set; since 6.4.0.
marklogic.client.ssl.keystore.password = must be a String;
optional password for a key store; since 6.4.0.
marklogic.client.ssl.keystore.type = must be a String; optional
type for a key store, defaults to "JKS"; since 6.4.0.
marklogic.client.ssl.keystore.algorithm = must be a String;
optional algorithm for a key store, defaults to "SunX509"; since
6.4.0.
marklogic.client.ssl.truststore.path = must be a String;
specifies a file path for a trust store for SSL and/or certificate
authentication; since 6.5.0.
marklogic.client.ssl.truststore.password = must be a String;
optional password for a trust store; since 6.5.0.
marklogic.client.ssl.truststore.type = must be a String;
optional type for a trust store, defaults to "JKS"; since
6.5.0.
marklogic.client.ssl.truststore.algorithm = must be a String;
optional algorithm for a trust store, defaults to "SunX509"; since
6.5.0.
Creates a client to access the database by means
of a REST server. A data service interface can only call an
endpoint for the configured content database of the appserver. You
cannot specify the database when constructing a client for working
with a data service.
Parameters:
host - the host with the REST server
port - the port for the REST server
database - 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)
Creates a client to access the database by means
of a REST server. A data service interface can only call an
endpoint for the configured content database of the appserver. You
cannot specify the database when constructing a client for working
with a data service.
Parameters:
host - the host with the REST server
port - the port for the REST server
database - 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
balancer
Creates a client to access the database by means
of a REST server. A data service interface can only call an
endpoint for the configured content database of the appserver. You
cannot specify the database when constructing a client for working
with a data service.
Parameters:
host - the host with the REST server
port - the port for the REST server
basePath - optional base path, typically used when
connecting to MarkLogic via a reverse proxy; since 6.1.0
database - 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
balancer
Returns the default registry with factories for
creating handles as adapters for IO representations. To create
custom registries, use
Returns:
the default registry
clearHandleRegistry
public staticvoidclearHandleRegistry()
Removes the current registered associations so
the handle registry is empty.
registerDefaultHandles
public staticvoidregisterDefaultHandles()
Initializes a handle registry with the default
associations between the content handles provided by the API and
the supported IO representation classes. Use this method only after
clearing or overwriting associations in the handle registry.
Adds a listener that provides custom
configuration when a communication library is created. As of 6.3.0,
this method can now be called multiple times. When a
DatabaseClient is constructed, configurators will be
invoked in the order they were passed in.
Parameters:
configurator - the listener for configuring the
communication library