Search in sources :

Example 1 with SpriteImageEntry

use of com.att.aro.core.bestpractice.pojo.SpriteImageEntry in project VideoOptimzer by attdevsupport.

the class BpFileSpriteImagesTablePanel method getContentTable.

/**
 * Initializes and returns the RequestResponseTable.
 */
@SuppressWarnings("unchecked")
public DataTable<SpriteImageEntry> getContentTable() {
    if (contentTable == null) {
        contentTable = new DataTable<SpriteImageEntry>(tableModel);
        contentTable.setName(ResourceBundleHelper.getMessageString("file.css.sprite.images.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 : DataTablePopupMenu(com.att.aro.ui.model.DataTablePopupMenu) SpriteImageEntry(com.att.aro.core.bestpractice.pojo.SpriteImageEntry)

Example 2 with SpriteImageEntry

use of com.att.aro.core.bestpractice.pojo.SpriteImageEntry in project VideoOptimzer by attdevsupport.

the class ARODiagnosticsOverviewRouteImpl method updateDiagnosticsTab.

@Override
public void updateDiagnosticsTab(Object routeInfo) {
    int oldPanelIndex = jtabbedPane.getSelectedIndex();
    jtabbedPane.setSelectedIndex(DIAGNOSTIC_INDEX);
    DiagnosticsTab diagnosticsTab = (DiagnosticsTab) jtabbedPane.getSelectedComponent();
    if (routeInfo == null) {
        jtabbedPane.setSelectedIndex(oldPanelIndex);
        LOG.error("Diagnostics Tab needs a type for updating");
        return;
    }
    LOG.debug("Type used to route to Diagnostics Tab: " + routeInfo.getClass().getSimpleName());
    if (routeInfo instanceof CacheEntry) {
        diagnosticsTab.setHighlightedTCP(((CacheEntry) routeInfo).getHttpRequestResponse());
    } else if (routeInfo instanceof Session) {
        diagnosticsTab.setHighlightedTCP(((Session) routeInfo));
    } else if (routeInfo instanceof HttpRequestResponseInfo) {
        diagnosticsTab.setHighlightedTCP((HttpRequestResponseInfo) routeInfo);
    } else if (routeInfo instanceof HttpEntry) {
        diagnosticsTab.setHighlightedTCP(((HttpEntry) routeInfo).getHttpRequestResponse());
    } else if (routeInfo instanceof DisplayNoneInCSSEntry) {
        diagnosticsTab.setHighlightedTCP(((DisplayNoneInCSSEntry) routeInfo).getHttpRequestResponse());
    } else if (routeInfo instanceof ImageMdataEntry) {
        diagnosticsTab.setHighlightedTCP(((ImageMdataEntry) routeInfo).getHttpRequestResponse());
    } else if (routeInfo instanceof ImageCompressionEntry) {
        diagnosticsTab.setHighlightedTCP(((ImageCompressionEntry) routeInfo).getHttpRequestResponse());
    } else if (routeInfo instanceof MultipleConnectionsEntry) {
        if (((MultipleConnectionsEntry) routeInfo).isMultiple()) {
            jtabbedPane.setSelectedIndex(WATERFALL_INDEX);
            WaterfallTab waterfallTab = (WaterfallTab) jtabbedPane.getSelectedComponent();
            waterfallTab.updateGraph(((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo());
        } else {
            if (((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo().getSession() != null) {
                diagnosticsTab.setHighlightedSessionTCP(((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo());
            } else {
                diagnosticsTab.setHighlightedTCP(((MultipleConnectionsEntry) routeInfo).getHttpReqRespInfo());
            }
        }
    } else if (routeInfo instanceof SpriteImageEntry) {
        diagnosticsTab.setHighlightedTCP(((SpriteImageEntry) routeInfo).getHttpRequestResponse());
    } else if (routeInfo instanceof UnnecessaryConnectionEntry) {
        UnnecessaryConnectionEntry unConnectionEntry = (UnnecessaryConnectionEntry) routeInfo;
        diagnosticsTab.setHighlightedTCP(unConnectionEntry.getLowTime());
    } else if (routeInfo instanceof TransmissionPrivateDataEntry || routeInfo instanceof UnsecureSSLVersionEntry || routeInfo instanceof ForwardSecrecyEntry) {
        diagnosticsTab.setHighlightedTCP(routeInfo);
    } else if (routeInfo instanceof VideoStall) {
        double timestamp = ((VideoStall) routeInfo).getSegmentTryingToPlay().getStartTS();
        diagnosticsTab.getGraphPanel().setGraphView(timestamp, true);
        diagnosticsTab.getVideoPlayer().setMediaTime(timestamp);
    } else {
        jtabbedPane.setSelectedIndex(oldPanelIndex);
        LOG.error("Diagnostics Tab cannot handle a type of " + routeInfo.getClass().getSimpleName() + " for updating");
    }
}
Also used : ImageMdataEntry(com.att.aro.core.bestpractice.pojo.ImageMdataEntry) TransmissionPrivateDataEntry(com.att.aro.core.bestpractice.pojo.TransmissionPrivateDataEntry) MultipleConnectionsEntry(com.att.aro.core.bestpractice.pojo.MultipleConnectionsEntry) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) DisplayNoneInCSSEntry(com.att.aro.core.bestpractice.pojo.DisplayNoneInCSSEntry) DiagnosticsTab(com.att.aro.ui.view.diagnostictab.DiagnosticsTab) CacheEntry(com.att.aro.core.packetanalysis.pojo.CacheEntry) UnnecessaryConnectionEntry(com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionEntry) ForwardSecrecyEntry(com.att.aro.core.bestpractice.pojo.ForwardSecrecyEntry) HttpEntry(com.att.aro.core.bestpractice.pojo.HttpEntry) ImageCompressionEntry(com.att.aro.core.bestpractice.pojo.ImageCompressionEntry) UnsecureSSLVersionEntry(com.att.aro.core.bestpractice.pojo.UnsecureSSLVersionEntry) WaterfallTab(com.att.aro.ui.view.waterfalltab.WaterfallTab) SpriteImageEntry(com.att.aro.core.bestpractice.pojo.SpriteImageEntry) Session(com.att.aro.core.packetanalysis.pojo.Session) VideoStall(com.att.aro.core.packetanalysis.pojo.VideoStall)

Example 3 with SpriteImageEntry

use of com.att.aro.core.bestpractice.pojo.SpriteImageEntry in project VideoOptimzer by attdevsupport.

the class SpriteImageImpl method runTest.

@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
    SpriteImageResult result = new SpriteImageResult();
    List<SpriteImageEntry> analysisResults = new ArrayList<SpriteImageEntry>();
    for (Session session : tracedata.getSessionlist()) {
        double lastTimeStamp = 0.0;
        HttpRequestResponseInfo lastReqRessInfo = null;
        HttpRequestResponseInfo secondReqRessInfo = null;
        boolean thirdOccurrenceTriggered = false;
        for (HttpRequestResponseInfo req : session.getRequestResponseInfo()) {
            if (req.getDirection() == HttpDirection.RESPONSE && req.getContentType() != null && req.getFirstDataPacket() != null && req.getContentType().contains("image/") && req.getContentLength() < IMAGE_SIZE_LIMIT) {
                PacketInfo pktInfo = req.getFirstDataPacket();
                if (lastTimeStamp == 0.0) {
                    lastTimeStamp = pktInfo.getTimeStamp();
                    lastReqRessInfo = req;
                    continue;
                } else {
                    if ((pktInfo.getTimeStamp() - lastTimeStamp) <= 5.0) {
                        if (!thirdOccurrenceTriggered) {
                            secondReqRessInfo = req;
                            thirdOccurrenceTriggered = true;
                            continue;
                        } else {
                            /* -At this stage 3 images found to be downloaded in 5 secs. store them.
								 * -fix for defect DE26829*/
                            analysisResults.add(new SpriteImageEntry(lastReqRessInfo));
                            analysisResults.add(new SpriteImageEntry(secondReqRessInfo));
                            analysisResults.add(new SpriteImageEntry(req));
                            /* -reset the variables to search more such images in this session
								 * -fix for defect DE26829 */
                            lastTimeStamp = 0.0;
                            lastReqRessInfo = null;
                            secondReqRessInfo = null;
                            thirdOccurrenceTriggered = false;
                        }
                    }
                    lastTimeStamp = pktInfo.getTimeStamp();
                    lastReqRessInfo = req;
                    secondReqRessInfo = null;
                    thirdOccurrenceTriggered = false;
                }
            }
        }
    }
    result.setAnalysisResults(analysisResults);
    String text = "";
    if (analysisResults.isEmpty()) {
        result.setResultType(BPResultType.PASS);
        text = MessageFormat.format(textResultPass, analysisResults.size());
        result.setResultText(text);
        result.setResultExcelText(BPResultType.PASS.getDescription());
    } else {
        result.setResultType(BPResultType.FAIL);
        text = MessageFormat.format(textResults, ApplicationConfig.getInstance().getAppShortName(), analysisResults.size());
        result.setResultText(text);
        result.setResultExcelText(MessageFormat.format(textExcelResults, BPResultType.FAIL.getDescription(), analysisResults.size()));
    }
    result.setAboutText(aboutText);
    result.setDetailTitle(detailTitle);
    result.setLearnMoreUrl(learnMoreUrl);
    result.setOverviewTitle(overviewTitle);
    result.setExportAllNumberOfSpriteFiles(exportAllNumberOfSpriteFiles);
    return result;
}
Also used : SpriteImageResult(com.att.aro.core.bestpractice.pojo.SpriteImageResult) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) ArrayList(java.util.ArrayList) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) SpriteImageEntry(com.att.aro.core.bestpractice.pojo.SpriteImageEntry) Session(com.att.aro.core.packetanalysis.pojo.Session)

Aggregations

SpriteImageEntry (com.att.aro.core.bestpractice.pojo.SpriteImageEntry)3 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)2 Session (com.att.aro.core.packetanalysis.pojo.Session)2 DisplayNoneInCSSEntry (com.att.aro.core.bestpractice.pojo.DisplayNoneInCSSEntry)1 ForwardSecrecyEntry (com.att.aro.core.bestpractice.pojo.ForwardSecrecyEntry)1 HttpEntry (com.att.aro.core.bestpractice.pojo.HttpEntry)1 ImageCompressionEntry (com.att.aro.core.bestpractice.pojo.ImageCompressionEntry)1 ImageMdataEntry (com.att.aro.core.bestpractice.pojo.ImageMdataEntry)1 MultipleConnectionsEntry (com.att.aro.core.bestpractice.pojo.MultipleConnectionsEntry)1 SpriteImageResult (com.att.aro.core.bestpractice.pojo.SpriteImageResult)1 TransmissionPrivateDataEntry (com.att.aro.core.bestpractice.pojo.TransmissionPrivateDataEntry)1 UnnecessaryConnectionEntry (com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionEntry)1 UnsecureSSLVersionEntry (com.att.aro.core.bestpractice.pojo.UnsecureSSLVersionEntry)1 CacheEntry (com.att.aro.core.packetanalysis.pojo.CacheEntry)1 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)1 VideoStall (com.att.aro.core.packetanalysis.pojo.VideoStall)1 DataTablePopupMenu (com.att.aro.ui.model.DataTablePopupMenu)1 DiagnosticsTab (com.att.aro.ui.view.diagnostictab.DiagnosticsTab)1 WaterfallTab (com.att.aro.ui.view.waterfalltab.WaterfallTab)1 ArrayList (java.util.ArrayList)1