Class GlueDBMessageLayout

java.lang.Object
com.poscoict.glueframework.message.layout.GlueAbstractFixedLengthMessageLayout
com.poscoict.glueframework.message.layout.GlueDBMessageLayout
All Implemented Interfaces:
GlueMessageLayout, DisposableBean, InitializingBean

public class GlueDBMessageLayout extends GlueAbstractFixedLengthMessageLayout
MessageLayout 구현체. Message를 DB에 정의된 Layout에 따라 Create, Parsing시 사용할수 있도록 구현된 Implement Class. GlueDBMessageLayout Class는 Master DB로 부터 TC에 해당하는 Layout 정보를 읽어 와서 TC를 Parse 하거나 Create 하게 한다.
 Bean Property

 - cacheManager : (필수) applicationContext.xml 의 Cache Manager의 bean id.

 - dao : (필수) applicationContext.xml 의 Dao의 bean id.

 - msgParsingType : (선택) default는 'byte'
    적용 우선순위
    1. msgParsingType bean property의 값
    2. glue.properties 의 msg.parsing.type 에 해당하는 값
    3. default 값

 - charset : (선택) default는 java.nio.charset.Charset.defaultCharset() 값임.

 - queryId : (선택) default는 'get_msg_layout_query' 임.
   query file에 query id가 'get_msg_layout_query' 이 아닐 경우 사용한다.

 - msgParsingRule : (선택)



 예제
 
 사용 예# 1

     <bean id="layoutInDB" class="com.poscoict.glueframework.message.layout.GlueDBMessageLayout">
         <property name="dao" ref="masterdao"/>
         <property name="cacheManager" ref="cacheManager"/>
     </bean>
     <bean id="masterdao" class=". . ."/>
     <bean id="cacheManager" class=". . ."/>


 사용 예# 2

     <bean id="layoutInDB" class="com.poscoict.glueframework.message.layout.GlueDBMessageLayout">
         <property name="dao" ref="masterdao"/>
         <property name="cacheManager" ref="cacheManager"/>
         <property name="queryId" value="get_msg_layout_query"/>
     </bean>
     <bean id="masterdao" class=". . ."/>
     <bean id="cacheManager" class=". . ."/>


 사용 예# 3

     <bean id="layoutInDB" class="com.poscoict.glueframework.message.layout.GlueDBMessageLayout">
         <property name="dao" ref="masterdao"/>
         <property name="cacheManager" ref="cacheManager"/>
         <property name="msgParsingType" value="byte"/>
     </bean>
     <bean id="masterdao" class=". . ."/>
     <bean id="cacheManager" class=". . ."/>


 사용 예# 4

     <bean id="layoutInDB" class="com.poscoict.glueframework.message.layout.GlueDBMessageLayout">
         <property name="dao" ref="masterdao"/>
         <property name="cacheManager" ref="cacheManager"/>
         <property name="msgParsingType" value="byte"/>
         <property name="msgParsingRule">
             <list>
                 <value>NULL_TO_ZERO_WHEN_TYPE_IS_NUMBER</value>
                 <value>ZERO_TO_SPACE_WHEN_TYPE_IS_STRING</value>
             </list>
         </property>
     </bean>
     <bean id="masterdao" class=". . ."/>
     <bean id="cacheManager" class=". . ."/>


 참고 : [MSGFW001]-service.xml

     <activity name="MessageParse" class="com.poscoict.glueframework.biz.activity.GlueMessageParse">
         <transition name="success" value="BizLogic" />
         <property name="layout" value="layoutInDB" />
     </activity>

 참고 : [layout]-query.glue_sql

     <?xml version="1.0" encoding="UTF-8"?>
     <queryMap desc="Layout조회용">
         <query id="get_msg_layout_query" desc="com/poscoict/glueframework/message/layout/schema-sqlite.sql 참고" resultType="" isNamed="false">
             <![CDATA[
     SELECT MDL_DEFINE_DT_NM_SEQ,
       MDL_DEFINE_DT_NM_GROUP_TP,
       STANDARD_ENGLISH_ID,
       STANDARD_KOREAN_NAME,
       MDL_DEFINE_DT_NM_DATA_TP,
       MDL_DEFINE_DT_NM_LEN,
       MDL_DEFINE_DT_NM_V_DECI_PREC
     FROM TB_M00_INTERFACE_ATTRS
     WHERE MDL_DEFINE_NM=?
           ]]>
         </query>
     </queryMap>