|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.solab.alarms.AbstractAlarmChannel
com.solab.alarms.channels.HttpChannel
public class HttpChannel
This channel can send an alarm over an HTTP GET or POST request. It does not wait for a response unless specified to do so.
Field Summary |
---|
Fields inherited from class com.solab.alarms.AbstractAlarmChannel |
---|
log |
Constructor Summary | |
---|---|
HttpChannel()
|
Method Summary | |
---|---|
protected Runnable |
createSendTask(String msg,
String source)
Subclasses need to create and return a new Runnable in each call to this method. |
protected boolean |
hasSource(String alarmSource)
This method is used to determine if a certain alarm channel has a special condition for the specified alarmSource or not. |
void |
init()
Initializes the cached URL if the URL value has no alarm or source variables, and validates that there is postData if the URL is going to be cached. |
void |
setAlarmSource(Set<String> value)
You can set a list of sources in this property so that only alarm messages matching any of the sources are be posted as status updates. |
void |
setExpectedResponse(String value)
If this property is set, the channel waits for a response and scans it for this particular string, warning if not found. |
void |
setPostData(String value)
Sets the POST data for the HTTP request. |
void |
setUrl(String value)
Sets the URL to send the alarm to. |
Methods inherited from class com.solab.alarms.AbstractAlarmChannel |
---|
getMinResendInterval, send, setMinResendInterval, shutdown |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpChannel()
Method Detail |
---|
public void setExpectedResponse(String value)
public void setAlarmSource(Set<String> value)
public void setUrl(String value) throws MalformedURLException
MalformedURLException
public void setPostData(String value)
protected Runnable createSendTask(String msg, String source)
AbstractAlarmChannel
createSendTask
in class AbstractAlarmChannel
msg
- The message to be sent.source
- The alarm source. A channel can have different recipient lists depending on the alarm source.protected boolean hasSource(String alarmSource)
AbstractAlarmChannel
hasSource
in class AbstractAlarmChannel
@PostConstruct public void init() throws MalformedURLException
MalformedURLException
- if the url is fixed (no ${alarm} or ${source}) and it cannot be converted to a valid URL.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |