Package com.poscoict.glueframework.web
Class GlueHttpReceiverAdapter
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
com.poscoict.glueframework.web.GlueHttpReceiverAdapter
- All Implemented Interfaces:
Servlet
,ServletConfig
,Serializable
Http Receiver Servlet. 외부 시스템으로부터 HttpRequest 방식으로 Data를 수신받은 모듈. EAI에서 전송되는 Message(전문)를 수신하여, Biz Controller로 전송하는 Receiver Class이다.
POST방식의 Request만 수신하며, GET의 경우는 Error를 Return한다.(SC_FORBIDDEN)
web.xml 파일 내용
<servlet>
<servlet-name>HttpReceiver</servlet-name>
<servlet-class>com.poscoict.glueframework.web.GlueHttpReceiverAdapter</servlet-class>
<init-param>
<param-name>UD_SC_SUCCESS</param-name>
<param-value>200</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>HttpReceiver</servlet-name>
<url-pattern>*.tc</url-pattern>
</servlet-mapping>
url
http://{ip}:{port}/{context-root}/HttpReceiver.tc
init-param
GlueHttpReceiverAdapter servlet의 init-param은 다음과 같다.
- UD_SC_SUCCESS : HttpResponse 정상 상태코드 정의, default 900
- UD_SC_RESEND : HttpResponse 재송신 상태코드 정의, default 600
- UD_SC_FAILURE : HttpResponse 에러 상태코드 정의, default 700
- TC_LENGTH : GlueService 실행 ID의 길이(TC ID의 길이) 정의, default 8
- NAME_IFD : HttpRequest의 parameter 중 InterfaceID, default ifd
- NAME_MESSAGE : HttpRequest의 parameter 중 tc(message 또는 file경로), default message
- NAME_TIMESTAMP : HttpRequest의 parameter 중 시간정보, default timestamp
- NAME_SEQUENCE : HttpRequest의 parameter 중 sequence 정보, default sequence
- NAME_TYPE : HttpRequest의 parameter 중 type 정보, default type. ex type=T 또는 type=F
logging 옵션
- debug.httpreceiver : Java 옵션으로 명시적 false를 지정할 경우 엔진로그(System.out.println())를 남기지 않음.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
현재 처리중인 request 정보를 관리.protected int
static final int
static final int
static final int
protected int
protected int
protected int
Fields inherited from class jakarta.servlet.http.HttpServlet
LEGACY_DO_HEAD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected GlueAuditAttributes
createGlueAtuditAttribute
(HttpServletRequest request, GlueContext ctx) void
destroy()
void
doGet
(HttpServletRequest request, HttpServletResponse response) void
doPost
(HttpServletRequest request, HttpServletResponse response) void
init
(ServletConfig config) protected boolean
isValidMsg
(String msg) Methods inherited from class jakarta.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service
Methods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
UD_SC_OK
public static final int UD_SC_OK- See Also:
-
UD_SC_RESEND
public static final int UD_SC_RESEND- See Also:
-
UD_SC_FAILURE
public static final int UD_SC_FAILURE- See Also:
-
DEFAULT_MSG_ID_LENGTH
public static final int DEFAULT_MSG_ID_LENGTH- See Also:
-
requestMap
현재 처리중인 request 정보를 관리. -
userDefinedStatusCodeSuccess
protected int userDefinedStatusCodeSuccess -
userDefinedStatusCodeSuccessResend
protected int userDefinedStatusCodeSuccessResend -
userDefinedStatusCodeSuccessfailure
protected int userDefinedStatusCodeSuccessfailure -
transactionCodeIdLength
protected int transactionCodeIdLength
-
-
Constructor Details
-
GlueHttpReceiverAdapter
public GlueHttpReceiverAdapter()
-
-
Method Details
-
init
- Specified by:
init
in interfaceServlet
- Overrides:
init
in classHttpServlet
- Throws:
ServletException
-
doGet
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - Overrides:
doGet
in classHttpServlet
- Throws:
ServletException
IOException
-
doPost
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - Overrides:
doPost
in classHttpServlet
- Throws:
ServletException
IOException
-
isValidMsg
- Parameters:
msg
-- Returns:
- msg의 유효여부
-
createGlueAtuditAttribute
protected GlueAuditAttributes createGlueAtuditAttribute(HttpServletRequest request, GlueContext ctx) - Parameters:
request
-ctx
-- Returns:
- GlueAuditAttributes
-
destroy
public void destroy()- Specified by:
destroy
in interfaceServlet
- Overrides:
destroy
in classGenericServlet
-