Search in sources :

Example 1 with Http4xx5xxStatusResponseCodesEntry

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;
}
Also used : Http4xx5xxStatusResponseCodesEntry(com.att.aro.core.bestpractice.pojo.Http4xx5xxStatusResponseCodesEntry) HashMap(java.util.HashMap) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) Http4xx5xxResult(com.att.aro.core.bestpractice.pojo.Http4xx5xxResult) ArrayList(java.util.ArrayList) TreeMap(java.util.TreeMap) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 2 with Http4xx5xxStatusResponseCodesEntry

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;
}
Also used : Http4xx5xxStatusResponseCodesEntry(com.att.aro.core.bestpractice.pojo.Http4xx5xxStatusResponseCodesEntry) DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu)

Aggregations

Http4xx5xxStatusResponseCodesEntry (com.att.aro.core.bestpractice.pojo.Http4xx5xxStatusResponseCodesEntry)2 Http4xx5xxResult (com.att.aro.core.bestpractice.pojo.Http4xx5xxResult)1 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)1 Session (com.att.aro.core.packetanalysis.pojo.Session)1 DataTablePopupMenu (com.att.aro.ui.model.DataTablePopupMenu)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 TreeMap (java.util.TreeMap)1