Search in sources :

Example 6 with TimeRange

use of com.att.aro.core.packetanalysis.pojo.TimeRange in project VideoOptimzer by attdevsupport.

the class ExcludeTimeRangeAnalysisDialog method initialize.

/**
 * Initializes the dialog.
 *
 * @return void
 */
private void initialize() {
    PacketAnalyzerResult traceresult = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult();
    if (traceresult == null) {
        LOGGER.error("Trace result error! ");
        MessageDialogFactory.getInstance().showErrorDialog(ExcludeTimeRangeAnalysisDialog.this, "wrong..");
    } else {
        if (endTimeResetValue == 0.0) {
            endTimeResetValue = traceresult.getTraceresult().getTraceDuration();
        }
        traceEndTime = endTimeResetValue;
        TimeRange timeRange = traceresult.getFilter().getTimeRange();
        if (timeRange != null) {
            timeRangeStartTime = timeRange.getBeginTime();
            timeRangeEndTime = timeRange.getEndTime();
        } else {
            timeRangeStartTime = 0.0;
            timeRangeEndTime = traceEndTime;
        }
    }
    // For cancel button
    saveInitTimeRangeValues(timeRangeStartTime, timeRangeEndTime);
    this.setSize(400, 150);
    this.setModal(true);
    this.setTitle(ResourceBundleHelper.getMessageString(DialogItem.excludetimerangeanalysis_title));
    this.setLocationRelativeTo(getOwner());
    this.setContentPane(getJDialogPanel());
    getRootPane().setDefaultButton(startButton);
    new EnableEscKeyCloseDialog(getRootPane(), this);
}
Also used : TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange) EnableEscKeyCloseDialog(com.att.aro.ui.commonui.EnableEscKeyCloseDialog) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) MainFrame(com.att.aro.ui.view.MainFrame)

Example 7 with TimeRange

use of com.att.aro.core.packetanalysis.pojo.TimeRange in project VideoOptimzer by attdevsupport.

the class AROController method propertyChange.

/**
 * Not to be directly called. Triggers a re-analysis if a property change is detected.
 */
@Override
public void propertyChange(PropertyChangeEvent event) {
    Profile profile = null;
    AnalysisFilter filter = null;
    try {
        theView.hideChartItems();
        if (event.getPropertyName().equals("tracePath")) {
            // to filter or not to filter
            String path;
            TimeRange timeRange = null;
            if (event.getNewValue() instanceof TimeRange) {
                timeRange = (TimeRange) event.getNewValue();
                path = timeRange.getPath();
                if (path != null) {
                    filter = new AnalysisFilter(null, timeRange, null);
                } else {
                    LOG.error("Invalid use of TimeRange here, it needs to hold a valid path, to finish creating a filter");
                }
            } else {
                path = (String) event.getNewValue();
                if ((path != null) && (timeRange = checkForDefaultTimeRange((String) event.getNewValue())) != null) {
                    // timeRange contains TimeRangeType.Default, so continue with analysis with filter
                    filter = new AnalysisFilter(null, timeRange, null);
                }
            }
            updateModel(path, profile, filter);
        } else if (event.getPropertyName().equals("profile")) {
            if (theModel.getAnalyzerResult() != null) {
                filter = theModel.getAnalyzerResult().getFilter();
            }
            if (theModel.isSuccess()) {
                updateModel(theModel.getAnalyzerResult().getTraceresult().getTraceDirectory(), (Profile) event.getNewValue(), filter);
            }
        } else if (event.getPropertyName().equals("filter")) {
            if (theModel.getAnalyzerResult() != null) {
                profile = theModel.getAnalyzerResult().getProfile();
            }
            if (theModel.getAnalyzerResult().getTraceresult().getTraceFile() != null && !theModel.getAnalyzerResult().getTraceresult().getTraceFile().equals("")) {
                updateModel(theModel.getAnalyzerResult().getTraceresult().getTraceFile(), profile, (AnalysisFilter) event.getNewValue());
            } else {
                updateModel(theModel.getAnalyzerResult().getTraceresult().getTraceDirectory(), profile, (AnalysisFilter) event.getNewValue());
            }
        }
    } finally {
        if (theModel.getAnalyzerResult() != null) {
            if (theModel.getAnalyzerResult().getStreamingVideoData() == null || theModel.getAnalyzerResult().getStreamingVideoData().isFinished()) {
                theView.showChartItems(HIDE_SHOW_CHARTPLOTOPTIONS);
            } else {
                // turn off chunks plot
                theView.hideChartItems(HIDE_SHOW_CHARTPLOTOPTIONS);
                // show everything that is not otherwise hidden
                theView.showChartItems();
            }
        }
    }
}
Also used : TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange) TraceTimeRange(com.att.aro.core.peripheral.pojo.TraceTimeRange) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) Profile(com.att.aro.core.configuration.pojo.Profile)

Example 8 with TimeRange

use of com.att.aro.core.packetanalysis.pojo.TimeRange in project VideoOptimzer by attdevsupport.

the class AROController method initializeFilter.

/**
 * <pre>
 * Create an AnalysisFilter
 * Creates default maps of domainNames and applications
 * Combined with the supplied TimeRange or a default TimeRange to create the AnalysisFilter
 *
 * This filter will be stored in the current PacketAnalyzerResult
 *
 * @param timeRangeParam is optional
 */
private void initializeFilter(TimeRange... timeRangeParam) {
    Collection<String> appNames = theModel.getAnalyzerResult().getTraceresult().getAllAppNames();
    Map<String, Set<InetAddress>> map = theModel.getAnalyzerResult().getTraceresult().getAppIps();
    Map<InetAddress, String> domainNames = new HashMap<InetAddress, String>();
    for (Session tcpSession : theModel.getAnalyzerResult().getSessionlist()) {
        if (!domainNames.containsKey(tcpSession.getRemoteIP())) {
            domainNames.put(tcpSession.getRemoteIP(), tcpSession.getDomainName());
        }
    }
    HashMap<String, ApplicationSelection> applications = new HashMap<String, ApplicationSelection>(appNames.size());
    ApplicationSelection appSelection;
    for (String app : appNames) {
        appSelection = new ApplicationSelection(app, map.get(app));
        appSelection.setDomainNames(domainNames);
        for (IPAddressSelection ipAddressSelection : appSelection.getIPAddressSelections()) {
            ipAddressSelection.setDomainName(domainNames.get(ipAddressSelection.getIpAddress()));
        }
        applications.put(app, appSelection);
    }
    TimeRange timeRange = timeRangeParam != null && timeRangeParam.length == 1 && timeRangeParam[0] != null ? timeRangeParam[0] : null;
    if (timeRange == null) {
        timeRange = new TimeRange(0.0, theModel.getAnalyzerResult().getTraceresult().getTraceDuration());
    }
    AnalysisFilter initFilter = new AnalysisFilter(applications, timeRange, domainNames);
    currentTraceInitialAnalyzerResult = theModel.getAnalyzerResult();
    currentTraceInitialAnalyzerResult.setFilter(initFilter);
}
Also used : Set(java.util.Set) HashMap(java.util.HashMap) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) ApplicationSelection(com.att.aro.core.packetanalysis.pojo.ApplicationSelection) TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange) TraceTimeRange(com.att.aro.core.peripheral.pojo.TraceTimeRange) IPAddressSelection(com.att.aro.core.packetanalysis.pojo.IPAddressSelection) InetAddress(java.net.InetAddress) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 9 with TimeRange

use of com.att.aro.core.packetanalysis.pojo.TimeRange in project VideoOptimzer by attdevsupport.

the class TimeRangeAnalysisDialog method reset.

private void reset(boolean cloneFilter) {
    traceEndTime = endTimeResetValue;
    startTimeTextField.setText(DECIMAL_FORMAT.format(0.0));
    endTimeTextField.setText(doubleToFixedDecimal(endTimeResetValue, 3));
    chkIpv4.setSelected(ipv4Selection = initialFilter.isIpv4Sel());
    chkIpv6.setSelected(ipv6Selection = initialFilter.isIpv6Sel());
    chkTCP.setSelected(tcpSelection = initialFilter.isTcpSel());
    chkUdp.setSelected(udpSelection = initialFilter.isUdpSel());
    chkDns.setSelected(dnsSelection = initialFilter.isDnsSelection());
    currentTraceResult.setFilter(cloneFilter ? cloneFilter(initialFilter) : initialFilter);
    currentTraceResult.getFilter().setTimeRange(new TimeRange(initTimeRangeStartTime, initTimeRangeEndTime));
    timeRangeAnalysisResultsTextArea.setText("");
}
Also used : TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange)

Example 10 with TimeRange

use of com.att.aro.core.packetanalysis.pojo.TimeRange in project VideoOptimzer by attdevsupport.

the class TimeRangeAnalysisDialog method cloneFilter.

private AnalysisFilter cloneFilter(AnalysisFilter filter) {
    Collection<ApplicationSelection> appSel = filter.getApplicationSelections();
    HashMap<String, ApplicationSelection> applications = new HashMap<String, ApplicationSelection>(appSel.size());
    for (ApplicationSelection aSel : appSel) {
        ApplicationSelection clonedAP = new ApplicationSelection(aSel);
        applications.put(clonedAP.getAppName(), clonedAP);
    }
    TimeRange clonedTimeRange = null;
    if (filter.getTimeRange() != null) {
        TimeRange original = filter.getTimeRange();
        clonedTimeRange = new TimeRange(original.getTitle(), original.getTimeRangeType(), original.getBeginTime(), original.getEndTime());
    }
    AnalysisFilter clonedFilter = new AnalysisFilter(applications, clonedTimeRange, filter.getDomainNames() == null ? null : new HashMap<>(filter.getDomainNames()));
    clonedFilter.setIpv4Sel(filter.isIpv4Sel());
    clonedFilter.setIpv6Sel(filter.isIpv6Sel());
    clonedFilter.setTcpSel(filter.isTcpSel());
    clonedFilter.setUdpSel(filter.isUdpSel());
    clonedFilter.setDnsSelection(filter.isDnsSelection());
    return clonedFilter;
}
Also used : TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange) HashMap(java.util.HashMap) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) ApplicationSelection(com.att.aro.core.packetanalysis.pojo.ApplicationSelection)

Aggregations

TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)21 TraceTimeRange (com.att.aro.core.peripheral.pojo.TraceTimeRange)8 AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)7 ArrayList (java.util.ArrayList)5 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)4 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)4 Profile (com.att.aro.core.configuration.pojo.Profile)3 AbstractRrcStateMachine (com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine)3 ApplicationSelection (com.att.aro.core.packetanalysis.pojo.ApplicationSelection)3 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)3 Session (com.att.aro.core.packetanalysis.pojo.Session)3 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 IOException (java.io.IOException)3 BaseTest (com.att.aro.core.BaseTest)2 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)2 Statistic (com.att.aro.core.packetanalysis.pojo.Statistic)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Set (java.util.Set)2