com.xmlserv.main
Interface XMLServBackend

All Known Implementing Classes:
XMLServBackendImpl

public interface XMLServBackend

This interface defines the signature of a Backend module for XMLServ. A Backend is the business logic that produces XML content which is then processed by the XMLServ Servlet calling the Backends process() routine.

Version:
$Id: XMLServBackend.java,v 1.10 2002/11/14 17:03:40 muecke Exp $
Author:
Wolfram Saringer

Method Summary
 void addParam(java.lang.String paramname, java.lang.String paramvalue)
          Add a parameter read from the config.xml file.
 void destroy()
          Free resources.
 java.lang.String getParam(java.lang.String paramname)
          Get a parameter value.
 java.lang.String getStatus()
          Return a short (one-line) status report.
 void init()
          Initialize the Backend.
 javax.xml.transform.Source process(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res, SecurityManager securitymanager)
          This variant of the main method is called when the BackendHandle indicates that this Backend produces binary data which should be sent to the client without further processing.
 org.jdom.Document process(javax.servlet.ServletContext context, javax.servlet.http.HttpServletRequest req, SecurityManager securitymanager)
          The main method.
 

Method Detail

init

public void init()
          throws javax.servlet.ServletException
Initialize the Backend. Called before any processing is requested. This method is called during the Repository initialization.

destroy

public void destroy()
Free resources. Called when a Backend is deactivated.

getStatus

public java.lang.String getStatus()
Return a short (one-line) status report. Basic HTML formatting may be used, but no paragraph tags are allowed.

addParam

public void addParam(java.lang.String paramname,
                     java.lang.String paramvalue)
Add a parameter read from the config.xml file.
Parameters:
paramname - The name of this parameter.
paramvalue - The parameters value.

getParam

public java.lang.String getParam(java.lang.String paramname)
Get a parameter value.
Parameters:
paramname - The name of the parameter.
Returns:
The parameters value or null if not set.

process

public org.jdom.Document process(javax.servlet.ServletContext context,
                                 javax.servlet.http.HttpServletRequest req,
                                 SecurityManager securitymanager)
                          throws XMLServException,
                                 javax.servlet.ServletException,
                                 java.io.IOException
The main method. Process a request and return a XML document.
Parameters:
context - The servlet context.
req - The request object.
securitymanager - The securitymanager instance associated with this Backend.
Returns:
A XML document.
Throws:
XMLServException - An error condition in the business logic.
javax.servlet.ServletException - Generic error condition in the request.
java.io.IOException - Any IO error.

process

public javax.xml.transform.Source process(javax.servlet.ServletContext context,
                                          javax.servlet.http.HttpServletRequest req,
                                          javax.servlet.http.HttpServletResponse res,
                                          SecurityManager securitymanager)
                                   throws XMLServException,
                                          javax.servlet.ServletException,
                                          java.io.IOException
This variant of the main method is called when the BackendHandle indicates that this Backend produces binary data which should be sent to the client without further processing.
Returns:
Always null.