Package org.zaproxy.zap.extension.websocket

Examples of org.zaproxy.zap.extension.websocket.WebSocketMessageDTO


  @Override
    public boolean isEnableForComponent(Component invoker) {
    String invokerName = invoker.getName();
    if (invokerName != null && invokerName.equals(WebSocketMessagesView.PANEL_NAME)) {
      wsPopupHelper = new WebSocketPopupHelper((JTable) invoker);
      WebSocketMessageDTO message = wsPopupHelper.getSelectedMessage();
     
      if (message != null) {      
        String url = message.channel.getContextUrl();        
                setEnabled(isEnabledForUrl(url));
            } else {
View Full Code Here


    return WebSocketMessageDTO.class;
  }

  @Override
  public Message getMessage() {
    WebSocketMessageDTO message = (WebSocketMessageDTO) getRequestPanel().getMessage();

    // set metadata first (opcode, channel, direction)
    wsMessagePanel.setMetadata(message);
   
    return message;
View Full Code Here

    return message;
  }
 
  @Override
  public void setMessage(Message aMessage) {
    WebSocketMessageDTO message = (WebSocketMessageDTO) aMessage;
    if (message == null) {
      return;
    }
   
    getRequestPanel().setMessage(message);
View Full Code Here

    return menuItem;
  }

  @Override
  public void setDefaultMessage() {
    WebSocketMessageDTO msg = new WebSocketMessageDTO();
    msg.isOutgoing = true;
    msg.opcode = WebSocketMessage.OPCODE_TEXT;
    msg.readableOpcode = WebSocketMessage.opcode2string(msg.opcode);
   
    setMessage(msg);
View Full Code Here

   */
  private List<WebSocketMessageDTO> buildMessageDTOs(ResultSet rs, boolean interpretLiteralBytes, int payloadLength) throws SQLException {
    ArrayList<WebSocketMessageDTO> messages = new ArrayList<>();
    try {
      while (rs.next()) {
        WebSocketMessageDTO message;
       
        int channelId = rs.getInt("channel_id");
        WebSocketChannelDTO channel = getChannel(channelId);
        if (rs.getInt("fuzz_id") != 0) {
          WebSocketFuzzMessageDTO fuzzMessage = new WebSocketFuzzMessageDTO(channel);
          fuzzMessage.fuzzId = rs.getInt("fuzz_id");
          fuzzMessage.state = WebSocketFuzzMessageDTO.State.valueOf(rs.getString("state"));
          fuzzMessage.fuzz = rs.getString("fuzz");
         
          message = fuzzMessage;
        } else {
          message = new WebSocketMessageDTO(channel);
        }
       
        message.id = rs.getInt("message_id");
        message.setTime(rs.getTimestamp("timestamp"));
        message.opcode = rs.getInt("opcode");
        message.readableOpcode = WebSocketMessage.opcode2string(message.opcode);
       
        // read payload
        if (message.opcode == WebSocketMessage.OPCODE_BINARY) {
View Full Code Here

  }

  @Override
  public boolean onMessageFrame(int channelId, WebSocketMessage wsMessage) {
    if (wsMessage.isFinished()) {
      WebSocketMessageDTO message = wsMessage.getDTO();

      try {
        table.insertMessage(message);
      } catch (SQLException e) {
        logger.error(e.getMessage(), e);
View Full Code Here

      final WebSocketBreakpointsUiManagerInterface brkManager = this.brkManager;
      brkButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
          brkManager.handleAddBreakpoint(new WebSocketMessageDTO());
        }
      });
    }
    return brkButton;
  }
View Full Code Here

        }
      });
    }
   
  protected void performAction() throws SQLException {
    WebSocketMessageDTO message = wsPopupHelper.getSelectedMessage();
    if (message != null) {
      String url = Pattern.quote(message.channel.getContextUrl());
         
          performAction(url);
    }
View Full Code Here

  @Override
    public boolean isEnableForComponent(Component invoker) {
    String invokerName = invoker.getName();
    if (invokerName != null && invokerName.equals(WebSocketMessagesView.PANEL_NAME)) {
      wsPopupHelper = new WebSocketPopupHelper((JTable) invoker);
      WebSocketMessageDTO message = wsPopupHelper.getSelectedMessage();
     
      if (message != null) {               
                setEnabled(isEnabledForUrl(message.channel.getContextUrl()));
            } else {
                setEnabled(false);
View Full Code Here

    return Constant.messages.getString("websocket.manual_send.resend.menu");
  }

  @Override
  protected void performAction() {
    WebSocketMessageDTO message = getSelectedMessageDTO();
    if (message == null) {
      // do nothing
      return;
    }
   
View Full Code Here

TOP

Related Classes of org.zaproxy.zap.extension.websocket.WebSocketMessageDTO

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.