Revision 58438
Added by Michele Artini about 4 years ago
ProcessListEntry.java | ||
---|---|---|
7 | 7 |
import eu.dnetlib.msro.workflows.util.ProcessUtils; |
8 | 8 |
|
9 | 9 |
public class ProcessListEntry { |
10 |
|
|
10 | 11 |
private String procId; |
11 | 12 |
private String wfId; |
12 | 13 |
private String name; |
... | ... | |
14 | 15 |
private String status; |
15 | 16 |
private long date; |
16 | 17 |
private String repo; |
17 |
|
|
18 |
private String repoId; |
|
19 |
private String apiId; |
|
20 |
|
|
18 | 21 |
public ProcessListEntry() {} |
19 | 22 |
|
20 |
public ProcessListEntry(String procId, String wfId, String name, String family, String status, long date, String repo) { |
|
23 |
public ProcessListEntry(final String procId, final String wfId, final String name, final String family, final String status, final long date, |
|
24 |
final String repo, final String repoId, final String apiId) { |
|
21 | 25 |
this.procId = procId; |
22 | 26 |
this.wfId = wfId; |
23 | 27 |
this.name = name; |
... | ... | |
25 | 29 |
this.status = status; |
26 | 30 |
this.date = date; |
27 | 31 |
this.repo = repo; |
32 |
this.repoId = repoId; |
|
33 |
this.apiId = apiId; |
|
28 | 34 |
} |
29 | 35 |
|
30 |
public ProcessListEntry(String procId, String wfId, String name, String family, String status, Date date, String repo) { |
|
31 |
this(procId, wfId, name, family, status, dateToLong(date), repo); |
|
36 |
public ProcessListEntry(final String procId, final String wfId, final String name, final String family, final String status, final Date date, |
|
37 |
final String repo, final String repoId, final String apiId) { |
|
38 |
this(procId, wfId, name, family, status, dateToLong(date), repo, repoId, apiId); |
|
32 | 39 |
} |
33 |
|
|
40 |
|
|
34 | 41 |
public ProcessListEntry(final String procId, final GraphProcess process) { |
35 |
this(procId,
|
|
36 |
ProcessUtils.calculateWfId(process),
|
|
42 |
this(procId, |
|
43 |
ProcessUtils.calculateWfId(process), |
|
37 | 44 |
ProcessUtils.calculateName(process), |
38 | 45 |
ProcessUtils.calculateFamily(process), |
39 | 46 |
ProcessUtils.calculateStatus(process), |
40 | 47 |
ProcessUtils.calculateLastActivityDate(process), |
41 |
ProcessUtils.calculateRepo(process)); |
|
48 |
ProcessUtils.calculateRepo(process), |
|
49 |
ProcessUtils.calculateRepoId(process), |
|
50 |
ProcessUtils.calculateApiId(process)); |
|
42 | 51 |
} |
43 | 52 |
|
44 | 53 |
public String getProcId() { |
45 | 54 |
return procId; |
46 | 55 |
} |
47 | 56 |
|
48 |
public void setProcId(String procId) { |
|
57 |
public void setProcId(final String procId) {
|
|
49 | 58 |
this.procId = procId; |
50 | 59 |
} |
51 | 60 |
|
... | ... | |
53 | 62 |
return name; |
54 | 63 |
} |
55 | 64 |
|
56 |
public void setName(String name) { |
|
65 |
public void setName(final String name) {
|
|
57 | 66 |
this.name = name; |
58 | 67 |
} |
59 | 68 |
|
... | ... | |
61 | 70 |
return status; |
62 | 71 |
} |
63 | 72 |
|
64 |
public void setStatus(String status) { |
|
73 |
public void setStatus(final String status) {
|
|
65 | 74 |
this.status = status; |
66 | 75 |
} |
67 | 76 |
|
... | ... | |
73 | 82 |
return wfId; |
74 | 83 |
} |
75 | 84 |
|
76 |
public void setWfId(String wfId) { |
|
85 |
public void setWfId(final String wfId) {
|
|
77 | 86 |
this.wfId = wfId; |
78 | 87 |
} |
79 | 88 |
|
... | ... | |
81 | 90 |
return date; |
82 | 91 |
} |
83 | 92 |
|
84 |
public void setDate(long date) { |
|
93 |
public void setDate(final long date) {
|
|
85 | 94 |
this.date = date; |
86 | 95 |
} |
87 | 96 |
|
88 |
public void setFamily(String family) { |
|
97 |
public void setFamily(final String family) {
|
|
89 | 98 |
this.family = family; |
90 | 99 |
} |
91 | 100 |
|
... | ... | |
93 | 102 |
return repo; |
94 | 103 |
} |
95 | 104 |
|
96 |
public void setRepo(String repo) { |
|
105 |
public void setRepo(final String repo) {
|
|
97 | 106 |
this.repo = repo; |
98 | 107 |
} |
99 |
|
|
100 |
private static long dateToLong(Date date) { |
|
101 |
return (date == null) ? Long.MAX_VALUE : date.getTime();
|
|
108 |
|
|
109 |
private static long dateToLong(final Date date) {
|
|
110 |
return date == null ? Long.MAX_VALUE : date.getTime();
|
|
102 | 111 |
} |
103 | 112 |
|
113 |
public String getRepoId() { |
|
114 |
return repoId; |
|
115 |
} |
|
116 |
|
|
117 |
public void setRepoId(final String repoId) { |
|
118 |
this.repoId = repoId; |
|
119 |
} |
|
120 |
|
|
121 |
public String getApiId() { |
|
122 |
return apiId; |
|
123 |
} |
|
124 |
|
|
125 |
public void setApiId(final String apiId) { |
|
126 |
this.apiId = apiId; |
|
127 |
} |
|
128 |
|
|
104 | 129 |
} |
Also available in: Unified diff
link to api from history