@Transactional public class DefaultInviteUserTokenService extends Object implements InviteUserTokenService
InviteUserTokenService backed by a storage DAO.DEFAULT_TOKEN_EXPIRY_SECONDS| Constructor and Description |
|---|
DefaultInviteUserTokenService(ExpirableUserTokenDao expirableUserTokenDao,
com.atlassian.security.random.SecureTokenGenerator tokenGenerator) |
| Modifier and Type | Method and Description |
|---|---|
ExpirableUserToken |
createAndStoreToken(String email,
long directoryId,
int tokenExpirySeconds)
Create a new token for the given email address and directory ID and store it
|
protected org.joda.time.Instant |
currentTime() |
Optional<ExpirableUserToken> |
findByToken(String token)
Find the token using the given random hash
|
boolean |
removeToken(String token)
Removes the token with the given random hash
|
public DefaultInviteUserTokenService(ExpirableUserTokenDao expirableUserTokenDao, com.atlassian.security.random.SecureTokenGenerator tokenGenerator)
public ExpirableUserToken createAndStoreToken(String email, long directoryId, int tokenExpirySeconds) throws ObjectAlreadyExistsException
InviteUserTokenServicecreateAndStoreToken in interface InviteUserTokenServiceemail - the email address that the invitation was sent todirectoryId - the directory ID that the user will be created totokenExpirySeconds - number of seconds before generated token expires, or DEFAULT_TOKEN_EXPIRY_SECONDSObjectAlreadyExistsException - if a token already exists with the same random hash as the one that was generated.public Optional<ExpirableUserToken> findByToken(String token)
InviteUserTokenServicefindByToken in interface InviteUserTokenServicetoken - random hash that was generated when the token was createdpublic boolean removeToken(String token)
InviteUserTokenServiceremoveToken in interface InviteUserTokenServicetoken - random hash that was generated when the token was createdprotected org.joda.time.Instant currentTime()
Copyright © 2017 Atlassian. All rights reserved.