Search in sources :

Example 6 with ApplicationSelection

use of com.att.aro.core.packetanalysis.pojo.ApplicationSelection 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 7 with ApplicationSelection

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

the class FilterApplicationsAndIpDialog method getJApplicationsTable.

/**
 * Initializes and returns the table that contains the list of applications
 * found in the trace data.
 */
private JTable getJApplicationsTable() {
    if (jApplicationsTable == null) {
        // Make sure to make a copy of the current data before modifying
        jApplicationsTable = new DataTable<ApplicationSelection>(jApplicationsTableModel);
        jApplicationsTable.setAutoCreateRowSorter(true);
        DataTablePopupMenu popupMenu = (DataTablePopupMenu) jApplicationsTable.getPopup();
        popupMenu.initialize();
    }
    return jApplicationsTable;
}
Also used : ApplicationSelection(com.att.aro.core.packetanalysis.pojo.ApplicationSelection) DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu)

Example 8 with ApplicationSelection

use of com.att.aro.core.packetanalysis.pojo.ApplicationSelection 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)

Example 9 with ApplicationSelection

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

the class TimeRangeAnalysisDialog method updateCurrentfilter.

private boolean updateCurrentfilter() {
    if (ipv4Selection || ipv6Selection) {
        if (tcpSelection || udpSelection || dnsSelection) {
            if (currentTraceResult.getFilter() != null) {
                AnalysisFilter filter = currentTraceResult.getFilter();
                Map<InetAddress, String> domainNames = filter.getDomainNames();
                Map<String, ApplicationSelection> appSelections = new HashMap<>(filter.getAppSelections().size());
                for (ApplicationSelection sel : filter.getAppSelections().values()) {
                    if (domainNames != null) {
                        sel.setDomainNames(domainNames);
                    }
                    appSelections.put(sel.getAppName(), new ApplicationSelection(sel));
                }
                filter.setIpv4Sel(ipv4Selection);
                filter.setIpv6Sel(ipv6Selection);
                filter.setTcpSel(tcpSelection);
                filter.setUdpSel(udpSelection);
                filter.setDnsSelection(dnsSelection);
                return true;
            }
        } else {
            MessageDialogFactory.getInstance().showErrorDialog(this, resourceBundle.getString("filter.noProtocolSelection.error"));
        }
    } else {
        MessageDialogFactory.getInstance().showErrorDialog(this, resourceBundle.getString("filter.noIpSelection.error"));
    }
    return false;
}
Also used : HashMap(java.util.HashMap) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) ApplicationSelection(com.att.aro.core.packetanalysis.pojo.ApplicationSelection) InetAddress(java.net.InetAddress)

Example 10 with ApplicationSelection

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

the class FilterApplicationsTableModel method setValueAt.

/**
 * Sets the value of the specified data item.
 *
 * @param aValue The value to set for the data item.
 *
 * @param rowIndex The row index of the data item.
 *
 * @param columnIndex The column index of the data item.
 *
 * @see javax.swing.table.AbstractTableModel#setValueAt(java.lang.Object,
 *      int, int)
 */
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
    super.setValueAt(aValue, rowIndex, columnIndex);
    ApplicationSelection obj = getValueAt(rowIndex);
    switch(columnIndex) {
        case SELECT_COL:
            if (aValue instanceof Boolean) {
                obj.setSelected(((Boolean) aValue).booleanValue());
            }
            break;
        case COLOR_COL:
            if (aValue instanceof Color) {
                obj.setColor(((Color) aValue));
            }
    }
    fireTableCellUpdated(rowIndex, columnIndex);
}
Also used : Color(java.awt.Color) ApplicationSelection(com.att.aro.core.packetanalysis.pojo.ApplicationSelection)

Aggregations

ApplicationSelection (com.att.aro.core.packetanalysis.pojo.ApplicationSelection)10 AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)6 HashMap (java.util.HashMap)5 TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)3 IPAddressSelection (com.att.aro.core.packetanalysis.pojo.IPAddressSelection)2 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)2 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)2 Session (com.att.aro.core.packetanalysis.pojo.Session)2 InetAddress (java.net.InetAddress)2 ArrayList (java.util.ArrayList)2 BestPracticeType (com.att.aro.core.bestpractice.pojo.BestPracticeType)1 Profile (com.att.aro.core.configuration.pojo.Profile)1 PacketAnalyzerImpl (com.att.aro.core.packetanalysis.impl.PacketAnalyzerImpl)1 AbstractRrcStateMachine (com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine)1 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)1 EnergyModel (com.att.aro.core.packetanalysis.pojo.EnergyModel)1 Statistic (com.att.aro.core.packetanalysis.pojo.Statistic)1 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)1 TraceTimeRange (com.att.aro.core.peripheral.pojo.TraceTimeRange)1 EnableEscKeyCloseDialog (com.att.aro.ui.commonui.EnableEscKeyCloseDialog)1