Jaa


File System Watcher Event Provider

The file system watcher event provider, implemented within Notification Services, is a continuous event provider that monitors a directory for new event files. If you can supply event data in XML files, the file system watcher event provider is an easy and quick way to get event data into your application.

The file system watcher event provider uses the FileSystemWatcher class in the Microsoft .NET Framework class library to monitor file and directory changes within a given directory. When a new file with an .xml extension is dropped into the designated directory, the file system watcher event provider loads the file into memory, and then uses an EventLoader object provided by Notification Services to write the event information into the event table.

Important

Creating and editing the XML source files should be done in a different directory from the one being monitored by the file system watcher event provider. This is to prevent the event provider from attempting to pick up the source file immediately after it has been created, possibly while you are still writing events to it.

When the event batch has been written to the database, the XML source file is renamed to indicate that it has been processed. The new file name concatenates the original file name, the date and time of processing, a counter value to differentiate files processed at the same time, and a .done extension.

For example, if a file named Alerts.xml is processed on September 22, 2001 at 10:34:22, it would be renamed "Alerts.xml.20010922-103422.CounterValue.done".

To use the file system watcher event provider, you must define a hosted event provider in the application definition, and you must develop a Transact-SQL annotated XML schema file that maps the event data to event fields.

In This Section

Topic Description

File Pickup and Retry Logic

Describes how the file system watcher event provider picks up files.

File Validation

Describes how the file system watcher validates data in the files using an XML schema file.

Defining a File System Watcher Event Provider

Documents the properties and attributes of the file system watcher event provider.

See Also

Other Resources

Standard Event Providers
Defining Notification Services Applications
Defining Event Providers
Developing a Custom Event Provider

Help and Information

Getting SQL Server 2005 Assistance