|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.connector.jcr.JcrRepositorySource
@ThreadSafe public class JcrRepositorySource
The RepositorySource
for the connector that exposes an area of the local file system as content in a repository. This
source considers a workspace name to be the path to the directory on the file system that represents the root of that
workspace. New workspaces can be created, as long as the names represent valid paths to existing directories.
Field Summary | |
---|---|
protected static String |
CREDENTIALS
|
protected static String |
DEFAULT_CACHE_POLICY
|
static int |
DEFAULT_RETRY_LIMIT
The default limit is 0 for retrying connection calls to the underlying source. |
protected static String |
PASSWORD
|
protected static String |
REPOSITORY_JNDI_NAME
|
protected static String |
RETRY_LIMIT
|
protected static String |
SOURCE_NAME
|
protected static boolean |
SUPPORTS_CREATING_WORKSPACES
This source does not support creating new workspaces, since the JCR API does not provide a way of doing so. |
protected static boolean |
SUPPORTS_EVENTS
This source supports events. |
protected static boolean |
SUPPORTS_REFERENCES
This source supports creating references. |
protected static boolean |
SUPPORTS_SAME_NAME_SIBLINGS
This source supports same-name-siblings. |
protected static boolean |
SUPPORTS_UPDATES
This source does support updates. |
protected static String |
USERNAME
|
Constructor Summary | |
---|---|
JcrRepositorySource()
Create a new instance of a JCR repository source. |
Method Summary | |
---|---|
void |
close()
Signal this source that it is no longer needed and should begin the process of reclaiming or closing all resources that it has acquired. |
RepositorySourceCapabilities |
getCapabilities()
Get the capabilities for this source. |
RepositoryConnection |
getConnection()
Get a connection from this source. |
protected Context |
getContext()
|
Credentials |
getCredentials()
Get the JCR credentials that should be used. |
CachePolicy |
getDefaultCachePolicy()
Get the default cache policy for this source, or null if the global default cache policy should be used |
String |
getName()
Get the name for this repository source. |
Object |
getObjectInstance(Object obj,
Name name,
Context nameCtx,
Hashtable<?,?> environment)
|
String |
getPassword()
|
Reference |
getReference()
|
protected Repository |
getRepository()
|
protected RepositoryContext |
getRepositoryContext()
|
String |
getRepositoryJndiName()
|
int |
getRetryLimit()
Get the maximum number of retries that may be performed on a given operation when using connections created by this source. |
boolean |
getUpdatesAllowed()
Get whether this source supports updates. |
String |
getUsername()
Get the username that should be used to access the repository. |
void |
initialize(RepositoryContext context)
Initialize this source to use the supplied RepositoryContext , from which this source can obtain the
configuration defining this source,
connections to other sources , and the
execution context . |
protected void |
setContext(Context context)
|
void |
setCredentials(Credentials credentials)
Set the JCR credentials that should be used. |
void |
setDefaultCachePolicy(CachePolicy defaultCachePolicy)
|
void |
setName(String name)
Set the name for the source |
void |
setPassword(String password)
|
protected void |
setRepository(Repository repository)
|
void |
setRepositoryJndiName(String repositoryJndiName)
Set the name in JNDI where this source can find the JCR Repository object. |
void |
setRetryLimit(int limit)
Set the maximum number of retries that may be performed on a given operation when using connections created by this source. |
void |
setUsername(String username)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String SOURCE_NAME
protected static final String REPOSITORY_JNDI_NAME
protected static final String USERNAME
protected static final String PASSWORD
protected static final String CREDENTIALS
protected static final String DEFAULT_CACHE_POLICY
protected static final String RETRY_LIMIT
public static final int DEFAULT_RETRY_LIMIT
connection
calls to the underlying source.
protected static final boolean SUPPORTS_EVENTS
protected static final boolean SUPPORTS_SAME_NAME_SIBLINGS
protected static final boolean SUPPORTS_UPDATES
protected static final boolean SUPPORTS_CREATING_WORKSPACES
protected static final boolean SUPPORTS_REFERENCES
Constructor Detail |
---|
public JcrRepositorySource()
Method Detail |
---|
public String getName()
getName
in interface RepositorySource
RepositorySource.getName()
public void setName(String name)
name
- the new name for the sourcepublic RepositorySourceCapabilities getCapabilities()
getCapabilities
in interface RepositorySource
RepositorySource.getCapabilities()
@Description(i18n=JcrConnectorI18n.class, value="updatesAllowedPropertyDescription") @Label(i18n=JcrConnectorI18n.class, value="updatesAllowedPropertyLabel") @Category(i18n=JcrConnectorI18n.class, value="updatesAllowedPropertyCategory") public boolean getUpdatesAllowed()
public String getRepositoryJndiName()
public void setRepositoryJndiName(String repositoryJndiName)
repositoryJndiName
- the name in JNDI where the JCR Repository object can be foundpublic String getUsername()
public void setUsername(String username)
username
- Sets username to the specified value.public String getPassword()
public void setPassword(String password)
password
- Sets password to the specified value.public Credentials getCredentials()
public void setCredentials(Credentials credentials)
credentials
- the credentials, or null if no fixed credentials should be usedpublic CachePolicy getDefaultCachePolicy()
public void setDefaultCachePolicy(CachePolicy defaultCachePolicy)
defaultCachePolicy
- Sets defaultCachePolicy to the specified value.public int getRetryLimit()
connections
created by this source. This value does not constitute a minimum number of retries; in fact, the connection
user is not required to retry any operations.
getRetryLimit
in interface RepositorySource
RepositorySource.getRetryLimit()
public void setRetryLimit(int limit)
connections
created by this source. This value does not constitute a minimum number of retries; in fact, the connection
user is not required to retry any operations.
setRetryLimit
in interface RepositorySource
limit
- the maximum number of allowable retries, or 0 if the source has no limitRepositorySource.setRetryLimit(int)
public void initialize(RepositoryContext context) throws RepositorySourceException
RepositoryContext
, from which this source can obtain the
configuration
defining this source,
connections
to other sources
, and the
execution context
.
This method may be called each time the configuration changes, allowing the source to update itself.
initialize
in interface RepositorySource
RepositorySourceException
RepositorySource.initialize(org.modeshape.graph.connector.RepositoryContext)
protected RepositoryContext getRepositoryContext()
protected Repository getRepository()
protected void setRepository(Repository repository)
protected Context getContext()
protected void setContext(Context context)
public Reference getReference()
getReference
in interface Referenceable
Referenceable.getReference()
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
getObjectInstance
in interface ObjectFactory
Exception
public RepositoryConnection getConnection() throws RepositorySourceException
getConnection
in interface RepositorySource
RepositorySourceException
- if there is a problem obtaining a connectionRepositorySource.getConnection()
public void close()
connections
may still be in use, this method may not necessarily close all
resources immediately.
This is a required method, and must be called when this source is no longer needed if one or more connections
have been obtained since the previous call to this method.
Note that calling this method also does not preclude obtaining more connections
after this method
is called. If that happens, this source should simply reacquire any resources necessary to provide additional connections,
and this method needs to be called once again.
close
in interface RepositorySource
RepositorySource.close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |