package com.eactive.eai.inbound.remote;

import com.eactive.eai.common.dao.DAOFactory;

import java.util.ArrayList;

public class RemoteDirectoryManager
{

	//singleton 객체 생성
	private static RemoteDirectoryManager instance = new RemoteDirectoryManager();
	//singleton 객체 리턴
    public static RemoteDirectoryManager getInstance() {
        return instance;
    }

	//생성자 (다른 클래스에서 new 불가)
	private RemoteDirectoryManager() {}



	public RemoteDirectoryVO detailRemoteDirectory(String remoteDirId) throws Exception {
		RemoteDirectoryDAO dao = (RemoteDirectoryDAO)DAOFactory.newInstance().create(RemoteDirectoryDAO.class);
        ArrayList<RemoteDirectoryVO> alist = dao.selectRemoteDirectory("", "DIRECTORY_ID", remoteDirId);
		if (alist.size() == 0) return null;
		return (RemoteDirectoryVO) alist.get(0);
	}

	public ArrayList<RemoteDirectoryVO> searchRemoteDirectory(String searchProcessCode, String searchType, String searchText) throws Exception {
		RemoteDirectoryDAO dao = (RemoteDirectoryDAO)DAOFactory.newInstance().create(RemoteDirectoryDAO.class);
        return dao.selectRemoteDirectory(searchProcessCode, searchType, searchText);
	}

//	public int insertRemoteDirectory(RemoteDirectoryVO remoteDirectoryVO) throws Exception {
//		RemoteDirectoryDAO dao = (RemoteDirectoryDAO)DAOFactory.newInstance().create(RemoteDirectoryDAO.class);
//        return dao.insertRemoteDirectory(remoteDirectoryVO);
//	}
//
//	public int updatetRemoteDirectory(RemoteDirectoryVO remoteDirectoryVO) throws Exception {
//		RemoteDirectoryDAO dao = (RemoteDirectoryDAO)DAOFactory.newInstance().create(RemoteDirectoryDAO.class);
//        return dao.updatetRemoteDirectory(remoteDirectoryVO);
//	}
//
//	public int deletetRemoteDirectory(String remoteDirId) throws Exception {
//		RemoteDirectoryDAO dao = (RemoteDirectoryDAO)DAOFactory.newInstance().create(RemoteDirectoryDAO.class);
//        return dao.deleteRemoteDirectory(remoteDirId);
//	}

}
