Package org.parosproxy.paros.model

Examples of org.parosproxy.paros.model.Session


      return historyList;
  }
 
  public String search(String filter, boolean isRequest){
      String result="";
      Session session = getModel().getSession();
        Pattern pattern = Pattern.compile(filter, Pattern.MULTILINE| Pattern.CASE_INSENSITIVE);
    Matcher matcher = null;
   
    getHistoryList();
      synchronized (historyList) {
          try {
              List list = getModel().getDb().getTableHistory().getHistoryList(session.getSessionId(), HistoryReference.TYPE_MANUAL, filter,isRequest);
              int last = list.size();
              for (int index=0;index < last;index++){
                  int v = ((Integer)(list.get(index))).intValue();
                  try {
                        HttpMessage message = getModel().getDb().getTableHistory().read(v).getHttpMessage();
View Full Code Here


        return;
      }
      model.createAndOpenUntitledDb();
    }
   
    Session session = new Session(model);
      log.info("new session file created");
      model.setSession(session);

    view.getSiteTreePanel().getTreeSite().setModel(session.getSiteTree());

    // comment code below so new session use default untitled first. 
//    if (isPromptNewSession) {
//        SessionDialog dialog = view.getSessionDialog("New Session");
//        dialog.initParam(session);
//        dialog.showDialog(false);
//        saveAsSession();
//    }

    control.getExtensionLoader().sessionChangedAllPlugin(session);
    // refresh display
   
    view.getMainFrame().setTitle(session.getSessionName() + " - " + Constant.PROGRAM_NAME);
    view.getOutputPanel().clear();
   
  }
View Full Code Here

          file = chooser.getSelectedFile();
          if (file == null) {
            return;
          }
                model.getOptionsParam().setUserDirectory(chooser.getCurrentDirectory());
          Session session = model.getSession();
            log.info("opening session file " + file.getAbsolutePath());
            waitMessageDialog = view.getWaitMessageDialog("Loading session file.  Please wait ...");
          session.open(file, this);
          waitMessageDialog.setVisible(true);
      } catch (Exception e) {
          e.printStackTrace();
      }
      }
View Full Code Here

          e.printStackTrace();
      }
      }
  }
  public void saveSession() {
      Session session = model.getSession();

      if (session.isNewState()) {
        view.showWarningDialog("Please use Save As...");
        return;
      }
     
    try {
          waitMessageDialog = view.getWaitMessageDialog("Saving session file.  Please wait ...");       
        session.save(session.getFileName(), this);
          log.info("saving session file " + session.getFileName());
          waitMessageDialog.setVisible(true);
         
    } catch (Exception e) {
        view.showWarningDialog("Error saving session file.");
          log.error("error saving session file " + session.getFileName());
          log.error(e.getMessage());
         
    }
     
  }
View Full Code Here

    }
     
  }
 
  public void saveAsSession() {
      Session session = model.getSession();

      JFileChooser chooser = new JFileChooser(model.getOptionsParam().getUserDirectory());
      chooser.setFileFilter(new FileFilter() {
             public boolean accept(File file) {
                  if (file.isDirectory()) {
                      return true;
                  } else if (file.isFile() && file.getName().endsWith(".session")) {
                      return true;
                  }
                  return false;
              }
             public String getDescription() {
                 return "Paros session";
             }
      });
    File file = null;
      int rc = chooser.showSaveDialog(view.getMainFrame());
      if(rc == JFileChooser.APPROVE_OPTION) {
        file = chooser.getSelectedFile();
        if (file == null) {
          return;
        }
            model.getOptionsParam().setUserDirectory(chooser.getCurrentDirectory());
        String fileName = file.getAbsolutePath();
        if (!fileName.endsWith(".session")) {
            fileName += ".session";
        }
       
        try {
            waitMessageDialog = view.getWaitMessageDialog("Saving new session file.  Please wait ...");
            session.save(fileName, this);
              log.info("save as session file " + session.getFileName());
              waitMessageDialog.setVisible(true);
        } catch (Exception e) {
            e.printStackTrace();
        }
      }
View Full Code Here

    }
    return txtDescription;
  }
 
  public void initParam(Object obj) {
      Session session = (Session) obj;
      getTxtSessionName().setText(session.getSessionName());
      getTxtDescription().setText(session.getSessionDesc());
  }
View Full Code Here

  public void validateParam(Object obj) {
      // no validation needed
  }
 
  public void saveParam (Object obj) throws Exception {
      Session session = (Session) obj;
      session.setSessionName(getTxtSessionName().getText());
      session.setSessionDesc(getTxtDescription().getText());
     
  }
View Full Code Here

        SiteNode node = ref.getSiteNode();
        if (node == null) {
            return;
        }

        Session session = Model.getSingleton().getSession();
        SiteMap map = session.getSiteTree();

        if (node.getHistoryReference() == ref) {
            // same active Node
            PopupPurgeMenu.purge(map, node);
        } else {
View Full Code Here

    }

   
    public void runCommandLineNewSession(String fileName) throws Exception {
   
    Session session = new Session(model);
      log.info("new session file created");
      model.setSession(session);
    control.getExtensionLoader().sessionChangedAllPlugin(session);

    if (!fileName.endsWith(".session")) {
        fileName += ".session";
    }
    session.save(fileName);
    getExtensionLoader().runCommandLine();
  }
View Full Code Here

    getExtensionLoader().runCommandLine();
  }
   
    public void runCommandLineOpenSession(String fileName) {
   
    Session session = new Session(model);
      log.info("new session file created");
      model.setSession(session);
    control.getExtensionLoader().sessionChangedAllPlugin(session);
   
    }
View Full Code Here

TOP

Related Classes of org.parosproxy.paros.model.Session

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.