use of com.att.aro.core.bestpractice.pojo.Http4xx5xxStatusResponseCodesEntry in project VideoOptimzer by attdevsupport.
the class Http4xx5xxImpl method runTest.
@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
Http4xx5xxResult result = new Http4xx5xxResult();
Map<Integer, HttpRequestResponseInfo> firstErrorRespMap4XX = new HashMap<Integer, HttpRequestResponseInfo>();
SortedMap<Integer, Integer> httpErrorCounts4XX = new TreeMap<Integer, Integer>();
List<Http4xx5xxStatusResponseCodesEntry> httpResCodelist = new ArrayList<Http4xx5xxStatusResponseCodesEntry>();
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() >= 400 && req.getStatusCode() < 600) {
Integer code = req.getStatusCode();
Integer count = httpErrorCounts4XX.get(code);
if (count != null) {
httpErrorCounts4XX.put(code, count + 1);
} else {
httpErrorCounts4XX.put(code, 1);
firstErrorRespMap4XX.put(code, req);
}
httpResCodelist.add(new Http4xx5xxStatusResponseCodesEntry(req, lastRequestObj, session.getDomainName()));
}
}
}
if (httpErrorCounts4XX.isEmpty()) {
result.setResultType(BPResultType.PASS);
result.setResultText(textResultPass);
result.setResultExcelText(BPResultType.PASS.getDescription());
} else {
result.setResultType(BPResultType.FAIL);
result.setResultText(Http3xx4xxHelper.createFailResult(httpErrorCounts4XX, textResults, errorPlural, errorSingular));
result.setResultExcelText(MessageFormat.format(textExcelResults, BPResultType.FAIL.getDescription(), Http3xx4xxHelper.formatErrorCodesToText(httpErrorCounts4XX)));
}
result.setAboutText(aboutText);
result.setDetailTitle(detailTitle);
result.setLearnMoreUrl(learnMoreUrl);
result.setOverviewTitle(overviewTitle);
result.setExportAllHttpError(exportAllHttpError);
result.setFirstErrorRespMap4XX(firstErrorRespMap4XX);
result.setHttpErrorCounts4XX(httpErrorCounts4XX);
result.setHttpResCodelist(httpResCodelist);
return result;
}
use of com.att.aro.core.bestpractice.pojo.Http4xx5xxStatusResponseCodesEntry in project VideoOptimzer by attdevsupport.
the class BpConnectionsHttp4xx5xxTablePanel method getContentTable.
/**
* Initializes and returns the RequestResponseTable.
*/
@SuppressWarnings("unchecked")
public DataTable<Http4xx5xxStatusResponseCodesEntry> getContentTable() {
if (contentTable == null) {
contentTable = new DataTable<Http4xx5xxStatusResponseCodesEntry>(tableModel);
contentTable.setName(ResourceBundleHelper.getMessageString("connections.400.500.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;
}
Aggregations