public static class DatabaseClientFactory.Bean extends Object implements Serializable
A Database Client Factory Bean provides an object for specifying configuration before creating a client to make database requests.
For instance, a Spring configuration file might resemble the following example:
<bean name="databaseClientFactory"
class="com.marklogic.client.DatabaseClientFactory.Bean">
<property name="host" value="localhost"/>
<property name="port" value="8012"/>
<property name="user" value="rest-writer-user"/>
<property name="password" value="rest-writer-password"/>
<property name="authenticationValue" value="digest"/>
</bean>
<bean name="databaseClient"
class="com.marklogic.client.DatabaseClient"
factory-bean="databaseClientFactory"
factory-method="newClient"/>
| Constructor and Description |
|---|
Bean()
Zero-argument constructor for bean applications.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearHandleRegistry()
Removes the current registered associations so the handle registry is empty.
|
DatabaseClientFactory.Authentication |
getAuthentication()
Deprecated.
(as of 4.0.1) use instanceof on any SecurityContext to get its type
|
SSLContext |
getContext()
Deprecated.
(as of 4.0.1) use SecurityContext.getSSLContext()
|
String |
getDatabase()
Returns the database for clients created with a DatabaseClientFactory.Bean object.
|
String |
getExternalName()
Returns the external name for Kerberos clients created with a DatabaseClientFactory.Bean object.
|
DatabaseClientFactory.HandleFactoryRegistry |
getHandleRegistry()
Returns the registry for associating IO representation classes with handle factories.
|
String |
getHost()
Returns the host for clients created with a DatabaseClientFactory.Bean object.
|
String |
getPassword()
Deprecated.
(as of 4.0.1) use SecurityContext.getUser() with BasicAuthContext or DigestAuthContext
|
int |
getPort()
Returns the port for clients created with a DatabaseClientFactory.Bean object.
|
DatabaseClientFactory.SecurityContext |
getSecurityContext()
Returns the security context for clients created with a DatabaseClientFactory.Bean object - BasicAuthContext, DigestAuthContext or KerberosAuthContext
|
String |
getUser()
Deprecated.
(as of 4.0.1) use SecurityContext.getUser() with BasicAuthContext or DigestAuthContext
|
DatabaseClientFactory.SSLHostnameVerifier |
getVerifier()
Deprecated.
(as of 4.0.1) use SecurityContext.getSSLHostnameVerifier()
|
DatabaseClient |
newClient()
Creates a client for bean applications based on the properties.
|
void |
registerDefaultHandles()
Initializes a handle registry with the default associations between the content handles provided by the API and the supported IO representation classes.
|
void |
setAuthentication(DatabaseClientFactory.Authentication authentication)
Deprecated.
(as of 4.0.1) use constructor for any SecurityContext
|
void |
setAuthenticationValue(String authentication)
Deprecated.
(as of 4.0.1) use constructor for any SecurityContext
|
void |
setContext(SSLContext context)
Deprecated.
(as of 4.0.1) use SecurityContext.setSSLContext(SSLContext) or SecurityContext.withSSLContext(SSLContext)
|
void |
setDatabase(String database)
Specifies the database for clients created with a DatabaseClientFactory.Bean object.
|
void |
setExternalName(String externalName)
Specifies the external name for Kerberos clients created with a DatabaseClientFactory.Bean object.
|
void |
setHost(String host)
Specifies the host for clients created from a DatabaseClientFactory.Bean object.
|
void |
setPassword(String password)
Deprecated.
(as of 4.0.1) use constructors for BasicAuthContext or DigestAuthContext
|
void |
setPort(int port)
Specifies the port for clients created with a DatabaseClientFactory.Bean object.
|
void |
setSecurityContext(DatabaseClientFactory.SecurityContext securityContext)
Specifies the security context for clients created with a DatabaseClientFactory.Bean object
|
void |
setUser(String user)
Deprecated.
(as of 4.0.1) use constructors for BasicAuthContext or DigestAuthContext
|
void |
setVerifier(DatabaseClientFactory.SSLHostnameVerifier verifier)
Deprecated.
(as of 4.0.1) use SecurityContext.setSSLHostnameVerifier(SSLHostnameVerifier) or SecurityContext.withSSLHostnameVerifier(SSLHostnameVerifier)
|
public Bean()
Zero-argument constructor for bean applications. Other applications can use the static newClient() factory methods of DatabaseClientFactory.
public String getHost()
Returns the host for clients created with a DatabaseClientFactory.Bean object.
public void setHost(String host)
Specifies the host for clients created from a DatabaseClientFactory.Bean object.
host - the client hostpublic int getPort()
Returns the port for clients created with a DatabaseClientFactory.Bean object.
public void setPort(int port)
Specifies the port for clients created with a DatabaseClientFactory.Bean object.
port - the client port@Deprecated public String getUser()
Returns the user authentication for clients created with a DatabaseClientFactory.Bean object.
@Deprecated public void setUser(String user)
Specifies the user authentication for clients created with a DatabaseClientFactory.Bean object.
user - the user@Deprecated public String getPassword()
Returns the password authentication for clients created with a DatabaseClientFactory.Bean object.
@Deprecated public void setPassword(String password)
Specifies the password authentication for clients created with a DatabaseClientFactory.Bean object.
password - the passwordpublic String getExternalName()
Returns the external name for Kerberos clients created with a DatabaseClientFactory.Bean object.
public void setExternalName(String externalName)
Specifies the external name for Kerberos clients created with a DatabaseClientFactory.Bean object.
externalName - the external name@Deprecated public DatabaseClientFactory.Authentication getAuthentication()
Returns the authentication type for clients created with a DatabaseClientFactory.Bean object.
@Deprecated public void setAuthentication(DatabaseClientFactory.Authentication authentication)
Specifies the authentication type for clients created with a DatabaseClientFactory.Bean object.
authentication - the authentication type@Deprecated public void setAuthenticationValue(String authentication)
Specifies the authentication type for clients created with a DatabaseClientFactory.Bean object based on a string value.
authentication - the authentication typepublic String getDatabase()
Returns the database for clients created with a DatabaseClientFactory.Bean object.
public void setDatabase(String database)
Specifies the database for clients created with a DatabaseClientFactory.Bean object.
database - a database to pass along to new DocumentManager and QueryManager instances@Deprecated public SSLContext getContext()
Returns the SSLContext for SSL clients created with a DatabaseClientFactory.Bean object.
@Deprecated public void setContext(SSLContext context)
Specifies the SSLContext for clients created with a DatabaseClientFactory.Bean object that authenticate with SSL.
context - the SSL context@Deprecated public DatabaseClientFactory.SSLHostnameVerifier getVerifier()
Returns the host verifier for clients created with a DatabaseClientFactory.Bean object.
@Deprecated public void setVerifier(DatabaseClientFactory.SSLHostnameVerifier verifier)
Specifies the host verifier for clients created with a DatabaseClientFactory.Bean object that verify hosts for additional security.
verifier - the host verifierpublic DatabaseClientFactory.SecurityContext getSecurityContext()
Returns the security context for clients created with a DatabaseClientFactory.Bean object - BasicAuthContext, DigestAuthContext or KerberosAuthContext
public void setSecurityContext(DatabaseClientFactory.SecurityContext securityContext)
Specifies the security context for clients created with a DatabaseClientFactory.Bean object
securityContext - the security context - BasicAuthContext, DigestAuthContext or KerberosAuthContextpublic DatabaseClientFactory.HandleFactoryRegistry getHandleRegistry()
Returns the registry for associating IO representation classes with handle factories.
public void clearHandleRegistry()
Removes the current registered associations so the handle registry is empty.
public void registerDefaultHandles()
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.
public DatabaseClient newClient()
Creates a client for bean applications based on the properties. Other applications can use the static newClient() factory methods of DatabaseClientFactory. The client accesses the database by means of a REST server.
Copyright © 2013-2017 MarkLogic Corporation.