1 /*** 2 * Jetrix TetriNET Server 3 * Copyright (C) 2008 Emmanuel Bourg 4 * 5 * This program is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU General Public License 7 * as published by the Free Software Foundation; either version 2 8 * of the License, or (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 */ 19 20 package net.jetrix.config; 21 22 import net.jetrix.DataSourceManager; 23 24 /*** 25 * Configuration for a pool of connections to a database. 26 * 27 * @author Emmanuel Bourg 28 * @version $Revision: 797 $, $Date: 2009-02-18 15:03:17 +0100 (Wed, 18 Feb 2009) $ 29 * @since 0.3 30 */ 31 public class DataSourceConfig 32 { 33 private String name = DataSourceManager.DEFAULT_DATASOURCE; 34 private String url; 35 private String driver; 36 private String username; 37 private String password; 38 private int minIdle = DataSourceManager.DEFAULT_MIN_IDLE; 39 private int maxActive = DataSourceManager.DEFAULT_MAX_ACTIVE; 40 41 /*** 42 * Tells if this datasource is the default datasource. 43 */ 44 public boolean isDefault() 45 { 46 return DataSourceManager.DEFAULT_DATASOURCE.equals(name); 47 } 48 49 public String getName() 50 { 51 return name; 52 } 53 54 public void setName(String name) 55 { 56 this.name = name; 57 } 58 59 public String getUrl() 60 { 61 return url; 62 } 63 64 public void setUrl(String url) 65 { 66 this.url = url; 67 } 68 69 public String getDriver() 70 { 71 return driver; 72 } 73 74 public void setDriver(String driver) 75 { 76 this.driver = driver; 77 } 78 79 public String getUsername() 80 { 81 return username; 82 } 83 84 public void setUsername(String username) 85 { 86 this.username = username; 87 } 88 89 public String getPassword() 90 { 91 return password; 92 } 93 94 public void setPassword(String password) 95 { 96 this.password = password; 97 } 98 99 public int getMinIdle() 100 { 101 return minIdle; 102 } 103 104 public void setMinIdle(int minIdle) 105 { 106 this.minIdle = minIdle; 107 } 108 109 public int getMaxActive() 110 { 111 return maxActive; 112 } 113 114 public void setMaxActive(int maxActive) 115 { 116 this.maxActive = maxActive; 117 } 118 }