Class ConnectionsTask

All Implemented Interfaces:
Initializable, UnregisterAware, ConfigurableTask, InfoTask, MonitorTask

@Bean(name="connections-task", parent=MonitorComponent.class, active=true) public class ConnectionsTask extends AbstractConfigurableTimerTask implements InfoTask, Initializable
  • Field Details

  • Constructor Details

    • ConnectionsTask

      public ConnectionsTask()
  • Method Details

    • createAlarmEvent

      @Deprecated public static Element createAlarmEvent(int currentOnlineUsers, int lastOnlineUsers, int thresholdMinimal, int threshold)
      Creates alarm event if required. Event will be created only if both conditions will met.
      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.
      event or null.
    • createUserDisconnectedEvent

      public static Optional<tigase.monitor.tasks.ConnectionsTask.UserDisconnectedEvent> createUserDisconnectedEvent(int currentOnlineUsers, int lastOnlineUsers, int thresholdMinimal, int threshold)
    • getCurrentConfiguration

      public Form getCurrentConfiguration()
      Specified by:
      getCurrentConfiguration in interface ConfigurableTask
      getCurrentConfiguration in class AbstractConfigurableTimerTask
    • getTaskInfo

      public Form getTaskInfo()
      Specified by:
      getTaskInfo in interface InfoTask
    • getThreshold

      public int getThreshold()
    • setThreshold

      public void setThreshold(int threshold)
    • getThresholdMinimal

      public int getThresholdMinimal()
    • setThresholdMinimal

      public void setThresholdMinimal(int thresholdMinimal)
    • initialize

      public void initialize()
      Description copied from interface: Initializable
      Method will be called, when bean will be created, configured and ready to use.
      Specified by:
      initialize in interface Initializable
      initialize in class AbstractConfigurableTask
    • setNewConfiguration

      public void setNewConfiguration(Form form)
      Specified by:
      setNewConfiguration in interface ConfigurableTask
      setNewConfiguration in class AbstractConfigurableTimerTask
    • run

      protected void run()
      Specified by:
      run in class AbstractConfigurableTimerTask