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