Package org.parosproxy.paros.extension

Examples of org.parosproxy.paros.extension.ExtensionLoader


        this.view = view;
    }
   
    public ExtensionLoader getExtensionLoader() {
        if (loader == null) {
            loader = new ExtensionLoader(model, view);
        }
        return loader;
    }
View Full Code Here


    } catch (WebSocketException e) {
      logger.warn(e.getMessage(), e);
    }
   
    if (getView() != null) {
      ExtensionLoader extLoader = Control.getSingleton().getExtensionLoader();
      ExtensionHookView hookView = extensionHook.getHookView();
      ExtensionHookMenu hookMenu = extensionHook.getHookMenu();
     
      // setup WebSocket tab
      WebSocketPanel wsPanel = getWebSocketPanel();
      wsPanel.setDisplayPanel(getView().getRequestPanel(), getView().getResponsePanel());
     
      extensionHook.addSessionListener(wsPanel.getSessionListener());
     
      addAllChannelObserver(wsPanel);
      ExtensionHelp.enableHelpKey(wsPanel, "websocket.tab");
     
      hookView.addStatusPanel(getWebSocketPanel());
     
      // setup Options Panel
      hookView.addOptionPanel(getOptionsPanel());
     
      // add 'Exclude from WebSockets' menu item to WebSocket tab context menu
      hookMenu.addPopupMenuItem(new ExcludeFromWebSocketsMenuItem(this, storage.getTable()));

      // setup Session Properties
      sessionExcludePanel =  new SessionExcludeFromWebSocket(this);
      getView().getSessionDialog().addParamPanel(new String[]{}, sessionExcludePanel, false);
     
      // setup Breakpoints
      ExtensionBreak extBreak = (ExtensionBreak) extLoader.getExtension(ExtensionBreak.NAME);
      if (extBreak != null) {
        // setup custom breakpoint handler
        BreakpointMessageHandler wsBrkMessageHandler = new WebSocketBreakpointMessageHandler(extBreak.getBreakPanel(), config);
        wsBrkMessageHandler.setEnabledBreakpoints(extBreak.getBreakpointsEnabledList());
       
        // listen on new messages such that breakpoints can apply
        addAllChannelObserver(new WebSocketProxyListenerBreak(this, wsBrkMessageHandler));

        // pop up to add the breakpoint
        hookMenu.addPopupMenuItem(new PopupMenuAddBreakWebSocket(extBreak));
        extBreak.addBreakpointsUiManager(getBrkManager());
      }
     
      // setup replace payload filter
      wsFilterListener = new WebSocketFilterListener();
      addAllChannelObserver(wsFilterListener);
      payloadFilter = new FilterWebSocketPayload(this, wsPanel.getChannelsModel());
      addWebSocketFilter(payloadFilter);
     
      // setup fuzzable extension
      ExtensionFuzz extFuzz = (ExtensionFuzz) extLoader.getExtension(ExtensionFuzz.NAME);
      if (extFuzz != null) {
        hookMenu.addPopupMenuItem(new ShowFuzzMessageInWebSocketsTabMenuItem(getWebSocketPanel()));
       
        fuzzHandler = new WebSocketFuzzerHandler(storage.getTable());
        extFuzz.addFuzzerHandler(WebSocketMessageDTO.class, fuzzHandler);
        addAllChannelObserver(fuzzHandler);
      }
     
      // add exclude/include scope
      hookMenu.addPopupMenuItem(new PopupIncludeWebSocketContextMenu());
      hookMenu.addPopupMenuItem(new PopupExcludeWebSocketContextMenu());
     
      // setup workpanel (window containing Request, Response & Break tab)
      initializeWebSocketsForWorkPanel();
     
      // setup manualrequest extension
      ExtensionManualRequestEditor extManReqEdit = (ExtensionManualRequestEditor) extLoader
          .getExtension(ExtensionManualRequestEditor.NAME);
      if (extManReqEdit != null) {
        WebSocketPanelSender sender = new WebSocketPanelSender();
        addAllChannelObserver(sender);
       
View Full Code Here

      WebSocketProxy wsProxy = wsEntry.getValue();
      wsProxy.shutdown();
    }
   
    Control control = Control.getSingleton();
    ExtensionLoader extLoader = control.getExtensionLoader();
   
    // clear up Session Properties
    getView().getSessionDialog().removeParamPanel(sessionExcludePanel);
   
    // clear up Breakpoints
    ExtensionBreak extBreak = (ExtensionBreak) extLoader.getExtension(ExtensionBreak.NAME);
    if (extBreak != null) {
      extBreak.removeBreakpointsUiManager(getBrkManager());
    }
   
    // clear up fuzzable extension
    ExtensionFuzz extFuzz = (ExtensionFuzz) extLoader.getExtension(ExtensionFuzz.NAME);
    if (extFuzz != null) {
      extFuzz.removeFuzzerHandler(WebSocketMessageDTO.class);
    }
   
    removeWebSocketFilter(payloadFilter);
   
    // clear up manualrequest extension
    ExtensionManualRequestEditor extManReqEdit = (ExtensionManualRequestEditor) extLoader
        .getExtension(ExtensionManualRequestEditor.NAME);
    if (extManReqEdit != null) {
      extManReqEdit.removeManualSendEditor(WebSocketMessageDTO.class);
     
      // clear up persistent connection listener for http manual send editor
View Full Code Here

   * HTTP communication.
   *
   * @param filter Instance receives payloads and is able to change it.
   */
  public void addWebSocketFilter(WebSocketFilter filter) {
    ExtensionLoader extLoader = Control.getSingleton().getExtensionLoader();
    ExtensionFilter extFilter = (ExtensionFilter) extLoader.getExtension(ExtensionFilter.NAME);
    if (extFilter != null) {
      filter.initView(getView());
      extFilter.addFilter(filter);
     
      wsFilterListener.addFilter(filter);
View Full Code Here

      logger.warn("Filter '" + filter.getClass().toString() + "' couldn't be added as the filter extension is not available!");
    }
  }
 
  public void removeWebSocketFilter(WebSocketFilter filter) {
    ExtensionLoader extLoader = Control.getSingleton().getExtensionLoader();
    ExtensionFilter extFilter = (ExtensionFilter) extLoader.getExtension(ExtensionFilter.NAME);
    if (extFilter != null) {
      extFilter.removeFilter(filter);
      wsFilterListener.removeFilter(filter);
    }
  }
View Full Code Here

    this.view = view;
  }

  public ExtensionLoader getExtensionLoader() {
    if (loader == null) {
      loader = new ExtensionLoader(model, view);
    }
    return loader;
  }
View Full Code Here

        }
    }

    private static StringBuilder getExtensionsXML(SiteNode site) {
        StringBuilder extensionXml = new StringBuilder();
        ExtensionLoader loader = Control.getSingleton().getExtensionLoader();
        int extensionCount = loader.getExtensionCount();
        for(int i=0; i<extensionCount; i++) {
            Extension extension = loader.getExtension(i);
            if(extension instanceof XmlReporterExtension) {
                extensionXml.append(((XmlReporterExtension)extension).getXml(site));
            }
        }
        return extensionXml;
View Full Code Here

TOP

Related Classes of org.parosproxy.paros.extension.ExtensionLoader

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.