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 |
create(String subject,
String message)
Deprecated.
|
Message |
create(String sender,
String subject,
String message)
Deprecated.
|
Message |
create(String recipients,
String sender,
String subject,
String message)
Deprecated.
|
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 |
prepare(String templateName,
Map data)
Deprecated.
|
Message |
prepare(Template template)
Deprecated.
|
Message |
prepareMessage(String templateName,
Map data)
Prepare a message based on a template and data used for variable subsitution within template.
|
Message |
prepareMessage(Template template)
Prepare a message given the template.
|
void |
send(Message message)
Deprecated.
|
void |
send(Message message,
Collection<User> users)
Deprecated.
|
void |
send(Message message,
Integer userId)
Deprecated.
|
void |
send(Message message,
Role role)
Deprecated.
|
void |
send(Message message,
String roleName)
Deprecated.
|
void |
send(Message message,
User user)
Deprecated.
|
void |
send(String recipients,
String sender,
String subject,
String message)
Deprecated.
|
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 thir 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 MessageService
messagePreparator
- public MessagePreparator getMessagePreparator()
getMessagePreparator
in interface MessageService
public void setMessageSender(MessageSender messageSender)
setMessageSender
in interface MessageService
messageSender
- public MessageSender getMessageSender()
getMessageSender
in interface MessageService
public void sendMessage(Message message) throws MessageException
sendMessage
in interface MessageService
message
- the Message to be sentMessageException
MessageService.sendMessage(org.openmrs.notification.Message)
public Message createMessage(String recipients, String sender, String subject, String content) throws MessageException
createMessage
in interface MessageService
recipients
- the recipients of the messagesender
- the send of the messagesubject
- the subject of the messagecontent
- the content or body of the messageMessageException
public Message createMessage(String sender, String subject, String content) throws MessageException
createMessage
in interface MessageService
sender
- the send of the messagesubject
- the subject of the messagecontent
- the content or body of the messageMessageException
public Message createMessage(String subject, String content) throws MessageException
createMessage
in interface MessageService
subject
- the subject of the messagecontent
- the content or body of the messageMessageException
public 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 MessageService
MessageException
public void sendMessage(Message message, Integer recipientId) throws MessageException
sendMessage
in interface MessageService
message
- Message
to be sentrecipientId
- Integer identifier of user (recipient)MessageException
public void sendMessage(Message message, User user) throws MessageException
sendMessage
in interface MessageService
message
- the Message
to be sentuser
- the recipient of the messageMessageException
public void sendMessage(Message message, Collection<User> users) throws MessageException
sendMessage
in interface MessageService
MessageException
public void sendMessage(Message message, String roleName) throws MessageException
sendMessage
in interface MessageService
MessageException
public void sendMessage(Message message, Role role) throws MessageException
sendMessage
in interface MessageService
MessageException
public Message prepareMessage(Template template) throws MessageException
prepareMessage
in interface MessageService
template
- the given Template
Message
MessageException
public Message prepareMessage(String templateName, Map data) throws MessageException
prepareMessage
in interface MessageService
templateName
- name of the template to be useddata
- data mapping used for variable substitution within templateMessageException
public List getAllTemplates() throws MessageException
getAllTemplates
in interface MessageService
MessageException
public Template getTemplate(Integer id) throws MessageException
getTemplate
in interface MessageService
id
- template identifierMessageException
public List getTemplatesByName(String name) throws MessageException
getTemplatesByName
in interface MessageService
name
- the name of the templateMessageException
public Message create(String subject, String message) throws MessageException
create
in interface MessageService
MessageException
MessageService.create(java.lang.String, java.lang.String)
public Message create(String sender, String subject, String message) throws MessageException
create
in interface MessageService
MessageException
MessageService.create(java.lang.String, java.lang.String,
java.lang.String)
public Message create(String recipients, String sender, String subject, String message) throws MessageException
create
in interface MessageService
MessageException
MessageService.create(java.lang.String, java.lang.String,
java.lang.String, java.lang.String)
public Message prepare(String templateName, Map data) throws MessageException
prepare
in interface MessageService
MessageException
MessageService.prepare(java.lang.String, java.util.Map)
public Message prepare(Template template) throws MessageException
prepare
in interface MessageService
MessageException
MessageService.prepare(org.openmrs.notification.Template)
public void send(Message message) throws MessageException
sendMessage(Message)
send
in interface MessageService
MessageException
MessageService.send(org.openmrs.notification.Message)
public void send(Message message, String roleName) throws MessageException
sendMessage(Message, String)
send
in interface MessageService
MessageException
MessageService.send(org.openmrs.notification.Message,
java.lang.String)
public void send(Message message, Integer userId) throws MessageException
sendMessage(Message, Integer)
send
in interface MessageService
MessageException
MessageService.send(org.openmrs.notification.Message,
java.lang.Integer)
public void send(Message message, User user) throws MessageException
sendMessage(Message, User)
send
in interface MessageService
MessageException
MessageService.send(org.openmrs.notification.Message,
org.openmrs.User)
public void send(Message message, Role role) throws MessageException
send(Message, Role)
send
in interface MessageService
MessageException
MessageService.send(org.openmrs.notification.Message,
org.openmrs.Role)
public void send(Message message, Collection<User> users) throws MessageException
send(Message, Collection)
send
in interface MessageService
MessageException
MessageService.send(org.openmrs.notification.Message,
java.util.Collection)
public void send(String recipients, String sender, String subject, String message) throws MessageException
send(String, String, String, String)
send
in interface MessageService
MessageException
MessageService.send(java.lang.String, java.lang.String,
java.lang.String, java.lang.String)
Copyright © 2018 OpenMRS LLC.. All Rights Reserved.