package com.etri.groupware;


import com.etri.groupware.organization.*;
import com.etri.groupware.authentication.* ;
import com.etri.groupware.bbs.*;
import com.etri.groupware.eda.*;

import java.util.*;
import java.sql.*;
import java.io.*;

public class GroupwareDBManagerFactory implements GroupwareDBManagerFactoryInterface{

       private OrganizationDBManagerInterface odi;
       private AuthenticationDBManagerInterface adi;
       private BBSDBManagerInterface bdi;
       private EDADBManagerInterface edi;
    
       
       
       public  OrganizationDBManagerInterface createOrganizationDBManager() throws Exception  {
         try{
       	   if( odi == null ) {
       	   	odi = (OrganizationDBManagerInterface)java.lang.Class.forName(GroupwareOptions.OrganizationDBManagerClassName).newInstance();
       	   	
       	   }
       	   return odi;
       	 }catch(ClassNotFoundException e1){
       	 	throw new ClassNotFoundException(GroupwareOptions.OrganizationDBManagerClassName + " 클래스를 찾을 수 없습니다.");
       	 }catch(Exception e){
       	 	throw new Exception("GroupwareController.init(Properties p) 에서 OrganizationDBManagerClassName 프로퍼티를 제대로 설정하십시요.");
       	 }	  
       }	  
       
       public  AuthenticationDBManagerInterface createAuthenticationDBManager() throws Exception  {
         try{
       	   if( adi == null ) {
       	   	adi = (AuthenticationDBManagerInterface)java.lang.Class.forName(GroupwareOptions.AuthenticationDBManagerClassName).newInstance();
       	   	
       	   }
       	   return adi;
       	 }catch(ClassNotFoundException e1){
       	 	throw new ClassNotFoundException(GroupwareOptions.AuthenticationDBManagerClassName + " 클래스를 찾을 수 없습니다.");
       	 }catch(Exception e){
       	 	throw new Exception("GroupwareController.init(Properties p) 에서 AuthenticationDBManagerClassName 프로퍼티를 제대로 설정하십시요.");
       	 }	  
       }	  

       public  BBSDBManagerInterface createBBSDBManager() throws Exception{
         try{
       	   if( bdi == null ) {
       	   	bdi = (BBSDBManagerInterface)java.lang.Class.forName(GroupwareOptions.BBSDBManagerClassName).newInstance();
       	   }
       	   return bdi;
       	 }catch(ClassNotFoundException e1){
       	 	throw new ClassNotFoundException(GroupwareOptions.BBSDBManagerClassName + " 클래스를 찾을 수 없습니다.");
       	 }catch(Exception e){
       	 	throw new Exception("GroupwareController.init(Properties p) 에서 BBSDBManagerClassName 프로퍼티를 제대로 설정하십시요.");
       	 }			  
       }	   
       
       
       public  EDADBManagerInterface createEDADBManager() throws Exception {
         try{
       	   if( edi == null ) {
       	   	edi = (EDADBManagerInterface)java.lang.Class.forName(GroupwareOptions.EDADBManagerClassName).newInstance();
       	   }
       	   return edi;
       	 }catch(ClassNotFoundException e1){
       	 	throw new ClassNotFoundException(GroupwareOptions.EDADBManagerClassName + " 클래스를 찾을 수 없습니다.");
       	 }catch(Exception e){
       	 	throw new Exception("GroupwareController.init(Properties p) 에서 EDADBManagerClassName 프로퍼티를 제대로 설정하십시요.");
       	 }		       	   
       }	    
       
 
              
}              