1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.api.document; |
17 | |
|
18 | |
import org.kuali.rice.core.api.CoreConstants; |
19 | |
import org.kuali.rice.core.api.mo.AbstractDataTransferObject; |
20 | |
import org.kuali.rice.core.api.mo.ModelObjectUtils; |
21 | |
import org.w3c.dom.Element; |
22 | |
|
23 | |
import javax.xml.bind.annotation.XmlAccessType; |
24 | |
import javax.xml.bind.annotation.XmlAccessorType; |
25 | |
import javax.xml.bind.annotation.XmlAnyElement; |
26 | |
import javax.xml.bind.annotation.XmlElement; |
27 | |
import javax.xml.bind.annotation.XmlElementWrapper; |
28 | |
import javax.xml.bind.annotation.XmlRootElement; |
29 | |
import javax.xml.bind.annotation.XmlType; |
30 | |
import java.util.Collection; |
31 | |
import java.util.Collections; |
32 | |
import java.util.Set; |
33 | |
|
34 | |
@XmlRootElement(name = OrchestrationConfig.Constants.ROOT_ELEMENT_NAME) |
35 | |
@XmlAccessorType(XmlAccessType.NONE) |
36 | |
@XmlType(name = OrchestrationConfig.Constants.TYPE_NAME, propOrder = { |
37 | |
OrchestrationConfig.Elements.ACTION_TAKEN_ID, |
38 | |
OrchestrationConfig.Elements.NODE_NAMES, |
39 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
40 | |
}) |
41 | |
public final class OrchestrationConfig extends AbstractDataTransferObject { |
42 | |
|
43 | |
@XmlElement(name = Elements.ACTION_TAKEN_ID, required = true) |
44 | |
private final String actionTakenId; |
45 | |
|
46 | |
@XmlElementWrapper(name = Elements.NODE_NAMES, required = false) |
47 | |
@XmlElement(name = Elements.NODE_NAME, required = false) |
48 | |
private final Set<String> nodeNames; |
49 | |
|
50 | 0 | @SuppressWarnings("unused") |
51 | |
@XmlAnyElement |
52 | |
private final Collection<Element> _futureElements = null; |
53 | |
|
54 | |
@SuppressWarnings("unused") |
55 | 0 | private OrchestrationConfig() { |
56 | 0 | this.actionTakenId = null; |
57 | 0 | this.nodeNames = null; |
58 | 0 | } |
59 | |
|
60 | 0 | private OrchestrationConfig(String actionTakenId, Set<String> nodeNames) { |
61 | 0 | this.actionTakenId = actionTakenId; |
62 | 0 | this.nodeNames = ModelObjectUtils.createImmutableCopy(nodeNames); |
63 | 0 | } |
64 | |
|
65 | |
public static OrchestrationConfig create(String actionTakenId, Set<String> nodeNames) { |
66 | 0 | return new OrchestrationConfig(actionTakenId, nodeNames); |
67 | |
} |
68 | |
|
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | |
|
76 | |
public String getActionTakenId() { |
77 | 0 | return actionTakenId; |
78 | |
} |
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
|
85 | |
|
86 | |
public Set<String> getNodeNames() { |
87 | 0 | return nodeNames; |
88 | |
} |
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | 0 | static class Constants { |
94 | |
final static String ROOT_ELEMENT_NAME = "orchestrationConfig"; |
95 | |
final static String TYPE_NAME = "OrchestrationConfigType"; |
96 | |
} |
97 | |
|
98 | |
|
99 | |
|
100 | |
|
101 | |
|
102 | 0 | static class Elements { |
103 | |
final static String ACTION_TAKEN_ID = "actionTakenId"; |
104 | |
final static String NODE_NAMES = "nodeNames"; |
105 | |
final static String NODE_NAME = "nodeName"; |
106 | |
} |
107 | |
|
108 | |
} |