protected void storeAccessTokenToMemory(String accessTokenValue,
byte[] accessTokenBytes,
String authenticationKey,
byte[] authenticationBytes,
Date tokenExpiry,
String userLogin,
@Nullable String refreshTokenValue) {
lock.writeLock().lock();
try {
accessTokenValueToAccessTokenStore.put(accessTokenValue, accessTokenBytes);
authenticationToAccessTokenStore.put(authenticationKey, accessTokenBytes);
accessTokenValueToAuthenticationStore.put(accessTokenValue, authenticationBytes);
accessTokenValueToAuthenticationKeyStore.put(accessTokenValue, authenticationKey);
accessTokenValueToUserLoginStore.put(accessTokenValue, userLogin);
if (!Strings.isNullOrEmpty(refreshTokenValue)) {
refreshTokenValueToAccessTokenValueStore.put(refreshTokenValue, accessTokenValue);
}
} finally {
lock.writeLock().unlock();
}
if (tokenExpiry != null) {
TokenExpiry expiry = new TokenExpiry(accessTokenValue, tokenExpiry);
this.accessTokensExpiryQueue.put(expiry);
}
}