|
XCC/J 3.1-9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
A ContentSource object describes a content source (MarkLogic Server instance)
and serves as a factory that creates Session objects.
Instances of ContentSource may be obtained from a JNDI lookup service
or from one of the static factory methods on the ContentSourceFactory class.
See the getDefaultLogger() method for information
about configuring logging behavior.
getDefaultLogger(),
ContentSourceFactory,
Session| Method Summary | |
Logger |
getDefaultLogger()
Returns the current Logger to which log messages will be sent. |
Session |
newSession()
Attempts to establish a Session with the default
contentbase for this ContentSource. |
Session |
newSession(String contentbaseId)
Attempts to establish a Session with the specified contentbase
on the server represented by this ContentSource. |
Session |
newSession(String userName,
String password)
Attempts to establish a Session with the default
contentbase for this ContentSource using the provided login credentials. |
Session |
newSession(String userName,
String password,
String contentbaseId)
Attempts to establish a Session with the specified contentbase
on the server represented by this ContentSource, using the
provided user credentials. |
void |
setDefaultLogger(Logger logger)
Set the default java.util.Logger instance which will be inherited by new Session instances. |
| Method Detail |
public Session newSession()
Session with the default
contentbase for this ContentSource.
Login credentials are the defaults
established when the instance was created or bound to the JNDI
service.
Session instance.
IllegalStateException - If this ContentSource was created
without specifying user/password credentials.public Session newSession(String contentbaseId)
Session with the specified contentbase
on the server represented by this ContentSource.
contentbaseId - A contentbase name or numeric ID.
Session instance.
IllegalStateException - If this ContentSource was created
without specifying default user credentials.
public Session newSession(String userName,
String password)
Session with the default
contentbase for this ContentSource using the provided login credentials.
userName - The user name to connect as.password - The password associated with the user name.
Session instance.
public Session newSession(String userName,
String password,
String contentbaseId)
Session with the specified contentbase
on the server represented by this ContentSource, using the
provided user credentials.
userName - The user name to connect as.password - The password associated with the user name.contentbaseId - A contentbase name or numeric ID.
Session instance.public Logger getDefaultLogger()
Returns the current Logger to which log messages will be sent.
If not overridden with setDefaultLogger(Logger), an implementation
default logger is returned. This Logger will be inherited
by Session instances created from this ContentSource.
The Logger for individual Sessions can be
overridden with the
Session.setLogger(java.util.logging.Logger) method.
The name of the implementation default logger is
com.marklogic.xcc. This is the name which should be
used in a logging properties file
(see LogManager) to customize
the logger.
XCC includes a bundled properties file that augments the default JVM logging properties. This file, xcc.logging.properties, is read from the classpath when the first ContentSource instance is created. The properties file in xcc.jar looks like this. If you wish to customize these logging properties, place a copy of this file in your classpath ahead of xcc.jar.
Default logging properties file in xcc.jar.
public void setDefaultLogger(Logger logger)
Set the default java.util.Logger instance which will be
inherited by new Session instances.
logger - An instance of java.util.logging.Logger
|
XCC/J 3.1-9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Complete online documentation for MarkLogic Server, XQuery and related components may be found at developer.marklogic.com