1 /*
2 Licensed under the Apache License, Version 2.0 (the "License");
3 you may not use this file except in compliance with the License.
4 You may obtain a copy of the License at
5
6 http://www.apache.org/licenses/LICENSE-2.0
7
8 Unless required by applicable law or agreed to in writing, software
9 distributed under the License is distributed on an "AS IS" BASIS,
10 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 See the License for the specific language governing permissions and
12 limitations under the License.
13 */
14 package uk.nhs.interoperability.infrastructure;
15
16 import uk.nhs.interoperability.capabilities.DirectoryOfServices;
17 import uk.nhs.interoperability.transport.ITKTransportRoute;
18
19 /**
20 * Interface representing a logical address of
21 * a message originator or destination. The underlying
22 * ITK specification provides a structured address
23 * format of the form
24 * <code><span style="color: red;">urn:nhs-uk:addressing:ods</span>:<span style="color: darkorange;">RHM</span>:<span style="color: green;">department:workgroup</span></code>
25 * where the first part (<code><span style="color: red;">urn:nhs-uk:addressing:ods</span></code>) is
26 * fixed the next part (<code><span style="color: darkorange;">RHM</span></code> in this example) is the ODS
27 * code for the NHS organisation and the latter structures of the address (<code><span style="color: green;">department:workgroup</span></code>) can
28 * be locally defined.</br></br>
29 *
30 * From a messaging standpoint the exact structures on the right hand side are not important, however enough information
31 * must be provided to unambiguously resolve the {@link ITKTransportRoute} of the recipient system (or potentially the next hop in the case of a routed message)
32 * via the {@link DirectoryOfServices}
33 *
34 * @author Michael Odling-Smee
35 * @author Nicholas Jones
36 * @since version 0.1
37 *
38 */
39 public interface ITKAddress {
40
41 /**
42 * The OID representing the default (ITK) address type.
43 */
44 public static final String DEFAULT_ADDRESS_TYPE = "2.16.840.1.113883.2.1.3.2.4.18.22";
45
46 /**
47 * Allows the address type to be specified if it is not the {@link #DEFAULT_ADDRESS_TYPE}
48 * @param type The OID representing the address type
49 */
50 public void setType(String type);
51
52 /**
53 * Obtains the address type
54 * @return the OID representing the type of address
55 */
56 public String getType();
57
58 /**
59 * Set the URI for this address
60 * @param uRI the URI to set
61 */
62 public void setURI(String uRI);
63
64 /**
65 * Obtain the URI associated with this address -
66 * e.g. <code>urn:nhs-uk:addressing:ods:RHM:department:workgroup</code>
67 */
68 public String getURI();
69
70 }