init
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
package com.eactive.eai.agent.b2bextractor;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.b2bextractor.B2BExtractManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadB2BExtractCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadB2BExtractCommand() {
|
||||
super("ReloadB2BExtractCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
B2BExtractManager manager = B2BExtractManager.getInstance();
|
||||
String keyName = (String) args;
|
||||
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule Reload.");
|
||||
} else {
|
||||
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,58 @@
|
||||
package com.eactive.eai.agent.b2bextractor;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.b2bextractor.B2BExtractManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
/**
|
||||
* 라우팅필드 추출 서비스리스트 메모리 동기화 Command - 오픈뱅킹 EAIServiceLoader_312에서 사용
|
||||
*
|
||||
* @author openbanking
|
||||
* @since 2019.08
|
||||
*/
|
||||
public class ReloadB2BExtractListCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
|
||||
public ReloadB2BExtractListCommand() {
|
||||
super("ReloadB2BExtractListCommand");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object execute() throws CommandException {
|
||||
if (logger.isInfo())
|
||||
logger.info(this.name + " is executed");
|
||||
|
||||
if (!(args instanceof Vector)) {
|
||||
String rspErrorCode = "RECEAIMCM001";
|
||||
String msg = makeException(rspErrorCode, null);
|
||||
if (logger.isError())
|
||||
logger.error(msg);
|
||||
throw new CommandException(msg);
|
||||
}
|
||||
|
||||
B2BExtractManager manager = B2BExtractManager.getInstance();
|
||||
try {
|
||||
Vector keyNameVt = (Vector) args;
|
||||
String keyName = "";
|
||||
for (int i = 0; i < keyNameVt.size(); i++) {
|
||||
keyName = (String) keyNameVt.get(i);
|
||||
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,45 @@
|
||||
package com.eactive.eai.agent.b2bextractor;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.b2bextractor.B2BExtractManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveB2BExtractCommand extends Command {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveB2BExtractCommand() {
|
||||
super("RemoveB2BExtractCommand");
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
String key = null;
|
||||
B2BExtractManager manager = B2BExtractManager.getInstance();
|
||||
try {
|
||||
key = (String) args;
|
||||
manager.removeB2BExtract(key);
|
||||
|
||||
} 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