1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.endpoint; |
12 | |
|
13 | |
import org.mule.api.MuleContext; |
14 | |
import org.mule.api.MuleMessage; |
15 | |
import org.mule.api.endpoint.EndpointURI; |
16 | |
import org.mule.api.endpoint.InboundEndpoint; |
17 | |
import org.mule.api.routing.filter.Filter; |
18 | |
import org.mule.api.security.EndpointSecurityFilter; |
19 | |
import org.mule.api.transaction.TransactionConfig; |
20 | |
import org.mule.api.transport.ConnectionStrategy; |
21 | |
import org.mule.api.transport.Connector; |
22 | |
|
23 | |
import java.util.List; |
24 | |
import java.util.Map; |
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
public class DynamicURIInboundEndpoint implements InboundEndpoint |
30 | |
{ |
31 | |
|
32 | |
private static final long serialVersionUID = -2814979100270307813L; |
33 | |
|
34 | |
private InboundEndpoint endpoint; |
35 | |
private EndpointURI dynamicEndpointURI; |
36 | |
|
37 | |
public DynamicURIInboundEndpoint(InboundEndpoint endpoint) |
38 | 0 | { |
39 | 0 | this.endpoint = endpoint; |
40 | 0 | } |
41 | |
|
42 | |
public DynamicURIInboundEndpoint(InboundEndpoint endpoint, EndpointURI dynamicEndpointURI) |
43 | 0 | { |
44 | 0 | this.endpoint = endpoint; |
45 | 0 | setEndpointURI(dynamicEndpointURI); |
46 | 0 | } |
47 | |
|
48 | |
public EndpointURI getEndpointURI() |
49 | |
{ |
50 | 0 | if (dynamicEndpointURI != null) |
51 | |
{ |
52 | 0 | return dynamicEndpointURI; |
53 | |
} |
54 | |
else |
55 | |
{ |
56 | 0 | return endpoint.getEndpointURI(); |
57 | |
} |
58 | |
} |
59 | |
|
60 | |
public void setEndpointURI(EndpointURI dynamicEndpointURI) |
61 | |
{ |
62 | 0 | this.dynamicEndpointURI = dynamicEndpointURI; |
63 | 0 | } |
64 | |
|
65 | |
public ConnectionStrategy getConnectionStrategy() |
66 | |
{ |
67 | 0 | return endpoint.getConnectionStrategy(); |
68 | |
} |
69 | |
|
70 | |
public Connector getConnector() |
71 | |
{ |
72 | 0 | return endpoint.getConnector(); |
73 | |
} |
74 | |
|
75 | |
public String getEncoding() |
76 | |
{ |
77 | 0 | return endpoint.getEncoding(); |
78 | |
} |
79 | |
|
80 | |
public Filter getFilter() |
81 | |
{ |
82 | 0 | return endpoint.getFilter(); |
83 | |
} |
84 | |
|
85 | |
public String getInitialState() |
86 | |
{ |
87 | 0 | return endpoint.getInitialState(); |
88 | |
} |
89 | |
|
90 | |
public MuleContext getMuleContext() |
91 | |
{ |
92 | 0 | return endpoint.getMuleContext(); |
93 | |
} |
94 | |
|
95 | |
public String getName() |
96 | |
{ |
97 | 0 | return endpoint.getName(); |
98 | |
} |
99 | |
|
100 | |
public Map getProperties() |
101 | |
{ |
102 | 0 | return endpoint.getProperties(); |
103 | |
} |
104 | |
|
105 | |
public Object getProperty(Object key) |
106 | |
{ |
107 | 0 | return endpoint.getProperty(key); |
108 | |
} |
109 | |
|
110 | |
public String getProtocol() |
111 | |
{ |
112 | 0 | return endpoint.getProtocol(); |
113 | |
} |
114 | |
|
115 | |
public int getRemoteSyncTimeout() |
116 | |
{ |
117 | 0 | return endpoint.getRemoteSyncTimeout(); |
118 | |
} |
119 | |
|
120 | |
public List getResponseTransformers() |
121 | |
{ |
122 | 0 | return endpoint.getResponseTransformers(); |
123 | |
} |
124 | |
|
125 | |
public EndpointSecurityFilter getSecurityFilter() |
126 | |
{ |
127 | 0 | return endpoint.getSecurityFilter(); |
128 | |
} |
129 | |
|
130 | |
public TransactionConfig getTransactionConfig() |
131 | |
{ |
132 | 0 | return endpoint.getTransactionConfig(); |
133 | |
} |
134 | |
|
135 | |
public List getTransformers() |
136 | |
{ |
137 | 0 | return endpoint.getTransformers(); |
138 | |
} |
139 | |
|
140 | |
public boolean isDeleteUnacceptedMessages() |
141 | |
{ |
142 | 0 | return endpoint.isDeleteUnacceptedMessages(); |
143 | |
} |
144 | |
|
145 | |
public boolean isReadOnly() |
146 | |
{ |
147 | 0 | return endpoint.isReadOnly(); |
148 | |
} |
149 | |
|
150 | |
public boolean isRemoteSync() |
151 | |
{ |
152 | 0 | return endpoint.isRemoteSync(); |
153 | |
} |
154 | |
|
155 | |
public boolean isSynchronous() |
156 | |
{ |
157 | 0 | return endpoint.isSynchronous(); |
158 | |
} |
159 | |
|
160 | |
public MuleMessage request(long timeout) throws Exception |
161 | |
{ |
162 | 0 | return endpoint.request(timeout); |
163 | |
} |
164 | |
|
165 | |
public int hashCode() |
166 | |
{ |
167 | 0 | final int prime = 31; |
168 | 0 | int result = 1; |
169 | 0 | result = prime * result + ((dynamicEndpointURI == null) ? 0 : dynamicEndpointURI.hashCode()); |
170 | 0 | result = prime * result + ((endpoint == null) ? 0 : endpoint.hashCode()); |
171 | 0 | return result; |
172 | |
} |
173 | |
|
174 | |
public boolean equals(Object obj) |
175 | |
{ |
176 | 0 | if (this == obj) return true; |
177 | 0 | if (obj == null) return false; |
178 | 0 | if (getClass() != obj.getClass()) return false; |
179 | 0 | final DynamicURIInboundEndpoint other = (DynamicURIInboundEndpoint) obj; |
180 | 0 | if (dynamicEndpointURI == null) |
181 | |
{ |
182 | 0 | if (other.dynamicEndpointURI != null) return false; |
183 | |
} |
184 | 0 | else if (!dynamicEndpointURI.equals(other.dynamicEndpointURI)) return false; |
185 | 0 | if (endpoint == null) |
186 | |
{ |
187 | 0 | if (other.endpoint != null) return false; |
188 | |
} |
189 | 0 | else if (!endpoint.equals(other.endpoint)) return false; |
190 | 0 | return true; |
191 | |
} |
192 | |
|
193 | |
} |