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.WS;
15  
16  import uk.nhs.interoperability.transport.ITKTransportProperties;
17  import uk.nhs.interoperability.util.StringUtils;
18  
19  /**
20   * The Class SOAPUtils.
21   *
22   * @author Michael Odling-Smee
23   * @author Nicholas Jones
24   * @since 0.1
25   */
26  public class SOAPUtils {
27  
28  	/**
29  	 * Instantiates a new sOAP utils.
30  	 */
31  	private SOAPUtils() {
32  	}
33  	
34  	/**
35  	 * Resolve fault to address.
36  	 *
37  	 * @param itkTransportProperties the itk transport properties
38  	 * @return the string
39  	 */
40  	public static final String resolveFaultToAddress(ITKTransportProperties itkTransportProperties) {
41  		if (StringUtils.hasValue(itkTransportProperties.getTransportFaultTo())) {
42  			return itkTransportProperties.getTransportFaultTo();
43  		} else if (StringUtils.hasValue(itkTransportProperties.getTransportReplyTo())) {
44  			return itkTransportProperties.getTransportReplyTo();
45  		} 
46  		return null;
47  	}
48  	
49  	/**
50  	 * Resolve reply to address.
51  	 *
52  	 * @param itkTransportProperties the itk transport properties
53  	 * @return the string
54  	 */
55  	public static final String resolveReplyToAddress(ITKTransportProperties itkTransportProperties) {
56  		if (StringUtils.hasValue(itkTransportProperties.getTransportReplyTo())) {
57  			return itkTransportProperties.getTransportReplyTo();
58  		} 
59  		return null;
60  	}
61  
62  }