ums dispatcher 기능 변경
This commit is contained in:
+25
-8
@@ -1,5 +1,6 @@
|
||||
package com.eactive.ext.kjb.ums;
|
||||
|
||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
||||
import com.eactive.apim.portal.template.entity.MessageRequest;
|
||||
import com.eactive.eai.rms.common.base.BaseService;
|
||||
import com.eactive.eai.rms.data.entity.man.monitoringProperty.service.MonitoringPropertyService;
|
||||
@@ -22,7 +23,9 @@ import java.util.Arrays;
|
||||
@Service
|
||||
@Transactional(transactionManager = "transactionManagerForEMS")
|
||||
@Slf4j
|
||||
public class KjbUmsService extends BaseService {
|
||||
public class KjbEmailService extends BaseService {
|
||||
public final static int[] ALLOW_CHANNELS = { MessageCode.Channels.EMAIL.getValue() };
|
||||
|
||||
public static final String PROP_GORUP_ID = "Monitoring";
|
||||
public static final String PROP_EAI_BATCH_URL = "kjb.ums.eai_batch.url";
|
||||
public static final String PROP_EAI_BATCH_SEND_DIR = "kjb.ums.eai_batch.send_dir";
|
||||
@@ -34,19 +37,33 @@ public class KjbUmsService extends BaseService {
|
||||
|
||||
|
||||
@Autowired
|
||||
public KjbUmsService(KjbSafedbWrapper kjbSafedbWrapper,
|
||||
MonitoringPropertyService monitoringPropertyService) {
|
||||
this.kjbSafedbWrapper = kjbSafedbWrapper;
|
||||
public KjbEmailService(MonitoringPropertyService monitoringPropertyService) {
|
||||
this.kjbSafedbWrapper = KjbSafedbWrapper.getInstance();
|
||||
|
||||
KjbProperty prop = new KjbProperty();
|
||||
prop.setEaiBatchUrl(monitoringPropertyService.getPropertyValue(PROP_GORUP_ID, PROP_EAI_BATCH_URL, ""));
|
||||
prop.setUmsEaiBatchSendDir(monitoringPropertyService.getPropertyValue(PROP_GORUP_ID, PROP_EAI_BATCH_SEND_DIR, "/Data/files/send"));
|
||||
prop.setEaiBatchUrl(monitoringPropertyService.getPrpty2ValById(PROP_GORUP_ID, PROP_EAI_BATCH_URL));
|
||||
prop.setUmsEaiBatchSendDir(monitoringPropertyService.getPrpty2ValById(PROP_GORUP_ID, PROP_EAI_BATCH_SEND_DIR));
|
||||
prop.setUmsEaiBatchBackupDir(monitoringPropertyService.getPrpty2ValById(PROP_GORUP_ID, "kjb.ums.eai_batch.backup_dir"));
|
||||
prop.setUmsEaiBatchInterfaceId(monitoringPropertyService.getPrpty2ValById(PROP_GORUP_ID, "kjb.ums.eai_batch.interface_id"));
|
||||
prop.setUmsHostUrl(monitoringPropertyService.getPrpty2ValById(PROP_GORUP_ID, "kjb.ums.host_url"));
|
||||
prop.setUmsApiKey(monitoringPropertyService.getPrpty2ValById(PROP_GORUP_ID, "kjb.ums.api_key"));
|
||||
|
||||
this.prop = prop;
|
||||
}
|
||||
|
||||
public KjbUmsService(KjbSafedbWrapper kjbSafedbWrapper,
|
||||
KjbProperty property) {
|
||||
|
||||
public static boolean isAllowChannel(MessageRequest message) {
|
||||
for (int channel : ALLOW_CHANNELS) {
|
||||
if ((message.getMessageCode().getChannels() & channel) == channel) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public KjbEmailService(KjbSafedbWrapper kjbSafedbWrapper,
|
||||
KjbProperty property) {
|
||||
this.kjbSafedbWrapper = kjbSafedbWrapper;
|
||||
this.prop = property;
|
||||
|
||||
Reference in New Issue
Block a user