mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-08 20:12:23 +00:00
bug5197: Created SendMailOperation
This commit is contained in:
1 parent
fd115f3b0a
commit
ee062a35f8
3 files changed
+32
-1
No files matched your search
@@ -28,6 +28,7 @@ import com.sap.sse.common.IsManagedByCache;
|
||||
import com.sap.sse.common.mail.MailException;
|
||||
import com.sap.sse.mail.MailServiceResolver;
|
||||
import com.sap.sse.mail.SerializableMultipartSupplier;
|
||||
import com.sap.sse.mail.operations.SendMailOperation;
|
||||
import com.sap.sse.replication.OperationExecutionListener;
|
||||
import com.sap.sse.replication.OperationWithResult;
|
||||
import com.sap.sse.replication.OperationWithResultWithIdWrapper;
|
||||
@@ -138,7 +139,7 @@ public class MailServiceImpl implements ReplicableMailService {
|
||||
|
||||
@Override
|
||||
public void sendMail(String toAddress, String subject, String body) throws MailException {
|
||||
apply(s -> s.internalSendMail(toAddress, subject, body));
|
||||
apply(new SendMailOperation(toAddress, subject, body));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.sap.sse.mail.operations;
|
||||
|
||||
import com.sap.sse.mail.impl.ReplicableMailService;
|
||||
import com.sap.sse.replication.OperationWithResult;
|
||||
|
||||
public interface MailServiceOperation<ResultType> extends OperationWithResult<ReplicableMailService, ResultType> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.sap.sse.mail.operations;
|
||||
|
||||
import com.sap.sse.mail.impl.ReplicableMailService;
|
||||
|
||||
public class SendMailOperation implements MailServiceOperation<Void> {
|
||||
private static final long serialVersionUID = 3410841670705846547L;
|
||||
protected final String toAddress;
|
||||
protected final String subject;
|
||||
protected final String body;
|
||||
|
||||
public SendMailOperation(String toAddress, String subject, String body) {
|
||||
this.toAddress = toAddress;
|
||||
this.subject = subject;
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Void internalApplyTo(ReplicableMailService toState) throws Exception {
|
||||
toState.internalSendMail(toAddress, subject, body);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user