init
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
package com.eactive.eai.agent.bizkey;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.bizkey.BizKeyManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class ReloadBizKeyCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadBizKeyCommand() {
|
||||
super("ReloadBizKeyCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
BizKeyManager manager = BizKeyManager.getInstance();
|
||||
|
||||
String keyName = (String) args;
|
||||
|
||||
if (keyName != null) {
|
||||
if ("ALL".equals(keyName)) {
|
||||
manager.reload();
|
||||
if (logger.isWarn())
|
||||
logger.warn(this.name + "] all rule Reload.");
|
||||
} else {
|
||||
String[] keys = keyName.split(",");
|
||||
manager.reload(keys[0], keys[1]);
|
||||
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";
|
||||
|
||||
}
|
||||
|
||||
// public static void main(String[] args)throws Exception{
|
||||
// Command command = new ReloadBizKeyCommand();
|
||||
// command.setArgs("ALL");
|
||||
// AgentUtil.broadcast(command);
|
||||
//
|
||||
// }
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.eactive.eai.agent.bizkey;
|
||||
|
||||
import java.util.Vector;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.bizkey.BizKeyManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
/**
|
||||
* 업무필드 추출 서비스리스트 메모리 동기화 Command
|
||||
* - 오픈뱅킹 EAIServiceLoader_312에서 사용
|
||||
*
|
||||
* @author openbanking
|
||||
* @since 2019.08
|
||||
*/
|
||||
public class ReloadBizKeyListCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public ReloadBizKeyListCommand() {
|
||||
super("ReloadBizKeyListCommand");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public Object execute() throws CommandException {
|
||||
Logger logger = Logger.getLogger(Logger.LOGGER_DEFAULT);
|
||||
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);
|
||||
}
|
||||
|
||||
BizKeyManager manager = BizKeyManager.getInstance();
|
||||
try {
|
||||
Vector keyNameVt = (Vector)args;
|
||||
String keyName ="";
|
||||
for(int i=0; i<keyNameVt.size(); i++) {
|
||||
keyName = (String)keyNameVt.get(i);
|
||||
// BizKeyManager를 변경하지 않고 exrClsNm = {TR, AK} 정의 호출
|
||||
manager.reload(keyName, "TR");
|
||||
manager.reload(keyName, "AK");
|
||||
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,48 @@
|
||||
package com.eactive.eai.agent.bizkey;
|
||||
|
||||
import com.eactive.eai.agent.command.Command;
|
||||
import com.eactive.eai.agent.command.CommandException;
|
||||
import com.eactive.eai.common.bizkey.BizKeyManager;
|
||||
import com.eactive.eai.common.util.Logger;
|
||||
|
||||
public class RemoveBizKeyCommand extends Command {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public RemoveBizKeyCommand() {
|
||||
super("RemoveBizKeyCommand");
|
||||
}
|
||||
|
||||
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 {
|
||||
BizKeyManager manager = BizKeyManager.getInstance();
|
||||
String keyName = (String) args;
|
||||
if (keyName != null) {
|
||||
String[] keys = keyName.split(",");
|
||||
manager.removeBizKey(keys[0] + keys[1]);
|
||||
}
|
||||
|
||||
} 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