UMS관련 정리
This commit is contained in:
@@ -1,41 +0,0 @@
|
|||||||
package com.eactive.ext.djb.apistatus;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
@Transactional
|
|
||||||
public class DjbIncidentDetectionService {
|
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(DjbIncidentDetectionService.class);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 이벤트 감지
|
|
||||||
* @param event "CONTROL_START" : 점검시작
|
|
||||||
"CONTROL_END" : 점검종료
|
|
||||||
"ERROR_START" : 장애시작
|
|
||||||
"ERROR_END" : 장애종료
|
|
||||||
"DELAY_START" : 지연시작
|
|
||||||
"DELAY_END" : 지연종료
|
|
||||||
* @param apiIds API IDs
|
|
||||||
*/
|
|
||||||
public void detect(String event, List<String> apiIds) {
|
|
||||||
log.debug("이벤트 감지: {} {}", event, apiIds);
|
|
||||||
}
|
|
||||||
|
|
||||||
// API FSM 내 아직 장애로 남아있는 API 목록
|
|
||||||
public void remainDownApiIds() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 정상 동작 - detect()에서 일괄 처리 (복구 = 점검종료, 장애종료, 지연종료)
|
|
||||||
// public void recovered(String event, String[] apiIds) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package com.eactive.ext.djb.apistatus.event;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import com.eactive.apim.portal.template.entity.MessageCode;
|
|
||||||
import com.eactive.apim.portal.template.service.MessageEventHandler;
|
|
||||||
import com.eactive.apim.portal.template.service.MessageRecipient;
|
|
||||||
import com.eactive.apim.portal.template.service.MessageSendEvent;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class ApiStatusChangedEventHandler implements MessageEventHandler {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MessageCode getKey() { return MessageCode.API_STATUS_CHANGED; }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public MessageSendEvent createEvent(Object source, MessageRecipient recipient, Map<String, Object> params) {
|
|
||||||
Map<String, String> p = new HashMap<>();
|
|
||||||
params.forEach((k, v) -> p.put(k, v != null ? v.toString() : null));
|
|
||||||
return new MessageSendEvent(source, getKey(), recipient, p);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override public boolean allowAdditionalRecipients() { return true; }
|
|
||||||
@Override public String getDisplayName() { return "API 상태 변경"; }
|
|
||||||
@Override public String getDescription() { return "API 상태가 변경되었습니다"; }
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user