Search in sources :

Example 1 with IPAddressSelection

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

the class FilterApplicationsAndIpDialog method selectionReturnsData.

/*
	 * Compares user selection to trace data to determine 
	 * if all the trace data will be filtered out if user
	 * selection is applied. 
	 */
private boolean selectionReturnsData() {
    AnalysisFilter filter = getCurrentPktAnalyzerResult().getFilter();
    if (!filter.isIpv4Sel() && !filter.isIpv6Sel() && !filter.isTcpSel() && !filter.isUdpSel() && !filter.isDnsSelection()) {
        return false;
    }
    Collection<ApplicationSelection> appSel = filter.getApplicationSelections();
    List<IPAddressSelection> ipSel = new ArrayList<IPAddressSelection>();
    List<IPAddressSelection> ipSelChecked = new ArrayList<IPAddressSelection>();
    for (ApplicationSelection aSel : appSel) {
        ipSel.addAll(aSel.getIPAddressSelections());
    }
    for (IPAddressSelection iSel : ipSel) {
        if (iSel.isSelected()) {
            ipSelChecked.add(iSel);
        }
    }
    if (ipSelChecked.size() == 0) {
        return false;
    }
    List<PacketInfo> packetsInfo = getInitialPktAnalyzerResult().getTraceresult().getAllpackets();
    PacketAnalyzerImpl pktAnalyzer = (PacketAnalyzerImpl) ((MainFrame) parent).getController().getAROService().getAnalyzer();
    if (pktAnalyzer.filterPackets(filter, packetsInfo).size() > 0) {
        return true;
    }
    return false;
}
Also used : PacketAnalyzerImpl(com.att.aro.core.packetanalysis.impl.PacketAnalyzerImpl) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) ApplicationSelection(com.att.aro.core.packetanalysis.pojo.ApplicationSelection) ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) IPAddressSelection(com.att.aro.core.packetanalysis.pojo.IPAddressSelection)

Example 2 with IPAddressSelection

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

Aggregations

AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)2 ApplicationSelection (com.att.aro.core.packetanalysis.pojo.ApplicationSelection)2 IPAddressSelection (com.att.aro.core.packetanalysis.pojo.IPAddressSelection)2 PacketAnalyzerImpl (com.att.aro.core.packetanalysis.impl.PacketAnalyzerImpl)1 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)1 Session (com.att.aro.core.packetanalysis.pojo.Session)1 TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)1 TraceTimeRange (com.att.aro.core.peripheral.pojo.TraceTimeRange)1 InetAddress (java.net.InetAddress)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Set (java.util.Set)1