1 | |
package org.kuali.rice.ksb.api.registry; |
2 | |
|
3 | |
import java.util.ArrayList; |
4 | |
import java.util.Collection; |
5 | |
import java.util.Collections; |
6 | |
import java.util.List; |
7 | |
|
8 | |
import javax.xml.bind.annotation.XmlAccessType; |
9 | |
import javax.xml.bind.annotation.XmlAccessorType; |
10 | |
import javax.xml.bind.annotation.XmlAnyElement; |
11 | |
import javax.xml.bind.annotation.XmlElement; |
12 | |
import javax.xml.bind.annotation.XmlElementWrapper; |
13 | |
import javax.xml.bind.annotation.XmlRootElement; |
14 | |
import javax.xml.bind.annotation.XmlType; |
15 | |
|
16 | |
import org.apache.commons.lang.builder.EqualsBuilder; |
17 | |
import org.apache.commons.lang.builder.HashCodeBuilder; |
18 | |
import org.apache.commons.lang.builder.ToStringBuilder; |
19 | |
import org.kuali.rice.core.api.CoreConstants; |
20 | |
import org.kuali.rice.core.api.mo.ModelObjectComplete; |
21 | |
import org.w3c.dom.Element; |
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
|
31 | |
@XmlRootElement(name = RemoveAndPublishResult.Constants.ROOT_ELEMENT_NAME) |
32 | |
@XmlAccessorType(XmlAccessType.NONE) |
33 | |
@XmlType(name = RemoveAndPublishResult.Constants.TYPE_NAME, propOrder = { |
34 | |
RemoveAndPublishResult.Elements.SERVICES_REMOVED, |
35 | |
RemoveAndPublishResult.Elements.SERVICES_PUBLISHED, |
36 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
37 | |
}) |
38 | |
public class RemoveAndPublishResult implements ModelObjectComplete { |
39 | |
|
40 | |
private static final long serialVersionUID = 4279564869510247725L; |
41 | |
|
42 | |
@XmlElementWrapper(name = Elements.SERVICES_REMOVED, required = false) |
43 | |
@XmlElement(name = Elements.SERVICE_REMOVED, required = false) |
44 | |
private final List<ServiceEndpoint> servicesRemoved; |
45 | |
|
46 | |
@XmlElementWrapper(name = Elements.SERVICES_PUBLISHED, required = false) |
47 | |
@XmlElement(name = Elements.SERVICE_PUBLISHED, required = false) |
48 | |
private final List<ServiceEndpoint> servicesPublished; |
49 | |
|
50 | 0 | @SuppressWarnings("unused") |
51 | |
@XmlAnyElement |
52 | |
private final Collection<Element> _futureElements = null; |
53 | |
|
54 | 0 | private RemoveAndPublishResult() { |
55 | 0 | this.servicesRemoved = null; |
56 | 0 | this.servicesPublished = null; |
57 | 0 | } |
58 | |
|
59 | 0 | private RemoveAndPublishResult(List<ServiceEndpoint> servicesRemoved, List<ServiceEndpoint> servicesPublished) { |
60 | 0 | this.servicesRemoved = servicesRemoved; |
61 | 0 | this.servicesPublished = servicesPublished; |
62 | 0 | } |
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
|
68 | |
|
69 | |
|
70 | |
|
71 | |
|
72 | |
public static RemoveAndPublishResult create(List<ServiceEndpoint> servicesRemoved, List<ServiceEndpoint> servicesPublished) { |
73 | 0 | return new RemoveAndPublishResult(new ArrayList<ServiceEndpoint>(servicesRemoved), |
74 | |
new ArrayList<ServiceEndpoint>(servicesPublished)); |
75 | |
} |
76 | |
|
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
|
84 | |
public List<ServiceEndpoint> getServicesRemoved() { |
85 | 0 | return Collections.unmodifiableList(servicesRemoved); |
86 | |
} |
87 | |
|
88 | |
|
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
public List<ServiceEndpoint> getServicesPublished() { |
96 | 0 | return Collections.unmodifiableList(servicesPublished); |
97 | |
} |
98 | |
|
99 | |
@Override |
100 | |
public int hashCode() { |
101 | 0 | return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
102 | |
} |
103 | |
|
104 | |
@Override |
105 | |
public boolean equals(Object object) { |
106 | 0 | return EqualsBuilder.reflectionEquals(object, this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
107 | |
} |
108 | |
|
109 | |
@Override |
110 | |
public String toString() { |
111 | 0 | return ToStringBuilder.reflectionToString(this); |
112 | |
} |
113 | |
|
114 | |
|
115 | |
|
116 | |
|
117 | 0 | static class Constants { |
118 | |
|
119 | |
final static String ROOT_ELEMENT_NAME = "removeAndPublishResult"; |
120 | |
final static String TYPE_NAME = "RemoveAndPublishResultType"; |
121 | 0 | final static String[] HASH_CODE_EQUALS_EXCLUDE = new String[] {CoreConstants.CommonElements.FUTURE_ELEMENTS }; |
122 | |
|
123 | |
} |
124 | |
|
125 | |
|
126 | |
|
127 | |
|
128 | 0 | static class Elements { |
129 | |
|
130 | |
final static String SERVICES_REMOVED = "servicesRemoved"; |
131 | |
final static String SERVICE_REMOVED = "serviceRemoved"; |
132 | |
final static String SERVICES_PUBLISHED = "servicesPublished"; |
133 | |
final static String SERVICE_PUBLISHED = "servicePublished"; |
134 | |
|
135 | |
} |
136 | |
|
137 | |
} |