@Override public String toString() { return "StreamAppDefinition [streamName=" + streamName + ", name=" + this.appDefinition.getName() + ", type=" + getApplicationType()+", registeredAppName=" + getRegisteredAppName() + ", properties=" + this.appDefinition.getProperties() + "]"; }
if (appDefinition.getApplicationType() != ApplicationType.app) { dslBuilder.append(" | "); } else {
for (StreamAppDefinition streamAppDefinition : streamDefinition.getAppDefinitions()) { final String streamAppName = streamAppDefinition.getRegisteredAppName(); final ApplicationType streamAppType = streamAppDefinition.getApplicationType(); if (appType != streamAppType) { continue;
for (StreamAppDefinition streamAppDefinition : streamDefinition.getAppDefinitions()) { final String streamAppName = streamAppDefinition.getRegisteredAppName(); final ApplicationType streamAppType =streamAppDefinition.getApplicationType(); if (appType != streamAppType) { continue;
CompletionProposal.Factory proposals = CompletionProposal.expanding(":" + streamName + "."); for (StreamAppDefinition streamAppDefinition : streamDefinition.getAppDefinitions()) { ApplicationType applicationType = streamAppDefinition.getApplicationType(); if (streamAppDefinition.getName().startsWith(appName) && !applicationType.equals(ApplicationType.sink)) {
while (iterator.hasNext()) { StreamAppDefinition currentApp = iterator.next(); AppRegistration appRegistration = this.appRegistry.find(currentApp.getRegisteredAppName(), currentApp.getApplicationType()); Assert.notNull(appRegistration, String.format("no application '%s' of type '%s' exists in the registry", currentApp.getName(), currentApp.getApplicationType())); streamDeploymentProperties); if (currentApp.getApplicationType() != ApplicationType.app) { if (upstreamAppSupportsPartition) { deployerDeploymentProperties.put(AppDeployer.INDEXED_PROPERTY_KEY, "true"); if (currentApp.getApplicationType() != ApplicationType.app) { isDownStreamAppPartitioned = isPartitionedConsumer(appDeployTimeProperties, upstreamAppSupportsPartition); appDeployTimeProperties.put(DataFlowPropertyKeys.STREAM_APP_TYPE, currentApp.getApplicationType().toString()); StringBuilder sb = new StringBuilder().append(currentApp.getStreamName()).append(".") .append(currentApp.getName()).append(".").append("${spring.cloud.application.guid}");
while (iterator.hasNext()) { StreamAppDefinition currentApp = iterator.next(); ApplicationType type = currentApp.getApplicationType(); AppRegistration appRegistration = this.appRegistry.find(currentApp.getRegisteredAppName(), type); Assert.notNull(appRegistration,
CompletionProposal.Factory proposals = CompletionProposal.expanding(":" + streamName + "."); for (StreamAppDefinition streamAppDefinition : streamDefinition.getAppDefinitions()) { ApplicationType applicationType = streamAppDefinition.getApplicationType(); if (streamAppDefinition.getName().startsWith(appName) && !applicationType.equals(ApplicationType.sink)) {
while (iterator.hasNext()) { StreamAppDefinition currentApp = iterator.next(); AppRegistration appRegistration = this.appRegistry.find(currentApp.getRegisteredAppName(), currentApp.getApplicationType()); Assert.notNull(appRegistration, String.format("no application '%s' of type '%s' exists in the registry", currentApp.getName(), currentApp.getApplicationType())); streamDeploymentProperties); if (currentApp.getApplicationType() != ApplicationType.app) { if (upstreamAppSupportsPartition) { deployerDeploymentProperties.put(AppDeployer.INDEXED_PROPERTY_KEY, "true"); if (currentApp.getApplicationType() != ApplicationType.app) { isDownStreamAppPartitioned = isPartitionedConsumer(appDeployTimeProperties, upstreamAppSupportsPartition); appDeployTimeProperties.put(DataFlowPropertyKeys.STREAM_APP_TYPE, currentApp.getApplicationType().toString()); StringBuilder sb = new StringBuilder().append(currentApp.getStreamName()).append(".") .append(currentApp.getName()).append(".").append("${spring.cloud.application.guid}");
while (iterator.hasNext()) { StreamAppDefinition currentApp = iterator.next(); ApplicationType type = currentApp.getApplicationType(); AppRegistration appRegistration = this.appRegistry.find(currentApp.getRegisteredAppName(), type); Assert.notNull(appRegistration,
public StreamDefinition createStream(String streamName, String dsl, boolean deploy) { StreamDefinition streamDefinition = createStreamDefinition(streamName, dsl); List<String> errorMessages = new ArrayList<>(); for (StreamAppDefinition streamAppDefinition : streamDefinition.getAppDefinitions()) { final String appName = streamAppDefinition.getRegisteredAppName(); ApplicationType applicationType = streamAppDefinition.getApplicationType(); if (!streamValidationService.isRegistered(appName, applicationType)) { errorMessages.add( String.format("Application name '%s' with type '%s' does not exist in the app registry.", appName, applicationType)); } } if (!errorMessages.isEmpty()) { throw new InvalidStreamDefinitionException( StringUtils.collectionToDelimitedString(errorMessages, "\n")); } final StreamDefinition savedStreamDefintion = this.streamDefinitionRepository.save(streamDefinition); if (deploy) { this.deployStream(streamName, new HashMap<>()); } auditRecordService.populateAndSaveAuditRecord( AuditOperationType.STREAM, AuditActionType.CREATE, streamDefinition.getName(), this.auditServiceUtils.convertStreamDefinitionToAuditData(savedStreamDefintion)); return streamDefinition; }
ApplicationType applicationType = streamAppDefinition.getApplicationType(); if (!streamValidationService.isRegistered(appName, applicationType)) { errorMessages.add(
@Override public ValidationStatus validateStream(String name) { StreamDefinition definition = streamDefinitionRepository.findById(name) .orElseThrow(() -> new NoSuchStreamDefinitionException(name)); ValidationStatus validationStatus = new ValidationStatus( definition.getName(), definition.getDslText()); for (StreamAppDefinition streamAppDefinition : definition.getAppDefinitions()) { ApplicationType appType = streamAppDefinition.getApplicationType(); boolean status = this.validate(streamAppDefinition.getName(), appType); validationStatus.getAppsStatuses().put( String.format("%s:%s", appType.name(), streamAppDefinition.getName()), (status) ? NodeStatus.valid.name() : NodeStatus.invalid.name()); } return validationStatus; } }
@Override public ValidationStatus validateStream(String name) { StreamDefinition definition = streamDefinitionRepository.findOne(name); if (definition == null) { throw new NoSuchStreamDefinitionException(name); } ValidationStatus validationStatus = new ValidationStatus( definition.getName(), definition.getDslText()); for (StreamAppDefinition streamAppDefinition : definition.getAppDefinitions()) { ApplicationType appType = streamAppDefinition.getApplicationType(); boolean status = this.validate(streamAppDefinition.getName(), appType); validationStatus.getAppsStatuses().put( String.format("%s:%s", appType.name(), streamAppDefinition.getName()), (status) ? NodeStatus.valid.name() : NodeStatus.invalid.name()); } return validationStatus; } }
/** * Create a new builder that is initialized with properties of the given * definition. Useful for "mutating" a definition by building a slightly different * copy. * * @param definition the StreamAppDefinition to create a new Builder instance with * stream name, registeredAppName, label, and properties populated * @return a StreamAppDefinition builder */ public static Builder from(StreamAppDefinition definition) { Builder builder = new Builder(); builder.setStreamName(definition.getStreamName()).setRegisteredAppName(definition.getRegisteredAppName()) .setApplicationType(definition.getApplicationType()) .setLabel(definition.getName()).addProperties(definition.getProperties()); return builder; }