Search in sources :

Example 6 with RecordStructure

use of org.parosproxy.paros.db.RecordStructure in project zaproxy by zaproxy.

the class StructuralTableNode method getParent.

@Override
public StructuralNode getParent() throws DatabaseException {
    if (parent == null && !this.isRoot()) {
        RecordStructure prs = Model.getSingleton().getDb().getTableStructure().read(rs.getSessionId(), rs.getStructureId());
        if (prs == null) {
            throw new InvalidParameterException("Failed to find parent sessionId=" + rs.getSessionId() + " parentId=" + rs.getParentId());
        }
        parent = new StructuralTableNode(prs);
    }
    return parent;
}
Also used : InvalidParameterException(java.security.InvalidParameterException) RecordStructure(org.parosproxy.paros.db.RecordStructure)

Example 7 with RecordStructure

use of org.parosproxy.paros.db.RecordStructure in project zaproxy by zaproxy.

the class StructuralTableNodeIterator method next.

@Override
public StructuralTableNode next() {
    if (!hasNext()) {
        throw new NoSuchElementException();
    }
    RecordStructure childRs = children.get(index);
    index++;
    return new StructuralTableNode(childRs);
}
Also used : RecordStructure(org.parosproxy.paros.db.RecordStructure) NoSuchElementException(java.util.NoSuchElementException)

Example 8 with RecordStructure

use of org.parosproxy.paros.db.RecordStructure in project zaproxy by zaproxy.

the class SessionStructure method find.

public static StructuralNode find(long sessionId, URI uri, String method, String postData) throws DatabaseException, URIException {
    Model model = Model.getSingleton();
    if (!Constant.isLowMemoryOptionSet()) {
        SiteNode node = model.getSession().getSiteTree().findNode(uri, method, postData);
        if (node == null) {
            return null;
        }
        return new StructuralSiteNode(node);
    }
    String nodeName = getNodeName(sessionId, uri, method, postData);
    RecordStructure rs = model.getDb().getTableStructure().find(sessionId, nodeName, method);
    if (rs == null) {
        return null;
    }
    return new StructuralTableNode(rs);
}
Also used : RecordStructure(org.parosproxy.paros.db.RecordStructure) Model(org.parosproxy.paros.model.Model) SiteNode(org.parosproxy.paros.model.SiteNode)

Aggregations

RecordStructure (org.parosproxy.paros.db.RecordStructure)8 ResultSet (java.sql.ResultSet)4 SQLException (java.sql.SQLException)4 DatabaseException (org.parosproxy.paros.db.DatabaseException)4 ArrayList (java.util.ArrayList)2 InvalidParameterException (java.security.InvalidParameterException)1 NoSuchElementException (java.util.NoSuchElementException)1 Model (org.parosproxy.paros.model.Model)1 SiteNode (org.parosproxy.paros.model.SiteNode)1 HttpMessage (org.parosproxy.paros.network.HttpMessage)1