Package org.zaproxy.zap.extension.websocket

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


  }
 
  public void setSelectedChannelId(Integer channelId) {
    if (channelId != null) {
      for (int i = 0; i < channelsModel.getSize(); i++) {
        WebSocketChannelDTO channel = channelsModel.getElementAt(i);
        if (channelId.equals(channel.id)) {
          channelsComboBox.setSelectedItem(channel);
          return;
        }
      }
View Full Code Here


      channels.setSelectedIndex(0);
      channels.setLayoutOrientation(JList.VERTICAL);
      channels.setVisibleRowCount(itemsCount);
           
            // fixes width of JList
      channels.setPrototypeCellValue(new WebSocketChannelDTO("XXXXXXXXXXXXXXXXXX"));
    }
    return channels;
  }
View Full Code Here

      channelsList.setSelectedIndex(0);
    } else {
      int[] selectedIndices = new int[channelIds.size()];
      ListModel<WebSocketChannelDTO> model = channelsList.getModel();
      for (int i = 0, j = 0; i < model.getSize(); i++) {
        WebSocketChannelDTO channel = model.getElementAt(i);
        if (channelIds.contains(channel.id)) {
          selectedIndices[j++] = i;
        }
      }
      channelsList.setSelectedIndices(selectedIndices);
View Full Code Here

    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");
View Full Code Here

    return messages;
  }

  private WebSocketChannelDTO getChannel(int channelId) throws SQLException {
    if (!channelCache.containsKey(channelId)) {
      WebSocketChannelDTO criteria = new WebSocketChannelDTO();
      criteria.id = channelId;
      List<WebSocketChannelDTO> channels = getChannels(criteria);
      if (channels.size() == 1) {
        channelCache.put(channelId, channels.get(0));
      } else {
View Full Code Here

  private List<WebSocketChannelDTO> buildChannelDTOs(ResultSet rs) throws SQLException {
    ArrayList<WebSocketChannelDTO> channels = new ArrayList<>();
    try {
      while (rs.next()) {
        WebSocketChannelDTO channel = new WebSocketChannelDTO();
        channel.id = rs.getInt("channel_id");
        channel.host = rs.getString("host");
        channel.port = rs.getInt("port");
        channel.url = rs.getString("url");
        channel.startTimestamp = rs.getTimestamp("start_timestamp").getTime();
View Full Code Here

      channelSelect.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {   

            WebSocketChannelDTO channel = (WebSocketChannelDTO) channelSelect.getSelectedItem();
            if (channel != null && channel.id != null) {
              // has valid element selected + a valid reference
                useModel(channel.id);
            } else {
                useJoinedModel();
View Full Code Here

      final JComboBox<WebSocketChannelDTO> channelSelect = this.channelSelect;
      handshakeButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent evt) {
          WebSocketChannelDTO channel = (WebSocketChannelDTO) channelSelect.getSelectedItem();
          HistoryReference handshakeRef = channel.getHandshakeReference();
          if (handshakeRef != null) {
            HttpMessage msg;
            try {
                            msg = handshakeRef.getHttpMessage();
                        } catch (Exception e) {
View Full Code Here

    return true;
  }

  @Override
  public void onStateChange(final State state, WebSocketProxy proxy) {
    final WebSocketChannelDTO channel = proxy.getDTO();
   
    try {
      if (EventQueue.isDispatchThread()) {
        updateChannelsState(state, channel);
      } else {
View Full Code Here

TOP

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

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.