Source:
<code>public CloseableIterator<NodeItem> getFirehose(int limit, String afterItemId, boolean isAdmin) throws NodeStoreException { PreparedStatement stmt = null; Date beforeDate = null; if (afterItemId != null) { beforeDate = getNodeItem(GlobalItemIDImpl.fromBuddycloudString( afterItemId)).getUpdated(); } else { beforeDate = new Date(); } if (limit < 0) { throw new IllegalArgumentException( "Invalid value for parameter count: " + limit); } String accessModel = "open"; if (true == isAdmin) accessModel = "%"; try { stmt = conn.prepareStatement(dialect .selectItemsForLocalNodesBeforeDate()); stmt.setTimestamp(1, new java.sql.Timestamp(beforeDate.getTime())); stmt.setString(2, Conf.ACCESS_MODEL); stmt.setString(3, accessModel); <START> <END> String serverDomain = Configuration.getInstance().getProperty( Configuration.CONFIGURATION_SERVER_DOMAIN); String serverTopicsDomain = Configuration.getInstance().getProperty( Configuration.CONFIGURATION_SERVER_TOPICS_DOMAIN); stmt.setString(4, serverDomain == null ? "%" : "%@" + serverDomain + "%"); stmt.setString(5, serverTopicsDomain == null ? "%" : "%@" + serverTopicsDomain + "%"); stmt.setInt(6, limit); java.sql.ResultSet rs = stmt.executeQuery(); LinkedList<NodeItem> results = new LinkedList<NodeItem>(); while (rs.next()) { results.push(new NodeItemImpl(rs.getString(1), rs.getString(2), rs.getTimestamp(3), rs.getString(4), rs.getString(5), rs.getTimestamp(6))); } return new ClosableIteratorImpl<NodeItem>(results.iterator()); } catch (SQLException e) { throw new NodeStoreException(e); } finally { close(stmt); } }</code><technical_language>I nicer if created methods configuration object of: getTopicsDomain() getServerDomain() similar</technical_language>

Target:
public CloseableIterator<NodeItem> getFirehose(int limit, String afterItemId, boolean isAdmin) throws NodeStoreException { PreparedStatement stmt = null; Date beforeDate = null; if (afterItemId != null) { beforeDate = getNodeItem(GlobalItemIDImpl.fromBuddycloudString( afterItemId)).getUpdated(); } else { beforeDate = new Date(); } if (limit < 0) { throw new IllegalArgumentException( "Invalid value for parameter count: " + limit); } String accessModel = "open"; if (true == isAdmin) accessModel = "%"; try { stmt = conn.prepareStatement(dialect .selectItemsForLocalNodesBeforeDate()); stmt.setTimestamp(1, new java.sql.Timestamp(beforeDate.getTime())); stmt.setString(2, Conf.ACCESS_MODEL); stmt.setString(3, accessModel); String serverDomain = Configuration.getInstance().getServerDomain(); String serverTopicsDomain = Configuration.getInstance().getServerTopicsDomain(); stmt.setString(4, serverDomain == null ? "%" : "%@" + serverDomain + "%"); stmt.setString(5, serverTopicsDomain == null ? "%" : "%@" + serverTopicsDomain + "%"); stmt.setInt(6, limit); java.sql.ResultSet rs = stmt.executeQuery(); LinkedList<NodeItem> results = new LinkedList<NodeItem>(); while (rs.next()) { results.push(new NodeItemImpl(rs.getString(1), rs.getString(2), rs.getTimestamp(3), rs.getString(4), rs.getString(5), rs.getTimestamp(6))); } return new ClosableIteratorImpl<NodeItem>(results.iterator()); } catch (SQLException e) { throw new NodeStoreException(e); } finally { close(stmt); } }