public class JcrRepository extends Object implements Repository
Modifier and Type | Class and Description |
---|---|
protected static class |
JcrRepository.BackgroundRepositoryTask
The garbage collection tasks should get cancelled before the repository is shut down, but just in case we'll use a weak
reference to hold onto the JcrRepository instance and we'll also check that the repository is running before we actually do
any work.
|
protected static class |
JcrRepository.BinaryValueGarbageCollectionTask |
protected static class |
JcrRepository.ConfigurationChange |
protected class |
JcrRepository.JcrRepositoryEnvironment |
protected static class |
JcrRepository.JournalingGCTask |
protected static class |
JcrRepository.LockGarbageCollectionTask |
protected static class |
JcrRepository.OptimizationTask |
static class |
JcrRepository.QueryLanguage
The set of supported query language string constants.
|
protected class |
JcrRepository.RunningState |
Modifier and Type | Field and Description |
---|---|
protected Logger |
logger |
protected static Set<String> |
MISSING_JAAS_POLICIES |
REPOSITORY_NAME, REPOSITORY_WORKSPACES, STANDARD_DESCRIPTORS
IDENTIFIER_STABILITY, IDENTIFIER_STABILITY_INDEFINITE_DURATION, IDENTIFIER_STABILITY_METHOD_DURATION, IDENTIFIER_STABILITY_SAVE_DURATION, IDENTIFIER_STABILITY_SESSION_DURATION, LEVEL_1_SUPPORTED, LEVEL_2_SUPPORTED, NODE_TYPE_MANAGEMENT_AUTOCREATED_DEFINITIONS_SUPPORTED, NODE_TYPE_MANAGEMENT_INHERITANCE, NODE_TYPE_MANAGEMENT_INHERITANCE_MINIMAL, NODE_TYPE_MANAGEMENT_INHERITANCE_MULTIPLE, NODE_TYPE_MANAGEMENT_INHERITANCE_SINGLE, NODE_TYPE_MANAGEMENT_MULTIPLE_BINARY_PROPERTIES_SUPPORTED, NODE_TYPE_MANAGEMENT_MULTIVALUED_PROPERTIES_SUPPORTED, NODE_TYPE_MANAGEMENT_ORDERABLE_CHILD_NODES_SUPPORTED, NODE_TYPE_MANAGEMENT_OVERRIDES_SUPPORTED, NODE_TYPE_MANAGEMENT_PRIMARY_ITEM_NAME_SUPPORTED, NODE_TYPE_MANAGEMENT_PROPERTY_TYPES, NODE_TYPE_MANAGEMENT_RESIDUAL_DEFINITIONS_SUPPORTED, NODE_TYPE_MANAGEMENT_SAME_NAME_SIBLINGS_SUPPORTED, NODE_TYPE_MANAGEMENT_UPDATE_IN_USE_SUPORTED, NODE_TYPE_MANAGEMENT_VALUE_CONSTRAINTS_SUPPORTED, OPTION_ACCESS_CONTROL_SUPPORTED, OPTION_ACTIVITIES_SUPPORTED, OPTION_BASELINES_SUPPORTED, OPTION_JOURNALED_OBSERVATION_SUPPORTED, OPTION_LIFECYCLE_SUPPORTED, OPTION_LOCKING_SUPPORTED, OPTION_NODE_AND_PROPERTY_WITH_SAME_NAME_SUPPORTED, OPTION_NODE_TYPE_MANAGEMENT_SUPPORTED, OPTION_OBSERVATION_SUPPORTED, OPTION_QUERY_SQL_SUPPORTED, OPTION_RETENTION_SUPPORTED, OPTION_SHAREABLE_NODES_SUPPORTED, OPTION_SIMPLE_VERSIONING_SUPPORTED, OPTION_TRANSACTIONS_SUPPORTED, OPTION_UNFILED_CONTENT_SUPPORTED, OPTION_UPDATE_MIXIN_NODE_TYPES_SUPPORTED, OPTION_UPDATE_PRIMARY_NODE_TYPE_SUPPORTED, OPTION_VERSIONING_SUPPORTED, OPTION_WORKSPACE_MANAGEMENT_SUPPORTED, OPTION_XML_EXPORT_SUPPORTED, OPTION_XML_IMPORT_SUPPORTED, QUERY_FULL_TEXT_SEARCH_SUPPORTED, QUERY_JOINS, QUERY_JOINS_INNER, QUERY_JOINS_INNER_OUTER, QUERY_JOINS_NONE, QUERY_LANGUAGES, QUERY_STORED_QUERIES_SUPPORTED, QUERY_XPATH_DOC_ORDER, QUERY_XPATH_POS_INDEX, REP_NAME_DESC, REP_VENDOR_DESC, REP_VENDOR_URL_DESC, REP_VERSION_DESC, SPEC_NAME_DESC, SPEC_VERSION_DESC, WRITE_SUPPORTED
Modifier | Constructor and Description |
---|---|
protected |
JcrRepository(RepositoryConfiguration configuration)
Create a Repository instance given the
configuration . |
Modifier and Type | Method and Description |
---|---|
protected ChangeBus |
changeBus() |
protected void |
completeRestore(RestoreOptions options) |
protected long |
determineInitialDelay(String initialTimeExpression)
Determine the initial delay before the garbage collection process(es) should be run, based upon the supplied initial
expression.
|
protected DocumentStore |
documentStore() |
protected boolean |
doShutdown(boolean rollback) |
protected JcrRepository.RunningState |
doStart() |
int |
getActiveSessionsCount()
Returns the number of active client sessions for this repository.
|
RepositoryConfiguration |
getConfiguration()
Get the immutable configuration for this repository.
|
String |
getDescriptor(String key) |
String[] |
getDescriptorKeys() |
org.modeshape.jcr.JcrValue |
getDescriptorValue(String key) |
org.modeshape.jcr.JcrValue[] |
getDescriptorValues(String key) |
String |
getName()
Get the name of this JCR repository instance.
|
RepositoryStatistics |
getRepositoryStatistics()
Get the component that can be used to obtain statistics for this repository.
|
Problems |
getStartupProblems()
Starts this repository instance (if not already started) and returns all the possible startup problems & warnings which did
not prevent the repository from starting up.
|
ModeShapeEngine.State |
getState()
Get the state of this JCR repository instance.
|
protected boolean |
hasWorkspace(String workspaceName) |
boolean |
isSingleValueDescriptor(String key) |
boolean |
isStandardDescriptor(String key) |
protected ChangeJournal |
journal() |
protected String |
journalId() |
protected boolean |
lockingUsed() |
protected org.modeshape.jcr.RepositoryLockManager |
lockManager() |
JcrSession |
login() |
JcrSession |
login(Credentials credentials) |
JcrSession |
login(Credentials credentials,
String workspaceName) |
JcrSession |
login(String workspaceName) |
protected boolean |
mimeTypeDetectionEnabled() |
protected org.modeshape.jcr.RepositoryNodeTypeManager |
nodeTypeManager() |
protected NamespaceRegistry |
persistentRegistry() |
protected void |
prepareToRestore() |
protected org.modeshape.jcr.RepositoryQueryManager |
queryManager() |
protected void |
refreshWorkspaces() |
protected RepositoryCache |
repositoryCache() |
protected String |
repositoryKey() |
protected String |
repositoryName() |
protected JcrRepository.RunningState |
runningState() |
protected RepositoryStatistics |
statistics() |
protected String |
systemWorkspaceKey() |
protected String |
systemWorkspaceName() |
protected TransactionManager |
transactionManager() |
Transactions |
transactions() |
protected boolean |
versioningUsed() |
protected NodeCache |
workspaceCache(String workspaceName) |
protected final Logger logger
protected JcrRepository(RepositoryConfiguration configuration) throws ConfigurationException
configuration
.configuration
- the repository configuration; may not be nullConfigurationException
- if there is a problem with the configurationpublic ModeShapeEngine.State getState()
public String getName()
getName
in interface NamedRepository
public int getActiveSessionsCount()
Repository
Session.logout()
hasn't been called yet.public RepositoryStatistics getRepositoryStatistics()
Note that this provides un-checked access to the statistics, unlike RepositoryManager.getRepositoryMonitor()
in the
public API which only exposes the statistics if the session's user has administrative privileges.
IllegalStateException
- if the repository is not running
Workspace.getRepositoryManager()
,
RepositoryManager.getRepositoryMonitor()
public Problems getStartupProblems() throws Exception
The are 2 general categories of issues that can be logged as problems:
protected final JcrRepository.RunningState doStart() throws Exception
Exception
protected final boolean doShutdown(boolean rollback)
public Transactions transactions()
protected final DocumentStore documentStore()
protected final String repositoryName()
protected final RepositoryCache repositoryCache()
protected final RepositoryStatistics statistics()
protected final org.modeshape.jcr.RepositoryNodeTypeManager nodeTypeManager()
protected final org.modeshape.jcr.RepositoryQueryManager queryManager()
protected final org.modeshape.jcr.RepositoryLockManager lockManager()
protected final NamespaceRegistry persistentRegistry()
protected final String systemWorkspaceName()
protected final String systemWorkspaceKey()
protected final ChangeBus changeBus()
protected final String repositoryKey()
protected final JcrRepository.RunningState runningState()
protected final boolean hasWorkspace(String workspaceName)
protected final TransactionManager transactionManager()
protected final void prepareToRestore() throws RepositoryException
RepositoryException
protected final String journalId()
protected final ChangeJournal journal()
protected final boolean versioningUsed()
protected final boolean lockingUsed()
protected final boolean mimeTypeDetectionEnabled()
protected final void completeRestore(RestoreOptions options) throws ExecutionException, Exception
ExecutionException
Exception
public RepositoryConfiguration getConfiguration()
public String getDescriptor(String key)
getDescriptor
in interface Repository
public org.modeshape.jcr.JcrValue getDescriptorValue(String key)
getDescriptorValue
in interface Repository
public org.modeshape.jcr.JcrValue[] getDescriptorValues(String key)
getDescriptorValues
in interface Repository
public boolean isSingleValueDescriptor(String key)
isSingleValueDescriptor
in interface Repository
public boolean isStandardDescriptor(String key)
isStandardDescriptor
in interface Repository
public String[] getDescriptorKeys()
getDescriptorKeys
in interface Repository
public JcrSession login() throws RepositoryException
login
in interface Repository
RepositoryException
public JcrSession login(Credentials credentials) throws RepositoryException
login
in interface Repository
RepositoryException
public JcrSession login(String workspaceName) throws RepositoryException
login
in interface Repository
RepositoryException
public JcrSession login(Credentials credentials, String workspaceName) throws RepositoryException
login
in interface Repository
IllegalArgumentException
- if credentials
is not null
but:
getLoginContext()
nor a getAccessControlContext()
method and is
not an instance of SimpleCredentials
.getLoginContext()
method that doesn't return a LoginContext
.
getLoginContext()
method that returns a
null
LoginContext
.
getLoginContext()
method, but provides a getAccessControlContext()
method that doesn't return an AccessControlContext
.
getLoginContext()
method, but provides a getAccessControlContext()
method that returns a null
AccessControlContext
.
RepositoryException
Repository.login(javax.jcr.Credentials, java.lang.String)
protected void refreshWorkspaces()
protected long determineInitialDelay(String initialTimeExpression)
initialTimeExpression
- the expression of the form "hh:mm
"; never nullCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.