1 | package gov.hhs.fha.nhinc.connectmgr.data;
|
---|
2 |
|
---|
3 | import java.util.List;
|
---|
4 | import java.util.ArrayList;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | * @author westbergl
|
---|
8 | * @version 1.0
|
---|
9 | * @created 20-Oct-2008 12:06:50 PM
|
---|
10 | */
|
---|
11 | public class CMBusinessEntity
|
---|
12 | {
|
---|
13 |
|
---|
14 | private String businessKey = "";
|
---|
15 | private CMDiscoveryURLs discoveryURLs = null;
|
---|
16 | private CMBusinessNames names = null;
|
---|
17 | private CMBusinessDescriptions descriptions = null;
|
---|
18 | private CMContacts contacts = null;
|
---|
19 | private String homeCommunityId = "";
|
---|
20 | private CMStates states = null;
|
---|
21 | private boolean federalHIE = false;
|
---|
22 | private String publicKeyURI = "";
|
---|
23 | private byte[] publicKey = null;
|
---|
24 | private CMBusinessServices businessServices = null;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * Default constructor.
|
---|
28 | */
|
---|
29 | public CMBusinessEntity()
|
---|
30 | {
|
---|
31 | clear();
|
---|
32 | }
|
---|
33 |
|
---|
34 | /**
|
---|
35 | * Clear the contents of this and set it to a default state.
|
---|
36 | */
|
---|
37 | public void clear()
|
---|
38 | {
|
---|
39 | homeCommunityId = "";
|
---|
40 | federalHIE = false;
|
---|
41 | publicKeyURI = "";
|
---|
42 | publicKey = null;
|
---|
43 | businessKey = "";
|
---|
44 | discoveryURLs = null;
|
---|
45 | names = null;
|
---|
46 | descriptions = null;
|
---|
47 | contacts = null;
|
---|
48 | states = null;
|
---|
49 | businessServices = null;
|
---|
50 | }
|
---|
51 |
|
---|
52 | /**
|
---|
53 | * Returns true of the contents of the object are the same as the one
|
---|
54 | * passed in.
|
---|
55 | *
|
---|
56 | * @param oCompare The object to compare.
|
---|
57 | * @return TRUE if the contents are the same as the one passed in.
|
---|
58 | */
|
---|
59 | public boolean equals(CMBusinessEntity oCompare)
|
---|
60 | {
|
---|
61 | if (!this.homeCommunityId.equals(oCompare.homeCommunityId))
|
---|
62 | {
|
---|
63 | return false;
|
---|
64 | }
|
---|
65 |
|
---|
66 | if (this.federalHIE != oCompare.federalHIE)
|
---|
67 | {
|
---|
68 | return false;
|
---|
69 | }
|
---|
70 |
|
---|
71 | if (!this.publicKeyURI.equals(oCompare.publicKeyURI))
|
---|
72 | {
|
---|
73 | return false;
|
---|
74 | }
|
---|
75 |
|
---|
76 | if (!this.businessKey.equals(oCompare.businessKey))
|
---|
77 | {
|
---|
78 | return false;
|
---|
79 | }
|
---|
80 |
|
---|
81 | if (!this.discoveryURLs.equals(oCompare.discoveryURLs))
|
---|
82 | {
|
---|
83 | return false;
|
---|
84 | }
|
---|
85 |
|
---|
86 | if (!this.names.equals(oCompare.names))
|
---|
87 | {
|
---|
88 | return false;
|
---|
89 | }
|
---|
90 |
|
---|
91 | if (!this.descriptions.equals(oCompare.descriptions))
|
---|
92 | {
|
---|
93 | return false;
|
---|
94 | }
|
---|
95 |
|
---|
96 | if (!this.contacts.equals(oCompare.contacts))
|
---|
97 | {
|
---|
98 | return false;
|
---|
99 | }
|
---|
100 |
|
---|
101 | if (!this.states.equals(oCompare.states))
|
---|
102 | {
|
---|
103 | return false;
|
---|
104 | }
|
---|
105 |
|
---|
106 | if (!this.businessServices.equals(oCompare.businessServices))
|
---|
107 | {
|
---|
108 | return false;
|
---|
109 | }
|
---|
110 |
|
---|
111 | if ((this.publicKey.length != oCompare.publicKey.length))
|
---|
112 | {
|
---|
113 | return false;
|
---|
114 | }
|
---|
115 |
|
---|
116 | int iCnt = this.publicKey.length;
|
---|
117 | for (int i = 0; i < iCnt; i++)
|
---|
118 | {
|
---|
119 | if (this.publicKey[i] != oCompare.publicKey[i])
|
---|
120 | {
|
---|
121 | return false;
|
---|
122 | }
|
---|
123 | }
|
---|
124 |
|
---|
125 | // If we got here then everything is the same...
|
---|
126 | //----------------------------------------------
|
---|
127 | return true;
|
---|
128 | }
|
---|
129 |
|
---|
130 | /**
|
---|
131 | * Return the business key associated with this entity.
|
---|
132 | *
|
---|
133 | * @return The business key associated with this entity.
|
---|
134 | */
|
---|
135 | public String getBusinessKey()
|
---|
136 | {
|
---|
137 | return businessKey;
|
---|
138 | }
|
---|
139 |
|
---|
140 | /**
|
---|
141 | * Sets the business key associated with this entity.
|
---|
142 | *
|
---|
143 | * @param businessKey The business key associated with this entity.
|
---|
144 | */
|
---|
145 | public void setBusinessKey(String businessKey)
|
---|
146 | {
|
---|
147 | this.businessKey = businessKey;
|
---|
148 | }
|
---|
149 |
|
---|
150 | /**
|
---|
151 | * Returns the business services assocaited with this business entity.
|
---|
152 | *
|
---|
153 | * @return The business services associated with this business entity.
|
---|
154 | */
|
---|
155 | public CMBusinessServices getBusinessServices()
|
---|
156 | {
|
---|
157 | return businessServices;
|
---|
158 | }
|
---|
159 |
|
---|
160 | /**
|
---|
161 | * Sets the business services assocaited with this business entity.
|
---|
162 | *
|
---|
163 | * @param businessServices The business services associated with this business entity.
|
---|
164 | */
|
---|
165 | public void setBusinessServices(CMBusinessServices businessServices)
|
---|
166 | {
|
---|
167 | this.businessServices = businessServices;
|
---|
168 | }
|
---|
169 |
|
---|
170 | /**
|
---|
171 | * Return the contacts associated with this business entity.
|
---|
172 | *
|
---|
173 | * @return The contacts associated with this business entity.
|
---|
174 | */
|
---|
175 | public CMContacts getContacts()
|
---|
176 | {
|
---|
177 | return contacts;
|
---|
178 | }
|
---|
179 |
|
---|
180 | /**
|
---|
181 | * Sets the contacts associated with this business entity.
|
---|
182 | *
|
---|
183 | * @param contacts The contacts associated with this business entity.
|
---|
184 | */
|
---|
185 | public void setContacts(CMContacts contacts)
|
---|
186 | {
|
---|
187 | this.contacts = contacts;
|
---|
188 | }
|
---|
189 |
|
---|
190 | /**
|
---|
191 | * Return the description of this business entity.
|
---|
192 | *
|
---|
193 | * @return The description of this business entity.
|
---|
194 | */
|
---|
195 | public CMBusinessDescriptions getDescriptions()
|
---|
196 | {
|
---|
197 | return descriptions;
|
---|
198 | }
|
---|
199 |
|
---|
200 | /**
|
---|
201 | * Sets the description of this business entity.
|
---|
202 | *
|
---|
203 | * @return The description of this business entity.
|
---|
204 | */
|
---|
205 | public void setDescriptions(CMBusinessDescriptions descriptions)
|
---|
206 | {
|
---|
207 | this.descriptions = descriptions;
|
---|
208 | }
|
---|
209 |
|
---|
210 | /**
|
---|
211 | * Returns the dicovery URLs for this business entity.
|
---|
212 | *
|
---|
213 | * @return The discovery URLs for this business entity.
|
---|
214 | */
|
---|
215 | public CMDiscoveryURLs getDiscoveryURLs()
|
---|
216 | {
|
---|
217 | return discoveryURLs;
|
---|
218 | }
|
---|
219 |
|
---|
220 | /**
|
---|
221 | * Sets the dicovery URLs for this business entity.
|
---|
222 | *
|
---|
223 | * @return The discovery URLs for this business entity.
|
---|
224 | */
|
---|
225 | public void setDiscoveryURLs(CMDiscoveryURLs discoveryURLs)
|
---|
226 | {
|
---|
227 | this.discoveryURLs = discoveryURLs;
|
---|
228 | }
|
---|
229 |
|
---|
230 | /**
|
---|
231 | * Returns true if this business entity represents a federal HIE.
|
---|
232 | *
|
---|
233 | * @return True if this business entity represents a federal HIE.
|
---|
234 | */
|
---|
235 | public boolean isFederalHIE()
|
---|
236 | {
|
---|
237 | return federalHIE;
|
---|
238 | }
|
---|
239 |
|
---|
240 | /**
|
---|
241 | * Set to true if this business entity represents a federal HIE.
|
---|
242 | *
|
---|
243 | * @param federalHIE True if this business entity represents a federal HIE.
|
---|
244 | */
|
---|
245 | public void setFederalHIE(boolean federalHIE)
|
---|
246 | {
|
---|
247 | this.federalHIE = federalHIE;
|
---|
248 | }
|
---|
249 |
|
---|
250 | /**
|
---|
251 | * Returns the home community ID for this business entity.
|
---|
252 | *
|
---|
253 | * @return The home community ID for this business entity.
|
---|
254 | */
|
---|
255 | public String getHomeCommunityId()
|
---|
256 | {
|
---|
257 | return homeCommunityId;
|
---|
258 | }
|
---|
259 |
|
---|
260 | /**
|
---|
261 | * Sets the home community ID for this business entity.
|
---|
262 | *
|
---|
263 | * @param homeCommunityId The home community ID for this business entity.
|
---|
264 | */
|
---|
265 | public void setHomeCommunityId(String homeCommunityId)
|
---|
266 | {
|
---|
267 | this.homeCommunityId = homeCommunityId;
|
---|
268 | }
|
---|
269 |
|
---|
270 | /**
|
---|
271 | * Returns the business names associated with this business entity.
|
---|
272 | *
|
---|
273 | * @return The business names associated with this business entity.
|
---|
274 | */
|
---|
275 | public CMBusinessNames getNames()
|
---|
276 | {
|
---|
277 | return names;
|
---|
278 | }
|
---|
279 |
|
---|
280 | /**
|
---|
281 | * Sets the business names associated with this business entity.
|
---|
282 | *
|
---|
283 | * @param names The business names associated with this business entity.
|
---|
284 | */
|
---|
285 | public void setNames(CMBusinessNames names)
|
---|
286 | {
|
---|
287 | this.names = names;
|
---|
288 | }
|
---|
289 |
|
---|
290 | /**
|
---|
291 | * Returns the PKI public key for this business entity.
|
---|
292 | *
|
---|
293 | * @return The PKI public key for this business entity.
|
---|
294 | */
|
---|
295 | public byte[] getPublicKey()
|
---|
296 | {
|
---|
297 | return publicKey;
|
---|
298 | }
|
---|
299 |
|
---|
300 | /**
|
---|
301 | * sets the PKI public key for this business entity.
|
---|
302 | *
|
---|
303 | * @param publicKey The PKI public key for this business entity.
|
---|
304 | */
|
---|
305 | public void setPublicKey(byte[] publicKey)
|
---|
306 | {
|
---|
307 | this.publicKey = publicKey;
|
---|
308 | }
|
---|
309 |
|
---|
310 | /**
|
---|
311 | * Returns the URL for the location to retrieve the business entity's PKI public key.
|
---|
312 | *
|
---|
313 | * @return The URL for the location to retrieve the business entity's PKI public key.
|
---|
314 | */
|
---|
315 | public String getPublicKeyURI()
|
---|
316 | {
|
---|
317 | return publicKeyURI;
|
---|
318 | }
|
---|
319 |
|
---|
320 | /**
|
---|
321 | * Sets the URL for the location to retrieve the business entity's PKI public key.
|
---|
322 | *
|
---|
323 | * @param publicKeyURI The URL for the location to retrieve the business entity's PKI public key.
|
---|
324 | */
|
---|
325 | public void setPublicKeyURI(String publicKeyURI)
|
---|
326 | {
|
---|
327 | this.publicKeyURI = publicKeyURI;
|
---|
328 | }
|
---|
329 |
|
---|
330 | /**
|
---|
331 | * Returns the states associated with this business entity.
|
---|
332 | *
|
---|
333 | * @return The states associated with this business entity.
|
---|
334 | */
|
---|
335 | public CMStates getStates()
|
---|
336 | {
|
---|
337 | return states;
|
---|
338 | }
|
---|
339 |
|
---|
340 | /**
|
---|
341 | * Sets the states associated with this business entity.
|
---|
342 | *
|
---|
343 | * @param states The states associated with this business entity.
|
---|
344 | */
|
---|
345 | public void setStates(CMStates states)
|
---|
346 | {
|
---|
347 | this.states = states;
|
---|
348 | }
|
---|
349 |
|
---|
350 | }
|
---|