1 package gnu.hylafax.pool;
2
3 public class ClientPoolConfiguration {
4
5 private String adminPassword = null;
6
7 private long blockingTimeout = 0;
8
9 private String host = null;
10
11 private long maxIdleTime = 10 * 60 * 1000;
12
13 private long maxNoopTime = 10000;
14
15 private int maxPoolSize = 5;
16
17 private int minPoolSize = 1;
18
19 private String password = null;
20
21 private boolean pooling = true;
22
23 private int port = -1;
24
25 private long retryInterval = 100;
26
27 private String timeZone = null;
28
29 private String userName = null;
30
31 /***
32 * @return the admin password.
33 */
34 public String getAdminPassword() {
35 return adminPassword;
36 }
37
38 /***
39 * @return the blocking timeout in milliseconds.
40 */
41 public long getBlockingTimeout() {
42 return blockingTimeout;
43 }
44
45 /***
46 * @return the host string
47 */
48 public String getHost() {
49 return host;
50 }
51
52 /***
53 * @return the maximum time in milliseconds for a client to be idle before
54 * reopening a connection.
55 */
56 public long getMaxIdleTime() {
57 return maxIdleTime;
58 }
59
60 /***
61 * @return the maximum time in millisecondes for a client to be idle between
62 * noop commands.
63 */
64 public long getMaxNoopTime() {
65 return maxNoopTime;
66 }
67
68 /***
69 * @return the maximum number of clients in the client pool.
70 */
71 public int getMaxPoolSize() {
72 return maxPoolSize;
73 }
74
75 /***
76 * @return the minimum number of clients in the client pool.
77 */
78 public int getMinPoolSize() {
79 return minPoolSize;
80 }
81
82 /***
83 * @return the password.
84 */
85 public String getPassword() {
86 return password;
87 }
88
89 /***
90 * @return the port number to be used.
91 */
92 public int getPort() {
93 return port;
94 }
95
96 /***
97 * @return the number of milliseconds to wait before checking the stack for
98 * a returned client.
99 */
100 public long getRetryInterval() {
101 return retryInterval;
102 }
103
104 /***
105 * @return the time zone string.
106 */
107 public String getTimeZone() {
108 return timeZone;
109 }
110
111 /***
112 * @return the user name.
113 */
114 public String getUserName() {
115 return userName;
116 }
117
118 /***
119 * @return true if pooling is on.
120 */
121 public boolean isPooling() {
122 return pooling;
123 }
124
125 /***
126 * @param adminPassword the administrator password to set.
127 */
128 public void setAdminPassword(String adminPassword) {
129 this.adminPassword = adminPassword;
130 }
131
132 /***
133 * The number of milliseconds to wait for a client before throwing an
134 * exception.
135 * @param blockingTimeout
136 */
137 public void setBlockingTimeout(long blockingTimeout) {
138 this.blockingTimeout = blockingTimeout;
139 }
140
141 /***
142 * @param host the host string.
143 */
144 public void setHost(String host) {
145 this.host = host;
146 }
147
148 /***
149 * @param maxIdleTime the number of milliseconds for idle clients to remain
150 * open before reopening.
151 */
152 public void setMaxIdleTime(long maxIdleTime) {
153 this.maxIdleTime = maxIdleTime;
154 }
155
156 /***
157 * @param maxNoopTime the number of milliseconds for idle clients to wait
158 * between noop commands.
159 */
160 public void setMaxNoopTime(long maxNoopTime) {
161 this.maxNoopTime = maxNoopTime;
162 }
163
164 /***
165 * @param maxPoolSize maximum number of connections to maintain in the pool.
166 */
167 public void setMaxPoolSize(int maxPoolSize) {
168 this.maxPoolSize = maxPoolSize;
169 }
170
171 /***
172 * @param minPoolSize minimum number of connections to maintain in the pool.
173 */
174 public void setMinPoolSize(int minPoolSize) {
175 this.minPoolSize = minPoolSize;
176 }
177
178 /***
179 * @param password the password to set.
180 */
181 public void setPassword(String password) {
182 this.password = password;
183 }
184
185 /***
186 * @param pooling set to true if client pooling is desired.
187 */
188 public void setPooling(boolean pooling) {
189 this.pooling = pooling;
190 }
191
192 /***
193 * @param port the port number to set.
194 */
195 public void setPort(int port) {
196 this.port = port;
197 }
198
199 /***
200 * @param retryInterval the number of milliseconds to wait before rechecking
201 * the pool for returned clients.
202 */
203 public void setRetryInterval(long retryInterval) {
204 this.retryInterval = retryInterval;
205 }
206
207 /***
208 * @param timeZone the timezone string to set.
209 */
210 public void setTimeZone(String timeZone) {
211 this.timeZone = timeZone;
212 }
213
214 /***
215 * @param userName the user name to set.
216 */
217 public void setUserName(String userName) {
218 this.userName = userName;
219 }
220
221 }