|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.solab.alarms.AlarmSender
public class AlarmSender
This is the central class for jAlarms. An AlarmSender can have several AlarmChannel instances to send alarms through different channels to different people.
Constructor Summary | |
---|---|
AlarmSender()
|
Method Summary | |
---|---|
int |
getAlarmTimeBuffer()
|
String |
getStatus()
|
void |
init()
Sets up a ScheduledExecutorService if necessary, to buffer alarm messages that are supposed to be sent always. |
void |
sendAlarm(String msg)
Sends an alarm through all channels, to the default users defined for each channel, as long as the message hasn't been already sent very recently. |
void |
sendAlarm(String msg,
String source)
Sends an alarm through all channels, to the users defined for the specified source in each channel, as long as the message hasn't been already sent very recently. |
void |
sendAlarmAlways(String msg)
Sends an alarm through all channels, to the default users defined for each channel, regardless of the last time the same message was sent. |
void |
sendAlarmAlways(String msg,
String source)
Sends an alarm through all channels, to the users defined for the specified source in each channel, regardless of the last time the same message was sent. |
void |
setAlarmCache(AlarmCache value)
Sets the cache to use for alarm messages. |
void |
setAlarmChannels(List<AlarmChannel> channels)
Sets the alarm channels to be used for sending alarm messages. |
void |
setAlarmTimeBuffer(int value)
Sets the time in milliseconds that the alarms sent via sendAlarmAlways(String, String) are
buffered before actually sending them. |
void |
shutdown()
Shuts down all channels, and the alarm cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AlarmSender()
Method Detail |
---|
public void setAlarmTimeBuffer(int value)
sendAlarmAlways(String, String)
are
buffered before actually sending them. Default is 0 which causes alarms to be sent immediately. If
set to a positive value, alarms are not sent immediately, but are rather queued to be sent after
sitting for the time specified here. If several identical messages are queued, only one is sent,
specifying how many times it was received. The queue is reviewed every 30 seconds, which means that
alarms will always be transmitted no sooner than 30 to 60 seconds after they're received, if they were
only received one time; an alarm that's been received 2 or more times will be queued for as long
as the buffer specifies.
public int getAlarmTimeBuffer()
public void setAlarmCache(AlarmCache value)
public void setAlarmChannels(List<AlarmChannel> channels)
public void sendAlarm(String msg, String source)
msg
- The message to be sent as an alarm.source
- The alarm source. The channels can use this information to determine the recipients
of the alarm. If null, the default recipients for each channel are used.public void sendAlarmAlways(String msg, String source)
msg
- The alarm message to be sent through the channels.source
- The alarm source. The channels can use this information to determine
the recipients of the alarm. If null, the default recipients for each channel are used.public void sendAlarm(String msg)
public void sendAlarmAlways(String msg)
@PostConstruct public void init()
@PreDestroy public void shutdown()
public String getStatus()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |