property 설정
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package com.eactive.eai.rms.onl.common.service.ums;
|
||||
|
||||
import com.eactive.apim.portal.template.entity.MessageRequest;
|
||||
import com.eactive.apim.portal.template.repository.MessageRequestRepository;
|
||||
import com.eactive.eai.rms.data.entity.man.monitoringProperty.service.MonitoringPropertyService;
|
||||
import com.eactive.ext.kjb.common.KjbProperty;
|
||||
import com.eactive.ext.kjb.safedb.KjbSafedbWrapper;
|
||||
import com.eactive.ext.kjb.ums.KjbEmailService;
|
||||
import com.eactive.ext.kjb.ums.KjbEmailSendModule;
|
||||
import com.eactive.ext.kjb.ums.KjbUmsService;
|
||||
import com.eactive.ext.kjb.util.KjbPropertyInjector;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.NotImplementedException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -42,19 +42,21 @@ public class UmsDispatchService {
|
||||
@PersistenceContext(unitName = "entityManagerFactoryForEMS")
|
||||
private EntityManager entityManager;
|
||||
|
||||
// private final KjbEmailService kjbEmailService;
|
||||
// private final KjbSafedbWrapper kjbSafedbWrapper;
|
||||
// private final MonitoringPropertyService monitoringPropertyService;
|
||||
|
||||
private final MessageRequestRepository messageRequestRepository;
|
||||
private final KjbUmsService kjbUmsService;
|
||||
private final KjbEmailSendModule kjbEmailSendModule;
|
||||
private final KjbPropertyInjector kjbPropertyInjector;
|
||||
|
||||
|
||||
@Autowired
|
||||
public UmsDispatchService(
|
||||
@Qualifier("transactionManagerForEMS") PlatformTransactionManager transactionManager,
|
||||
// KjbSafedbWrapper kjbSafedbWrapper,
|
||||
MonitoringPropertyService monitoringPropertyService
|
||||
MonitoringPropertyService monitoringPropertyService,
|
||||
MessageRequestRepository messageRequestRepository
|
||||
) {
|
||||
this.kjbPropertyInjector = new KjbPropertyInjector(monitoringPropertyService, PROP_GORUP_ID);
|
||||
|
||||
this.messageRequestRepository = messageRequestRepository;
|
||||
// this.kjbEmailService = kjbEmailService;
|
||||
// this.kjbSafedbWrapper = kjbSafedbWrapper;
|
||||
// this.monitoringPropertyService = monitoringPropertyService;
|
||||
@@ -73,14 +75,17 @@ public class UmsDispatchService {
|
||||
|
||||
|
||||
KjbProperty prop = new KjbProperty();
|
||||
prop.setEaiBatchUrl(monitoringPropertyService.getPrpty2ValById(PROP_GORUP_ID, "kjb.ums.eai_batch.url"));
|
||||
prop.setUmsEaiBatchSendDir(monitoringPropertyService.getPrpty2ValById(PROP_GORUP_ID, "kjb.ums.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"));
|
||||
// prop.setEaiBatchUrl(monitoringPropertyService.getPrpty2ValById(PROP_GORUP_ID, "kjb.ums.eai_batch.url"));
|
||||
// prop.setUmsEaiBatchSendDir(monitoringPropertyService.getPrpty2ValById(PROP_GORUP_ID, "kjb.ums.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"));
|
||||
prop = kjbPropertyInjector.inject(prop);
|
||||
|
||||
this.kjbUmsService = new KjbUmsService(prop);
|
||||
|
||||
this.kjbEmailSendModule = KjbEmailSendModule.getInstance(prop, messageRequestRepository);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -123,6 +128,9 @@ public class UmsDispatchService {
|
||||
}
|
||||
} else {
|
||||
log.info("No pending messages found");
|
||||
|
||||
// 발송 메세지가 없을 때 파일 삭제 처리 진행
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,9 +150,8 @@ public class UmsDispatchService {
|
||||
kjbUmsService.send(message);
|
||||
}
|
||||
|
||||
if (KjbEmailService.isAllowChannel(message)) {
|
||||
throw new NotImplementedException();
|
||||
// kjbEmailService.sendEmail(message);
|
||||
if (KjbEmailSendModule.isAllowChannel(message)) {
|
||||
kjbEmailSendModule.sendEmail(message);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user