A message factory is used to create DataSource messages that can be published to other DataSources.
More...
Inherited by Caplin.DataSource.Messaging.IInternalMessageFactory.
|
IContainerMessage | CreateContainerMessage (string subject) |
| Create a message that defines a container. The name of the container is the given subject. More...
|
|
IGenericMessage | CreateGenericMessage (string subject) |
| Creates a Generic message to which Generic structured data can be added. More...
|
|
IMappingMessage | CreateMappingMessage (string subject, string mapping) |
| Create a new mapping message; More...
|
|
INewsMessage | CreateNewsMessage (string subject, string headline, string storyReference, string newsDateTime) |
| Creates a News message for the given subject. More...
|
|
IPageMessage | CreatePageMessage (string subject, int maxColumns, int maxRows) |
| Creates a Page message for the given subject. More...
|
|
IPermissionMessage | CreatePermissionMessage (string subject, string key) |
| Creates a Permission message for the given subject. More...
|
|
IRecordType1Message | CreateRecordType1Message (string subject) |
| Creates a Record message to which Type 1 structured data can be added. More...
|
|
IRecordType2Message | CreateRecordType2Message (string subject, string type2Indexfield, string type2IndexValue) |
| Creates a Record message to which Type 2 structured data can be added. More...
|
|
IRecordType3Message | CreateRecordType3Message (string subject) |
| Creates a Record message to which Type 3 structured data can be added. More...
|
|
IStoryMessage | CreateStoryMessage (string subject, string text) |
| Creates a story message for the given subject. More...
|
|
ISubjectErrorEvent | CreateSubjectErrorEvent (string subject, SubjectError error, params SubjectErrorFlags[] flags) |
| Creates a subject error event. More...
|
|
ISubjectStatusEvent | CreateSubjectStatusEvent (string subject, SubjectStatus status, string message) |
| Creates a subject status event. More...
|
|
IWrapperMessage | CreateWrapperMessage (string subject) |
| Create a new wrapper message; More...
|
|
A message factory is used to create DataSource messages that can be published to other DataSources.
IContainerMessage Caplin.DataSource.Messaging.IMessageFactory.CreateContainerMessage |
( |
string |
subject | ) |
|
Create a message that defines a container. The name of the container is the given subject.
- Parameters
-
subject | The subject defining the name of the container. |
- Returns
- A message defining the container.
IGenericMessage Caplin.DataSource.Messaging.IMessageFactory.CreateGenericMessage |
( |
string |
subject | ) |
|
Creates a Generic message to which Generic structured data can be added.
- Parameters
-
subject | The subject of the Message. |
- Returns
- A new Generic message.
Generic messages can be used without specifying field mappings in a separate adapter configuration file. This may be useful when receiving updates from a provider which supplies a variable or unknown number of fields.
The returned message contains no data. To populate the message with data, use the appropriate methods of Caplin.DataSource.Messaging.Record.IGenericMessage.
IMappingMessage Caplin.DataSource.Messaging.IMessageFactory.CreateMappingMessage |
( |
string |
subject, |
|
|
string |
mapping |
|
) |
| |
Create a new mapping message;
- Parameters
-
subject | The original subject. |
mapping | The new subject that the remote peer must request to satisfy the subscription. |
- Returns
- A new mapping message.
INewsMessage Caplin.DataSource.Messaging.IMessageFactory.CreateNewsMessage |
( |
string |
subject, |
|
|
string |
headline, |
|
|
string |
storyReference, |
|
|
string |
newsDateTime |
|
) |
| |
Creates a News message for the given subject.
- Parameters
-
subject | The subject identifying the news message. |
headline | The news headline. |
storyReference | The reference to the news story associated with the headline. |
newsDateTime | The date and time of the news headline. |
- Returns
- A new News message.
IPageMessage Caplin.DataSource.Messaging.IMessageFactory.CreatePageMessage |
( |
string |
subject, |
|
|
int |
maxColumns, |
|
|
int |
maxRows |
|
) |
| |
Creates a Page message for the given subject.
- Parameters
-
subject | The subject of the page message. |
maxColumns | The maximum horizontal size of the page in columns of text characters. |
maxRows | The maximum vertical size of the page in rows of text. |
- Returns
- A new Page Message.
The returned message contains no data. To populate the message with data, use the appropriate methods of Caplin.DataSource.Messaging.Page.IPageMessage.
IPermissionMessage Caplin.DataSource.Messaging.IMessageFactory.CreatePermissionMessage |
( |
string |
subject, |
|
|
string |
key |
|
) |
| |
IRecordType1Message Caplin.DataSource.Messaging.IMessageFactory.CreateRecordType1Message |
( |
string |
subject | ) |
|
IRecordType2Message Caplin.DataSource.Messaging.IMessageFactory.CreateRecordType2Message |
( |
string |
subject, |
|
|
string |
type2Indexfield, |
|
|
string |
type2IndexValue |
|
) |
| |
Creates a Record message to which Type 2 structured data can be added.
- Parameters
-
subject | The subject of the Record. |
type2Indexfield | Field name of the type2 index. |
type2IndexValue | The value of the type2 index. |
- Returns
- A new Type 2 Record message.
The returned message contains no data. To populate the message with data, use the appropriate methods of Caplin.DataSource.Messaging.Record.IRecordType2Message.
IRecordType3Message Caplin.DataSource.Messaging.IMessageFactory.CreateRecordType3Message |
( |
string |
subject | ) |
|
IStoryMessage Caplin.DataSource.Messaging.IMessageFactory.CreateStoryMessage |
( |
string |
subject, |
|
|
string |
text |
|
) |
| |
Creates a story message for the given subject.
- Parameters
-
subject | The subject. |
text | The story text. |
- Returns
- A new Story message.
Creates a subject error event.
- Parameters
-
subject | The subject to which the error relates. |
error | The error. |
flags | Additional Flags to be applied to the SubjectError message. |
- Returns
- A subject error event.
The following example shows how to create an ISubjectErrorEvent for a specified subject, and send it to all peers that have requested that subject:
namespace DataSourceExamples.Messaging
{
public class ClassSubjectError
{
public void SendSubjectErrorEvent(IPublisher publisher, string subject)
{
ISubjectErrorEvent ev = publisher.MessageFactory.CreateSubjectErrorEvent(subject,
SubjectError.NotFound);
publisher.PublishSubjectErrorEvent(ev);
}
}
}
Creates a subject status event.
- Parameters
-
subject | The subject to which the status relates. |
status | The status. |
message | A free form textual message indicating the reason for the status message being raised. |
- Returns
- A subject status event.
The following example shows how to create an ISubjectStatusEvent for a specified subject, and send it to all peers that have requested that subject.
namespace DataSourceExamples.Messaging
{
public class SendSubjectStatusEvent
{
void SendSubjectStatusToSubscribedPeers(IPublisher publisher, string subject)
{
ISubjectStatusEvent ev = publisher.MessageFactory.CreateSubjectStatusEvent(subject,
SubjectStatus.Stale,
"Object is stale");
publisher.PublishSubjectStatusEvent(ev);
}
}
}
IWrapperMessage Caplin.DataSource.Messaging.IMessageFactory.CreateWrapperMessage |
( |
string |
subject | ) |
|
Create a new wrapper message;
- Parameters
-
- Returns
- A new wrapper message.