@Transactional public class MessageServiceImpl extends Object implements MessageService
| Constructor and Description |
|---|
MessageServiceImpl()
Public constructor Required for use with spring's method injection.
|
| Modifier and Type | Method and Description |
|---|---|
Message |
createMessage(String subject,
String content)
Create a message object with the given parts.
|
Message |
createMessage(String sender,
String subject,
String content)
Create a message object with the given parts.
|
Message |
createMessage(String recipients,
String sender,
String subject,
String content)
Create a message object with the given parts.
|
Message |
createMessage(String recipients,
String sender,
String subject,
String content,
String attachment,
String attachmentContentType,
String attachmentFileName) |
List |
getAllTemplates()
Get all templates in the database.
|
MessagePreparator |
getMessagePreparator() |
MessageSender |
getMessageSender() |
Template |
getTemplate(Integer id)
Get template by identifier.
|
List |
getTemplatesByName(String name)
Get templates by name.
|
Message |
prepareMessage(String templateName,
Map data)
Prepare a message based on a template and data used for variable substitution within template.
|
Message |
prepareMessage(Template template)
Prepare a message given the template.
|
void |
sendMessage(Message message)
Send the message.
|
void |
sendMessage(Message message,
Collection<User> users)
Send message to a collection of recipients.
|
void |
sendMessage(Message message,
Integer recipientId)
Send a message to a user that is identified by the given identifier.
|
void |
sendMessage(Message message,
Role role)
Sends a message to a group of users identifier by their role.
|
void |
sendMessage(Message message,
String roleName)
Send a message to a group of users identified by their role.
|
void |
sendMessage(Message message,
User user)
Send message to a single user.
|
void |
sendMessage(String recipients,
String sender,
String subject,
String content)
Send a message using the given parameters.
|
void |
setMessagePreparator(MessagePreparator messagePreparator)
Set the message preparator.
|
void |
setMessageSender(MessageSender messageSender)
Set the message sender.
|
void |
setTemplateDAO(TemplateDAO dao) |
public MessageServiceImpl()
public void setTemplateDAO(TemplateDAO dao)
public void setMessagePreparator(MessagePreparator messagePreparator)
setMessagePreparator in interface MessageServicemessagePreparator - public MessagePreparator getMessagePreparator()
getMessagePreparator in interface MessageServicepublic void setMessageSender(MessageSender messageSender)
setMessageSender in interface MessageServicemessageSender - public MessageSender getMessageSender()
getMessageSender in interface MessageServicepublic void sendMessage(Message message) throws MessageException
sendMessage in interface MessageServicemessage - the Message to be sentMessageException - Should send messageMessageService.sendMessage(org.openmrs.notification.Message)public Message createMessage(String recipients, String sender, String subject, String content) throws MessageException
createMessage in interface MessageServicerecipients - the recipients of the messagesender - the send of the messagesubject - the subject of the messagecontent - the content or body of the messageMessageException - Should create messagepublic Message createMessage(String sender, String subject, String content) throws MessageException
createMessage in interface MessageServicesender - the send of the messagesubject - the subject of the messagecontent - the content or body of the messageMessageExceptionpublic Message createMessage(String subject, String content) throws MessageException
createMessage in interface MessageServicesubject - the subject of the messagecontent - the content or body of the messageMessageExceptionpublic Message createMessage(String recipients, String sender, String subject, String content, String attachment, String attachmentContentType, String attachmentFileName) throws MessageException
public void sendMessage(String recipients, String sender, String subject, String content) throws MessageException
sendMessage in interface MessageServiceMessageExceptionpublic void sendMessage(Message message, Integer recipientId) throws MessageException
sendMessage in interface MessageServicemessage - Message to be sentrecipientId - Integer identifier of user (recipient)MessageExceptionpublic void sendMessage(Message message, User user) throws MessageException
sendMessage in interface MessageServicemessage - the Message to be sentuser - the recipient of the messageMessageExceptionpublic void sendMessage(Message message, Collection<User> users) throws MessageException
sendMessage in interface MessageServiceMessageExceptionpublic void sendMessage(Message message, String roleName) throws MessageException
sendMessage in interface MessageServiceMessageExceptionpublic void sendMessage(Message message, Role role) throws MessageException
sendMessage in interface MessageServiceMessageExceptionpublic Message prepareMessage(Template template) throws MessageException
prepareMessage in interface MessageServicetemplate - the given TemplateMessageMessageException@Transactional(readOnly=true) public Message prepareMessage(String templateName, Map data) throws MessageException
prepareMessage in interface MessageServicetemplateName - name of the template to be useddata - mapping used for variable substitution within templateMessageException@Transactional(readOnly=true) public List getAllTemplates() throws MessageException
getAllTemplates in interface MessageServiceMessageException@Transactional(readOnly=true) public Template getTemplate(Integer id) throws MessageException
getTemplate in interface MessageServiceid - template identifierMessageException@Transactional(readOnly=true) public List getTemplatesByName(String name) throws MessageException
getTemplatesByName in interface MessageServicename - the name of the templateMessageExceptionCopyright © 2024 OpenMRS Inc.. All rights reserved.