public void removeSessionData(String key, String type, long nanoTime) { if (!enablePersist) { return; } Connection connection = null; try { connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return; } PreparedStatement preparedStatement = null; try { preparedStatement = connection.prepareStatement(sqlInsertDELETE); preparedStatement.setString(1, key); preparedStatement.setString(2, type); preparedStatement.setString(3, OPERATION_DELETE); preparedStatement.setLong(4, nanoTime); preparedStatement.executeUpdate(); if (!connection.getAutoCommit()) { connection.commit(); } } catch (Exception e) { log.error("Error while storing DELETE operation session data", e); } finally { IdentityDatabaseUtil.closeAllConnections(connection, null, preparedStatement); } }
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
private void deleteDELETEOperationsTask() { Connection connection = null; PreparedStatement statement = null; try { connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return; } long cleanupLimitNano = FrameworkUtils.getCurrentStandardNano() - TimeUnit.MINUTES.toNanos(IdentityUtil.getOperationCleanUpTimeout()); try { statement = connection.prepareStatement(sqlDeleteDELETETask); statement.setLong(1, cleanupLimitNano); statement.execute(); if (!connection.getAutoCommit()) { connection.commit(); } return; } catch (SQLException e) { log.error("Error while removing DELETE operation data from the database for nano time " + cleanupLimitNano, e); } finally { IdentityDatabaseUtil.closeAllConnections(connection, null, statement); } } }
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
public void removeExpiredSessionData() { Connection connection = null; PreparedStatement statement = null; try { connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return; } long cleanupLimitNano = FrameworkUtils.getCurrentStandardNano() - TimeUnit.MINUTES.toNanos(IdentityUtil.getCleanUpTimeout()); try { statement = connection.prepareStatement(sqlDeleteExpiredDataTask); statement.setLong(1, cleanupLimitNano); statement.execute(); if (!connection.getAutoCommit()) { connection.commit(); } } catch (SQLException e) { log.error("Error while removing session data from the database for nano time " + cleanupLimitNano, e); } finally { IdentityDatabaseUtil.closeAllConnections(connection, null, statement); } }
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
private int getTenantId(OAuth2AccessTokenReqDTO tokenReq) throws IdentityOAuth2Exception { String username = tokenReq.getResourceOwnerUsername(); String userTenantDomain = MultitenantUtils.getTenantDomain(username); int tenantId; try { tenantId = IdentityTenantUtil.getTenantId(userTenantDomain); } catch (IdentityRuntimeException e) { log.error("Token request with Password Grant Type for an invalid tenant : " + userTenantDomain); throw new IdentityOAuth2Exception(e.getMessage(), e); } if (log.isDebugEnabled()) { log.debug("Retrieved tenant id: " + tenantId + " for tenant domain: " + userTenantDomain); } return tenantId; }
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return null;
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return null;
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return null;
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
connection = IdentityDatabaseUtil.getDBConnection(); } catch (IdentityRuntimeException e) { log.error(e.getMessage(), e); return;
log.debug("BasicAuthentication failed while trying to get the tenant ID of the user " + username, e); throw new AuthenticationFailedException(e.getMessage(), User.getUserFromUserName(username), e); } catch (Exception e) { log.error(e.getMessage(), e);