public class ContentSourceFactory
extends java.lang.Object
Static helper class with factory methods to create instances of ContentSource
using
explicit connection parameters.
ContentSource
Modifier and Type | Method and Description |
---|---|
static ContentSource |
newContentSource(ConnectionProvider connectionProvider,
java.lang.String user,
char[] password,
java.lang.String contentbaseName)
Return a
ContentSource object that will use the provided ConnectionProvider
instance to obtain server connections, with the given default login credentials and
contentbase values. |
static ContentSource |
newContentSource(ConnectionProvider connectionProvider,
java.lang.String user,
java.lang.String password,
java.lang.String contentbaseName)
Deprecated.
|
static ContentSource |
newContentSource(java.lang.String host,
int port)
Return a ContentSource object that will serve as the source of connections to the server on
the given host and port, with no default login credentials.
|
static ContentSource |
newContentSource(java.lang.String host,
int port,
java.lang.String user,
char[] password)
Equivalent to
newContentSource (host, port, user, password, null) |
static ContentSource |
newContentSource(java.lang.String host,
int port,
java.lang.String user,
char[] password,
java.lang.String contentbaseName)
Equivalent to
newContentSource (host, port, user, password, contentbaseName, null) |
static ContentSource |
newContentSource(java.lang.String host,
int port,
java.lang.String user,
char[] password,
java.lang.String contentbaseName,
SecurityOptions options)
Return a
ContentSource object that will serve as the source of connections to the
server on the given host and port, with login credentials of the given user and password. |
static ContentSource |
newContentSource(java.lang.String host,
int port,
java.lang.String user,
java.lang.String password)
Deprecated.
|
static ContentSource |
newContentSource(java.lang.String host,
int port,
java.lang.String user,
java.lang.String password,
java.lang.String contentbaseName)
Deprecated.
|
static ContentSource |
newContentSource(java.lang.String host,
int port,
java.lang.String user,
java.lang.String password,
java.lang.String contentbaseName,
SecurityOptions options)
Deprecated.
|
static ContentSource |
newContentSource(java.net.URI uri)
Equivalent to
newContentSource(uri, null) . |
static ContentSource |
newContentSource(java.net.URI uri,
SecurityOptions options)
Return a
ContentSource object that will serve as the source of connections to the
server specified by the given URI. |
@Deprecated public static ContentSource newContentSource(ConnectionProvider connectionProvider, java.lang.String user, java.lang.String password, java.lang.String contentbaseName)
Return a ContentSource
object that will use the provided ConnectionProvider
instance to obtain server connections, with the given default login credentials and
contentbase values. Custom connection management policies may be implemented by the
ConnectionProvider
object.
NOTE: This factory method should only be used by advanced users. A
misbehaving ConnectionProvider
implementation can result in connection failures and
potentially even data loss. Be sure you know what you're doing.
connectionProvider
- An instance of ConnectionProvider
that will be used to obtain sockets to
connect to the ContentSource
when needed. The client is responsible for
properly initializing this object with the information it needs to make the
appropriate connections.user
- The default User Name to use for authentication.password
- The default Password to use for authentication.contentbaseName
- The contentbase (database) on the ContentSource
to run queries against.
The contentbase numeric id may be supplied instead, if prepended by '#'. Pass null
to use the default configured on the server.ContentSource
instance representing the ContentSource.ContentSource
,
ContentbaseMetaData
public static ContentSource newContentSource(ConnectionProvider connectionProvider, java.lang.String user, char[] password, java.lang.String contentbaseName)
Return a ContentSource
object that will use the provided ConnectionProvider
instance to obtain server connections, with the given default login credentials and
contentbase values. Custom connection management policies may be implemented by the
ConnectionProvider
object.
NOTE: This factory method should only be used by advanced users. A
misbehaving ConnectionProvider
implementation can result in connection failures and
potentially even data loss. Be sure you know what you're doing.
connectionProvider
- An instance of ConnectionProvider
that will be used to obtain sockets to
connect to the ContentSource
when needed. The client is responsible for
properly initializing this object with the information it needs to make the
appropriate connections.user
- The default User Name to use for authentication.password
- The default Password to use for authentication.contentbaseName
- The contentbase (database) on the ContentSource
to run queries against.
The contentbase numeric id may be supplied instead, if prepended by '#'. Pass null
to use the default configured on the server.ContentSource
instance representing the ContentSource.ContentSource
,
ContentbaseMetaData
public static ContentSource newContentSource(java.net.URI uri, SecurityOptions options) throws XccConfigException
Return a ContentSource
object that will serve as the source of connections to the
server specified by the given URI.
The format of the URI is: xcc://user:password@host:port/contentbase
For an SSL-enabled connection, the URI format is:
xccs://user:password@host:port/contentbase
For example: xcc://joe:hush@myserver:8003
For example: xccs://joe:hush@myserver:8003/production
The contentbase name is optional. If not specified the default database for the XDBC server
configuration will be used. To reference a contentbase by numeric id (see
ContentbaseMetaData.getContentBaseId()
), prepend it with '#'.
For example: xcc://joe:hush@myserver:8003/#84635406972362574
The supported connection schemes are currently "xcc" ("xdbc" is an alias) for a non-secure connection and "xccs" for a secure connection, but others may be added in the future.
uri
- A URI instance which encodes the connection scheme, host, port and optional user
and password.options
- Security settings to be used for "xccs" secure connections.ContentSource
instance representing the ContentSource.XccConfigException
- If there is a configuration problem or the configured ContentSource
implementation class cannot be instantiated.ContentSource
,
ContentbaseMetaData
public static ContentSource newContentSource(java.net.URI uri) throws XccConfigException
newContentSource(uri, null)
.uri
- A URI instance which encodes the connection scheme, host, port and optional user
and password. The format of the URI is:
xcc://user:password@host:port/contentbase
ContentSource
instance representing the ContentSource.XccConfigException
- If there is a configuration problem or the configured ContentSource
implementation class cannot be instantiated.@Deprecated public static ContentSource newContentSource(java.lang.String host, int port, java.lang.String user, java.lang.String password, java.lang.String contentbaseName, SecurityOptions options)
ContentSource
object that will serve as the source of connections to the
server on the given host and port, with login credentials of the given user and password. No
connections are made at this time. Note that the ContentSource
instance returned may
be shared with other callers or threads. The implementation may choose to pool and re-use
ContentSource
objects for a particular host/port/user combination.host
- The name or dotted-quad IP address of the server host.port
- The port on the host to connect to.user
- The default User Name to use for authentication.password
- The default Password to use for authentication.contentbaseName
- The ContentBase (database) on the ContentSource to run queries against. The
contentbase numeric id may be supplied instead, if prepended by '#'. Pass null to
use the default configured on the server.options
- Security settings to be used for secure connections.ContentSource
instance representing the ContentSource.ContentSource
,
ContentbaseMetaData
public static ContentSource newContentSource(java.lang.String host, int port, java.lang.String user, char[] password, java.lang.String contentbaseName, SecurityOptions options)
ContentSource
object that will serve as the source of connections to the
server on the given host and port, with login credentials of the given user and password. No
connections are made at this time. Note that the ContentSource
instance returned may
be shared with other callers or threads. The implementation may choose to pool and re-use
ContentSource
objects for a particular host/port/user combination.host
- The name or dotted-quad IP address of the server host.port
- The port on the host to connect to.user
- The default User Name to use for authentication.password
- The default Password to use for authentication.contentbaseName
- The ContentBase (database) on the ContentSource to run queries against. The
contentbase numeric id may be supplied instead, if prepended by '#'. Pass null to
use the default configured on the server.options
- Security settings to be used for secure connections.ContentSource
instance representing the ContentSource.ContentSource
,
ContentbaseMetaData
@Deprecated public static ContentSource newContentSource(java.lang.String host, int port, java.lang.String user, java.lang.String password, java.lang.String contentbaseName)
newContentSource (host, port, user, password, contentbaseName, null)
host
- The name or dotted-quad IP address of the server host.port
- The port on the host to connect to.user
- The default User Name to use for authentication.password
- The default Password to use for authentication.contentbaseName
- The ContentBase (database) on the ContentSource to runContentSource
instance representing the ContentSource. the configured
ContentSource
implementation class cannot be instantiated.ContentSource
public static ContentSource newContentSource(java.lang.String host, int port, java.lang.String user, char[] password, java.lang.String contentbaseName)
newContentSource (host, port, user, password, contentbaseName, null)
host
- The name or dotted-quad IP address of the server host.port
- The port on the host to connect to.user
- The default User Name to use for authentication.password
- The default Password to use for authentication.contentbaseName
- The ContentBase (database) on the ContentSource to runContentSource
instance representing the ContentSource. the configured
ContentSource
implementation class cannot be instantiated.ContentSource
@Deprecated public static ContentSource newContentSource(java.lang.String host, int port, java.lang.String user, java.lang.String password)
newContentSource (host, port, user, password, null)
host
- The name or dotted-quad IP address of the server host.port
- The port on the host to connect to.user
- The default User Name to use for authentication.password
- The default Password to use for authentication.ContentSource
instance representing the ContentSource. the configured
ContentSource
implementation class cannot be instantiated.ContentSource
public static ContentSource newContentSource(java.lang.String host, int port, java.lang.String user, char[] password)
newContentSource (host, port, user, password, null)
host
- The name or dotted-quad IP address of the server host.port
- The port on the host to connect to.user
- The default User Name to use for authentication.password
- The default Password to use for authentication.ContentSource
instance representing the ContentSource. the configured
ContentSource
implementation class cannot be instantiated.ContentSource
public static ContentSource newContentSource(java.lang.String host, int port)
host
- The name or dotted-quad IP address of the server host.port
- The port on the host to connect to.ContentSource
Copyright © 2018 MarkLogic Corporation. All Rights Reserved.
Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com