Class MessageScheduler<T extends Message>
- java.lang.Object
-
- io.openems.backend.alerting.scheduler.MessageScheduler<T>
-
public class MessageScheduler<T extends Message> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description MessageScheduler(Handler<T> handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
handle()
Transfer the messages due to their handler.boolean
isFor(Handler<?> handler)
Check if this MessageScheduler handles messages for given handler.boolean
isScheduled(Message msg)
Get if given message is scheduled.void
remove(java.lang.String msgId)
Remove message from scheduler.void
schedule(T msg)
Add message to scheduler.int
size()
Get amount of scheduled messages.
-
-
-
Method Detail
-
schedule
public void schedule(T msg)
Add message to scheduler.- Parameters:
msg
- to add
-
remove
public void remove(java.lang.String msgId)
Remove message from scheduler.- Parameters:
msgId
- for message to remove
-
isScheduled
public boolean isScheduled(Message msg)
Get if given message is scheduled.- Parameters:
msg
- to check for- Returns:
- true if is scheduled
-
size
public int size()
Get amount of scheduled messages.- Returns:
- size of message queue
-
handle
public void handle()
Transfer the messages due to their handler.
-
isFor
public boolean isFor(Handler<?> handler)
Check if this MessageScheduler handles messages for given handler.- Parameters:
handler
- to check for- Returns:
- true if this MessageScheduler handles messages for given handler
-
-