diff --git a/build.gradle b/build.gradle
index 3f077c920c..a38e04e01c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -135,7 +135,6 @@ allprojects {
'https://jakarta.ee/specifications/platform/9/apidocs/',
'https://docs.spring.io/spring-framework/docs/current/javadoc-api',
'https://docs.spring.io/spring-amqp/docs/current/api/',
- 'https://docs.spring.io/spring-data-gemfire/docs/current/api/',
'https://docs.spring.io/spring-data/data-mongo/docs/current/api/',
'https://docs.spring.io/spring-data/data-redis/docs/current/api/',
'https://docs.spring.io/spring-ws/docs/current/api/'
@@ -583,11 +582,11 @@ project('spring-integration-file') {
testImplementation project(':spring-integration-redis')
testImplementation project(':spring-integration-redis').sourceSets.test.output
- testImplementation project(':spring-integration-gemfire')
testImplementation project(':spring-integration-jdbc')
testImplementation "com.h2database:h2:$h2Version"
testImplementation "io.lettuce:lettuce-core:$lettuceVersion"
testImplementation "com.jayway.jsonpath:json-path:$jsonpathVersion"
+ testImplementation 'com.fasterxml.jackson.core:jackson-databind'
}
}
@@ -604,31 +603,6 @@ project('spring-integration-ftp') {
}
}
-project('spring-integration-gemfire') {
- description = 'Spring Integration GemFire Support'
- dependencies {
- api project(':spring-integration-core')
- api('org.springframework.data:spring-data-geode') {
- exclude group: 'org.springframework'
- exclude group: 'org.apache.shiro', module: 'shiro-event'
- exclude group: 'org.apache.shiro', module: 'shiro-lang'
- exclude group: 'org.apache.shiro', module: 'shiro-crypto-hash'
- exclude group: 'org.apache.shiro', module: 'shiro-crypto-cipher'
- exclude group: 'org.apache.shiro', module: 'shiro-config-ogdl'
- exclude group: 'org.apache.shiro', module: 'shiro-config-core'
- exclude group: 'org.apache.shiro', module: 'shiro-cache'
- exclude group: 'commons-logging'
- }
- api "commons-io:commons-io:$commonsIoVersion"
-
- testImplementation project(':spring-integration-stream')
- }
-
- tasks.withType(JavaForkOptions) {
- jvmArgs '--add-opens', 'jdk.management/com.sun.management.internal=ALL-UNNAMED'
- }
-}
-
project('spring-integration-graphql') {
description = 'Spring Integration GraphQL Support'
dependencies {
diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/aggregator/FileAggregatorTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/aggregator/FileAggregatorTests.java
index 8cdd05254c..1aad767f75 100644
--- a/spring-integration-file/src/test/java/org/springframework/integration/file/aggregator/FileAggregatorTests.java
+++ b/spring-integration-file/src/test/java/org/springframework/integration/file/aggregator/FileAggregatorTests.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 the original author or authors.
+ * Copyright 2021-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.
@@ -33,7 +33,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.ImportResource;
import org.springframework.core.task.TaskExecutor;
import org.springframework.integration.IntegrationMessageHeaderAccessor;
import org.springframework.integration.channel.QueueChannel;
@@ -56,7 +55,6 @@ import org.springframework.util.FileCopyUtils;
/**
* @author Artem Bilan
- *
* @since 5.5
*/
@SpringJUnitConfig
@@ -81,12 +79,6 @@ public class FileAggregatorTests {
@Autowired
PollableChannel resultChannel;
- @Autowired
- MessageChannel input;
-
- @Autowired
- PollableChannel output;
-
@BeforeAll
static void setup() throws IOException {
file = new File(tmpDir, "foo.txt");
@@ -146,26 +138,8 @@ public class FileAggregatorTests {
.isEmpty();
}
- @Test
- void testFileAggregatorXmlConfig() {
- this.input.send(new GenericMessage<>(file));
-
- Message> receive = this.output.receive(10_000);
- assertThat(receive).isNotNull();
- assertThat(receive.getHeaders())
- .containsEntry(FileHeaders.FILENAME, "foo.txt")
- .containsEntry(FileHeaders.LINE_COUNT, 4L)
- .doesNotContainKeys("firstLine", IntegrationMessageHeaderAccessor.CORRELATION_ID);
-
- assertThat(receive.getPayload())
- .isInstanceOf(List.class)
- .asList()
- .containsExactly("file header", "first line", "second line", "last line");
- }
-
@Configuration
@EnableIntegration
- @ImportResource("org/springframework/integration/file/aggregator/FileAggregatorTests.xml")
public static class Config {
@Bean
diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/aggregator/FileAggregatorTests.xml b/spring-integration-file/src/test/java/org/springframework/integration/file/aggregator/FileAggregatorTests.xml
deleted file mode 100644
index bb528b2df4..0000000000
--- a/spring-integration-file/src/test/java/org/springframework/integration/file/aggregator/FileAggregatorTests.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-file/src/test/java/org/springframework/integration/file/filters/PersistentAcceptOnceFileListFilterExternalStoreTests.java b/spring-integration-file/src/test/java/org/springframework/integration/file/filters/PersistentAcceptOnceFileListFilterExternalStoreTests.java
index 94aeeacdd8..c5590bb9f8 100644
--- a/spring-integration-file/src/test/java/org/springframework/integration/file/filters/PersistentAcceptOnceFileListFilterExternalStoreTests.java
+++ b/spring-integration-file/src/test/java/org/springframework/integration/file/filters/PersistentAcceptOnceFileListFilterExternalStoreTests.java
@@ -27,7 +27,6 @@ import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
-import org.apache.geode.cache.CacheFactory;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
@@ -35,7 +34,6 @@ import org.mockito.Mockito;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer;
-import org.springframework.integration.gemfire.metadata.GemfireMetadataStore;
import org.springframework.integration.jdbc.metadata.JdbcMetadataStore;
import org.springframework.integration.metadata.ConcurrentMetadataStore;
import org.springframework.integration.redis.RedisContainerTest;
@@ -50,9 +48,7 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
* @author Artem Bilan
* @author Bojan Vukasovic
* @author Artem Vozhdayenko
- *
* @since 4.0
- *
*/
public class PersistentAcceptOnceFileListFilterExternalStoreTests implements RedisContainerTest {
@@ -80,11 +76,6 @@ public class PersistentAcceptOnceFileListFilterExternalStoreTests implements Red
}
}
- @Test
- public void testFileSystemWithGemfireMetadataStore() throws Exception {
- this.testFileSystem(new GemfireMetadataStore(new CacheFactory().create()));
- }
-
@Test
public void testFileSystemWithJdbcMetadataStore() throws Exception {
EmbeddedDatabase dataSource = new EmbeddedDatabaseBuilder()
@@ -135,21 +126,21 @@ public class PersistentAcceptOnceFileListFilterExternalStoreTests implements Red
final FileSystemPersistentAcceptOnceFileListFilter filter =
new FileSystemPersistentAcceptOnceFileListFilter(store, "foo:");
final File file = File.createTempFile("foo", ".txt");
- assertThat(filter.filterFiles(new File[] {file})).hasSize(1);
+ assertThat(filter.filterFiles(new File[]{ file })).hasSize(1);
String ts = store.get("foo:" + file.getAbsolutePath());
assertThat(ts).isEqualTo(String.valueOf(file.lastModified()));
- assertThat(filter.filterFiles(new File[] {file})).isEmpty();
+ assertThat(filter.filterFiles(new File[]{ file })).isEmpty();
assertThat(file.setLastModified(file.lastModified() + 5000L)).isTrue();
- assertThat(filter.filterFiles(new File[] {file})).hasSize(1);
+ assertThat(filter.filterFiles(new File[]{ file })).hasSize(1);
ts = store.get("foo:" + file.getAbsolutePath());
assertThat(ts).isEqualTo(String.valueOf(file.lastModified()));
- assertThat(filter.filterFiles(new File[] {file})).isEmpty();
+ assertThat(filter.filterFiles(new File[]{ file })).isEmpty();
suspend.set(true);
assertThat(file.setLastModified(file.lastModified() + 5000L)).isTrue();
Future result = Executors.newSingleThreadExecutor()
- .submit(() -> filter.filterFiles(new File[] {file}).size());
+ .submit(() -> filter.filterFiles(new File[]{ file }).size());
assertThat(latch2.await(10, TimeUnit.SECONDS)).isTrue();
store.put("foo:" + file.getAbsolutePath(), "43");
latch1.countDown();
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireCqInboundChannelAdapterParser.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireCqInboundChannelAdapterParser.java
deleted file mode 100644
index 93f3638632..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireCqInboundChannelAdapterParser.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2002-2019 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.gemfire.config.xml;
-
-import org.w3c.dom.Element;
-
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.springframework.integration.config.xml.AbstractChannelAdapterParser;
-import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
-import org.springframework.integration.gemfire.inbound.ContinuousQueryMessageProducer;
-
-/**
- * @author David Turanski
- * @author Dan Oxlade
- * @author Gary Russell
- * @author Artem Bilan
- * @since 2.1
- *
- */
-public class GemfireCqInboundChannelAdapterParser extends AbstractChannelAdapterParser {
-
-
- private static final String ERROR_CHANNEL_ATTRIBUTE = "error-channel";
-
- private static final String OUTPUT_CHANNEL_PROPERTY = "outputChannel";
-
- private static final String QUERY_LISTENER_CONTAINER_ATTRIBUTE = "cq-listener-container";
-
- private static final String DURABLE_ATTRIBUTE = "durable";
-
- private static final String QUERY_NAME_ATTRIBUTE = "query-name";
-
- private static final String QUERY_ATTRIBUTE = "query";
-
- private static final String EXPRESSION_ATTRIBUTE = "expression";
-
- private static final String SUPPORTED_EVENT_TYPES_PROPERTY = "supportedEventTypes";
-
- private static final String QUERY_EVENTS_ATTRIBUTE = "query-events";
-
- @Override
- protected AbstractBeanDefinition doParse(Element element, ParserContext parserContext, String channelName) {
- BeanDefinitionBuilder continuousQueryMessageProducer =
- BeanDefinitionBuilder.genericBeanDefinition(ContinuousQueryMessageProducer.class);
- IntegrationNamespaceUtils.setValueIfAttributeDefined(continuousQueryMessageProducer, element,
- EXPRESSION_ATTRIBUTE, "payloadExpressionString");
- IntegrationNamespaceUtils.setValueIfAttributeDefined(continuousQueryMessageProducer, element,
- QUERY_EVENTS_ATTRIBUTE, SUPPORTED_EVENT_TYPES_PROPERTY);
-
- if (!element.hasAttribute(QUERY_LISTENER_CONTAINER_ATTRIBUTE)) {
- parserContext.getReaderContext()
- .error("'" + QUERY_LISTENER_CONTAINER_ATTRIBUTE + "' attribute is required.", element);
- }
-
- if (!element.hasAttribute(QUERY_ATTRIBUTE)) {
- parserContext.getReaderContext().error("'" + QUERY_ATTRIBUTE + "' attribute is required.", element);
- }
-
- continuousQueryMessageProducer.addConstructorArgReference(element.getAttribute(QUERY_LISTENER_CONTAINER_ATTRIBUTE));
- continuousQueryMessageProducer.addConstructorArgValue(element.getAttribute(QUERY_ATTRIBUTE));
-
- continuousQueryMessageProducer.addPropertyReference(OUTPUT_CHANNEL_PROPERTY, channelName);
- IntegrationNamespaceUtils.setReferenceIfAttributeDefined(continuousQueryMessageProducer, element,
- ERROR_CHANNEL_ATTRIBUTE);
-
- IntegrationNamespaceUtils.setValueIfAttributeDefined(continuousQueryMessageProducer, element, QUERY_NAME_ATTRIBUTE);
- IntegrationNamespaceUtils.setValueIfAttributeDefined(continuousQueryMessageProducer, element, DURABLE_ATTRIBUTE);
- return continuousQueryMessageProducer.getBeanDefinition();
- }
-
-}
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireInboundChannelAdapterParser.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireInboundChannelAdapterParser.java
deleted file mode 100644
index 67928a8ad9..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireInboundChannelAdapterParser.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright 2002-2019 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.gemfire.config.xml;
-
-import org.w3c.dom.Element;
-
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.springframework.integration.config.xml.AbstractChannelAdapterParser;
-import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
-import org.springframework.integration.gemfire.inbound.CacheListeningMessageProducer;
-
-/**
- * @author David Turanski
- * @author Gary Russell
- * @author Artem Bilan
- * @since 2.1
- */
-public class GemfireInboundChannelAdapterParser extends AbstractChannelAdapterParser {
-
- private static final String ERROR_CHANNEL_ATTRIBUTE = "error-channel";
-
- private static final String OUTPUT_CHANNEL_PROPERTY = "outputChannel";
-
- private static final String REGION_ATTRIBUTE = "region";
-
- private static final String EXPRESSION_ATTRIBUTE = "expression";
-
- private static final String SUPPORTED_EVENT_TYPES_PROPERTY = "supportedEventTypes";
-
- private static final String CACHE_EVENTS_ATTRIBUTE = "cache-events";
-
- @Override
- protected AbstractBeanDefinition doParse(Element element, ParserContext parserContext, String channelName) {
- BeanDefinitionBuilder listeningMessageProducer =
- BeanDefinitionBuilder.genericBeanDefinition(CacheListeningMessageProducer.class);
- IntegrationNamespaceUtils.setValueIfAttributeDefined(listeningMessageProducer, element,
- EXPRESSION_ATTRIBUTE, "payloadExpressionString");
- IntegrationNamespaceUtils.setValueIfAttributeDefined(listeningMessageProducer, element,
- CACHE_EVENTS_ATTRIBUTE, SUPPORTED_EVENT_TYPES_PROPERTY);
-
- if (!element.hasAttribute(REGION_ATTRIBUTE)) {
- parserContext.getReaderContext().error("'region' attribute is required.", element);
- }
-
- listeningMessageProducer.addConstructorArgReference(element.getAttribute(REGION_ATTRIBUTE));
-
- listeningMessageProducer.addPropertyReference(OUTPUT_CHANNEL_PROPERTY, channelName);
- IntegrationNamespaceUtils.setReferenceIfAttributeDefined(listeningMessageProducer, element,
- ERROR_CHANNEL_ATTRIBUTE);
- return listeningMessageProducer.getBeanDefinition();
- }
-
-}
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireIntegrationNamespaceHandler.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireIntegrationNamespaceHandler.java
deleted file mode 100644
index 3492154fd3..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireIntegrationNamespaceHandler.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2002-2019 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.gemfire.config.xml;
-
-import org.springframework.integration.config.xml.AbstractIntegrationNamespaceHandler;
-
-/**
- * @author David Turanski
- * @since 2.1
- */
-public class GemfireIntegrationNamespaceHandler extends AbstractIntegrationNamespaceHandler {
-
- /* (non-Javadoc)
- * @see org.springframework.beans.factory.xml.NamespaceHandler#init()
- */
- public void init() {
- registerBeanDefinitionParser("inbound-channel-adapter", new GemfireInboundChannelAdapterParser());
- registerBeanDefinitionParser("cq-inbound-channel-adapter", new GemfireCqInboundChannelAdapterParser());
- registerBeanDefinitionParser("outbound-channel-adapter", new GemfireOutboundChannelAdapterParser());
- }
-
-}
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireOutboundChannelAdapterParser.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireOutboundChannelAdapterParser.java
deleted file mode 100644
index ec617c8ac4..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/GemfireOutboundChannelAdapterParser.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright 2002-2019 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.gemfire.config.xml;
-
-import java.util.Map;
-
-import org.w3c.dom.Element;
-
-import org.springframework.beans.factory.support.AbstractBeanDefinition;
-import org.springframework.beans.factory.support.BeanDefinitionBuilder;
-import org.springframework.beans.factory.xml.ParserContext;
-import org.springframework.integration.config.xml.AbstractOutboundChannelAdapterParser;
-import org.springframework.integration.gemfire.outbound.CacheWritingMessageHandler;
-import org.springframework.util.xml.DomUtils;
-
-/**
- * @author David Turanski
- * @author Gary Russell
- * @since 2.1
- */
-public class GemfireOutboundChannelAdapterParser extends AbstractOutboundChannelAdapterParser {
-
- private static final String CACHE_ENTRIES_PROPERTY = "cacheEntries";
-
- private static final String CACHE_ENTRIES_ELEMENT = "cache-entries";
-
- private static final String REGION_ATTRIBUTE = "region";
-
- /* (non-Javadoc)
- * @see AbstractOutboundChannelAdapterParser#parseConsumer(Element, ParserContext)
- */
- @Override
- protected AbstractBeanDefinition parseConsumer(Element element, ParserContext parserContext) {
- BeanDefinitionBuilder cacheWritingMessageHandler = BeanDefinitionBuilder.genericBeanDefinition(
- CacheWritingMessageHandler.class);
- if (!element.hasAttribute(REGION_ATTRIBUTE)) {
- parserContext.getReaderContext().error("'region' attribute is required.", element);
- }
-
- cacheWritingMessageHandler.addConstructorArgReference(element.getAttribute(REGION_ATTRIBUTE));
-
- Element cacheEntries = DomUtils.getChildElementByTagName(element, CACHE_ENTRIES_ELEMENT);
- if (cacheEntries != null) {
- Map, ?> map = parserContext.getDelegate()
- .parseMapElement(cacheEntries, cacheWritingMessageHandler.getBeanDefinition());
- cacheWritingMessageHandler.addPropertyValue(CACHE_ENTRIES_PROPERTY, map);
- }
- return cacheWritingMessageHandler.getBeanDefinition();
- }
-}
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/package-info.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/package-info.java
deleted file mode 100644
index 83e13b5ba4..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/config/xml/package-info.java
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * Provides classes for configuration - parsers, namespace handlers.
- */
-package org.springframework.integration.gemfire.config.xml;
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/CacheListeningMessageProducer.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/CacheListeningMessageProducer.java
deleted file mode 100644
index 61c609c649..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/CacheListeningMessageProducer.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Copyright 2002-2019 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.gemfire.inbound;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.geode.cache.CacheClosedException;
-import org.apache.geode.cache.CacheListener;
-import org.apache.geode.cache.EntryEvent;
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.util.CacheListenerAdapter;
-
-import org.springframework.integration.endpoint.ExpressionMessageProducerSupport;
-import org.springframework.messaging.Message;
-import org.springframework.util.Assert;
-
-/**
- * An inbound endpoint that listens to a GemFire region for events and then publishes Messages to
- * a channel. The default supported event types are CREATED and UPDATED. See the {@link EventType}
- * enum for all options. A SpEL expression may be provided to generate a Message payload by
- * evaluating that expression against the {@link EntryEvent} instance as the root object. If no
- * payloadExpression is provided, the {@link EntryEvent} itself will be the payload.
- *
- * @author Mark Fisher
- * @author David Turanski
- * @author Artem Bilan
- * @since 2.1
- */
-@SuppressWarnings({ "rawtypes", "unchecked" })
-public class CacheListeningMessageProducer extends ExpressionMessageProducerSupport {
-
- private final Log logger = LogFactory.getLog(this.getClass());
-
- private final Region region;
-
- private final CacheListener, ?> listener;
-
- private volatile Set supportedEventTypes =
- new HashSet(Arrays.asList(EventType.CREATED, EventType.UPDATED));
-
-
- public CacheListeningMessageProducer(Region, ?> region) {
- Assert.notNull(region, "region must not be null");
- this.region = region;
- this.listener = new MessageProducingCacheListener();
- }
-
-
- public void setSupportedEventTypes(EventType... eventTypes) {
- Assert.notEmpty(eventTypes, "eventTypes must not be empty");
- this.supportedEventTypes = new HashSet(Arrays.asList(eventTypes));
- }
-
- @Override
- public String getComponentType() {
- return "gemfire:inbound-channel-adapter";
- }
-
- @Override
- protected void doStart() {
- if (this.logger.isInfoEnabled()) {
- this.logger.info("adding MessageProducingCacheListener to GemFire Region '" + this.region.getName() + "'");
- }
- this.region.getAttributesMutator().addCacheListener(this.listener);
- }
-
- @Override
- protected void doStop() {
- if (this.logger.isInfoEnabled()) {
- this.logger.info("removing MessageProducingCacheListener from GemFire Region '" + this.region.getName() + "'");
- }
- try {
- this.region.getAttributesMutator().removeCacheListener(this.listener);
- }
- catch (CacheClosedException e) {
- if (this.logger.isDebugEnabled()) {
- this.logger.debug(e.getMessage(), e);
- }
- }
-
- }
-
- private class MessageProducingCacheListener extends CacheListenerAdapter {
-
- @Override
- public void afterCreate(EntryEvent event) {
- if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.CREATED)) {
- processEvent(event);
- }
- }
-
- @Override
- public void afterUpdate(EntryEvent event) {
- if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.UPDATED)) {
- processEvent(event);
- }
- }
-
- @Override
- public void afterInvalidate(EntryEvent event) {
- if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.INVALIDATED)) {
- processEvent(event);
- }
- }
-
- @Override
- public void afterDestroy(EntryEvent event) {
- if (CacheListeningMessageProducer.this.supportedEventTypes.contains(EventType.DESTROYED)) {
- processEvent(event);
- }
- }
-
- private void processEvent(EntryEvent event) {
- publish(evaluatePayloadExpression(event));
-
- }
-
- private void publish(Object object) {
- Message> message = null;
- if (object instanceof Message) {
- message = (Message>) object;
- }
- else {
- message = getMessageBuilderFactory().withPayload(object).build();
- }
- sendMessage(message);
- }
- }
-
-}
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/ContinuousQueryMessageProducer.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/ContinuousQueryMessageProducer.java
deleted file mode 100644
index 665e3abf69..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/ContinuousQueryMessageProducer.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright 2002-2019 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.gemfire.inbound;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.geode.cache.query.CqEvent;
-
-import org.springframework.data.gemfire.listener.ContinuousQueryDefinition;
-import org.springframework.data.gemfire.listener.ContinuousQueryListener;
-import org.springframework.data.gemfire.listener.ContinuousQueryListenerContainer;
-import org.springframework.integration.endpoint.ExpressionMessageProducerSupport;
-import org.springframework.messaging.Message;
-import org.springframework.util.Assert;
-
-/**
- * Responds to a Gemfire continuous query (set using the #query field) that is
- * constantly evaluated against a cache
- * {@link org.apache.geode.cache.Region}. This is much faster than
- * re-querying the cache manually.
- *
- * @author Josh Long
- * @author David Turanski
- * @author Artem Bilan
- * @since 2.1
- *
- */
-public class ContinuousQueryMessageProducer extends ExpressionMessageProducerSupport
- implements ContinuousQueryListener {
-
- private static Log logger = LogFactory.getLog(ContinuousQueryMessageProducer.class);
-
- private final String query;
-
- private final ContinuousQueryListenerContainer queryListenerContainer;
-
- private volatile String queryName;
-
- private boolean durable;
-
- private volatile Set supportedEventTypes =
- new HashSet(Arrays.asList(CqEventType.CREATED, CqEventType.UPDATED));
-
- /**
- * @param queryListenerContainer a {@link ContinuousQueryListenerContainer}
- * @param query the query string
- */
- public ContinuousQueryMessageProducer(ContinuousQueryListenerContainer queryListenerContainer, String query) {
- Assert.notNull(queryListenerContainer, "'queryListenerContainer' cannot be null");
- Assert.notNull(query, "'query' cannot be null");
- this.queryListenerContainer = queryListenerContainer;
- this.query = query;
- }
-
- /**
- * @param queryName optional query name
- */
- public void setQueryName(String queryName) {
- this.queryName = queryName;
- }
-
- /**
- * @param durable true if the query is a durable subscription
- */
- public void setDurable(boolean durable) {
- this.durable = durable;
- }
-
- public void setSupportedEventTypes(CqEventType... eventTypes) {
- Assert.notEmpty(eventTypes, "eventTypes must not be empty");
- this.supportedEventTypes = new HashSet(Arrays.asList(eventTypes));
- }
-
- @Override
- public String getComponentType() {
- return "gemfire:cq-inbound-channel-adapter";
- }
-
- @Override
- protected void onInit() {
- super.onInit();
- if (this.queryName == null) {
- this.queryListenerContainer.addListener(new ContinuousQueryDefinition(this.query, this, this.durable));
- }
- else {
- this.queryListenerContainer.addListener(new ContinuousQueryDefinition(this.queryName, this.query, this,
- this.durable));
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.springframework.data.gemfire.listener.QueryListener#onEvent(com.gemstone.gemfire.cache.query.CqEvent)
- */
- @Override
- public void onEvent(CqEvent event) {
- if (isEventSupported(event)) {
- if (logger.isDebugEnabled()) {
- logger.debug(String.format("processing cq event key [%s] event [%s]", event.getQueryOperation()
- .toString(), event.getKey()));
- }
- Message> message = null;
- Object object = evaluatePayloadExpression(event);
- if (object instanceof Message) {
- message = (Message>) object;
- }
- else {
- message = getMessageBuilderFactory().withPayload(object).build();
- }
- sendMessage(message);
- }
- }
-
- private boolean isEventSupported(CqEvent event) {
-
- String eventName = event.getQueryOperation().toString() +
- (event.getQueryOperation().toString().endsWith("Y") ? "ED" : "D");
- CqEventType eventType = CqEventType.valueOf(eventName);
- return this.supportedEventTypes.contains(eventType);
- }
-
-}
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/CqEventType.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/CqEventType.java
deleted file mode 100644
index 7964a5309a..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/CqEventType.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright 2002-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.gemfire.inbound;
-
-/**
- * Enumeration of GemFire Continuous Query Event Types.
- *
- * @author David Turanski
- *
- * @since 2.1
- */
-public enum CqEventType {
- CREATED,
-
- UPDATED,
-
- DESTROYED,
-
- REGION_CLEARED,
-
- REGION_INVALIDATED
-}
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/EventType.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/EventType.java
deleted file mode 100644
index 60be238d84..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/EventType.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright 2002-2019 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.gemfire.inbound;
-
-/**
- * Enumeration of GemFire event types.
- *
- * @author Mark Fisher
- * @since 2.1
- */
-public enum EventType {
-
- CREATED,
-
- UPDATED,
-
- DESTROYED,
-
- INVALIDATED
-
-}
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/package-info.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/package-info.java
deleted file mode 100644
index 29f4b7f241..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/inbound/package-info.java
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * Provides classes supporting inbound endpoints.
- */
-package org.springframework.integration.gemfire.inbound;
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/metadata/GemfireMetadataStore.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/metadata/GemfireMetadataStore.java
deleted file mode 100644
index 6630883014..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/metadata/GemfireMetadataStore.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright 2014-2019 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.gemfire.metadata;
-
-import java.util.List;
-import java.util.Objects;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.apache.geode.cache.Cache;
-import org.apache.geode.cache.EntryEvent;
-import org.apache.geode.cache.Region;
-import org.apache.geode.cache.Scope;
-import org.apache.geode.cache.util.CacheListenerAdapter;
-
-import org.springframework.integration.metadata.ListenableMetadataStore;
-import org.springframework.integration.metadata.MetadataStoreListener;
-import org.springframework.util.Assert;
-
-/**
- * Gemfire implementation of {@link ListenableMetadataStore}.
- * Use this {@link org.springframework.integration.metadata.MetadataStore}
- * to achieve meta-data persistence shared across application instances and
- * restarts.
- *
- * @author Artem Bilan
- * @author Venil Noronha
- * @author Gary Russell
- *
- * @since 4.0
- */
-public class GemfireMetadataStore implements ListenableMetadataStore {
-
- private static final String KEY_MUST_NOT_BE_NULL = "'key' must not be null.";
-
- public static final String KEY = "MetaData";
-
- private final GemfireCacheListener cacheListener = new GemfireCacheListener();
-
- private final Region region;
-
- public GemfireMetadataStore(Cache cache) {
- this(Objects.requireNonNull(cache, "'cache' must not be null")
- .createRegionFactory()
- .setScope(Scope.LOCAL)
- .create(KEY));
- }
-
- public GemfireMetadataStore(Region region) {
- Assert.notNull(region, "'region' must not be null");
- this.region = region;
- this.region.getAttributesMutator()
- .addCacheListener(this.cacheListener);
- }
-
- @Override
- public void put(String key, String value) {
- Assert.notNull(key, KEY_MUST_NOT_BE_NULL);
- Assert.notNull(value, "'value' must not be null.");
- this.region.put(key, value);
- }
-
- @Override
- public String putIfAbsent(String key, String value) {
- Assert.notNull(key, KEY_MUST_NOT_BE_NULL);
- Assert.notNull(value, "'value' must not be null.");
- return this.region.putIfAbsent(key, value);
- }
-
- @Override
- public boolean replace(String key, String oldValue, String newValue) {
- Assert.notNull(key, KEY_MUST_NOT_BE_NULL);
- Assert.notNull(oldValue, "'oldValue' must not be null.");
- Assert.notNull(newValue, "'newValue' must not be null.");
- return this.region.replace(key, oldValue, newValue);
- }
-
- @Override
- public String get(String key) {
- Assert.notNull(key, KEY_MUST_NOT_BE_NULL);
- return this.region.get(key);
- }
-
- @Override
- public String remove(String key) {
- Assert.notNull(key, KEY_MUST_NOT_BE_NULL);
- return this.region.remove(key);
- }
-
- @Override
- public void addListener(MetadataStoreListener listener) {
- Assert.notNull(listener, "'listener' must not be null");
- this.cacheListener.listeners.add(listener);
- }
-
- @Override
- public void removeListener(MetadataStoreListener listener) {
- this.cacheListener.listeners.remove(listener);
- }
-
- private static class GemfireCacheListener extends CacheListenerAdapter {
-
- private final List listeners = new CopyOnWriteArrayList<>();
-
- GemfireCacheListener() {
- }
-
- @Override
- public void afterCreate(EntryEvent event) {
- this.listeners.forEach(listener -> listener.onAdd(event.getKey(), event.getNewValue()));
- }
-
- @Override
- public void afterUpdate(EntryEvent event) {
- this.listeners.forEach(listener -> listener.onUpdate(event.getKey(), event.getNewValue()));
- }
-
- @Override
- public void afterDestroy(EntryEvent event) {
- this.listeners.forEach(listener -> listener.onRemove(event.getKey(), event.getOldValue()));
- }
-
- }
-
-}
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/metadata/package-info.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/metadata/package-info.java
deleted file mode 100644
index 5454827492..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/metadata/package-info.java
+++ /dev/null
@@ -1,4 +0,0 @@
-/**
- * Provides classes for the Gemfire MetadataStore.
- */
-package org.springframework.integration.gemfire.metadata;
diff --git a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/outbound/CacheWritingMessageHandler.java b/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/outbound/CacheWritingMessageHandler.java
deleted file mode 100644
index 018e6d364c..0000000000
--- a/spring-integration-gemfire/src/main/java/org/springframework/integration/gemfire/outbound/CacheWritingMessageHandler.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Copyright 2002-2019 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.gemfire.outbound;
-
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.geode.GemFireCheckedException;
-import org.apache.geode.GemFireException;
-import org.apache.geode.cache.Region;
-
-import org.springframework.data.gemfire.GemfireCallback;
-import org.springframework.data.gemfire.GemfireTemplate;
-import org.springframework.expression.EvaluationContext;
-import org.springframework.expression.Expression;
-import org.springframework.expression.spel.standard.SpelExpressionParser;
-import org.springframework.integration.expression.ExpressionUtils;
-import org.springframework.integration.handler.AbstractMessageHandler;
-import org.springframework.messaging.Message;
-import org.springframework.util.Assert;
-
-/**
- * A {@link org.springframework.messaging.MessageHandler} implementation that writes to a
- * GemFire Region. The Message's payload must be an instance of {@link Map} or
- * {@link #cacheEntryExpressions} must be provided.
- *
- * @author Mark Fisher
- * @author David Turanski
- * @author Artem Bilan
- * @author Gary Russell
- *
- * @since 2.1
- */
-public class CacheWritingMessageHandler extends AbstractMessageHandler {
-
- private static final SpelExpressionParser PARSER = new SpelExpressionParser();
-
- private final Map cacheEntryExpressions = new LinkedHashMap();
-
- private final GemfireTemplate gemfireTemplate = new GemfireTemplate();
-
- private volatile EvaluationContext evaluationContext;
-
- @SuppressWarnings("rawtypes")
- public CacheWritingMessageHandler(Region region) {
- Assert.notNull(region, "region must not be null");
- this.gemfireTemplate.setRegion(region);
- }
-
- @Override
- public String getComponentType() {
- return "gemfire:outbound-channel-adapter";
- }
-
- @Override
- protected void onInit() {
- super.onInit();
- this.gemfireTemplate.afterPropertiesSet();
- this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory());
- }
-
- @Override
- @SuppressWarnings({ "unchecked", "rawtypes" })
- protected void handleMessageInternal(Message> message) {
- Object payload = message.getPayload();
- Map, ?> cacheValues = (this.cacheEntryExpressions.size() > 0) ? evaluateCacheEntries(message) : null;
-
- if (cacheValues == null) {
- Assert.state(payload instanceof Map,
- "If cache entry expressions are not configured, then payload must be a Map");
- cacheValues = (Map) payload;
- }
-
- final Map, ?> map = cacheValues;
-
- this.gemfireTemplate.execute(new GemfireCallback