org.modeshape.connector.svn
Class SvnWorkspace

java.lang.Object
  extended by org.modeshape.graph.connector.base.PathWorkspace<PathNode>
      extended by org.modeshape.connector.svn.SvnWorkspace
All Implemented Interfaces:
Workspace

public class SvnWorkspace
extends PathWorkspace<PathNode>

Workspace implementation for SVN repository connector


Nested Class Summary
protected  class SvnWorkspace.SvnCommand
           
protected  class SvnWorkspace.SvnCompositeCommand
           
protected  class SvnWorkspace.SvnPutContentCommand
           
protected  class SvnWorkspace.SvnPutFileCommand
           
protected  class SvnWorkspace.SvnPutFolderCommand
           
protected  class SvnWorkspace.SvnRemoveCommand
           
 
Nested classes/interfaces inherited from class org.modeshape.graph.connector.base.PathWorkspace
PathWorkspace.ChangeCommand<NodeType extends PathNode>
 
Field Summary
protected static byte[] EMPTY_BYTE_ARRAY
           
 
Constructor Summary
SvnWorkspace(String name, SvnWorkspace originalToClone, org.tmatesoft.svn.core.io.SVNRepository workspaceRoot)
           
SvnWorkspace(SvnRepository repository, org.tmatesoft.svn.core.io.SVNRepository workspaceRoot, String name, UUID rootNodeUuid)
           
 
Method Summary
 void commit(List<PathWorkspace.ChangeCommand<PathNode>> commands)
          Successively (and in order) apply the changes from the list of pending commands All validation for each of the objects (including validation of resource availability in the underlying persistent store) should be performed prior to invoking this method.
 PathWorkspace.ChangeCommand<PathNode> createMoveCommand(PathNode source, PathNode target)
          Create a change command that represents the movement of a node.
 SvnWorkspace.SvnCommand createPutCommand(PathNode previousNode, PathNode node)
          Create a change command for the required update to the given node
 SvnWorkspace.SvnCommand createRemoveCommand(Path path)
          Create a change command for the removal of the given node and its descendants
 PathNode getNode(Path path)
          Get the node with the supplied path.
protected  org.tmatesoft.svn.core.SVNNodeKind getNodeKind(ExecutionContext context, Path path, String repositoryRootUrl)
           
 PathNode getRootNode()
          Get the root node in this workspace.
protected  boolean readNode(ExecutionContext context, String workspaceName, Path requestedPath, List<Property> properties, List<Path.Segment> children)
           
protected  void validate(PathNode node)
           
 
Methods inherited from class org.modeshape.graph.connector.base.PathWorkspace
getName, getRootNodeUuid, moveNode, putNode, removeAll, removeNode, toString, verifyNodeExists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_BYTE_ARRAY

protected static final byte[] EMPTY_BYTE_ARRAY
Constructor Detail

SvnWorkspace

public SvnWorkspace(SvnRepository repository,
                    org.tmatesoft.svn.core.io.SVNRepository workspaceRoot,
                    String name,
                    UUID rootNodeUuid)

SvnWorkspace

public SvnWorkspace(String name,
                    SvnWorkspace originalToClone,
                    org.tmatesoft.svn.core.io.SVNRepository workspaceRoot)
Method Detail

getRootNode

public PathNode getRootNode()
Description copied from class: PathWorkspace
Get the root node in this workspace.

Specified by:
getRootNode in class PathWorkspace<PathNode>
Returns:
the root node; never null

getNode

public PathNode getNode(Path path)
Description copied from class: PathWorkspace
Get the node with the supplied path.

Specified by:
getNode in class PathWorkspace<PathNode>
Parameters:
path - the path to the node
Returns:
the node state as known by this workspace, or null if no such node exists in this workspace

readNode

protected boolean readNode(ExecutionContext context,
                           String workspaceName,
                           Path requestedPath,
                           List<Property> properties,
                           List<Path.Segment> children)
                    throws org.tmatesoft.svn.core.SVNException
Throws:
org.tmatesoft.svn.core.SVNException

getNodeKind

protected org.tmatesoft.svn.core.SVNNodeKind getNodeKind(ExecutionContext context,
                                                         Path path,
                                                         String repositoryRootUrl)
                                                  throws org.tmatesoft.svn.core.SVNException
Throws:
org.tmatesoft.svn.core.SVNException

validate

protected void validate(PathNode node)

createMoveCommand

public PathWorkspace.ChangeCommand<PathNode> createMoveCommand(PathNode source,
                                                               PathNode target)
Description copied from class: PathWorkspace
Create a change command that represents the movement of a node. The movement record will only reflect the changes to the node's name and/or parent. Changes to the node's properties or children should be ignored. A separate put command should be used to reflect these changes.

Overrides:
createMoveCommand in class PathWorkspace<PathNode>
Parameters:
source - the original version of the node; may not be null
target - the new version of the node; may not be null
Returns:
a PathWorkspace.ChangeCommand instance that reflects the changes to the node
See Also:
PathWorkspace.createMoveCommand(PathNode, PathNode), PathWorkspace.commit(List)

createPutCommand

public SvnWorkspace.SvnCommand createPutCommand(PathNode previousNode,
                                                PathNode node)
Description copied from class: PathWorkspace
Create a change command for the required update to the given node

Overrides:
createPutCommand in class PathWorkspace<PathNode>
Parameters:
previousNode - the prior version of the node; may be null if this is a new node
node - the new version of the node; may not be null
Returns:
a PathWorkspace.ChangeCommand instance that reflects the changes to the node
See Also:
PathWorkspace.commit(List)

createRemoveCommand

public SvnWorkspace.SvnCommand createRemoveCommand(Path path)
Description copied from class: PathWorkspace
Create a change command for the removal of the given node and its descendants

Overrides:
createRemoveCommand in class PathWorkspace<PathNode>
Parameters:
path - the path to the node at the root of the branch to be removed; may not be null
Returns:
a PathWorkspace.ChangeCommand instance that reflects the changes to the node
See Also:
PathWorkspace.createPutCommand(PathNode, PathNode), PathWorkspace.commit(List)

commit

public void commit(List<PathWorkspace.ChangeCommand<PathNode>> commands)
Description copied from class: PathWorkspace
Successively (and in order) apply the changes from the list of pending commands

All validation for each of the objects (including validation of resource availability in the underlying persistent store) should be performed prior to invoking this method.

Overrides:
commit in class PathWorkspace<PathNode>
Parameters:
commands - the list of commands to apply


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