Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tp-4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pirkl-poo-2018
tp-4
Commits
3716e124
Commit
3716e124
authored
6 years ago
by
Alexis Durgnat
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup + sendMeeting
parent
4e540a61
Branches
Branches containing commit
No related tags found
1 merge request
!21
*poof* final version
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/ch/hepia/mq/MessageManager.java
+32
-24
32 additions, 24 deletions
src/main/java/ch/hepia/mq/MessageManager.java
with
32 additions
and
24 deletions
src/main/java/ch/hepia/mq/MessageManager.java
+
32
−
24
View file @
3716e124
...
...
@@ -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
conditionalSubscribe
ChatMessage
(
Consumer
<
ChatMessage
>
event
Handler
,
Predicate
<
ChatMessage
>
condition
)
{
this
.
conditionalSubscribe
(
Message
.
Type
.
ChatMessage
,
event
Handler
,
condition
);
public
void
send
ChatMessage
(
ChatMessage
event
)
{
this
.
sendEvent
(
Message
.
Type
.
ChatMessage
,
event
);
}
/**
* Send a ChatMessage event
* @param event ChatMessage event
*/
public
void
send
ChatMessage
(
ChatMessage
event
)
{
this
.
sendEvent
(
Message
.
Type
.
ChatMessage
,
event
);
public
void
send
Meeting
(
Meeting
event
)
{
this
.
sendEvent
(
Message
.
Type
.
Meeting
,
event
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment