public void remove(String handle) { try { String sql = "DELETE FROM " + _tableName + " WHERE handle=?"; JdbcTemplate jdbcTemplate = getJdbcTemplate(); int cnt = jdbcTemplate.update(sql, new Object[]{handle}); if (cnt == 1 && DEBUG) { _log.debug("Removed association, handle: " + handle + " from table: " + _tableName); } if (cnt != 1) { _log.warn("Trying to remove handle: " + handle + " from table: " + _tableName + "; affected entries: " + cnt); } } catch (Exception e) { _log.error("Error removing association from table: " + _tableName, e); } }
public void configure (final Map mapGlobalSettings, final String strComponentName, final Map mapComponentSettings) { this.log.trace("TokenGeneratorHandler::initialize"); String tableName = (String) mapComponentSettings.get("AssocTableName"); JdbcServerAssociationStore privateAssociations = new JdbcServerAssociationStore(tableName); boolean status = true; try { InitialContext cxt = new InitialContext(); String dataSourceJndi = (String) mapComponentSettings.get("AssocDataSource"); DataSource ds = (DataSource) cxt.lookup(dataSourceJndi); privateAssociations.setDataSource(ds); } catch (NamingException e) { log.error("Unable to load JNDI data source from context."); status = false; } _privateAssociations = privateAssociations; java.net.URI opEndpointUri = (java.net.URI) mapComponentSettings.get("OPEndpoint"); _opEndpoint = opEndpointUri != null ? opEndpointUri.toString() : null; _expireIn = (Integer) mapComponentSettings.get("AssocExpiry"); this.bConfigured = status; }
public Association generate(String type, int expiryIn) throws AssociationException { cleanupExpired(); JdbcTemplate jdbcTemplate = getJdbcTemplate();
public Association generate(String type, int expiryIn) throws AssociationException cleanupExpired(); JdbcTemplate jdbcTemplate = getJdbcTemplate();
public Association generate(String type, int expiryIn) throws AssociationException cleanupExpired(); JdbcTemplate jdbcTemplate = getJdbcTemplate();
public void remove(String handle) { try { String sql = "DELETE FROM " + _tableName + " WHERE handle=?"; JdbcTemplate jdbcTemplate = getJdbcTemplate(); int cnt = jdbcTemplate.update(sql, new Object[] { handle } ); if (cnt == 1 && DEBUG) _log.debug("Removed association, handle: " + handle + " from table: " + _tableName); if (cnt != 1) _log.warn("Trying to remove handle: " + handle + " from table: " + _tableName + "; affected entries: " + cnt); } catch (Exception e) { _log.error("Error removing association from table: " + _tableName, e); } }
public void configure (final Map mapGlobalSettings, final String strComponentName, final Map mapComponentSettings) { this.log.trace("TokenGeneratorHandler::initialize"); String tableName = (String) mapComponentSettings.get("AssocTableName"); JdbcServerAssociationStore privateAssociations = new JdbcServerAssociationStore(tableName); boolean status = true; try { InitialContext cxt = new InitialContext(); String dataSourceJndi = (String) mapComponentSettings.get("AssocDataSource"); DataSource ds = (DataSource) cxt.lookup(dataSourceJndi); privateAssociations.setDataSource(ds); } catch (NamingException e) { log.error("Unable to load JNDI data source from context."); status = false; } _privateAssociations = privateAssociations; java.net.URI opEndpointUri = (java.net.URI) mapComponentSettings.get("OPEndpoint"); _opEndpoint = opEndpointUri != null ? opEndpointUri.toString() : null; _expireIn = (Integer) mapComponentSettings.get("AssocExpiry"); this.bConfigured = status; }
public Association generate(String type, int expiryIn) throws AssociationException cleanupExpired(); JdbcTemplate jdbcTemplate = getJdbcTemplate();
public void remove(String handle) { try { String sql = "DELETE FROM " + _tableName + " WHERE handle=?"; JdbcTemplate jdbcTemplate = getJdbcTemplate(); int cnt = jdbcTemplate.update(sql, new Object[] { handle } ); if (cnt == 1 && DEBUG) _log.debug("Removed association, handle: " + handle + " from table: " + _tableName); if (cnt != 1) _log.warn("Trying to remove handle: " + handle + " from table: " + _tableName + "; affected entries: " + cnt); } catch (Exception e) { _log.error("Error removing association from table: " + _tableName, e); } }
public Association generate(String type, int expiryIn) throws AssociationException cleanupExpired(); JdbcTemplate jdbcTemplate = getJdbcTemplate();
public void remove(String handle) { try { String sql = "DELETE FROM " + _tableName + " WHERE handle=?"; JdbcTemplate jdbcTemplate = getJdbcTemplate(); int cnt = jdbcTemplate.update(sql, new Object[] { handle } ); if (cnt == 1 && DEBUG) _log.debug("Removed association, handle: " + handle + " from table: " + _tableName); if (cnt != 1) _log.warn("Trying to remove handle: " + handle + " from table: " + _tableName + "; affected entries: " + cnt); } catch (Exception e) { _log.error("Error removing association from table: " + _tableName, e); } }
public void remove(String handle) { try { String sql = "DELETE FROM " + _tableName + " WHERE handle=?"; JdbcTemplate jdbcTemplate = getJdbcTemplate(); int cnt = jdbcTemplate.update(sql, new Object[] { handle } ); if (cnt == 1 && DEBUG) _log.debug("Removed association, handle: " + handle + " from table: " + _tableName); if (cnt != 1) _log.warn("Trying to remove handle: " + handle + " from table: " + _tableName + "; affected entries: " + cnt); } catch (Exception e) { _log.error("Error removing association from table: " + _tableName, e); } }
private void cleanupExpired() { if (System.currentTimeMillis() - _lastCleanup < CLEANUP_INTERVAL) { return; } try { String sql = "DELETE FROM " + _tableName + " WHERE expdate<?"; JdbcTemplate jdbcTemplate = getJdbcTemplate(); Date now = new Date(); int cnt = jdbcTemplate.update(sql, new Object[]{now}); _log.debug("Cleaned " + cnt + " expired associations from table: " + _tableName); _lastCleanup = System.currentTimeMillis(); } catch (Exception e) { _log.error("Error removing expired associations from table: " + _tableName, e); } } }
private void cleanupExpired() { if (System.currentTimeMillis() - _lastCleanup < CLEANUP_INTERVAL) return; try { String sql = "DELETE FROM " + _tableName + " WHERE expdate<?"; JdbcTemplate jdbcTemplate = getJdbcTemplate(); Date now = new Date ( ) ; int cnt = jdbcTemplate.update(sql, new Object[] { now } ); _log.debug("Cleaned " + cnt + " expired associations from table: " + _tableName); _lastCleanup = System.currentTimeMillis(); } catch (Exception e) { _log.error("Error removing expired associations from table: " + _tableName, e); } } }
private void cleanupExpired() { if (System.currentTimeMillis() - _lastCleanup < CLEANUP_INTERVAL) return; try { String sql = "DELETE FROM " + _tableName + " WHERE expdate<?"; JdbcTemplate jdbcTemplate = getJdbcTemplate(); Date now = new Date ( ) ; int cnt = jdbcTemplate.update(sql, new Object[] { now } ); _log.debug("Cleaned " + cnt + " expired associations from table: " + _tableName); _lastCleanup = System.currentTimeMillis(); } catch (Exception e) { _log.error("Error removing expired associations from table: " + _tableName, e); } } }
private void cleanupExpired() { if (System.currentTimeMillis() - _lastCleanup < CLEANUP_INTERVAL) return; try { String sql = "DELETE FROM " + _tableName + " WHERE expdate<?"; JdbcTemplate jdbcTemplate = getJdbcTemplate(); Date now = new Date ( ) ; int cnt = jdbcTemplate.update(sql, new Object[] { now } ); _log.debug("Cleaned " + cnt + " expired associations from table: " + _tableName); _lastCleanup = System.currentTimeMillis(); } catch (Exception e) { _log.error("Error removing expired associations from table: " + _tableName, e); } } }
private void cleanupExpired() { if (System.currentTimeMillis() - _lastCleanup < CLEANUP_INTERVAL) return; try { String sql = "DELETE FROM " + _tableName + " WHERE expdate<?"; JdbcTemplate jdbcTemplate = getJdbcTemplate(); Date now = new Date ( ) ; int cnt = jdbcTemplate.update(sql, new Object[] { now } ); _log.debug("Cleaned " + cnt + " expired associations from table: " + _tableName); _lastCleanup = System.currentTimeMillis(); } catch (Exception e) { _log.error("Error removing expired associations from table: " + _tableName, e); } } }
" WHERE handle=?"; JdbcTemplate jdbcTemplate = getJdbcTemplate();
" WHERE handle=?"; JdbcTemplate jdbcTemplate = getJdbcTemplate();
" WHERE handle=?"; JdbcTemplate jdbcTemplate = getJdbcTemplate();