tapestry.ptr.api
Class GetPtrReq

java.lang.Object
  |
  +--tapestry.ptr.api.GetPtrReq
All Implemented Interfaces:
QueueElementIF

public class GetPtrReq
extends Object
implements QueueElementIF

Ask for the publish info of certain objects from the pointer manager stage.

Version:
$Id: GetPtrReq.java,v 1.1.1.1 2004/03/26 19:57:10 hweather Exp $
Author:
Jeremy Stribling

Field Summary
 boolean local
          SQL-like query equivalent to SELECT pinfo FROM p AS ptrs WHERE p.local=true AND p.objguid=objguid That is, select PublishInfo's where the src is this node.
 boolean nonroot
          SQL-like query equivalent to SELECT pinfo FROM p AS ptrs WHERE p.root=false AND p.objguid=objguid That is, select PublishInfo's that this node is the root for.
 SecureHash[] objguids
          Array of objguids of ptrs to retrieve from the PtrMgr stage.
 short policy
          policy defines the SQL-like query to run over the ptr, level, and host data structures.
static short POLICY_DEAD
          SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level=root AND l.guid=p.guid AND p.src=h.guid AND h.state=DEAD.
static short POLICY_DOWN
          SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS level WHERE p.objguid=objguid AND l.level=root AND l.guid=p.objguid AND p.src=h.guid AND (h.state=DEAD OR h.state=HIBERNATING).
static short POLICY_EXPIRED
          SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, l AS levels WHERE p.objguid=objguid AND l.p.deadline > now.
static short POLICY_HIBERNATING
          SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level=root AND l.guid=p.objguid AND p.src=h.guid AND h.state=HIBERNATING.
static short POLICY_INSTANCEOF_THRESHOLD
          SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, l AS levels WHERE p.objguid = objguid AND l.level=root AND l.guid=p.objguid AND (p.tag instanceof TapestryThresholdTag).
static short POLICY_NONE
          SQL-like query equivalent to SELECT pinfos FROM p AS ptrs WHERE p.objguid=objguid.
static short POLICY_NORMAL
          SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level=root AND l.guid=p.objguid AND p.src=h.guid AND h.state=NORMAL.
static short POLICY_REVIVING
          SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level=root AND l.guid=p.objguid AND p.src=h.guid AND h.state=REVIVING.
static String[] POLICY_STRING
          Strings corresponding to ptr queries.
static short POLICY_THRESHOLD_REACHED
          SQL-like query equivalent to SELECT pinfos FROM p1 AS ptrs, l AS levels WHERE p1.objguid=objguid AND l.level=root AND l.guid=p1.objguid AND (p1.tag instanceof TapestryThresholdTag) AND p1.low_watermark > (SELECT COUNT FROM p2 as ptrs, h AS hosts WHERE p1.objguid=p2.objguid AND p1.tag=p2.tag AND p2.src=h.guid AND (h.state=NORMAL OR h.state=REVIVING) That is, select PublishInfo's where the remaining number of PublishInfo's is less that the TapestryThresholdTag.low_watermark.
static short POLICY_UP
          SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level==root AND l.guid=p.objguid AND p.src=h.guid AND (h.state=NORMAL OR h.state=REVIVING).
static short POLICY_UP_OR_HIBERNATING
          SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level==root AND l.guid=p.objguid AND p.src=h.guid AND (h.state=NORMAL OR h.state=REVIVING OR h.state=HIBERNATING) .
 boolean root
          SQL-like query equivalent to SELECT pinfo FROM p AS ptrs WHERE p.root=true AND p.objguid=objguid That is, select PublishInfo's that this node is the root for.
 SinkIF sink
          Requestor sink to use to return the response.
 boolean useCache
          Flag indicating whether query should use the cache (if there is a valid entry) or only use disk.
 Object userData
          Requestor defined object to be returned in the response.
 
Constructor Summary
GetPtrReq(SecureHash[] objguids, short policy, boolean root, boolean nonroot, boolean local, boolean useCache, Object userData, SinkIF sink)
          Constructor: Creates a new PtrIteratorStartReq.
GetPtrReq(SecureHash objguid, short policy, boolean root, boolean nonroot, boolean local, boolean useCache, Object userData, SinkIF sink)
          Constructor: Creates a new PtrIteratorStartReq.
 
Method Summary
 String toString()
          Specified by java.lang.Object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

POLICY_NONE

public static final short POLICY_NONE
SQL-like query equivalent to SELECT pinfos FROM p AS ptrs WHERE p.objguid=objguid. That is, select all PublishInfo's that match the given objguid.

See Also:
Constant Field Values

POLICY_EXPIRED

public static final short POLICY_EXPIRED
SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, l AS levels WHERE p.objguid=objguid AND l.p.deadline > now. That is, for all the ptrs where the local node is root, select expired PublishInfo's.

See Also:
Constant Field Values

POLICY_UP

public static final short POLICY_UP
SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level==root AND l.guid=p.objguid AND p.src=h.guid AND (h.state=NORMAL OR h.state=REVIVING). That is, select PublishInfo's that match the given objguid, local node is root, and where host is up.

See Also:
Constant Field Values

POLICY_UP_OR_HIBERNATING

public static final short POLICY_UP_OR_HIBERNATING
SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level==root AND l.guid=p.objguid AND p.src=h.guid AND (h.state=NORMAL OR h.state=REVIVING OR h.state=HIBERNATING) . That is, select PublishInfo's that match the given objguid, local node is root, and where host is up or hibernating (we don't know up or down).

See Also:
Constant Field Values

POLICY_DOWN

public static final short POLICY_DOWN
SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS level WHERE p.objguid=objguid AND l.level=root AND l.guid=p.objguid AND p.src=h.guid AND (h.state=DEAD OR h.state=HIBERNATING). That is, select PublishInfo's that match the given objguid, local node is root, and where host is down.

See Also:
Constant Field Values

POLICY_NORMAL

public static final short POLICY_NORMAL
SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level=root AND l.guid=p.objguid AND p.src=h.guid AND h.state=NORMAL. That is, select PublishInfo's that match the given objguid, local node is root, and where host is normal.

See Also:
Constant Field Values

POLICY_REVIVING

public static final short POLICY_REVIVING
SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level=root AND l.guid=p.objguid AND p.src=h.guid AND h.state=REVIVING. That is, select PublishInfo's that match the given objguid, local node is root, and where host is reviving.

See Also:
Constant Field Values

POLICY_HIBERNATING

public static final short POLICY_HIBERNATING
SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level=root AND l.guid=p.objguid AND p.src=h.guid AND h.state=HIBERNATING. That is, select PublishInfo's that match the given objguid, local node is root, and where host is hibernating.

See Also:
Constant Field Values

POLICY_DEAD

public static final short POLICY_DEAD
SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, h AS hosts, l AS levels WHERE p.objguid=objguid AND l.level=root AND l.guid=p.guid AND p.src=h.guid AND h.state=DEAD. That is, select PublishInfo's that match the given objguid, local node is root, and where host is dead.

See Also:
Constant Field Values

POLICY_INSTANCEOF_THRESHOLD

public static final short POLICY_INSTANCEOF_THRESHOLD
SQL-like query equivalent to SELECT pinfos FROM p AS ptrs, l AS levels WHERE p.objguid = objguid AND l.level=root AND l.guid=p.objguid AND (p.tag instanceof TapestryThresholdTag). That is, select PublishInfo's that local node is root and where tag instanceof TapestryThresholdTag.

See Also:
Constant Field Values

POLICY_THRESHOLD_REACHED

public static final short POLICY_THRESHOLD_REACHED
SQL-like query equivalent to SELECT pinfos FROM p1 AS ptrs, l AS levels WHERE p1.objguid=objguid AND l.level=root AND l.guid=p1.objguid AND (p1.tag instanceof TapestryThresholdTag) AND p1.low_watermark > (SELECT COUNT FROM p2 as ptrs, h AS hosts WHERE p1.objguid=p2.objguid AND p1.tag=p2.tag AND p2.src=h.guid AND (h.state=NORMAL OR h.state=REVIVING) That is, select PublishInfo's where the remaining number of PublishInfo's is less that the TapestryThresholdTag.low_watermark.

See Also:
Constant Field Values

POLICY_STRING

public static final String[] POLICY_STRING
Strings corresponding to ptr queries. Used for debugging.


objguids

public SecureHash[] objguids
Array of objguids of ptrs to retrieve from the PtrMgr stage.


root

public boolean root
SQL-like query equivalent to SELECT pinfo FROM p AS ptrs WHERE p.root=true AND p.objguid=objguid That is, select PublishInfo's that this node is the root for. NOTE ALSO: cannot also run query over combined root (or non-root) and local ptrs. That is, root=true AND local=true.


nonroot

public boolean nonroot
SQL-like query equivalent to SELECT pinfo FROM p AS ptrs WHERE p.root=false AND p.objguid=objguid That is, select PublishInfo's that this node is the root for. NOTE ALSO: cannot also run query over combined root (or non-root) and local ptrs. That is, root=true AND local=true.


local

public boolean local
SQL-like query equivalent to SELECT pinfo FROM p AS ptrs WHERE p.local=true AND p.objguid=objguid That is, select PublishInfo's where the src is this node. NOTE ALSO: cannot also run query over combined root and local ptrs. That is, root=true AND local=true.


useCache

public boolean useCache
Flag indicating whether query should use the cache (if there is a valid entry) or only use disk.


policy

public short policy
policy defines the SQL-like query to run over the ptr, level, and host data structures.


userData

public Object userData
Requestor defined object to be returned in the response.


sink

public SinkIF sink
Requestor sink to use to return the response.

Constructor Detail

GetPtrReq

public GetPtrReq(SecureHash[] objguids,
                 short policy,
                 boolean root,
                 boolean nonroot,
                 boolean local,
                 boolean useCache,
                 Object userData,
                 SinkIF sink)
Constructor: Creates a new PtrIteratorStartReq.


GetPtrReq

public GetPtrReq(SecureHash objguid,
                 short policy,
                 boolean root,
                 boolean nonroot,
                 boolean local,
                 boolean useCache,
                 Object userData,
                 SinkIF sink)
Constructor: Creates a new PtrIteratorStartReq.

Method Detail

toString

public String toString()
Specified by java.lang.Object

Overrides:
toString in class Object