Subscription Management API
When you build a subscription management interface, you manage three types of objects: subscribers, subscriber devices, and subscriptions. Your custom application uses the Notification Services subscription management API to create, modify, and delete these objects. Internally, the API stores and manipulates subscriber and subscription information in the instance and application databases.
Notification Services also provides views in the instance and application database that you can use to add basic subscriber, subscriber device, and subscriptions directly to the databases. These views are primarily intended for application development and testing.
Important
Always use the API or views to manage subscriber, subscriber device, and subscription data; never manipulate the underlying tables directly.
Subscription Management API
The following illustration shows how subscription management objects are used by a subscription management interface to communicate with Notification Services.
- The Subscriber object represents a single subscriber. A subscriber is a person or process identified by a subscriber ID. Subscriber data is stored in the instance database so that subscribers can be shared between applications.
- The SubscriberDevice object represents a single subscriber device for a subscriber. A subscriber device is a deliver endpoint for notification delivery, such as an e-mail address.
Each subscriber must have at least one subscriber device. Subscriber device data, like subscriber data, is stored in the instance database.
Each subscriber device has a name and address, and is associated with a delivery channel. The delivery channel represents a specific delivery service used to deliver notifications to the device, such as a particular Simple Mail Transfer Protocol (SMTP) gateway. You configure delivery channels when you configure an instance of Notification Services. - A Subscription object represents a single subscription for a subscriber. Subscriptions define what notifications the subscriber wishes to receive. Subscriptions are for a specific subscription class, and can be for event-driven or scheduled subscriptions. Subscriptions define values for subscription class fields.
If the subscription class uses condition actions, a subscription can also specify a condition that is used to determine if a notification should be generated for the subscription. Your application must use classes in the Microsoft.SqlServer.NotificationServices.Rules namespace to support condition development.
Subscription data is stored in the application database.
Subscription Management Classes
The following classes in the Microsoft.SqlServer.NotificationServices namespace are used to develop subscription management interfaces.
Class | Description |
---|---|
Subscriber |
Represents an individual subscriber in a given Notification Services instance. |
Represents the collection of subscribers in a given Notification Services instance. |
|
SubscriberDevice |
Represents a device that can receive notifications. |
Represents a collection of subscriber devices. |
|
Subscription |
Represents a single subscription. |
Represents a collection of subscriptions. |
|
Represents a geographic region for which a notification will be formatted. |
|
Represents the collection of subscriber locales available within a given Notification Services instance. |
|
Represents a valid time zone, which is used for scheduled subscriptions. |
|
Represents the collection of time zones available within a given Notification Services instance. |
|
Represents a subscription class, as specified for a given application. |
|
Represents the collection of subscription classes in a given Notification Services application. |
|
Represents a Notification Services application. |
|
Represents a Notification Services instance. |
|
Represents exceptions thrown when a Notification Services application error occurs. |
Subscription Condition Classes
If a subscription class contains rules that use condition actions, you will use classes in the Microsoft.SqlServer.NotificationServices.Rules namespace to allow users to define conditions.
Class | Description |
---|---|
Defines a set of conditions to be evaluated using AND Boolean logic. |
|
Evaluates to true if the test argument is between a minimum and maximum value, inclusive. |
|
Evaluates to true if its Boolean-valued argument is true. |
|
Represents an argument with a predetermined value. |
|
Expression operators. |
|
Represents an argument whose value is determined by evaluating a simple arithmetic expression. |
|
Represents a condition argument that obtains its value from an input field. |
|
Filter actions. |
|
Defines a filter over an input table or view based on the results of condition evaluation. A filter rule is composed of one or more filter statements. |
|
Describes a logic statement in the form "IF Condition THEN Action." |
|
Represents an argument that obtains its value from a Transact-SQL user-defined function. |
|
Evaluates to true if its argument is NULL. |
|
Evaluates operations against the results of a related filter rule. |
|
Operators for link leaf conditions. |
|
Negates the result of another condition. |
|
Defines a set of conditions to be logically evaluated using OR Boolean logic. |
|
Defines logic that evaluates to a scalar value for any row in an input table or view. A property rule is composed of one or more property statements. |
|
Describes a logic statement in the form "IF Condition THEN Result," where the result is a scalar value. |
|
Represents the exception that is thrown by an object in this namespace. |
|
Represents an argument that obtains its value from the evaluation of other rules. |
|
Compares two arguments using relational operators and returns a Boolean result. |
|
Operators for simple leaf conditions. |
|
Describes a table that can be used as an input to rule. |
|
Describes a view that can be used as an input to a rule. |
Subscription Administration Classes
The classes above are intended for managing subscriber, subscriber device, and subscription data. If you are building an application to administer or manage instances of Notification Services, use the following classes in the Microsoft.SqlServer.Management.Nmo namespace to enable and disable subscribers and subscriptions.
Class | Description |
---|---|
Provides methods for enabling and disabling subscriber management. |
|
Provides methods for enabling and disabling subscription management. |
Subscription Management Views
Notification Services exposes views for managing subscriber data primarily for application testing. For more information, see the following topics:
See Also
Concepts
Starting a Subscription Management Project
Other Resources
Developing Subscription Management Interfaces
Managing Subscribers
Managing Subscriber Devices
Managing Subscription Data