Implementing IUrlAccessor

Implementing IUrlAccessor

The IUrlAccessor interface provides methods for handling individual items from the Gatherer. The UrlAccessor object is created in the security context specified by rules associated with the Gatherer.

The UrlAccessor object is instantiated and initialized in the CreateAccessor method of the ISearchProtocol interface. If an****internal initialization method was implemented for the UrlAccessor object, that method is invoked immediately after the object is created. If implemented, this method performs initialization specific to your protocol handler implementation, such as validating the URL for the item being accessed. It can also check the last time the item was modified to determine if that file must be processed in the current crawl.

All of the Get methods on the UrlAccessor object are then called to retrieve standard properties associated with the item. Depending on which was implemented, the URL to the item is passed to the GetFileName method or to the BindtoStream method to read the content of the item. If the item pointed to by the URL contains an embedded document that must also be filtered, BindtoFilter method is called. The Filter Daemon calls this method only once for each item. If the item contains one or more embedded documents, filter it by using an IFilter that can process these documents.

The GetSecurityDescriptor method retrieves the security information associated with the URL item, such as the different kinds of access allowed for particular users and groups of users. If this method is implemented, the Gatherer provides the Index engine with security information about the item when it is crawled. The Index engine incorporates this information into the full-text index with the document content. The security information is used by the Search engine when processing queries against the full-text index. Therefore, if the GetSecurityDescriptor method is not implemented, the contents of the URL item are visible and retrievable through queries for all users.

The GetSecurityDescriptor method also allows custom mappings between users registered to a content source and those users registered on the domain, if they are different. Security descriptors created in this method must be self-relative.

For more information about designing and creating Security Descriptors for Windows 2000. see the Security section of the Microsoft Platform SDK.

Implementing ISearchProtocol