The NetShow Event Notification and Authorization API is comprised of two custom COM-compliant interfaces and one server callback interface. As a developer, you are responsible for implementing the two component-side interfaces, namely INSSEventHandler, and INSSEventAuthorization. These two interfaces are invoked by the NetShow server. The third one is the INSSEventAuthorizationCallback interface, which is implemented by the server and invoked by the component. The NetShow server also employs several context objects that implement IPropertyMap, a generic and prepackaged interface for manipulating named parameters. Following is a brief description of these interfaces.
Interface | Description |
INSSEventHandler | The methods of this interface are called by the server when specified events occur. It is also used to select which events will trigger a call to the interface 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 has been 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 will trigger a call to this interface. This interface is implemented by the developer. |
INSSEventAuthorizationCallback | The callback method of this interface is used to notify the server when the requested event has been authorized or denied. This interface is implemented by the server. |
A component must be able to handle events even if it is not required to perform authorization. Thus, each component must implment the INNSEventHandler event notification interface. Every component can selectively respond to event notifications issued from the server. You implement the INNSEventHandler::GetHandleEvents method to specify the types of events to be notified. 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 down.
The INSSEventAuthorization interface deals with event authorization only. A component implements this interface only when it is interested in 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 may require authorization, but not notification.
Any number of different components may 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 will not grant the request until it receives permission from all the registered components. If any component denies the request, the server will not grant permission and will notify all the components of the denial. Thus, a component should grant permission to any request of the event authorization that is outside of the scope of its prescribed responsibility. For example, a pay-per-view authorization component should not deny requests for pay-per-minute title.
For performance reasons, a single component capable of handling different authorization schemes is prefered to multiple components handling a single authorization scheme. A single component implementation helps to reduce the number of client/server interactions.
© 1996-1998 Microsoft Corporation. All rights reserved.