kr.co.hit.live.web.flex.io.type
Class FlexMessage

java.lang.Object
  extended by kr.co.hit.live.web.flex.io.type.FlexObject
      extended by kr.co.hit.live.web.flex.io.type.FlexMessage
All Implemented Interfaces:
Serializable, Map<String,Object>
Direct Known Subclasses:
AsyncMessage, RemotingMessage

public abstract class FlexMessage
extends FlexObject
implements Map<String,Object>

Flex 내부 처리 메시지 클래스들의 상위 클래스이다. (RemotingMessage, CommandMessage, AcknowledgeMessage, ErrorMessage 등) 이 클래스를 상속받아 구현되는 하위 클래스들은 입력 파라메터를 받지 않는 디폴트 생성자와 문자열을 파라메터로 받는 하위 클래스용 생성자를 정의해야 한다. 또한 각 생성자에서는 addSerializedProperty() 메소드를 사용하여 serialze 대상이 되는 필드명을 정의해주어야 한다.

Author:
김형도
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
protected  Map<String,Object> map
          프로퍼티를 관리하기 위한 map 객체이다.
static String MESSAGE_ID
           
protected  List<String> serializeProps
          Serialize 대상이 되는 속성 목록을 담아 놓는다.
 
Fields inherited from class kr.co.hit.live.web.flex.io.type.FlexObject
className, FLEX_IO_PACKAGE_PREFIX, FLEX_MESSAGE_PACKAGE_PREFIX, LIVE_PACKAGE_PREFIX
 
Constructor Summary
FlexMessage(String cname)
          생성자이다.
 
Method Summary
protected  void addSerializedProperties(String propName)
          Serialize 대상이 되는 필드명을 지정하다.
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<String,Object>> entrySet()
           
 Object get(Object key)
           
 Object getBody()
           
 String getClientId()
           
 Object getHeader(String name)
           
 Map<String,Object> getHeaders()
           
 int getInt(String key)
           
 long getLong(String key)
           
 String getMessageId()
           
 List<String> getProperties()
          Serialize 대상 속성명을 반환한다.
 Object getProperty(String name)
           
 String getString(String name)
           
 boolean isEmpty()
           
 Set<String> keySet()
           
 Object put(String key, Object value)
           
 void putAll(Map<? extends String,? extends Object> m)
           
 Object remove(Object key)
           
 void setBody(Object value)
           
 void setClientId(String value)
           
 void setHeader(String name, Object value)
           
 void setMessageId(String value)
           
 void setProperty(String name, Object value)
           
 void setTimestamp(long value)
           
 void setTimeToLive(long value)
           
 int size()
           
 Collection<Object> values()
           
 
Methods inherited from class kr.co.hit.live.web.flex.io.type.FlexObject
getClassName, instantiate, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

MESSAGE_ID

public static final String MESSAGE_ID
See Also:
Constant Field Values

serializeProps

protected List<String> serializeProps
Serialize 대상이 되는 속성 목록을 담아 놓는다. 이 클래스를 상속하는 클래스에서는 생성자에서 serialize 대상 속성을 추가할 수 있다.


map

protected Map<String,Object> map
프로퍼티를 관리하기 위한 map 객체이다.

Constructor Detail

FlexMessage

public FlexMessage(String cname)
생성자이다.

Parameters:
cname - flex에서 정의한 클래스의 패키지 명
Method Detail

addSerializedProperties

protected void addSerializedProperties(String propName)
Serialize 대상이 되는 필드명을 지정하다.

Parameters:
propName -

setHeader

public void setHeader(String name,
                      Object value)

getHeader

public Object getHeader(String name)

getHeaders

public Map<String,Object> getHeaders()

getClientId

public String getClientId()

setClientId

public void setClientId(String value)

getMessageId

public String getMessageId()

setMessageId

public void setMessageId(String value)

setTimestamp

public void setTimestamp(long value)

setTimeToLive

public void setTimeToLive(long value)

getBody

public Object getBody()

setBody

public void setBody(Object value)

getString

public String getString(String name)

getInt

public int getInt(String key)

getLong

public long getLong(String key)

clear

public void clear()
Specified by:
clear in interface Map<String,Object>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<String,Object>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<String,Object>

entrySet

public Set<Map.Entry<String,Object>> entrySet()
Specified by:
entrySet in interface Map<String,Object>

get

public Object get(Object key)
Specified by:
get in interface Map<String,Object>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<String,Object>

keySet

public Set<String> keySet()
Specified by:
keySet in interface Map<String,Object>

put

public Object put(String key,
                  Object value)
Specified by:
put in interface Map<String,Object>

putAll

public void putAll(Map<? extends String,? extends Object> m)
Specified by:
putAll in interface Map<String,Object>

remove

public Object remove(Object key)
Specified by:
remove in interface Map<String,Object>

size

public int size()
Specified by:
size in interface Map<String,Object>

values

public Collection<Object> values()
Specified by:
values in interface Map<String,Object>

getProperties

public List<String> getProperties()
Serialize 대상 속성명을 반환한다. PropertyProvider interface의 메소드?

Returns:

getProperty

public Object getProperty(String name)

setProperty

public void setProperty(String name,
                        Object value)


Copyright © 2014. All Rights Reserved.