package kr.co.i4way.genesys.config;

import java.util.Collection;

import com.genesyslab.platform.applicationblocks.com.ConfigException;
import com.genesyslab.platform.applicationblocks.com.IConfService;
import com.genesyslab.platform.applicationblocks.com.objects.CfgFolder;
import com.genesyslab.platform.applicationblocks.com.queries.CfgFolderQuery;
import com.genesyslab.platform.configuration.protocol.types.CfgObjectType;

public class Folder {
	
	public Folder(){
	}

	public Collection<CfgFolder> SelectCfgFolder(int folderDbid, String folderName, CfgObjectType objtype,
			final IConfService service)
					throws ConfigException, InterruptedException { 
		// Read configuration objects:
		Collection<CfgFolder> folder = null;
		CfgFolderQuery folderquery = new CfgFolderQuery();
		if(folderDbid > 0){
			folderquery.setDbid(folderDbid);
		}
		if(folderName != null){
			folderquery.setName(folderName);
		}
		folderquery.setType(objtype.asInteger());
		folder = service.retrieveMultipleObjects(CfgFolder.class,
				folderquery);
		return folder;
	}
}
