[This is preliminary documentation and is subject to change.]
| C# | Visual Basic | Visual C++ |
public interface IMessageInfo
Public Interface IMessageInfo
public interface class IMessageInfo
| All Members | Methods | Properties | |||
| Icon | Member | Description |
|---|---|---|
| AttributeNames | Gets the names of all attributes. Implementations of this interface may
define attributes to hold values specific to the messaging protocol.
| |
| GetAttribute(String) | Gets the value of an attribute. Implementations of this interface may
define attributes to hold values specific to the messaging protocol.
| |
| Message | Gets the content of the raw XML message | |
| PayloadTag | Gets the SIF payload message element tag | |
| PayloadType | Gets the SIF payload message type | |
| SetAttribute(String, String) | Sets the value of an attribute. Implementations of this interface may
define attributes to hold values specific to the messaging protocol.
| |
| Zone | Gets the zone from which the message originated |
A concrete implementation of this interface is available for each messaging protocol supported by the ADK. For instance, the SifMessageInfo class provides access to specific information regarding Schools Interoperability Framework SIF_Message envelopes and SIF_Header headers.
Raw XML Message Content
When the adk.keepMessageContent agent property is enabled, the Message property will return the XML document that was received as a single String. When this option is disabled (the default), the ADK does not keep a copy of raw message content in memory and will return a null value.
Using MessageInfo in Message Handlers
A MessageInfo instance is passed as a parameter to message handlers such as Publisher.onRequest and Subscriber.onEvent. Cast the parameter to a concrete type to obtain protocol-specific information about the message.
public void onEvent( Event event, Zone zone, MessageInfo info ) { // Cast to SIFMessageInfo to get SIF-specific header info SIFMessageInfo inf = (SIFMessageInfo)info; // Obtain SIF-specific header values String sourceId = inf.getSourceId(); String msgId = inf.getMsgId(); SIFVersion version = inf.getSIFVersion(); // Display some information about this SIF_Event... System.out.println( "SIF_Event message with ID " + msgId + " received from agent " + sourceId + " in zone " + zone.getZoneId() + "." " This is a SIF " + version.toString() + " message." ); ...