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   * The Class ITKTransportRouteImpl.
18   *
19   * @author Michael Odling-Smee
20   * @author Nicholas Jones
21   * @since 0.1
22   */
23  public class ITKTransportRouteImpl implements ITKTransportRoute {
24  
25  	/** The transport type. */
26  	private String transportType;
27  	
28  	/** The physical address. */
29  	private String physicalAddress;
30  	
31  	/** The reply to address. */
32  	private String replyToAddress;
33  	
34  	/** The exception to address. */
35  	private String exceptionToAddress;
36  	
37  	/** The destination type. */
38  	private String destinationType;
39  	
40  	/** The wrapper type. */
41  	private String wrapperType = ITKTransportRoute.NO_WRAPPER;
42  	
43  	/** The time to live. */
44  	private int timeToLive;
45  	
46  	/* (non-Javadoc)
47  	 * @see uk.nhs.interoperability.transport.ITKTransportRoute#getTransportType()
48  	 */
49  	@Override
50  	public String getTransportType() {
51  		return transportType;
52  	}
53  
54  	/* (non-Javadoc)
55  	 * @see uk.nhs.interoperability.transport.ITKTransportRoute#getPhysicalAddress()
56  	 */
57  	@Override
58  	public String getPhysicalAddress() {
59  		return physicalAddress;
60  	}
61  	
62  	/**
63  	 * Instantiates a new iTK transport route impl.
64  	 *
65  	 * @param type the type
66  	 * @param address the address
67  	 */
68  	public ITKTransportRouteImpl(String type, String address) {
69  		this.transportType = type;
70  		this.physicalAddress = address;
71  	}
72  	
73  	/**
74  	 * Instantiates a new iTK transport route impl.
75  	 *
76  	 * @param type the type
77  	 * @param address the address
78  	 * @param replyTo the reply to
79  	 * @param exceptionTo the exception to
80  	 * @param destinationType the destination type
81  	 * @param wrapperType the wrapper type
82  	 * @param timeToLive the time to live
83  	 */
84  	public ITKTransportRouteImpl(String type, String address, String replyTo, 
85  								 String exceptionTo, String destinationType, 
86  								 String wrapperType, int timeToLive){
87  		this.transportType = type;
88  		this.physicalAddress = address;
89  		this.replyToAddress = replyTo;
90  		this.exceptionToAddress = exceptionTo;
91  		this.destinationType = destinationType;
92  		this.wrapperType = wrapperType;
93  		this.timeToLive = timeToLive;
94  	}
95  
96  	/* (non-Javadoc)
97  	 * @see uk.nhs.interoperability.transport.ITKTransportRoute#getReplyToAddress()
98  	 */
99  	@Override
100 	public String getReplyToAddress() {
101 		return replyToAddress;
102 	}
103 
104 	/* (non-Javadoc)
105 	 * @see uk.nhs.interoperability.transport.ITKTransportRoute#getExceptionToAddress()
106 	 */
107 	@Override
108 	public String getExceptionToAddress() {
109 		return exceptionToAddress;
110 	}
111 
112 	/* (non-Javadoc)
113 	 * @see uk.nhs.interoperability.transport.ITKTransportRoute#getDestinationType()
114 	 */
115 	@Override
116 	public String getDestinationType() {
117 		return destinationType;
118 	}
119 
120 	/* (non-Javadoc)
121 	 * @see uk.nhs.interoperability.transport.ITKTransportRoute#getWrapperType()
122 	 */
123 	@Override
124 	public String getWrapperType() {
125 		return wrapperType;
126 	}
127 	
128 	/* (non-Javadoc)
129 	 * @see uk.nhs.interoperability.transport.ITKTransportRoute#setWrapperType(java.lang.String)
130 	 */
131 	@Override
132 	public void setWrapperType(String wrapperType) {
133 		this.wrapperType = wrapperType;
134 	}
135 
136 	/* (non-Javadoc)
137 	 * @see uk.nhs.interoperability.transport.ITKTransportRoute#getTimeToLive()
138 	 */
139 	@Override
140 	public int getTimeToLive() {
141 		return timeToLive;
142 	}
143 	
144 	/* (non-Javadoc)
145 	 * @see java.lang.Object#toString()
146 	 */
147 	@Override
148 	public String toString() {
149 		return "[" + this.getClass().getCanonicalName() + "]"
150 					+ "\n\tTransport type " + this.getTransportType()
151 					+ "\n\tPhysical address " + this.getPhysicalAddress()
152 					+ "\n\tWrapper type " + this.getWrapperType();
153 	}
154 	
155 
156 }