Skip to content
Snippets Groups Projects
Commit 3716e124 authored by Alexis Durgnat's avatar Alexis Durgnat :milky_way:
Browse files

Cleanup + sendMeeting

parent 4e540a61
Branches
No related tags found
1 merge request!21*poof* final version
......@@ -70,6 +70,14 @@ public class MessageManager extends MessageQueue {
this.conditionalSubscribeLeftJourney(eventHandler, (event) -> true);
}
/**
* Subscribe to all ChatMessage events
* @param eventHandler ChatMessage consumer
*/
public void subscribeChatMessage(Consumer<ChatMessage> eventHandler) {
this.conditionalSubscribeChatMessage(eventHandler, (event) -> true);
}
/**
* Subscribe to JoinedJourney events validating the condition
* @param eventHandler JoinedJourney consumer
......@@ -80,15 +88,6 @@ public class MessageManager extends MessageQueue {
this.conditionalSubscribe(Message.Type.JoinedJourney, eventHandler, condition);
}
/**
* Subscribe to Meetings events
* @param eventHandler Meeting consumer
* @param condition Meeting predicate
*/
public void conditionalSubscribeMeeting(Consumer<Meeting> eventHandler, Predicate<Meeting> condition) {
this.conditionalSubscribe(Message.Type.Meeting, eventHandler, condition);
}
/**
* Subscribe to LeftJourney events validating the condition
* @param eventHandler LeftJourney consumer
......@@ -97,6 +96,24 @@ public class MessageManager extends MessageQueue {
public void conditionalSubscribeLeftJourney(Consumer<LeftJourney> eventHandler, Predicate<LeftJourney> condition) {
this.conditionalSubscribe(Message.Type.LeftJourney, eventHandler, condition);
}
/**
* Subscribe to ChatMessage events validating the condition
* @param eventHandler ChatMessage consumer
* @param condition ChatMessage predicate
*/
public void conditionalSubscribeChatMessage(Consumer<ChatMessage> eventHandler, Predicate<ChatMessage> condition) {
this.conditionalSubscribe(Message.Type.ChatMessage, eventHandler, condition);
}
/**
* Subscribe to Meetings events
* @param eventHandler Meeting consumer
* @param condition Meeting predicate
*/
public void conditionalSubscribeMeeting(Consumer<Meeting> eventHandler, Predicate<Meeting> condition) {
this.conditionalSubscribe(Message.Type.Meeting, eventHandler, condition);
}
/**
* Send a JoinedJourney event
......@@ -115,27 +132,18 @@ public class MessageManager extends MessageQueue {
}
/**
* Subscribe to all ChatMessage events
* @param eventHandler ChatMessage consumer
*/
public void subscribeChatMessage(Consumer<ChatMessage> eventHandler) {
this.conditionalSubscribeChatMessage(eventHandler, (event) -> true);
}
/**
* Subscribe to ChatMessage events validating the condition
* @param eventHandler ChatMessage consumer
* @param condition ChatMessage predicate
* Send a ChatMessage event
* @param event ChatMessage event
*/
public void conditionalSubscribeChatMessage(Consumer<ChatMessage> eventHandler, Predicate<ChatMessage> condition) {
this.conditionalSubscribe(Message.Type.ChatMessage, eventHandler, condition);
public void sendChatMessage(ChatMessage event) {
this.sendEvent(Message.Type.ChatMessage, event);
}
/**
* Send a ChatMessage event
* @param event ChatMessage event
*/
public void sendChatMessage(ChatMessage event) {
this.sendEvent(Message.Type.ChatMessage, event);
public void sendMeeting(Meeting event) {
this.sendEvent(Message.Type.Meeting, event);
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment