i-net Clear Reports

com.inet.report
Interface RequestHandler


public interface RequestHandler

Use this interface if you want to redirect HTTP requests received from i-net Clear Reports report server to your own class. This can be useful if you want to display runtime information of the cache or of the i-net Scheduler. You can register your RequestHandler by set the property "requesthandler" in the i-net Clear Reports configuration, e.g.: requesthandler=com.companyname.MyRequestHandler

You can also set multiple RequestHandler, separated with commas.
The class must be added to the class path of i-net Clear Reports.

Note: if you use multiple RequestHandler and if one RequestHandler executes a request, no other RequestHandler will receive this request.

A sample RequestHandler can be found in the package samples.requesthandler.

Since:
6.1

Method Summary
 boolean acceptsRequest(java.util.Properties props)
          This method indicates whether this RequestHandler will execute the request with the passed Properties.
 void handleRequest(java.net.Socket socket, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.OutputStream out, java.util.Properties props)
          Implement the logic of your RequestHandler here.
 

Method Detail

handleRequest

void handleRequest(java.net.Socket socket,
                   javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response,
                   java.io.OutputStream out,
                   java.util.Properties props)
                   throws java.lang.Exception
Implement the logic of your RequestHandler here. In addition to the properties send with the request, the Properties parameter contains address of the client(key: clientadress).

Parameters:
socket - Is not null in context of standalone report server. Is null in context of Servlet(application server).
request - Is a HttpServletRequest Object containing information about the request
response - Is a HttpServletResponse Object which can contain information about the response
out - This is the Socket-OutputStream or the HttpServletResponse-OutputStream. Use this OutputStream to show a HTML page for example.
props - This Properties object contains all POST and GET parameters. Note: Every parameter key name is in lower case.
Throws:
java.lang.Exception - if an exception occurs, this exception is shown to the client
Since:
6.1

acceptsRequest

boolean acceptsRequest(java.util.Properties props)
This method indicates whether this RequestHandler will execute the request with the passed Properties.
If the method returns true, no other RequestHandler will have the possibility to handle this request. The following properties are reserved by i-net Clear Reports:
"init=scheduler"
"init=cacheviewer"

Parameters:
props - This properties object contains all POST and GET parameter. Note: Every parameter is in lower case.
Returns:
Whether the request have to be executed by this RequestHandler.
Since:
6.1

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH