ikrs.httpd
Class HTTPConfiguration

java.lang.Object
  extended by ikrs.httpd.HTTPConfiguration

public class HTTPConfiguration
extends java.lang.Object

The HTTP configuration file(s) have become pretty large so the config handling is now located in an extra class.


Constructor Summary
HTTPConfiguration(HTTPHandler handler, CustomLogger logger)
          Creates a new HTTPConfiguration handler.
 
Method Summary
 void applyConfiguration(Environment<java.lang.String,BasicType> serverConfiguration)
          This method reads the passed HTTP settings from the cnfiguration environment and applies them to the HTTP handler.
protected  HTTPHandler getHandler()
          Get the HTTP handler for this configuration.
protected  CustomLogger getLogger()
          Get the logger for this configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPConfiguration

public HTTPConfiguration(HTTPHandler handler,
                         CustomLogger logger)
                  throws java.lang.NullPointerException
Creates a new HTTPConfiguration handler.

Parameters:
handler - The HTTP handler to apply the configuration settings to.
logger - A custom logger to use to write log messages.
Throws:
java.lang.NullPointerException - If the handler is null.
Method Detail

getHandler

protected HTTPHandler getHandler()
Get the HTTP handler for this configuration.

Returns:
The HTTP handler for this configuration.

getLogger

protected CustomLogger getLogger()
Get the logger for this configuration. If the passed logger (see constructor) is null the method will return this HTTPHandler's logger.

Returns:
The logger for this configuration.

applyConfiguration

public void applyConfiguration(Environment<java.lang.String,BasicType> serverConfiguration)
                        throws ConfigurationException,
                               java.io.IOException
This method reads the passed HTTP settings from the cnfiguration environment and applies them to the HTTP handler. If the passed settings environment is null the method does nothing.

The passed configuration comes from an XML configuration file parsed by the yucca server.
The structure is like this:

<server name="My HTTP Server" handlerClass="ikrs.http.HTTPHandler">
<httpConfig>
<httpSettings configFile=".yuccasrv/ikrs.httpd.conf" />
<fileHandlers configFile=".yuccasrv/filehandlers.ini" />
...
</httpConfig>
...
</server>

Parameters:
httpSettings - The HTTP settings to apply.
Throws:
ConfigurationException - If the passed settings contain any malformed or bad entries or is incomplete. Note that earlier settings might have already been applied and the handler is only partially configured when this exception was thrown.
java.io.IOException