View Javadoc

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.capabilities;
15  
16  import uk.nhs.interoperability.infrastructure.ITKAddress;
17  import uk.nhs.interoperability.service.ITKService;
18  import uk.nhs.interoperability.transport.ITKTransportRoute;
19  
20  /**
21   * An abstraction for an endpoint resolution directory.
22   * Concrete implementations of this interface can be
23   * simple (for instance configuration file based) or
24   * be dependent on external services such as a national
25   * endpoint directory - for instance
26   * Spine Directory Services (SDS) 
27   * 
28   * @author Michael Odling-Smee
29   * @author Nicholas Jones
30   * @since version 0.1
31   */
32  public interface DirectoryOfServices {
33  
34  
35  	/**
36  	 * Resolve the <code>ITKTransportRoute</code> for the supplied <code>service</code>
37  	 * and logical destination <code>address</code>. For non-routed messages the returned
38  	 * transport route will provide the physical destination address of the addressee.
39  	 * For routed messages the return <code>ITKTransportRoute</code> may represent the
40  	 * physical route to the actual destination service or it may resolve to an intermediary
41  	 * ITK-router - from the message originators perspective it is agnostic.
42  	 * 
43  	 * @param serviceId The serviceId representing the ITK service that is being requested
44  	 * e.g. <code>urn:nhs-itk:services:201005:transferPatient-v1-0</code>
45  	 * @param address The logical address of the destination e.g. <code>urn:nhs-uk:addressing:ods:TESTORGS:ORGB</code>
46  	 */
47  	public ITKTransportRoute resolveDestination(String serviceId, ITKAddress address);
48  
49  	/**
50  	 * Get the <code>ITKService</code> for the supplied <code>serviceId</code>
51  	 * 
52  	 * @param serviceId The ITK Service Id representing the ITK service that is being requested
53  	 * e.g. <code>urn:nhs-itk:services:201005:transferPatient-v1-0</code>
54  	 */
55  	public ITKService getService(String serviceId);
56  }