The NetShow Theater Server Event Notification and Authorization API is composed of three COM-compliant interfaces. As a developer, you are responsible for implementing the two component-side interfaces, namely INSSEventNotification and INSSEventAuthorization. Both are invoked by the server. The third one is the INSSEventAuthorizationCallback interface, which is implemented by the server and invoked by the component. You must also implement the three base methods, AddRef, Release, and QueryInterface, as stipulated by the COM specification.
The server also employs several context objects that implement IPropertyMap, a generic and prepackaged interface for manipulating named parameters. For more information on contexts, see Event Notification and Authorization Context in this overview.
The following table gives a brief description of these interfaces.
Interface | Description |
INSSEventNotification | The methods of this interface are called by the server when specified events occur. This interface is also used to select which events trigger a call to it, and to perform initialization and shutdown tasks. This interface is implemented by the developer. |
INSSEventAuthorization | The methods of this interface are called by the server when a request is made to perform a specified task. The server does not grant the request until it receives permission from the authorization routine. This interface is also used to specify which requests trigger a call to it. This interface is implemented by the developer. |
INSSEventAuthorizationCallback | The callback method of this interface is used to notify the server when the requested event is authorized or denied. This interface is implemented by the server. |
A component must be able to handle events even if it performs authorization. Thus, each component must implement the INNSEventNotification event notification interface. Every component can selectively respond to event notifications issued by the server. You implement the INNSEventNotification::GetHandledEvents method to specify the types of events for which notification must be sent. In addition to handling events, the event notification interface serves to initialize the component when the server starts, to monitor the operational state of the server, and to terminate itself when the server is offline.
The INSSEventAuthorization interface deals with event authorization only. A component implements this interface only when it requires authorization. There are only two methods in this interface: GetAuthorizedEvents, which specifies the type of events requiring authorization, and AuthorizeEvent, which performs the actual process of authorization. An event can require authorization, but not notification, and vice versa.
Any number of different components can be registered for event authorization. For example, one component authorizes the Play event based on the Pay-per-View plan, and another on the Pay-per-Minute plan. When more than one component is registered, the server calls the methods of the authorization interface of each component in turn. The server does not grant the request until it receives permission from all the registered components. If any component denies the request, the server does not grant permission, and does notify all the components of the denial. Thus, a component must grant permission to any event authorization request that is outside the scope of its prescribed responsibility. For example, a Pay-per-View authorization component must not deny requests for Pay-per-Minute titles.
For performance reasons, a single component capable of handling different authorization schemes is preferred to multiple components handling a single authorization scheme. A single-component implementation helps to reduce the number of interactions between the plug-ins and the server.
[Previous][Next]