1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package gnu.hylafax;
25
26 import gnu.hylafax.pool.ClientPoolException;
27
28 /***
29 * @author <a href="mailto:steve@mjnservices.com">Steven Jardine </a>
30 */
31 public interface ClientPool {
32
33 /***
34 * Retrieve a client from the client pool. If the pool is empty or all
35 * connections are being used this function will block for
36 * <code>blockingTimeout</code> milli-seconds and then throw an exception.
37 *
38 * @return A client from the client pool.
39 */
40 public Client getClient() throws ClientPoolException;
41
42 /***
43 * Get the username that has been designated for use in creating client
44 * connections.
45 *
46 * @return the username being used to connect to the client pool.
47 */
48 public String getUserName() throws ClientPoolException;
49
50 /***
51 * Sets the username to be used to connect clients to the server.
52 *
53 * @param userName
54 * The usename to be used for client connections.
55 */
56 public void setUserName(String userName) throws ClientPoolException;
57
58 /***
59 * Sets the password to be used to connect clients to the server. If the
60 * password is "" or <code>null</code> it will not be used to connect.
61 *
62 * @param password
63 */
64 public void setPassword(String password) throws ClientPoolException;
65
66 /***
67 * @return the number of milli-seconds the pool will wait for an available
68 * connection prior to throwing an exception.
69 */
70 public long getBlockingTimeout() throws ClientPoolException;
71
72 /***
73 * Sets the number of milli-seconds to wait for an available connection.
74 *
75 * @param blockingTimeout
76 * the number of milli-seconds the pool will wait for an
77 * available connection prior to throwing an exception.
78 */
79 public void setBlockingTimeout(long blockingTimeout)
80 throws ClientPoolException;
81
82 /***
83 * @return the maximum number of clients allowed by the client pool.
84 */
85 public int getMaxPoolSize() throws ClientPoolException;
86
87 /***
88 * Sets the maximum number of clients allowed by the client pool.
89 *
90 * @param maxPoolSize
91 */
92 public void setMaxPoolSize(int maxPoolSize) throws ClientPoolException;
93
94 /***
95 * @return the minimum number of clients in the pool.
96 */
97 public int getMinPoolSize() throws ClientPoolException;
98
99 /***
100 * Sets the minimum number of clients to initialize the pool with.
101 *
102 * @param minPoolSize
103 */
104 public void setMinPoolSize(int minPoolSize) throws ClientPoolException;
105
106 /***
107 * @return the number of milli-seconds of client inactivity before sending a
108 * noop command.
109 */
110 public long getNoopInterval() throws ClientPoolException;
111
112 /***
113 * Sets the number of milli-seconds of client inactivity before sending a
114 * noop command to the server.
115 *
116 * @param noopInterval
117 */
118 public void setNoopInterval(long noopInterval) throws ClientPoolException;
119
120 }