init
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.eactive.eai.agent.httpouttlsinfo;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.httpouttlsinfo.HttpOutTlsInfoManager;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class ReloadHttpOutTlsInfoCommand extends Command {
|
||||
|
||||
public ReloadHttpOutTlsInfoCommand() {
|
||||
super("ReloadClientCommand");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof String)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try {
|
||||
HttpOutTlsInfoManager manager = HttpOutTlsInfoManager.getInstance();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
manager.reload(keyName);
|
||||
if (logger.isWarn()) {
|
||||
logger.warn(this.name + "] " + keyName + " Reload.");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.eactive.eai.agent.httpouttlsinfo;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
import com.eactive.eai.httpouttlsinfo.HttpOutTlsInfoManager;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class RemoveHttpOutTlsInfoCommand extends Command {
|
||||
|
||||
public RemoveHttpOutTlsInfoCommand() {
|
||||
super("ReloadClientCommand");
|
||||
}
|
||||
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof String)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
try {
|
||||
HttpOutTlsInfoManager manager = HttpOutTlsInfoManager.getInstance();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null && keyName.trim().length() > 0) {
|
||||
manager.removeHttpOutTlsInfo(keyName);
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutCommand ] " + keyName + " 에 대한 Layout 정보가 메모리에서 삭제되었습니다.");
|
||||
} else {
|
||||
if (logger.isWarn())
|
||||
logger.warn("ReloadLayoutCommand ] Layout 명을 확인하세요 [" + keyName + "]");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
String rspErrorCode = "RECEAIMCM002";
|
||||
String msg = makeException(rspErrorCode, e);
|
||||
if (logger.isError())
|
||||
logger.error(msg, e);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
return "success";
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user