@Bean(name="connections-task") public class ConnectionsTask extends AbstractConfigurableTimerTask implements InfoTask
Modifier and Type | Field and Description |
---|---|
protected MonitorComponent |
component |
protected static DateTimeFormatter |
dtf |
protected EventBus |
eventBus |
protected static Logger |
log |
Constructor and Description |
---|
ConnectionsTask() |
Modifier and Type | Method and Description |
---|---|
static Element |
createAlarmEvent(int currentOnlineUsers,
int lastOnlineUsers,
int thresholdMinimal,
int threshold)
Creates alarm event if required.
|
Form |
getCurrentConfiguration() |
Form |
getTaskInfo() |
int |
getThreshold() |
int |
getThresholdMinimal() |
protected void |
run() |
void |
setNewConfiguration(Form form) |
void |
setThreshold(int threshold) |
void |
setThresholdMinimal(int thresholdMinimal) |
beforeUnregister, disable, enable, getPeriod, getTimerTaskService, setPeriod, setPeriod, setTimerTaskService
isEnabled, setEnabled
protected static final DateTimeFormatter dtf
protected static final Logger log
@Inject protected MonitorComponent component
public static Element createAlarmEvent(int currentOnlineUsers, int lastOnlineUsers, int thresholdMinimal, int threshold)
currentOnlineUsers
- current amount of online users.lastOnlineUsers
- previous amount of online users.thresholdMinimal
- minimal amount of disconnected users to create alarm event.threshold
- percent of disconnected users to create alarm event.null
.public Form getCurrentConfiguration()
getCurrentConfiguration
in interface ConfigurableTask
getCurrentConfiguration
in class AbstractConfigurableTimerTask
public Form getTaskInfo()
getTaskInfo
in interface InfoTask
public int getThreshold()
public void setThreshold(int threshold)
public int getThresholdMinimal()
public void setThresholdMinimal(int thresholdMinimal)
protected void run()
run
in class AbstractConfigurableTimerTask
public void setNewConfiguration(Form form)
setNewConfiguration
in interface ConfigurableTask
setNewConfiguration
in class AbstractConfigurableTimerTask
Copyright © 2017 "Tigase, Inc.". All rights reserved.