|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMessage
The common interface for all messages supported by the Raccoon Framework.
Method Summary | |
---|---|
void |
addMsgField(IField pField)
Adds a new field instance to the list of fields. |
void |
append(java.lang.String pFieldName,
boolean pFieldData)
Adds to this message a new field that represents a boolean. |
void |
append(java.lang.String pFieldName,
int pFieldData)
Adds to this message a new field that represents an int. |
void |
append(java.lang.String pFieldName,
long pFieldData)
Adds to this message a new field that represents an long. |
void |
append(java.lang.String pFieldName,
java.lang.Object pFieldData)
Adds to this message a new field. |
void |
append(java.lang.String pFieldName,
java.lang.Object pFieldData,
int pFieldType,
int pFieldId)
Adds to this message a new field. |
void |
append(java.lang.String pFieldName,
short pFieldData)
Adds to this message a new field that represents a short. |
IField |
getMsgField(int pFieldId)
Retrieves the field according to it's id. |
IField |
getMsgField(java.lang.String pFieldName)
Retrieves the field according to it's name. |
IField |
getMsgFieldAt(int pIndex)
Retrieves the field located at the specified index. |
java.util.Collection |
getMsgFields()
Retrieves the fields attached to this instance. |
long |
getMsgSize()
Retrieves the size of the message in bytes. |
java.lang.String |
getName()
Retrieves the name of this instance. |
java.lang.Object |
getNativeMsg()
Retrieve the native representation of this instance. |
long |
getSequence()
The sequence number of this given message. |
java.util.Map |
hashMsgFields()
Retrieves a Map instance containing the messages fields. |
int |
nbMsgFields()
Retrieves the number of fields attached to this instance. |
boolean |
removeMsgField(int pFieldID)
Removes the field located at the specified index. |
boolean |
removeMsgField(java.lang.String pFieldName)
Removes the first instance of the field by it's name. |
boolean |
removeMsgFieldAt(int pIndex)
Removes the field located at the specified index. |
void |
setMsgFields(java.util.Collection pFields)
Defines the fields attached to this instance. |
void |
setName(java.lang.String pName)
Defines the name of this instance. |
void |
updateField(java.lang.String pFieldPath,
java.lang.Object pNewValue)
Updates the content of the given field. |
Method Detail |
---|
void setName(java.lang.String pName)
pName
- the name of this instancejava.lang.String getName()
void setMsgFields(java.util.Collection pFields)
pFields
- a collection of IField
'sjava.util.Collection getMsgFields()
IField
'svoid addMsgField(IField pField) throws java.lang.IllegalArgumentException
pField
- the field instance to append to the list of current fields
java.lang.IllegalArgumentException
- if the field id is already used by another field and is different from zero.
java.lang.IllegalArgumentException
- if the data type is invalid or doesn't correspond to the data.IField getMsgField(java.lang.String pFieldName)
pFieldName
- the name of the field
null
if the field doesn't exist.IField getMsgField(int pFieldId) throws java.lang.IllegalArgumentException
pFieldId
- the field ID of the desired field
null
if the field ID doesn't exist.
java.lang.IllegalArgumentException
- if the field ID is less than 1.IField getMsgFieldAt(int pIndex) throws java.lang.IndexOutOfBoundsException, java.lang.InternalError
pIndex
- the position of the field within the message
IField
corresponding to the index
java.lang.IndexOutOfBoundsException
- if the index is greater than the number of fields.
java.lang.InternalError
- if the contents of this message are corruptednbMsgFields()
boolean removeMsgField(java.lang.String pFieldName) throws java.lang.IllegalArgumentException
pFieldName
- the name of the field that is to be removed.
true
if the removal was a success,
false
otherwise (field not found or can't remove).
java.lang.IllegalArgumentException
- the name of the fieldName is null.boolean removeMsgFieldAt(int pIndex) throws java.lang.IllegalArgumentException
pIndex
- the name of the field that is to be removed.
true
if the removal was a success, false
otherwise.
java.lang.IllegalArgumentException
- the name of the fiels is null.boolean removeMsgField(int pFieldID) throws java.lang.IndexOutOfBoundsException, java.lang.IllegalArgumentException
IField
element,
unless the field ID is equal to zero, in which case the field doesn't have a field ID.
pFieldID
- the ID of the field to be removed.
true
if the removal was a success, false
otherwise.
java.lang.IndexOutOfBoundsException
- if the provided ID is out of range
java.lang.IllegalArgumentException
- if the field ID is equal to zero.java.util.Map hashMsgFields()
Map
instance containing the messages fields.
Map
of IField
s where the key is the field name.void append(java.lang.String pFieldName, java.lang.Object pFieldData) throws java.lang.IllegalArgumentException
pFieldName
- the name of the fieldpFieldData
- the data associated to the field
java.lang.IllegalArgumentException
- if one of the given arguments are invalid.IField.setName(String)
,
IField.setData(Object)
void append(java.lang.String pFieldName, boolean pFieldData) throws java.lang.IllegalArgumentException
pFieldName
- the name of the fieldpFieldData
- the data associated to the field
java.lang.IllegalArgumentException
- if one of the parameters is invalidIField.setName(String)
,
IField.setData(Object)
void append(java.lang.String pFieldName, short pFieldData) throws java.lang.IllegalArgumentException
pFieldName
- the name of the fieldpFieldData
- the data associated to the field
java.lang.IllegalArgumentException
- if one of the parameters is invalidIField.setName(String)
,
IField.setData(Object)
void append(java.lang.String pFieldName, int pFieldData) throws java.lang.IllegalArgumentException
pFieldName
- the name of the fieldpFieldData
- the data associated to the field
java.lang.IllegalArgumentException
- if one of the parameters is invalidIField.setName(String)
,
IField.setData(Object)
void append(java.lang.String pFieldName, long pFieldData) throws java.lang.IllegalArgumentException
pFieldName
- the name of the fieldpFieldData
- the data associated to the field
java.lang.IllegalArgumentException
- if one of the parameters is invalidIField.setName(String)
,
IField.setData(Object)
void append(java.lang.String pFieldName, java.lang.Object pFieldData, int pFieldType, int pFieldId) throws java.lang.IllegalArgumentException
pFieldName
- the name of the fieldpFieldData
- the data associated to the fieldpFieldType
- the type of the data associated to the fieldpFieldId
- the id of the new field to add
java.lang.IllegalArgumentException
- if one of the given arguments are invalid.IField.setName(String)
,
IField.setData(Object)
,
IField.setType(int)
,
IField.setId(int)
int nbMsgFields()
IField
elements contained by this messagelong getMsgSize()
java.lang.Object getNativeMsg()
void updateField(java.lang.String pFieldPath, java.lang.Object pNewValue)
pFieldPath
- the path to the field.pNewValue
- the new value, must be same type as previous value.long getSequence()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |