|
XCC/J 3.2-9 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.marklogic.xcc.jndi.ContentSourceBean
This is a Java Bean compatible implementation of
ContentSource intended for use in a JNDI context
or container where configuration must be done via
setter methods.
Use of this class to directly instantiate
a ContentSource is discouraged. If you wish
to programmatically create an instance use the primary
factory class ContentSourceFactory instead.
This class depends on a container-provided
ObjectFactory implementation.
If you have the option of configuring a custom bean
factory, you are encouraged to use
ContentSourceBeanFactory instead.
<Context path="/">
<Resource name="marklogic/ContentSource" auth="Container"
type="com.marklogic.xcc.jndi.ContentSourceBean"
factory="org.apache.naming.factory.BeanFactory"
host="somehost.mycorp.com" port="8003" user="fred" password="hush"
contentbase="productiondb"/>
<Context>
See ContentSourceBeanFactory for more details
and an example of looking up a ContentSource with
JNDI. The lookup code will be identical for both
configuration approaches.
ContentSourceBeanFactory| Constructor Summary | |
ContentSourceBean()
|
|
| 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 databaseId)
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 databaseId)
Attempts to establish a Session with the specified contentbase
on the server represented by this ContentSource, using the
provided user credentials. |
void |
setContentBase(String contentBase)
|
void |
setDefaultLogger(Logger logger)
Set the default java.util.Logger instance which will be inherited by new Session instances. |
void |
setHost(String host)
|
void |
setPassword(String password)
|
void |
setPort(int port)
|
void |
setUrl(String url)
|
void |
setUser(String user)
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ContentSourceBean()
| Method Detail |
public Session newSession()
ContentSourceSession with the default
contentbase for this ContentSource.
Login credentials are the defaults
established when the instance was created or bound to the JNDI
service.
newSession in interface ContentSourceSession instance.public Session newSession(String databaseId)
ContentSourceSession with the specified contentbase
on the server represented by this ContentSource.
newSession in interface ContentSourcedatabaseId - A contentbase name or numeric ID.
Session instance.
public Session newSession(String userName,
String password)
ContentSourceSession with the default
contentbase for this ContentSource using the provided login credentials.
newSession in interface ContentSourceuserName - The user name to connect as.password - The password associated with the user name.
Session instance.
public Session newSession(String userName,
String password,
String databaseId)
ContentSourceSession with the specified contentbase
on the server represented by this ContentSource, using the
provided user credentials.
newSession in interface ContentSourceuserName - The user name to connect as.password - The password associated with the user name.databaseId - A contentbase name or numeric ID.
Session instance.public Logger getDefaultLogger()
ContentSource
Returns the current Logger to which log messages will be sent.
If not overridden with ContentSource.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.
getDefaultLogger in interface ContentSourcepublic void setDefaultLogger(Logger logger)
ContentSource
Set the default java.util.Logger instance which will be
inherited by new Session instances.
setDefaultLogger in interface ContentSourcelogger - An instance of java.util.logging.Loggerpublic String toString()
public void setHost(String host)
public void setPort(int port)
public void setUser(String user)
public void setPassword(String password)
public void setContentBase(String contentBase)
public void setUrl(String url)
throws URISyntaxException
URISyntaxException
|
XCC/J 3.2-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