|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object forward.server.ForwardServerManager
public class ForwardServerManager
This class manages the whole forwarding server and supplies some important methods to other classes. This class is a singleton.
Field Summary | |
---|---|
static int |
CLIENT_CONNECTION_TIMEOUT
This is the timeout for all socket methods on the client connection. |
static int |
CLIENT_DUMMYTRAFFIC_INTERVAL
This is the interval, we need dummy traffic from the client (in milliseconds). |
private ForwardCascadeDatabase |
m_allowedCascadesDatabase
Stores the database with with the MixCascades, where connections can be forwarded to. |
private int |
m_dummyTrafficInterval
Stores the dummy traffic interval (in ms), if we need dummy traffic for holding a connection while phases of inactivity. |
private ForwardScheduler |
m_forwardScheduler
Stores the associated ForwardScheduler. |
private static ForwardServerManager |
ms_fsmInstance
Stores the instance of ForwardServerManager (Singleton). |
Constructor Summary | |
---|---|
private |
ForwardServerManager()
This creates a new instance of ForwardManager. |
Method Summary | |
---|---|
java.lang.Object |
addListenSocket(int a_portNumber)
This opens a listen socket at the specified portnumber. |
java.lang.Object |
addServerManager(IServerManager a_manager)
Adds an ServerManager. |
ForwardCascadeDatabase |
getAllowedCascadesDatabase()
Returns the database with the MixCascades, where connections are allowed to be forwarded to. |
int |
getCurrentlyForwardedConnections()
Returns the number of currently forwarded connections. |
int |
getDummyTrafficInterval()
Returns the dummy traffic interval. |
static ForwardServerManager |
getInstance()
Returns the instance of ForwardServerManager (Singleton). |
ForwardSchedulerStatistics |
getSchedulerStatistics()
Returns the statistics instance of the scheduler. |
void |
removeAllServerManagers()
Removes all ServerManagers from the list of associated ServerManagers of the internal ForwardScheduler. |
void |
removeServerManager(java.lang.Object a_serverManagerId)
Removes one ServerManager from the list of associated ServerManagers of this ForwardScheduler. |
void |
setDummyTrafficInterval(int a_interval)
This sets the dummy traffic interval. |
void |
setMaximumNumberOfConnections(int a_maxNumberOfConnections)
Changes the number of simultaneously forwarded client connections. |
void |
setNetBandwidth(int a_netBandwidth)
Changes the maximum bandwidth (net bandwidth, without TCP/IP headers...) which can be used by all client connections together. |
void |
shutdownForwarding()
This method must be called, when forwarding shall come to an end. |
void |
startForwarding()
This method starts the forwarding code. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int CLIENT_CONNECTION_TIMEOUT
public static final int CLIENT_DUMMYTRAFFIC_INTERVAL
private static ForwardServerManager ms_fsmInstance
private int m_dummyTrafficInterval
private ForwardCascadeDatabase m_allowedCascadesDatabase
private ForwardScheduler m_forwardScheduler
Constructor Detail |
---|
private ForwardServerManager()
Method Detail |
---|
public static ForwardServerManager getInstance()
public void setDummyTrafficInterval(int a_interval)
a_interval
- The dummy traffic interval (in milliseconds) or -1, if dummy traffic is
disabled.public int getDummyTrafficInterval()
public ForwardCascadeDatabase getAllowedCascadesDatabase()
public void setMaximumNumberOfConnections(int a_maxNumberOfConnections)
public void setNetBandwidth(int a_netBandwidth)
a_netBandwidth
- The maximum bandwidth for all client connections together (= average
upstream = average downstream) in bytes/sec.public java.lang.Object addListenSocket(int a_portNumber)
a_portNumber
- The portnumber where the new server socket will listen on.
public java.lang.Object addServerManager(IServerManager a_manager)
public void removeServerManager(java.lang.Object a_serverManagerId)
a_serverManagerId
- The ID of the ServerManager to close, see IServerManager.getId().public void removeAllServerManagers()
public void shutdownForwarding()
public void startForwarding()
public ForwardSchedulerStatistics getSchedulerStatistics()
public int getCurrentlyForwardedConnections()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |