org.modeshape.graph.connector.path
Class PathRequestProcessor

java.lang.Object
  extended by org.modeshape.graph.request.processor.RequestProcessor
      extended by org.modeshape.graph.connector.path.PathRequestProcessor

public class PathRequestProcessor
extends RequestProcessor

The default implementation of the RequestProcessor for path repositories.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.modeshape.graph.request.processor.RequestProcessor
RequestProcessor.LocationWithDepth
 
Constructor Summary
PathRequestProcessor(ExecutionContext context, PathRepository repository, Observer observer, boolean updatesAllowed, PathRepositoryTransaction txn)
           
 
Method Summary
protected  PathNode getTargetNode(PathWorkspace workspace, Request request, Location location)
           
 PathRepositoryTransaction getTransaction()
          Returns the transaction associated with this request processor.
protected  PathWorkspace getWorkspace(Request request, String workspaceName)
           
 void process(AccessQueryRequest request)
          Process a request to query a workspace with an access query, which is is a low-level atomic query that is part of a larger, planned query.
 void process(CloneBranchRequest request)
          Process a request to clone a branch into a new workspace.
 void process(CloneWorkspaceRequest request)
          Process a request to clone an existing workspace as a new workspace.
 void process(CopyBranchRequest request)
          Process a request to copy a branch into another location.
 void process(CreateNodeRequest request)
          Process a request to create a node at a specified location.
 void process(CreateWorkspaceRequest request)
          Process a request to create a new workspace.
 void process(DeleteBranchRequest request)
          Process a request to delete a branch at a specified location.
 void process(DestroyWorkspaceRequest request)
          Process a request to permanently destroy a workspace.
 void process(FullTextSearchRequest request)
          Process a request to search a workspace.
 void process(GetWorkspacesRequest request)
          Process a request to get the information about the available workspaces.
 void process(LockBranchRequest request)
          Process a request to lock a node or branch within a workspace The default implementation of this method does nothing, as most connectors will not support locking.
 void process(MoveBranchRequest request)
          Process a request to move a branch at a specified location into a different location.
 void process(ReadAllChildrenRequest request)
          Process a request to read all of the children of a node.
 void process(ReadAllPropertiesRequest request)
          Process a request to read the properties of a node at the supplied location.
 void process(ReadNodeRequest request)
          Process a request to read the properties and children of a node at the supplied location.
 void process(UnlockBranchRequest request)
          Process a request to unlock a node or branch within a workspace The default implementation of this method does nothing, as most connectors will not support locking.
 void process(UpdatePropertiesRequest request)
          Process a request to remove the specified properties from a node.
 void process(VerifyWorkspaceRequest request)
          Process a request to verify a named workspace.
protected  boolean updatesAllowed(Request request)
           
 
Methods inherited from class org.modeshape.graph.request.processor.RequestProcessor
close, completeRequest, getChanges, getDefaultCachePolicy, getExecutionContext, getNowInUtc, getSourceName, notifyObserverOfChanges, process, process, process, process, process, process, process, process, process, process, process, process, processUnknownRequest, recordChange, setCacheableInfo, setCacheableInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathRequestProcessor

public PathRequestProcessor(ExecutionContext context,
                            PathRepository repository,
                            Observer observer,
                            boolean updatesAllowed,
                            PathRepositoryTransaction txn)
Method Detail

updatesAllowed

protected boolean updatesAllowed(Request request)

process

public void process(VerifyWorkspaceRequest request)
Description copied from class: RequestProcessor
Process a request to verify a named workspace.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the request

process

public void process(GetWorkspacesRequest request)
Description copied from class: RequestProcessor
Process a request to get the information about the available workspaces.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the request

process

public void process(CreateWorkspaceRequest request)
Description copied from class: RequestProcessor
Process a request to create a new workspace.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the request

process

public void process(CloneBranchRequest request)
Description copied from class: RequestProcessor
Process a request to clone a branch into a new workspace.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the request

process

public void process(CloneWorkspaceRequest request)
Description copied from class: RequestProcessor
Process a request to clone an existing workspace as a new workspace.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the request

process

public void process(DestroyWorkspaceRequest request)
Description copied from class: RequestProcessor
Process a request to permanently destroy a workspace.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the request

process

public void process(CopyBranchRequest request)
Description copied from class: RequestProcessor
Process a request to copy a branch into another location.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the copy request

process

public void process(CreateNodeRequest request)
Description copied from class: RequestProcessor
Process a request to create a node at a specified location.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the create request

process

public void process(DeleteBranchRequest request)
Description copied from class: RequestProcessor
Process a request to delete a branch at a specified location.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the delete request

process

public void process(MoveBranchRequest request)
Description copied from class: RequestProcessor
Process a request to move a branch at a specified location into a different location.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the move request

process

public void process(ReadNodeRequest request)
Description copied from class: RequestProcessor
Process a request to read the properties and children of a node at the supplied location.

This method does nothing if the request is null. Unless overridden, this method converts the single request into a ReadAllChildrenRequest and a ReadAllPropertiesRequest.

Overrides:
process in class RequestProcessor
Parameters:
request - the read request

process

public void process(ReadAllChildrenRequest request)
Description copied from class: RequestProcessor
Process a request to read all of the children of a node.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the read request

process

public void process(ReadAllPropertiesRequest request)
Description copied from class: RequestProcessor
Process a request to read the properties of a node at the supplied location.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the read request

process

public void process(AccessQueryRequest request)
Description copied from class: RequestProcessor
Process a request to query a workspace with an access query, which is is a low-level atomic query that is part of a larger, planned query.

The default implementation of this method behaves as though the implementation does not support queries by setting an error on the request

Overrides:
process in class RequestProcessor
Parameters:
request - the request

process

public void process(FullTextSearchRequest request)
Description copied from class: RequestProcessor
Process a request to search a workspace.

The default implementation of this method behaves as though the implementation does not support full-text searches by setting an error on the request

Overrides:
process in class RequestProcessor
Parameters:
request - the request

process

public void process(UpdatePropertiesRequest request)
Description copied from class: RequestProcessor
Process a request to remove the specified properties from a node.

This method does nothing if the request is null.

Specified by:
process in class RequestProcessor
Parameters:
request - the remove request

process

public void process(LockBranchRequest request)
Description copied from class: RequestProcessor
Process a request to lock a node or branch within a workspace

The default implementation of this method does nothing, as most connectors will not support locking. Any implementation of this method should do nothing if the request is null.

Implementations that do support locking should throw a LockFailedException if the request could not be fulfilled.

Overrides:
process in class RequestProcessor
Parameters:
request - the request

process

public void process(UnlockBranchRequest request)
Description copied from class: RequestProcessor
Process a request to unlock a node or branch within a workspace

The default implementation of this method does nothing, as most connectors will not support locking. Any implementation of this method should do nothing if the request is null.

Overrides:
process in class RequestProcessor
Parameters:
request - the request

getWorkspace

protected PathWorkspace getWorkspace(Request request,
                                     String workspaceName)

getTargetNode

protected PathNode getTargetNode(PathWorkspace workspace,
                                 Request request,
                                 Location location)

getTransaction

public PathRepositoryTransaction getTransaction()
Returns the transaction associated with this request processor. This transaction must eventually either be committed or rolled back.

Returns:
the transaction associated with this request processor; never null
See Also:
PathRepositoryTransaction.commit(), PathRepositoryTransaction.rollback()


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