/** * Fluent API method to set the name of the stream. * @param name - The unique identifier of a Stream with the server * @return A {@link Stream.StreamNameBuilder} that provides the next navigation step in the DSL. */ public Stream.StreamNameBuilder name(String name) { return new Stream.StreamNameBuilder(name, dataFlowOperations); }
/** * Creates the Stream. This method will invoke the remote server and create a stream * @return StreamDefinition to allow deploying operations on the created Stream */ private StreamDefinition create() { return new StreamDefinition(this.name, this.client, this.definition, this.applications); }
/** * Fluent API method to create a {@link StreamBuilder}. * @param client {@link DataFlowOperations} client instance * @return A fluent style builder to create streams */ public static StreamBuilder builder(DataFlowOperations client) { return new StreamBuilder(client); }
private boolean contains(StreamApplication application) { for (StreamApplication app : this.applications) { if (app.getType().equals(application.getType()) && app.getIdentity().equals(application.getIdentity())) { return true; } } return false; } }
/** * Appends a {@link StreamApplication} as a processor for this stream * @param processor - The {@link StreamApplication} being added * @return a {@link ProcessorBuilder} to continue the building of the Stream */ public ProcessorBuilder processor(StreamApplication processor) { Assert.notNull(processor, "Processor application can't be null"); return new ProcessorBuilder( processor.type(StreamApplication.ApplicationType.PROCESSOR), this.parent); }
/** * Appends a {@link StreamApplication} as a sink for this stream * @param sink - The {@link StreamApplication} being added * @return a {@link SinkBuilder} to continue the building of the Stream */ public SinkBuilder sink(StreamApplication sink) { Assert.notNull(sink, "Sink application can't be null"); return new SinkBuilder(sink.type(StreamApplication.ApplicationType.SINK), this.parent); } }
/** * Appends a {@link StreamApplication} as a source for this stream * @param source - The {@link StreamApplication} being added * @return a {@link SourceBuilder} to continue the building of the Stream */ public SourceBuilder source(StreamApplication source) { Assert.notNull(source, "Source application can't be null"); return new SourceBuilder( source.type(StreamApplication.ApplicationType.SOURCE), this); }
/** * Deploy the current stream without any extra properties * @return A deployed {@link Stream} */ public Stream deploy() { return deploy(null); }
@Override public String toString() { return getDefinition(); }
private boolean contains(StreamApplication application) { for (StreamApplication app : this.applications) { if (app.getType().equals(application.getType()) && app.getIdentity().equals(application.getIdentity())) { return true; } } return false; } }
/** * Appends a {@link StreamApplication} as a processor for this stream * @param processor - The {@link StreamApplication} being added * @return a {@link ProcessorBuilder} to continue the building of the Stream */ public ProcessorBuilder processor(StreamApplication processor) { Assert.notNull(processor, "Processor application can't be null"); return new ProcessorBuilder( processor.type(StreamApplication.ApplicationType.PROCESSOR), this.parent); } /**
/** * Appends a {@link StreamApplication} as a sink for this stream * @param sink - The {@link StreamApplication} being added * @return a {@link SinkBuilder} to continue the building of the Stream */ public SinkBuilder sink(StreamApplication sink) { Assert.notNull(sink, "Sink application can't be null"); return new SinkBuilder(sink.type(StreamApplication.ApplicationType.SINK), this.parent); }
/** * Appends a {@link StreamApplication} as a source for this stream * @param source - The {@link StreamApplication} being added * @return a {@link SourceBuilder} to continue the building of the Stream */ public SourceBuilder source(StreamApplication source) { Assert.notNull(source, "Source application can't be null"); return new SourceBuilder( source.type(StreamApplication.ApplicationType.SOURCE), this); }
/** * Fluent API method to set the name of the stream. * @param name - The unique identifier of a Stream with the server * @return A {@link Stream.StreamNameBuilder} that provides the next navigation step in the DSL. */ public Stream.StreamNameBuilder name(String name) { return new Stream.StreamNameBuilder(name, dataFlowOperations); }
/** * Creates the Stream. This method will invoke the remote server and create a stream * @return StreamDefinition to allow deploying operations on the created Stream */ private StreamDefinition create() { return new StreamDefinition(this.name, this.client, this.definition, this.applications); }
/** * Fluent API method to create a {@link StreamBuilder}. * @param client {@link DataFlowOperations} client instance * @return A fluent style builder to create streams */ public static StreamBuilder builder(DataFlowOperations client) { return new StreamBuilder(client); }
/** * Deploy the current stream without any extra properties * @return A deployed {@link Stream} */ public Stream deploy() { return deploy(null); }
/** * Appends a {@link StreamApplication} as a processor for this stream * @param processor - The {@link StreamApplication} being added * @return a {@link ProcessorBuilder} to continue the building of the Stream */ public ProcessorBuilder processor(StreamApplication processor) { Assert.notNull(processor, "Processor application can't be null"); return new ProcessorBuilder( processor.type(StreamApplication.ApplicationType.PROCESSOR), this.parent); } /**
/** * Appends a {@link StreamApplication} as a sink for this stream * @param sink - The {@link StreamApplication} being added * @return a {@link SinkBuilder} to continue the building of the Stream */ public SinkBuilder sink(StreamApplication sink) { Assert.notNull(sink, "Sink application can't be null"); return new SinkBuilder(sink.type(StreamApplication.ApplicationType.SINK), this.parent); } }
/** * Appends a {@link StreamApplication} as a processor for this stream * @param processor - The {@link StreamApplication} being added * @return a {@link ProcessorBuilder} to continue the building of the Stream */ public ProcessorBuilder processor(StreamApplication processor) { Assert.notNull(processor, "Processor application can't be null"); return new ProcessorBuilder( processor.type(StreamApplication.ApplicationType.PROCESSOR), this.parent); }