Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.jcr
Class JcrConfiguration

    java.lang.Object
      org.modeshape.repository.ModeShapeConfiguration
          org.modeshape.jcr.JcrConfiguration

    @NotThreadSafe
    public class JcrConfiguration

extends ModeShapeConfiguration

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.

Nested classes/interfaces inherited from class org.modeshape.repository.ModeShapeConfiguration
`ModeShapeConfiguration.BaseReturnable<ReturnType>, ModeShapeConfiguration.ChooseClass<ComponentClassType,ReturnType>, ModeShapeConfiguration.ClusterBuilder<ReturnType>, ModeShapeConfiguration.ClusterDefinition<ReturnType>, ModeShapeConfiguration.ConfigurationDefinition, ModeShapeConfiguration.GlobalProperties<ReturnType>, ModeShapeConfiguration.GraphComponentBuilder<ReturnType,ThisType,ComponentType>, ModeShapeConfiguration.GraphReturnable<ReturnType,ThisType>, ModeShapeConfiguration.HasName, ModeShapeConfiguration.LoadedFrom<ReturnType>, ModeShapeConfiguration.MimeTypeDetectorBuilder<ReturnType>, ModeShapeConfiguration.MimeTypeDetectorDefinition<ReturnType>, ModeShapeConfiguration.PathExpressionOutput<ReturnType>, ModeShapeConfiguration.Removable<ReturnType>, ModeShapeConfiguration.RepositorySourceDefinition<ReturnType>, ModeShapeConfiguration.Returnable<ReturnType>, ModeShapeConfiguration.SequencerBuilder<ReturnType>, ModeShapeConfiguration.SequencerDefinition<ReturnType>, ModeShapeConfiguration.SetDescription<ReturnType>, ModeShapeConfiguration.SetProperties<ReturnType>, ModeShapeConfiguration.SourceBuilder<ReturnType>, ModeShapeConfiguration.TextExtractorBuilder<ReturnType>, ModeShapeConfiguration.TextExtractorDefinition<ReturnType>`

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
`<ReturnType extends JcrConfiguration> JcrConfiguration.RepositoryDefinition<ReturnType>`
` | `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 org.modeshape.repository.ModeShapeConfiguration
`changes, clusterDefinition, clustering, configurationGraph, getConfigurationDefinition, getExecutionContext, getExecutionContextForEngine, getNamesOfComponentsUnder, getProblems, globalProperties, globalProperties, hasChanges, mimeTypeDetectorDefinition, mimeTypeDetectors, name, path, path, repositorySourceDefinition, repositorySources, sequencerDefinition, sequencers, storeTo, storeTo, storeTo, storeTo, textExtractor, textExtractorDefinition, textExtractors, withGarbageCollectionInterval, withName`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JcrConfiguration

    public JcrConfiguration()

  Create a new configuration, using a default-constructed `ExecutionContext`.

### JcrConfiguration

    public JcrConfiguration(ExecutionContext context)

  Create a new configuration using the supplied `ExecutionContext`.

  Parameters:
    `context` - the execution context
  Throws:
    `IllegalArgumentException` - if the path is null or empty

Method Detail

### loadFrom

    public JcrConfiguration loadFrom(String pathToFile)
                              throws IOException,
                                     SAXException

  Load the configuration from a file at the given path.

  Overrides:
    `loadFrom` in class `ModeShapeConfiguration`
  Parameters:
    `pathToFile` - the path the file containing the configuration information
  Returns:
    this configuration object, for convenience and method chaining
  Throws:
    `IOException`
    `SAXException`
  See Also:
    `ModeShapeConfiguration.loadFrom(java.lang.String)`

### loadFrom

    public JcrConfiguration loadFrom(String pathToConfigurationFile,
                                     String path)
                              throws IOException,
                                     SAXException

  Load the configuration from a file at the given path.

  Overrides:
    `loadFrom` in class `ModeShapeConfiguration`
  Parameters:
    `pathToConfigurationFile` - the path the file containing the configuration information
    `path` - path within the content to the parent containing the configuration information, or null if the `default path` should be used
  Returns:
    this configuration object, for convenience and method chaining
  Throws:
    `IOException` - if there is an error or problem reading the file at the supplied location
    `SAXException` - if the file is not a valid XML format
  See Also:
    `ModeShapeConfiguration.loadFrom(java.lang.String, java.lang.String)`

### loadFrom

    public JcrConfiguration loadFrom(File configurationFile)
                              throws IOException,
                                     SAXException

  Load the configuration from a file.

  Overrides:
    `loadFrom` in class `ModeShapeConfiguration`
  Parameters:
    `configurationFile` - the file containing the configuration information
  Returns:
    this configuration object, for convenience and method chaining
  Throws:
    `IOException` - if there is an error or problem reading the supplied file
    `SAXException` - if the file is not a valid XML format
  See Also:
    `ModeShapeConfiguration.loadFrom(java.io.File)`

### loadFrom

    public JcrConfiguration loadFrom(File configurationFile,
                                     String path)
                              throws IOException,
                                     SAXException

  Load the configuration from a file.

  Overrides:
    `loadFrom` in class `ModeShapeConfiguration`
  Parameters:
    `configurationFile` - the file containing the configuration information
    `path` - path within the content to the parent containing the configuration information, or null if the `default path` should be used
  Returns:
    this configuration object, for convenience and method chaining
  Throws:
    `IOException` - if there is an error or problem reading the supplied file
    `SAXException` - if the file is not a valid XML format
  See Also:
    `ModeShapeConfiguration.loadFrom(java.io.File, java.lang.String)`

### loadFrom

    public JcrConfiguration loadFrom(URL urlToConfigurationFile)
                              throws IOException,
                                     SAXException

  Load the configuration from a file at the supplied URL.

  Overrides:
    `loadFrom` in class `ModeShapeConfiguration`
  Parameters:
    `urlToConfigurationFile` - the URL of the file containing the configuration information
  Returns:
    this configuration object, for convenience and method chaining
  Throws:
    `IOException` - if there is an error or problem reading the file at the supplied URL
    `SAXException` - if the file is not a valid XML format
  See Also:
    `ModeShapeConfiguration.loadFrom(java.net.URL)`

### loadFrom

    public JcrConfiguration loadFrom(URL urlToConfigurationFile,
                                     String path)
                              throws IOException,
                                     SAXException

  Load the configuration from a file at the supplied URL.

  Overrides:
    `loadFrom` in class `ModeShapeConfiguration`
  Parameters:
    `urlToConfigurationFile` - the URL of the file containing the configuration information
    `path` - path within the content to the parent containing the configuration information, or null if the `default path` should be used
  Returns:
    this configuration object, for convenience and method chaining
  Throws:
    `IOException` - if there is an error or problem reading the file at the supplied URL
    `SAXException` - if the file is not a valid XML format
  See Also:
    `ModeShapeConfiguration.loadFrom(java.net.URL, java.lang.String)`

### loadFrom

    public JcrConfiguration loadFrom(InputStream configurationFileInputStream)
                              throws IOException,
                                     SAXException

  Load the configuration from a file at the supplied URL.

  Overrides:
    `loadFrom` in class `ModeShapeConfiguration`
  Parameters:
    `configurationFileInputStream` - the stream with the configuration information
  Returns:
    this configuration object, for convenience and method chaining
  Throws:
    `IOException` - if there is an error or problem reading the file at the supplied URL
    `SAXException` - if the file is not a valid XML format
  See Also:
    `ModeShapeConfiguration.loadFrom(java.io.InputStream)`

### loadFrom

    public JcrConfiguration loadFrom(InputStream configurationFileInputStream,
                                     String path)
                              throws IOException,
                                     SAXException

  Load the configuration from a file at the supplied URL.

  Overrides:
    `loadFrom` in class `ModeShapeConfiguration`
  Parameters:
    `configurationFileInputStream` - the stream with the configuration information
    `path` - path within the content to the parent containing the configuration information, or null if the `default path` should be used
  Returns:
    this configuration object, for convenience and method chaining
  Throws:
    `IOException` - if there is an error or problem reading the file at the supplied URL
    `SAXException` - if the file is not a valid XML format
  See Also:
    `ModeShapeConfiguration.loadFrom(java.io.InputStream, java.lang.String)`

### loadFrom

    public JcrConfiguration loadFrom(RepositorySource source)

  Load the configuration from the repository content using the supplied repository source. This method assumes that the supplied source has already been configured and is ready to `create connections`. Also, the default workspace of the source will be used, and the configuration content may be found directly under the root node.

  Overrides:
    `loadFrom` in class `ModeShapeConfiguration`
  Parameters:
    `source` - the source that defines the repository with the configuration content
  Returns:
    this configuration object, for convenience and method chaining
  See Also:
    `ModeShapeConfiguration.loadFrom(org.modeshape.graph.connector.RepositorySource)`

### loadFrom

    public JcrConfiguration loadFrom(RepositorySource source,
                                     String workspaceName)

  Load the configuration from the repository content using the workspace in the supplied repository source. This method assumes that the supplied source has already been configured and is ready to `create connections`. Also, the configuration content may be found directly under the root node.

  Overrides:
    `loadFrom` in class `ModeShapeConfiguration`
  Parameters:
    `source` - the source that defines the repository with the configuration content
    `workspaceName` - the name of the workspace with the configuration content, or null if the source's default workspace should be used
  Returns:
    this configuration object, for convenience and method chaining
  See Also:
    `ModeShapeConfiguration.loadFrom(org.modeshape.graph.connector.RepositorySource, java.lang.String)`

### loadFrom

    public 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. This method assumes that the supplied source has already been configured and is ready to `create connections`.

  Overrides:
    `loadFrom` in class `ModeShapeConfiguration`
  Parameters:
    `source` - the source that defines the repository with the configuration content
    `workspaceName` - the name of the workspace with the configuration content, or null if the source's default workspace should be used
    `pathInWorkspace` - 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
  Returns:
    this configuration object, for convenience and method chaining
  See Also:
    `ModeShapeConfiguration.loadFrom(org.modeshape.graph.connector.RepositorySource, java.lang.String, java.lang.String)`

### and

    public JcrConfiguration and()

  Convenience method to make the code that sets up this configuration easier to read. This method simply returns this object.

  Overrides:
    `and` in class `ModeShapeConfiguration`
  Returns:
    this configuration component; never null
  See Also:
    `ModeShapeConfiguration.and()`

### withClassLoaderFactory

    public JcrConfiguration withClassLoaderFactory(ClassLoaderFactory classLoaderFactory)

  Specify the `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.

  Overrides:
    `withClassLoaderFactory` in class `ModeShapeConfiguration`
  Parameters:
    `classLoaderFactory` - the class loader factory implementation, or null if the classes should be loaded using the class loader of this object
  Returns:
    this configuration, for method chaining purposes
  See Also:
    `ModeShapeConfiguration.withClassLoaderFactory(org.modeshape.common.component.ClassLoaderFactory)`

### mimeTypeDetector

    public ModeShapeConfiguration.MimeTypeDetectorDefinition<JcrConfiguration> mimeTypeDetector(String name)

  Obtain or create a definition for the `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.

  Overrides:
    `mimeTypeDetector` in class `ModeShapeConfiguration`
  Parameters:
    `name` - the name or identifier of the detector
  Returns:
    the details of the MIME type detector definition; never null
  See Also:
    `ModeShapeConfiguration.mimeTypeDetector(java.lang.String)`

### repositorySource

    public ModeShapeConfiguration.RepositorySourceDefinition<JcrConfiguration> repositorySource(String name)

  Obtain or create a definition for the `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.

  Overrides:
    `repositorySource` in class `ModeShapeConfiguration`
  Parameters:
    `name` - the name or identifier of the repository source
  Returns:
    the details of the repository source definition; never null
  See Also:
    `ModeShapeConfiguration.repositorySource(java.lang.String)`

### sequencer

    public ModeShapeConfiguration.SequencerDefinition<JcrConfiguration> sequencer(String name)

  Obtain or create a definition for the `sequencer` with the supplied name or identifier. A new definition will be created if there currently is no sequencer defined with the supplied name.

  Overrides:
    `sequencer` in class `ModeShapeConfiguration`
  Parameters:
    `name` - the name or identifier of the sequencer
  Returns:
    the details of the sequencer definition; never null
  See Also:
    `ModeShapeConfiguration.sequencer(java.lang.String)`

### repository

    public JcrConfiguration.RepositoryDefinition<JcrConfiguration> repository(String name)

  Obtain or create a definition for the `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.

  Parameters:
    `name` - the name or identifier of the sequencer
  Returns:
    the details of the sequencer definition; never null

### repositoryNames

    public Set<String> repositoryNames()

  Get the names of the repositories defined in this configuration.

  Returns:
    the repository names; never null

### repositories

    public Set<JcrConfiguration.RepositoryDefinition<JcrConfiguration>> repositories()

  Get the list of repository definitions.

  Returns:
    the unmodifiable set of definitions; never null but possibly empty if there are no definitions

### save

    public JcrConfiguration save()

  Persist any unsaved changes that have been made to this configuration. This method has no effect if there are currently `no unsaved changes`.

  Overrides:
    `save` in class `ModeShapeConfiguration`
  Returns:
    this configuration, for method chaining purposes
  See Also:
    `ModeShapeConfiguration.save()`

### build

    public JcrEngine build()

  Construct an engine that reflects the current state of this configuration. This method always creates a new instance.

  Overrides:
    `build` in class `ModeShapeConfiguration`
  Returns:
    the resulting engine; never null
  See Also:
    `ModeShapeConfiguration.build()`

### repositoryDefinition

    protected <ReturnType extends JcrConfiguration> JcrConfiguration.RepositoryDefinition<ReturnType> repositoryDefinition(ReturnType returnObject,
                                                                                                                           String name)

  Utility method to construct a definition object for the repository with the supplied name and return type.

  Type Parameters:
    `ReturnType` - the type of the return object
  Parameters:
    `returnObject` - the return object
    `name` - the name of the repository
  Returns:
    the definition for the repository

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.