Remove deprecations from previous versions (#8628)
This commit is contained in:
@@ -306,18 +306,6 @@ public abstract class IntegrationObjectSupport implements BeanNameAware, NamedCo
|
||||
this.messageBuilderFactory = messageBuilderFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param key Integration property.
|
||||
* @param tClass the class to convert a value of Integration property.
|
||||
* @param <T> The expected type of the property.
|
||||
* @return the value of the Integration property converted to the provide type.
|
||||
* @deprecated in favor of {@link #getIntegrationProperties()}
|
||||
*/
|
||||
@Deprecated(since = "6.0")
|
||||
protected <T> T getIntegrationProperty(String key, Class<T> tClass) {
|
||||
return this.defaultConversionService.convert(this.integrationProperties.toProperties().getProperty(key), tClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return (this.beanName != null) ? getBeanDescription() : super.toString();
|
||||
|
||||
@@ -2401,292 +2401,6 @@ public abstract class BaseIntegrationFlowDefinition<B extends BaseIntegrationFlo
|
||||
return wireTap(loggerChannel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the {@code INFO}
|
||||
* logging level and {@code org.springframework.integration.handler.LoggingHandler}
|
||||
* as a default logging category.
|
||||
* <p> The full request {@link Message} will be logged.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public IntegrationFlow logAndReply() {
|
||||
return logAndReply(LoggingHandler.Level.INFO);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for provided {@link LoggingHandler.Level}
|
||||
* logging level and {@code org.springframework.integration.handler.LoggingHandler}
|
||||
* as a default logging category.
|
||||
* <p> The full request {@link Message} will be logged.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param level the {@link LoggingHandler.Level}.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public IntegrationFlow logAndReply(LoggingHandler.Level level) {
|
||||
return logAndReply(level, (String) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the provided logging category
|
||||
* and {@code INFO} logging level.
|
||||
* <p> The full request {@link Message} will be logged.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param category the logging category to use.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public IntegrationFlow logAndReply(String category) {
|
||||
return logAndReply(LoggingHandler.Level.INFO, category);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the provided
|
||||
* {@link LoggingHandler.Level} logging level and logging category.
|
||||
* <p> The full request {@link Message} will be logged.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param level the {@link LoggingHandler.Level}.
|
||||
* @param category the logging category to use.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public IntegrationFlow logAndReply(LoggingHandler.Level level, @Nullable String category) {
|
||||
return logAndReply(level, category, (Expression) null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the provided
|
||||
* {@link LoggingHandler.Level} logging level, logging category
|
||||
* and SpEL expression for the log message.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param level the {@link LoggingHandler.Level}.
|
||||
* @param category the logging category.
|
||||
* @param logExpression the SpEL expression to evaluate logger message at runtime
|
||||
* against the request {@link Message}.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public IntegrationFlow logAndReply(LoggingHandler.Level level, String category, String logExpression) {
|
||||
Assert.hasText(logExpression, "'logExpression' must not be empty");
|
||||
return logAndReply(level, category, PARSER.parseExpression(logExpression));
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the {@code INFO} logging level,
|
||||
* the {@code org.springframework.integration.handler.LoggingHandler}
|
||||
* as a default logging category and {@link Function} for the log message.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param function the function to evaluate logger message at runtime
|
||||
* @param <P> the expected payload type.
|
||||
* against the request {@link Message}.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public <P> IntegrationFlow logAndReply(Function<Message<P>, Object> function) {
|
||||
Assert.notNull(function, FUNCTION_MUST_NOT_BE_NULL);
|
||||
return logAndReply(new FunctionExpression<>(function));
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the {@code INFO} logging level,
|
||||
* the {@code org.springframework.integration.handler.LoggingHandler}
|
||||
* as a default logging category and SpEL expression to evaluate
|
||||
* logger message at runtime against the request {@link Message}.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param logExpression the {@link Expression} to evaluate logger message at runtime
|
||||
* against the request {@link Message}.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public IntegrationFlow logAndReply(Expression logExpression) {
|
||||
return logAndReply(LoggingHandler.Level.INFO, logExpression);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the provided
|
||||
* {@link LoggingHandler.Level} logging level,
|
||||
* the {@code org.springframework.integration.handler.LoggingHandler}
|
||||
* as a default logging category and SpEL expression to evaluate
|
||||
* logger message at runtime against the request {@link Message}.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param level the {@link LoggingHandler.Level}.
|
||||
* @param logExpression the {@link Expression} to evaluate logger message at runtime
|
||||
* against the request {@link Message}.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public IntegrationFlow logAndReply(LoggingHandler.Level level, Expression logExpression) {
|
||||
return logAndReply(level, null, logExpression);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the {@code INFO}
|
||||
* {@link LoggingHandler.Level} logging level,
|
||||
* the provided logging category and SpEL expression to evaluate
|
||||
* logger message at runtime against the request {@link Message}.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param category the logging category.
|
||||
* @param logExpression the {@link Expression} to evaluate logger message at runtime
|
||||
* against the request {@link Message}.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public IntegrationFlow logAndReply(String category, Expression logExpression) {
|
||||
return logAndReply(LoggingHandler.Level.INFO, category, logExpression);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the provided
|
||||
* {@link LoggingHandler.Level} logging level,
|
||||
* the {@code org.springframework.integration.handler.LoggingHandler}
|
||||
* as a default logging category and {@link Function} for the log message.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param level the {@link LoggingHandler.Level}.
|
||||
* @param function the function to evaluate logger message at runtime
|
||||
* @param <P> the expected payload type.
|
||||
* against the request {@link Message}.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public <P> IntegrationFlow logAndReply(LoggingHandler.Level level, Function<Message<P>, Object> function) {
|
||||
return logAndReply(level, null, function);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the provided
|
||||
* {@link LoggingHandler.Level} logging level,
|
||||
* the provided logging category and {@link Function} for the log message.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param category the logging category.
|
||||
* @param function the function to evaluate logger message at runtime
|
||||
* @param <P> the expected payload type.
|
||||
* against the request {@link Message}.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public <P> IntegrationFlow logAndReply(String category, Function<Message<P>, Object> function) {
|
||||
return logAndReply(LoggingHandler.Level.INFO, category, function);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the provided
|
||||
* {@link LoggingHandler.Level} logging level, logging category
|
||||
* and {@link Function} for the log message.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param level the {@link LoggingHandler.Level}.
|
||||
* @param category the logging category.
|
||||
* @param function the function to evaluate logger message at runtime
|
||||
* @param <P> the expected payload type.
|
||||
* against the request {@link Message}.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public <P> IntegrationFlow logAndReply(LoggingHandler.Level level, @Nullable String category,
|
||||
Function<Message<P>, Object> function) {
|
||||
|
||||
Assert.notNull(function, FUNCTION_MUST_NOT_BE_NULL);
|
||||
return logAndReply(level, category, new FunctionExpression<>(function));
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link WireTap} for the {@link #currentMessageChannel}
|
||||
* with the {@link LoggingHandler} subscriber for the provided
|
||||
* {@link LoggingHandler.Level} logging level, logging category
|
||||
* and SpEL expression for the log message.
|
||||
* <p> A {@link #bridge()} is added after this operator to make the flow reply-producing
|
||||
* if the {@code replyChannel} header is present.
|
||||
* <p> This operator can be used only in the end of flow.
|
||||
* @param level the {@link LoggingHandler.Level}.
|
||||
* @param category the logging category.
|
||||
* @param logExpression the {@link Expression} to evaluate logger message at runtime
|
||||
* against the request {@link Message}.
|
||||
* @return an {@link IntegrationFlow} instance based on this builder.
|
||||
* @deprecated since 6.0 in favor of {@link #log} in the end of flow.
|
||||
* @see #log()
|
||||
* @see #bridge()
|
||||
*/
|
||||
@Deprecated
|
||||
public IntegrationFlow logAndReply(LoggingHandler.Level level, @Nullable String category,
|
||||
@Nullable Expression logExpression) {
|
||||
|
||||
return log(level, category, logExpression)
|
||||
.bridge()
|
||||
.get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate a {@link ScatterGatherHandler} to the current integration flow position
|
||||
* based on the provided {@link MessageChannel} for scattering function
|
||||
|
||||
@@ -69,16 +69,6 @@ public abstract class IntegrationComponentSpec<S extends IntegrationComponentSpe
|
||||
return this.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the configured component.
|
||||
* @deprecated since 6.1 with no-op for end-user:
|
||||
* the {@link #getObject()} is called by the framework at the appropriate phase.
|
||||
*/
|
||||
@Deprecated(since = "6.1", forRemoval = true)
|
||||
public T get() {
|
||||
return getObject();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getObjectType() {
|
||||
return getObject().getClass();
|
||||
|
||||
@@ -1,289 +0,0 @@
|
||||
/*
|
||||
* Copyright 2016-2022 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.reactivestreams.Publisher;
|
||||
|
||||
import org.springframework.integration.channel.DirectChannel;
|
||||
import org.springframework.integration.channel.FluxMessageChannel;
|
||||
import org.springframework.integration.core.MessageSource;
|
||||
import org.springframework.integration.endpoint.MessageProducerSupport;
|
||||
import org.springframework.integration.gateway.MessagingGatewaySupport;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
|
||||
/**
|
||||
* The central factory for fluent {@link IntegrationFlowBuilder} API.
|
||||
*
|
||||
* @author Artem Bilan
|
||||
* @author Gary Russell
|
||||
* @author Oleg Zhurakousky
|
||||
*
|
||||
* @since 5.0
|
||||
*
|
||||
* @see org.springframework.integration.dsl.context.IntegrationFlowBeanPostProcessor
|
||||
*
|
||||
* @deprecated since version 6.0 in favor of fluent API methods straight from {@link IntegrationFlow} interface.
|
||||
*/
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
public final class IntegrationFlows {
|
||||
|
||||
/**
|
||||
* Populate the {@link MessageChannel} name to the new {@link IntegrationFlowBuilder} chain.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}.
|
||||
* @param messageChannelName the name of existing {@link MessageChannel} bean.
|
||||
* The new {@link DirectChannel} bean will be created on context startup
|
||||
* if there is no bean with this name.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(String messageChannelName) {
|
||||
return IntegrationFlow.from(messageChannelName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the {@link MessageChannel} name to the new {@link IntegrationFlowBuilder} chain.
|
||||
* Typically for the {@link org.springframework.integration.channel.FixedSubscriberChannel} together
|
||||
* with {@code fixedSubscriber = true}.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}.
|
||||
* @param messageChannelName the name for {@link DirectChannel} or
|
||||
* {@link org.springframework.integration.channel.FixedSubscriberChannel}
|
||||
* to be created on context startup, not reference.
|
||||
* The {@link MessageChannel} depends on the {@code fixedSubscriber} boolean argument.
|
||||
* @param fixedSubscriber the boolean flag to determine if result {@link MessageChannel} should
|
||||
* be {@link DirectChannel}, if {@code false} or
|
||||
* {@link org.springframework.integration.channel.FixedSubscriberChannel}, if {@code true}.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @see DirectChannel
|
||||
* @see org.springframework.integration.channel.FixedSubscriberChannel
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(String messageChannelName, boolean fixedSubscriber) {
|
||||
return IntegrationFlow.from(messageChannelName, fixedSubscriber);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the {@link MessageChannel} object to the
|
||||
* {@link IntegrationFlowBuilder} chain using the fluent API from {@link MessageChannelSpec}.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}.
|
||||
* @param messageChannelSpec the MessageChannelSpec to populate {@link MessageChannel} instance.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @see org.springframework.integration.dsl.MessageChannels
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(MessageChannelSpec<?, ?> messageChannelSpec) {
|
||||
return IntegrationFlow.from(messageChannelSpec);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the provided {@link MessageChannel} object to the {@link IntegrationFlowBuilder} chain.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code inputChannel}.
|
||||
* @param messageChannel the {@link MessageChannel} to populate.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(MessageChannel messageChannel) {
|
||||
return IntegrationFlow.from(messageChannel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the {@link MessageSource} object to the {@link IntegrationFlowBuilder} chain
|
||||
* using the fluent API from the provided {@link MessageSourceSpec}.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code startMessageSource}.
|
||||
* @param messageSourceSpec the {@link MessageSourceSpec} to use.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @see MessageSourceSpec and its implementations.
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec) {
|
||||
return IntegrationFlow.from(messageSourceSpec);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the {@link MessageSource} object to the {@link IntegrationFlowBuilder} chain
|
||||
* using the fluent API from the provided {@link MessageSourceSpec}.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code startMessageSource}.
|
||||
* @param messageSourceSpec the {@link MessageSourceSpec} to use.
|
||||
* @param endpointConfigurer the {@link Consumer} to provide more options for the
|
||||
* {@link org.springframework.integration.config.SourcePollingChannelAdapterFactoryBean}.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @see MessageSourceSpec
|
||||
* @see SourcePollingChannelAdapterSpec
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(MessageSourceSpec<?, ? extends MessageSource<?>> messageSourceSpec,
|
||||
Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) {
|
||||
return IntegrationFlow.from(messageSourceSpec, endpointConfigurer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides {@link Supplier} as source of messages to the integration flow which will
|
||||
* be triggered by the application context's default poller (which must be declared).
|
||||
* @param messageSource the {@link Supplier} to populate.
|
||||
* @param <T> the supplier type.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @see Supplier
|
||||
*/
|
||||
public static <T> IntegrationFlowBuilder fromSupplier(Supplier<T> messageSource) {
|
||||
return IntegrationFlow.fromSupplier(messageSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides {@link Supplier} as source of messages to the integration flow.
|
||||
* which will be triggered by a <b>provided</b>
|
||||
* {@link org.springframework.integration.endpoint.SourcePollingChannelAdapter}.
|
||||
* @param messageSource the {@link Supplier} to populate.
|
||||
* @param endpointConfigurer the {@link Consumer} to provide more options for the
|
||||
* {@link org.springframework.integration.config.SourcePollingChannelAdapterFactoryBean}.
|
||||
* @param <T> the supplier type.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @see Supplier
|
||||
*/
|
||||
public static <T> IntegrationFlowBuilder fromSupplier(Supplier<T> messageSource,
|
||||
Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) {
|
||||
return IntegrationFlow.fromSupplier(messageSource, endpointConfigurer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the provided {@link MessageSource} object to the {@link IntegrationFlowBuilder} chain.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code startMessageSource}.
|
||||
* @param messageSource the {@link MessageSource} to populate.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @see MessageSource
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(MessageSource<?> messageSource) {
|
||||
return IntegrationFlow.from(messageSource);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the provided {@link MessageSource} object to the {@link IntegrationFlowBuilder} chain.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code startMessageSource}.
|
||||
* In addition use {@link SourcePollingChannelAdapterSpec} to provide options for the underlying
|
||||
* {@link org.springframework.integration.endpoint.SourcePollingChannelAdapter} endpoint.
|
||||
* @param messageSource the {@link MessageSource} to populate.
|
||||
* @param endpointConfigurer the {@link Consumer} to provide more options for the
|
||||
* {@link org.springframework.integration.config.SourcePollingChannelAdapterFactoryBean}.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @see MessageSource
|
||||
* @see SourcePollingChannelAdapterSpec
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(MessageSource<?> messageSource,
|
||||
@Nullable Consumer<SourcePollingChannelAdapterSpec> endpointConfigurer) {
|
||||
return IntegrationFlow.from(messageSource, endpointConfigurer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the {@link MessageProducerSupport} object to the {@link IntegrationFlowBuilder} chain
|
||||
* using the fluent API from the {@link MessageProducerSpec}.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code startMessageProducer}.
|
||||
* @param messageProducerSpec the {@link MessageProducerSpec} to use.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @see MessageProducerSpec
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(MessageProducerSpec<?, ?> messageProducerSpec) {
|
||||
return IntegrationFlow.from(messageProducerSpec);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the provided {@link MessageProducerSupport} object to the {@link IntegrationFlowBuilder} chain.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code startMessageProducer}.
|
||||
* @param messageProducer the {@link MessageProducerSupport} to populate.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(MessageProducerSupport messageProducer) {
|
||||
return IntegrationFlow.from(messageProducer);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the {@link MessagingGatewaySupport} object to the {@link IntegrationFlowBuilder} chain
|
||||
* using the fluent API from the {@link MessagingGatewaySpec}.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code startMessagingGateway}.
|
||||
* @param inboundGatewaySpec the {@link MessagingGatewaySpec} to use.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(MessagingGatewaySpec<?, ?> inboundGatewaySpec) {
|
||||
return IntegrationFlow.from(inboundGatewaySpec);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the provided {@link MessagingGatewaySupport} object to the {@link IntegrationFlowBuilder} chain.
|
||||
* The {@link org.springframework.integration.dsl.IntegrationFlow} {@code startMessageProducer}.
|
||||
* @param inboundGateway the {@link MessagingGatewaySupport} to populate.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(MessagingGatewaySupport inboundGateway) {
|
||||
return IntegrationFlow.from(inboundGateway);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the {@link MessageChannel} to the new {@link IntegrationFlowBuilder}
|
||||
* chain, which becomes as a {@code requestChannel} for the Messaging Gateway(s) built
|
||||
* on the provided service interface.
|
||||
* <p>A gateway proxy bean for provided service interface is registered under a name
|
||||
* from the
|
||||
* {@link org.springframework.integration.annotation.MessagingGateway#name()} if present
|
||||
* or from the {@link IntegrationFlow} bean name plus {@code .gateway} suffix.
|
||||
* @param serviceInterface the service interface class with an optional
|
||||
* {@link org.springframework.integration.annotation.MessagingGateway} annotation.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(Class<?> serviceInterface) {
|
||||
return IntegrationFlow.from(serviceInterface);
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate the {@link MessageChannel} to the new {@link IntegrationFlowBuilder}
|
||||
* chain, which becomes as a {@code requestChannel} for the Messaging Gateway(s) built
|
||||
* on the provided service interface.
|
||||
* <p>A gateway proxy bean for provided service interface is based on the options
|
||||
* configured via provided {@link Consumer}.
|
||||
* @param serviceInterface the service interface class with an optional
|
||||
* {@link org.springframework.integration.annotation.MessagingGateway} annotation.
|
||||
* @param endpointConfigurer the {@link Consumer} to configure proxy bean for gateway.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @since 5.2
|
||||
*/
|
||||
public static IntegrationFlowBuilder from(Class<?> serviceInterface,
|
||||
@Nullable Consumer<GatewayProxySpec> endpointConfigurer) {
|
||||
return IntegrationFlow.from(serviceInterface, endpointConfigurer);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Populate a {@link FluxMessageChannel} to the {@link IntegrationFlowBuilder} chain
|
||||
* and subscribe it to the provided {@link Publisher}.
|
||||
* @param publisher the {@link Publisher} to subscribe to.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
*/
|
||||
@SuppressWarnings("overloads")
|
||||
public static IntegrationFlowBuilder from(Publisher<? extends Message<?>> publisher) {
|
||||
return IntegrationFlow.from(publisher);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start the flow with a composition from the {@link IntegrationFlow}.
|
||||
* @param other the {@link IntegrationFlow} from which to compose.
|
||||
* @return new {@link IntegrationFlowBuilder}.
|
||||
* @since 5.5.4
|
||||
*/
|
||||
@SuppressWarnings("overloads")
|
||||
public static IntegrationFlowBuilder from(IntegrationFlow other) {
|
||||
return IntegrationFlow.from(other);
|
||||
}
|
||||
|
||||
private IntegrationFlows() {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 the original author or authors.
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,9 +17,7 @@
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.TimeZone;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.scheduling.Trigger;
|
||||
|
||||
@@ -79,19 +77,6 @@ public final class PollerFactory {
|
||||
return Pollers.fixedRate(period);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed rate period and {@link TimeUnit}.
|
||||
* @param period the fixed rate period to use.
|
||||
* @param timeUnit the {@link TimeUnit} to use.
|
||||
* @return the {@link PollerSpec}
|
||||
* @deprecated since 6.1 in favor of {@link #fixedRate(Duration)}
|
||||
* @see Pollers#fixedRate(Duration)
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public PollerSpec fixedRate(long period, TimeUnit timeUnit) {
|
||||
return Pollers.fixedRate(Duration.of(period, timeUnit.toChronoUnit()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed rate period.
|
||||
* @param period the fixed rate period to use.
|
||||
@@ -126,51 +111,6 @@ public final class PollerFactory {
|
||||
return Pollers.fixedRate(period, initialDelay);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed rate period and {@link TimeUnit}
|
||||
* with an initial delay.
|
||||
* @param period the fixed rate period to use.
|
||||
* @param timeUnit the {@link TimeUnit} to use.
|
||||
* @param initialDelay the initial delay to use.
|
||||
* @return the {@link PollerSpec}
|
||||
* @deprecated since 6.1 in favor of {@link #fixedRate(Duration, Duration)}
|
||||
* @see Pollers#fixedRate(Duration, Duration)
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public PollerSpec fixedRate(long period, TimeUnit timeUnit, long initialDelay) {
|
||||
ChronoUnit chronoUnit = timeUnit.toChronoUnit();
|
||||
return Pollers.fixedRate(Duration.of(period, chronoUnit), Duration.of(initialDelay, chronoUnit));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed delay period and {@link TimeUnit}
|
||||
* with an initial delay.
|
||||
* @param period the fixed delay period to use.
|
||||
* @param timeUnit the {@link TimeUnit} to use.
|
||||
* @param initialDelay the initial delay to use.
|
||||
* @return the {@link PollerSpec}
|
||||
* @deprecated since 6.1 in favor of {@link #fixedDelay(Duration, Duration)}
|
||||
* @see Pollers#fixedDelay(Duration, Duration)
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public PollerSpec fixedDelay(long period, TimeUnit timeUnit, long initialDelay) {
|
||||
ChronoUnit chronoUnit = timeUnit.toChronoUnit();
|
||||
return Pollers.fixedDelay(Duration.of(period, chronoUnit), Duration.of(initialDelay, chronoUnit));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed delay period and {@link TimeUnit}.
|
||||
* @param period the fixed delay period to use.
|
||||
* @param timeUnit the {@link TimeUnit} to use.
|
||||
* @return the {@link PollerSpec}
|
||||
* @deprecated since 6.1 in favor of {@link #fixedDelay(Duration)}
|
||||
* @see Pollers#fixedDelay(Duration)
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public PollerSpec fixedDelay(long period, TimeUnit timeUnit) {
|
||||
return Pollers.fixedDelay(Duration.of(period, timeUnit.toChronoUnit()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed delay period and initial delay.
|
||||
* @param period the fixed delay period (in milliseconds) to use.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 the original author or authors.
|
||||
* Copyright 2016-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,9 +17,7 @@
|
||||
package org.springframework.integration.dsl;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.TimeZone;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.scheduling.Trigger;
|
||||
@@ -62,21 +60,6 @@ public final class Pollers {
|
||||
return periodicTrigger(period, true, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed rate period.
|
||||
* The "fixed rate" means that periodic interval should be measured between the
|
||||
* scheduled start times rather than between actual completion times.
|
||||
* @param period the fixed rate period to use.
|
||||
* @param timeUnit the {@link TimeUnit} to use.
|
||||
* @return the {@link PollerSpec}
|
||||
* @deprecated since 6.0 in favor of {@link #fixedRate(Duration)}
|
||||
* @see PeriodicTrigger
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static PollerSpec fixedRate(long period, TimeUnit timeUnit) {
|
||||
return fixedRate(Duration.of(period, timeUnit.toChronoUnit()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed rate period
|
||||
* and initial delay.
|
||||
@@ -105,24 +88,6 @@ public final class Pollers {
|
||||
return fixedRate(Duration.ofMillis(period), Duration.ofMillis(initialDelay));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed rate period
|
||||
* and initial delay.
|
||||
* The "fixed rate" means that periodic interval should be measured between the
|
||||
* scheduled start times rather than between actual completion times.
|
||||
* @param period the fixed rate period to use.
|
||||
* @param timeUnit the {@link TimeUnit} to use.
|
||||
* @param initialDelay the initial delay to use.
|
||||
* @return the {@link PollerSpec}
|
||||
* @deprecated since 6.0 in favor of {@link #fixedRate(Duration, Duration)}
|
||||
* @see PeriodicTrigger
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static PollerSpec fixedRate(long period, TimeUnit timeUnit, long initialDelay) {
|
||||
ChronoUnit chronoUnit = timeUnit.toChronoUnit();
|
||||
return fixedRate(Duration.of(period, chronoUnit), Duration.of(initialDelay, chronoUnit));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed delay period.
|
||||
* The "fixed delay" means that periodic interval should be measured between the
|
||||
@@ -160,21 +125,6 @@ public final class Pollers {
|
||||
return periodicTrigger(period, false, initialDelay);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed delay period.
|
||||
* The "fixed delay" means that periodic interval should be measured between the
|
||||
* scheduled tasks actual completion times.
|
||||
* @param period the fixed delay period to use.
|
||||
* @param timeUnit the {@link TimeUnit} to use.
|
||||
* @return the {@link PollerSpec}
|
||||
* @deprecated since 6.0 in favor of {@link #fixedDelay(Duration)}
|
||||
* @see PeriodicTrigger
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static PollerSpec fixedDelay(long period, TimeUnit timeUnit) {
|
||||
return fixedDelay(Duration.of(period, timeUnit.toChronoUnit()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed delay period and initial delay.
|
||||
* The "fixed delay" means that periodic interval should be measured between the
|
||||
@@ -188,24 +138,6 @@ public final class Pollers {
|
||||
return fixedDelay(Duration.ofMillis(period), Duration.ofMillis(initialDelay));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link PollerSpec} based on the provided fixed delay period
|
||||
* and initial delay.
|
||||
* The "fixed delay" means that periodic interval should be measured between the
|
||||
* scheduled tasks actual completion times.
|
||||
* @param period the fixed delay period to use.
|
||||
* @param timeUnit the {@link TimeUnit} to use.
|
||||
* @param initialDelay the initial delay to use.
|
||||
* @return the {@link PollerSpec}
|
||||
* @deprecated since 6.0 in favor of {@link #fixedDelay(Duration, Duration)}
|
||||
* @see PeriodicTrigger
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static PollerSpec fixedDelay(long period, TimeUnit timeUnit, long initialDelay) {
|
||||
ChronoUnit chronoUnit = timeUnit.toChronoUnit();
|
||||
return fixedDelay(Duration.of(period, chronoUnit), Duration.of(initialDelay, chronoUnit));
|
||||
}
|
||||
|
||||
private static PollerSpec periodicTrigger(Duration period, boolean fixedRate, @Nullable Duration initialDelay) {
|
||||
PeriodicTrigger periodicTrigger = new PeriodicTrigger(period);
|
||||
periodicTrigger.setFixedRate(fixedRate);
|
||||
|
||||
@@ -109,22 +109,6 @@ public class RouterSpec<K, R extends AbstractMappingMessageRouter> extends Abstr
|
||||
return _this();
|
||||
}
|
||||
|
||||
/**
|
||||
* By default, if a resolved channel key does not exist in the channel map, the key
|
||||
* itself is used as the channel name, which we will attempt to resolve to a channel.
|
||||
* Invoke this method to disable this feature. This could be useful to prevent
|
||||
* malicious actors from generating a message that could cause the message to be
|
||||
* routed to an unexpected channel, such as one upstream of the router, which would
|
||||
* cause a stack overflow.
|
||||
* @return the router spec.
|
||||
* @since 5.2
|
||||
* @deprecated since 6.0 in favor of {@link #channelKeyFallback(boolean)}
|
||||
*/
|
||||
@Deprecated(since = "6.0", forRemoval = true)
|
||||
public RouterSpec<K, R> noChannelKeyFallback() {
|
||||
return channelKeyFallback(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* When true (default), if a resolved channel key does not exist in the channel map,
|
||||
* the key itself is used as the channel name, which we will attempt to resolve to a
|
||||
|
||||
@@ -55,9 +55,9 @@ public class AvroTestClass1 extends org.apache.avro.specific.SpecificRecordBase
|
||||
return DECODER.decode(b);
|
||||
}
|
||||
|
||||
@Deprecated public java.lang.String bar;
|
||||
public java.lang.String bar;
|
||||
|
||||
@Deprecated public java.lang.String qux;
|
||||
public java.lang.String qux;
|
||||
|
||||
/**
|
||||
* Default constructor. Note that this does not initialize fields
|
||||
|
||||
@@ -55,9 +55,9 @@ public class AvroTestClass2 extends org.apache.avro.specific.SpecificRecordBase
|
||||
return DECODER.decode(b);
|
||||
}
|
||||
|
||||
@Deprecated public java.lang.String bar;
|
||||
public java.lang.String bar;
|
||||
|
||||
@Deprecated public java.lang.String qux;
|
||||
public java.lang.String qux;
|
||||
|
||||
/**
|
||||
* Default constructor. Note that this does not initialize fields
|
||||
|
||||
@@ -642,7 +642,7 @@ private static final long serialVersionUID = 0L;
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
@java.lang.Deprecated public static final com.google.protobuf.Parser<TestClass1>
|
||||
public static final com.google.protobuf.Parser<TestClass1>
|
||||
PARSER = new com.google.protobuf.AbstractParser<TestClass1>() {
|
||||
@java.lang.Override
|
||||
public TestClass1 parsePartialFrom(
|
||||
@@ -668,4 +668,3 @@ private static final long serialVersionUID = 0L;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -642,7 +642,7 @@ private static final long serialVersionUID = 0L;
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
@java.lang.Deprecated public static final com.google.protobuf.Parser<TestClass2>
|
||||
public static final com.google.protobuf.Parser<TestClass2>
|
||||
PARSER = new com.google.protobuf.AbstractParser<TestClass2>() {
|
||||
@java.lang.Override
|
||||
public TestClass2 parsePartialFrom(
|
||||
@@ -668,4 +668,3 @@ private static final long serialVersionUID = 0L;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user