@Service(value="notificationManagement") public class NotificationManagementImpl extends NotificationManagementBase
NotificationManagement
Modifier and Type | Field and Description |
---|---|
static int |
XMPP_PRIORITY
Default priority for xmpp.
|
Constructor and Description |
---|
NotificationManagementImpl(UserManagement userManagement,
NoteManagement noteManagement,
MailSender mailSender) |
Modifier and Type | Method and Description |
---|---|
String |
getXMPPId() |
protected void |
handleDisableUser(long userId,
String connectorId)
Performs the core logic for
NotificationManagementBase.disableUser(long, String) |
protected void |
handleEnableUser(long userId,
String connectorId)
Performs the core logic for
NotificationManagementBase.enableUser(long, String) |
protected String |
handleGetClientId(String client,
String connectorId)
Performs the core logic for
NotificationManagementBase.getClientId(String, String) |
protected String |
handleGetUserAlias(String username,
String connectorId)
Performs the core logic for
NotificationManagementBase.getUserAlias(String, String) |
protected void |
handleRemoveMessagerConnector(String connectorId)
Performs the core logic for
NotificationManagementBase.removeMessagerConnector(String) |
void |
registerMessagerConnector(MessagerConnector connector) |
void |
sendMessage(Long noteId,
Long userId,
NotificationDefinition notificationDefinition,
Map<String,Object> model)
Send notifications to users to inform about created or edited notes.
|
void |
sendMessage(Note note,
Collection<User> usersToNotify,
NotificationDefinition definition)
Send notifications to users to inform about created or edited notes.
|
void |
start()
Use this method to initialise the management.
|
void |
stop()
Use this method to stop the management.
|
disableUser, enableUser, getClientId, getPrincipal, getUserAlias, removeMessagerConnector
public static final int XMPP_PRIORITY
@Autowired public NotificationManagementImpl(UserManagement userManagement, NoteManagement noteManagement, MailSender mailSender)
@Transactional(propagation=SUPPORTS) public String getXMPPId()
protected void handleDisableUser(long userId, String connectorId)
NotificationManagementBase.disableUser(long, String)
handleDisableUser
in class NotificationManagementBase
userId
- Id of the user.connectorId
- Id of the connector.protected void handleEnableUser(long userId, String connectorId)
NotificationManagementBase.enableUser(long, String)
handleEnableUser
in class NotificationManagementBase
userId
- Id of the user.connectorId
- Id of the connector.protected String handleGetClientId(String client, String connectorId)
NotificationManagementBase.getClientId(String, String)
handleGetClientId
in class NotificationManagementBase
client
- The client.connectorId
- Id of the connector.protected String handleGetUserAlias(String username, String connectorId)
NotificationManagementBase.getUserAlias(String, String)
handleGetUserAlias
in class NotificationManagementBase
username
- The users name.connectorId
- Id of the connector.protected void handleRemoveMessagerConnector(String connectorId)
NotificationManagementBase.removeMessagerConnector(String)
handleRemoveMessagerConnector
in class NotificationManagementBase
connectorId
- Id of the connector.public void registerMessagerConnector(MessagerConnector connector)
connector
- Connector to register.public void sendMessage(Long noteId, Long userId, NotificationDefinition notificationDefinition, Map<String,Object> model)
noteId
- Id of the note, which should be send. the note to inform aboutuserId
- Id of the user to notify.notificationDefinition
- The current definition of the notification.model
- Additional elements used for the velocity context.public void sendMessage(Note note, Collection<User> usersToNotify, NotificationDefinition definition)
note
- the note to inform aboutusersToNotify
- the users to be notifieddefinition
- The current definition of the notification.@Transactional(propagation=SUPPORTS) public void start()
Use this method to initialise the management.
@Transactional(propagation=SUPPORTS) public void stop()
Use this method to stop the management.
Copyright © 2019 Communote team. All rights reserved.