use of org.parosproxy.paros.db.RecordSession in project zaproxy by zaproxy.
the class SqlTableSession method listSessions.
@Override
public List<RecordSession> listSessions() throws DatabaseException {
SqlPreparedStatementWrapper psList = null;
try {
psList = DbSQL.getSingleton().getPreparedStatement("session.ps.list");
List<RecordSession> result = new ArrayList<RecordSession>();
try (ResultSet rs = psList.getPs().executeQuery()) {
RecordSession ra = build(rs);
while (ra != null) {
result.add(ra);
ra = build(rs);
}
}
return result;
} catch (SQLException e) {
throw new DatabaseException(e);
} finally {
DbSQL.getSingleton().releasePreparedStatement(psList);
}
}
use of org.parosproxy.paros.db.RecordSession in project zaproxy by zaproxy.
the class MenuFileControl method openDbBasedSession.
private void openDbBasedSession() {
try {
List<String> sessionList = new ArrayList<String>();
for (RecordSession rs : model.getDb().getTableSession().listSessions()) {
sessionList.add("" + rs.getSessionId());
}
SessionTableSelectDialog ssd = new SessionTableSelectDialog(View.getSingleton().getMainFrame(), sessionList);
ssd.setVisible(true);
if (ssd.getSelectedSession() != null) {
waitMessageDialog = view.getWaitMessageDialog(Constant.messages.getString("menu.file.loadSession"));
control.openSession(ssd.getSelectedSession(), this);
waitMessageDialog.setVisible(true);
}
} catch (DatabaseException e) {
log.error(e.getMessage(), e);
}
}
Aggregations