ucar.unidata.util
Class HttpServer

java.lang.Object
  extended by ucar.unidata.util.HttpServer
Direct Known Subclasses:
ImageServer, OneInstanceServer

public class HttpServer
extends Object

Class HttpServer. A simple http server.

Version:
$Revision: 1.12 $
Author:
IDV Development Team

Nested Class Summary
static class HttpServer.RequestHandler
          Class RequestHandler handles requests
 
Field Summary
static int RESPONSE_INTERNALERROR
          _more_
static int RESPONSE_NOTFOUND
          _more_
static int RESPONSE_OK
          _more_
static int RESPONSE_UNAUTHORIZED
          _more_
protected  Hashtable serverProperties
          _more_
static String TYPE_GET
          get type
static String TYPE_POST
          post type
 
Constructor Summary
HttpServer(int port)
          Create me with the given port
HttpServer(String propertyFile)
          _more_
 
Method Summary
protected  HttpServer.RequestHandler doMakeRequestHandler(Socket socket)
          Factory method to create the request handler
 int getPort()
          _more_
 Hashtable getProperties()
          _more_
protected  void handleError(String msg, Exception exc)
          _more_
 void init()
          _more_
protected  void initServerSocket(ServerSocket socket)
          _more_
 void setPort(int port)
          _more_
static void xxxxmain(String[] args)
          test main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESPONSE_OK

public static final int RESPONSE_OK
_more_

See Also:
Constant Field Values

RESPONSE_NOTFOUND

public static final int RESPONSE_NOTFOUND
_more_

See Also:
Constant Field Values

RESPONSE_UNAUTHORIZED

public static final int RESPONSE_UNAUTHORIZED
_more_

See Also:
Constant Field Values

RESPONSE_INTERNALERROR

public static final int RESPONSE_INTERNALERROR
_more_

See Also:
Constant Field Values

TYPE_GET

public static final String TYPE_GET
get type

See Also:
Constant Field Values

TYPE_POST

public static final String TYPE_POST
post type

See Also:
Constant Field Values

serverProperties

protected Hashtable serverProperties
_more_

Constructor Detail

HttpServer

public HttpServer(int port)
Create me with the given port

Parameters:
port - The port to listen on

HttpServer

public HttpServer(String propertyFile)
_more_

Parameters:
propertyFile - _more_
Method Detail

setPort

public void setPort(int port)
_more_

Parameters:
port - _more_

getPort

public int getPort()
_more_

Returns:
_more_

getProperties

public Hashtable getProperties()
_more_

Returns:
_more_

init

public void init()
_more_


handleError

protected void handleError(String msg,
                           Exception exc)
_more_

Parameters:
msg - _more_
exc - _more_

initServerSocket

protected void initServerSocket(ServerSocket socket)
_more_

Parameters:
socket - _more_

doMakeRequestHandler

protected HttpServer.RequestHandler doMakeRequestHandler(Socket socket)
                                                  throws Exception
Factory method to create the request handler

Parameters:
socket - The socket
Returns:
The handler
Throws:
Exception - On badness

xxxxmain

public static void xxxxmain(String[] args)
test main

Parameters:
args - args