private String getRegisteredName(StreamDefinition streamDefinition, String adrAppName) { for (StreamAppDefinition appDefinition : streamDefinition.getAppDefinitions()) { if (appDefinition.getName().equals(adrAppName)) { return appDefinition.getRegisteredAppName(); } } return adrAppName; }
private String getRegisteredName(StreamDefinition streamDefinition, String adrAppName) { for (StreamAppDefinition appDefinition: streamDefinition.getAppDefinitions()) { if (appDefinition.getName().equals(adrAppName)) { return appDefinition.getRegisteredAppName(); } } return adrAppName; }
if (!appDefinition.getName().equals(appDefinition.getRegisteredAppName())) { dslBuilder.append(": ").append(appDefinition.getRegisteredAppName());
@Override public String toString() { return "StreamAppDefinition [streamName=" + streamName + ", name=" + this.appDefinition.getName() + ", type=" + getApplicationType()+", registeredAppName=" + getRegisteredAppName() + ", properties=" + this.appDefinition.getProperties() + "]"; }
StreamDeployment streamDeployment = this.streamService.info(streamDefinition.getName()); for (StreamAppDefinition streamAppDefinition : streamDefinition.getAppDefinitions()) { final String streamAppName = streamAppDefinition.getRegisteredAppName(); final ApplicationType streamAppType = streamAppDefinition.getApplicationType(); if (appType != streamAppType) {
StreamDeployment streamDeployment = this.streamService.info(streamDefinition.getName()); for (StreamAppDefinition streamAppDefinition : streamDefinition.getAppDefinitions()) { final String streamAppName = streamAppDefinition.getRegisteredAppName(); final ApplicationType streamAppType =streamAppDefinition.getApplicationType(); if (appType != streamAppType) {
StreamAppDefinition currentApp = iterator.next(); ApplicationType type = currentApp.getApplicationType(); AppRegistration appRegistration = this.appRegistry.find(currentApp.getRegisteredAppName(), type); Assert.notNull(appRegistration, String.format("no application '%s' of type '%s' exists in the registry",
StreamAppDefinition currentApp = iterator.next(); ApplicationType type = currentApp.getApplicationType(); AppRegistration appRegistration = this.appRegistry.find(currentApp.getRegisteredAppName(), type); Assert.notNull(appRegistration, String.format("no application '%s' of type '%s' exists in the registry",
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; }
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()));
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()));
final String appName = streamAppDefinition.getRegisteredAppName(); ApplicationType applicationType = streamAppDefinition.getApplicationType(); if (!streamValidationService.isRegistered(appName, applicationType)) {
/** * 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; }