org.modeshape.graph.connector.path
Class PathRepository

java.lang.Object
  extended by org.modeshape.graph.connector.path.PathRepository
Direct Known Subclasses:
WritablePathRepository

@ThreadSafe
public abstract class PathRepository
extends Object


Field Summary
protected  UUID rootNodeUuid
           
protected  ConcurrentMap<String,PathWorkspace> workspaces
           
 
Constructor Summary
protected PathRepository(PathRepositorySource source)
          Creates a PathRepository with the given repository source, root node UUID, and a default workspace with the given name.
 
Method Summary
protected  String getDefaultWorkspaceName()
           
 UUID getRootNodeUuid()
          Returns the UUID used by the root nodes in each workspace.
 String getSourceName()
          Returns the logical name (as opposed to the class name) of the repository source that defined this instance of the repository for use in error, informational, and other contextual messages.
 PathWorkspace getWorkspace(String name)
          Returns the workspace with the given name
 Set<String> getWorkspaceNames()
          Returns a list of the names of the currently created workspaces
protected abstract  void initialize()
          Initializes the repository by creating the default workspace.
 boolean isWritable()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootNodeUuid

protected final UUID rootNodeUuid

workspaces

protected final ConcurrentMap<String,PathWorkspace> workspaces
Constructor Detail

PathRepository

protected PathRepository(PathRepositorySource source)
Creates a PathRepository with the given repository source, root node UUID, and a default workspace with the given name.

Parameters:
source - the path repository source; may not be null
Method Detail

getRootNodeUuid

public final UUID getRootNodeUuid()
Returns the UUID used by the root nodes in each workspace.

Note that the root nodes themselves are distinct objects in each workspace and a change to the root node of one workspace does not imply a change to the root nodes of any other workspaces. However, the JCR specification mandates that all referenceable root nodes in a repository use a common UUID (in support of node correspondence); therefore this must be supported by ModeShape.

Returns:
the root node UUID

getSourceName

public String getSourceName()
Returns the logical name (as opposed to the class name) of the repository source that defined this instance of the repository for use in error, informational, and other contextual messages.

Returns:
sourceName the logical name for the repository source name

getDefaultWorkspaceName

protected String getDefaultWorkspaceName()

getWorkspaceNames

public Set<String> getWorkspaceNames()
Returns a list of the names of the currently created workspaces

Returns:
a list of the names of the currently created workspaces

getWorkspace

public PathWorkspace getWorkspace(String name)
Returns the workspace with the given name

Parameters:
name - the name of the workspace to return
Returns:
the workspace with the given name; may be null if no workspace with the given name exists

initialize

protected abstract void initialize()
Initializes the repository by creating the default workspace.

Due to the ordering restrictions on constructor chaining, this method cannot be called until the repository is fully initialized. This method MUST be called at the end of the constructor by any class that implements MapRepository .


isWritable

public boolean isWritable()


Copyright © 2008-2010 JBoss, a division of Red Hat. All Rights Reserved.