com.poscoict.glueframework.message.layout
Class GlueAbstractFixedLengthMessageLayout

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

public abstract class GlueAbstractFixedLengthMessageLayout
extends Object
implements GlueMessageLayout, org.springframework.beans.factory.DisposableBean


Field Summary
protected  org.slf4j.Logger logger
          logger
static String MSG_TYPE_BYTE
           
static String MSG_TYPE_STRING
           
 
Constructor Summary
GlueAbstractFixedLengthMessageLayout()
           
 
Method Summary
abstract  GlueMessage createMessageObject(String message)
           
 void destroy()
           
 GlueMessageDefinition getAttributes(String key)
          ÇØ´ç Msg LayoutÀÇ Attribute Á¤º¸¸¦ ÃßÃâÇÏ´Â Method óÀ½ È£Ãâ½Ã AttributeÀÇ Á¤º¸¸¦ Cache¿¡ ÀúÀåÇÏ°í, Àç È£Ãâ½Ã Cache¸¦ ÅëÇØ Á¤º¸¸¦ ÃßÃâÇÏ¿© Á¦°ø
abstract  List<GlueMessageAttributeDefinition> getAttributesDefinition(String id)
           
 GlueCacheManager getCacheManager()
           
 Charset getCharset()
           
 String getMsgParsingType()
          Message Parsing TypeÀ» °¡Á®¿Â´Ù.
 GlueMessage makeMessageParsing(GlueMessageDefinition messageDefinition, String tc)
          Message Layout Ç׸ñ Á¤º¸¿¡ µû Message¸¦ ÆĽÌÇÏ¿© GlueMessage °´Ã¼¿¡ ´ã´Â´Ù.
 String makeMessageString(GlueMessageDefinition messageDefinition, GlueMessage message)
          Message Layout¿¡ µû¶ó ÇØ´ç Message¸¦ »ý¼ºÇÑ´Ù.
 void setCacheManager(GlueCacheManager cacheManager)
          setter method for DI.
 void setCharset(Charset charset)
          setter method for DI.
 void setMsgParsingType(String msgParsingType)
          setter method for DI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MSG_TYPE_BYTE

public static final String MSG_TYPE_BYTE
See Also:
Constant Field Values

MSG_TYPE_STRING

public static final String MSG_TYPE_STRING
See Also:
Constant Field Values

logger

protected org.slf4j.Logger logger
logger

Constructor Detail

GlueAbstractFixedLengthMessageLayout

public GlueAbstractFixedLengthMessageLayout()
Method Detail

getCacheManager

public GlueCacheManager getCacheManager()

setCacheManager

public void setCacheManager(GlueCacheManager cacheManager)
setter method for DI.

Parameters:
cacheManager -

getMsgParsingType

public String getMsgParsingType()
Message Parsing TypeÀ» °¡Á®¿Â´Ù. -ÇöÀç µÎ°¡Áö ¹æ½Ä Á¦°ø -Byte ÆĽÌÀº MES¿¡ Byte ÆḺ̌ÔÄ¢ÀÌ Àû¿ëµÊ

Returns:
message parsing type : byte, String

setMsgParsingType

public void setMsgParsingType(String msgParsingType)
setter method for DI. Message Parsing TypeÀ» ÀúÀåÇÑ´Ù.

Parameters:
msgParsingType - message Parsing Type, byte or String

getCharset

public Charset getCharset()
Returns:
Charset

setCharset

public void setCharset(Charset charset)
setter method for DI.

Parameters:
charset -

makeMessageString

public String makeMessageString(GlueMessageDefinition messageDefinition,
                                GlueMessage message)
Description copied from interface: GlueMessageLayout
Message Layout¿¡ µû¶ó ÇØ´ç Message¸¦ »ý¼ºÇÑ´Ù.
 [Message Byte »ý¼º ±ÔÄ¢]
 1. Data Type : String
    DataType : STRING, CHAR, VARCHAR2 ¸ðµÎ µ¿ÀÏÇÏ°Ô StringÀ¸·Î °£ÁÖ
    String Data°¡ LayoutÀÇ Lengthº¸´Ù ÀÛÀ»¶§ : Length¸¸Å­ ¿À¸¥ÂÊ °ø¹é Ãß°¡
    String Data°¡ LayoutÀÇ Lengthº¸´Ù Ŭ¶§ : Length¸¸Å­ ¿ÞÂÊ ±âÁØÀ¸·Î ÀÚ¸§
    ´Ü, StringÀÌ Null, ""(zero Length) ÀÏ °æ¿ì : Length¸¸Å­ °ø¹é »ý¼º
    ´Ü, StringÀ» Byte Length »ý¼º½Ã String Áß°£Àý»èÀÏ °æ¿ì ±úÁø String ±×´ë·Î ó¸®ÇÔ.
    ¿¹) 123ÇÑ(Length:4) : 123?
    
 2. Data Type : Number
    1) Truncateó¸®
    2) ¿À¸¥ÂÊ Shift
    3) Cut
       Number Data°¡ LayoutÀÇ Lengthº¸´Ù ÀÛÀ»¶§ : Length¸¸Å­ ¿ÞÂÊÀ¸·Î '0' Ãß°¡
       ¿¹) -123(Length:5) : -0123
       Number Data°¡ LayoutÀÇ Lengthº¸´Ù Ŭ¶§ : Length¸¸Å­ ¿ÞÂÊ ±âÁØÀ¸·Î ÀÚ¸§
    ´Ü, '-', '.'µµ 1 Byte·Î °£ÁÖÇÑ´Ù.
    ´Ü, Number°¡ Null, ""(zero Length) ÀÏ °æ¿ì : Length¸¸Å­ °ø¹é »ý¼º
    
 3. Data Type : Date
    Date°´Ã¼¿¡¼­ ÇØ´ç Length¿¡ ¸ÂÃç °ªÀ» °¡Á®¿È.
    [Áö¿øÇÏ´Â Date Type]
      Length(14) : yyyyMMddHHmmss
      Length(12) : yyyyMMddHHmm
      Length(10) : yyyyMMddHH
      Length(8) : yyyyMMdd
      Length(6) : yyyyMM
      Length(4) : yyyy
      ´Ü, Date°¡ Null, ""(zero Length) ÀÏ °æ¿ì : Length¸¸Å­ °ø¹é »ý¼º
 

Specified by:
makeMessageString in interface GlueMessageLayout
Parameters:
messageDefinition - Message LayoutÀÇ AttributeÇ׸ñ List
message - GlueMessage °´Ã¼
Returns:
»ý¼ºµÈ Message ¹®ÀÚ¿­

makeMessageParsing

public GlueMessage makeMessageParsing(GlueMessageDefinition messageDefinition,
                                      String tc)
                               throws GlueMessageParserException
Description copied from interface: GlueMessageLayout
Message Layout Ç׸ñ Á¤º¸¿¡ µû Message¸¦ ÆĽÌÇÏ¿© GlueMessage °´Ã¼¿¡ ´ã´Â´Ù.
 [Message Byte ÆÄ½Ì ±ÔÄ¢]
 1. Data Type : String
    -DataType : STRING, CHAR, VARCHAR2 ¸ðµÎ µ¿ÀÏÇÏ°Ô StringÀ¸·Î °£ÁÖ
    -String Data¸¦ ÀÚ¸¥ÈÄ Rigth Trimó¸®ÇÏ¿© Message °´Ã¼¿¡ ÀúÀå
    ´Ü, String ÆĽ̽à String Áß°£ Àý»èÀÌ µÉ °æ¿ì ±úÁø»óÅ·Π»ý¼º.
    ¿¹) 123ÇѱÛ1 : ¾Õ String(Length:4) -> 123?
                  µÚ String(Length:4) -> ?±Û1    
    ´Ü, Message °ø¹é½Ã -> ""(Empty String)
    
 2. Data Type : Number
    1) Cut
       ´Ü, '-', '.'µµ 1 Byte·Î °£ÁÖÇÑ´Ù.   
    2) Right Trim
    3) ¿ÞÂÊÀ¸·Î Shift
    4) Number »ý¼ºÈÄ Message °´Ã¼¿¡ ÀúÀå
    ´Ü, NumberÀ϶§ À߸øµÈ ÆĽÌÀ¸·Î String Áß°£ Àý»è½Ã Exceptionó¸®
    ´Ü, Message °ø¹é½Ã -> null(Default)
    
    Number Message °ø¹é½Ã ó¸® Option
    1) Message °ªÀÌ Zero -> null
    2) Message °ªÀÌ Space -> Zero
    3) 1,2 µ¿½Ã
       Message °ªÀÌ Zero -> null
       Message °ªÀÌ Space -> Zero
    
 3. Data Type : Date
    1) Length¸¸Å­ Cut
    2) Date Type¿¡ ¸ÂÃç Date °´Ã¼ »ý¼ºÈÄ Message °´Ã¼¿¡ ÀúÀå
    [Áö¿øÇÏ´Â Date Type]
      Length(14) : yyyyMMddHHmmss
      Length(12) : yyyyMMddHHmm
      Length(10) : yyyyMMddHH
      Length(8) : yyyyMMdd
      Length(6) : yyyyMM
      Length(4) : yyyy
      ´Ü, DateÀ϶§ À߸øµÈ ÆĽÌÀ¸·Î String Áß°£ Àý»è½Ã Exceptionó¸®
      ´Ü, Message °ø¹é½Ã -> null
 

Specified by:
makeMessageParsing in interface GlueMessageLayout
Parameters:
messageDefinition - Object
tc - Message ¹®ÀÚ¿­
Returns:
GlueMessage
Throws:
GlueMessageParserException

createMessageObject

public abstract GlueMessage createMessageObject(String message)
Returns:
GlueMessage

getAttributes

public GlueMessageDefinition getAttributes(String key)
                                    throws GlueMessageDefinitionException
Description copied from interface: GlueMessageLayout
ÇØ´ç Msg LayoutÀÇ Attribute Á¤º¸¸¦ ÃßÃâÇÏ´Â Method óÀ½ È£Ãâ½Ã AttributeÀÇ Á¤º¸¸¦ Cache¿¡ ÀúÀåÇÏ°í, Àç È£Ãâ½Ã Cache¸¦ ÅëÇØ Á¤º¸¸¦ ÃßÃâÇÏ¿© Á¦°ø

Specified by:
getAttributes in interface GlueMessageLayout
Parameters:
key - Message ID
Returns:
GlueMessageDefinition
Throws:
GlueMessageDefinitionException

getAttributesDefinition

public abstract List<GlueMessageAttributeDefinition> getAttributesDefinition(String id)
Parameters:
id -
Returns:
GlueMessageAttributeDefinition List

destroy

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


Copyright © 2013–2014 POSCO ICT SWÁ¦Ç°±â¼úÆÀ. All rights reserved.