A C D E F G H I K L M O P R S T U V W

A

ACCEPT_NO_MATCH - Variable in class Policy
specifies if Policy shoud accept hosname that have found no match in rules; default is true;
ACCEPT_STRING - Variable in class Policy
 
accept(String) - Method in class Policy
apply policy to a hostname.
accepted - Variable in class Policy
 
addRule(String) - Method in class Policy
add a new rule to policy
append(String) - Method in class Header.HeaderEntry
append a new string to a header, the CRLF is put by this method

C

chunked() - Method in class HTTPInputStream
Get the chunked value.
chunked() - Method in class ServConnection
Is this request chunked?
cleaner - Variable in class ServConnectionManager
The cleaner thread.
close() - Method in class Logger
close the log file
close() - Method in class ServConnection
Close the connection.
closeDown() - Method in class Connection
Close down nicely.
closeSocket() - Method in class Proxy
Closes the serversocket and makes the proxy stop listening for connections.
config - Static variable in class Proxy
The Config
Config - class Config.
a class to handle configs for different things. reads file on the format [sectionName1] key=value key2=value2 [sectionName2] key=value key2=value2 ...
Config() - Constructor for class Config
create an empty Config
Config(File) - Constructor for class Config
Create a Config for the specified file
Config(InputStream) - Constructor for class Config
Create a Config by reading it from a stream.
Config(Reader) - Constructor for class Config
Create a Config by reading it from a reader.
Config(String) - Constructor for class Config
Create a Config for the specified file
Connection - class Connection.
This is the class that handles one connection And makes sure the content is delivered to the client.
Connection() - Constructor for class Connection
Create a new Connection.
ConnectionPool - class ConnectionPool.
This is a Connection pool.
ConnectionPool(int, int, int, int) - Constructor for class ConnectionPool
Create a ConectionPool.
cp - Static variable in class Proxy
The ConnectionPool for handling client connections
CRLF - Static variable in class Header
The String consisting of \r and \n

D

dataSize() - Method in class HTTPInputStream
Get the size of the page being read.
dataSize() - Method in class ServConnection
Get the size of the data being fetched.
DEFAULT_SLEEP_TIME - Static variable in class ConnectionPool
manager will use it as sleep time if connections are still available
denied - Variable in class Policy
 
DENY_STRING - Variable in class Policy
 
doRun() - Method in class Connection
Does run the thread: called by RestartableThread.run()
doRun() - Method in class RestartableThread
This is the method that is run.

E

equals(Object) - Method in class Header.HeaderEntry
 
equals(Object) - Method in class HTTPHeader
Is this Header equal to the other object?
equals(Object) - Method in class ServConnection
Compare this ServConnection against another object.

F

FIELD_SEPARATOR - Static variable in class Header
The Field separator
find(ServConnection) - Method in class ServConnectionManager
Look for a matching active ServConnection inside the pool, match is done uppon InetAddress and Port
free_threads - Variable in class ConnectionPool
 

G

getChunkSize() - Method in class HTTPInputStream
Get the size of the next chunk.
getChunkStream() - Method in class HTTPInputStream
Get the chunked page.
getChunkStream() - Method in class ServConnection
Get the last chunked page.
getConnection() - Method in class ConnectionPool
Get a Thread.
getConnection() - Static method in class Proxy
Get a Connection that is ready to service.
getConnection(HTTPHeader) - Method in class ServConnectionManager
Get a ServConnection for the given header.
getContent() - Method in class HTTPHeader
Get the content of the request/response.
getHeader(String) - Static method in class Connection
Get a new HTTPHeader initialized with some data.
getHeaderEntryValue(String) - Method in class Header
get the value of header type
getHost() - Static method in class Proxy
Get the local host.
getHTTPVersion() - Method in class HTTPHeader
Get the HTTP Version of this request (only valid for requests).
getInactiveTime() - Method in class ServConnection
Get the time that this ServConnection was Inactive.
getInetAddress() - Method in class ServConnection
Get the InetAddress that this ServConnection is connected to.
getInputStream() - Method in class ServConnection
Get the InputStream.
getKeepalive() - Method in class Connection
Get the keepalive value.
getKeepAlive() - Method in class HTTPInputStream
Get the keep alive value.
getKeepAlive() - Method in class ServConnection
Get the keepalive value of this ServConnection.
getMaxSpareThread() - Method in class ConnectionPool
Get the current max of free threads.
getMaxThread() - Method in class ConnectionPool
Get the current max of concurrent threads.
getMethod() - Method in class HTTPHeader
Get the request method of this header (only valid for requests).
getMinSpareThread() - Method in class ConnectionPool
Get the current min of free threads.
getMinThread() - Method in class ConnectionPool
Get the current min of concurrent threads.
getOutputStream() - Method in class ServConnection
Get the OutputStream of this ServConnection.
getPort() - Method in class Proxy
Get the port this proxy is using.
getPort() - Method in class ServConnection
Get the port number this ServConnection is connected to.
getProperties(String) - Method in class Config
get the properties for a given section
getProperty(String, String) - Method in class Config
get a property for given key in specified section
getProperty(String, String, String) - Method in class Config
get a property for given key in specified section
getRequestLine() - Method in class HTTPHeader
Get the requestline of this header (only valid for requests).
getRequestURI() - Method in class HTTPHeader
Get the requestURI of this request (only valid for requests).
getResponseHTTPVersion() - Method in class HTTPHeader
Get the HTTP version of the response (only valid for responses).
getStatusCode() - Method in class HTTPHeader
Get the Status code of the response (only valid for responses).

H

handleRequest(HTTPHeader) - Method in class Connection
Handle a request by getting the datastream (from the cache or the web).
Header - class Header.
A class to handle a general Header.
Header.HeaderEntry - class Header.HeaderEntry.
This class holds a header entry, that has the folowing form "type: some text"
Header() - Constructor for class Header
Create a new empty Header
Header(DataInputStream) - Constructor for class Header
Create a new Header where entries are read from a given stream
hHeaderEntries - Variable in class Header
The hashtable of the headers. keys used are types, values are HeaderEntry Objects
HT - Static variable in class HTTPHeader
 
HTTPHeader - class HTTPHeader.
A class to handle a HTTP Header.
HTTPHeader() - Constructor for class HTTPHeader
Create a new empty HTTPHeader
HTTPHeader(DataInputStream) - Constructor for class HTTPHeader
Read in a HTTPHeader from an inputstream.
HTTPInputStream - class HTTPInputStream.
This is an extended DataInputStream suitable for reading data from the web.
HTTPInputStream(InputStream) - Constructor for class HTTPInputStream
Create a new HTTPInputStream on the underlying stream.
HTTPOutputStream - class HTTPOutputStream.
This is an extended DataOutputstream That can handle HTTP data.
HTTPOutputStream(OutputStream) - Constructor for class HTTPOutputStream
Create a new HTTPOutputStream on the underlying stream.

I

inPolicy - Static variable in class Proxy
IN/OUT authorization policies
isDot9Request() - Method in class HTTPHeader
Is this request a HTTP/0.9 type request?
isHeadOnlyRequest() - Method in class HTTPHeader
Is this request for the head only?
isResponse() - Method in class HTTPHeader
Try to guess if this header is a response.

K

KEEP_ALIVE_TIME - Variable in class ServConnectionManager
the keepalivetime time we keep ServConnections.
kill() - Method in class Proxy
shutdown
killConnection(Connection) - Method in class ConnectionPool
Kills a connection given its reference

L

lastModified - Variable in class Config
 
log - Static variable in class Proxy
The logger
logAccess(String, String, String, String, String) - Method in class Logger
log requests.
logError(String) - Method in class Logger
log errors.
Logger - class Logger.
This class is used to perform a very simple log Task
Logger(String, String) - Constructor for class Logger
 
logMessage(String) - Method in class Logger
log messages.
logWarning(String) - Method in class Logger
log warnings.

M

main(String[]) - Static method in class ProxyLauncher
Start a proxy.
manager - Variable in class ConnectionPool
Thread used to manage the pool

O

openSocket() - Method in class Proxy
Open a socket on the specified port also make the proxy continue listening connections.
openStreams() - Method in class Connection
Set up the streams used for reading request and sending data to and from the client.
outPolicy - Static variable in class Proxy
 

P

Policy - class Policy.
A class that handle ACCEPT/DENY policy for the Proxy
Policy(String) - Constructor for class Policy
Constructor
Policy(String, boolean) - Constructor for class Policy
Constructor
Proxy - class Proxy.
 
Proxy(int) - Constructor for class Proxy
Constructor, builds a Proxy instance running on the specified port number
ProxyLauncher - class ProxyLauncher.
 
ProxyLauncher() - Constructor for class ProxyLauncher
 

R

READ_BUFFER_SIZE - Static variable in class Connection
 
read(DataInputStream) - Method in class Header
Read in this header from the given Stream.
read(DataInputStream, String) - Method in class Header
Read in this header from the given Stream.
readBody(HTTPHeader) - Method in class Connection
If a content-length header field has been found, we have to read content-length 's value bytes and forward them to the server
readCRLF() - Method in class HTTPInputStream
Read of an CR LF combination.
readHTTPHeader() - Method in class HTTPInputStream
Read a HTTPHeader of this stream.
readHTTPHeader(DataInputStream) - Method in class HTTPHeader
Read a Header in an inputstream.
releaseConnection(ServConnection) - Method in class ServConnectionManager
Return a ServConnection to the pool so that it may be reused.
removeConnection(Connection) - Static method in class Proxy
Remove a connection (it has received full treatment)
removeHeaderEntry(String) - Method in class Header
removes a headerline from this header
RestartableThread - class RestartableThread.
A thread class that is restartable.
RestartableThread() - Constructor for class RestartableThread
 
returnConnection(Connection) - Method in class ConnectionPool
Return a thread to the pool.
run() - Method in class ConnectionPool
The cleaner thread is used to maintain the number of threads within the values defined by MAX_THREAD, MIN_THREAD, MAX_SPARE_THREAD and MIN_SPARE_THREAD
run() - Method in class Proxy
while we can, accept new sockets, creating a handler for each and also save connections for statistics.
run() - Method in class RestartableThread
Dont override this in subclasses.
run() - Method in class ServConnectionManager
The cleaner thread is used to drop old connections where keepalive time is over. after each clean session, cleaner sleeps for an amount of time of this.KEEP_ALIVE_TIME in order to save CPU

S

save(OutputStream) - Method in class Config
save the config to a OutputStream
save(OutputStream, String) - Method in class Config
save the config to a OutputStream
scm - Static variable in class Proxy
The ServConnectionManager used for server Connections
send(HTTPHeader) - Method in class Connection
Send a header to the client.
send400(String) - Method in class Connection
Send a 400 Bad Request error to the client.
send403(String) - Method in class Connection
Send a 403 Forbidden error to the client.
send500(Throwable) - Method in class Connection
Send a 500 Internal Server Error header for the given exception.
ServConnection - class ServConnection.
A class to handle a connection to an HTTP server.
ServConnection(InetAddress, int) - Constructor for class ServConnection
Create a new ServConnection to the given InetAddress and port.
ServConnectionManager - class ServConnectionManager.
A class to Manage ServConnection.
ServConnectionManager() - Constructor for class ServConnectionManager
Create a new ServConnectionManager for use.
setContent(String) - Method in class HTTPHeader
Set the Content for the request/response Mostly not used for responses.
setHeaderEntry(String, String) - Method in class Header
Set or replaces a value for given type.
setInactive() - Method in class ServConnection
Mark this ServConnection as Inactive at current time.
setInactiveTime(Date) - Method in class ServConnection
Mark this ServConnection as Inactive at given time.
setKeepalive(boolean) - Method in class Connection
Set keepalive to a new value.
setKeepAlive(boolean) - Method in class HTTPInputStream
Set the keep alive value to currentkeepalive & keepalive
setMaxSpareThread(int) - Method in class ConnectionPool
Set the max number of free threads
setMaxThread(int) - Method in class ConnectionPool
Set the max number of threads,
setMinSpareThread(int) - Method in class ConnectionPool
Set the min number of free threads
setMinThread(int) - Method in class ConnectionPool
Set the min number of threads
setProperties(String, Properties) - Method in class Config
set the properties for a given section
setProperty(String, String, String) - Method in class Config
set a property for given section.
setRequestLine(String) - Method in class HTTPHeader
Set the requestline of this header
setRequestURI(String) - Method in class HTTPHeader
Sets the request URI of this header
setSocket(Socket) - Method in class Connection
Give this connection a socket to handle, this makes call to start() method
setStatusLine(String) - Method in class HTTPHeader
Set the statusline of this header.
socket - Variable in class Connection
 
SOCKET_TIMEOUT - Static variable in class ServConnection
 
SP - Static variable in class HTTPHeader
 
start() - Method in class RestartableThread
Overridden to handle restarting of this thread.

T

toString() - Method in class Config
Get a string describing this Config
toString() - Method in class Header
Get the text value of this header
toString() - Method in class HTTPHeader
get the text value of this header

U

URGENT_SLEEP_TIME - Static variable in class ConnectionPool
manager will use it s sleep time if no more connections are available
used_threads - Variable in class ConnectionPool
 

V

VERSION - Static variable in class Proxy
Current version

W

write(byte) - Method in class HTTPOutputStream
Write a byte to the underlying stream.
write(byte[]) - Method in class HTTPOutputStream
Write a byte array to the underlying stream.
write(byte[], int, int) - Method in class HTTPOutputStream
Write a byte array to the underlying stream.
writeHTTPHeader(HTTPHeader) - Method in class HTTPOutputStream
Write a HTTPHeader on this stream.
writeHTTPHeader(HTTPHeader) - Method in class ServConnection
Write an HTTP header on this connection.

A C D E F G H I K L M O P R S T U V W