org.jboss.dna.graph.request
Class Request

java.lang.Object
  extended by org.jboss.dna.graph.request.Request
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CacheableRequest, CloneWorkspaceRequest, CompositeRequest, CopyBranchRequest, CreateNodeRequest, CreateWorkspaceRequest, DeleteBranchRequest, DestroyWorkspaceRequest, MoveBranchRequest, RemovePropertyRequest, RenameNodeRequest, SetPropertyRequest, UpdatePropertiesRequest, VerifyWorkspaceRequest

public abstract class Request
extends Object
implements Serializable

The abstract base class for all classes representing requests to be executed against a RepositoryConnection.

Author:
Randall Hauch
See Also:
Serialized Form

Method Summary
 void cancel()
          Cancel this request.
 Throwable getError()
          Get the error associated with this request, if there is such an error.
 boolean hasError()
          Return whether there is an error associated with this request
 boolean isCancelled()
          Check whether this request has been cancelled.
abstract  boolean isReadOnly()
          Return whether this request only reads information.
 void setError(Throwable error)
          Set the error for this request.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setError

public void setError(Throwable error)
Set the error for this request.

Parameters:
error - the error to be associated with this request, or null if this request is to have no error

hasError

public boolean hasError()
Return whether there is an error associated with this request

Returns:
true if there is an error, or false otherwise

getError

public Throwable getError()
Get the error associated with this request, if there is such an error.

Returns:
the error, or null if there is none

isCancelled

public boolean isCancelled()
Check whether this request has been cancelled. Although it is a recommendation that the result of this method be followed wherever possible, it is not required to immediately stop processing the request if this method returns true. For example, if processing is almost complete, it may be appropriate to simply finish processing the request.

This method is safe to be called by different threads.

Returns:
true if this request has been cancelled, or false otherwise.

cancel

public void cancel()
Cancel this request. After this method is called, the cancellation flag is set, and any current or future processing of the request may be affected by the cancellation. (Note however, that processors may choose to not respect this request.)

This method is safe to be called by different threads.


isReadOnly

public abstract boolean isReadOnly()
Return whether this request only reads information.

Returns:
true if this request reads information, or false if it requests that the repository content be changed in some way


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