Class IdServerMailService
java.lang.Object
com.io7m.idstore.server.service.mail.IdServerMailService
- All Implemented Interfaces:
IdServerMailServiceType
,com.io7m.repetoir.core.RPServiceType
,AutoCloseable
A mail service.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static IdServerMailServiceType
create
(IdServerTelemetryServiceType telemetry, IdEventServiceType events, IdServerMailConfiguration configuration) Create a new mail service.sendMail
(io.opentelemetry.api.trace.Span parentSpan, UUID requestId, IdEmail to, Map<String, String> headers, String subject, String text) Send a message to the given target address.toString()
-
Method Details
-
create
public static IdServerMailServiceType create(IdServerTelemetryServiceType telemetry, IdEventServiceType events, IdServerMailConfiguration configuration) Create a new mail service.- Parameters:
telemetry
- The telemetry serviceevents
- The events serviceconfiguration
- The mail configuration- Returns:
- The service
-
sendMail
public CompletableFuture<Void> sendMail(io.opentelemetry.api.trace.Span parentSpan, UUID requestId, IdEmail to, Map<String, String> headers, String subject, String text) Description copied from interface:IdServerMailServiceType
Send a message to the given target address.- Specified by:
sendMail
in interfaceIdServerMailServiceType
- Parameters:
parentSpan
- The parent span for metricsrequestId
- The request IDto
- The target addressheaders
- Extra message headerssubject
- The message subjecttext
- The message text- Returns:
- The send in progress
-
description
- Specified by:
description
in interfacecom.io7m.repetoir.core.RPServiceType
-
toString
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-