@Override
public void storeRefreshToken(String refreshTokenValue,
byte[] refreshTokenBytes,
byte[] authenticationBytes,
Date tokenExpiry,
String userLogin) {
storeRefreshTokenToMemory(refreshTokenValue, refreshTokenBytes, authenticationBytes, tokenExpiry, userLogin);
if (serverConfig.getRestStoreTokensInDb()) {
try (Transaction tx = persistence.getTransaction()) {
removeRefreshTokenFromDatabase(refreshTokenValue);
storeRefreshTokenToDatabase(refreshTokenValue, refreshTokenBytes, authenticationBytes,
tokenExpiry, userLogin);
tx.commit();
}
}
}