KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > spi > ojb > OJBStep


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.workflow.spi.ojb;
6
7 import com.opensymphony.workflow.spi.Step;
8
9 import java.util.Date JavaDoc;
10 import java.util.Iterator JavaDoc;
11 import java.util.List JavaDoc;
12
13
14 /**
15  * @author picard
16  * Created on 9 sept. 2003
17  */

18 public abstract class OJBStep implements Step {
19     //~ Instance fields ////////////////////////////////////////////////////////
20

21     Date JavaDoc dueDate;
22     Date JavaDoc finishDate;
23     Date JavaDoc startDate;
24     List JavaDoc previousSteps;
25     OJBWorkflowEntry entry;
26     String JavaDoc caller;
27     String JavaDoc owner;
28     String JavaDoc status;
29     int actionId;
30     int stepId;
31     long entryId;
32     long id;
33
34     //~ Constructors ///////////////////////////////////////////////////////////
35

36     public OJBStep() {
37         super();
38     }
39
40     public OJBStep(OJBStep step) {
41         this.actionId = step.getActionId();
42         this.caller = step.getCaller();
43         this.finishDate = step.getFinishDate();
44         this.dueDate = step.getDueDate();
45         this.startDate = step.getStartDate();
46         this.id = step.getId();
47         this.owner = step.getOwner();
48         this.status = step.getStatus();
49         this.stepId = step.getStepId();
50         this.previousSteps = step.getPreviousSteps();
51     }
52
53     //~ Methods ////////////////////////////////////////////////////////////////
54

55     public void setActionId(int i) {
56         actionId = i;
57     }
58
59     public int getActionId() {
60         return actionId;
61     }
62
63     public void setCaller(String JavaDoc string) {
64         caller = string;
65     }
66
67     public String JavaDoc getCaller() {
68         return caller;
69     }
70
71     public void setDueDate(Date JavaDoc date) {
72         dueDate = date;
73     }
74
75     public Date JavaDoc getDueDate() {
76         return dueDate;
77     }
78
79     public void setEntry(OJBWorkflowEntry entry) {
80         this.entry = entry;
81     }
82
83     public OJBWorkflowEntry getEntry() {
84         return entry;
85     }
86
87     public void setEntryId(long l) {
88         entryId = l;
89     }
90
91     public long getEntryId() {
92         return entryId;
93     }
94
95     public void setFinishDate(Date JavaDoc date) {
96         finishDate = date;
97     }
98
99     public Date JavaDoc getFinishDate() {
100         return finishDate;
101     }
102
103     public void setId(long l) {
104         id = l;
105     }
106
107     public long getId() {
108         return id;
109     }
110
111     public void setOwner(String JavaDoc string) {
112         owner = string;
113     }
114
115     public String JavaDoc getOwner() {
116         return owner;
117     }
118
119     public long[] getPreviousStepIds() {
120         if (previousSteps == null) {
121             return new long[0];
122         }
123
124         long[] previousStepIds = new long[previousSteps.size()];
125         int i = 0;
126
127         for (Iterator JavaDoc iterator = previousSteps.iterator(); iterator.hasNext();) {
128             OJBStep ojbStep = (OJBStep) iterator.next();
129             previousStepIds[i] = ojbStep.getId();
130             i++;
131         }
132
133         return previousStepIds;
134     }
135
136     public void setPreviousSteps(List JavaDoc list) {
137         previousSteps = list;
138     }
139
140     public List JavaDoc getPreviousSteps() {
141         return previousSteps;
142     }
143
144     public void setStartDate(Date JavaDoc date) {
145         startDate = date;
146     }
147
148     public Date JavaDoc getStartDate() {
149         return startDate;
150     }
151
152     public void setStatus(String JavaDoc string) {
153         status = string;
154     }
155
156     public String JavaDoc getStatus() {
157         return status;
158     }
159
160     public void setStepId(int i) {
161         stepId = i;
162     }
163
164     public int getStepId() {
165         return stepId;
166     }
167 }
168
Popular Tags