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");
}
}
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);
}
}
}
};
}
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;
}
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);
}
}
}
}
}
}
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);
}
}
Aggregations