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;
}
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);
}
Aggregations