
public abstract class GlueAbstractFixedLengthMessageLayout extends Object implements GlueMessageLayout, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
| Modifier and Type | Field and Description |
|---|---|
protected org.slf4j.Logger |
logger
logger
|
static String |
MSG_TYPE_BYTE |
static String |
MSG_TYPE_STRING |
static String |
RULE_NUMBER_NULL_TO_ZERO |
static String |
RULE_STRING_ZERO_TO_SPACE |
| Constructor and Description |
|---|
GlueAbstractFixedLengthMessageLayout() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
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() |
Set<String> |
getMsgParsingRule() |
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 |
setMsgParsingRule(Set<String> msgParsingRule) |
void |
setMsgParsingType(String msgParsingType)
setter method for DI.
|
public static final String MSG_TYPE_BYTE
public static final String MSG_TYPE_STRING
public static final String RULE_NUMBER_NULL_TO_ZERO
public static final String RULE_STRING_ZERO_TO_SPACE
protected org.slf4j.Logger logger
public GlueAbstractFixedLengthMessageLayout()
public GlueCacheManager getCacheManager()
public void setCacheManager(GlueCacheManager cacheManager)
cacheManager - public String getMsgParsingType()
public void setMsgParsingType(String msgParsingType)
msgParsingType - message Parsing Type, byte or Stringpublic Charset getCharset()
public void setCharset(Charset charset)
charset - public String makeMessageString(GlueMessageDefinition messageDefinition, GlueMessage message)
GlueMessageLayout
[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¸¸Å °ø¹é »ý¼º
makeMessageString in interface GlueMessageLayoutmessageDefinition - Message LayoutÀÇ AttributeÇ׸ñ Listmessage - GlueMessage °´Ã¼public GlueMessage makeMessageParsing(GlueMessageDefinition messageDefinition, String tc) throws GlueMessageParserException
GlueMessageLayout
[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
makeMessageParsing in interface GlueMessageLayoutmessageDefinition - Objecttc - Message ¹®ÀÚ¿GlueMessageParserExceptionpublic abstract GlueMessage createMessageObject(String message)
public GlueMessageDefinition getAttributes(String key) throws GlueMessageDefinitionException
GlueMessageLayoutgetAttributes in interface GlueMessageLayoutkey - Message IDGlueMessageDefinitionExceptionpublic abstract List<GlueMessageAttributeDefinition> getAttributesDefinition(String id)
id - public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionCopyright © 2013–2019 POSCO ICT. All rights reserved.