org.modeshape.graph.request
Class VerifyNodeExistsRequest

java.lang.Object
  extended by org.modeshape.graph.request.Request
      extended by org.modeshape.graph.request.CacheableRequest
          extended by org.modeshape.graph.request.VerifyNodeExistsRequest
All Implemented Interfaces:
Serializable, Cacheable

public class VerifyNodeExistsRequest
extends CacheableRequest

Instruction to verify the existance of a node at the specified location. This request also returns the actual location.

See Also:
Serialized Form

Constructor Summary
VerifyNodeExistsRequest(Location at, String workspaceName)
          Create a request to verify the existance and location of a node at the supplied location.
 
Method Summary
 Location at()
          Get the location defining the node that is to be read.
 void cancel()
          Cancel this request.
 boolean equals(Object obj)
          
 boolean exists()
          Return whether this node is known to exist.
 Location getActualLocationOfNode()
          Get the actual location of the node whose properties were read.
 int hashCode()
          
 String inWorkspace()
          Get the name of the workspace in which the node exists.
 boolean isReadOnly()
          Return whether this request only reads information.
 void setActualLocationOfNode(Location actual)
          Sets the actual and complete location of the node whose properties have been read.
 String toString()
          
 
Methods inherited from class org.modeshape.graph.request.CacheableRequest
getCachePolicy, getTimeLoaded, setCachePolicy, setTimeLoaded
 
Methods inherited from class org.modeshape.graph.request.Request
freeze, getError, hasError, isCancelled, isFrozen, setError, setLatchForFreezing
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VerifyNodeExistsRequest

public VerifyNodeExistsRequest(Location at,
                               String workspaceName)
Create a request to verify the existance and location of a node at the supplied location.

Parameters:
at - the location of the node to be verified
workspaceName - the name of the workspace containing the node
Throws:
IllegalArgumentException - if the location or workspace name is null
Method Detail

isReadOnly

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

Specified by:
isReadOnly in class Request
Returns:
true if this request reads information, or false if it requests that the repository content be changed in some way
See Also:
Request.isReadOnly()

at

public Location at()
Get the location defining the node that is to be read.

Returns:
the location of the node; never null

inWorkspace

public String inWorkspace()
Get the name of the workspace in which the node exists.

Returns:
the name of the workspace; never null

setActualLocationOfNode

public void setActualLocationOfNode(Location actual)
Sets the actual and complete location of the node whose properties have been read. This method must be called when processing the request, and the actual location must have a path.

Parameters:
actual - the actual location of the node being read, or null if the current location should be used
Throws:
IllegalArgumentException - if the actual location is not equal to the current location, or if the actual location does not have a path.
IllegalStateException - if the request is frozen

getActualLocationOfNode

public Location getActualLocationOfNode()
Get the actual location of the node whose properties were read.

Returns:
the actual location, or null if the actual location was not set

exists

public boolean exists()
Return whether this node is known to exist. If the request has been processed, it will have an actual location or an error.

Returns:
true if this node is known to exist
See Also:
getActualLocationOfNode(), Request.getError()

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.

Overrides:
cancel in class Request
See Also:
Request.cancel()

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()


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