use of org.parosproxy.paros.db.RecordSessionUrl in project zaproxy by zaproxy.
the class SqlTableSessionUrl method getUrlsForType.
/* (non-Javadoc)
* @see org.parosproxy.paros.db.paros.TableSessionUrl#getUrlsForType(int)
*/
@Override
public List<RecordSessionUrl> getUrlsForType(int type) throws DatabaseException {
SqlPreparedStatementWrapper psGetAlluRLSForType = null;
try {
psGetAlluRLSForType = DbSQL.getSingleton().getPreparedStatement("sessionurl.ps.geturlsfortype");
psGetAlluRLSForType.getPs().setInt(1, type);
try (ResultSet rs = psGetAlluRLSForType.getPs().executeQuery()) {
List<RecordSessionUrl> result = new ArrayList<>();
while (rs.next()) {
result.add(new RecordSessionUrl(rs.getLong(URLID), rs.getInt(TYPE), rs.getString(URL)));
}
return result;
}
} catch (SQLException e) {
throw new DatabaseException(e);
} finally {
DbSQL.getSingleton().releasePreparedStatement(psGetAlluRLSForType);
}
}
use of org.parosproxy.paros.db.RecordSessionUrl in project zaproxy by zaproxy.
the class Session method getSessionUrls.
public List<String> getSessionUrls(int type) throws DatabaseException {
List<RecordSessionUrl> urls = model.getDb().getTableSessionUrl().getUrlsForType(type);
List<String> list = new ArrayList<>(urls.size());
for (RecordSessionUrl url : urls) {
list.add(url.getUrl());
}
return list;
}
Aggregations