001: /*
002: * $Header: /export/home/cvsroot/MyPersonalizerRepository/MyPersonalizer/Subsystems/Kernel/Sources/es/udc/mypersonalizer/kernel/config/ConnectionPoolAdapterSingletonConfig.java,v 1.1.1.1 2004/03/25 12:08:38 fbellas Exp $
003: * $Revision: 1.1.1.1 $
004: * $Date: 2004/03/25 12:08:38 $
005: *
006: * =============================================================================
007: *
008: * Copyright (c) 2003, The MyPersonalizer Development Group
009: * (http://www.tic.udc.es/~fbellas/mypersonalizer/index.html) at
010: * University Of A Coruna
011: * All rights reserved.
012: *
013: * Redistribution and use in source and binary forms, with or without
014: * modification, are permitted provided that the following conditions are met:
015: *
016: * - Redistributions of source code must retain the above copyright notice,
017: * this list of conditions and the following disclaimer.
018: *
019: * - Redistributions in binary form must reproduce the above copyright notice,
020: * this list of conditions and the following disclaimer in the documentation
021: * and/or other materials provided with the distribution.
022: *
023: * - Neither the name of the University Of A Coruna nor the names of its
024: * contributors may be used to endorse or promote products derived from
025: * this software without specific prior written permission.
026: *
027: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
028: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
029: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
030: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
031: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
032: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
033: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
034: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
035: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
036: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
037: * POSSIBILITY OF SUCH DAMAGE.
038: *
039: */
040:
041: package es.udc.mypersonalizer.kernel.config;
042:
043: /**
044: * This is the configuration bean for the ConnectionPoolAdapterSingleton, which
045: * carries the database connection configuration and takes its data from the
046: * <code>connection-pool-adapter-singleton</code> tag in the Kernel configuration
047: * file.
048: *
049: * @author Daniel Fernandez
050: * @since 1.0
051: */
052: public class ConnectionPoolAdapterSingletonConfig {
053:
054: /**
055: * The name of the class implementing ConnectionPoolAdapterSingleton.
056: */
057: private String className = null;
058:
059: /**
060: * The name of the database driver to use for the specified database.
061: */
062: private String connectionDriver = null;
063:
064: /**
065: * The JDBC connection URL which identifies the database to use.
066: */
067: private String connectionURL = null;
068:
069: /**
070: * The name of the user in whose name the connections to the database
071: * will be made.
072: */
073: private String connectionUser = null;
074:
075: /**
076: * The password to use when the connection is established.
077: */
078: private String connectionPassword = null;
079:
080: /**
081: * Time out (in seconds) for the expiration of connections.
082: */
083: private String connectionWaitTimeOutSeconds = null;
084:
085: /**
086: * Maximum number of connections to the database that the pool will handle.
087: */
088: private String connectionMaximumNumber = null;
089:
090: /**
091: * A SQL query that will be used to validate connections from the pool
092: * before returning them to the caller. If specified, this query
093: * <b>must</b> be an SQL <code>SELECT</code> statement that returns at
094: * least one row.
095: */
096: private String connectionPingQuery = null;
097:
098: /**
099: * Creates a new instance of ConnectionPoolAdapterSingletonConfig.
100: */
101: public ConnectionPoolAdapterSingletonConfig() {
102: }
103:
104: /**
105: * Returns the name of the class implementing the
106: * <code>ConnectionPoolAdapterSingleton</code>.
107: *
108: * @return a String with the class name
109: */
110: public String getClassName() {
111: return className;
112: }
113:
114: /**
115: * Sets a new class name for the class implementing
116: * <code>ConnectionPoolAdapterSingleton</code>.
117: *
118: * @param className the new class name
119: */
120: public void setClassName(String className) {
121: this .className = className;
122: }
123:
124: /**
125: * Returns the name of the driver that will be used to connect to the
126: * database.
127: *
128: * @return a String with the driver name
129: */
130: public String getConnectionDriver() {
131: return connectionDriver;
132: }
133:
134: /**
135: * Sets a new driver to be used to connect to the database.
136: *
137: * @param connectionDriver the name of the driver
138: */
139: public void setConnectionDriver(String connectionDriver) {
140: this .connectionDriver = connectionDriver;
141: }
142:
143: /**
144: * Returns the JDBC URL identifying the database to be used.
145: *
146: * @return a String with the JDBC URL
147: */
148: public String getConnectionURL() {
149: return connectionURL;
150: }
151:
152: /**
153: * Sets a new JDBC URL for the database to be used.
154: *
155: * @param connectionURL the new JDBC URL
156: */
157: public void setConnectionURL(String connectionURL) {
158: this .connectionURL = connectionURL;
159: }
160:
161: /**
162: * Returns the user name to be used in database connections.
163: *
164: * @return a String with the user name.
165: */
166: public String getConnectionUser() {
167: return connectionUser;
168: }
169:
170: /**
171: * Sets a new user name for the database connections.
172: *
173: * @param connectionUser the new user name.
174: */
175: public void setConnectionUser(String connectionUser) {
176: this .connectionUser = connectionUser;
177: }
178:
179: /**
180: * Returns the connection password for database connections.
181: *
182: * @return a String with the password.
183: */
184: public String getConnectionPassword() {
185: return connectionPassword;
186: }
187:
188: /**
189: * Sets a new password for database connections.
190: *
191: * @param connectionPassword the new connection password.
192: */
193: public void setConnectionPassword(String connectionPassword) {
194: this .connectionPassword = connectionPassword;
195: }
196:
197: /**
198: * Returns the timeout period in seconds for connections to stay unused.
199: *
200: * @return a String with the value of the time out parameter.
201: */
202: public String getConnectionWaitTimeOutSeconds() {
203: return connectionWaitTimeOutSeconds;
204: }
205:
206: /**
207: * Sets a new timeout in seconds for connections
208: *
209: * @param connectionWaitTimeOutSeconds a String containing the
210: * new time out in seconds.
211: */
212: public void setConnectionWaitTimeOutSeconds(
213: String connectionWaitTimeOutSeconds) {
214: this .connectionWaitTimeOutSeconds = connectionWaitTimeOutSeconds;
215: }
216:
217: /**
218: * Returns the maximum number of connections that the pool will handle.
219: *
220: * @return a String with the maximum number of connections to be handled.
221: */
222: public String getConnectionMaximumNumber() {
223: return connectionMaximumNumber;
224: }
225:
226: /**
227: * Sets a new number of connections to be handled by the pool.
228: *
229: * @param connectionMaximumNumber the new number of connections.
230: */
231: public void setConnectionMaximumNumber(
232: String connectionMaximumNumber) {
233: this .connectionMaximumNumber = connectionMaximumNumber;
234: }
235:
236: /**
237: * Returns the SQL SELECT statement that will be used to validate
238: * connections in the pool.
239: *
240: * @return a String with the SQL SELECT statement being used.
241: */
242: public String getConnectionPingQuery() {
243: return connectionPingQuery;
244: }
245:
246: /**
247: * Sets a new SQL SELECT statement to ping the database connections
248: * with validating purposes.
249: *
250: * @param connectionPingQuery the new SQL statement.
251: */
252: public void setConnectionPingQuery(String connectionPingQuery) {
253: this.connectionPingQuery = connectionPingQuery;
254: }
255:
256: }
|