vqServer API Class vq.server.HttpServer

java.lang.Object
    |
    +----vq.utils.klentry
            |
            +----vq.server.Server
                    |
                    +----vq.server.HttpServer
Contents
Package index
Package
API index

public class HttpServer
extends Server
implements java.lang.Runnable, javax.servlet.ServletContext
A standard multi-threaded HTTP web server such as the main web server or the administration server. Warning: the key field is used to store a unique identifier and should not be modified.


Constructor Index

 o HttpServer()
Creates a new HTTP server.

Method Index

 o flushLogs()
Flushes the server's logs.
 o getAccessLogging()
Returns true if access logging is enabled.
 o getAliases()
Returns the server's list of aliases.
 o getAttribute(String)
Returns the object bound to the specified name.
 o getAttributeNames()
Returns an enumeration of the names of the attributes known to the server.
 o getErrorLogging()
Returns true if error logging is enabled.
 o getHitLogging()
Returns true if hit logging is enabled.
 o getHttpTimeout()
Returns the server's HTTP transaction timeout setting.
 o getKeepAliveTimeout()
Returns the server's keep-alive timeout setting.
 o getMaxThreads()
Returns the server's maximum threads setting.
 o getMimeType(String)
Returns the mime type of the specified file or null if not known.
 o getMinThreads()
Returns the server's minimum threads setting.
 o getRealPath(String)
Translates the specified alias into a real file name.
 o getRefererLogging()
Returns true if referer logging is enabled.
 o getRequestDispatcher(String)
Returns a request disptacher for the specified URI.
 o getResource(String)
Returns a URL object that points to the corresponding URI.
 o getServerInfo()
Returns the server name and version number.
 o getServlet(String)
Returns the specified servlet.
 o getServletLogging()
Returns true if servlet logging is enabled.
 o getServletNames()
Returns an enumeration of the aliases of the servlets in this context (server).
 o getServlets()
Returns an enumeration of the servlets in this context (server).
 o init()
Performs the initialisation required after the configuration file has been read.
 o kill()
Kills the server.
 o log(Exception, String)
Writes the specified message and exception to the servlet log file. Deprecated
 o log(String)
Writes the specified message to the servlet log file.
 o log(String, Throwable)
Writes the specified message and stack trace to the servlet log.
 o periodic(long)
Performs certain time-dependent tasks such as checking for timed-out connections.
 o removeAttribute(String)
Removes the specified attribute from the servlet context.
 o resetLogs(String)
Resets the server's logs.
 o run()
The server thread's run method.
 o save(vqos)
Writes the server's configuration to the output stream specified in vqServer .cfg file format.
 o setAccessLogging(boolean)
Enables or disables access logging.
 o setAttribute(String, Object)
Binds the specified object to the specified name.
 o setErrorLogging(boolean)
Enables or disables error logging.
 o setHitLogging(boolean)
Enables or disables hit logging.
 o setHttpTimeout(long)
Sets the server's HTTP transaction timeout setting.
 o setKeepAliveTimeout(long)
Sets the server's keep-alive timeout setting.
 o setMaxThreads(int)
Sets the server's maximum threads setting.
 o setMinThreads(int)
Sets the server's minimum threads setting.
 o setPort(int)
Sets the TCP/IP port on which the server listens for incoming requests.
 o setRefererLogging(boolean)
Enables or disables referer logging.
 o setServletLogging(boolean)
Enables or disables servlet logging.
 o start()
Starts the server.
 o stop()
Stops the server.

Constructor Detail

 o HttpServer
public HttpServer()
          Creates a new HTTP server.

Method Detail

 o init
public void init()
          Performs the initialisation required after the configuration file has been read.
Overrides:
init in class Server
 o kill
public void kill()
          Kills the server. Warning: do not invoke this method if the server is a member of a list.
Overrides:
kill in class Server
 o save
public void save(vqos os) throws java.io.IOException
          Writes the server's configuration to the output stream specified in vqServer .cfg file format.
Overrides:
save in class klentry
 o run
public void run()
          The server thread's run method. It has to be public because of the Runnable interface. Do not call this method.
 o flushLogs
public void flushLogs()
          Flushes the server's logs.
Overrides:
flushLogs in class Server
 o resetLogs
public void resetLogs(java.lang.String theExtension)
          Resets the server's logs.
Overrides:
resetLogs in class Server
 o setPort
public void setPort(int thePort)
          Sets the TCP/IP port on which the server listens for incoming requests. If the server is running it is first shut down and then restarted. The log files are renamed.
Overrides:
setPort in class Server
 o getServlet
public javax.servlet.Servlet getServlet(java.lang.String servletAlias) throws javax.servlet.ServletException
          Returns the specified servlet. A ServletContext method.
Parameters:
servletAlias - an alias that maps to the servlet
Returns:
the Servlet or null if not found
Throws:
javax.servlet.ServletException - if the servlet could not be initialised
 o getServlets
public java.util.Enumeration getServlets()
          Returns an enumeration of the servlets in this context (server). The enumeration only includes initialised servlets. A ServletContext method.
 o getServletNames
public java.util.Enumeration getServletNames()
          Returns an enumeration of the aliases of the servlets in this context (server). The enumeration only includes the names of initialised servlets. A ServletContext method.
 o log
public void log(java.lang.String msg)
          Writes the specified message to the servlet log file. A ServletContext method.
 o log
public void log(java.lang.Exception e,
                java.lang.String msg)
Note: log() is deprecated.Replaced by log(String msg, Throwable t)

          Writes the specified message and exception to the servlet log file. A ServletContext method.

 o getRealPath
public java.lang.String getRealPath(java.lang.String theAlias)
          Translates the specified alias into a real file name. A ServletContext method.
 o getMimeType
public java.lang.String getMimeType(java.lang.String fileName)
          Returns the mime type of the specified file or null if not known. A ServletContext method.
 o getServerInfo
public java.lang.String getServerInfo()
          Returns the server name and version number. A ServletContext method.
 o setAttribute
public void setAttribute(java.lang.String name,
                         java.lang.Object object)
          Binds the specified object to the specified name. Attribute names are case insensitive in vqServer. A ServletContext method (specification version 2.1).
 o removeAttribute
public void removeAttribute(java.lang.String name)
          Removes the specified attribute from the servlet context. Attribute names are case insensitive in vqServer. A ServletContext method (specification version 2.1).
 o log
public void log(java.lang.String msg,
                java.lang.Throwable t)
          Writes the specified message and stack trace to the servlet log. A ServletContext method (specification version 2.1).
 o getResource
public java.net.URL getResource(java.lang.String path) throws java.net.MalformedURLException
          Returns a URL object that points to the corresponding URI. A ServletContext method (specification version 2.1).
 o getAttributeNames
public java.util.Enumeration getAttributeNames()
          Returns an enumeration of the names of the attributes known to the server. A ServletContext method (specification version 2.1).
 o start
public void start()
          Starts the server.
Overrides:
start in class Server
 o stop
public void stop()
          Stops the server.
Overrides:
stop in class Server
 o periodic
public void periodic(long currentTime)
          Performs certain time-dependent tasks such as checking for timed-out connections. Called periodically by the timer thread.
Parameters:
currentTime - the current time as returned by System.currentTimeMillis()
Overrides:
periodic in class Server
 o getMinThreads
public int getMinThreads()
          Returns the server's minimum threads setting.
 o setMinThreads
public void setMinThreads(int newSetting)
          Sets the server's minimum threads setting.
 o getMaxThreads
public int getMaxThreads()
          Returns the server's maximum threads setting.
 o setMaxThreads
public void setMaxThreads(int newSetting)
          Sets the server's maximum threads setting.
 o getHttpTimeout
public long getHttpTimeout()
          Returns the server's HTTP transaction timeout setting.
 o setHttpTimeout
public void setHttpTimeout(long newSetting)
          Sets the server's HTTP transaction timeout setting.
 o getKeepAliveTimeout
public long getKeepAliveTimeout()
          Returns the server's keep-alive timeout setting.
 o setKeepAliveTimeout
public void setKeepAliveTimeout(long newSetting)
          Sets the server's keep-alive timeout setting.
 o getAliases
public Aliases getAliases()
          Returns the server's list of aliases.
 o getAccessLogging
public boolean getAccessLogging()
          Returns true if access logging is enabled.
 o setAccessLogging
public boolean setAccessLogging(boolean newSetting)
          Enables or disables access logging. Returns true if the setting was changed.
 o getErrorLogging
public boolean getErrorLogging()
          Returns true if error logging is enabled.
 o setErrorLogging
public boolean setErrorLogging(boolean newSetting)
          Enables or disables error logging. Returns true if the setting was changed.
 o getServletLogging
public boolean getServletLogging()
          Returns true if servlet logging is enabled.
 o setServletLogging
public boolean setServletLogging(boolean newSetting)
          Enables or disables servlet logging. Returns true if the setting was changed.
 o getHitLogging
public boolean getHitLogging()
          Returns true if hit logging is enabled.
 o setHitLogging
public boolean setHitLogging(boolean newSetting)
          Enables or disables hit logging. Returns true if the setting was changed.
 o getRefererLogging
public boolean getRefererLogging()
          Returns true if referer logging is enabled.
 o setRefererLogging
public boolean setRefererLogging(boolean newSetting)
          Enables or disables referer logging. Returns true if the setting was changed.
 o getRequestDispatcher
public javax.servlet.RequestDispatcher getRequestDispatcher(java.lang.String URI)
          Returns a request disptacher for the specified URI. A ServletContext method.
 o getAttribute
public java.lang.Object getAttribute(java.lang.String name)
          Returns the object bound to the specified name. Attribute names are case insensitive in vqServer. A ServletContext method.


vqServer API version 1.9. vqServer and the vqServer API are copyright © Steve Shering and vqSoft 1997-2000. Last updated 15 May 2000.

Contents
Package index
Package
API index