-
Notifications
You must be signed in to change notification settings - Fork 0
Upgrade to DynamiaTools 5.4.7 and improved javadocs #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,17 +3,35 @@ | |
| import tools.dynamia.modules.email.OTPMessage; | ||
| import tools.dynamia.modules.email.OTPSendResult; | ||
|
|
||
| import java.util.concurrent.CompletableFuture; | ||
| import java.util.concurrent.Future; | ||
|
|
||
| /** | ||
| * Service interface to dispatch One-Time Password (OTP) messages. | ||
| * <p> | ||
| * Implementations may deliver OTP codes via email, SMS, or both, depending on configuration and | ||
| * the contents of the provided {@link OTPMessage}. The service abstracts transport selection, | ||
| * formatting, and delivery tracking, returning an asynchronous handle to inspect the result. | ||
| * </p> | ||
| * <p> | ||
| * Typical usage: build an {@link OTPMessage} with target channels and the OTP value, then call {@link #send(OTPMessage)}. | ||
| * </p> | ||
| */ | ||
| public interface OTPService { | ||
|
|
||
|
|
||
| /** | ||
| * Send OTP message using email, sms or both service | ||
| * Sends an OTP message using email, SMS, or both channels. | ||
| * <p> | ||
| * The selected transport(s) depend on implementation and the {@link OTPMessage} fields (e.g., presence of | ||
| * email address, phone number, or explicit channel selection). Delivery may happen asynchronously; use the | ||
| * returned {@link Future} to check completion and obtain the {@link OTPSendResult}. | ||
|
||
| * </p> | ||
| * | ||
| * @param message | ||
| * @return | ||
| * @param message Fully populated {@link OTPMessage} containing the OTP code, target recipient(s), preferred | ||
| * channel(s), expiration and metadata as required by the implementation. Must not be null. | ||
| * @return a {@link Future} that completes with {@link OTPSendResult} indicating success, failure, and relevant | ||
| * details (e.g., which channels were used). The future may complete exceptionally if an unrecoverable error occurs. | ||
|
Comment on lines
+32
to
+33
|
||
| */ | ||
| Future<OTPSendResult> send(OTPMessage message); | ||
| CompletableFuture<OTPSendResult> send(OTPMessage message); | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused import:
java.util.concurrent.Futureis imported but no longer used in this interface. The return type has been changed toCompletableFutureand this import should be removed.