public class ClientsManager extends java.lang.Object implements ClientsManagerInterface
ClientManagerInterface
,
ClientInterface
,
Client
Constructor and Description |
---|
ClientsManager(int clientsCleanerTimeInMinutes,
int maxClientInactivityDurationInMinutes,
int maxTaskInactivityDurationInMinutes)
Construct a ClientManager
|
Modifier and Type | Method and Description |
---|---|
ClientInterface |
addClient()
Create and add a ClientInterface to the ClientManager
|
int |
countClient()
Count the number of clients in the ClientManager
|
ClientInterface |
getClient(java.lang.String sessionKey)
Return the ClientInterface corresponding to the sessionKey given in the parameters
|
void |
removeClient(ClientInterface client)
Remove a ClientInterface from the ClientManager
|
void |
setMaxClientInactivityDuration(int durationInMinutes)
Change the amount of time from which a client is considered as inactive
|
void |
setMaxTaskInactivityDuration(int durationInMinutes)
Change the amount of time from which a task is considered as too old
|
void |
setSessionCleanerTimer(int timeInMinutes)
Change the clients cleaning time frequency
|
public ClientsManager(int clientsCleanerTimeInMinutes, int maxClientInactivityDurationInMinutes, int maxTaskInactivityDurationInMinutes)
clientsCleanerTimeInMinutes
- the clients cleaning time frequency in minutesmaxClientInactivityDurationInMinutes
- the amount of time from which a client is considered as
too oldtasksCleanerTimeInMinutes
- the tasks cleaning frequency in minutesmaxTaskInactivityDurationInMinutes
- the amount of time from which a task is considered
as too oldpublic ClientInterface addClient()
addClient
in interface ClientsManagerInterface
public void removeClient(ClientInterface client)
removeClient
in interface ClientsManagerInterface
the
- ClientInterface to removepublic ClientInterface getClient(java.lang.String sessionKey)
getClient
in interface ClientsManagerInterface
public int countClient()
countClient
in interface ClientsManagerInterface
public void setSessionCleanerTimer(int timeInMinutes)
setSessionCleanerTimer
in interface ClientsManagerInterface
the
- clients cleaning time frequency in minutespublic void setMaxClientInactivityDuration(int durationInMinutes)
setMaxClientInactivityDuration
in interface ClientsManagerInterface
durationInMinutes
- the amount of time from which a client is considered as inactivepublic void setMaxTaskInactivityDuration(int durationInMinutes)
setMaxTaskInactivityDuration
in interface ClientsManagerInterface
durationInMinutes
- the amount of time from which a task is considered
as too old