public class ForwardServerManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
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).
|
Modifier | Constructor and Description |
---|---|
private |
ForwardServerManager()
This creates a new instance of ForwardManager.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
addListenSocket(int a_portNumber)
This opens a listen socket at the specified portnumber.
|
java.lang.Object |
addServerManager(IServerManager a_manager)
Adds a 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.
|
boolean |
isRunning() |
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...)
|
void |
shutdownForwarding()
This method must be called, when forwarding shall come to an end.
|
void |
startForwarding()
This method starts the forwarding code.
|
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
private ForwardServerManager()
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 boolean isRunning()
public void shutdownForwarding()
public void startForwarding()
public ForwardSchedulerStatistics getSchedulerStatistics()
public int getCurrentlyForwardedConnections()
Copyright © 2023. All rights reserved.