alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 * Copyright (c) 2003, Rafael Steil
 * All rights reserved.
 * 
 * Redistribution and use in source and binary forms, 
 * with or without modification, are permitted provided 
 * that the following conditions are met:
 * 
 * 1) Redistributions of source code must retain the above 
 * copyright notice, this list of conditions and the 
 * following  disclaimer.
 * 2)  Redistributions in binary form must reproduce the 
 * above copyright notice, this list of conditions and 
 * the following disclaimer in the documentation and/or 
 * other materials provided with the distribution.
 * 3) Neither the name of "Rafael Steil" nor 
 * the names of its contributors may be used to endorse 
 * or promote products derived from this software without 
 * specific prior written permission.
 * 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 
 * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 
 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 
 * THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 
 * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 
 * IN CONTRACT, STRICT LIABILITY, OR TORT 
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
 * 
 * This file creation date: Mar 3, 2003 / 1:37:05 PM
 * The JForum Project
 * http://www.jforum.net
 */
package net.jforum.model;


/**
 * The class that every driver class must implement.
 * JForum implementation provides a simple and extremely
 * configurable way to use diferent database engines without
 * any modification to the core source code. 
 * <br>
 * For example, if you want to use the Database "XYZ" as
 * backend, all you need to do is to implement <code>DataAccessDriver,
 * all *Model classes and a specific file with the SQL queries. 
 * <br>
 * The default implementation was written to support MySQL, so if you want a base code to
 * analise, look at <code>net.jforum.drivers.generic package.
 * 
 * @author Rafael Steil
 * @version $Id: DataAccessDriver.java,v 1.16 2005/02/22 20:32:36 rafaelsteil Exp $
 */
public abstract class DataAccessDriver 
{
	private static DataAccessDriver driver;
	
	protected DataAccessDriver() {}
	
	/**
	 * Starts the engine.
	 * This method should be called when the system
	 * is starting. 
	 * 
	 * @param implementation The dao.driver implementation
	 */
	public static final void init(DataAccessDriver implementation)
	{
		driver = implementation;
	}
	
	/**
	 * Gets a driver implementation instance. 
	 * You MUST use this method when you want a instance
	 * of a valid <code>DataAccessDriver. Never access
	 * the driver implementation directly.  
	 * 
	 * @return <code>DataAccessDriver instance
	 */
	public final static DataAccessDriver getInstance()
	{
		return driver;
	}
	
	/**
	 * Gets a {@link net.jforum.model.ForumModel} instance. 
	 * 
	 * @return <code>net.jforum.model.ForumModel instance
	 */
	public abstract net.jforum.model.ForumModel newForumModel();
	
	/**
	 * Gets a {@link net.jforum.model.GroupModel} instance
	 * 
	 * @return <code>net.jforum.model.GroupModel instance.
	 */
	public abstract  net.jforum.model.GroupModel newGroupModel();
	
	/**
	 * Gets a {@link net.jforum.model.PostModel} instance.
	 * 
	 * @return <code>net.jforum.model.PostModel instance.
	 */
	public abstract  net.jforum.model.PostModel newPostModel();
	
	/**
	 * Gets a {@link net.jforum.model.RankingModel} instance.
	 * 
	 * @return <code>net.jforum.model.RankingModel instance
	 */
	public abstract  net.jforum.model.RankingModel newRankingModel();
	
	/**
	 * Gets a {@link net.jforum.model.TopicModel} instance.
	 * 
	 * @return <code>net.jforum.model.TopicModel instance.
	 */
	public abstract  net.jforum.model.TopicModel newTopicModel();
	
	/**
	 * Gets an {@link net.jforum.model.UserModel} instance.
	 * 
	 * @return <code>net.jforum.model.UserModel instance.
	 */
	public abstract  net.jforum.model.UserModel newUserModel();
	
	/**
	 * Gets an {@link net.jforum.model.CategoryModel} instance.
	 * 
	 * @return <code>net.jforum.model.CategoryModel instance.
	 */
	public abstract  net.jforum.model.CategoryModel newCategoryModel();
	
	/**
	 * Gets an {@link net.jforum.model.TreeGroupModel} instance
	 * 
	 * @return <code>net.jforum.model.TreeGroupModel instance.
	 */
	public abstract net.jforum.model.TreeGroupModel newTreeGroupModel();

	/**
	 * Gets a {@link net.jforum.model.SmilieModel} instance
	 * 
	 * @return <code>net.jforum.model.SmilieModel instance.
	 */
	public abstract net.jforum.model.SmilieModel newSmilieModel();
	
	/**
	 * Gets a {@link net.jforum.model.SearchModel} instance
	 * 
	 * @return <code>net.jforum.model.SearchModel instance
	 */
	public abstract net.jforum.model.SearchModel newSearchModel();
	
	/**
	 * Gets a {@link net.jforum.model.SearchIndexerModel} instance
	 * 
	 * @return <code>net.jforum.model.SearchIndexerModel instance
	 */
	public abstract net.jforum.model.SearchIndexerModel newSearchIndexerModel();
	
	/**
	 * Gets a {@link net.jforum.model.security.UserSecurityModel} instance
	 * 
	 * @return <code>net.jforum.model.security.UserSecurityModel instance
	 */
	public abstract net.jforum.model.security.UserSecurityModel newUserSecurityModel();
	
	/**
	 * Gets a {@link net.jforum.model.security.GroupSecurityModel} instance
	 * 
	 * @return <code>net.jforum.model.security.GroupSecurityModel instance
	 */
	public abstract net.jforum.model.security.GroupSecurityModel newGroupSecurityModel();

	/**
	 * Gets a {@link net.jforum.model.security.PrivateMessageModel} instance
	 * 
	 * @return <code>link net.jforum.model.security.PrivateMessageModel instance
	 */
	public abstract net.jforum.model.PrivateMessageModel newPrivateMessageModel();
	
	/**
	 * Gets a {@link net.jforum.model.UserSessionModel} instance
	 * 
	 * @return <code>link net.jforum.model.UserSessionModel instance
	 */
	public abstract net.jforum.model.UserSessionModel newUserSessionModel();
	
	/**
	 * Gets a {@link net.jforum.model.ConfigModel} instance
	 * 
	 * @return <code>link net.jforum.model.ConfigModel instance
	 */
	public abstract net.jforum.model.ConfigModel newConfigModel();
	/**
	 * Gets a {@link net.jforum.model.KarmaModel} instance
	 * 
	 * @return <code>link net.jforum.model.KarmaModel instance
	 */
	public abstract net.jforum.model.KarmaModel newKarmaModel();
	
	/**
	 * Gets a {@link net.jforum.model.BookmarkModel} instance
	 * 
	 * @return <code>link net.jforum.model.BookmarkModel instance
	 */
	public abstract net.jforum.model.BookmarkModel newBookmarkModel();
	
	/**
	 * Gets a {@link net.jforum.model.AttachmentModel} instance
	 * 
	 * @return <code>link net.jforum.model.AttachmentModel instance
	 */
	public abstract net.jforum.model.AttachmentModel newAttachmentModel();
	
	/**
	 * Gets a {@link net.jforum.model.ModerationModel} instance
	 * 
	 * @return <code>link net.jforum.model.ModerationModel instance
	 */
	public abstract net.jforum.model.ModerationModel newModerationModel();
}
... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.