org.writersforge.catalan.process.queue
Class AlertQueue

java.lang.Object
  extended byorg.writersforge.catalan.process.queue.AlertQueue

public class AlertQueue
extends java.lang.Object

Manager for all alerts generated during a processing run.

Author:
jsheets

Constructor Summary
AlertQueue()
          Creates a new instance of AlertQueue.
 
Method Summary
 void addAlert(Alert alert)
          Adds the alert to the queue.
 int getAlertCount()
          Calculates how many distinct Alert objects exist in the queue.
 int getAlertCount(AlertPriority priority)
          Calculates how many distinct Alert objects exist in the queue with the given priority.
 Alert[] getAlerts()
          Retrieves all Alert objects in the queue.
 Alert[] getAlerts(AlertPriority priority)
          Retrieves all Alert objects in the queue of the given priority.
 void logAllAlerts()
          Sends all Alerts to the logger.
 void logErrorAlerts()
          Sends all ERROR Alerts to the logger.
 void logFatalAlerts()
          Sends all FATAL Alerts to the logger.
 void logInfoAlerts()
          Sends all INFO Alerts to the logger.
 void logWarningAlerts()
          Sends all WARNING Alerts to the logger.
 void removeAlert(Alert alert)
          Removes the alert from the queue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlertQueue

public AlertQueue()
Creates a new instance of AlertQueue.

Method Detail

addAlert

public void addAlert(Alert alert)
Adds the alert to the queue. If the alert object already exists in the queue, this method will not add a duplicate.

Parameters:
alert - Alert to add

removeAlert

public void removeAlert(Alert alert)
Removes the alert from the queue.

Parameters:
alert - Alert to remove

getAlerts

public Alert[] getAlerts()
Retrieves all Alert objects in the queue.

Returns:
all Alert objects

getAlerts

public Alert[] getAlerts(AlertPriority priority)
Retrieves all Alert objects in the queue of the given priority.

Parameters:
priority - AlertPriority to get
Returns:
all Alert objects of the given priority

getAlertCount

public int getAlertCount()
Calculates how many distinct Alert objects exist in the queue.

Returns:
the number of Alert objects in the queue

getAlertCount

public int getAlertCount(AlertPriority priority)
Calculates how many distinct Alert objects exist in the queue with the given priority.

Parameters:
priority - AlertPriority to count
Returns:
the number of Alert objects of the given priority

logFatalAlerts

public void logFatalAlerts()
Sends all FATAL Alerts to the logger.


logErrorAlerts

public void logErrorAlerts()
Sends all ERROR Alerts to the logger.


logWarningAlerts

public void logWarningAlerts()
Sends all WARNING Alerts to the logger.


logInfoAlerts

public void logInfoAlerts()
Sends all INFO Alerts to the logger.


logAllAlerts

public void logAllAlerts()
Sends all Alerts to the logger.