package com.eactive.eai.agent.rule.dirInfo;

import com.eactive.eai.agent.command.Command;
import com.eactive.eai.agent.command.CommandException;
import com.eactive.eai.batch.rule.dirInfo.DirInfoManager;
import com.eactive.eai.common.util.Logger;

public class RefreshAllJobCommand extends Command
{

    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public RefreshAllJobCommand(String name) {
        super(name);
    }

    public Object execute() throws CommandException
    {
        Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
        logger.info(this.name + " Agent 가 호출되었습니다.");

        try {
            DirInfoManager.getInstance().loadAllFileInfo();

			logger.info(this.name + " Agent 가 성공적으로 완료되었습니다.");
            return "sucess";

        } catch (Exception e) {
            String msg = makeException("BECEAICAG002", e);
            logger.error(msg, e);
            throw new CommandException(msg);
        }
    }
}
