|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.repository.ModeShapeConfiguration
org.modeshape.jcr.JcrConfiguration
@NotThreadSafe public class JcrConfiguration
A configuration builder for a JcrEngine
. This class is an internal domain-specific language (DSL), and is designed to
be used in a traditional way or in a method-chained manner:
configuration.repositorySource("Source1").setClass(InMemoryRepositorySource.class).setDescription("description"); configuration.mimeTypeDetector("detector").setClass(ExtensionBasedMimeTypeDetector.class).setDescription("default detector"); configuration.sequencer("MicrosoftDocs") .setClass("org.modeshape.sequencer.msoffice.MSOfficeMetadataSequencer") .setDescription("Our primary sequencer for all .doc files") .sequencingFrom("/public//(*.(doc|xml|ppt)[*]/jcr:content[@jcr:data]") .andOutputtingTo("/documents/$1"); configuration.repository("MyRepository").setSource("Source1"); configuration.save();
Nested Class Summary | |
---|---|
protected static class |
JcrConfiguration.AuthenticatorBuilder<ReturnType>
|
static interface |
JcrConfiguration.AuthenticatorDefinition<ReturnType>
Interface used to set up and define a authentication provider instance. |
protected class |
JcrConfiguration.RepositoryBuilder<ReturnType>
|
static interface |
JcrConfiguration.RepositoryDefinition<ReturnType>
Interface used to define a JCR Repository that's accessible from the JcrEngine. |
Field Summary |
---|
Fields inherited from class org.modeshape.repository.ModeShapeConfiguration |
---|
DEFAULT_CONFIGURATION_SOURCE_NAME, DEFAULT_PATH, DEFAULT_WORKSPACE_NAME |
Constructor Summary | |
---|---|
JcrConfiguration()
Create a new configuration, using a default-constructed ExecutionContext . |
|
JcrConfiguration(ExecutionContext context)
Create a new configuration using the supplied ExecutionContext . |
Method Summary | ||
---|---|---|
JcrConfiguration |
and()
Convenience method to make the code that sets up this configuration easier to read. |
|
JcrEngine |
build()
Construct an engine that reflects the current state of this configuration. |
|
JcrConfiguration |
loadFrom(File configurationFile)
Load the configuration from a file. |
|
JcrConfiguration |
loadFrom(File configurationFile,
String path)
Load the configuration from a file. |
|
JcrConfiguration |
loadFrom(InputStream configurationFileInputStream)
Load the configuration from a file at the supplied URL. |
|
JcrConfiguration |
loadFrom(InputStream configurationFileInputStream,
String path)
Load the configuration from a file at the supplied URL. |
|
JcrConfiguration |
loadFrom(RepositorySource source)
Load the configuration from the repository content using the supplied repository source. |
|
JcrConfiguration |
loadFrom(RepositorySource source,
String workspaceName)
Load the configuration from the repository content using the workspace in the supplied repository source. |
|
JcrConfiguration |
loadFrom(RepositorySource source,
String workspaceName,
String pathInWorkspace)
Load the configuration from the repository content at the supplied path in the workspace in the supplied repository source. |
|
JcrConfiguration |
loadFrom(String pathToFile)
Load the configuration from a file at the given path. |
|
JcrConfiguration |
loadFrom(String pathToConfigurationFile,
String path)
Load the configuration from a file at the given path. |
|
JcrConfiguration |
loadFrom(URL urlToConfigurationFile)
Load the configuration from a file at the supplied URL. |
|
JcrConfiguration |
loadFrom(URL urlToConfigurationFile,
String path)
Load the configuration from a file at the supplied URL. |
|
ModeShapeConfiguration.MimeTypeDetectorDefinition<JcrConfiguration> |
mimeTypeDetector(String name)
Obtain or create a definition for the MIME type detector with the supplied name or identifier. |
|
Set<JcrConfiguration.RepositoryDefinition<JcrConfiguration>> |
repositories()
Get the list of repository definitions. |
|
JcrConfiguration.RepositoryDefinition<JcrConfiguration> |
repository(String name)
Obtain or create a definition for the JCR Repository with the supplied name or identifier. |
|
protected
|
repositoryDefinition(ReturnType returnObject,
String name)
Utility method to construct a definition object for the repository with the supplied name and return type. |
|
Set<String> |
repositoryNames()
Get the names of the repositories defined in this configuration. |
|
ModeShapeConfiguration.RepositorySourceDefinition<JcrConfiguration> |
repositorySource(String name)
Obtain or create a definition for the RepositorySource with the supplied name or identifier. |
|
JcrConfiguration |
save()
Persist any unsaved changes that have been made to this configuration. |
|
ModeShapeConfiguration.SequencerDefinition<JcrConfiguration> |
sequencer(String name)
Obtain or create a definition for the sequencer with the supplied name or identifier. |
|
JcrConfiguration |
withClassLoaderFactory(ClassLoaderFactory classLoaderFactory)
Specify the ClassLoaderFactory that should be used to load the classes for the various components. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JcrConfiguration()
ExecutionContext
.
public JcrConfiguration(ExecutionContext context)
ExecutionContext
.
context
- the execution context
IllegalArgumentException
- if the path is null or emptyMethod Detail |
---|
public JcrConfiguration loadFrom(String pathToFile) throws IOException, SAXException
loadFrom
in class ModeShapeConfiguration
pathToFile
- the path the file containing the configuration information
IOException
SAXException
ModeShapeConfiguration.loadFrom(java.lang.String)
public JcrConfiguration loadFrom(String pathToConfigurationFile, String path) throws IOException, SAXException
loadFrom
in class ModeShapeConfiguration
pathToConfigurationFile
- the path the file containing the configuration informationpath
- path within the content to the parent containing the configuration information, or null if the
default path
should be used
IOException
- if there is an error or problem reading the file at the supplied location
SAXException
- if the file is not a valid XML formatModeShapeConfiguration.loadFrom(java.lang.String, java.lang.String)
public JcrConfiguration loadFrom(File configurationFile) throws IOException, SAXException
loadFrom
in class ModeShapeConfiguration
configurationFile
- the file containing the configuration information
IOException
- if there is an error or problem reading the supplied file
SAXException
- if the file is not a valid XML formatModeShapeConfiguration.loadFrom(java.io.File)
public JcrConfiguration loadFrom(File configurationFile, String path) throws IOException, SAXException
loadFrom
in class ModeShapeConfiguration
configurationFile
- the file containing the configuration informationpath
- path within the content to the parent containing the configuration information, or null if the
default path
should be used
IOException
- if there is an error or problem reading the supplied file
SAXException
- if the file is not a valid XML formatModeShapeConfiguration.loadFrom(java.io.File, java.lang.String)
public JcrConfiguration loadFrom(URL urlToConfigurationFile) throws IOException, SAXException
loadFrom
in class ModeShapeConfiguration
urlToConfigurationFile
- the URL of the file containing the configuration information
IOException
- if there is an error or problem reading the file at the supplied URL
SAXException
- if the file is not a valid XML formatModeShapeConfiguration.loadFrom(java.net.URL)
public JcrConfiguration loadFrom(URL urlToConfigurationFile, String path) throws IOException, SAXException
loadFrom
in class ModeShapeConfiguration
urlToConfigurationFile
- the URL of the file containing the configuration informationpath
- path within the content to the parent containing the configuration information, or null if the
default path
should be used
IOException
- if there is an error or problem reading the file at the supplied URL
SAXException
- if the file is not a valid XML formatModeShapeConfiguration.loadFrom(java.net.URL, java.lang.String)
public JcrConfiguration loadFrom(InputStream configurationFileInputStream) throws IOException, SAXException
loadFrom
in class ModeShapeConfiguration
configurationFileInputStream
- the stream with the configuration information
IOException
- if there is an error or problem reading the file at the supplied URL
SAXException
- if the file is not a valid XML formatModeShapeConfiguration.loadFrom(java.io.InputStream)
public JcrConfiguration loadFrom(InputStream configurationFileInputStream, String path) throws IOException, SAXException
loadFrom
in class ModeShapeConfiguration
configurationFileInputStream
- the stream with the configuration informationpath
- path within the content to the parent containing the configuration information, or null if the
default path
should be used
IOException
- if there is an error or problem reading the file at the supplied URL
SAXException
- if the file is not a valid XML formatModeShapeConfiguration.loadFrom(java.io.InputStream, java.lang.String)
public JcrConfiguration loadFrom(RepositorySource source)
create connections
.
Also, the default workspace of the source will be used, and the configuration content may be found directly under the root
node.
loadFrom
in class ModeShapeConfiguration
source
- the source that defines the repository with the configuration content
ModeShapeConfiguration.loadFrom(org.modeshape.graph.connector.RepositorySource)
public JcrConfiguration loadFrom(RepositorySource source, String workspaceName)
create
connections
. Also, the configuration content may be found directly under the root node.
loadFrom
in class ModeShapeConfiguration
source
- the source that defines the repository with the configuration contentworkspaceName
- the name of the workspace with the configuration content, or null if the source's default workspace
should be used
ModeShapeConfiguration.loadFrom(org.modeshape.graph.connector.RepositorySource,
java.lang.String)
public JcrConfiguration loadFrom(RepositorySource source, String workspaceName, String pathInWorkspace)
create connections
.
loadFrom
in class ModeShapeConfiguration
source
- the source that defines the repository with the configuration contentworkspaceName
- the name of the workspace with the configuration content, or null if the source's default workspace
should be usedpathInWorkspace
- the path to the parent node under which the configuration content may be found, or null if the
content may be found under the root node
ModeShapeConfiguration.loadFrom(org.modeshape.graph.connector.RepositorySource,
java.lang.String, java.lang.String)
public JcrConfiguration and()
and
in class ModeShapeConfiguration
ModeShapeConfiguration.and()
public JcrConfiguration withClassLoaderFactory(ClassLoaderFactory classLoaderFactory)
ClassLoaderFactory
that should be used to load the classes for the various components. Most of the
definitions can specify the classpath
that should be used, and that classpath is
passed to the supplied ClassLoaderFactory instance to obtain a ClassLoader
for the class.
If not called, this configuration will use the class loader that loaded this configuration's class.
withClassLoaderFactory
in class ModeShapeConfiguration
classLoaderFactory
- the class loader factory implementation, or null if the classes should be loaded using the class
loader of this object
ModeShapeConfiguration.withClassLoaderFactory(org.modeshape.common.component.ClassLoaderFactory)
public ModeShapeConfiguration.MimeTypeDetectorDefinition<JcrConfiguration> mimeTypeDetector(String name)
MIME type detector
with the supplied name or identifier. A
new definition will be created if there currently is no MIME type detector defined with the supplied name.
mimeTypeDetector
in class ModeShapeConfiguration
name
- the name or identifier of the detector
ModeShapeConfiguration.mimeTypeDetector(java.lang.String)
public ModeShapeConfiguration.RepositorySourceDefinition<JcrConfiguration> repositorySource(String name)
RepositorySource
with the supplied name or identifier. A new definition will
be created if there currently is no repository source defined with the supplied name.
repositorySource
in class ModeShapeConfiguration
name
- the name or identifier of the repository source
ModeShapeConfiguration.repositorySource(java.lang.String)
public ModeShapeConfiguration.SequencerDefinition<JcrConfiguration> sequencer(String name)
sequencer
with the supplied name or identifier. A new
definition will be created if there currently is no sequencer defined with the supplied name.
sequencer
in class ModeShapeConfiguration
name
- the name or identifier of the sequencer
ModeShapeConfiguration.sequencer(java.lang.String)
public JcrConfiguration.RepositoryDefinition<JcrConfiguration> repository(String name)
JCR Repository
with the supplied name or identifier. A
new definition will be created if there currently is no sequencer defined with the supplied name.
name
- the name or identifier of the sequencer
public Set<String> repositoryNames()
public Set<JcrConfiguration.RepositoryDefinition<JcrConfiguration>> repositories()
public JcrConfiguration save()
no unsaved changes
.
save
in class ModeShapeConfiguration
ModeShapeConfiguration.save()
public JcrEngine build()
build
in class ModeShapeConfiguration
ModeShapeConfiguration.build()
protected <ReturnType extends JcrConfiguration> JcrConfiguration.RepositoryDefinition<ReturnType> repositoryDefinition(ReturnType returnObject, String name)
ReturnType
- the type of the return objectreturnObject
- the return objectname
- the name of the repository
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |