@Override public void storeAccessToken(String tokenValue, byte[] accessTokenBytes, String authenticationKey, byte[] authenticationBytes, Date tokenExpiry, String userLogin, Locale locale, String refreshTokenValue) { storeAccessTokenToMemory(tokenValue, accessTokenBytes, authenticationKey, authenticationBytes, tokenExpiry, userLogin, refreshTokenValue); if (serverConfig.getRestStoreTokensInDb()) { try (Transaction tx = persistence.getTransaction()) { removeAccessTokenFromDatabase(tokenValue); storeAccessTokenToDatabase(tokenValue, accessTokenBytes, authenticationKey, authenticationBytes, tokenExpiry, userLogin, locale, refreshTokenValue); tx.commit(); } } clusterManagerAPI.send(new TokenStoreAddAccessTokenMsg(tokenValue, accessTokenBytes, authenticationKey, authenticationBytes, tokenExpiry, userLogin, refreshTokenValue)); }