All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sics.agentbase.http.httpServer

java.lang.Object
   |
   +----sics.agentbase.net.InternetServer
           |
           +----sics.agentbase.http.httpServer

public class httpServer
extends InternetServer
implements ProtocolHandler
httpServer implements a HTTP server that parses HTTP requests and delivers messages.


Constructor Index

 o httpServer()
Starts up a HTTP server on the default port. Deprecated.
 o httpServer(boolean)
Starts up a HTTP server on any available port and registers as a protocol handler if the register flag is true.
 o httpServer(int)
Starts up a HTTP server on a specified port. Deprecated.
 o httpServer(int, boolean)
Starts up a HTTP server on a specified port and registers as a protocol handler if the register flag is true.
 o httpServer(String, int)
Starts up a HTTP server on a specified port and host. Deprecated.
 o httpServer(String, int, boolean)
Starts up a HTTP server on a specified port and registers as a protocol handler if the register flag is true.

Method Index

 o getScheme()
Returns the scheme of this protocol (= "http").
 o getURL(String)
Returns the full HTTP URL of a local path (object name).
 o handleConnection(Socket)
Handles a HTTP connection.
 o main(String[])
 o supportType(String)
Returns true if the specified mime type is supported.

Constructors

 o httpServer
 public httpServer() throws IOException
Note: httpServer() is deprecated. Use httpServer(boolean doRegister) instead!

Starts up a HTTP server on the default port.

 o httpServer
 public httpServer(int Port) throws IOException
Note: httpServer() is deprecated. Use httpServer(int Port, boolean doRegister) instead!

Starts up a HTTP server on a specified port.

Parameters:
Port - the port that this server opens and listens to.
 o httpServer
 public httpServer(String host,
                   int Port) throws IOException
Note: httpServer() is deprecated. Use httpServer(String Host, int Port, boolean doRegister) instead!

Starts up a HTTP server on a specified port and host.

Parameters:
host - the host that this server resides at.
Port - the port that this server opens and listens to.
 o httpServer
 public httpServer(boolean doRegister) throws IOException
Starts up a HTTP server on any available port and registers as a protocol handler if the register flag is true.

Parameters:
doRegister - specifies if the server should register as a protocol handler or not.
See Also:
addProtocolHandler
 o httpServer
 public httpServer(int Port,
                   boolean doRegister) throws IOException
Starts up a HTTP server on a specified port and registers as a protocol handler if the register flag is true.

Parameters:
Port - the port that this server opens and listens to.
doRegister - specifies if the server should register as a protocol handler or not.
 o httpServer
 public httpServer(String host,
                   int Port,
                   boolean doRegister) throws IOException
Starts up a HTTP server on a specified port and registers as a protocol handler if the register flag is true.

Parameters:
host - the full host name of the host that this server resides at.
Port - the port that this server opens and listens to.
doRegister - specifies if the server should register as a protocol handler or not.

Methods

 o getScheme
 public String getScheme()
Returns the scheme of this protocol (= "http").

 o supportType
 public boolean supportType(String mimetype)
Returns true if the specified mime type is supported.

 o getURL
 public URL getURL(String name)
Returns the full HTTP URL of a local path (object name).

Parameters:
name - the path (or object name).
Returns:
the complete URL.
 o handleConnection
 protected void handleConnection(Socket connection)
Handles a HTTP connection. Creates a HTTP Message from the connection and delivers the message using CentralFactory.

Parameters:
connection - the HTTP request connection.
Overrides:
handleConnection in class InternetServer
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index