/* 
    IntraPMS Project
    OrganizationManagementController

    
*/

package com.etri.groupware.organization ;

public class OrganizationManagementController implements OrganizationManagementControllerInterface {
	
	
	private static OrganizationManagementController oc = null;
	
	// 시스템 데이타 베이스 접근
	private static OrganizationDBManagerInterface odbm = null ;
	
	// 생성자를 private으로 만들어서 밖으로부터의 접근을 막는다.
	private OrganizationManagementController ( ) { }
		
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: init<br>
	 [기능]: OrganizationManagementController를 Singlton으로 리턴한다.<br>
	 [파라미터]: OrganizationDBManagerInterface db<br>
	 [호출자] : GroupwareController<br>
	 */
	/*--------------------------------------------------------------- */
	public static OrganizationManagementController init ( OrganizationDBManagerInterface db ) { 
		if(oc == null){
			odbm = db ;
			odbm.init();
			oc = new OrganizationManagementController ( ) ;
		}
		return oc;	
	}
	
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: getOrganizationTree<br>
	 [기능]: 부서와 팀을 리턴한다. <br>
	 [파라미터]: 없음<br>
	 [호출자] : ShowOrganizationTreeServlet<br>
	 */
	/*--------------------------------------------------------------- */		
	public String[][] getOrganizationTree ( ) { 
		return odbm.getOrganizationTree ( ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: getAllDepartment<br>
	 [기능]: 존재하는 모든 부서를 리턴한다. <br>
	 [파라미터]: 없음<br>
	 [호출자] : ShowAllDepartmentServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public Department[] getAllDepartment ( ) { 
		return odbm.getAllDepartment ( ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: getAllTeam<br>
	 [기능]: 부서에 존재하는 모든 팀을 리턴한다. <br>
	 [파라미터]: Department d<br>
	 [호출자] : ShowAllTeamServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public Team[] getAllTeam ( Department d ) { 
		return odbm.getAllTeam ( d ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: getAllOfficial<br>
	 [기능]: 팀에 존재하는 모든 사원을 리턴한다. <br>
	 [파라미터]: Team t<br>
	 [호출자] : ShowAllOfficialServlet<br>
	 */
	/*--------------------------------------------------------------- */		
	public Official[] getAllOfficial ( Team t )  {
		return odbm.getAllOfficial ( t ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: addDepartment<br>
	 [기능]: 새로운 부서를 생성한다. <br>
	 [파라미터]: Department d<br>
	 [호출자] : ShowAllDepartmentServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public OrganizationResultStatus addDepartment ( Department d ) {
		return odbm.addDepartment ( d ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: deleteDepartment<br>
	 [기능]: 존재하는 부서를 삭제한다. <br>
	 [파라미터]: Department d<br>
	 [호출자] : ShowAllDepartmentServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public OrganizationResultStatus deleteDepartment ( Department d ) {
		return odbm.deleteDepartment ( d ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: updateDepartment<br>
	 [기능]: 존재하는 부서를 변경한다. <br>
	 [파라미터]: Department d<br>
	 [호출자] : ShowAllDepartmentServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public OrganizationResultStatus updateDepartment ( Department d ) {
		return odbm.updateDepartment ( d ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: searchDepartment<br>
	 [기능]: 부서 검색 조건을 넘겨 받아서 부서를 검색한 후 부서 검색 결과를 리턴한다. <br>
	 [파라미터]: DepartmentSearchProperty dsp<br>
	 [호출자] : ShowAllDepartmentServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public Department[] searchDepartment ( DepartmentSearchProperty dsp )  { 
		return odbm.searchDepartment ( dsp ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: addTeam<br>
	 [기능]: 새로운 팀을 생성한다. <br>
	 [파라미터]: Team t<br>
	 [호출자] : ShowAllTeamServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public OrganizationResultStatus addTeam ( Team t ) {
		return odbm.addTeam ( t ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: deleteTeam<br>
	 [기능]: 팀을 삭제한다. <br>
	 [파라미터]: Team t<br>
	 [호출자] : ShowAllTeamServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public OrganizationResultStatus deleteTeam ( Team t ) {
		return odbm.deleteTeam ( t ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: updateTeam<br>
	 [기능]: 팀의 정보를 변경한다. <br>
	 [파라미터]: Team t<br>
	 [호출자] : ShowAllTeamServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public OrganizationResultStatus updateTeam ( Team t ) { 
		return odbm.updateTeam ( t ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: searchTeam<br>
	 [기능]: 검색 조건을 만족하는 팀을 검색한다. <br>
	 [파라미터]: TeamSearchProperty tsp<br>
	 [호출자] : ShowAllTeamServlet<br>
	 */
	/*--------------------------------------------------------------- */	
	public Team[] searchTeam ( TeamSearchProperty tsp )  {
		return odbm.searchTeam ( tsp ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: addOfficial<br>
	 [기능]: 새로운 사원을 등록한다. <br>
	 [파라미터]: Official o<br>
	 [호출자] : ShowAllOfficialServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public OrganizationResultStatus addOfficial ( Official o ) {
		return odbm.addOfficial ( o ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: deleteOfficial<br>
	 [기능]: 사원을 삭제한다. <br>
	 [파라미터]: Official o<br>
	 [호출자] : ShowAllOfficialServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public OrganizationResultStatus deleteOfficial ( Official o ) {
		return odbm.deleteOfficial ( o ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: updateOfficial<br>
	 [기능]: 사원의 정보를 업데이트 한다. <br>
	 [파라미터]: Official o<br>
	 [호출자] : ShowAllOfficialServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public OrganizationResultStatus updateOfficial ( Official o ) {
		return odbm.updateOfficial ( o ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: searchOfficial<br>
	 [기능]: 검색 조건을 만족하는 사원을 검색한다. <br>
	 [파라미터]: OfficialSearchProperty osp<br>
	 [호출자] : ShowAllOfficialServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public Official[] searchOfficial ( OfficialSearchProperty osp ) {
		return odbm.searchOfficial ( osp ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: changeDepartment<br>
	 [기능]: 사원의 부서와 팀을 변경한다. ( 부서 발령 )<br>
	 [파라미터]: String id , String department , String team , String orders<br>
	 [호출자] : ShowAllOfficialServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public OrganizationResultStatus changeDepartment ( String id , String department , String team , String orders ) {
		return odbm.changeDepartment ( id , department , team , orders ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: getComOfficial<br>
	 [기능]: 부서가 존재하지 않는 사원을 리턴한다.<br>
	 [파라미터]: 없음<br>
	 [호출자] : ShowOrganizationTreeServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public Official[] getComOfficial ( ) {
		return odbm.getComOfficial ( ) ;
	}
	
	/*----------------------------------------------------------------- */
	/**
	 [메소드이름]: getDepOfficial<br>
	 [기능]: 부서는 존재하지만 팀이 존재하지 않는 사원을 리턴한다.<br>
	 [파라미터]: 없음<br>
	 [호출자] : ShowOrganizationTreeServlet<br>
	 */
	/*--------------------------------------------------------------- */
	public Official[] getDepOfficial ( ) {
		return odbm.getDepOfficial ( ) ;
	}
	
}