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.