Search in sources :

Example 16 with Session

use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.

the class DiagnosticsTab method setHighlightedTCP.

// only UnnecessaryConnectionEntry table use this method
public void setHighlightedTCP(Double timestampParm) {
    if (timestampParm != null) {
        double timestamp = timestampParm.doubleValue();
        double timestampDiff = Double.MAX_VALUE;
        double lastTimestampDiff = timestampDiff;
        Session foundSession = null;
        for (Session tcpSess : sessionsSortedByTimestamp) {
            if (tcpSess != null) {
                double currentTimestampDiff = Math.abs(tcpSess.getSessionStartTime() - timestamp);
                if (currentTimestampDiff < timestampDiff) {
                    timestampDiff = currentTimestampDiff;
                    foundSession = tcpSess;
                }
                if (currentTimestampDiff > lastTimestampDiff) {
                    break;
                }
                lastTimestampDiff = currentTimestampDiff;
            }
        }
        if (foundSession != null) {
            // setHighlightedTCP(foundSession, timestamp);
            setHighlightedTCP(foundSession);
        } else {
            LOGGER.warn("No session found to route to Diagnostic Tab for timestamp " + timestamp);
        }
    } else {
        LOGGER.warn("No timestamp for Diagnostic Tab routing");
    }
}
Also used : HttpRequestResponseInfoWithSession(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfoWithSession) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 17 with Session

use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.

the class SegmentTablePanel method streamTableClickHandler.

public MouseAdapter streamTableClickHandler(TableModel tableModel, JTable jTable, int sessionLinkColumn) {
    return new MouseAdapter() {

        public void mouseClicked(MouseEvent e) {
            if (diagnosticsOverviewRoute != null && e.getClickCount() == 2) {
                if (e.getSource() instanceof JTable) {
                    int selectionIndex = ((JTable) e.getSource()).getSelectedRow();
                    Session session = (Session) jTable.getValueAt(selectionIndex, sessionLinkColumn);
                    diagnosticsOverviewRoute.updateDiagnosticsTab(session);
                }
            }
        }
    };
}
Also used : MouseEvent(java.awt.event.MouseEvent) JTable(javax.swing.JTable) MouseAdapter(java.awt.event.MouseAdapter) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 18 with Session

use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.

the class ImageMetaDataImpl method runTest.

@Override
public AbstractBestPracticeResult runTest(PacketAnalyzerResult tracedata) {
    ImageMdtaResult result = new ImageMdtaResult();
    List<String> imageList = new ArrayList<String>();
    List<ImageMdataEntry> entrylist = new ArrayList<ImageMdataEntry>();
    String imagePath = tracedata.getTraceresult().getTraceDirectory() + System.getProperty("file.separator") + "Image" + System.getProperty("file.separator");
    if (Util.isFilesforAnalysisAvailable(new File(imagePath))) {
        for (Session session : tracedata.getSessionlist()) {
            for (HttpRequestResponseInfo req : session.getRequestResponseInfo()) {
                if (req.getDirection() == HttpDirection.RESPONSE && req.getContentType() != null && req.getContentType().contains("image/")) {
                    String extractedImageName = ImageHelper.extractFullNameFromRRInfo(req);
                    int pos = extractedImageName.lastIndexOf('.') + 1;
                    // List<String> imageList = new ArrayList<String>();
                    File folder = new File(imagePath);
                    File[] listOfFiles = folder.listFiles();
                    if (listOfFiles != null) {
                        runTestForFiles(imageList, entrylist, session, req, imagePath, extractedImageName, pos, listOfFiles);
                    }
                }
            }
        }
        result.setResults(entrylist);
        String text = "";
        if (entrylist.isEmpty()) {
            result.setResultType(BPResultType.PASS);
            text = MessageFormat.format(textResultPass, entrylist.size());
            result.setResultText(text);
            result.setResultExcelText(BPResultType.PASS.getDescription());
        } else {
            result.setResultType(BPResultType.FAIL);
            text = MessageFormat.format(textResults, ApplicationConfig.getInstance().getAppShortName(), entrylist.size());
            result.setResultText(text);
            result.setResultExcelText(MessageFormat.format(textExcelResults, BPResultType.FAIL.getDescription(), entrylist.size()));
        }
    } else {
        result.setResultText(noData);
        result.setResultExcelText(BPResultType.NO_DATA.getDescription());
        result.setResultType(BPResultType.NO_DATA);
    }
    result.setAboutText(aboutText);
    result.setDetailTitle(detailTitle);
    result.setLearnMoreUrl(learnMoreUrl);
    result.setOverviewTitle(overviewTitle);
    result.setExportNumberOfMdataImages(String.valueOf(entrylist.size()));
    return result;
}
Also used : ImageMdataEntry(com.att.aro.core.bestpractice.pojo.ImageMdataEntry) HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) ArrayList(java.util.ArrayList) File(java.io.File) ByteSourceFile(org.apache.commons.imaging.common.bytesource.ByteSourceFile) ImageMdtaResult(com.att.aro.core.bestpractice.pojo.ImageMdtaResult) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 19 with Session

use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.

the class ImageUIComparatorImpl method getImageList.

private void getImageList() {
    String originalImageName = "";
    long orgImageSize = 0L;
    String imgExtn = "";
    for (Session session : tracedataResult.getSessionlist()) {
        for (HttpRequestResponseInfo reqResp : session.getRequestResponseInfo()) {
            if (reqResp.getDirection() == HttpDirection.RESPONSE && reqResp.getContentType() != null && reqResp.getContentType().contains("image/")) {
                originalImageName = Util.extractFullNameFromRequest(reqResp);
                if (!originalImageName.isEmpty()) {
                    File orgImage = new File(imageFolderPath + originalImageName);
                    orgImageSize = orgImage.length();
                    int pos = originalImageName.lastIndexOf(".");
                    imgExtn = originalImageName.substring(pos + 1, originalImageName.length());
                    if (orgImageSize > 0 && Util.isJPG(orgImage, imgExtn)) {
                        updateOriginalImageDimensionMap(originalImageName, imgExtn, pos, reqResp);
                    }
                }
            }
        }
    }
}
Also used : HttpRequestResponseInfo(com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo) File(java.io.File) Session(com.att.aro.core.packetanalysis.pojo.Session)

Example 20 with Session

use of com.att.aro.core.packetanalysis.pojo.Session in project VideoOptimzer by attdevsupport.

the class MultipleSimultnsConnImpl method populateAllSimultConnList.

private void populateAllSimultConnList() {
    List<Session> sessions = traceDataResult.getSessionlist();
    if (sessions == null || sessions.size() <= 0) {
        simultnsConnectionAllServersEntryList = Collections.emptyList();
        return;
    }
    List<Session> tempSessionList = new ArrayList<Session>();
    Map<String, ArrayList<Session>> distinctMap = simultnsUtil.getDistinctMap(sessions);
    for (Map.Entry<String, ArrayList<Session>> entry : distinctMap.entrySet()) {
        ArrayList<Session> tempList = entry.getValue();
        for (int iterator = 0; iterator < tempList.size(); iterator++) {
            tempSessionList.add(tempList.get(iterator));
        }
    }
    List<SessionValues> sessionValuesList = simultnsUtil.createDomainsTCPSessions(tempSessionList);
    MultipleConnectionsEntry simultnsConnEntry = simultnsUtil.getTimeMap(sessionValuesList, maxConnections, true);
    if (simultnsConnEntry != null) {
        simultnsConnectionAllServersEntryMap.put(simultnsConnEntry.getStartTimeStamp(), simultnsConnEntry);
    }
}
Also used : MultipleConnectionsEntry(com.att.aro.core.bestpractice.pojo.MultipleConnectionsEntry) ArrayList(java.util.ArrayList) TreeMap(java.util.TreeMap) Map(java.util.Map) SortedMap(java.util.SortedMap) Session(com.att.aro.core.packetanalysis.pojo.Session) SessionValues(com.att.aro.core.packetanalysis.pojo.SessionValues)

Aggregations

Session (com.att.aro.core.packetanalysis.pojo.Session)130 ArrayList (java.util.ArrayList)86 HttpRequestResponseInfo (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfo)74 BaseTest (com.att.aro.core.BaseTest)49 Test (org.junit.Test)49 PacketInfo (com.att.aro.core.packetanalysis.pojo.PacketInfo)32 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)31 InetAddress (java.net.InetAddress)26 HashMap (java.util.HashMap)19 TCPPacket (com.att.aro.core.packetreader.pojo.TCPPacket)17 HashSet (java.util.HashSet)11 TreeMap (java.util.TreeMap)11 List (java.util.List)10 Statistic (com.att.aro.core.packetanalysis.pojo.Statistic)9 File (java.io.File)9 TraceDirectoryResult (com.att.aro.core.packetanalysis.pojo.TraceDirectoryResult)8 DomainNameSystem (com.att.aro.core.packetreader.pojo.DomainNameSystem)8 BurstCollectionAnalysisData (com.att.aro.core.packetanalysis.pojo.BurstCollectionAnalysisData)7 HttpRequestResponseInfoWithSession (com.att.aro.core.packetanalysis.pojo.HttpRequestResponseInfoWithSession)7 UDPPacket (com.att.aro.core.packetreader.pojo.UDPPacket)7