com.poscoict.glueframework.message.layout
Class GlueDBMessageLayout

java.lang.Object
  extended by com.poscoict.glueframework.message.layout.GlueAbstractFixedLengthMessageLayout
      extended by com.poscoict.glueframework.message.layout.GlueDBMessageLayout
All Implemented Interfaces:
GlueMessageLayout, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class GlueDBMessageLayout
extends GlueAbstractFixedLengthMessageLayout
implements org.springframework.beans.factory.InitializingBean

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

 bean property 설정
 
 - cacheManager : (선택) default 는 'cacheManager' 임.
   applicationContext.xml 의 Cache Manager의 bean id가 'cacheManager가 아닐 경우 사용한다.
 
  - msgParsingType : (선택) default는 'byte'
    적용 우선순위
    1. msgParsingType bean property의 값
    2. glue.properties 의 msg.parsing.type 에 해당하는 값
    3. default 값
 
 - charset : (선택) default는 java.nio.charset.Charset.defaultCharset() 값임.
 
 - dao : (선택) default는 'masterdao' 임.
   applicationContext.xml 의 Dao의 bean id가 'masterdao'가 아닐 경우 사용한다.
 
 - queryId : (선택) default는 'get_msg_layout_query' 임.
   query file에 query id가 'get_msg_layout_query' 이 아닐 경우 사용한다.
 
 
 applicationContext.xml
 <bean id="layoutInDB" class="com.poscoict.glueframework.message.layout.GlueDBMessageLayout">
     <property name="dao" ref="masterdao"/>
     <property name="queryId" value="get_msg_layout_query"/>
     <property name="cacheManager" ref="cacheManager"/>
     <property name="msgParsingType" value="byte"/>
 </bean>
 <bean id="masterdao" class="com.poscoict.glueframework.dao.jdbc.GlueJdbcDao">
     <property name="dataSource"><ref local="masterData"/></property>
     <property name="queryManager"><ref local="queryManager"/></property>
 </bean>
 <bean id="masterData" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
      <property name="url" value="jdbc:oracle:thin:@127.0.0.1:1521:ORCL"/>
      <property name="username" value="GLUEMAST"/>
      <property name="password" value="GLUEMAST"/>
      <property name="defaultAutoCommit" value="false"/>
 </bean> 
 
 service 파일 : [MSGFW001]-service.xml
 <activity name="MessageParse" class="com.poscoict.glueframework.biz.activity.GlueMessageParse">
     <transition name="success" value="BizLogic" />
     <property name="layout" value="layoutInDB" />
 </activity>
 
 query 파일 : [layout]-query.glue_sql
 <?xml version="1.0" encoding="UTF-8"?> 
 <queryMap desc="Layout조회용">
     <query id="get_msg_layout_query" desc="" 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_ID IN ( SELECT FK_MDL_DEFINE_ID
                          FROM TB_M00_INTERFACES
                          WHERE MDL_DEFINE_NM=?
                            AND END_ACTIVE_DATE=TO_DATE('2999/12/31 23:59:59','YYYY/MM/DD HH24:MI:SS')
                        )
 ORDER BY MDL_DEFINE_DT_NM_SEQ ASC
       ]]>
     </query>
 </queryMap>
 


Field Summary
 
Fields inherited from class com.poscoict.glueframework.message.layout.GlueAbstractFixedLengthMessageLayout
logger, MSG_TYPE_BYTE, MSG_TYPE_STRING
 
Constructor Summary
GlueDBMessageLayout()
           
 
Method Summary
 void afterPropertiesSet()
           
 GlueMessage createMessageObject(String tc)
           
 List<GlueMessageAttributeDefinition> getAttributesDefinition(String tcid)
           
 GlueGenericJdbcDao getDao()
           
 String getQueryId()
           
 void setDao(GlueGenericJdbcDao dao)
          setter method for DI.
 void setQueryId(String queryId)
          setter method for DI.
 
Methods inherited from class com.poscoict.glueframework.message.layout.GlueAbstractFixedLengthMessageLayout
destroy, getAttributes, getCacheManager, getCharset, getMsgParsingType, makeMessageParsing, makeMessageString, setCacheManager, setCharset, setMsgParsingType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GlueDBMessageLayout

public GlueDBMessageLayout()
Method Detail

getDao

public GlueGenericJdbcDao getDao()

setDao

public void setDao(GlueGenericJdbcDao dao)
setter method for DI.

Parameters:
dao -

getQueryId

public String getQueryId()

setQueryId

public void setQueryId(String queryId)
setter method for DI.

Parameters:
queryId -

getAttributesDefinition

public List<GlueMessageAttributeDefinition> getAttributesDefinition(String tcid)
                                                             throws GlueMessageDefinitionException
Specified by:
getAttributesDefinition in class GlueAbstractFixedLengthMessageLayout
Returns:
GlueMessageAttributeDefinition List
Throws:
GlueMessageDefinitionException

createMessageObject

public GlueMessage createMessageObject(String tc)
Specified by:
createMessageObject in class GlueAbstractFixedLengthMessageLayout
Returns:
GlueMessage

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception


Copyright © 2013–2014 POSCO ICT SW제품기술팀. All rights reserved.