Class InMemoryVerifiedEmailRepository
java.lang.Object
com.codename1.backend.security.mail.InMemoryVerifiedEmailRepository
- All Implemented Interfaces:
VerifiedEmailRepository
public final class InMemoryVerifiedEmailRepository
extends Object
implements VerifiedEmailRepository
Addresses kept in this process: gone when it stops. For development and
tests; see
JdbcVerifiedEmailRepository otherwise.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidForgetsusername's address.The addressusernameclaims, proved or not, or null.findVerifiedEmail(String username) The addressusernamehas proved, or null when they claim none or have not proved the one they claim.booleanisVerified(String username) Whether the addressusernameclaims has been proved.booleanmarkVerified(String username, String proof, long now) Marks the addressusernameclaims as proved atnow, whenproofis the one it was recorded with.voidsavePending(String username, String email, String proof) Recordsemailas the addressusernameclaims, not yet proved, in place of whatever was recorded -- a proved address included: a user has one address, and it is the one they gave last.
-
Constructor Details
-
InMemoryVerifiedEmailRepository
public InMemoryVerifiedEmailRepository()
-
-
Method Details
-
savePending
Description copied from interface:VerifiedEmailRepositoryRecordsemailas the addressusernameclaims, not yet proved, in place of whatever was recorded -- a proved address included: a user has one address, and it is the one they gave last. An application that wants the old one to stand until the new one is proved keeps it in its own table and calls this when it lets go of it.proofis whatVerifiedEmailRepository.markVerified(String, String, long)has to be given for this address: it stands for the one link that was mailed there, so a link mailed to an earlier address proves nothing about this one.- Specified by:
savePendingin interfaceVerifiedEmailRepository
-
markVerified
Description copied from interface:VerifiedEmailRepositoryMarks the addressusernameclaims as proved atnow, whenproofis the one it was recorded with. False when the user claims none, or claims one recorded with another proof.- Specified by:
markVerifiedin interfaceVerifiedEmailRepository
-
findEmail
Description copied from interface:VerifiedEmailRepositoryThe addressusernameclaims, proved or not, or null.- Specified by:
findEmailin interfaceVerifiedEmailRepository
-
findVerifiedEmail
Description copied from interface:VerifiedEmailRepositoryThe addressusernamehas proved, or null when they claim none or have not proved the one they claim. One read: an address replaced between two reads would be answered as proved when it is not.- Specified by:
findVerifiedEmailin interfaceVerifiedEmailRepository
-
isVerified
Description copied from interface:VerifiedEmailRepositoryWhether the addressusernameclaims has been proved.- Specified by:
isVerifiedin interfaceVerifiedEmailRepository
-
delete
Description copied from interface:VerifiedEmailRepositoryForgetsusername's address.- Specified by:
deletein interfaceVerifiedEmailRepository
-