|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
rabbit.proxy.Proxy
This is the central dispatcher for RabbIT. Basically it sits in a loop accepting connection and for each connection creating a handler for it. Also handles logging so it goes out nicely formatted (and synchronized).
Field Summary | |
static int |
ALL
Show all normal messages and higher. |
static Config |
config
The current configuration |
static int |
DEBUG
Show all messages in the log. |
static int |
ERROR
Show error messages and higer. |
static int |
FATAL
Show only fatal messages. |
static int |
INFO
Show information messages and higher. |
static int |
MSG
Show important messages and above. |
static java.lang.String |
VERSION
Current version |
static int |
WARN
Show warnings and higer. |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Method Summary | |
static NCache |
getCache()
Get the cache the proxy are using. |
static ConnectionHandler |
getConnectionHandler()
Get the connection handler. |
static int |
getConnectPort(int port)
Get the port to connect to. |
static Counter |
getCounter()
Get the Log-handle |
static java.util.Vector |
getCurrentConections()
returns the current connections. |
static java.util.logging.Level |
getErrorLevel(int errorlevel)
Get the String description of the given error level |
static int |
getErrorLevel(java.lang.String errorlevel)
Get the actual error level from the given String. |
static java.net.InetAddress |
getHost()
Get the local host. |
static java.net.InetAddress |
getInetAddress(java.net.URL url)
Get the InetAddress to connect to. |
static long |
getOffset()
Get the offset in milis from GMT NOTE! the offset is only calculated at startup. |
static int |
getPort()
Get the port this proxy is using. |
static java.lang.String |
getProxyAuthString()
Get the authenticationstring to use for proxy. |
static java.lang.String |
getServerIdentity()
|
static java.util.Date |
getStartDate()
return the time when the proxy was started. |
java.util.TimeZone |
getTimeZone()
Get the time zone the proxy is running in. |
static WebConnection |
getWebConnection(HTTPHeader header)
Get a WebConnection. |
static boolean |
isAccepting()
Returns the accepting. |
static boolean |
isProxyConnected()
are we connected to another proxy? |
static void |
kill()
shutdown |
static void |
logConnection(Connection con)
log a connection handled. |
static void |
logError(int type,
java.lang.String error,
java.lang.String obj,
java.lang.String meth)
log errors and other important stuff. |
static void |
logError(java.lang.String error)
log errors and other important stuff. |
static void |
main(java.lang.String[] args)
Start a proxy. |
static void |
printHelp()
print out the helptext to the user. |
static void |
reConfigure(Config config)
Reconfigure the proxy during runtime. |
static void |
releaseWebConnection(WebConnection wc)
Release a WebConnection so that it may be reused if possible. |
static void |
removeConnection(Connection con)
Remove a connection (it has received full treatment) |
void |
run()
while we can, accept new sockets, creating a handler for each and also save connections for statistics. |
static void |
saveConfig()
save the config back to file |
static void |
startProxy()
|
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, toString, yield |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String VERSION
public static final int DEBUG
public static final int ALL
public static final int INFO
public static final int WARN
public static final int MSG
public static final int ERROR
public static final int FATAL
public static Config config
Method Detail |
public static void main(java.lang.String[] args)
args
- the command-line flags given.public static void startProxy()
public java.util.TimeZone getTimeZone()
public static long getOffset()
public static ConnectionHandler getConnectionHandler()
public static WebConnection getWebConnection(HTTPHeader header) throws java.io.IOException
java.io.IOException
public static void releaseWebConnection(WebConnection wc)
wc
- the WebConnection to release.public void run()
public static void printHelp()
public static void reConfigure(Config config)
config
- the new config.public static void saveConfig()
public static int getErrorLevel(java.lang.String errorlevel)
errorlevel
- the String to translate.
public static java.util.logging.Level getErrorLevel(int errorlevel)
errorlevel
- the int to translate to a String.
public static void logError(java.lang.String error)
error
- the thing that happend.public static void logError(int type, java.lang.String error, java.lang.String obj, java.lang.String meth)
type
- the type of the error.error
- the thing that happend.public static NCache getCache()
public static Counter getCounter()
public static int getPort()
public static java.net.InetAddress getHost()
public static boolean isProxyConnected()
public static java.net.InetAddress getInetAddress(java.net.URL url) throws java.net.UnknownHostException
java.net.UnknownHostException
public static int getConnectPort(int port)
port
- the port we want to connect to.
public static java.lang.String getProxyAuthString()
public static java.util.Vector getCurrentConections()
public static void removeConnection(Connection con)
con
- the connection that is closing down.public static java.util.Date getStartDate()
public static java.lang.String getServerIdentity()
public static void logConnection(Connection con)
con
- the Connection that handled a requestpublic static void kill()
public static boolean isAccepting()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |