345
|
1 package alice.topology.manager.keeparive;
|
|
2
|
|
3 public class TaskInfo {
|
|
4 private TaskType type;
|
|
5 private long sleepTime;
|
|
6 private String managerKey;
|
|
7 private String returnKey;
|
|
8
|
|
9 public TaskInfo(TaskType t){
|
|
10 type = t;
|
|
11 }
|
|
12
|
|
13 public void setInfo(String managerKey, long time){
|
|
14 this.managerKey = managerKey;
|
|
15 sleepTime = time;
|
|
16 }
|
|
17
|
|
18 public void setInfo(String managerKey, String returnKey, long time){
|
|
19 this.managerKey = managerKey;
|
|
20 this.returnKey = returnKey;
|
|
21 sleepTime = time;
|
|
22 }
|
|
23
|
|
24 public TaskType getType(){
|
|
25 return type;
|
|
26 }
|
|
27
|
|
28 public long getSleepTime(){
|
|
29 return sleepTime;
|
|
30 }
|
|
31
|
|
32 public void setSleepTime(long time){
|
|
33 sleepTime = time;
|
|
34 }
|
|
35
|
|
36 public String getManagerKey(){
|
|
37 return managerKey;
|
|
38 }
|
|
39
|
|
40 public String getReturnKey(){
|
|
41 return returnKey;
|
|
42 }
|
|
43
|
|
44 public TaskInfo clone(){
|
|
45 TaskInfo task = new TaskInfo(type);
|
|
46 task.setInfo(managerKey, returnKey, sleepTime);
|
|
47 return task;
|
|
48 }
|
|
49
|
|
50 public void show(){
|
|
51 System.out.print(type);
|
|
52 System.out.print(" "+ this.sleepTime);
|
|
53 System.out.print(" "+ this.managerKey);
|
|
54 System.out.println(" "+ this.returnKey);
|
|
55 }
|
|
56 }
|