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.service;
15  
16  import uk.nhs.interoperability.capabilities.DirectoryOfServices;
17  
18  /**
19   * Definition of a fully resolved ITKService
20   * including the supported pattern, mime type
21   * and whether or not the payload should be
22   * base64 encoded.
23   * 
24   * @see DirectoryOfServices#getService(String)
25   * 
26   * 
27   * @author Michael Odling-Smee
28   * @author Nicholas Jones
29   * @since version 0.1
30   */
31  public interface ITKService {
32  
33  	/**
34  	 * Obtains the service identifier
35  	 * associated with this ITKService
36  	 * object
37  	 * @return the ITK service identifier
38  	 * - e.g. <code>urn:nhs-itk:services:201005:transferPatient-v1-0</code>
39  	 */
40  	public String getServiceId();
41  	
42  	/**
43  	 * Determines whether or not this service 
44  	 * supports synchronous invocation.
45  	 * 
46  	 * @return <code>true</code> if the service
47  	 * supports synchronous invocation
48  	 */
49  	public boolean supportsSync();
50  	
51  	/**
52  	 * Determines whether or not this service 
53  	 * supports an asynchronous invocation.
54  	 * 
55  	 * @return <code>true</code> if the service
56  	 * supports asynchronous invocation
57  	 */
58  	public boolean supportsAsync();
59  	
60  	/**
61  	 * Determines whether this service
62  	 * expects the business payload data
63  	 * to be base64 encoded.<br/><br/>
64  	 * 
65  	 * Note: In ITK all ADT v2 pipe and hat
66  	 * messages are required to base64 encoded during
67  	 * transmission
68  	 * 
69  	 * @return <code>true</code> if the 
70  	 * service defines that the payload data
71  	 * should be base64 encoding during transmission;
72  	 * <code>false</code> otherwise
73  	 */
74  	public boolean isBase64();
75  	
76  	/**
77  	 * Specifies the appropriate mime type
78  	 * for this service
79  	 * 
80  	 * @return The String representing the Mime
81  	 * type that should be set when transmitting
82  	 * ITKMessages on this service
83  	 * - e.g. <code>text/xml</code>
84  	 */
85  	public String getMimeType();
86  }