use of com.att.aro.core.bestpractice.pojo.HttpCode3xxEntry in project VideoOptimzer by attdevsupport.
the class BpConnectionsHttp3xxTablePanel method getContentTable.
/**
* Initializes and returns the RequestResponseTable.
*/
@SuppressWarnings("unchecked")
public DataTable<HttpCode3xxEntry> getContentTable() {
if (contentTable == null) {
contentTable = new DataTable<HttpCode3xxEntry>(tableModel);
contentTable.setName(ResourceBundleHelper.getMessageString("connections.301.302.response.tableName"));
contentTable.setAutoCreateRowSorter(true);
contentTable.setGridColor(Color.LIGHT_GRAY);
contentTable.setRowHeight(ROW_HEIGHT);
contentTable.setAutoResizeMode(JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
DataTablePopupMenu popupMenu = (DataTablePopupMenu) contentTable.getPopup();
popupMenu.initialize();
}
return contentTable;
}
use of com.att.aro.core.bestpractice.pojo.HttpCode3xxEntry in project VideoOptimzer by attdevsupport.
the class Http3xxCodeImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
Http3xxCodeResult result = new Http3xxCodeResult();
SortedMap<Integer, Integer> httpRedirectCounts3XX = new TreeMap<Integer, Integer>();
Map<Integer, HttpRequestResponseInfo> firstResMap = new HashMap<Integer, HttpRequestResponseInfo>();
List<HttpCode3xxEntry> httprescodelist = new ArrayList<HttpCode3xxEntry>();
HttpRequestResponseInfo lastRequestObj = null;
for (Session session : tracedata.getSessionlist()) {
lastRequestObj = null;
for (HttpRequestResponseInfo req : session.getRequestResponseInfo()) {
if (req.getDirection() == HttpDirection.REQUEST) {
lastRequestObj = req;
}
if (req.getDirection() == HttpDirection.RESPONSE && HttpRequestResponseInfo.HTTP_SCHEME.equals(req.getScheme()) && req.getStatusCode() >= 300 && req.getStatusCode() < 400) {
Integer code = req.getStatusCode();
Integer count = httpRedirectCounts3XX.get(code);
if (count != null) {
httpRedirectCounts3XX.put(code, count + 1);
} else {
httpRedirectCounts3XX.put(code, 1);
firstResMap.put(code, req);
}
httprescodelist.add(new HttpCode3xxEntry(req, lastRequestObj, session.getDomainName()));
}
}
}
if (httpRedirectCounts3XX.isEmpty()) {
result.setResultType(BPResultType.PASS);
result.setResultText(textResultPass);
result.setResultExcelText(BPResultType.PASS.getDescription());
} else {
result.setResultType(BPResultType.FAIL);
result.setResultText(Http3xx4xxHelper.createFailResult(httpRedirectCounts3XX, textResults, errorPlural, errorSingular));
result.setResultExcelText(MessageFormat.format(textExcelResults, BPResultType.FAIL.getDescription(), Http3xx4xxHelper.formatErrorCodesToText(httpRedirectCounts3XX)));
}
result.setAboutText(aboutText);
result.setDetailTitle(detailTitle);
result.setLearnMoreUrl(learnMoreUrl);
result.setOverviewTitle(overviewTitle);
result.setExportAllHttpError(exportAllHttpError);
result.setHttp3xxResCode(httprescodelist);
result.setHttpRedirectCounts3XX(httpRedirectCounts3XX);
result.setFirstResMap(firstResMap);
return result;
}
Aggregations