-
Notifications
You must be signed in to change notification settings - Fork 5
/
MessageService.java
70 lines (57 loc) · 2.2 KB
/
MessageService.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package de.diedavids.cuba.userinbox.service;
import com.haulmont.cuba.core.entity.Entity;
import com.haulmont.cuba.security.entity.User;
import de.diedavids.cuba.userinbox.entity.SendMessageEntity;
public interface MessageService {
String NAME = "ddcui_MessageService";
/**
* sends a message to a user as system (no sender defined in the message)
*
* @param receiver the user as the receiver of the message
* @param subject the subject of the message
* @param messageText the message text
* @param entityReference the shareable entity reference
*/
void sendSystemMessage(User receiver, String subject, String messageText, Entity entityReference);
/**
* sends a message to a user as system (no sender defined in the message)
*
* @param receiver the user as the receiver of the message
* @param subject the subject of the message
* @param messageText the message text
*/
void sendSystemMessage(User receiver, String subject, String messageText);
/**
* sends a message to a user with the current user as the sender
*
* @param receiver the user as the receiver of the message
* @param subject the subject of the message
* @param messageText the message text
* @param entityReference the shareable entity reference
*/
void sendMessage(User receiver, String subject, String messageText, Entity entityReference);
/**
* sends a message to a user with the current user as the sender
*
* @param receiver the user as the receiver of the message
* @param subject the subject of the message
* @param messageText the message text
*/
void sendMessage(User receiver, String subject, String messageText);
/**
* returns the count of unread messages for the current user
* @return the count of unread messages
*/
long countUnreadMessagesForCurrentUser();
/**
* sends a message using the SendMessageEntity, which allows to define:
* - receivers
* - sender
* - subject
* - text
* - shareable entity reference
*
* @param sendMessageEntity the SendMessageEntity
*/
void sendMessage(SendMessageEntity sendMessageEntity);
}