package com.eactive.eai.agent.adapter; import com.eactive.eai.adapter.AdapterGroupVO; import com.eactive.eai.adapter.AdapterManager; import com.eactive.eai.agent.command.Command; import com.eactive.eai.agent.command.CommandException; import com.eactive.eai.common.util.Logger; /** * 1. 기능 : Running중인 EAI Server의 메모리에 로딩된 AdapterManager의 정보 변경 * 2. 처리 개요 : AdapterGroupVO를 manager에서 remove * 3. 주의사항 * * @author * @version v 1.0.0 * @see 관련 기능을 참조 * @since */ public class RemoveAdapterGroupCommand extends Command { /** * */ private static final long serialVersionUID = 1L; /** * 1. 기능 : RemoveAdapterGroupCommand 생성자 * 2. 처리 개요 : * 3. 주의사항 * **/ public RemoveAdapterGroupCommand(String name) { super(name); } /** * 1. 기능 : AdapterManager에 AdapterGroupVO를 제거 * 2. 처리 개요 : AdapterGroupVO의 EAISvrInstNm이 DEFAULT_SERVER(ALL) 이거나 LocalServer인 경우 * AdapterManager에 등록된 해당 AdapterGroupVO를 제거 * 3. 주의사항 * * @exception CommandException Argument Type이 다르거나 Command 수행중 Excpetion이 발생할 경우 **/ public Object execute() throws CommandException { Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT); logger.info(this.name + " Agent 가 호출되었습니다."); if ( args == null || !(args instanceof String) ) { String msg = makeException("BECEAICAG001", null); logger.error(msg); throw new CommandException(msg); } try { String adapterGroupName = (String)args; logger.debug("adapterGroupName : "+adapterGroupName ); AdapterGroupVO gvo = AdapterManager.getInstance().getAdapterGroupVO(adapterGroupName); if (gvo != null) { gvo.stop(); AdapterManager.getInstance().removeAdapterGroupVO(adapterGroupName); } logger.info(this.name + " Agent 가 성공적으로 완료되었습니다."); return "sucess"; } catch (Exception e) { String msg = makeException("BECEAICAG002", e); logger.error(msg, e); throw new CommandException(msg); } } }