|
Configuration Platform SDK 7.6 API Reference | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.platform.commons.connection.ConnectionMessage
Message to/from server. The message usually consists of its id and
set of attributes. Each attribute has its own id (or type). The message
can't contain two (or more) attributes with the same id, so calling
put
method several times with the same id will replace
attributes in the message.
Constructor Summary | |
ConnectionMessage(int id)
Creates the message. |
|
ConnectionMessage(int id,
int attrCount)
Creates the message with known attribute count. |
Method Summary | |
void |
add(int id,
byte[] val)
Add binary (byte array) attribute to this message. |
void |
add(int id,
int val)
Add integer attribute to this message. |
void |
add(int id,
java.lang.Integer val)
Add integer attribute to this message. |
void |
add(int id,
KeyValueCollection val)
Add KeyValueCollection attribute to this message. |
void |
add(int id,
KeyValueCollection val,
java.lang.String encoding)
Add KeyValueCollection attribute to this message. |
void |
add(int id,
long val)
Add long attribute to this message. |
void |
add(int id,
java.lang.Long val)
Add long attribute to this message. |
void |
add(int id,
java.lang.String val)
Add string attribute to this message. |
java.lang.Object |
clone()
|
java.lang.Object |
deleteAttrib(int id)
Delete attribyte by ID. |
int |
getAttributeCount()
Get number of attributes in this Message |
java.util.Iterator |
getAttributeIds()
Get attribute ids in this message as Iterator through Integer objects. |
byte[] |
getBinary(int id)
Get binary (byte array) attribute value from the Message by ID. |
java.util.Iterator |
getEntries()
Get attributes and their ids in this message as Iterator through Map.Entry objects. |
java.lang.Integer |
getInt(int id)
Get integer attribute value from the essage by ID. |
KeyValueCollection |
getKeyValueCollection(int id)
Get KeyValueCollection attribute value from the Message by ID. |
KeyValueCollection |
getKeyValueCollection(int id,
java.lang.String encoding)
Get KeyValueCollection attribute value from the Message by ID. |
java.lang.Long |
getLong(int id)
Get long attribute value from the Message by ID. |
int |
getMessageId()
Return message id (type) |
java.lang.Object |
getObject(int id)
Get attribute value from the Message by ID. |
java.lang.String |
getString(int id)
Get string attribute value from the Message by ID. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ConnectionMessage(int id)
id
- message id (or type)public ConnectionMessage(int id, int attrCount)
id
- message id (or type)Method Detail |
public int getMessageId()
public void add(int id, int val)
id
- Attribute ID.val
- Attribute value.public void add(int id, java.lang.Integer val)
id
- Attribute ID.val
- Attribute value.public void add(int id, long val)
id
- Attribute ID.val
- Attribute value.public void add(int id, java.lang.Long val)
id
- Attribute ID.val
- Attribute value.public void add(int id, java.lang.String val)
id
- Attribute ID.val
- Attribute value.public void add(int id, byte[] val)
id
- Attribute ID.val
- Attribute value.public void add(int id, KeyValueCollection val)
id
- Attribute ID.val
- Attribute value.public void add(int id, KeyValueCollection val, java.lang.String encoding) throws java.io.UnsupportedEncodingException
id
- Attribute ID.val
- Attribute value.
java.io.UnsupportedEncodingException
public java.lang.Object deleteAttrib(int id)
id
- Attribute ID.
null
if no such attribute in the ConnectionMessage
public java.lang.Integer getInt(int id)
id
- Attribute ID.
null
if there is
no such attribute in the ConnectionMessage
or it has wrong type.public java.lang.Long getLong(int id)
id
- Attribute ID.
null
if there is
no such attribute in the ConnectionMessage
or it has wrong type.public java.lang.String getString(int id)
id
- Attribute ID.
null
if there is
no such attribute in the ConnectionMessage
or it has wrong type.public byte[] getBinary(int id)
id
- Attribute ID.
null
if there is
no such attribute in the ConnectionMessage
or it has wrong type.public KeyValueCollection getKeyValueCollection(int id)
KeyValueCollection
attribute value from the Message by ID.
id
- Attribute ID.
null
if there is
no such attribute in the ConnectionMessage
or it has wrong type.public KeyValueCollection getKeyValueCollection(int id, java.lang.String encoding) throws java.io.UnsupportedEncodingException
KeyValueCollection
attribute value from the Message by ID.
id
- Attribute ID.
null
if there is
no such attribute in the ConnectionMessage
or it has wrong type.
java.io.UnsupportedEncodingException
public java.lang.Object getObject(int id)
id
- Attribute ID.
null
if there is
no such attribute in the ConnectionMessage
.public java.util.Iterator getAttributeIds()
Integer
objects.
public java.util.Iterator getEntries()
Map.Entry
objects. The key in the entry is
Integer
object and the value is Object.
public int getAttributeCount()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
public java.lang.String toString()
|
Configuration Platform SDK 7.6 API Reference | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |