Class InMemoryOneTimeTokenRepository
java.lang.Object
com.codename1.backend.security.mail.InMemoryOneTimeTokenRepository
- All Implemented Interfaces:
OneTimeTokenRepository
Tokens kept in this process: gone when it stops, and unknown to any other
server. For development and tests; see
JdbcOneTimeTokenRepository
otherwise.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionUses a token up.voidDrops every tokenusernamehas forpurpose.voidKeeps a token forusername, in place of any that user had forpurpose: the newest link is the only one that works.
-
Constructor Details
-
InMemoryOneTimeTokenRepository
public InMemoryOneTimeTokenRepository()
-
-
Method Details
-
save
Description copied from interface:OneTimeTokenRepositoryKeeps a token for
username, in place of any that user had forpurpose: the newest link is the only one that works.Parameters
tokenHash: the token's hashpurpose: what the token may be used forusername: whose it isnow: the moment, epoch milliseconds; tokens that expired before it may be droppedexpiresAt: when the token stops working, epoch milliseconds
- Specified by:
savein interfaceOneTimeTokenRepository
-
consume
Description copied from interface:OneTimeTokenRepositoryUses a token up. Answers the user it was given to, or null when there is none forpurpose, it has expired, or another caller used it first: of two callers with one token, one is answered.- Specified by:
consumein interfaceOneTimeTokenRepository
-
removeAll
Description copied from interface:OneTimeTokenRepositoryDrops every tokenusernamehas forpurpose.- Specified by:
removeAllin interfaceOneTimeTokenRepository
-