Ejemplo n.º 1
0
  /** Loading the values stored into configuration form */
  private void loadValues() {
    PacketLoggingService packetLogging = LoggingUtilsActivator.getPacketLoggingService();
    PacketLoggingConfiguration cfg = packetLogging.getConfiguration();

    enableCheckBox.setSelected(cfg.isGlobalLoggingEnabled());

    sipProtocolCheckBox.setSelected(cfg.isSipLoggingEnabled());
    jabberProtocolCheckBox.setSelected(cfg.isJabberLoggingEnabled());
    rtpProtocolCheckBox.setSelected(cfg.isRTPLoggingEnabled());
    ice4jProtocolCheckBox.setSelected(cfg.isIce4JLoggingEnabled());
    fileCountField.setText(String.valueOf(cfg.getLogfileCount()));
    fileSizeField.setText(String.valueOf(cfg.getLimit() / 1000));

    updateButtonsState();
  }
Ejemplo n.º 2
0
  /** Invoked when an action occurs. */
  public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    PacketLoggingService packetLogging = LoggingUtilsActivator.getPacketLoggingService();

    if (source.equals(enableCheckBox)) {
      // turn it on/off in activator
      packetLogging.getConfiguration().setGlobalLoggingEnabled(enableCheckBox.isSelected());
      updateButtonsState();
    } else if (source.equals(sipProtocolCheckBox)) {
      packetLogging.getConfiguration().setSipLoggingEnabled(sipProtocolCheckBox.isSelected());
    } else if (source.equals(jabberProtocolCheckBox)) {
      packetLogging.getConfiguration().setJabberLoggingEnabled(jabberProtocolCheckBox.isSelected());
    } else if (source.equals(rtpProtocolCheckBox)) {
      packetLogging.getConfiguration().setRTPLoggingEnabled(rtpProtocolCheckBox.isSelected());
    } else if (source.equals(ice4jProtocolCheckBox)) {
      packetLogging.getConfiguration().setIce4JLoggingEnabled(ice4jProtocolCheckBox.isSelected());
    } else if (source.equals(archiveButton)) {
      // don't block the UI thread
      new Thread(
              new Runnable() {
                public void run() {
                  collectLogs();
                }
              })
          .start();
    } else if (source.equals(uploadLogsButton)) {
      // don't block the UI thread
      new Thread(
              new Runnable() {
                public void run() {
                  uploadLogs();
                }
              })
          .start();
    }
  }