Package ome.services.mail
Class ObjectMailSender
- java.lang.Object
-
- ome.services.mail.MailSender
-
- ome.services.mail.ObjectMailSender
-
- All Implemented Interfaces:
java.util.EventListener
,org.springframework.context.ApplicationListener<EventLogsMessage>
public class ObjectMailSender extends MailSender implements org.springframework.context.ApplicationListener<EventLogsMessage>
When anEventLogMessage
of the specified type and kind is received, an email is sent to all users which are returned by a given query. A number of parameters are made available to the query via aParameters
instance.
-
-
Field Summary
-
Fields inherited from class ome.services.mail.MailSender
log
-
-
Constructor Summary
Constructors Constructor Description ObjectMailSender()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addUser(java.util.Set<java.lang.String> addresses, ome.model.meta.Experimenter exp)
java.lang.String
getAction()
java.lang.Class<ome.model.IObject>
getObjectClass()
java.lang.String
getQueryString()
void
onApplicationEvent(EventLogsMessage elm)
protected void
sendEmail(java.util.Collection<ome.model.meta.EventLog> matches)
void
setAction(java.lang.String action)
void
setObjectClass(java.lang.Class<ome.model.IObject> klass)
void
setQueryString(java.lang.String queryString)
-
Methods inherited from class ome.services.mail.MailSender
getAllSystemUsers, getDefaultBody, getExecutor, getMailUtil, getQueryService, getRoles, getSubjectPrefix, getUserEmail, isEnabled, sendBlind, sendBlind, setDefaultBody, setEnabled, setExecutor, setMailUtil, setQueryService, setRoles, setSubjectPrefix
-
-
-
-
Method Detail
-
getAction
public java.lang.String getAction()
-
setAction
public void setAction(java.lang.String action)
-
getObjectClass
public java.lang.Class<ome.model.IObject> getObjectClass()
-
setObjectClass
public void setObjectClass(java.lang.Class<ome.model.IObject> klass)
-
getQueryString
public java.lang.String getQueryString()
-
setQueryString
public void setQueryString(java.lang.String queryString)
-
onApplicationEvent
public void onApplicationEvent(EventLogsMessage elm)
- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<EventLogsMessage>
-
sendEmail
protected void sendEmail(java.util.Collection<ome.model.meta.EventLog> matches)
-
addUser
protected void addUser(java.util.Set<java.lang.String> addresses, ome.model.meta.Experimenter exp)
- Overrides:
addUser
in classMailSender
-
-