/** * Checks if the given timer data has a sensor type that equals {@link SensorTypeEnum#TIMER} or * {@link SensorTypeEnum#AVERAGE_TIMER}, so that a special navigation types are possible or not. * * @param timerData * {@link TimerData} to check. * @return True if given object is of a TimerData class and mentioned sensor types are * registered. False otherwise. */ private boolean isTimerSensorBounded(TimerData timerData) { if ((null == timerData) || (!timerData.getClass().equals(TimerData.class) && !timerData.getClass().equals(AggregatedTimerData.class))) { return false; } IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); if (editor instanceof AbstractRootEditor) { RepositoryDefinition repositoryDefinition = ((AbstractRootEditor) editor).getInputDefinition().getRepositoryDefinition(); SensorTypeIdent sensorTypeIdent = repositoryDefinition.getCachedDataService().getSensorTypeIdentForId(timerData.getSensorTypeIdent()); if (null != sensorTypeIdent) { SensorTypeEnum sensorTypeEnum = SensorTypeEnum.get(sensorTypeIdent.getFullyQualifiedClassName()); return (sensorTypeEnum == SensorTypeEnum.TIMER) || (sensorTypeEnum == SensorTypeEnum.AVERAGE_TIMER); } } return false; } }
@Override public void setInputDefinition(InputDefinition inputDefinition) { super.setInputDefinition(inputDefinition); cachedDataService = inputDefinition.getRepositoryDefinition().getCachedDataService(); if (0 != inputDefinition.getIdDefinition().getSensorTypeId()) { httpSensorTypeIdent = (MethodSensorTypeIdent) cachedDataService.getSensorTypeIdentForId(inputDefinition.getIdDefinition().getSensorTypeId()); String regEx = MethodSensorTypeIdentHelper.getRegEx(httpSensorTypeIdent); if (null != regEx) { try { Pattern.compile(regEx); regExEnabledInSensor = true; } catch (PatternSyntaxException e) { InspectIT.getDefault().createInfoDialog("The HTTP sensor defines the Regular expression " + regEx + " for URI transformation that can not be compiled. The transformation option will not be available.\n\n Reason: " + e.getMessage(), -1); } } } }
/** * Sets data for the {@link BreadcrumbTitleComposite}. */ private void setDataForBreadcrumbTitleComposite() { // repository breadcrumbTitleComposite.setRepositoryDefinition(repositoryDefinition); // agent PlatformIdent platformIdent = repositoryDefinition.getCachedDataService().getPlatformIdentForId(defaultData.getPlatformIdent()); if (null != platformIdent) { breadcrumbTitleComposite.setAgent(TextFormatter.getAgentDescription(platformIdent), InspectIT.getDefault().getImage(InspectITImages.IMG_AGENT)); } else { breadcrumbTitleComposite.setAgent("All Agents", InspectIT.getDefault().getImage(InspectITImages.IMG_AGENT)); } // sensor info if (0 != defaultData.getSensorTypeIdent()) { SensorTypeIdent sensorTypeIdent = repositoryDefinition.getCachedDataService().getSensorTypeIdentForId(defaultData.getSensorTypeIdent()); String fqn = sensorTypeIdent.getFullyQualifiedClassName(); SensorTypeEnum sensorTypeEnum = SensorTypeEnum.get(fqn); if (null != sensorTypeEnum) { breadcrumbTitleComposite.setGroup(sensorTypeEnum.getDisplayName(), sensorTypeEnum.getImage()); } } else if (defaultData instanceof Span) { // must be set explicitly as no sensor id is set with user spans breadcrumbTitleComposite.setGroup("Tracing SDK", null); } breadcrumbTitleComposite.setView("Details", null); }