SubscriptionEventHandlerBase Class Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Provides a base class for a Content Studio Subscription related event handler.
Inheritance Hierarchy

SystemObject
  ContentStudio.Document.Subscription.EventHandlerSubscriptionEventHandlerBase
    ContentStudio.Document.Subscription.EventHandlerMailSubscriptionHandler

Namespace: ContentStudio.Document.Subscription.EventHandler
Assembly: CSSubscriptionEventHandler (in CSSubscriptionEventHandler.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax

public abstract class SubscriptionEventHandlerBase : ICSAsyncEventHandler, 
	IDisposable

The SubscriptionEventHandlerBase type exposes the following members.

Constructors

  NameDescription
Protected methodSubscriptionEventHandlerBase
Initializes a new instance of the SubscriptionEventHandlerBase class.
Top
Properties

  NameDescription
Protected propertyConnectionId
Protected propertyContent Obsolete.
Protected propertyCredentials
Gets the credentials to use when communicating with the message server. The data was passed in the content argument of the EventHandler(Int32, Int32, String, String, ICSCredentialsContainer, Int32, String) method inc combination with the xml passed in.
Protected propertyEventId
Protected propertyExtendedProperties
Gets or a collections of extended properties that was sent to the event handler.
Public propertyFailedCount
Gets or sets the number of subscribers to whom a message was not sent for some reason.
Protected propertyLogger
Gets or sets the logger object that is used when logging to a syslog.
Protected propertyProperties
Gets the regular properties that was passed in to the event handler.
Public propertySendCount
Gets or gets the number of sent messages.
Protected propertySessionId
Gets the numeric value of the session used by the Service Manager when it communicates with Content Studio.
Public propertyStatusText
Gets the status text that is sent back to the Service Manager after that the event handler has finished. For success this value can be "OK" or "Success". The status can also be an informative message that should be logged in the Content Studio event log.
Public propertySubscribers
Gets or gets the number of found subscribers.
Protected propertySubscriptionTypeHandled
Gets or sets the subscription type handled.
Protected propertyTimeOut
Top
Methods

  NameDescription
Protected methodCreateLogger
Creates the logger object that logs events to its implementation of the ISysLogWriter interface.
Protected methodCreateMessage
When implemented in derived class creates a message to be sent out to subscribers. This method gets called once from the event handler.
Public methodDispose
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Protected methodDispose(Boolean)
Releases unmanaged and - optionally - managed resources
Public methodEquals (Inherited from Object.)
Public methodEventHandler
Defines an asyncronous Content Studio event handler. This method gets called by Content Studio Service Manager when it needs to handle a subscription related event.
Protected methodFinalize
Releases unmanaged resources and performs other cleanup operations before the SubscriptionEventHandlerBase is reclaimed by garbage collection.
(Overrides ObjectFinalize.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodReadData
Gets a list of subscribers that should receive messages.
Protected methodSendMessage
When implemented in derived classes sends the message to the specified subscriber.
Protected methodSetStatus
Sets the status text that is sent back to the Service Manager after that the event handler has finished.
Public methodToString (Inherited from Object.)
Protected methodValidateEvent
When implemented in derived classes, checks if the the event passed in is valid for this implementation.
Protected methodValidateMessage
Validates a message before it is sent to a single subscriber.
Protected methodValidateSubscriber
Validates the subscriber to see if he/she should receive the message.
Public methodCode exampleWriteToLog
Writes a message to the logger provided that a logger exists.
Top
Events

  NameDescription
Protected eventFinished
Occurs when the event handler has done its job.
Protected eventInitialized
Occurs when the event handler has parsed and read all of the passed in even handler arguments but before the actual job has started. A developer can subscribe to this event to do private initialization specific to the current implementation.
Top
Remarks

A Content Studio Subscription event handler must implement the ICSAsyncEventHandler interface. When a subscription event occurs Content Studio Service Manager calls the EventHandler(Int32, Int32, String, String, ICSCredentialsContainer, Int32, String) method that starts the actual subscription handling process. During this process the SubscriptionEventHandlerBase calls a number of methods and raises events that enables derived classes to implement different scenarios.

The methods are called and events are fired in the following order:

ValidateEvent(Int32)
Derived classes override this method to specify which type of event can be handled by the handler.
CreateLogger
Creates the log specified by the ContentStudio.ServiceManager.Logging.ISysLogWriter member if the extended properties passed in. Normally there is no reason to override this method.
Initialized
Subscribe to this event if you like to do your own initialization.
CreateMessage
In this abstract (MustInherit in Visual Basic) method the message to send is created. Deriving classes creates a message to send in this method. Typically this message should be a Content Studio document but developers can create any message to by overriding this method.
ReadData(Int32)
This method reads a list of subscribers that should receive a message. The data is read in pages and is called until no more data is returned.
ValidateSubscriber(SubscriptionInformation)
This method gets called for each subscriber returned by ReadData(Int32). Developers override this method whenever there is a need to apply custom validating for each found subscriber.
ValidateMessage(SubscriptionInformation)
This method is called for each subscriber returned by ReadData(Int32). In this method implementations can process the message individually for each subscriber returned by ReadData(Int32).
SendMessage(SubscriptionInformation)
When the subscriber and her message is validated the message is sent out. Derived class implements their own send operation be it a regular mail message or some other message system, such as SMS or fax.
Finished
This event is fired at the end when the send operation has finished successfully.
See Also

Reference