org.jboss.dna.connector.filesystem
Class FileSystemRepository.FileSystemWorkspace

java.lang.Object
  extended by org.jboss.dna.graph.connector.path.AbstractWritablePathWorkspace
      extended by org.jboss.dna.connector.filesystem.FileSystemRepository.FileSystemWorkspace
All Implemented Interfaces:
PathWorkspace, WritablePathWorkspace
Enclosing class:
FileSystemRepository

public class FileSystemRepository.FileSystemWorkspace
extends AbstractWritablePathWorkspace

Writable workspace implementation for file system-backed workspaces


Constructor Summary
FileSystemRepository.FileSystemWorkspace(String name, ExecutionContext context, File workspaceRoot)
           
 
Method Summary
 PathNode createNode(ExecutionContext context, PathNode parentNode, Name name, Map<Name,Property> properties, NodeConflictBehavior conflictBehavior)
          Create a new node with the supplied name, as a child of the supplied parent.
 Path getLowestExistingPath(Path path)
          Find the lowest existing node along the path.
 PathNode getNode(Path path)
          Returns the node at the given path, if one exists of null if no exists at the given path.
 PathNode moveNode(ExecutionContext context, PathNode node, Name desiredNewName, WritablePathWorkspace originalWorkspace, PathNode newParent, PathNode beforeNode)
          Move the supplied node to the new parent within this workspace.
 boolean removeNode(ExecutionContext context, Path nodePath)
          Removes the node at the given path
 PathNode setProperties(ExecutionContext context, Path nodePath, Map<Name,Property> properties)
          Sets the given properties in a single operation, overwriting any previous properties for the same name.
 
Methods inherited from class org.jboss.dna.graph.connector.path.AbstractWritablePathWorkspace
copyNode, createNode, getName, lockNode, query, removeProperties, search, unlockNode
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemRepository.FileSystemWorkspace

public FileSystemRepository.FileSystemWorkspace(String name,
                                                ExecutionContext context,
                                                File workspaceRoot)
Method Detail

createNode

public PathNode createNode(ExecutionContext context,
                           PathNode parentNode,
                           Name name,
                           Map<Name,Property> properties,
                           NodeConflictBehavior conflictBehavior)
Description copied from interface: WritablePathWorkspace
Create a new node with the supplied name, as a child of the supplied parent.

Parameters:
context - the execution context
parentNode - the parent node; may not be null
name - the name; may not be null
properties - the properties for the new node
conflictBehavior - the expected behavior if an equivalently-named child already exists at the location
Returns:
the new node

removeNode

public boolean removeNode(ExecutionContext context,
                          Path nodePath)
Description copied from interface: WritablePathWorkspace
Removes the node at the given path

Parameters:
context - the context; may not be null
nodePath - the path of the node to be removed
Returns:
true if the node existed (and was removed); false otherwise

setProperties

public PathNode setProperties(ExecutionContext context,
                              Path nodePath,
                              Map<Name,Property> properties)
Description copied from interface: WritablePathWorkspace
Sets the given properties in a single operation, overwriting any previous properties for the same name. This bulk mutator should be used when multiple properties are being set in order to allow underlying implementations to optimize their access to their respective persistent storage mechanism.

Parameters:
context - the context; may not be null
nodePath - the path to the node on which the properties should be set
properties - the properties to set
Returns:
this map node

moveNode

public PathNode moveNode(ExecutionContext context,
                         PathNode node,
                         Name desiredNewName,
                         WritablePathWorkspace originalWorkspace,
                         PathNode newParent,
                         PathNode beforeNode)
Description copied from interface: WritablePathWorkspace
Move the supplied node to the new parent within this workspace. This method automatically removes the node from its existing parent, and also correctly adjusts the index to be correct in the new parent.

Specified by:
moveNode in interface WritablePathWorkspace
Overrides:
moveNode in class AbstractWritablePathWorkspace
node - the node to be moved; may not be the workspace root node
desiredNewName - the new name for the node, if it is to be changed; may be null
originalWorkspace - the workspace containing the node to be moved
newParent - the new parent; may not be the workspace root node
beforeNode - the node before which this new node should be placed
Returns:
a new copy of node that reflects the new location

getLowestExistingPath

public Path getLowestExistingPath(Path path)
Description copied from interface: PathWorkspace
Find the lowest existing node along the path.

Parameters:
path - the path to the node; may not be null
Returns:
the lowest existing node along the path, or the root node if no node exists on the path

getNode

public PathNode getNode(Path path)
Description copied from interface: PathWorkspace
Returns the node at the given path, if one exists of null if no exists at the given path.

Parameters:
path - the path of the node to retrieve; may not be null
Returns:
the node at the given path, if one exists of null if no exists at the given path.


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