AP&C API Reference
Public Member Functions | Protected Member Functions | Properties | List of all members
Apac.Messaging.Message Class Reference

This class provides the data structure for both outgoing (queued) and archived messages. More...

Inheritance diagram for Apac.Messaging.Message:
Apac.Messaging.Messages.ConfigurationMessage Apac.Messaging.Messages.AddQueueConfigMessage Apac.Messaging.Messages.RemoveQueueConfigMessage

Public Member Functions

 Message (string queue, MessageType type, string subject, string body, string initiatingProcess, string initiatingUser)
 Creates a new message instance. More...
 
 Message ()
 Parameterless constructor provided for XML serialization. More...
 
void AddProperty (string propertyName, object data)
 Puts an object in the property bag, which is the extended data for the message, apart from the message content. This data is stored with the message but is not delivered along with it. It can be used to drive any special handling required for the message, but standard handlers ignore it. More...
 
object GetProperty (string propertyName)
 Dips into the property bag and returns the extended data with the given name. More...
 
List< DeliveryStatusGetHistoryByProtocol (MessagingProtocols protocol)
 Gets sublist of delivery status messages that match the requested protocol sorted by timestamp (ascending). More...
 
void GetObjectData (SerializationInfo info, StreamingContext context)
 The serializing method for binary data. More...
 
System.Xml.Schema.XmlSchema GetSchema ()
 This method is a no-op. We have opted to use the System.Xml.Serialization.XmlSchemaProviderAttribute instead. More...
 
void ReadXml (System.Xml.XmlReader reader)
 Deserializes object data from XML format. More...
 
void WriteXml (System.Xml.XmlWriter writer)
 Serializes object data to XML format. More...
 

Protected Member Functions

 Message (SerializationInfo info, StreamingContext context)
 Deserializes a message from binary format. More...
 
virtual void OnReadXml (System.Xml.XmlReader reader)
 The virtual plug-in point for XML deserialization, for subclasses to participate. More...
 
virtual void OnWriteXml (System.Xml.XmlWriter writer)
 The virtual plug-in point for XML serialization, for subclasses to participate. More...
 

Properties

Guid Id [get]
 Gets the auto-generated unique ID for this message. More...
 
string Queue [get, protected set]
 Gets the designated queue for the message. This provides scope isolation within the messaging system and can be used to securely partition storage space between different security contexts (eg: two banks using the same server can have their messages segregated by queue, each with its own exclusive permissions). More...
 
MessageType Type [get, protected set]
 The category to which this message belongs. This provides message routing within the message handling control structures. See MessageType for details about each type. More...
 
string Subject [get, protected set]
 Gets the brief summary or topic for the message. More...
 
string Body [get, protected set]
 Gets the content of the message. More...
 
string BodyAsHTML [get]
 Gets the content of the message wrapped in an HTML document. More...
 
string InitiatingProcess [get, protected set]
 Gets the name of the process (or class and method) that created the notification request for this message. This information is included as an auditing and statistical analysis metric. More...
 
string InitiatingUser [get, protected set]
 Gets the name of the user identity under which the InitiatingProcess is executing. Thei information is included as an auditing and statistical analysis metric. More...
 
List< DeliveryStatusDeliveryHistory [get]
 Gets the whole unsorted list of delivery status entries for the life of the message. More...
 
string AuditID [get]
 Returns the Audit Identification value that can be used to track this message. More...
 
string Hostname [get]
 The hostname of the system where the message was originally created. More...
 
string Text [get]
 Returns the Body and AuditID concatenated together. More...
 

Detailed Description

This class provides the data structure for both outgoing (queued) and archived messages.

Constructor & Destructor Documentation

◆ Message() [1/3]

Apac.Messaging.Message.Message ( string  queue,
MessageType  type,
string  subject,
string  body,
string  initiatingProcess,
string  initiatingUser 
)
inline

Creates a new message instance.

Parameters
queueThe isolated partition to which the message is destined.
typeThe type of content in the message. See MessageType.
subjectA short summary of the message indicating its purpose.
bodyThe content of the message.
initiatingProcessThe name of the process (or class) that sent the notification.
initiatingUserThe name of the user running the process that sent the notification.

◆ Message() [2/3]

Apac.Messaging.Message.Message ( )
inline

Parameterless constructor provided for XML serialization.

◆ Message() [3/3]

Apac.Messaging.Message.Message ( SerializationInfo  info,
StreamingContext  context 
)
inlineprotected

Deserializes a message from binary format.

Parameters
infoSee SerializationInfo.
contextSee StreamingContext.

Member Function Documentation

◆ AddProperty()

void Apac.Messaging.Message.AddProperty ( string  propertyName,
object  data 
)
inline

Puts an object in the property bag, which is the extended data for the message, apart from the message content. This data is stored with the message but is not delivered along with it. It can be used to drive any special handling required for the message, but standard handlers ignore it.

Parameters
propertyNameThe name of the property to be stored.
dataThe data to be stored for the property. The data object must support serialization and XML serialization or the message will fail to persist the property with the rest of the message.
Exceptions
ArgumentExceptionIf the property already exists in the property bag.

◆ GetHistoryByProtocol()

List<DeliveryStatus> Apac.Messaging.Message.GetHistoryByProtocol ( MessagingProtocols  protocol)
inline

Gets sublist of delivery status messages that match the requested protocol sorted by timestamp (ascending).

Parameters
protocolThe protocol for which status entries are wanted.
Returns
Returns a subset of the delivery status history filtered by the given protocol.

◆ GetObjectData()

void Apac.Messaging.Message.GetObjectData ( SerializationInfo  info,
StreamingContext  context 
)
inline

The serializing method for binary data.

Parameters
infoSee SerializationInfo.
contextSee StreamingContext.

◆ GetProperty()

object Apac.Messaging.Message.GetProperty ( string  propertyName)
inline

Dips into the property bag and returns the extended data with the given name.

Parameters
propertyNameThe name of the property to retrieve.
Returns
Returns the object data for propertyName or null if the property is not in the bag.

◆ GetSchema()

System.Xml.Schema.XmlSchema Apac.Messaging.Message.GetSchema ( )
inline

This method is a no-op. We have opted to use the System.Xml.Serialization.XmlSchemaProviderAttribute instead.

Returns
Returns null.

◆ OnReadXml()

virtual void Apac.Messaging.Message.OnReadXml ( System.Xml.XmlReader  reader)
inlineprotectedvirtual

The virtual plug-in point for XML deserialization, for subclasses to participate.

Parameters
readerThe System.Xml.XmlReader containing the serialized data.

◆ OnWriteXml()

virtual void Apac.Messaging.Message.OnWriteXml ( System.Xml.XmlWriter  writer)
inlineprotectedvirtual

The virtual plug-in point for XML serialization, for subclasses to participate.

Parameters
writerThe System.Xml.XmlWriter receiving the serialized data.

◆ ReadXml()

void Apac.Messaging.Message.ReadXml ( System.Xml.XmlReader  reader)
inline

Deserializes object data from XML format.

Parameters
readerThe System.Xml.XmlReader containing the serialized data.

◆ WriteXml()

void Apac.Messaging.Message.WriteXml ( System.Xml.XmlWriter  writer)
inline

Serializes object data to XML format.

Parameters
writerThe System.Xml.XmlWriter receiving the serialized data.

Property Documentation

◆ AuditID

string Apac.Messaging.Message.AuditID
get

Returns the Audit Identification value that can be used to track this message.

◆ Body

string Apac.Messaging.Message.Body
getprotected set

Gets the content of the message.

◆ BodyAsHTML

string Apac.Messaging.Message.BodyAsHTML
get

Gets the content of the message wrapped in an HTML document.

◆ DeliveryHistory

List<DeliveryStatus> Apac.Messaging.Message.DeliveryHistory
get

Gets the whole unsorted list of delivery status entries for the life of the message.

◆ Hostname

string Apac.Messaging.Message.Hostname
get

The hostname of the system where the message was originally created.

◆ Id

Guid Apac.Messaging.Message.Id
get

Gets the auto-generated unique ID for this message.

◆ InitiatingProcess

string Apac.Messaging.Message.InitiatingProcess
getprotected set

Gets the name of the process (or class and method) that created the notification request for this message. This information is included as an auditing and statistical analysis metric.

◆ InitiatingUser

string Apac.Messaging.Message.InitiatingUser
getprotected set

Gets the name of the user identity under which the InitiatingProcess is executing. Thei information is included as an auditing and statistical analysis metric.

◆ Queue

string Apac.Messaging.Message.Queue
getprotected set

Gets the designated queue for the message. This provides scope isolation within the messaging system and can be used to securely partition storage space between different security contexts (eg: two banks using the same server can have their messages segregated by queue, each with its own exclusive permissions).

◆ Subject

string Apac.Messaging.Message.Subject
getprotected set

Gets the brief summary or topic for the message.

◆ Text

string Apac.Messaging.Message.Text
get

Returns the Body and AuditID concatenated together.

◆ Type

MessageType Apac.Messaging.Message.Type
getprotected set

The category to which this message belongs. This provides message routing within the message handling control structures. See MessageType for details about each type.


The documentation for this class was generated from the following file: