|
8 | 8 | import java.util.concurrent.ThreadFactory;
|
9 | 9 |
|
10 | 10 | public class ConnectionParams {
|
11 |
| - private final String username; |
12 |
| - private final String password; |
13 |
| - private final ExecutorService executor; |
14 |
| - private final String virtualHost; |
15 |
| - private final Map<String, Object> clientProperties; |
16 |
| - private final int requestedFrameMax; |
17 |
| - private final int requestedChannelMax; |
18 |
| - private final int requestedHeartbeat; |
| 11 | + private String username; |
| 12 | + private String password; |
| 13 | + private ExecutorService executor; |
| 14 | + private String virtualHost; |
| 15 | + private Map<String, Object> clientProperties; |
| 16 | + private int requestedFrameMax; |
| 17 | + private int requestedChannelMax; |
| 18 | + private int requestedHeartbeat; |
19 | 19 | private int handshakeTimeout;
|
20 |
| - private final int shutdownTimeout; |
21 |
| - private final SaslConfig saslConfig; |
22 |
| - private final long networkRecoveryInterval; |
23 |
| - private final boolean topologyRecovery; |
24 |
| - |
25 |
| - private final ExceptionHandler exceptionHandler; |
26 |
| - private final ThreadFactory threadFactory; |
27 |
| - |
28 |
| - /** |
29 |
| - * @param username name used to establish connection |
30 |
| - * @param password for <code><b>username</b></code> |
31 |
| - * @param executor thread pool service for consumer threads for channels on this connection |
32 |
| - * @param virtualHost virtual host of this connection |
33 |
| - * @param clientProperties client info used in negotiating with the server |
34 |
| - * @param requestedFrameMax max size of frame offered |
35 |
| - * @param requestedChannelMax max number of channels offered |
36 |
| - * @param requestedHeartbeat heart-beat in seconds offered |
37 |
| - * @param saslConfig sasl configuration hook |
38 |
| - * @param networkRecoveryInterval interval used when recovering from network failure |
39 |
| - * @param topologyRecovery should topology (queues, exchanges, bindings, consumers) recovery be performed? |
40 |
| - * @param threadFactory factory that instantiates threads used by the client |
41 |
| - * @param exceptionHandler handles unhandled consumer exceptions |
42 |
| - */ |
43 |
| <
8000
code class="diff-text syntax-highlighted-line deletion">- public ConnectionParams(String username, String password, ExecutorService executor, |
44 |
| - String virtualHost, Map<String, Object> clientProperties, |
45 |
| - int requestedFrameMax, int requestedChannelMax, int requestedHeartbeat, |
46 |
| - int shutdownTimeout, SaslConfig saslConfig, long networkRecoveryInterval, |
47 |
| - boolean topologyRecovery, ExceptionHandler exceptionHandler, ThreadFactory threadFactory) { |
48 |
| - this.username = username; |
49 |
| - this.password = password; |
50 |
| - this.executor = executor; |
51 |
| - this.virtualHost = virtualHost; |
52 |
| - this.clientProperties = clientProperties; |
53 |
| - this.requestedFrameMax = requestedFrameMax; |
54 |
| - this.requestedChannelMax = requestedChannelMax; |
55 |
| - this.requestedHeartbeat = requestedHeartbeat; |
56 |
| - this.shutdownTimeout = shutdownTimeout; |
57 |
| - this.saslConfig = saslConfig; |
58 |
| - this.networkRecoveryInterval = networkRecoveryInterval; |
59 |
| - this.topologyRecovery = topologyRecovery; |
60 |
| - this.exceptionHandler = exceptionHandler; |
61 |
| - this.threadFactory = threadFactory; |
62 |
| - } |
| 20 | + private int shutdownTimeout; |
| 21 | + private SaslConfig saslConfig; |
| 22 | + private long networkRecoveryInterval; |
| 23 | + private boolean topologyRecovery; |
| 24 | + |
| 25 | + private ExceptionHandler exceptionHandler; |
| 26 | + private ThreadFactory threadFactory; |
| 27 | + |
| 28 | + public ConnectionParams() {} |
63 | 29 |
|
64 | 30 | public String getUsername() {
|
65 | 31 | return username;
|
@@ -121,7 +87,63 @@ public boolean isTopologyRecoveryEnabled() {
|
121 | 87 | return topologyRecovery;
|
122 | 88 | }
|
123 | 89 |
|
124 |
| - public ThreadFactory getThreadFactory() { |
| 90 | + public ThreadFactory getThreadFactory() { |
125 | 91 | return threadFactory;
|
126 | 92 | }
|
| 93 | + |
| 94 | + public void setUsername(String username) { |
| 95 | + this.username = username; |
| 96 | + } |
| 97 | + |
| 98 | + public void setPassword(String password) { |
| 99 | + this.password = password; |
| 100 | + } |
| 101 | + |
| 102 | + public void setExecutor(ExecutorService executor) { |
| 103 | + this.executor = executor; |
| 104 | + } |
| 105 | + |
| 106 | + public void setVirtualHost(String virtualHost) { |
| 107 | + this.virtualHost = virtualHost; |
| 108 | + } |
| 109 | + |
| 110 | + public void setClientProperties(Map<String, Object> clientProperties) { |
| 111 | + this.clientProperties = clientProperties; |
| 112 | + } |
| 113 | + |
| 114 | + public void setRequestedFrameMax(int requestedFrameMax) { |
| 115 | + this.requestedFrameMax = requestedFrameMax; |
| 116 | + } |
| 117 | + |
| 118 | + public void setRequestedChannelMax(int requestedChannelMax) { |
| 119 | + this.requestedChannelMax = requestedChannelMax; |
| 120 | + } |
| 121 | + |
| 122 | + public void setRequestedHeartbeat(int requestedHeartbeat) { |
| 123 | + this.requestedHeartbeat = requestedHeartbeat; |
| 124 | + } |
| 125 | + |
| 126 | + public void setShutdownTimeout(int shutdownTimeout) { |
| 127 | + this.shutdownTimeout = shutdownTimeout; |
| 128 | + } |
| 129 | + |
| 130 | + public void setSaslConfig(SaslConfig saslConfig) { |
| 131 | + this.saslConfig = saslConfig; |
| 132 | + } |
| 133 | + |
| 134 | + public void setNetworkRecoveryInterval(long networkRecoveryInterval) { |
| 135 | + this.networkRecoveryInterval = networkRecoveryInterval; |
| 136 | + } |
| 137 | + |
| 138 | + public void setTopologyRecovery(boolean topologyRecovery) { |
| 139 | + this.topologyRecovery = topologyRecovery; |
| 140 | + } |
| 141 | + |
| 142 | + public void setExceptionHandler(ExceptionHandler exceptionHandler) { |
| 143 | + this.exceptionHandler = exceptionHandler; |
| 144 | + } |
| 145 | + |
| 146 | + public void setThreadFactory(ThreadFactory threadFactory) { |
| 147 | + this.threadFactory = threadFactory; |
| 148 | + } |
127 | 149 | }
|
0 commit comments