Provides fields storing standard message property names.
public interface MessageProperties
All members of MessageProperties interface, including all inherited members.
Name | Description |
---|---|
For "system" queue messages, the network adapter that is being used to connect to the QAnywhere server. | |
This property name refers to a delimited list of network adapters that can be used to connect to the QAnywhere server. | |
This property name refers to the number of attempts that have been made so far to deliver the message. | |
For "system" queue messages, the IP address of the network adapter that is being used to connect to the QAnywhere server. | |
For "system" queue messages, the MAC address of the network adapter that is being used to connect to the QAnywhere server. | |
This property name refers to MessageType enumeration values associated with a QAnywhere message. | |
This property name refers to the state of the network connection. | |
This property name refers to the message store ID of the originator of the message. | |
For "system" queue messages, the RAS entry name that is being used to connect to the QAnywhere server. | |
For "system" queue messages, a delimited list of RAS entry names that can be used to connect to the QAnywhere server. | |
This property name refers to the current status of the message. | |
This property name refers to the time at which the message assumed its current status. | |
This property name refers to the current transmission status of the message. |
The MessageProperties class provides standard message property names. You can pass MessageProperties fields to QAMessage methods used to get and set message properties.
For example, assume you have the following QAMessage instance:
QAMessage msg = mgr.createTextMessage(); |
The following example gets the value corresponding to MessageProperties.MSG_TYPE using the QAMessage.getIntProperty(String) method. The MessageType enumeration maps the integer result to an appropriate message type.
int msg_type = t_msg.getIntProperty( MessageProperties.MSG_TYPE ); |
The following example shows the onSystemMessage(QAMessage) method, which is used to handle QAnywhere system messages.
The message type is evaluated using MessageProperties.MSG_TYPE variable and the QAMessage.getIntProperty(String) method.
A delimited list of RAS entry names is obtained using MessageProperties.RASNAMES and the QAMessage.getStringProperty(String) method.
private void onSystemMessage(QAMessage msg) { QATextMessage t_msg; int msg_type; String network_adapters; String network_names; String network_info; t_msg = (QATextMessage)msg; if( t_msg != null ) { // Evaluate the message type. msg_type = (MessageType)t_msg.getIntProperty( MessageProperties.MSG_TYPE ); if( msg_type == MessageType.NETWORK_STATUS_NOTIFICATION ) { // Handle network status notification. network_info = ""; network_adapters = t_msg.getStringProperty( MessageProperties.ADAPTERS ); if( network_adapters != null && network_adapters.length > 0) { network_info += network_adapters; } network_names = t_msg.getStringProperty( MessageProperties.RASNAMES ); //... } } } |
ADAPTER variable
ADAPTERS variable
DELIVERY_COUNT variable
IP variable
MAC variable
MSG_TYPE variable
NETWORK_STATUS variable
ORIGINATOR variable
RAS variable
RASNAMES variable
STATUS variable
STATUS_TIME variable
TRANSMISSION_STATUS variable
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |