|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.connector.base.AbstractRepositorySource
org.modeshape.graph.connector.base.AbstractNodeCachingRepositorySource<UUID,DiskNode>
org.modeshape.connector.disk.DiskSource
@ThreadSafe public class DiskSource
A repository source that uses a uses a disk to store arbitrary content. Unlike the FileSystemSource
, this connector can
store arbitrary content and is not limited to storing nodes of type nt:folder, nt:file, and nt:resource
. However,
content stored by this connector is not intended to be accessible to other applications unless they integrate with ModeShape to
read the data.
Nodes created by this source are assigned a UUID and mapped to a system of folders and subfolders based on this UUID.
Like other RepositorySource
classes, instances of DiskSource can be placed into JNDI and do support the creation of
JNDI referenceable
objects and resolution of references into DiskSource.
Field Summary | |
---|---|
static boolean |
DEFAULT_LOCK_FILE_USED
The initial value for whether a lock file is used is "false ", unless otherwise specified. |
static String |
DEFAULT_NAME_OF_DEFAULT_WORKSPACE
The initial name of the default workspace is ""default" ", unless otherwise specified. |
static String |
DEFAULT_REPOSITORY_ROOT_PATH
The initial value for where content should be stored on disk is ""/tmp" ", unless otherwise specified. |
static boolean |
DEFAULT_UPDATES_ALLOWED
The initial value for whether updates are allowed is "true ", unless otherwise specified. |
Fields inherited from class org.modeshape.graph.connector.base.AbstractNodeCachingRepositorySource |
---|
DEFAULT_NODE_CACHE_POLICY, NODE_CACHE_POLICY |
Fields inherited from class org.modeshape.graph.connector.base.AbstractRepositorySource |
---|
cachePolicy, DEFAULT_CACHE_POLICY, DEFAULT_RETRY_LIMIT, DEFAULT_ROOT_NODE_UUID, retryLimit, rootNodeUuid |
Constructor Summary | |
---|---|
DiskSource()
Create a repository source instance. |
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. |
boolean |
equals(Object obj)
|
RepositorySourceCapabilities |
getCapabilities()
Get the capabilities for this source. |
RepositoryConnection |
getConnection()
Get a connection from this source. |
protected Context |
getContext()
|
String |
getDefaultWorkspaceName()
Get the name of the default workspace. |
String |
getLargeValuePath()
|
long |
getLargeValueSizeInBytes()
|
Object |
getObjectInstance(Object obj,
Name name,
Context nameCtx,
Hashtable<?,?> environment)
|
protected Observer |
getObserver()
|
String[] |
getPredefinedWorkspaceNames()
Gets the names of the workspaces that are available when this source is created. |
Reference |
getReference()
|
String |
getRepositoryRootPath()
|
int |
hashCode()
|
boolean |
isCreatingWorkspacesAllowed()
Get whether this source allows workspaces to be created dynamically. |
boolean |
isLockFileUsed()
|
protected void |
setContext(Context context)
|
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 |
setLargeValuePath(String largeValuePath)
|
void |
setLargeValueSizeInBytes(long largeValueSizeInBytes)
|
void |
setLockFileUsed(boolean lockFileUsed)
|
void |
setPredefinedWorkspaceNames(String[] predefinedWorkspaceNames)
Sets the names of the workspaces that are available when this source is created. |
void |
setRepositoryRootPath(String repositoryRootPath)
Set the the path to the root of the repository on disk. |
void |
setUpdatesAllowed(boolean updatesAllowed)
Set whether this source allows updates to data within workspaces |
Methods inherited from class org.modeshape.graph.connector.base.AbstractNodeCachingRepositorySource |
---|
addNodeCachePolicyChangedListener, addNodeCachePolicyReference, getNodeCachePolicy, removeNodeCachePolicyChangedListener, setNodeCachePolicy |
Methods inherited from class org.modeshape.graph.connector.base.AbstractRepositorySource |
---|
getDefaultCachePolicy, getName, getRepositoryContext, getRetryLimit, getRootNodeUuid, getRootNodeUuidObject, initialize, setCachePolicy, setName, setRetryLimit, setRootNodeUuid, setRootNodeUuidObject, valuesFrom |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, 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_UPDATES_ALLOWED
public static final String DEFAULT_REPOSITORY_ROOT_PATH
public static final boolean DEFAULT_LOCK_FILE_USED
Constructor Detail |
---|
public DiskSource()
Method Detail |
---|
public String getRepositoryRootPath()
public RepositorySourceCapabilities getCapabilities()
getCapabilities
in interface RepositorySource
RepositorySource.getCapabilities()
public void setRepositoryRootPath(String repositoryRootPath)
repositoryRootPath
- the path to the root of the repository on disk. This path must be (at least) readable.public String getDefaultWorkspaceName()
getDefaultWorkspaceName
in interface BaseRepositorySource
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 long getLargeValueSizeInBytes()
public void setLargeValueSizeInBytes(long largeValueSizeInBytes)
largeValueSizeInBytes
- Sets largeValueSizeInBytes to the specified value.public String getLargeValuePath()
public void setLargeValuePath(String largeValuePath)
largeValuePath
- Sets largeValuePath to the specified value.public boolean isCreatingWorkspacesAllowed()
isCreatingWorkspacesAllowed
in interface BaseRepositorySource
isCreatingWorkspacesAllowed
in class AbstractRepositorySource
set of workspaces
is fixedsetPredefinedWorkspaceNames(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 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
close
in class AbstractRepositorySource
RepositorySource.close()
protected Observer getObserver()
protected Context getContext()
protected void setContext(Context context)
public boolean areUpdatesAllowed()
AbstractRepositorySource
areUpdatesAllowed
in interface BaseRepositorySource
areUpdatesAllowed
in class AbstractRepositorySource
BaseRepositorySource.areUpdatesAllowed()
public void setUpdatesAllowed(boolean updatesAllowed)
BaseRepositorySource
setUpdatesAllowed
in interface BaseRepositorySource
updatesAllowed
- true if this source allows updates to data within workspaces clients, or false if updates are not
allowed.BaseRepositorySource.areUpdatesAllowed()
public boolean isLockFileUsed()
public void setLockFileUsed(boolean lockFileUsed)
lockFileUsed
- whether a lock file should be used to coordinate repository locks across JVMspublic RepositoryConnection getConnection() throws RepositorySourceException
getConnection
in interface RepositorySource
RepositorySourceException
- if there is a problem obtaining a connectionRepositorySource.getConnection()
public Reference getReference()
getReference
in interface Referenceable
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment) throws Exception
getObjectInstance
in interface ObjectFactory
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |