Search in sources :

Example 51 with Session

use of org.parosproxy.paros.model.Session in project zaproxy by zaproxy.

the class SessionStructure method find.

/**
 * Finds the node in the Site tree for the given request data
 *
 * @param model the model
 * @param uri the URI
 * @param method the method
 * @param postData the POST data
 * @return the site node or null if not found
 * @throws DatabaseException
 * @throws URIException
 * @since 2.10.0
 */
public static StructuralNode find(Model model, URI uri, String method, String postData) throws DatabaseException, URIException {
    Session session = model.getSession();
    if (!Constant.isLowMemoryOptionSet()) {
        SiteNode node = session.getSiteTree().findNode(uri, method, postData);
        if (node == null) {
            return null;
        }
        return new StructuralSiteNode(node);
    }
    String nodeName = getNodeName(model, uri, method, postData);
    RecordStructure rs = model.getDb().getTableStructure().find(session.getSessionId(), nodeName, method);
    if (rs == null) {
        return null;
    }
    return new StructuralTableNode(rs);
}
Also used : RecordStructure(org.parosproxy.paros.db.RecordStructure) Session(org.parosproxy.paros.model.Session) SiteNode(org.parosproxy.paros.model.SiteNode)

Aggregations

Session (org.parosproxy.paros.model.Session)51 DatabaseException (org.parosproxy.paros.db.DatabaseException)18 Context (org.zaproxy.zap.model.Context)14 ArrayList (java.util.ArrayList)8 JMenuItem (javax.swing.JMenuItem)7 ExtensionPopupMenuItem (org.parosproxy.paros.extension.ExtensionPopupMenuItem)7 File (java.io.File)5 SiteNode (org.parosproxy.paros.model.SiteNode)5 HttpMalformedHeaderException (org.parosproxy.paros.network.HttpMalformedHeaderException)5 URIException (org.apache.commons.httpclient.URIException)4 RecordStructure (org.parosproxy.paros.db.RecordStructure)4 HttpMessage (org.parosproxy.paros.network.HttpMessage)4 ApiException (org.zaproxy.zap.extension.api.ApiException)4 ApiResponseElement (org.zaproxy.zap.extension.api.ApiResponseElement)4 Date (java.util.Date)3 HashMap (java.util.HashMap)3 PatternSyntaxException (java.util.regex.PatternSyntaxException)3 JFileChooser (javax.swing.JFileChooser)3 JSONException (net.sf.json.JSONException)3 ExtensionHistory (org.parosproxy.paros.extension.history.ExtensionHistory)3