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.transport;
15  
16  /**
17   * Interface representing the properties of a physical
18   * (transport specific) destination.
19   * 
20   * @author Michael Odling-Smee
21   * @author Nicholas Jones
22   * @since 0.1
23   *
24   */
25  public interface ITKTransportRoute {
26  	
27  	// Transport Types
28  	/**
29  	 * Indicates an unknown transport type
30  	 */
31  	public static final String UNKNOWN = "UN";
32  	
33  	/**
34  	 * Constant to indicate an HTTP SOAP/Web Service
35  	 * ITKTransportRoute
36  	 */
37  	public static final String HTTP_WS = "WS";
38  	
39  	/**
40  	 * Constant to indicate a DTS (Data Transfer Service)
41  	 * ITKTransportRoute
42  	 */
43  	public static final String DTS = "DTS";
44  	
45  	/**
46  	 * Constant to indicate a Spine TMS forward channel
47  	 * ITKTransportRoute
48  	 */
49  	public static final String SPINE_TMS = "TMS";	
50  	
51  	// Destination Types
52  	/**
53  	 * Constant to indicate that the service
54  	 * provider can be reached directly without
55  	 * any intermediary routing or the need
56  	 * for routing components an message instance
57  	 * information.
58  	 */
59  	public static final String DIRECT = "DIRECT";
60  	
61  	/**
62  	 * Constant to indicate that the service
63  	 * provider can be reached via the routed
64  	 * message pattern (note this does not preclude
65  	 * the service provider being invoked via
66  	 * a single message hop)
67  	 */
68  	public static final String ROUTED = "ROUTED";
69  	
70  	// Wrapper Types
71  	/**
72  	 * Constant to indicate that no wrappers are
73  	 * required for the transport route
74  	 */
75  	public static final String NO_WRAPPER = "NONE";
76  	
77  	/**
78  	 * Constant to indicate that a distribution envelope
79  	 * should wrap the business payload for the transport
80  	 * route. 
81  	 * 
82  	 * <br/><br/>Any additional wrappers such as
83  	 * <code>&lt;SOAP/&gt;</code> wrappers are implied and
84  	 * handled via the transport specific components
85  	 */
86  	public static final String DISTRIBUTION_ENVELOPE = "DE";
87  	
88  	/**
89  	 * Obtains the transport type for this
90  	 * ITKTransportRoute instance
91  	 * 
92  	 * @return the transport type. Can be one of
93  	 * 
94  	 * {@link ITKTransportRoute#DTS}; {@link ITKTransportRoute#HTTP_WS};
95  	 * {@link ITKTransportRoute#SPINE_TMS} or {@link ITKTransportRoute#UNKNOWN}
96  	 */
97  	public String getTransportType();
98  	
99  	/**
100 	 * Obtains the transport specific physical
101 	 * destination address
102 	 * 
103 	 * @return A string representation of the
104 	 * transport specific destination address 
105 	 * for this ITKTransportRoute
106 	 */
107 	public String getPhysicalAddress();
108 
109 	/**
110 	 * Obtains the address for any asynchronous replies
111 	 * 
112 	 * @return the address for any asynchronous replies
113 	 */
114 	public String getReplyToAddress();
115 	
116 	/**
117 	 * Obtains the address for sending an exceptions
118 	 * that are reported asynchronously
119 	 * 
120 	 * @return the address for asynchronous exceptions
121 	 */
122 	public String getExceptionToAddress(); 
123 	
124 	/**
125 	 * Obtains the destination type
126 	 * 
127 	 * @return the destination type - can be one
128 	 * of {@link #DIRECT} or {@link #ROUTED}
129 	 */
130 	public String getDestinationType();
131 	
132 	/**
133 	 * Obtains the details of any transport route
134 	 * wrappers that are required for the business
135 	 * payload
136 	 * 
137 	 * @return The wrapper type - can be one of
138 	 * {@link #NO_WRAPPER} or {@link #DISTRIBUTION_ENVELOPE}
139 	 */
140 	public String getWrapperType();
141 	
142 	/**
143 	 * Sets the details of any transport route
144 	 * wrappers that are required for the business
145 	 * payload
146 	 * 
147 	 * @param wrapperType The wrapper type - can be one of
148 	 * {@link #NO_WRAPPER} or {@link #DISTRIBUTION_ENVELOPE}
149 	 */
150 	public void setWrapperType(String wrapperType);
151 	
152 	/**
153 	 * Obtains the time to live for any messages
154 	 * being sent via this ITKTransportRoute
155 	 * 
156 	 * @return The time to live (in Seconds)
157 	 */
158 	public int getTimeToLive();
159 }