|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.connector.filesystem.FileSystemSource
@ThreadSafe public class FileSystemSource
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 | |
---|---|
static int |
DEFAULT_CACHE_TIME_TO_LIVE_IN_SECONDS
|
static String |
DEFAULT_EXCLUSION_PATTERN
|
static int |
DEFAULT_MAX_PATH_LENGTH
|
static String |
DEFAULT_NAME_OF_DEFAULT_WORKSPACE
The initial name of the default workspace is ""default" ", unless otherwise specified. |
static int |
DEFAULT_RETRY_LIMIT
|
static boolean |
DEFAULT_SUPPORTS_UPDATES
This source does not support updates by default, but each instance may be configured to be read-only or updateable}. |
Constructor Summary | |
---|---|
FileSystemSource()
|
Method Summary | |
---|---|
boolean |
areUpdatesAllowed()
Get whether this source allows updates. |
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. |
int |
getCacheTimeToLiveInMilliseconds()
Get the time in milliseconds that content returned from this source may used while in the cache. |
RepositorySourceCapabilities |
getCapabilities()
Get the capabilities for this source. |
RepositoryConnection |
getConnection()
Get a connection from this source. |
String |
getDefaultWorkspaceName()
Get the name of the default workspace. |
String |
getExclusionPattern()
Get the regular expression that, if matched by a file or folder, indicates that the file or folder should be ignored |
int |
getMaxPathLength()
Get the UUID that is used for the root node of each workspace |
String |
getName()
Get the name for this repository source. |
Object |
getObjectInstance(Object obj,
Name name,
Context nameCtx,
Hashtable<?,?> environment)
|
String[] |
getPredefinedWorkspaceNames()
Gets the names of the workspaces that are available when this source is created. |
Reference |
getReference()
|
int |
getRetryLimit()
Get the maximum number of retries that may be performed on a given operation when using connections created by this source. |
UUID |
getRootNodeUuid()
Get the UUID that is used for the root node of each workspace |
boolean |
getSupportsUpdates()
Get whether this source supports updates. |
String |
getWorkspaceRootPath()
Get the relative root directory for the workspaces. |
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 . |
boolean |
isCreatingWorkspacesAllowed()
Get whether this source allows workspaces to be created dynamically. |
void |
setCacheTimeToLiveInMilliseconds(int cacheTimeToLive)
Set the time in milliseconds that content returned from this source may used while in the cache. |
void |
setCreatingWorkspacesAllowed(boolean allowWorkspaceCreation)
Set whether this source allows workspaces to be created dynamically. |
void |
setDefaultWorkspaceName(String nameOfDefaultWorkspace)
Set the name of the workspace that should be used when clients don't specify a workspace. |
void |
setExclusionPattern(String exclusionPattern)
Sets the regular expression that, if matched by a file or folder, indicates that the file or folder should be ignored |
void |
setMaxPathLength(int maxPathLength)
Set the maximum absolute path length supported by this source. |
void |
setName(String name)
Set the name for the source |
void |
setPredefinedWorkspaceNames(String[] predefinedWorkspaceNames)
Sets the names of the workspaces that are available when this source is created. |
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 |
setRootNodeUuid(String rootNodeUuid)
Set the jcr:uuid property of the root node in each workspace to the given value. |
void |
setUpdatesAllowed(boolean allowUpdates)
Set whether this source allows updates to data within workspaces |
void |
setWorkspaceRootPath(String workspaceRootPath)
Sets the relative root directory for workspaces |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_NAME_OF_DEFAULT_WORKSPACE
name of the default workspace
is ""default" ", unless otherwise specified.
public static final boolean DEFAULT_SUPPORTS_UPDATES
public static final int DEFAULT_RETRY_LIMIT
public static final int DEFAULT_CACHE_TIME_TO_LIVE_IN_SECONDS
public static final int DEFAULT_MAX_PATH_LENGTH
public static final String DEFAULT_EXCLUSION_PATTERN
Constructor Detail |
---|
public FileSystemSource()
Method Detail |
---|
public RepositorySourceCapabilities getCapabilities()
getCapabilities
in interface RepositorySource
RepositorySource.getCapabilities()
public String getName()
getName
in interface RepositorySource
RepositorySource.getName()
public void setName(String name)
name
- the new name for the sourcepublic boolean getSupportsUpdates()
public String getWorkspaceRootPath()
public void setWorkspaceRootPath(String workspaceRootPath)
workspaceRootPath
- the relative root directory for workspaces. If this value is non-null, all workspace paths will be
treated as paths relative to this directorypublic String getExclusionPattern()
public void setExclusionPattern(String exclusionPattern)
exclusionPattern
- the regular expression that, if matched by a file or folder, indicates that the file or folder
should be ignored. If this pattern is null
, no files will be excluded.public UUID getRootNodeUuid()
public void setRootNodeUuid(String rootNodeUuid)
jcr:uuid
property of the root node in each workspace to the given value.
rootNodeUuid
- the UUID to use for the root nodes of all workspacespublic int getMaxPathLength()
public void setMaxPathLength(int maxPathLength)
The length of any path is calculated relative to the file system root, NOT the repository root. That is, if a workspace
foo
is mapped to the /tmp/foo/bar
directory on the file system, then the path /node1/node2
in the
foo
workspace has an effective length of 23 for the purposes of the maxPathLength
calculation (/tmp/foo/bar
has length 11, /node1/node2
has length 12, 11 + 12 = 23).
maxPathLength
- the maximum absolute path length supported by this source; must be non-negativepublic String getDefaultWorkspaceName()
public void setDefaultWorkspaceName(String nameOfDefaultWorkspace)
nameOfDefaultWorkspace
- the name of the workspace that should be used by default, or null if the
default name
should be usedpublic String[] getPredefinedWorkspaceNames()
setPredefinedWorkspaceNames(String[])
,
setCreatingWorkspacesAllowed(boolean)
public void setPredefinedWorkspaceNames(String[] predefinedWorkspaceNames)
predefinedWorkspaceNames
- the names of the workspaces that this source should start with, or null if there are no
such workspacessetCreatingWorkspacesAllowed(boolean)
,
getPredefinedWorkspaceNames()
public boolean isCreatingWorkspacesAllowed()
setPredefinedWorkspaceNames(String[])
,
getPredefinedWorkspaceNames()
,
setCreatingWorkspacesAllowed(boolean)
public void setCreatingWorkspacesAllowed(boolean allowWorkspaceCreation)
allowWorkspaceCreation
- true if this source allows workspaces to be created by clients, or false if the set of
workspaces is fixedsetPredefinedWorkspaceNames(String[])
,
getPredefinedWorkspaceNames()
,
isCreatingWorkspacesAllowed()
public boolean areUpdatesAllowed()
setUpdatesAllowed(boolean)
public void setUpdatesAllowed(boolean allowUpdates)
allowUpdates
- true if this source allows updates to data within workspaces clients, or false if updates are not
allowed.areUpdatesAllowed()
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 int getCacheTimeToLiveInMilliseconds()
public void setCacheTimeToLiveInMilliseconds(int cacheTimeToLive)
cacheTimeToLive
- the time to live, in milliseconds; 0 if the time to live is not specified by this source; or a
negative number for the default valuepublic 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.jboss.dna.graph.connector.RepositoryContext)
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 |