
Enterprise Server 6.1 APIs
24 Netscape Enterprise Server Programmer’s Guide • April 2002 (Draft)
NSAPI
Netscape Server Application Programming Interface (NSAPI) is a set of C
functions for implementing extensions to the server. These extensions are known
as server plugins.
Using NSAPI, you can write plugins to extend the functionality of the Enterprise
Server.An NSAPI plugin defines one or more Server Application Functions(SAFs).
You can develop SAFs for implementing custom authorization, custom logging, or
for other ways of modifying how the Enterprise Server handles requests.
The file
obj.conf contains instructions (known as directives) that tell the server
how to process requests received from clients. Each instruction is enacted either
during server initialization or during a particular stage of the request-handling
process. Each instruction invokes a server application function (SAF).
For example, the following instruction is invoked when the request method is GET
and the requested resource is of type
text/html. This instruction calls the
append-trailer function with a trailer argument of<H4><font
color=green>Served by
6.1</font></H4>.(Theappend-trailer function
simply returns the requested resource, in this case an HTML file, to the client, and
appends the given trailer to it.)
Enterprise Server 6.1 comes with a set of pre-defined SAFs. It also comes with a
library of NSAPI functions for developing your own SAFs to modify the way that
the server handles requests.
Enabling NSAPI
Youdon’tenableNSAPIassuch. You use ittodevelopserverapplicationfunctions
(SAFs) to use in the file
obj.conf. The file obj.conf is essential for the operation
of the server -- if it does not exist, the server cannot work, since it has nowhere to
look forinstructions on how to handle requests.
When defining new SAFs, include the header function
nsapi.h (which is in
server_root/plugins/include) to get access to all the NSAPI functions.
Service method=GET type="text/html" fn=append-trailer
trailer="<H4><font color=green>Served by
6.1</font></H4>"
Kommentare zu diesen Handbüchern