DJB 표준전문 및 오류 응답 관련 수정
This commit is contained in:
@@ -17,6 +17,7 @@ import com.eactive.eai.adapter.AdapterManager;
|
|||||||
import com.eactive.eai.adapter.AdapterPropManager;
|
import com.eactive.eai.adapter.AdapterPropManager;
|
||||||
import com.eactive.eai.adapter.AdapterVO;
|
import com.eactive.eai.adapter.AdapterVO;
|
||||||
import com.eactive.eai.adapter.http.HttpStatusException;
|
import com.eactive.eai.adapter.http.HttpStatusException;
|
||||||
|
import com.eactive.eai.adapter.http.dynamic.filter.FilterCryptoException;
|
||||||
import com.eactive.eai.adapter.http.dynamic.filter.JwtAuthException;
|
import com.eactive.eai.adapter.http.dynamic.filter.JwtAuthException;
|
||||||
import com.eactive.eai.common.message.EAIMessage;
|
import com.eactive.eai.common.message.EAIMessage;
|
||||||
import com.eactive.eai.common.property.PropManager;
|
import com.eactive.eai.common.property.PropManager;
|
||||||
@@ -429,7 +430,9 @@ public class TemplateAdapterErrorMsgHandler implements AdapterErrorMessageHandle
|
|||||||
String adptMsgType = adapterVO.getAdapterGroupVO().getMessageType();
|
String adptMsgType = adapterVO.getAdapterGroupVO().getMessageType();
|
||||||
String encode = StringUtils.defaultIfBlank(adapterGroupVO.getMessageEncode(), "UTF-8");
|
String encode = StringUtils.defaultIfBlank(adapterGroupVO.getMessageEncode(), "UTF-8");
|
||||||
|
|
||||||
if (e instanceof HttpStatusException) {
|
if (e instanceof FilterCryptoException) {
|
||||||
|
return genInboundErrorResponse(adapterGroupName, callProp, httpProp, adptMsgType, encode, e, 550);
|
||||||
|
} else if (e instanceof HttpStatusException) {
|
||||||
HttpStatusException e1 = (HttpStatusException) e;
|
HttpStatusException e1 = (HttpStatusException) e;
|
||||||
int httpCode = e1.getStatus();
|
int httpCode = e1.getStatus();
|
||||||
|
|
||||||
|
|||||||
+10
-12
@@ -1,19 +1,17 @@
|
|||||||
package com.eactive.eai.adapter.http.dynamic.filter;
|
package com.eactive.eai.adapter.http.dynamic.filter;
|
||||||
|
|
||||||
import com.eactive.eai.adapter.http.HttpStatusException;
|
import java.util.Properties;
|
||||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
|
||||||
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceSupport;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import com.eactive.eai.common.util.Logger;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.eactive.eai.util.IpUtil;
|
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceKey;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import com.eactive.eai.adapter.http.dynamic.HttpAdapterServiceSupport;
|
||||||
import java.util.Properties;
|
import com.eactive.eai.common.util.Logger;
|
||||||
import java.util.regex.Matcher;
|
import com.eactive.eai.util.IpUtil;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
public class AdapterAllowIPListFilter implements HttpAdapterFilter {
|
public class AdapterAllowIPListFilter implements HttpAdapterFilter {
|
||||||
static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
||||||
@@ -30,9 +28,9 @@ public class AdapterAllowIPListFilter implements HttpAdapterFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!IpUtil.isMatchIp(allowedIps, requestIp)) {
|
if (!IpUtil.isMatchIp(allowedIps, requestIp)) {
|
||||||
throw new HttpStatusException("This IP was not allowed-" + requestIp, HttpStatus.FORBIDDEN.value());
|
throw new FilterException("This IP was not allowed-" + requestIp, HttpStatus.FORBIDDEN.value());
|
||||||
}
|
}
|
||||||
} catch (HttpStatusException e) {
|
} catch (FilterException e) {
|
||||||
logger.debug(e.getMessage());
|
logger.debug(e.getMessage());
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
+3
-5
@@ -8,11 +8,9 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|
||||||
import com.eactive.eai.adapter.http.HttpStatusException;
|
|
||||||
import com.eactive.eai.common.util.Logger;
|
import com.eactive.eai.common.util.Logger;
|
||||||
import com.eactive.eai.util.IpUtil;
|
import com.eactive.eai.util.IpUtil;
|
||||||
|
|
||||||
|
|
||||||
public class AdapterBlockIpListFilter implements HttpAdapterFilter {
|
public class AdapterBlockIpListFilter implements HttpAdapterFilter {
|
||||||
static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
static Logger logger = Logger.getLogger(Logger.LOGGER_ADAPTER);
|
||||||
|
|
||||||
@@ -28,9 +26,9 @@ public class AdapterBlockIpListFilter implements HttpAdapterFilter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (IpUtil.isMatchIp(blockIps, requestIp)) {
|
if (IpUtil.isMatchIp(blockIps, requestIp)) {
|
||||||
throw new HttpStatusException("This IP was not allowed-" + requestIp, HttpStatus.FORBIDDEN.value());
|
throw new FilterException("This IP was not allowed-" + requestIp, HttpStatus.FORBIDDEN.value());
|
||||||
}
|
}
|
||||||
} catch (HttpStatusException e) {
|
} catch (FilterException e) {
|
||||||
logger.debug(e.getMessage());
|
logger.debug(e.getMessage());
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -46,7 +44,7 @@ public class AdapterBlockIpListFilter implements HttpAdapterFilter {
|
|||||||
if (ipAddress == null) {
|
if (ipAddress == null) {
|
||||||
ipAddress = request.getRemoteAddr();
|
ipAddress = request.getRemoteAddr();
|
||||||
}
|
}
|
||||||
if(ipAddress.indexOf(",") >= 0) {
|
if (ipAddress.indexOf(",") >= 0) {
|
||||||
ipAddress = org.springframework.util.StringUtils.tokenizeToStringArray(ipAddress, ",")[0];
|
ipAddress = org.springframework.util.StringUtils.tokenizeToStringArray(ipAddress, ",")[0];
|
||||||
}
|
}
|
||||||
return ipAddress;
|
return ipAddress;
|
||||||
|
|||||||
@@ -488,6 +488,8 @@ public final class MessageUtil {
|
|||||||
}
|
}
|
||||||
if (EAIServiceMonitor.getInstance().isTimeOutCodes(oldErrCode) ){ //TIMEOUT일경우
|
if (EAIServiceMonitor.getInstance().isTimeOutCodes(oldErrCode) ){ //TIMEOUT일경우
|
||||||
return STDMessageErrorKeys.TIMEOUT_ERROR_DESC_VALUE;
|
return STDMessageErrorKeys.TIMEOUT_ERROR_DESC_VALUE;
|
||||||
|
}else if (EAIServiceMonitor.getInstance().isBizErrorCodes(oldErrCode)){ //업무오류일경우
|
||||||
|
return STDMessageErrorKeys.BIZ_ERROR_DESC_VALUE;
|
||||||
}else{
|
}else{
|
||||||
return STDMessageErrorKeys.SYSTEM_ERROR_DESC_VALUE;
|
return STDMessageErrorKeys.SYSTEM_ERROR_DESC_VALUE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.eactive.eai.inbound.error;
|
package com.eactive.eai.inbound.error;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -54,9 +55,12 @@ public class InboundErrorInfoDAO extends BaseDAO {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String errCode = StringUtils.substring(vo.getErrCd(), 0, 12);
|
||||||
|
vo.setErrCd(errCode);
|
||||||
|
|
||||||
InboundErrorInfo entity = inboundErrorInfoMapper.toEntity(vo);
|
InboundErrorInfo entity = inboundErrorInfoMapper.toEntity(vo);
|
||||||
inboundErrorInfoLoader.save(entity);
|
inboundErrorInfoLoader.save(entity);
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
logger.error(e);
|
logger.error(e);
|
||||||
throw new DAOException(ExceptionUtil.getErrorCode(e, "RECEAIIEI001"), e);
|
throw new DAOException(ExceptionUtil.getErrorCode(e, "RECEAIIEI001"), e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user