[Rapforums-developer] src/source/edu/fullcoll/uportal/channels/rap/forum/database RAPDBConfig.java,N
Status: Beta
Brought to you by:
brippe
From: <br...@pr...> - 2004-01-26 18:56:46
|
Update of /cvsroot/rapforums/src/source/edu/fullcoll/uportal/channels/rap/forum/database In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22189 Added Files: RAPDBConfig.java Log Message: Update to version 0.8.3 --- NEW FILE: RAPDBConfig.java --- /** * Copyright (c) 2004, Fullerton College. All Rights Reserved. * (http://www.fullcoll.edu) * * This software is distributed under the IBM Public Licence. Please see * the license infomation for more details at http://www.opensource.org/licenses/ibmpl.php. * EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED * ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER * EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS * OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * Each Recipient is solely responsible for determining the appropriateness of using * and distributing the Program and assumes all risks associated with its exercise * of rights under this Agreement, including but not limited to the risks and costs * of program errors, compliance with applicable laws, damage to or loss of data, * programs or equipment, and unavailability or interruption of operations. * * This software is OSI Certified Open Source Software. * OSI Certified is a certification mark of the Open Source Initiative */ package edu.fullcoll.uportal.channels.rap.forum.database; /** * This class is used to determine the data source configuration for the forums. * Initial versions of the forums required two data sources, one for the portal information * and one for the forums. This is now configurable by setting a channel parameter called * "multiDS=true". If this parameter is set when the channel is published, the channel uses two data * sources, otherwise, the channel uses one datasource. * * @author br...@fu... (Brad Rippe) * @version 0.8.3 $Revision %G% */ public class RAPDBConfig { protected RAPDBConfig(){} /** * Returns an instance of RAPDBConfig */ public static RAPDBConfig getInstance(){ if (instance == null) { instance = new RAPDBConfig(); } return instance; } /** * Returns whether the forums are using multiple data sources * or a single data source. * @return true if using multiple data sources, otherwise false. */ public static boolean isMultiDS() { return multiDS; } /** * Sets whether the are multiple data sources used. * @param mDS - determines whether there are multiple data sources. */ public static void setMultiDS(boolean mDS) { multiDS = mDS; } /** * Returns the database product the forums are currently utilizing. * @return the name of the database product the forums are using: MSSQL, MYSQL or ORACLE. */ public static String getDatabaseProduct() { return dbProduct; } /** * Sets the database product the forums are utilizing, MSSQL, MYSQL, or ORACLE. * The forums default to MSSQL * @param dbProduct the name of the database product being used. */ public static void setDatabaseProduct(String dbP) { if(dbP == null) dbProduct = "MSSQL"; else dbProduct = dbP; } /** * @link * @shapeType PatternLink * @pattern Singleton * @supplierRole Singleton factory */ /*# private RAPDBConfig _singleton; */ private static RAPDBConfig instance = null; private static boolean multiDS = false; private static String dbProduct = "MSSQL"; // default database product is MSSQL } |