package com.eactive.eai.agent.firstaccount;

import java.util.HashMap;

import com.eactive.eai.agent.command.Command;
import com.eactive.eai.agent.command.CommandException;
import com.eactive.eai.common.util.Logger;

public class RemoteFirstAccountCommand extends Command {
	static Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);

	private static final long serialVersionUID = 1L;

	public RemoteFirstAccountCommand() {
		super("RemoteFirstAccountCommand");
	}

	public Object execute() throws CommandException {
		try {
			logger.warn("Execute 실행중... ");
			HashMap argMap = (HashMap) args;
			String accNum = (String) argMap.get("accNum");
			logger.warn("정상적으로 호출되었습니다. accNum=[" + accNum + "]");
			ShareMemory sm = ShareMemory.getInstance();
			sm.setAccoutName(accNum);

		} catch (Exception e) {
			String msg = makeException("Error Fist Account", e);
			logger.error(msg, e);
			throw new CommandException(msg);
		}
		return "success";
	}

}
