1
|
package eu.dnetlib.functionality.modular.ui.workflows.objects;
|
2
|
|
3
|
import java.util.Collections;
|
4
|
import java.util.List;
|
5
|
import java.util.Map;
|
6
|
|
7
|
import com.google.common.collect.Lists;
|
8
|
import eu.dnetlib.msro.workflows.procs.Token;
|
9
|
|
10
|
public class NodeTokenInfo {
|
11
|
|
12
|
private String name;
|
13
|
private long start;
|
14
|
private long end;
|
15
|
private List<EnvParam> params;
|
16
|
|
17
|
public NodeTokenInfo(final String name) {
|
18
|
super();
|
19
|
this.name = name;
|
20
|
this.start = 0;
|
21
|
this.end = 0;
|
22
|
this.params = Lists.newArrayList();
|
23
|
}
|
24
|
|
25
|
public NodeTokenInfo(final Token token) {
|
26
|
super();
|
27
|
|
28
|
this.start = token.getStartDate();
|
29
|
this.end = token.getEndDate();
|
30
|
this.name = token.getNodeName();
|
31
|
this.params = Lists.newArrayList();
|
32
|
|
33
|
for (Map.Entry<String, Object> e : token.getEnv().getAttributes().entrySet()) {
|
34
|
this.params.add(new EnvParam(e.getKey(), e.getValue() != null ? e.getValue().toString() : null));
|
35
|
}
|
36
|
|
37
|
Collections.sort(this.params);
|
38
|
}
|
39
|
|
40
|
public String getName() {
|
41
|
return name;
|
42
|
}
|
43
|
|
44
|
public long getStart() {
|
45
|
return start;
|
46
|
}
|
47
|
|
48
|
public long getEnd() {
|
49
|
return end;
|
50
|
}
|
51
|
|
52
|
public List<EnvParam> getParams() {
|
53
|
return params;
|
54
|
}
|
55
|
}
|