irssibot.remote.http
Class HttpServer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--irssibot.remote.http.HttpServer
All Implemented Interfaces:
java.lang.Runnable

public class HttpServer
extends java.lang.Thread

HTTP interface for remote administration of IrssiBot.

Version:
$Name: $ $Revision: 1.1 $
Author:
Matti Dahlbom

Field Summary
private  java.util.ArrayList hostsAllow
          Allowed hostmasks
private  java.util.ArrayList hostsDeny
          Disallowed hostmasks
private static java.lang.String info
          Module info string
private  boolean isRunning
          Whether to keep listening to connections.
private  java.net.ServerSocket serverSocket
          Server socket
private static int SOCKET_SO_TIMEOUT
          Socket timeout value (in milliseconds).
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
HttpServer()
           
 
Method Summary
 void init(int port, java.util.ArrayList hostsAllow, java.util.ArrayList hostsDeny)
          Initializes the server.
 void run()
          Listens to the server socket for inbound connections.
 void stopServer()
          Stops the server thread.
 java.lang.String toString()
          Returns textual description.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SOCKET_SO_TIMEOUT

private static final int SOCKET_SO_TIMEOUT
Socket timeout value (in milliseconds).

See Also:
Constant Field Values

info

private static final java.lang.String info
Module info string

See Also:
Constant Field Values

hostsAllow

private java.util.ArrayList hostsAllow
Allowed hostmasks


hostsDeny

private java.util.ArrayList hostsDeny
Disallowed hostmasks


serverSocket

private java.net.ServerSocket serverSocket
Server socket


isRunning

private boolean isRunning
Whether to keep listening to connections. When set to false, the server thread will exit.

Constructor Detail

HttpServer

public HttpServer()
Method Detail

init

public void init(int port,
                 java.util.ArrayList hostsAllow,
                 java.util.ArrayList hostsDeny)
          throws java.io.IOException
Initializes the server.

Parameters:
port - server port to listen to
hostsAllow - allowed hostmasks
hostsDeny - disallowed hostmasks
java.io.IOException

stopServer

public void stopServer()
Stops the server thread.


run

public void run()
Listens to the server socket for inbound connections.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

toString

public java.lang.String toString()
Returns textual description.

Overrides:
toString in class java.lang.Thread


IrssiBot (c) 2000-2002 Matti Dahlbom