public abstract class RateLimitedDispatcher extends Object implements MessageDispatcher
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
log
Pre-configured logger.
|
Constructor and Description |
---|
RateLimitedDispatcher() |
Modifier and Type | Method and Description |
---|---|
abstract void |
dispatch(String messageSubject,
String messageContent,
String target)
Dispatch a message to a recipient that doesn't care what produced it.
|
void |
dispatch(TavernaRun ignored,
String messageSubject,
String messageContent,
String target)
Dispatch a message to a recipient.
|
protected boolean |
isSendAllowed(String who)
Test whether the rate limiter allows the given user to send a message.
|
void |
setCooldownSeconds(int cooldownSeconds)
Set how long must elapse between updates to the status of any particular
user.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName, isAvailable
public void setCooldownSeconds(int cooldownSeconds)
cooldownSeconds
- Time to elapse, in seconds.protected boolean isSendAllowed(String who)
who
- Who wants to send the message?public void dispatch(TavernaRun ignored, String messageSubject, String messageContent, String target) throws Exception
MessageDispatcher
dispatch
in interface MessageDispatcher
ignored
- The workflow run that produced the message.messageSubject
- The subject of the message to send.messageContent
- The plain-text content of the message to send.target
- A description of where it is to go.Exception
- If anything goes wrong.public abstract void dispatch(String messageSubject, String messageContent, String target) throws Exception
messageSubject
- The subject of the message to send.messageContent
- The plain-text content of the message to send.target
- A description of where it is to go.Exception
- If anything goes wrong.Copyright © 2015–2018 The Apache Software Foundation. All rights reserved.