private void addReportingTaskFingerprint(final StringBuilder builder, final ReportingTaskDTO dto) { builder.append(dto.getId()); builder.append(dto.getType()); builder.append(dto.getName()); addBundleFingerprint(builder, dto.getBundle()); builder.append(dto.getComments()); builder.append(dto.getSchedulingPeriod()); builder.append(dto.getSchedulingStrategy()); builder.append(dto.getAnnotationData()); // get the temp instance of the ReportingTask so that we know the default property values final BundleCoordinate coordinate = getCoordinate(dto.getType(), dto.getBundle()); final ConfigurableComponent configurableComponent = extensionManager.getTempComponent(dto.getType(), coordinate); if (configurableComponent == null) { logger.warn("Unable to get ReportingTask of type {}; its default properties will be fingerprinted instead of being ignored.", dto.getType()); } addPropertiesFingerprint(builder, configurableComponent, dto.getProperties()); }
values.put(NAME, reportingTask.getName()); if (reportingTaskDTO.getAnnotationData() != null) { values.put(ANNOTATION_DATA, reportingTask.getAnnotationData());
private ComponentDetails getComponentConfiguration(final ReportingTaskDTO reportingTask) { return new ComponentDetails.Builder() .id(reportingTask.getId()) .name(reportingTask.getName()) .type(reportingTask.getType()) .state(reportingTask.getState()) .annotationData(reportingTask.getAnnotationData()) .properties(reportingTask.getProperties()) .validateErrors(reportingTask.getValidationErrors()).build(); } }
reportingTaskDTO.getSchedulingStrategy(), reportingTaskDTO.getSchedulingPeriod(), reportingTaskDTO.getAnnotationData(), reportingTaskDTO.getProperties(), reportingTaskDTO.getBundle())) {
final String schedulingStrategy = reportingTaskDTO.getSchedulingStrategy(); final String schedulingPeriod = reportingTaskDTO.getSchedulingPeriod(); final String annotationData = reportingTaskDTO.getAnnotationData(); final String comments = reportingTaskDTO.getComments(); final Map<String, String> properties = reportingTaskDTO.getProperties();
private ReportingTaskNode getOrCreateReportingTask(final FlowController controller, final ReportingTaskDTO dto, final boolean controllerInitialized, final boolean existingFlowEmpty) throws ReportingTaskInstantiationException { // create a new reporting task node when the controller is not initialized or the flow is empty if (!controllerInitialized || existingFlowEmpty) { BundleCoordinate coordinate; try { coordinate = BundleUtils.getCompatibleBundle(extensionManager, dto.getType(), dto.getBundle()); } catch (final IllegalStateException e) { final BundleDTO bundleDTO = dto.getBundle(); if (bundleDTO == null) { coordinate = BundleCoordinate.UNKNOWN_COORDINATE; } else { coordinate = new BundleCoordinate(bundleDTO.getGroup(), bundleDTO.getArtifact(), bundleDTO.getVersion()); } } final ReportingTaskNode reportingTask = controller.createReportingTask(dto.getType(), dto.getId(), coordinate, false); reportingTask.setName(dto.getName()); reportingTask.setComments(dto.getComments()); reportingTask.setSchedulingPeriod(dto.getSchedulingPeriod()); reportingTask.setSchedulingStrategy(SchedulingStrategy.valueOf(dto.getSchedulingStrategy())); reportingTask.setAnnotationData(dto.getAnnotationData()); reportingTask.setProperties(dto.getProperties()); return reportingTask; } else { // otherwise return the existing reporting task node return controller.getReportingTaskNode(dto.getId()); } }