01: package org.syrup;
02:
03: /**
04: * A persistent Task that is held by a WorkSpace.
05: *
06: * @author Robbert van Dalen
07: */
08: public interface PTask extends Task {
09: static final String COPYRIGHT = "Copyright 2005 Robbert van Dalen."
10: + "At your option, you may copy, distribute, or make derivative works under "
11: + "the terms of The Artistic License. This License may be found at "
12: + "http://www.opensource.org/licenses/artistic-license.php. "
13: + "THERE IS NO WARRANTY; USE THIS PRODUCT AT YOUR OWN RISK.";
14:
15: /**
16: * Returns the parent identifier. The parent of a PTask is fixed and cannot
17: * change during the life-cyle of a Workspace.
18: *
19: * @return The parent identifier key.
20: * @see PTask#key
21: */
22: public String parentKey();
23:
24: /**
25: * Returns the key that the WorkSpace uses to identify a PTask. This
26: * identifier is fixed and cannot change during the life-cyle of a
27: * Workspace.
28: *
29: * @return The identifier key.
30: */
31: public String key();
32:
33: /**
34: * Returns the number of modifications since creation. Because PTasks can be
35: * executed multiple times, this number can more then 1. Note that the
36: * number of modifications can only increase during the life-cyle of a
37: * Workspace.
38: *
39: * @return The number of modifications since creation.
40: */
41: public long modifications();
42:
43: /**
44: * Returns the last modification time since creation. This changes when the
45: * number of modifications is increased.
46: *
47: * @return The last modification time since creation.
48: */
49: public long modificationTime();
50:
51: /**
52: * Returns the creation time of a PTask. This is fixed and cannot change
53: * during the life-cyle of a Workspace.
54: */
55: public long creationTime();
56:
57: /**
58: * Returns true if this PTask is executable.
59: *
60: * @return true if this PTask is executable.
61: */
62: public boolean executable();
63:
64: /**
65: * Returns true if this PTask is done. When a PTask is done, it will be
66: * indefinitely during the life-cyle of a Workspace.
67: *
68: * @return true if this PTask is done.
69: */
70: public boolean done();
71:
72: /**
73: * Returns true if this PTask is a parent. When a PTask is made parent, it
74: * will be indefinitely during the life-cyle of a Workspace.
75: *
76: * @return true if this PTask is a parent.
77: */
78: public boolean isParent();
79:
80: /**
81: * Returns the Worker's address (URL) that is currently executing this
82: * PTask.
83: *
84: * @return The Worker's address executing this PTask.
85: */
86: public String worker();
87: }
|