From 799802c0d1e1ec1e930798672267ed43175948cb Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 8 Apr 2022 16:05:43 -0400 Subject: [PATCH] Clean up some JavaDocs; remove deprecated API --- .../AbstractAmqpOutboundEndpoint.java | 30 +- ...alAckListenerExecutionFailedException.java | 25 +- .../aop/AbstractMessageSourceAdvice.java | 33 -- .../aop/CompoundTriggerAdvice.java | 11 +- .../SimpleActiveIdleMessageSourceAdvice.java | 83 --- .../channel/MessageChannelReactiveUtils.java | 44 -- .../config/EnableIntegrationManagement.java | 26 +- .../config/IntegrationConfigUtils.java | 9 +- .../context/IntegrationContextUtils.java | 11 +- .../dsl/BaseIntegrationFlowDefinition.java | 92 ++- .../dsl/CorrelationHandlerSpec.java | 80 +-- .../micrometer/MicrometerMetricsCaptor.java | 38 +- .../integration/util/JavaUtils.java | 177 ------ .../session/DefaultSessionFactoryLocator.java | 13 +- .../integration/ftp/dsl/Ftp.java | 27 +- .../ftp/dsl/FtpMessageHandlerSpec.java | 13 +- .../ftp/outbound/FtpMessageHandler.java | 15 +- .../http/outbound/CookieTests.java | 29 +- .../integration/jdbc/StoredProcExecutor.java | 9 +- .../jdbc/store/JdbcChannelMessageStore.java | 8 +- .../jdbc/store/JdbcMessageStore.java | 2 +- .../ChannelPublishingJmsMessageListener.java | 25 +- .../jms/JmsSendingMessageHandler.java | 24 +- .../integration/jms/JmsTimeoutException.java | 10 +- .../jms/dsl/JmsInboundGatewaySpec.java | 24 +- .../monitor/IntegrationMBeanExporter.java | 95 +-- .../integration/monitor/ManagedEndpoint.java | 63 -- .../rsocket/ClientRSocketConnector.java | 13 +- .../integration/sftp/dsl/Sftp.java | 28 +- .../sftp/dsl/SftpMessageHandlerSpec.java | 18 +- .../session/DefaultSftpSessionFactory.java | 18 +- .../sftp/session/SftpFileInfo.java | 14 +- .../integration/test/mail/TestMailServer.java | 550 ------------------ .../ws/AbstractWebServiceOutboundGateway.java | 30 +- .../WebServiceOutboundGatewayParser.java | 6 +- .../ws/config/spring-integration-ws.xsd | 25 - ...utboundGatewayInsideChainTests-context.xml | 2 +- .../ws/config/UriVariableTests-context.xml | 6 +- ...viceOutboundGatewayParserTests-context.xml | 2 +- src/reference/asciidoc/polling-consumer.adoc | 7 +- 40 files changed, 182 insertions(+), 1553 deletions(-) delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/aop/AbstractMessageSourceAdvice.java delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/aop/SimpleActiveIdleMessageSourceAdvice.java delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannelReactiveUtils.java delete mode 100644 spring-integration-core/src/main/java/org/springframework/integration/util/JavaUtils.java delete mode 100644 spring-integration-jmx/src/main/java/org/springframework/integration/monitor/ManagedEndpoint.java delete mode 100644 spring-integration-test-support/src/main/java/org/springframework/integration/test/mail/TestMailServer.java diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AbstractAmqpOutboundEndpoint.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AbstractAmqpOutboundEndpoint.java index c05211b949..fd3bf18124 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AbstractAmqpOutboundEndpoint.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/outbound/AbstractAmqpOutboundEndpoint.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2021 the original author or authors. + * 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. @@ -618,25 +618,6 @@ public abstract class AbstractAmqpOutboundEndpoint extends AbstractReplyProducin : getMessageBuilderFactory().withPayload(replyObject); } - /** - * Build Spring message object based on the provided returned AMQP message info. - * @param message the returned AMQP message - * @param replyCode the returned message reason code - * @param replyText the returned message reason text - * @param exchange the exchange the message returned from - * @param returnedRoutingKey the routing key for returned message - * @param converter the converter to deserialize body of the returned AMQP message - * @return the Spring message which represents a returned AMQP message - * @deprecated since 5.4 in favor of {@link #buildReturnedMessage(ReturnedMessage, MessageConverter)} - */ - @Deprecated - protected Message buildReturnedMessage(org.springframework.amqp.core.Message message, - int replyCode, String replyText, String exchange, String returnedRoutingKey, MessageConverter converter) { - - return buildReturnedMessage(new ReturnedMessage(message, replyCode, replyText, exchange, returnedRoutingKey), - converter); - } - protected Message buildReturnedMessage(ReturnedMessage returnedMessage, MessageConverter converter) { org.springframework.amqp.core.Message amqpMessage = returnedMessage.getMessage(); Object returnedObject = converter.fromMessage(amqpMessage); @@ -731,15 +712,6 @@ public abstract class AbstractAmqpOutboundEndpoint extends AbstractReplyProducin } } - @Override - @Deprecated - public void setReturnedMessage(org.springframework.amqp.core.Message returnedMessage) { - if (this.userData instanceof CorrelationData) { - ((CorrelationData) this.userData).setReturnedMessage(returnedMessage); - } - super.setReturnedMessage(returnedMessage); - } - @Override public void setReturned(ReturnedMessage returned) { if (this.userData instanceof CorrelationData) { diff --git a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/ManualAckListenerExecutionFailedException.java b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/ManualAckListenerExecutionFailedException.java index 74854ffc07..45211de5d7 100644 --- a/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/ManualAckListenerExecutionFailedException.java +++ b/spring-integration-amqp/src/main/java/org/springframework/integration/amqp/support/ManualAckListenerExecutionFailedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 the original author or authors. + * Copyright 2019-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. @@ -16,6 +16,8 @@ package org.springframework.integration.amqp.support; +import java.io.Serial; + import org.springframework.amqp.core.Message; import org.springframework.amqp.rabbit.support.ListenerExecutionFailedException; @@ -26,37 +28,20 @@ import com.rabbitmq.client.Channel; * Used for conversion errors when using manual acks. * * @author Gary Russell + * @author Artem Bilan * * @since 5.1.3 * */ public class ManualAckListenerExecutionFailedException extends ListenerExecutionFailedException { + @Serial private static final long serialVersionUID = 1L; private final Channel channel; private final long deliveryTag; - /** - * Construct an instance with the provided properties. - * @param msg the exception message. - * @param cause the cause. - * @param failedMessage the failed message. - * @param channel the channel. - * @param deliveryTag the delivery tag for the message. - * @deprecated in favor of - * {@link #ManualAckListenerExecutionFailedException(String, Throwable, Channel, long, Message...)}. - */ - @Deprecated - public ManualAckListenerExecutionFailedException(String msg, Throwable cause, Message failedMessage, - Channel channel, long deliveryTag) { - - super(msg, cause, failedMessage); - this.channel = channel; - this.deliveryTag = deliveryTag; - } - /** * Construct an instance with the provided properties. * @param msg the exception message. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/AbstractMessageSourceAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/AbstractMessageSourceAdvice.java deleted file mode 100644 index 049a3300f8..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/AbstractMessageSourceAdvice.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2015-2020 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.aop; - -/** - * Advice for a {@link org.springframework.integration.core.MessageSource#receive()} method to decide whether a poll - * should be ignored and/or take action after the receive. - * - * @author Gary Russell - * @author Artem Bilan - * - * @since 4.2 - * - * @deprecated since 5.3 in favor of {@link MessageSourceMutator}. - */ -@Deprecated -public abstract class AbstractMessageSourceAdvice implements MessageSourceMutator { - -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/CompoundTriggerAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/CompoundTriggerAdvice.java index 41a65ab8b8..f4c2c465c0 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/CompoundTriggerAdvice.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aop/CompoundTriggerAdvice.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2020 the original author or authors. + * Copyright 2015-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. @@ -18,7 +18,6 @@ package org.springframework.integration.aop; import org.springframework.integration.core.MessageSource; import org.springframework.integration.util.CompoundTrigger; -import org.springframework.lang.Nullable; import org.springframework.messaging.Message; import org.springframework.scheduling.Trigger; import org.springframework.util.Assert; @@ -55,17 +54,9 @@ public class CompoundTriggerAdvice * @param result the received message. * @param source the message source. * @return the message or null - * @deprecated since 5.3 in favor of {@link #afterReceive(Message, Object)} */ @Override - @Deprecated public Message afterReceive(Message result, MessageSource source) { - return afterReceive(result, (Object) source); - } - - @Override - @Nullable - public Message afterReceive(@Nullable Message result, Object source) { if (result == null) { this.compoundTrigger.setOverride(this.override); } diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/SimpleActiveIdleMessageSourceAdvice.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/SimpleActiveIdleMessageSourceAdvice.java deleted file mode 100644 index 7e468ddeb6..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/SimpleActiveIdleMessageSourceAdvice.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright 2015-2020 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.aop; - -import java.time.Duration; - -import org.springframework.integration.core.MessageSource; -import org.springframework.integration.util.DynamicPeriodicTrigger; -import org.springframework.messaging.Message; - -/** - * A simple advice that polls at one rate when messages exist and another when - * there are no messages. - * - * @author Gary Russell - * - * @since 4.2 - * - * @see DynamicPeriodicTrigger - * - * @deprecated since 5.3 in favor of {@link SimpleActiveIdleReceiveMessageAdvice} with the same - * (but more common) functionality. - */ -@Deprecated -public class SimpleActiveIdleMessageSourceAdvice extends AbstractMessageSourceAdvice { - - private final DynamicPeriodicTrigger trigger; - - private volatile Duration idlePollPeriod; - - private volatile Duration activePollPeriod; - - - public SimpleActiveIdleMessageSourceAdvice(DynamicPeriodicTrigger trigger) { - this.trigger = trigger; - this.idlePollPeriod = trigger.getDuration(); - this.activePollPeriod = trigger.getDuration(); - } - - /** - * Set the poll period when messages are not returned. Defaults to the - * trigger's period. - * @param idlePollPeriod the period in milliseconds. - */ - public void setIdlePollPeriod(long idlePollPeriod) { - this.idlePollPeriod = Duration.ofMillis(idlePollPeriod); - } - - /** - * Set the poll period when messages are returned. Defaults to the - * trigger's period. - * @param activePollPeriod the period in milliseconds. - */ - public void setActivePollPeriod(long activePollPeriod) { - this.activePollPeriod = Duration.ofMillis(activePollPeriod); - } - - @Override - public Message afterReceive(Message result, MessageSource source) { - if (result == null) { - this.trigger.setDuration(this.idlePollPeriod); - } - else { - this.trigger.setDuration(this.activePollPeriod); - } - return result; - } - -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannelReactiveUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannelReactiveUtils.java deleted file mode 100644 index 490c8e7ef5..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/channel/MessageChannelReactiveUtils.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2017-2020 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.channel; - -import org.reactivestreams.Publisher; - -import org.springframework.integration.util.IntegrationReactiveUtils; -import org.springframework.messaging.Message; -import org.springframework.messaging.MessageChannel; - -/** - * Utilities for adaptation {@link MessageChannel}s to the {@link Publisher}s. - * - * @author Artem Bilan - * - * @since 5.0 - * - * @deprecated since 5.3 in favor of {@link IntegrationReactiveUtils}. - */ -@Deprecated -public final class MessageChannelReactiveUtils { - - private MessageChannelReactiveUtils() { - } - - public static Publisher> toPublisher(MessageChannel messageChannel) { - return IntegrationReactiveUtils.messageChannelToFlux(messageChannel); - } - -} diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/EnableIntegrationManagement.java b/spring-integration-core/src/main/java/org/springframework/integration/config/EnableIntegrationManagement.java index ed4ea3dab4..a4f7a66216 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/EnableIntegrationManagement.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/EnableIntegrationManagement.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 the original author or authors. + * Copyright 2014-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. @@ -42,33 +42,19 @@ import org.springframework.integration.support.management.micrometer.MicrometerM @Import({ MicrometerMetricsCaptorImportSelector.class, IntegrationManagementConfiguration.class }) public @interface EnableIntegrationManagement { - /** - * @deprecated this property is no longer used. - * @return the patterns. - */ - @Deprecated - String[] metersEnabled() default "*"; /** - * @deprecated this property is no longer used. - * @return the value; false by default, or true when JMX is enabled. - */ - @Deprecated - String defaultCountsEnabled() default "false"; - - /** - * Use to disable all logging in the main message flow in framework components. When 'false', such logging will be - * skipped, regardless of logging level. When 'true', the logging is controlled as normal by the logging - * subsystem log level configuration. + * Use for disabling all logging in the main message flow in framework components. When 'false', + * such logging will be skipped, regardless of logging level. When 'true', + * the logging is controlled as normal by the logging subsystem log level configuration. *

* It has been found that in high-volume messaging environments, calls to methods such as * {@code logger.isDebuggingEnabled()} can be quite expensive and account for an inordinate amount of CPU * time. *

- * Set this to false to disable logging by default in all framework components that implement + * Set this to false for disabling logging by default in all framework components that implement * {@link org.springframework.integration.support.management.IntegrationManagement} - * (channels, message handlers etc). This turns off logging such as - * "PreSend on channel", "Received message" etc. + * (channels, message handlers etc). It turns off logging such as "PreSend on channel", "Received message" etc. *

* After the context is initialized, individual components can have their setting changed by invoking * {@link org.springframework.integration.support.management.IntegrationManagement#setLoggingEnabled(boolean)}. diff --git a/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationConfigUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationConfigUtils.java index c08e93eea6..117ead890d 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationConfigUtils.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/config/IntegrationConfigUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2021 the original author or authors. + * Copyright 2014-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. @@ -20,7 +20,6 @@ import org.springframework.beans.factory.support.BeanDefinitionBuilder; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.RootBeanDefinition; import org.springframework.integration.channel.DirectChannel; -import org.springframework.integration.context.IntegrationContextUtils; /** * Shared utility methods for Integration configuration. @@ -31,12 +30,6 @@ import org.springframework.integration.context.IntegrationContextUtils; */ public final class IntegrationConfigUtils { - /** - * @deprecated in favor of {@link IntegrationContextUtils#BASE_PACKAGE}. - */ - @Deprecated - public static final String BASE_PACKAGE = IntegrationContextUtils.BASE_PACKAGE; - public static final String HANDLER_ALIAS_SUFFIX = ".handler"; public static void registerSpelFunctionBean(BeanDefinitionRegistry registry, String functionId, String className, diff --git a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java index 6bfd580e82..6dbed72ce1 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/context/IntegrationContextUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-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. @@ -110,12 +110,6 @@ public abstract class IntegrationContextUtils { public static final String ARGUMENT_RESOLVER_MESSAGE_CONVERTER_BEAN_NAME = "integrationArgumentResolverMessageConverter"; - /** - * @deprecated since 5.5.7 - out of use. - */ - @Deprecated - public static final String DISPOSABLES_BEAN_NAME = "integrationDisposableAutoCreatedBeans"; - public static final String MESSAGE_HANDLER_FACTORY_BEAN_NAME = "integrationMessageHandlerMethodFactory"; public static final String LIST_MESSAGE_HANDLER_FACTORY_BEAN_NAME = "integrationListMessageHandlerMethodFactory"; @@ -209,8 +203,7 @@ public abstract class IntegrationContextUtils { propertiesToRegister.putAll(userProperties); } - if (beanFactory instanceof BeanDefinitionRegistry) { - BeanDefinitionRegistry registry = (BeanDefinitionRegistry) beanFactory; + if (beanFactory instanceof BeanDefinitionRegistry registry) { RootBeanDefinition beanDefinition = new RootBeanDefinition(Properties.class); beanDefinition.setInstanceSupplier(() -> propertiesToRegister); diff --git a/spring-integration-core/src/main/java/org/springframework/integration/dsl/BaseIntegrationFlowDefinition.java b/spring-integration-core/src/main/java/org/springframework/integration/dsl/BaseIntegrationFlowDefinition.java index 7fdd4d1925..104de5ee29 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/dsl/BaseIntegrationFlowDefinition.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/dsl/BaseIntegrationFlowDefinition.java @@ -631,7 +631,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .transform(Scripts.script("classpath:myScript.py").variable("foo", bar()), @@ -708,7 +708,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .filter("payload.hot"), e -> e.autoStartup(false)) @@ -820,7 +820,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .filter(Scripts.script(scriptResource).lang("ruby"), @@ -910,7 +910,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .handle(m -> logger.info(m.getPayload()) @@ -939,7 +939,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .handle(Integer.class, (p, h) -> p / 2) @@ -1024,8 +1024,8 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .handle(Integer.class, (p, h) -> p / 2, e -> e.autoStartup(false)) @@ -1076,7 +1076,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .handle(Scripts.script("classpath:myScript.ruby"), e -> e.autoStartup(false)) @@ -1098,8 +1098,8 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .handle(Amqp.outboundAdapter(this.amqpTemplate).routingKeyExpression("headers.routingKey"), @@ -1125,8 +1125,8 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .handle(m -> logger.info(m.getPayload()), e -> e.autoStartup(false)) @@ -1153,7 +1153,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .bridge(s -> s.poller(Pollers.fixedDelay(100)) @@ -1196,7 +1196,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .enrich(e -> e.requestChannel("enrichChannel") @@ -1239,7 +1239,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code @@ -1297,7 +1297,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .enrichHeaders(h -> h.header(FileHeaders.FILENAME, "foo.sitest") @@ -1325,7 +1325,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .split(s -> s.applySequence(false).delimiters(",")) @@ -1341,8 +1341,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .split(Scripts.script(myScriptResource).lang("groovy").refreshCheckDelay(1000), @@ -1489,7 +1487,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .split(String.class, p -> @@ -1516,7 +1514,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .split(String.class, p -> @@ -1627,8 +1625,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .resequence(r -> r.releasePartialSequences(true) @@ -1761,7 +1758,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .aggregate(a -> a.correlationExpression("1") @@ -1875,7 +1872,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .route(Integer.class, p -> p % 2 == 0) @@ -1898,7 +1895,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .route(Integer.class, p -> p % 2 == 0, @@ -1992,8 +1989,7 @@ public abstract class BaseIntegrationFlowDefinition entry : componentsToRegister.entrySet()) { Object component = entry.getKey(); - if (component instanceof BaseIntegrationFlowDefinition) { - BaseIntegrationFlowDefinition flowBuilder = (BaseIntegrationFlowDefinition) component; + if (component instanceof BaseIntegrationFlowDefinition flowBuilder) { if (flowBuilder.isOutputChannelRequired()) { registerSubflowBridge = true; flowBuilder.channel(new FixedSubscriberChannel(bridgeHandler)); @@ -2020,7 +2016,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .routeToRecipients(r -> r @@ -2040,7 +2036,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .routeByException(r -> r @@ -2072,7 +2068,7 @@ public abstract class BaseIntegrationFlowDefinition the {@link AbstractMessageRouter} type. @@ -2144,7 +2140,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .gateway(f -> f.transform("From Gateway SubFlow: "::concat)) @@ -2161,7 +2157,7 @@ public abstract class BaseIntegrationFlowDefinition * {@code * .gateway(f -> f.transform("From Gateway SubFlow: "::concat), e -> e.replyTimeout(100L)) @@ -3009,8 +3005,7 @@ public abstract class BaseIntegrationFlowDefinition new MicrometerMetricsCaptor(registry)); - } - return applicationContext.getBean(MICROMETER_CAPTOR_NAME, MetricsCaptor.class); - } - catch (NoSuchBeanDefinitionException e) { - return null; - } - } - - private static class MicroSample implements SampleFacade { - - private final Timer.Sample sample; - - MicroSample(Timer.Sample sample) { - this.sample = sample; - } + private record MicroSample(Timer.Sample sample) implements SampleFacade { @SuppressWarnings("unchecked") @Override diff --git a/spring-integration-core/src/main/java/org/springframework/integration/util/JavaUtils.java b/spring-integration-core/src/main/java/org/springframework/integration/util/JavaUtils.java deleted file mode 100644 index 7e3290ebb5..0000000000 --- a/spring-integration-core/src/main/java/org/springframework/integration/util/JavaUtils.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright 2019-2021 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.util; - -import java.util.List; -import java.util.function.BiConsumer; -import java.util.function.Consumer; - -import org.springframework.util.CollectionUtils; -import org.springframework.util.ObjectUtils; -import org.springframework.util.StringUtils; - -/** - * Chained utility methods to simplify some Java repetitive code. Obtain a reference to - * the singleton {@link #INSTANCE} and then chain calls to the utility methods. - * - * @author Gary Russell - * @author Artem Bilan - * - * @since 5.1.3 - * - * @deprecated since 5.5.6 in favor of {@link org.springframework.integration.JavaUtils}. - */ -@Deprecated -public final class JavaUtils { - - /** - * The singleton instance of this utility class. - */ - public static final JavaUtils INSTANCE = new JavaUtils(); - - private JavaUtils() { - } - - /** - * Invoke {@link Consumer#accept(Object)} with the value if the condition is true. - * @param condition the condition. - * @param value the value. - * @param consumer the consumer. - * @param the value type. - * @return this. - */ - public JavaUtils acceptIfCondition(boolean condition, T value, Consumer consumer) { - if (condition) { - consumer.accept(value); - } - return this; - } - - /** - * Invoke {@link Consumer#accept(Object)} with the value if it is not null. - * @param value the value. - * @param consumer the consumer. - * @param the value type. - * @return this. - */ - public JavaUtils acceptIfNotNull(T value, Consumer consumer) { - if (value != null) { - consumer.accept(value); - } - return this; - } - - /** - * Invoke {@link Consumer#accept(Object)} with the value if it is not null or empty. - * @param value the value. - * @param consumer the consumer. - * @return this. - * @since 5.2 - */ - public JavaUtils acceptIfHasText(String value, Consumer consumer) { - if (StringUtils.hasText(value)) { - consumer.accept(value); - } - return this; - } - - /** - * Invoke {@link Consumer#accept(Object)} with the value if it is not null or empty. - * @param value the value. - * @param consumer the consumer. - * @param the value type. - * @return this. - * @since 5.2 - */ - public JavaUtils acceptIfNotEmpty(List value, Consumer> consumer) { - if (!CollectionUtils.isEmpty(value)) { - consumer.accept(value); - } - return this; - } - - /** - * Invoke {@link Consumer#accept(Object)} with the value if it is not null or empty. - * @param value the value. - * @param consumer the consumer. - * @param the value type. - * @return this. - * @since 5.2 - */ - public JavaUtils acceptIfNotEmpty(T[] value, Consumer consumer) { - if (!ObjectUtils.isEmpty(value)) { - consumer.accept(value); - } - return this; - } - - /** - * Invoke {@link BiConsumer#accept(Object, Object)} with the arguments if the - * condition is true. - * @param condition the condition. - * @param t1 the first consumer argument - * @param t2 the second consumer argument - * @param consumer the consumer. - * @param the first argument type. - * @param the second argument type. - * @return this. - * @since 5.2 - */ - public JavaUtils acceptIfCondition(boolean condition, T1 t1, T2 t2, BiConsumer consumer) { - if (condition) { - consumer.accept(t1, t2); - } - return this; - } - - /** - * Invoke {@link BiConsumer#accept(Object, Object)} with the arguments if the t2 - * argument is not null. - * @param t1 the first argument - * @param t2 the second consumer argument - * @param consumer the consumer. - * @param the first argument type. - * @param the second argument type. - * @return this. - * @since 5.2 - */ - public JavaUtils acceptIfNotNull(T1 t1, T2 t2, BiConsumer consumer) { - if (t2 != null) { - consumer.accept(t1, t2); - } - return this; - } - - /** - * Invoke {@link BiConsumer#accept(Object, Object)} with the arguments if the value - * argument is not null or empty. - * @param t1 the first consumer argument. - * @param value the second consumer argument - * @param the first argument type. - * @param consumer the consumer. - * @return this. - * @since 5.2 - */ - public JavaUtils acceptIfHasText(T t1, String value, BiConsumer consumer) { - if (StringUtils.hasText(value)) { - consumer.accept(t1, value); - } - return this; - } - - -} diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/DefaultSessionFactoryLocator.java b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/DefaultSessionFactoryLocator.java index f7c5cba41c..a782c7344d 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/DefaultSessionFactoryLocator.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/remote/session/DefaultSessionFactoryLocator.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2021 the original author or authors. + * Copyright 2015-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. @@ -59,17 +59,6 @@ public class DefaultSessionFactoryLocator implements SessionFactoryLocator this.defaultFactory = defaultFactory; } - /** - * Add a session factory. - * @param key the lookup key. - * @param factory the factory. - * @deprecated since 5.3 in favor of {@link #addSessionFactory(Object, SessionFactory)} - */ - @Deprecated - public void addSessionFactory(String key, SessionFactory factory) { - addSessionFactory((Object) key, factory); - } - /** * Add a session factory. * @param key the lookup key. diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/dsl/Ftp.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/dsl/Ftp.java index 713fb63512..0226b2160d 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/dsl/Ftp.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/dsl/Ftp.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2019 the original author or authors. + * Copyright 2014-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. @@ -108,31 +108,6 @@ public final class Ftp { return outboundAdapter(new FtpRemoteFileTemplate(sessionFactory), fileExistsMode); } - /** - * A {@link FtpMessageHandlerSpec} factory for an outbound channel adapter spec. - * @param remoteFileTemplate the remote file template. - * @return the spec. - * @deprecated in favor of {@link #outboundAdapter(FtpRemoteFileTemplate)} - */ - @Deprecated - public static FtpMessageHandlerSpec outboundAdapter(RemoteFileTemplate remoteFileTemplate) { - return new FtpMessageHandlerSpec(remoteFileTemplate); - } - - /** - * A {@link FtpMessageHandlerSpec} factory for an outbound channel adapter spec. - * @param remoteFileTemplate the remote file template. - * @param fileExistsMode the file exists mode. - * @return the spec. - * @deprecated in favor of {@link #outboundAdapter(FtpRemoteFileTemplate, FileExistsMode)} - */ - @Deprecated - public static FtpMessageHandlerSpec outboundAdapter(RemoteFileTemplate remoteFileTemplate, - FileExistsMode fileExistsMode) { - - return new FtpMessageHandlerSpec(remoteFileTemplate, fileExistsMode); - } - /** * A {@link FtpMessageHandlerSpec} factory for an outbound channel adapter spec. * @param ftpRemoteFileTemplate the remote file template. diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/dsl/FtpMessageHandlerSpec.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/dsl/FtpMessageHandlerSpec.java index 2f7042eafd..745800c04a 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/dsl/FtpMessageHandlerSpec.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/dsl/FtpMessageHandlerSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-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. @@ -19,7 +19,6 @@ package org.springframework.integration.ftp.dsl; import org.apache.commons.net.ftp.FTPFile; import org.springframework.integration.file.dsl.FileTransferringMessageHandlerSpec; -import org.springframework.integration.file.remote.RemoteFileTemplate; import org.springframework.integration.file.remote.session.SessionFactory; import org.springframework.integration.file.support.FileExistsMode; import org.springframework.integration.ftp.outbound.FtpMessageHandler; @@ -40,16 +39,6 @@ public class FtpMessageHandlerSpec extends FileTransferringMessageHandlerSpec remoteFileTemplate) { - this.target = new FtpMessageHandler(remoteFileTemplate.getSessionFactory()); - } - - @Deprecated - protected FtpMessageHandlerSpec(RemoteFileTemplate remoteFileTemplate, FileExistsMode fileExistsMode) { - this.target = new FtpMessageHandler(remoteFileTemplate, fileExistsMode); - } - protected FtpMessageHandlerSpec(FtpRemoteFileTemplate ftpRemoteFileTemplate) { this.target = new FtpMessageHandler(ftpRemoteFileTemplate); } diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/outbound/FtpMessageHandler.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/outbound/FtpMessageHandler.java index ba0a9fa3ef..63ca2b01c7 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/outbound/FtpMessageHandler.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/outbound/FtpMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * 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. @@ -37,6 +37,7 @@ import org.springframework.integration.ftp.session.FtpRemoteFileTemplate; * @author Deepak Gunasekaran * * @since 4.1.9 + * * @see FtpRemoteFileTemplate */ public class FtpMessageHandler extends FileTransferringMessageHandler { @@ -50,18 +51,6 @@ public class FtpMessageHandler extends FileTransferringMessageHandler { super(remoteFileTemplate); } - /** - * Constructor which sets the RemoteFileTemplate and FileExistsMode. - * @param remoteFileTemplate the remote file template. - * @param mode the file exists mode. - * @deprecated in favor of - * {@link #FtpMessageHandler(FtpRemoteFileTemplate, FileExistsMode)} - */ - @Deprecated - public FtpMessageHandler(RemoteFileTemplate remoteFileTemplate, FileExistsMode mode) { - super(remoteFileTemplate, mode); - } - /** * Constructor which sets the FtpRemoteFileTemplate and FileExistsMode. * @param ftpRemoteFileTemplate the remote file template. diff --git a/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java b/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java index 0523de01a5..86738220b4 100644 --- a/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java +++ b/spring-integration-http/src/test/java/org/springframework/integration/http/outbound/CookieTests.java @@ -21,7 +21,6 @@ import static org.assertj.core.api.Assertions.assertThat; import java.io.BufferedReader; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; @@ -29,8 +28,7 @@ import java.net.URI; import java.util.ArrayList; import java.util.List; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; @@ -43,8 +41,7 @@ import org.springframework.integration.channel.QueueChannel; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.support.GenericMessage; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; /** * @author Gary Russell @@ -54,8 +51,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; * @since 2.1 * */ -@ContextConfiguration -@RunWith(SpringJUnit4ClassRunner.class) +@SpringJUnitConfig @DirtiesContext public class CookieTests { @@ -65,9 +61,9 @@ public class CookieTests { @Autowired private QueueChannel ch6; - private static ByteArrayOutputStream bos = new ByteArrayOutputStream(); + private static final ByteArrayOutputStream bos = new ByteArrayOutputStream(); - private static List allHeaders = new ArrayList<>(); + private static final List allHeaders = new ArrayList<>(); @Test public void testCookie() throws Exception { @@ -93,8 +89,7 @@ public class CookieTests { private int count = 123; - public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) - throws IOException { + public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) { return new ClientHttpRequest() { @@ -104,7 +99,7 @@ public class CookieTests { return headers; } - public OutputStream getBody() throws IOException { + public OutputStream getBody() { return bos; } @@ -122,7 +117,7 @@ public class CookieTests { return null; } - public ClientHttpResponse execute() throws IOException { + public ClientHttpResponse execute() { allHeaders.add(headers); return new ClientHttpResponse() { @@ -134,22 +129,22 @@ public class CookieTests { return headers; } - public InputStream getBody() throws IOException { + public InputStream getBody() { return new ByteArrayInputStream("OK".getBytes()); } - public String getStatusText() throws IOException { + public String getStatusText() { return "OK"; } - public HttpStatus getStatusCode() throws IOException { + public HttpStatus getStatusCode() { return HttpStatus.OK; } public void close() { } - public int getRawStatusCode() throws IOException { + public int getRawStatusCode() { return 200; } diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java index f9556e1514..294e0c789d 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/StoredProcExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-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. @@ -16,6 +16,7 @@ package org.springframework.integration.jdbc; +import java.io.Serial; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -103,7 +104,7 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { private List sqlParameters = new ArrayList<>(0); /** - * By default bean properties of the passed in {@link Message} will be used + * By default, bean properties of the passed in {@link Message} will be used * as a source for the Stored Procedure's input parameters. By default a * {@link BeanPropertySqlParameterSourceFactory} will be used. * This may be sufficient for basic use cases. For more sophisticated options @@ -191,9 +192,9 @@ public class StoredProcExecutor implements BeanFactoryAware, InitializingBean { } private Map buildJdbcCallOperationsMap() { - return new LinkedHashMap(this.jdbcCallOperationsCacheSize + 1, LOAD_FACTOR, - true) { + return new LinkedHashMap<>(this.jdbcCallOperationsCacheSize + 1, LOAD_FACTOR, true) { + @Serial private static final long serialVersionUID = 3801124242820219131L; @Override diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java index c78dea0efa..e6b2be3276 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcChannelMessageStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-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. @@ -203,7 +203,7 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto /** * The {@link org.springframework.jdbc.core.JdbcOperations} - * to use when interacting with the database. Either + * to use when interacting with the database. Either * this property can be set or the {@link #setDataSource(DataSource) dataSource}. * Please consider passing in a {@link JdbcTemplate} with a fetchSize property * of 1. This is particularly important for Oracle to ensure First In, First Out (FIFO) @@ -457,8 +457,8 @@ public class JdbcChannelMessageStore implements PriorityCapableChannelMessageSto /** * Replace patterns in the input to produce a valid SQL query. This implementation lazily initializes a - * simple map-based cache, only replacing the table prefix on the first access to a named query. Further - * accesses will be resolved from the cache. + * simple map-based cache, only replacing the table prefix on the first access to a named query. + * Subsequent accesses will be resolved from the cache. * @param queryName The {@link Query} to be transformed. * @param queryProvider a supplier to provide the query template. * @return A transformed query with replacements. diff --git a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcMessageStore.java b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcMessageStore.java index 3aafce78f0..3c0cb21305 100644 --- a/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcMessageStore.java +++ b/spring-integration-jdbc/src/main/java/org/springframework/integration/jdbc/store/JdbcMessageStore.java @@ -566,7 +566,7 @@ public class JdbcMessageStore extends AbstractMessageGroupStore implements Messa new SingleColumnRowMapper(), this.region) .iterator(); - return new Iterator() { + return new Iterator<>() { @Override public boolean hasNext() { diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java index 43f6a88a67..ef427eb2f7 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/ChannelPublishingJmsMessageListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-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. @@ -392,8 +392,8 @@ public class ChannelPublishingJmsMessageListener this.gatewayDelegate.stop(); } - private void copyCorrelationIdFromRequestToReply(jakarta.jms.Message requestMessage, jakarta.jms.Message replyMessage) - throws JMSException { + private void copyCorrelationIdFromRequestToReply(jakarta.jms.Message requestMessage, + jakarta.jms.Message replyMessage) throws JMSException { if (this.correlationKey != null) { if (this.correlationKey.equals("JMSCorrelationID")) { @@ -417,9 +417,8 @@ public class ChannelPublishingJmsMessageListener /** * Determine a reply destination for the given message. - *

- * This implementation first checks the boolean 'error' flag which signifies that the reply is an error message. If - * reply is not an error it will first check the JMS Reply-To {@link Destination} of the supplied request message; + *

This implementation first checks the boolean 'error' flag which signifies that the reply is an error message. + * If reply is not an error it will first check the JMS Reply-To {@link Destination} of the supplied request message; * if that is not null it is returned; if it is null, then the configured * {@link #resolveDefaultReplyDestination default reply destination} is returned; if this too is null, * then an {@link InvalidDestinationException} is thrown. @@ -458,8 +457,7 @@ public class ChannelPublishingJmsMessageListener if (this.defaultReplyDestination instanceof Destination) { return (Destination) this.defaultReplyDestination; } - if (this.defaultReplyDestination instanceof DestinationNameHolder) { - DestinationNameHolder nameHolder = (DestinationNameHolder) this.defaultReplyDestination; + if (this.defaultReplyDestination instanceof DestinationNameHolder nameHolder) { return this.destinationResolver.resolveDestinationName(session, nameHolder.name, nameHolder.isTopic); } return null; @@ -486,16 +484,7 @@ public class ChannelPublishingJmsMessageListener * Internal class combining a destination name * and its target destination type (queue or topic). */ - private static final class DestinationNameHolder { - - private final String name; - - private final boolean isTopic; - - DestinationNameHolder(String name, boolean isTopic) { - this.name = name; - this.isTopic = isTopic; - } + private record DestinationNameHolder(String name, boolean isTopic) { } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java index f0d0011a68..cc937256da 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsSendingMessageHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-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. @@ -18,6 +18,7 @@ package org.springframework.integration.jms; import jakarta.jms.Destination; +import org.springframework.beans.factory.BeanFactory; import org.springframework.core.convert.ConversionService; import org.springframework.expression.EvaluationContext; import org.springframework.expression.Expression; @@ -60,6 +61,7 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler { public JmsSendingMessageHandler(JmsTemplate jmsTemplate) { + Assert.notNull(jmsTemplate, "'jmsTemplate' must not be null"); this.jmsTemplate = jmsTemplate; } @@ -145,14 +147,15 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler { @Override protected void onInit() { + BeanFactory beanFactory = getBeanFactory(); if (this.destinationExpressionProcessor != null) { - this.destinationExpressionProcessor.setBeanFactory(getBeanFactory()); + this.destinationExpressionProcessor.setBeanFactory(beanFactory); ConversionService conversionService = getConversionService(); if (conversionService != null) { this.destinationExpressionProcessor.setConversionService(conversionService); } } - this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); + this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(beanFactory); } @Override @@ -201,7 +204,8 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler { Object result = this.destinationExpressionProcessor.processMessage(message); if (!(result instanceof Destination || result instanceof String)) { throw new MessageDeliveryException(message, - "Evaluation of destinationExpression failed to produce a Destination or destination name. Result was: " + result); + "Evaluation of destinationExpression failed to produce a Destination or destination name. " + + "Result was: " + result); } return result; } @@ -221,16 +225,8 @@ public class JmsSendingMessageHandler extends AbstractMessageHandler { } - private static final class HeaderMappingMessagePostProcessor implements MessagePostProcessor { - - private final Message integrationMessage; - - private final JmsHeaderMapper headerMapper; - - HeaderMappingMessagePostProcessor(Message integrationMessage, JmsHeaderMapper headerMapper) { - this.integrationMessage = integrationMessage; - this.headerMapper = headerMapper; - } + private record HeaderMappingMessagePostProcessor(Message integrationMessage, JmsHeaderMapper headerMapper) + implements MessagePostProcessor { @Override public jakarta.jms.Message postProcessMessage(jakarta.jms.Message jmsMessage) { diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsTimeoutException.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsTimeoutException.java index 4dcfc1ea06..580c6b9ebc 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsTimeoutException.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/JmsTimeoutException.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2019 the original author or authors. + * 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. @@ -16,18 +16,24 @@ package org.springframework.integration.jms; +import java.io.Serial; + import org.springframework.jms.JmsException; /** * A timeout occurred within an async gateway. * * @author Gary Russell + * @author Artem Bilan + * * @since 4.3 * */ -@SuppressWarnings("serial") public class JmsTimeoutException extends JmsException { + @Serial + private static final long serialVersionUID = 5439915454935047936L; + public JmsTimeoutException(String description) { super(description); } diff --git a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsInboundGatewaySpec.java b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsInboundGatewaySpec.java index 5bfe81684b..935e4a8d07 100644 --- a/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsInboundGatewaySpec.java +++ b/spring-integration-jms/src/main/java/org/springframework/integration/jms/dsl/JmsInboundGatewaySpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2021 the original author or authors. + * 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. @@ -209,17 +209,6 @@ public class JmsInboundGatewaySpec> this.spec.get().setAutoStartup(false); } - /** - * @param destination the destination - * @return the spec. - * @deprecated since 5.5 in favor of {@link #requestDestination(Destination)} - * @see JmsListenerContainerSpec#destination(Destination) - */ - @Deprecated - public JmsInboundGatewayListenerContainerSpec destination(Destination destination) { - return requestDestination(destination); - } - /** * Specify a request destination for incoming messages. * @param requestDestination the destination @@ -232,17 +221,6 @@ public class JmsInboundGatewaySpec> return _this(); } - /** - * @param destinationName the destinationName - * @return the spec. - * @deprecated since 5.5 in favor of {@link #requestDestination(String)} - * @see JmsListenerContainerSpec#destination(String) - */ - @Deprecated - public JmsInboundGatewayListenerContainerSpec destination(String destinationName) { - return requestDestination(destinationName); - } - /** * Specify a request destination for incoming messages. * @param requestDestinationName the destination name diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/IntegrationMBeanExporter.java b/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/IntegrationMBeanExporter.java index 6819dcb2da..b4e3eb9780 100644 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/IntegrationMBeanExporter.java +++ b/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/IntegrationMBeanExporter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-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. @@ -242,8 +242,7 @@ public class IntegrationMBeanExporter extends MBeanExporter } private void populateMessageHandlers() { - Map messageHandlers = this.applicationContext - .getBeansOfType(MessageHandler.class); + Map messageHandlers = this.applicationContext.getBeansOfType(MessageHandler.class); for (Entry entry : messageHandlers.entrySet()) { String beanName = entry.getKey(); @@ -264,8 +263,7 @@ public class IntegrationMBeanExporter extends MBeanExporter } private void populateMessageSources() { - this.applicationContext.getBeansOfType( - IntegrationInboundManagement.class) + this.applicationContext.getBeansOfType(IntegrationInboundManagement.class) .values() .stream() // If the source is proxied, we have to extract the target to expose as an MBean. @@ -332,8 +330,7 @@ public class IntegrationMBeanExporter extends MBeanExporter } private void postProcessAbstractEndpoint(Object bean) { - if (bean instanceof IntegrationConsumer) { - IntegrationConsumer integrationConsumer = (IntegrationConsumer) bean; + if (bean instanceof IntegrationConsumer integrationConsumer) { MessageHandler handler = integrationConsumer.getHandler(); MessageHandler monitor = (MessageHandler) extractTarget(handler); if (monitor instanceof IntegrationManagement) { @@ -344,8 +341,7 @@ public class IntegrationMBeanExporter extends MBeanExporter } return; } - else if (bean instanceof SourcePollingChannelAdapter) { - SourcePollingChannelAdapter pollingChannelAdapter = (SourcePollingChannelAdapter) bean; + else if (bean instanceof SourcePollingChannelAdapter pollingChannelAdapter) { MessageSource messageSource = pollingChannelAdapter.getMessageSource(); if (messageSource instanceof IntegrationInboundManagement) { IntegrationInboundManagement monitor = (IntegrationInboundManagement) extractTarget(messageSource); @@ -388,14 +384,14 @@ public class IntegrationMBeanExporter extends MBeanExporter else { this.endpointsByMonitor.remove(bean); - if (bean instanceof IntegrationManagement) { + if (bean instanceof IntegrationManagement && bean instanceof MessageChannel) { this.channels.remove(((NamedComponent) bean).getComponentName()); } - else if (bean instanceof IntegrationManagement) { + else if (bean instanceof IntegrationManagement && bean instanceof MessageHandler) { this.handlers.remove(((NamedComponent) bean).getComponentName()); this.endpointNames.remove(((NamedComponent) bean).getComponentName()); } - else if (bean instanceof IntegrationInboundManagement) { + else if (bean instanceof IntegrationInboundManagement && bean instanceof MessageSource) { this.sources.remove(((NamedComponent) bean).getComponentName()); this.endpointNames.remove(((NamedComponent) bean).getComponentName()); } @@ -428,7 +424,7 @@ public class IntegrationMBeanExporter extends MBeanExporter * Copy of private method in super class. Needed so we can avoid using the bean factory to extract the bean again, * and risk it being a proxy (which it almost certainly is by now). * @param bean the bean instance to register - * @param beanKey the bean name or human readable version if auto-generated + * @param beanKey the bean name or human-readable version if auto-generated * @return the JMX object name of the MBean that was registered */ private ObjectName registerBeanInstance(Object bean, String beanKey) { @@ -550,12 +546,11 @@ public class IntegrationMBeanExporter extends MBeanExporter public void stopActiveChannels() { // Stop any "active" channels (JMS etc). for (IntegrationManagement metrics : this.channels.values()) { - IntegrationManagement channel = metrics; - if (channel instanceof Lifecycle) { + if (metrics instanceof Lifecycle) { if (logger.isInfoEnabled()) { - logger.info("Stopping channel " + channel); + logger.info("Stopping channel " + metrics); } - ((Lifecycle) channel).stop(); + ((Lifecycle) metrics).stop(); } } } @@ -604,20 +599,8 @@ public class IntegrationMBeanExporter extends MBeanExporter @ManagedAttribute public String[] getHandlerNames() { return this.handlers.values().stream() - .map(hand -> hand.getManagedName()) - .toArray(n -> new String[n]); - } - - @Deprecated - @ManagedMetric(metricType = MetricType.GAUGE, displayName = "No longer supported") - public int getActiveHandlerCount() { - return 0; - } - - @Deprecated - @ManagedMetric(metricType = MetricType.GAUGE, displayName = "No longer supported") - public long getActiveHandlerCountLong() { - return 0; + .map(IntegrationManagement::getManagedName) + .toArray(String[]::new); } @ManagedMetric(metricType = MetricType.GAUGE, displayName = "Queued Message Count") @@ -631,14 +614,7 @@ public class IntegrationMBeanExporter extends MBeanExporter @ManagedAttribute public String[] getChannelNames() { - return this.channels.keySet().stream() - .toArray(n -> new String[n]); - } - - @Nullable - @Deprecated - public AbstractMessageHandler getHandlerMetrics(String name) { - return null; + return this.channels.keySet().toArray(String[]::new); } @Nullable @@ -648,18 +624,7 @@ public class IntegrationMBeanExporter extends MBeanExporter @ManagedAttribute public String[] getSourceNames() { - return this.sources.keySet().stream() - .toArray(n -> new String[n]); - } - - @Deprecated - public IntegrationInboundManagement getSourceMetrics(String name) { - return this.sources.get(name); - } - - @Deprecated - public IntegrationManagement getChannelMetrics(String name) { - return this.channels.get(name); + return this.sources.keySet().toArray(String[]::new); } public IntegrationInboundManagement getSource(String name) { @@ -732,7 +697,7 @@ public class IntegrationMBeanExporter extends MBeanExporter private void registerEndpoints() { String[] names = this.applicationContext.getBeanNamesForType(AbstractEndpoint.class); for (String name : names) { - if (!this.endpointsByMonitor.values().contains(name)) { + if (!this.endpointsByMonitor.containsValue(name)) { AbstractEndpoint endpoint = this.applicationContext.getBean(name, AbstractEndpoint.class); registerEndpoint(endpoint); } @@ -778,14 +743,13 @@ public class IntegrationMBeanExporter extends MBeanExporter */ private boolean matches(String[] patterns, String name) { Boolean match = PatternMatchUtils.smartMatch(name, patterns); - return match == null ? false : match; + return match != null && match; } private Object extractTarget(Object bean) { - if (!(bean instanceof Advised)) { + if (!(bean instanceof Advised advised)) { return bean; } - Advised advised = (Advised) bean; try { return extractTarget(advised.getTargetSource().getTarget()); } @@ -824,7 +788,6 @@ public class IntegrationMBeanExporter extends MBeanExporter /* * https://www.oracle.com/technetwork/java/javase/tech/best-practices-jsp-136021.html - * * The set of characters in a value is also limited. If special characters may * occur, it is recommended that the value be quoted, using ObjectName.quote. If * the value for a given key is sometimes quoted, then it should always be quoted. @@ -890,7 +853,6 @@ public class IntegrationMBeanExporter extends MBeanExporter IntegrationManagement monitor2, String name, String source, IntegrationConsumer endpoint) { - IntegrationManagement result = monitor2; String managedType = source; String managedName = name; @@ -914,16 +876,16 @@ public class IntegrationMBeanExporter extends MBeanExporter managedType = "handler"; } - result.setManagedType(managedType); - result.setManagedName(managedName); - return result; + monitor2.setManagedType(managedType); + monitor2.setManagedName(managedName); + return monitor2; } private String buildAnonymousManagedName(Map anonymousCache, MessageChannel messageChannel) { AtomicLong count = anonymousCache.computeIfAbsent(messageChannel, (key) -> new AtomicLong()); long total = count.incrementAndGet(); /* - * Short hack to makes sure object names are unique if more than one endpoint has the same input + * Short hack to make sure object names are unique if more than one endpoint has the same input * channel */ @@ -966,9 +928,7 @@ public class IntegrationMBeanExporter extends MBeanExporter return messageSourceMetrics; } - @SuppressWarnings("unlikely-arg-type") private AbstractEndpoint getEndpointForMonitor(IntegrationInboundManagement source2) { - for (AbstractEndpoint endpoint : this.applicationContext.getBeansOfType(AbstractEndpoint.class).values()) { Object target = null; if (source2 instanceof MessagingGatewaySupport && endpoint.equals(source2)) { @@ -988,7 +948,6 @@ public class IntegrationMBeanExporter extends MBeanExporter IntegrationInboundManagement source2, String name, String source, Object endpoint) { - IntegrationInboundManagement result = source2; String managedType = source; String managedName = name; @@ -1019,13 +978,13 @@ public class IntegrationMBeanExporter extends MBeanExporter } if (managedName == null) { - managedName = result.toString(); + managedName = source2.toString(); managedType = "source"; } - result.setManagedType(managedType); - result.setManagedName(managedName); - return result; + source2.setManagedType(managedType); + source2.setManagedName(managedName); + return source2; } } diff --git a/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/ManagedEndpoint.java b/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/ManagedEndpoint.java deleted file mode 100644 index 1abb43215a..0000000000 --- a/spring-integration-jmx/src/main/java/org/springframework/integration/monitor/ManagedEndpoint.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2002-2020 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.monitor; - -import org.springframework.context.Lifecycle; -import org.springframework.integration.endpoint.AbstractEndpoint; -import org.springframework.integration.support.management.IntegrationManagedResource; -import org.springframework.jmx.export.annotation.ManagedAttribute; -import org.springframework.jmx.export.annotation.ManagedOperation; - -/** - * Wrapper for an {@link AbstractEndpoint} that exposes a management interface. - * - * @author Dave Syer - * @author Gary Russell - * - * @deprecated this is no longer used by the framework. Replaced by - * {@link org.springframework.integration.support.management.ManageableLifecycle}. - * - */ -@Deprecated -@IntegrationManagedResource -public class ManagedEndpoint implements Lifecycle { - - private final AbstractEndpoint delegate; - - public ManagedEndpoint(AbstractEndpoint delegate) { - this.delegate = delegate; - } - - @Override - @ManagedAttribute - public final boolean isRunning() { - return this.delegate.isRunning(); - } - - @Override - @ManagedOperation - public final void start() { - this.delegate.start(); - } - - @Override - @ManagedOperation - public final void stop() { - this.delegate.stop(); - } - -} diff --git a/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/ClientRSocketConnector.java b/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/ClientRSocketConnector.java index 2678b4298e..f3ef40b5f3 100644 --- a/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/ClientRSocketConnector.java +++ b/spring-integration-rsocket/src/main/java/org/springframework/integration/rsocket/ClientRSocketConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 the original author or authors. + * Copyright 2019-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. @@ -29,7 +29,6 @@ import org.springframework.util.MimeType; import io.rsocket.transport.ClientTransport; import io.rsocket.transport.netty.client.TcpClientTransport; import io.rsocket.transport.netty.client.WebsocketClientTransport; -import reactor.core.publisher.Mono; /** * A client {@link AbstractRSocketConnector} extension to the RSocket connection. @@ -190,16 +189,6 @@ public class ClientRSocketConnector extends AbstractRSocketConnector { this.rsocketRequester.rsocketClient().source().subscribe(); } - /** - * Return the {@link Mono} for the {@link RSocketRequester}. - * @return the {@link Mono} for the {@link RSocketRequester}. - * @deprecated since 5.4 in favor of {@link #getRequester()} - */ - @Deprecated - public Mono getRSocketRequester() { - return Mono.just(getRequester()); - } - /** * Return the {@link RSocketRequester} this connector is built on. * @return the {@link RSocketRequester} this connector is built on. diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/Sftp.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/Sftp.java index 6d8030ed24..ed87112430 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/Sftp.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/Sftp.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-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. @@ -109,32 +109,6 @@ public final class Sftp { return outboundAdapter(new SftpRemoteFileTemplate(sessionFactory), fileExistsMode); } - /** - * An {@link SftpMessageHandlerSpec} factory for an outbound channel adapter spec. - * @param remoteFileTemplate the remote file template. - * @return the spec. - * @deprecated in favor of {@link #outboundAdapter(SftpRemoteFileTemplate)} - */ - @Deprecated - public static SftpMessageHandlerSpec outboundAdapter(RemoteFileTemplate remoteFileTemplate) { - return new SftpMessageHandlerSpec(remoteFileTemplate); - } - - /** - * An {@link SftpMessageHandlerSpec} factory for an outbound channel adapter spec. - * @param remoteFileTemplate the remote file template. - * @param fileExistsMode the file exists mode. - * @return the spec. - * @deprecated in favor of - * {@link #outboundAdapter(SftpRemoteFileTemplate,FileExistsMode)} - */ - @Deprecated - public static SftpMessageHandlerSpec outboundAdapter(RemoteFileTemplate remoteFileTemplate, - FileExistsMode fileExistsMode) { - - return new SftpMessageHandlerSpec(remoteFileTemplate, fileExistsMode); - } - /** * An {@link SftpMessageHandlerSpec} factory for an outbound channel adapter spec. * @param sftpRemoteFileTemplate the remote file template. diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/SftpMessageHandlerSpec.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/SftpMessageHandlerSpec.java index bc7c861362..c6c9906d73 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/SftpMessageHandlerSpec.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/dsl/SftpMessageHandlerSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 the original author or authors. + * Copyright 2014-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. @@ -17,7 +17,6 @@ package org.springframework.integration.sftp.dsl; import org.springframework.integration.file.dsl.FileTransferringMessageHandlerSpec; -import org.springframework.integration.file.remote.RemoteFileTemplate; import org.springframework.integration.file.remote.session.SessionFactory; import org.springframework.integration.file.support.FileExistsMode; import org.springframework.integration.sftp.outbound.SftpMessageHandler; @@ -39,26 +38,11 @@ public class SftpMessageHandlerSpec this.target = new SftpMessageHandler(sessionFactory); } - @Deprecated - protected SftpMessageHandlerSpec(RemoteFileTemplate remoteFileTemplate) { - this.target = new SftpMessageHandler(remoteFileTemplate.getSessionFactory()); - } - - @Deprecated - protected SftpMessageHandlerSpec(RemoteFileTemplate remoteFileTemplate, - FileExistsMode fileExistsMode) { - - this.target = - new SftpMessageHandler(new SftpRemoteFileTemplate(remoteFileTemplate.getSessionFactory()), - fileExistsMode); - } - protected SftpMessageHandlerSpec(SftpRemoteFileTemplate sftpRemoteFileTemplate) { this.target = new SftpMessageHandler(sftpRemoteFileTemplate); } protected SftpMessageHandlerSpec(SftpRemoteFileTemplate sftpRemoteFileTemplate, FileExistsMode fileExistsMode) { - this.target = new SftpMessageHandler(sftpRemoteFileTemplate, fileExistsMode); } diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java index b97e261ae5..1038b0daca 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/DefaultSftpSessionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-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. @@ -27,7 +27,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.springframework.beans.factory.BeanCreationException; -import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; import org.springframework.integration.JavaUtils; import org.springframework.integration.file.remote.session.SessionFactory; @@ -184,21 +183,6 @@ public class DefaultSftpSessionFactory implements SessionFactory, Share this.password = password; } - /** - * Specifies the filename that will be used for a host key repository. - * The file has the same format as OpenSSH's known_hosts file. - *

- * Required if {@link #setAllowUnknownKeys(boolean) allowUnknownKeys} is - * false (default). - * @param knownHosts The known hosts. - * @deprecated since 5.2.5 in favor of {@link #setKnownHostsResource(Resource)} - * @see JSch#setKnownHosts(String) - */ - @Deprecated - public void setKnownHosts(String knownHosts) { - setKnownHostsResource(new FileSystemResource(knownHosts)); - } - /** * Specifies the filename that will be used for a host key repository. * The file has the same format as OpenSSH's known_hosts file. diff --git a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpFileInfo.java b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpFileInfo.java index 02c5de1ab5..53e9e66b2c 100644 --- a/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpFileInfo.java +++ b/spring-integration-sftp/src/main/java/org/springframework/integration/sftp/session/SftpFileInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-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. @@ -26,6 +26,8 @@ import com.jcraft.jsch.SftpATTRS; * A {@link org.springframework.integration.file.remote.FileInfo} implementation for SFTP. * * @author Gary Russell + * @author Artem Bilan + * * @since 2.1 */ public class SftpFileInfo extends AbstractFileInfo { @@ -42,7 +44,7 @@ public class SftpFileInfo extends AbstractFileInfo { } /** - * @see com.jcraft.jsch.SftpATTRS#isDir() + * @see SftpATTRS#isDir() */ @Override public boolean isDirectory() { @@ -50,7 +52,7 @@ public class SftpFileInfo extends AbstractFileInfo { } /** - * @see com.jcraft.jsch.SftpATTRS#isLink() + * @see SftpATTRS#isLink() */ @Override public boolean isLink() { @@ -58,7 +60,7 @@ public class SftpFileInfo extends AbstractFileInfo { } /** - * @see com.jcraft.jsch.SftpATTRS#getSize() + * @see SftpATTRS#getSize() */ @Override public long getSize() { @@ -66,7 +68,7 @@ public class SftpFileInfo extends AbstractFileInfo { } /** - * @see com.jcraft.jsch.SftpATTRS#getMTime() + * @see SftpATTRS#getMTime() */ @Override public long getModified() { @@ -74,7 +76,7 @@ public class SftpFileInfo extends AbstractFileInfo { } /** - * @see com.jcraft.jsch.ChannelSftp.LsEntry#getFilename() + * @see LsEntry#getFilename() */ @Override public String getFilename() { diff --git a/spring-integration-test-support/src/main/java/org/springframework/integration/test/mail/TestMailServer.java b/spring-integration-test-support/src/main/java/org/springframework/integration/test/mail/TestMailServer.java deleted file mode 100644 index 359ef43260..0000000000 --- a/spring-integration-test-support/src/main/java/org/springframework/integration/test/mail/TestMailServer.java +++ /dev/null @@ -1,550 +0,0 @@ -/* - * Copyright 2014-2021 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.test.mail; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.net.ServerSocket; -import java.net.Socket; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -import javax.net.ServerSocketFactory; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import org.springframework.util.Base64Utils; - -/** - * A basic test mail server for pop3, imap, - * Serves up a canned email message with each protocol. - * For smtp, it handles the basic handshaking and captures - * the pertinent data so it can be verified by a test case. - * - * @author Gary Russell - * @author Artem Bilan - * - * @since 5.0 - * - * @deprecated since 5.5 in favor of GreenMail library for mail testing. - * - */ -@Deprecated -public final class TestMailServer { - - public static SmtpServer smtp(int port) { - try { - return new SmtpServer(port); - } - catch (IOException e) { - throw new IllegalStateException(e); - } - } - - public static Pop3Server pop3(int port) { - try { - return new Pop3Server(port); - } - catch (IOException e) { - throw new IllegalStateException(e); - } - } - - public static ImapServer imap(int port) { - try { - return new ImapServer(port); - } - catch (IOException e) { - throw new IllegalStateException(e); - } - } - - public static class SmtpServer extends MailServer { - - SmtpServer(int port) throws IOException { - super(port); - } - - @Override - protected MailHandler mailHandler(Socket socket) { - return new SmtpHandler(socket); - } - - class SmtpHandler extends MailHandler { - - SmtpHandler(Socket socket) { - super(socket); - } - - @Override // NOSONAR - void doRun() { // NOSONAR - try { - write("220 foo SMTP"); - while (!socket.isClosed()) { - String line = reader.readLine(); - if (line == null) { - break; - } - if (line.contains("EHLO")) { - write("250-foo hello [0,0,0,0], foo"); - write("250-AUTH LOGIN PLAIN"); - write("250 OK"); - } - else if (line.contains("MAIL FROM")) { - write("250 OK"); - } - else if (line.contains("RCPT TO")) { - write("250 OK"); - } - else if (line.contains("AUTH LOGIN")) { - write("334 VXNlcm5hbWU6"); - } - else if (line.contains("dXNlcg==")) { // base64 'user' - sb.append("user:"); - sb.append((new String(Base64Utils.decode(line.getBytes())))); - sb.append("\n"); - write("334 UGFzc3dvcmQ6"); - } - else if (line.contains("cHc=")) { // base64 'pw' - sb.append("password:"); - sb.append((new String(Base64Utils.decode(line.getBytes())))); - sb.append("\n"); - write("235"); - } - else if (line.equals("DATA")) { - write("354"); - } - else if (line.equals(".")) { - write("250"); - } - else if (line.equals("QUIT")) { - write("221"); - socket.close(); - } - else { - sb.append(line); - sb.append("\n"); - } - } - messages.add(sb.toString()); - } - catch (IOException e) { - if (!this.stopped) { - LOGGER.error(IO_EXCEPTION, e); - } - } - } - - } - - } - - public static class Pop3Server extends MailServer { - - Pop3Server(int port) throws IOException { - super(port); - } - - @Override - protected MailHandler mailHandler(Socket socket) { - return new Pop3Handler(socket); - } - - class Pop3Handler extends MailHandler { - - private static final String PLUS_OK = "+OK"; - - Pop3Handler(Socket socket) { - super(socket); - } - - @Override // NOSONAR - void doRun() { - try { - write("+OK POP3"); - while (!socket.isClosed()) { - String line = reader.readLine(); - if (line == null) { - break; - } - switch (line) { - case "CAPA": - write(PLUS_OK); - write("USER"); - write("."); - break; - case "USER user": - case "PASS pw": - case "NOOP": - write(PLUS_OK); - break; - case "STAT": - write("+OK 1 3"); - break; - case "RETR 1": - write(PLUS_OK); - write(MESSAGE); - write("."); - break; - case "QUIT": - write(PLUS_OK); - socket.close(); - break; - default: - throw new UnsupportedOperationException(line); - } - } - } - catch (IOException e) { - if (!this.stopped) { - LOGGER.error(IO_EXCEPTION, e); - } - } - } - - } - - } - - public static class ImapServer extends MailServer { - - private volatile boolean seen; - - private volatile boolean idled; - - ImapServer(int port) throws IOException { - super(port); - } - - @Override - public void resetServer() { - super.resetServer(); - this.seen = false; - this.idled = false; - } - - @Override - protected MailHandler mailHandler(Socket socket) { - return new ImapHandler(socket); - } - - class ImapHandler extends MailHandler { - - private static final String OK_FETCH_COMPLETED = "OK FETCH completed"; - - /** - * Time to wait while IDLE before returning a result. - */ - private static final int IDLE_WAIT_TIME = 500; - - ImapHandler(Socket socket) { - super(socket); - } - - @Override // NOSONAR - void doRun() { - try { - write("* OK IMAP4rev1 Service Ready"); - String idleTag = ""; - while (!socket.isClosed()) { - String line = reader.readLine(); - if (line == null) { - break; - } - String tag = line.substring(0, line.indexOf(' ') + 1); - if (line.endsWith("CAPABILITY")) { - write("* CAPABILITY IDLE IMAP4rev1"); - write(tag + "OK CAPABILITY completed"); - } - else if (line.endsWith("LOGIN user pw")) { - write(tag + "OK LOGIN completed"); - } - else if (line.endsWith("LIST \"\" INBOX")) { - write("* LIST \"/\" \"INBOX\""); - write(tag + "OK LIST completed"); - } - else if (line.endsWith("LIST \"\" \"\"")) { - write("* LIST \"/\" \"\""); - write(tag + "OK LIST completed"); - } - else if (line.endsWith("SELECT INBOX")) { - write("* 1 EXISTS"); - if (!seen) { - write("* 1 RECENT"); - write("* OK [UNSEEN 1]"); - } - else { - write("* OK"); - } - write("* OK [PERMANENTFLAGS (\\Deleted \\Seen \\*)]"); // \* - user flags allowed - write(tag + "OK SELECT completed"); - } - else if (line.endsWith("EXAMINE INBOX")) { - write(tag + "OK"); - } - else if (line.endsWith("SEARCH FROM bar@baz UNSEEN ALL")) { - searchReply(tag); - } - else if (line.endsWith("SEARCH NOT (DELETED) NOT (SEEN) NOT (KEYWORD testSIUserFlag) ALL")) { - searchReply(tag); - assertions.add("searchWithUserFlag"); - } - else if (line.contains("FETCH 1 (ENVELOPE")) { - write("* 1 FETCH (RFC822.SIZE " - + MESSAGE.length() - + " INTERNALDATE \"27-May-2013 09:45:41 +0000\" " - + "FLAGS (\\Seen) " - + "ENVELOPE (\"Mon, 27 May 2013 15:14:49 +0530\" " - + "\"Test Email\" " - + "((\"Bar\" NIL \"bar\" \"baz\")) " // From - + "((\"Bar\" NIL \"bar\" \"baz\")) " // Sender - + "((\"Bar\" NIL \"bar\" \"baz\")) " // Reply To - + "((\"Foo\" NIL \"foo\" \"bar\")) " // To - + "((NIL NIL \"a\" \"b\") (NIL NIL \"c\" \"d\")) " // cc - + "((NIL NIL \"e\" \"f\") (NIL NIL \"g\" \"h\")) " // bcc - + "\"<4DA0A7E4.3010506@baz.net>\" " // In reply to - + "\"\") " // msgid - + "BODYSTRUCTURE " - + "(\"TEXT\" \"PLAIN\" (\"CHARSET\" \"ISO-8859-1\") NIL NIL \"7BIT\" 1 5)))"); - write(tag + OK_FETCH_COMPLETED); - } - else if (line.contains("FETCH 2 (BODYSTRUCTURE)")) { - write("* 2 FETCH " + - "BODYSTRUCTURE " - + "(\"TEXT\" \"PLAIN\" (\"CHARSET\" \"ISO-8859-1\") NIL NIL \"7BIT\" 1 5)))"); - write(tag + OK_FETCH_COMPLETED); - } - else if (line.contains("STORE 1 +FLAGS (\\Flagged)")) { - write("* 1 FETCH (FLAGS (\\Flagged))"); - write(tag + "OK STORE completed"); - } - else if (line.contains("STORE 1 +FLAGS (\\Seen)")) { - write("* 1 FETCH (FLAGS (\\Flagged \\Seen))"); - write(tag + "OK STORE completed"); - seen = true; - } - else if (line.contains("FETCH 1 FLAGS")) { - write("* 1 FLAGS(\\Seen)"); - write(tag + OK_FETCH_COMPLETED); - } - else if (line.contains("FETCH 1 (BODY.PEEK")) { - write("* 1 FETCH (BODY[]<0> {" + (MESSAGE.length() + 2) + "}"); - write(MESSAGE); - write(")"); - write(tag + OK_FETCH_COMPLETED); - } - else if (line.contains("CLOSE")) { - write(tag + "OK CLOSE completed"); - } - else if (line.contains("NOOP")) { - write(tag + "OK NOOP completed"); - } - else if (line.endsWith("STORE 1 +FLAGS (testSIUserFlag)")) { - write(tag + "OK STORE completed"); - assertions.add("storeUserFlag"); - } - else if (line.endsWith("IDLE")) { - write("+ idling"); - idleTag = tag; - if (!idled) { - try { - Thread.sleep(IDLE_WAIT_TIME); - write("* 2 EXISTS"); - seen = false; - } - catch (@SuppressWarnings("unused") InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - idled = true; - } - else if (line.equals("DONE")) { - write(idleTag + "OK"); - } - else if (line.contains("LOGOUT")) { - write(tag + "OK LOGOUT completed"); - this.socket.close(); - } - } - } - catch (IOException e) { - if (!this.stopped) { - LOGGER.error(IO_EXCEPTION, e); - } - } - } // NOSONAR - - void searchReply(String tag) throws IOException { - if (seen) { - write("* SEARCH"); - } - else { - write("* SEARCH 1"); - } - write(tag + "OK SEARCH completed"); - } - - } - - } - - public abstract static class MailServer implements Runnable { - - protected final Log LOGGER = LogFactory.getLog(getClass()); // NOSONAR - - protected static final String IO_EXCEPTION = "IOException"; // NOSONAR - - private final ServerSocket serverSocket; - - private final ExecutorService exec = Executors.newCachedThreadPool(); - - protected final Set assertions = new HashSet<>(); // NOSONAR protected - - protected final List messages = new ArrayList<>(); // NOSONAR protected - - private final List handlers = new ArrayList<>(); - - private volatile boolean listening; - - MailServer(int port) throws IOException { - this.serverSocket = ServerSocketFactory.getDefault().createServerSocket(port); - this.listening = true; - exec.execute(this); - } - - public int getPort() { - return this.serverSocket.getLocalPort(); - } - - public boolean isListening() { - return listening; - } - - public List getMessages() { - return messages; - } - - public void resetServer() { - this.assertions.clear(); - } - - public boolean assertReceived(String assertion) { - return this.assertions.contains(assertion); - } - - @Override - public void run() { - try { - while (!serverSocket.isClosed()) { - Socket socket = this.serverSocket.accept(); - MailHandler mailHandler = mailHandler(socket); - this.handlers.add(mailHandler); - exec.execute(mailHandler); - } - } - catch (@SuppressWarnings("unused") IOException e) { - this.listening = false; - } - } - - protected abstract MailHandler mailHandler(Socket socket); - - public void stop() { - try { - for (MailHandler handler : this.handlers) { - handler.stop(); - } - this.serverSocket.close(); - } - catch (IOException e) { - LOGGER.error(IO_EXCEPTION, e); - } - this.exec.shutdownNow(); - } - - public abstract class MailHandler implements Runnable { - - public static final String BODY = "foo\r\n"; - - public static final String MESSAGE = - "To: Foo \r\n" - + "cc: a@b, c@d\r\n" - + "bcc: e@f, g@h\r\n" - + "From: Bar , Bar2 \r\n" - + "Subject: Test Email\r\n" - + "\r\n" + BODY; - - protected final Socket socket; // NOSONAR protected - - private BufferedWriter writer; - - protected StringBuilder sb = new StringBuilder(); // NOSONAR protected - - protected BufferedReader reader; // NOSONAR protected - - protected boolean stopped; // NOSONAR - - MailHandler(Socket socket) { - this.socket = socket; - } - - @Override - public void run() { - try { - this.reader = new BufferedReader(new InputStreamReader(this.socket.getInputStream())); - this.writer = new BufferedWriter(new OutputStreamWriter(this.socket.getOutputStream())); - } - catch (IOException e) { - LOGGER.error(IO_EXCEPTION, e); - } - doRun(); - } - - protected void write(String str) throws IOException { - this.writer.write(str); - this.writer.write("\r\n"); - this.writer.flush(); - } - - abstract void doRun(); - - void stop() { - this.stopped = true; - try { - this.socket.close(); - } - catch (IOException e) { - // NOSONAR - } - } - - } - - } - - private TestMailServer() { - } - -} diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java index 48e857bfe1..53fc14ea80 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/AbstractWebServiceOutboundGateway.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-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. @@ -114,22 +114,6 @@ public abstract class AbstractWebServiceOutboundGateway extends AbstractReplyPro } } - /** - * Specify whether the URI should be encoded after any uriVariables - * are expanded and before sending the request. The default value is true. - * @param encodeUri true if the URI should be encoded. - * @since 4.1 - * @deprecated since 5.3 in favor of {@link #setEncodingMode} - * @see org.springframework.web.util.UriComponentsBuilder - */ - @Deprecated - public void setEncodeUri(boolean encodeUri) { - setEncodingMode( - encodeUri - ? DefaultUriBuilderFactory.EncodingMode.TEMPLATE_AND_VALUES - : DefaultUriBuilderFactory.EncodingMode.NONE); - } - /** * Set the encoding mode to use. * By default, this is set to {@link DefaultUriBuilderFactory.EncodingMode#TEMPLATE_AND_VALUES}. @@ -181,16 +165,6 @@ public abstract class AbstractWebServiceOutboundGateway extends AbstractReplyPro this.webServiceTemplate.setFaultMessageResolver(faultMessageResolver); } - /** - * Specify the {@link WebServiceMessageSender} to use. - * @param messageSender the sender. - * @deprecated in favor of {@link #setMessageSenders(WebServiceMessageSender...)} - */ - @Deprecated - public void setMessageSender(WebServiceMessageSender messageSender) { - setMessageSenders(messageSender); - } - public void setMessageSenders(WebServiceMessageSender... messageSenders) { Assert.state(!this.webServiceTemplateExplicitlySet, () -> "'messageSenders' must be specified on the provided: " + this.webServiceTemplate); @@ -205,7 +179,7 @@ public abstract class AbstractWebServiceOutboundGateway extends AbstractReplyPro @Override protected void doInit() { - this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); + this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); Assert.state(this.destinationProvider == null || CollectionUtils.isEmpty(this.uriVariableExpressions), "uri variables are not supported when a DestinationProvider is supplied."); } diff --git a/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParser.java b/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParser.java index d2e6d53b28..c9ece1c023 100644 --- a/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParser.java +++ b/spring-integration-ws/src/main/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParser.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-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. @@ -86,7 +86,6 @@ public class WebServiceOutboundGatewayParser extends AbstractOutboundGatewayPars IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "reply-timeout", "sendTimeout"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "requires-reply"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "ignore-empty-responses"); - IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "encode-uri"); IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "encoding-mode"); postProcessGateway(builder, element, parserContext); @@ -122,9 +121,6 @@ public class WebServiceOutboundGatewayParser extends AbstractOutboundGatewayPars parserContext.getReaderContext().error( "Only one of message-sender or message-senders should be specified.", element); } - if (StringUtils.hasText(messageSenderRef)) { - builder.addPropertyReference("messageSender", messageSenderRef); - } if (StringUtils.hasText(messageSenderListRef)) { builder.addPropertyReference("messageSenders", messageSenderListRef); } diff --git a/spring-integration-ws/src/main/resources/org/springframework/integration/ws/config/spring-integration-ws.xsd b/spring-integration-ws/src/main/resources/org/springframework/integration/ws/config/spring-integration-ws.xsd index 76dc43e436..efb98b7082 100644 --- a/spring-integration-ws/src/main/resources/org/springframework/integration/ws/config/spring-integration-ws.xsd +++ b/spring-integration-ws/src/main/resources/org/springframework/integration/ws/config/spring-integration-ws.xsd @@ -124,19 +124,6 @@ ]]> - - - - [DEPRECATED] When set to "false", the URI won't be encoded before the request is sent. This may be useful - in some scenarios as it allows user control over the encoding, if needed. Default is "true". - This attribute is ignored, if 'destination-provider' is specified. - Deprecated since 5.3 in favor of 'encoding-mode'. - - - - - - @@ -240,18 +227,6 @@ - - - - Reference to the bean definition of a WebServiceMessageSender. - - - - - - - - diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/WebServiceOutboundGatewayInsideChainTests-context.xml b/spring-integration-ws/src/test/java/org/springframework/integration/ws/WebServiceOutboundGatewayInsideChainTests-context.xml index a187f604ba..8345002581 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/WebServiceOutboundGatewayInsideChainTests-context.xml +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/WebServiceOutboundGatewayInsideChainTests-context.xml @@ -16,7 +16,7 @@ + message-senders="mockMessageSender"/> + message-senders="jmsMessageSender"> @@ -44,7 +44,7 @@ uri="mailto:{to}?subject={subject}" encoding-mode="VALUES_ONLY" interceptor="emailInterceptor" - message-sender="emailMessageSender"> + message-senders="emailMessageSender"> @@ -61,7 +61,7 @@ + message-senders="xmppMessageSender"> diff --git a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests-context.xml b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests-context.xml index 4fa915c49f..ec27ea443a 100644 --- a/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests-context.xml +++ b/spring-integration-ws/src/test/java/org/springframework/integration/ws/config/WebServiceOutboundGatewayParserTests-context.xml @@ -74,7 +74,7 @@ + message-senders="messageSender"/> > for more information.