1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
package org.mule.endpoint; |
8 | |
|
9 | |
import org.mule.api.MuleContext; |
10 | |
import org.mule.api.endpoint.EndpointException; |
11 | |
import org.mule.api.endpoint.EndpointURI; |
12 | |
import org.mule.api.endpoint.ImmutableEndpoint; |
13 | |
import org.mule.api.processor.MessageProcessor; |
14 | |
|
15 | |
import java.util.Collections; |
16 | |
|
17 | |
public class EndpointURIEndpointBuilder extends AbstractEndpointBuilder |
18 | |
{ |
19 | |
|
20 | |
public EndpointURIEndpointBuilder() |
21 | |
{ |
22 | 0 | super(); |
23 | 0 | } |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
public EndpointURIEndpointBuilder(EndpointURIEndpointBuilder global) throws EndpointException |
31 | |
{ |
32 | 0 | super(); |
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | 0 | uriBuilder = global.uriBuilder; |
38 | 0 | connector = global.connector; |
39 | 0 | name = global.name; |
40 | |
|
41 | 0 | properties = global.properties; |
42 | 0 | transactionConfig = global.transactionConfig; |
43 | 0 | deleteUnacceptedMessages = global.deleteUnacceptedMessages; |
44 | 0 | synchronous = global.synchronous; |
45 | 0 | messageExchangePattern = global.messageExchangePattern; |
46 | 0 | responseTimeout = global.responseTimeout; |
47 | 0 | encoding = global.encoding; |
48 | 0 | retryPolicyTemplate = global.retryPolicyTemplate; |
49 | 0 | messageProcessors = global.messageProcessors; |
50 | 0 | responseMessageProcessors = global.responseMessageProcessors; |
51 | 0 | mimeType = global.mimeType; |
52 | 0 | disableTransportTransformer = global.disableTransportTransformer; |
53 | 0 | transformers = global.transformers; |
54 | 0 | responseTransformers = global.responseTransformers; |
55 | |
|
56 | 0 | } |
57 | |
|
58 | |
public EndpointURIEndpointBuilder(URIBuilder builder) |
59 | |
{ |
60 | 0 | super(); |
61 | 0 | this.uriBuilder = builder; |
62 | 0 | this.muleContext = builder.getMuleContext(); |
63 | 0 | } |
64 | |
|
65 | |
public EndpointURIEndpointBuilder(String address, MuleContext muleContext) |
66 | |
{ |
67 | 0 | this(new URIBuilder(address, muleContext)); |
68 | 0 | } |
69 | |
|
70 | |
protected EndpointURIEndpointBuilder(EndpointURI endpointURI) |
71 | |
{ |
72 | 0 | this(new URIBuilder(endpointURI)); |
73 | 0 | } |
74 | |
|
75 | |
public EndpointURIEndpointBuilder(ImmutableEndpoint source) |
76 | |
{ |
77 | 0 | this(source.getEndpointURI()); |
78 | 0 | setName(source.getName()); |
79 | 0 | setEncoding(source.getEncoding()); |
80 | 0 | setConnector(source.getConnector()); |
81 | 0 | setProperties(source.getProperties()); |
82 | 0 | setTransactionConfig(source.getTransactionConfig()); |
83 | 0 | setDeleteUnacceptedMessages(source.isDeleteUnacceptedMessages()); |
84 | 0 | setInitialState(source.getInitialState()); |
85 | 0 | setResponseTimeout(source.getResponseTimeout()); |
86 | 0 | setRetryPolicyTemplate(source.getRetryPolicyTemplate()); |
87 | 0 | setExchangePattern(source.getExchangePattern()); |
88 | 0 | setMuleContext(source.getMuleContext()); |
89 | 0 | setMessageProcessors(source.getMessageProcessors().isEmpty() ? Collections.<MessageProcessor>emptyList() : source.getMessageProcessors()); |
90 | 0 | setResponseMessageProcessors(source.getResponseMessageProcessors().isEmpty() ? Collections.<MessageProcessor>emptyList() : source.getResponseMessageProcessors()); |
91 | 0 | setDisableTransportTransformer(source.isDisableTransportTransformer()); |
92 | 0 | setMimeType(source.getMimeType()); |
93 | 0 | } |
94 | |
} |