Codota Logo
StreamAppDefinition$Builder.build
Code IndexAdd Codota to your IDE (free)

How to use
build
method
in
org.springframework.cloud.dataflow.core.StreamAppDefinition$Builder

Best Java code snippets using org.springframework.cloud.dataflow.core.StreamAppDefinition$Builder.build (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: org.springframework.cloud/spring-cloud-dataflow-rest-resource

/**
 * Redacts sensitive property values in a stream.
 *
 * @param streamDefinition the stream definition to sanitize
 * @return Stream definition text that has sensitive data redacted.
 */
public String sanitizeStream(StreamDefinition streamDefinition) {
  List<StreamAppDefinition> sanitizedAppDefinitions = streamDefinition.getAppDefinitions().stream()
      .map(app -> StreamAppDefinition.Builder
          .from(app)
          .setProperties(this.sanitizeProperties(app.getProperties()))
          .build(streamDefinition.getName())
      ).collect(Collectors.toList());
  return this.streamDslConverter.toDsl(sanitizedAppDefinitions);
}
origin: spring-cloud/spring-cloud-dataflow

/**
 * Redacts sensitive property values in a stream.
 *
 * @param streamDefinition the stream definition to sanitize
 * @return Stream definition text that has sensitive data redacted.
 */
public String sanitizeStream(StreamDefinition streamDefinition) {
  List<StreamAppDefinition> sanitizedAppDefinitions = streamDefinition.getAppDefinitions().stream()
      .map(app -> StreamAppDefinition.Builder
          .from(app)
          .setProperties(this.sanitizeProperties(app.getProperties()))
          .build(streamDefinition.getName())
      ).collect(Collectors.toList());
  return this.streamDslConverter.toDsl(sanitizedAppDefinitions);
}
origin: spring-cloud/spring-cloud-dataflow

private void updateStreamDefinitionFromReleaseManifest(String streamName, String releaseManifest) {
  List<SpringCloudDeployerApplicationManifest> appManifests = new SpringCloudDeployerApplicationManifestReader()
      .read(releaseManifest);
  Map<String, SpringCloudDeployerApplicationManifest> appManifestMap = new HashMap<>();
  for (SpringCloudDeployerApplicationManifest am : appManifests) {
    String name = am.getSpec().getApplicationProperties().get(DataFlowPropertyKeys.STREAM_APP_LABEL);
    appManifestMap.put(name, am);
  }
  StreamDefinition streamDefinition = this.streamDefinitionRepository.findById(streamName)
      .orElseThrow(() -> new NoSuchStreamDefinitionException(streamName));
  LinkedList<StreamAppDefinition> updatedStreamAppDefinitions = new LinkedList<>();
  for (StreamAppDefinition appDefinition : streamDefinition.getAppDefinitions()) {
    StreamAppDefinition.Builder appDefinitionBuilder = StreamAppDefinition.Builder.from(appDefinition);
    SpringCloudDeployerApplicationManifest applicationManifest = appManifestMap.get(appDefinition.getName());
    // overrides app definition properties with those from the release manifest
    appDefinitionBuilder.setProperties(applicationManifest.getSpec().getApplicationProperties());
    updatedStreamAppDefinitions.addLast(appDefinitionBuilder.build(streamDefinition.getName()));
  }
  String dslText = new StreamDefinitionToDslConverter().toDsl(updatedStreamAppDefinitions);
  StreamDefinition updatedStreamDefinition = new StreamDefinition(streamName, dslText);
  logger.debug("Updated StreamDefinition: " + updatedStreamDefinition);
  // TODO consider adding an explicit UPDATE method to the streamDefRepository
  // Note: Not transactional and can lead to loosing the stream definition
  this.streamDefinitionRepository.delete(updatedStreamDefinition);
  this.streamDefinitionRepository.save(updatedStreamDefinition);
  this.auditRecordService.populateAndSaveAuditRecord(
      AuditOperationType.STREAM, AuditActionType.UPDATE, streamName, this.auditServiceUtils.convertStreamDefinitionToAuditData(streamDefinition));
}
origin: org.springframework.cloud/spring-cloud-dataflow-server-core

private void updateStreamDefinitionFromReleaseManifest(String streamName, String releaseManifest) {
  List<SpringCloudDeployerApplicationManifest> appManifests = new SpringCloudDeployerApplicationManifestReader()
      .read(releaseManifest);
  Map<String, SpringCloudDeployerApplicationManifest> appManifestMap = new HashMap<>();
  for (SpringCloudDeployerApplicationManifest am : appManifests) {
    String name = am.getSpec().getApplicationProperties().get(DataFlowPropertyKeys.STREAM_APP_LABEL);
    appManifestMap.put(name, am);
  }
  StreamDefinition streamDefinition = this.streamDefinitionRepository.findOne(streamName);
  LinkedList<StreamAppDefinition> updatedStreamAppDefinitions = new LinkedList<>();
  for (StreamAppDefinition appDefinition : streamDefinition.getAppDefinitions()) {
    StreamAppDefinition.Builder appDefinitionBuilder = StreamAppDefinition.Builder.from(appDefinition);
    SpringCloudDeployerApplicationManifest applicationManifest = appManifestMap.get(appDefinition.getName());
    // overrides app definition properties with those from the release manifest
    appDefinitionBuilder.setProperties(applicationManifest.getSpec().getApplicationProperties());
    updatedStreamAppDefinitions.addLast(appDefinitionBuilder.build(streamDefinition.getName()));
  }
  String dslText = new StreamDefinitionToDslConverter().toDsl(updatedStreamAppDefinitions);
  StreamDefinition updatedStreamDefinition = new StreamDefinition(streamName, dslText);
  logger.debug("Updated StreamDefinition: " + updatedStreamDefinition);
  // TODO consider adding an explicit UPDATE method to the streamDefRepository
  // Note: Not transactional and can lead to loosing the stream definition
  this.streamDefinitionRepository.delete(updatedStreamDefinition);
  this.streamDefinitionRepository.save(updatedStreamDefinition);
  this.auditRecordService.populateAndSaveAuditRecord(
      AuditOperationType.STREAM, AuditActionType.UPDATE, streamName, this.auditServiceUtils.convertStreamDefinitionToAuditData(streamDefinition));
}
origin: spring-cloud/spring-cloud-dataflow

streamAppDefinitions.add(builder.build(streamName));
org.springframework.cloud.dataflow.coreStreamAppDefinition$Builderbuild

Javadoc

Return a new instance of StreamAppDefinition.

Popular methods of StreamAppDefinition$Builder

  • from
  • setProperties
  • <init>
  • addProperties
    Add the contents of the provided map to the map of app properties.
  • setApplicationType
    Set the ApplicationType for this application.
  • setLabel
    Set the app label.
  • setProperty
    Set an app property.
  • setRegisteredAppName
    Set the name of the app in the registry.
  • setStreamName
    Set the stream name this app belongs to.

Popular in Java

  • Start an intent from android
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now