|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.modeshape.graph.connector.path.PathRepository org.modeshape.graph.connector.path.WritablePathRepository
@ThreadSafe public abstract class WritablePathRepository
Extension of PathRepository
for repositories that support modification of nodes as well as access to the nodes.
Field Summary |
---|
Fields inherited from class org.modeshape.graph.connector.path.PathRepository |
---|
rootNodeUuid, workspaces |
Constructor Summary | |
---|---|
WritablePathRepository(PathRepositorySource source)
|
Method Summary | |
---|---|
protected abstract WritablePathWorkspace |
createWorkspace(ExecutionContext context,
String name)
Creates a new workspace with the given name containing only a root node. |
WritablePathWorkspace |
createWorkspace(ExecutionContext context,
String name,
CreateWorkspaceRequest.CreateConflictBehavior behavior)
Attempts to create a workspace with the given name with name-collision behavior determined by the behavior parameter. |
WritablePathWorkspace |
createWorkspace(ExecutionContext context,
String name,
CreateWorkspaceRequest.CreateConflictBehavior existingWorkspaceBehavior,
String nameOfWorkspaceToClone)
Attempts to create a workspace with the requested name as in the #createWorkspace(ExecutionContext, String, CreateConflictBehavior) method and then clones the content from the
given source workspace into the new workspace if the creation was successful. |
boolean |
destroyWorkspace(String name)
Removes the named workspace from the #workspaces workspaces map . |
boolean |
isWritable()
|
Methods inherited from class org.modeshape.graph.connector.path.PathRepository |
---|
getDefaultWorkspaceName, getRootNodeUuid, getSourceName, getWorkspace, getWorkspaceNames, initialize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WritablePathRepository(PathRepositorySource source)
Method Detail |
---|
protected abstract WritablePathWorkspace createWorkspace(ExecutionContext context, String name)
This method does NOT automatically add the newly created workspace to the workspace map
or check to
see if a workspace already exists in this repository with the same name.
context
- the context in which the workspace is to be createdname
- the name of the workspace
public WritablePathWorkspace createWorkspace(ExecutionContext context, String name, CreateWorkspaceRequest.CreateConflictBehavior behavior)
This method will first check to see if a workspace already exists with the given name. If no such workspace exists, the
method will create a new workspace with the given name, add it to the #workspaces workspaces map
, and return it. If
a workspace with the requested name already exists and the behavior
is CreateWorkspaceRequest.CreateConflictBehavior.DO_NOT_CREATE
, this method will return null
without modifying the state of the repository. If a workspace with the requested
name already exists and the behavior
is CreateWorkspaceRequest.CreateConflictBehavior.CREATE_WITH_ADJUSTED_NAME
, this method will
generate a unique new name for the workspace, create a new workspace with the given name, added it to the #workspaces workspaces map
, and return it.
context
- the context in which the workspace is to be created; may not be nullname
- the requested name of the workspace. The name of the workspace that is returned from this method may not be the
same as the requested name; may not be nullbehavior
- the behavior to use in case a workspace with the requested name already exists in the repository
null
if a workspace with the requested name already exists in the repository
and behavior == CreateConflictBehavior#DO_NOT_CREATE
.public WritablePathWorkspace createWorkspace(ExecutionContext context, String name, CreateWorkspaceRequest.CreateConflictBehavior existingWorkspaceBehavior, String nameOfWorkspaceToClone)
#createWorkspace(ExecutionContext, String, CreateConflictBehavior)
method and then clones the content from the
given source workspace into the new workspace if the creation was successful.
If no workspace with the name nameOfWorkspaceToClone
exists, the method will return an empty workspace.
context
- the context in which the workspace is to be created; may not be nullname
- the requested name of the workspace. The name of the workspace that is returned from this method may not be the
same as the requested name; may not be nullexistingWorkspaceBehavior
- the behavior to use in case a workspace with the requested name already exists in the
repositorynameOfWorkspaceToClone
- the name of the workspace from which the content should be cloned; may not be null
nameOfWorkspaceToClone
or null
if a workspace with the requested name already exists in the repository and
behavior == CreateConflictBehavior#DO_NOT_CREATE
.public boolean destroyWorkspace(String name)
#workspaces workspaces map
.
name
- the name of the workspace to remove
true
if a workspace with that name previously existed in the mappublic boolean isWritable()
isWritable
in class PathRepository
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |