KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > continuent > sequoia > controller > recoverylog > RecoveryTask


1 /**
2  * Sequoia: Database clustering technology.
3  * Copyright (C) 2002-2004 French National Institute For Research In Computer
4  * Science And Control (INRIA).
5  * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
6  * Contact: sequoia@continuent.org
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  * Initial developer(s): Emmanuel Cecchet.
21  * Contributor(s): Julie Marguerite.
22  */

23
24 package org.continuent.sequoia.controller.recoverylog;
25
26 import org.continuent.sequoia.controller.loadbalancer.tasks.AbstractTask;
27
28 /**
29  * Recovery task containing an <code>AbstractTask</code> and the id of the
30  * task in the recovery log.
31  *
32  * @author <a HREF="mailto:Emmanuel.Cecchet@inria.fr">Emmanuel Cecchet </a>
33  * @author <a HREF="mailto:Julie.Marguerite@inria.fr">Julie Marguerite </a>
34  * @version 1.0
35  */

36 public class RecoveryTask
37 {
38   private long id;
39   private long tid;
40   private AbstractTask task;
41   private String JavaDoc status;
42   private long completionLogId = -1;
43
44   /**
45    * Constructs a new <code>RecoveryTask</code> instance.
46    *
47    * @param tid transaction id
48    * @param id task id in the recovery log
49    * @param task task to be executed
50    * @param status request execution status as defined in LogEntry constants
51    */

52   public RecoveryTask(long tid, long id, AbstractTask task, String JavaDoc status)
53   {
54     this.id = id;
55     this.tid = tid;
56     this.task = task;
57     this.status = status;
58   }
59
60   /**
61    * Get the last log id that had been assigned when this task completed
62    *
63    * @return the completion log id
64    */

65   public long getCompletionLogId()
66   {
67     return completionLogId;
68   }
69
70   /**
71    * Set the last log id that had been assigned when this task completed
72    *
73    * @param completionLogId the completion log id
74    */

75   public void setCompletionLogId(long completionLogId)
76   {
77     this.completionLogId = completionLogId;
78   }
79
80   /**
81    * Returns the id.
82    *
83    * @return int
84    */

85   public long getId()
86   {
87     return id;
88   }
89
90   /**
91    * Returns the status value.
92    *
93    * @return Returns the status.
94    */

95   public final String JavaDoc getStatus()
96   {
97     return status;
98   }
99
100   /**
101    * Returns the task.
102    *
103    * @return AbstractTask
104    */

105   public AbstractTask getTask()
106   {
107     return task;
108   }
109
110   /**
111    * Returns the tid value.
112    *
113    * @return Returns the tid.
114    */

115   public long getTid()
116   {
117     return tid;
118   }
119
120 }
121
Popular Tags