|
EMGJavaAPI
|
A message with a list of options, to be sent via MGP to the EMG Server. More...
Public Member Functions | |
| Message () | |
| Create a new message. | |
| Message (OptionHolder options) | |
| Create a new message. | |
| Message (BufferedReader in) throws IOException | |
| Create a new message. | |
| Message (String destaddr, String text) | |
| Create a basic text message. | |
| Message (String destaddr, char[] data) | |
| Create a basic text message with binary data. | |
| Message (String destaddr) | |
| Create a basic message with destaddr. | |
| OptionHolder | getOptions () |
| Returns the message options. | |
| void | addOption (MgpOption option) |
| Add an option to this message. | |
| void | addText (String text) |
| Adds message text to this message. | |
| void | addText (char[] data) |
| Add binary message data to this message. | |
| void | addHex (String hex) |
| Add message data which is already hex encoded. | |
| void | addUdh (char[] udh) |
| Add a UDH (User Data Header) to message. | |
| void | deleteOption (MgpOption option) |
| Delete a specific MGP option from message. | |
| String | getId () |
| Gets the message id. | |
| boolean | equals (Message msg) |
| Compare this messge with another. | |
| void | load (BufferedReader in) throws IOException |
| Loads the message options from an input stream. | |
| void | save (BufferedWriter out) throws IOException |
| Saves the message options to an output stream. | |
Private Attributes | |
| OptionHolder | options = null |
| int | charcode = Mgp.MGP_CHARCODE_DEFAULT |
A message with a list of options, to be sent via MGP to the EMG Server.
The message text is hex encoded for safe transportation.
| com::nmt::mgp::Message::Message | ( | ) | [inline] |
Create a new message.
References options.
| com::nmt::mgp::Message::Message | ( | OptionHolder | options | ) | [inline] |
Create a new message.
References options.
| com::nmt::mgp::Message::Message | ( | BufferedReader | in | ) | throws IOException [inline] |
Create a new message.
References com::nmt::mgp::OptionHolder::load(), and options.
| com::nmt::mgp::Message::Message | ( | String | destaddr, |
| String | text | ||
| ) | [inline] |
Create a basic text message.
| destaddr | the destination address, stored as the option Mgp.MGP_OPTION_DESTADDR |
| text | the message text, stored as the option Mgp.MGP_OPTION_MESSAGE |
References com::nmt::mgp::OptionHolder::add(), com::nmt::mgp::Mgp::MGP_OPTION_DESTADDR, com::nmt::mgp::Mgp::MGP_OPTION_MESSAGE, and options.
| com::nmt::mgp::Message::Message | ( | String | destaddr, |
| char[] | data | ||
| ) | [inline] |
Create a basic text message with binary data.
| destaddr | the destination address, stored as the option Mgp.MGP_OPTION_DESTADDR |
| data | the message text, stored as the option Mgp.MGP_OPTION_MESSAGE |
References com::nmt::mgp::OptionHolder::add(), charcode, com::nmt::mgp::Mgp::MGP_CHARCODE_8BIT, com::nmt::mgp::Mgp::MGP_OPTION_DESTADDR, com::nmt::mgp::Mgp::MGP_OPTION_MESSAGE, and options.
| com::nmt::mgp::Message::Message | ( | String | destaddr | ) | [inline] |
Create a basic message with destaddr.
| destaddr | the destination address, stored as the option Mgp.MGP_OPTION_DESTADDR |
References com::nmt::mgp::OptionHolder::add(), com::nmt::mgp::Mgp::MGP_OPTION_DESTADDR, and options.
| void com::nmt::mgp::Message::addHex | ( | String | hex | ) | [inline] |
Add message data which is already hex encoded.
Sets the character code for this message to MGP_CHARCODE_8BIT.
References com::nmt::mgp::OptionHolder::add(), charcode, com::nmt::mgp::Mgp::MGP_CHARCODE_8BIT, com::nmt::mgp::Mgp::MGP_OPTION_MESSAGE, and options.
| void com::nmt::mgp::Message::addOption | ( | MgpOption | option | ) | [inline] |
Add an option to this message.
References com::nmt::mgp::OptionHolder::add(), and options.
| void com::nmt::mgp::Message::addText | ( | char[] | data | ) | [inline] |
Add binary message data to this message.
Sets the character code for message to MGP_CHARCODE_8BIT.
References com::nmt::mgp::OptionHolder::add(), charcode, com::nmt::mgp::Mgp::MGP_CHARCODE_8BIT, com::nmt::mgp::Mgp::MGP_OPTION_MESSAGE, and options.
| void com::nmt::mgp::Message::addText | ( | String | text | ) | [inline] |
Adds message text to this message.
Sets the character code for the message to MGP_CHARCODE_DEFAULT.
References com::nmt::mgp::OptionHolder::add(), charcode, com::nmt::mgp::Mgp::MGP_CHARCODE_DEFAULT, com::nmt::mgp::Mgp::MGP_OPTION_MESSAGE, and options.
| void com::nmt::mgp::Message::addUdh | ( | char[] | udh | ) | [inline] |
Add a UDH (User Data Header) to message.
References com::nmt::mgp::OptionHolder::add(), com::nmt::mgp::Mgp::MGP_OPTION_UDH, and options.
| void com::nmt::mgp::Message::deleteOption | ( | MgpOption | option | ) | [inline] |
Delete a specific MGP option from message.
References com::nmt::mgp::OptionHolder::delete(), and options.
| boolean com::nmt::mgp::Message::equals | ( | Message | msg | ) | [inline] |
| String com::nmt::mgp::Message::getId | ( | ) | [inline] |
Gets the message id.
The MGP option MGP_OPTION_ID is located and returned.
References com::nmt::mgp::OptionHolder::getValue(), com::nmt::mgp::Mgp::MGP_OPTION_ID, and options.
Referenced by equals().
| OptionHolder com::nmt::mgp::Message::getOptions | ( | ) | [inline] |
Returns the message options.
References options.
| void com::nmt::mgp::Message::load | ( | BufferedReader | in | ) | throws IOException [inline] |
Loads the message options from an input stream.
| in | the input stream, already opened |
| IOException | if an error occurs while reading |
References com::nmt::mgp::OptionHolder::load(), and options.
| void com::nmt::mgp::Message::save | ( | BufferedWriter | out | ) | throws IOException [inline] |
Saves the message options to an output stream.
| out | the output stream, already initiated |
| IOException | if an error occurs while writing |
References options, and com::nmt::mgp::OptionHolder::write().
int com::nmt::mgp::Message::charcode = Mgp.MGP_CHARCODE_DEFAULT [private] |
OptionHolder com::nmt::mgp::Message::options = null [private] |
Referenced by addHex(), addOption(), addText(), addUdh(), deleteOption(), getId(), getOptions(), load(), Message(), and save().
1.7.4