Class AuthTokenRegistry
- java.lang.Object
-
- com.helger.security.authentication.result.AuthTokenRegistry
-
@ThreadSafe public final class AuthTokenRegistry extends Object
This class manages all the currently available authentications tokens.- Author:
- Philip Helger
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IAuthTokencreateToken(IAuthIdentification aIdentification, int nExpirationSeconds)static com.helger.commons.collection.impl.ICommonsList<IAuthToken>getAllTokensOfSubject(IAuthSubject aSubject)Get all tokens of the specified auth subject.static IAuthTokengetValidToken(String sTokenID)static intremoveAllTokensOfSubject(IAuthSubject aSubject)Remove all tokens of the given subjectstatic com.helger.commons.state.ESuccessremoveToken(String sTokenID)static IAuthTokenvalidateTokenAndUpdateLastAccess(String sTokenID)
-
-
-
Method Detail
-
createToken
@Nonnull public static IAuthToken createToken(@Nonnull IAuthIdentification aIdentification, @Nonnegative int nExpirationSeconds)
-
removeToken
@Nonnull public static com.helger.commons.state.ESuccess removeToken(@Nonnull String sTokenID)
-
getValidToken
@Nullable public static IAuthToken getValidToken(@Nullable String sTokenID)
-
validateTokenAndUpdateLastAccess
@Nullable public static IAuthToken validateTokenAndUpdateLastAccess(@Nullable String sTokenID)
-
getAllTokensOfSubject
@Nonnull public static com.helger.commons.collection.impl.ICommonsList<IAuthToken> getAllTokensOfSubject(@Nonnull IAuthSubject aSubject)
Get all tokens of the specified auth subject. All tokens are returned, no matter whether they are expired or not.- Parameters:
aSubject- The subject to query. May not benull.- Returns:
- The list and never
null.
-
removeAllTokensOfSubject
@Nonnegative public static int removeAllTokensOfSubject(@Nonnull IAuthSubject aSubject)
Remove all tokens of the given subject- Parameters:
aSubject- The subject for which the tokens should be removed.- Returns:
- The number of removed tokens. Always ≥ 0.
-
-