Commit Graph

54 Commits

Author SHA1 Message Date
John Blum
8cb59be29c Add JsonToPdxConverter interface specifying a contract to convert JSON to PDX.
The JSON may be expressed as a byte[] or a String.

Resolves gh-67.
2020-05-05 11:14:04 -07:00
John Blum
074fd7f1ed Add java.util.function.Predicate on Region to filter Regions on data import/export.
Add protected getLogger() method returning a SLF4J Logger to log messages and events during data import/export operations.

Format source code.

Resolves gh-67.
2020-05-05 11:14:04 -07:00
John Blum
1b44a80830 Add abstract base class implementation of the CacheDataImporterExporter interface to correctly manage data exports and imports based on application and Environment (context) configuration.
Resolves gh-67.
2020-05-05 11:14:04 -07:00
John Blum
1a19c228be Introduce new CacheDataImporter and CacheDataExporter interfaces to import and export data into and out from a GemFire/Geode cache on startup.
These new interfaces and APIs are intended to be used in SBDG's auto-configuration when the Spring Boot app using Apache Geode starts up in order to load or save data.

Resolves gh-67.
2020-05-05 11:14:04 -07:00
John Blum
46722ea9c4 Add ApplicationContextMembershipListener implementation and extension of MembershipListenerAdapter to adapt the Spring ApplicationContext to handle peer member departed and joined membership events. 2020-04-27 15:16:42 -07:00
John Blum
2deb202c21 Add new AbstractContextLoader implementation and extension to the Spring TestContext Framework to configure and bootstrap the RefreshableAnnotationConfigApplicationContext used in Spring based tests. 2020-04-27 14:18:45 -07:00
John Blum
e8ddc1f744 Introduce new Spring ApplicationContext implementation and extension that is Refreshable and can be configured with Annotations. 2020-04-27 14:18:45 -07:00
John Blum
069ad68016 Add Unit Test demonstrating how to use Mock objects with Spring's Cache Abstraction in a @Cacheable @Service component/bean. 2020-03-20 14:01:28 -07:00
John Blum
8447eaad10 Update Copyright to 2020. 2020-02-19 23:04:23 -08:00
John Blum
1969f89492 Add GeodeLoggingApplicationListener registered with Spring Boot to handle backwards compatibility and existing logging configuration expressed with SDG.
User may configure logging using @ClientCacheApplication(logLevel = INFO), or by annotating their Spring application class with @EnableLogging(logLevel = INFO) or using 1 of SDG's logging configuration properties ['spring.data.gemfire.cache.log-level', 'spring.data.gemfire.logging.level'], therefore, SBDG makes a best attempt to honor those logging configuration settings.

Resolves gh-73.
2020-02-14 15:19:14 -08:00
John Blum
ddafaafe56 Fix tests failures in the Apache Geode, Inline Caching support Integration Tests involving Apache Cassandra due to the DataStax 4.x Driver upgrade in Spring Data Neumann/2.3. 2020-01-22 12:39:12 -08:00
John Blum
0300d0e753 Format source code and optimize imports. 2019-12-09 16:22:50 -08:00
John Blum
25960adc4d Add auto-configuration support for TLS using SSL when deploying Spring Boot ClientCache applications to PCF using PCC that requires secure Sockets.
The TLS/SSL auto-configuration enables and configures the use of the SSL default context provided by the JRE, which the ClientCache instance uses to obtain the required CERT necessary when creating SSL Sockets between the client and PCC servers.

Resolves gh-61.
2019-10-17 15:50:26 -07:00
John Blum
4eff04c517 Refactor Cluster-aware Conditions to be CloudFoundry Environment-aware.
Resolves gh-56.
2019-09-24 00:34:36 -07:00
John Blum
ff3ddaf586 Adds support to properly clean up and 'reset' the ClusterAwareConfiguration.ClusterAwareCondition state on ApplicationContext closed events. 2019-09-12 17:40:08 -07:00
John Blum
c3f19df920 Move ClusterAwareConfiguration.ClusterAwareCondition.reset() to @AfterClass tear down method. 2019-09-12 16:57:48 -07:00
John Blum
7992b3e893 Edit Javadoc. 2019-09-12 01:09:38 -07:00
John Blum
a8e29f7065 Provide ability to reset Cluster-Aware Configuration Condition state. 2019-09-12 01:09:38 -07:00
John Blum
c1d7424de1 Add @EnableClusterAware annotation configuration support allowing developers to seamlessly switch between local and client/server development environments.
Resolves gh-52.
2019-09-12 01:09:38 -07:00
John Blum
69250d1e30 Add capability to find an optional user by name.
Resolves gh-44.
2019-09-10 12:29:32 -07:00
John Blum
8febb7cab4 Mock the SDG o.s.d.g.LocatorFactoryBean. 2019-09-03 14:36:35 -07:00
John Blum
f39f480a1a Format source code; Optimize imports. 2019-09-03 13:01:55 -07:00
John Blum
d16e36a38f Extend o.s.d.g.tests.integration.IntegrationTestsSupport.
Format source code.

Optimize imports.
2019-09-03 13:01:22 -07:00
John Blum
263206a3c0 Add LocatorConfigurer to LocatorApplication configuration class to disable Apache Geode Cluster Configuration.
Add Before and After cleanup() method to remove any Locator runtime files and directories.
2019-09-03 12:50:04 -07:00
John Blum
a16018bcb2 Add support for 'locators' and 'remote-locators' properties configuration on Spring Boot, Apache Geode Locator applications when using the @UseLocators annotation. 2019-09-01 10:58:58 -07:00
John Blum
6c1c7af36d Adapt to API and TestContext behavior changes in Spring Framework 5.2. 2019-08-21 11:56:31 -07:00
John Blum
621982f472 Add functionality to target and extract VCAP environment variable configuration for a specific CloudCache Service Instance in PCF.
Resolves gh-33.
2019-06-28 18:43:27 -07:00
John Blum
6e81c007e6 Add comparable methods to optionally 'find' as well as 'require' a CloudCache Service Instance in PCF.
Resolves gh-33.
2019-06-28 13:03:30 -07:00
John Blum
a8f88dff0a Declare AbstractInlineCachingWithExternalDataSourceIntegrationTests as a proper abstract class. 2019-06-13 01:39:14 -07:00
John Blum
bc1c259fb7 Add Integration Tests testing the Inline Caching support using Apache Cassandra. 2019-06-13 01:32:02 -07:00
John Blum
d3bb6e4b32 Extend AbstractInlineCachingWithExternalDataSourceIntegrationTests. 2019-06-13 01:31:14 -07:00
John Blum
6837ac82c9 Add abstract base class encapsulating functionality and test cases common to all Inline Caching Integration Tests. 2019-06-13 01:30:00 -07:00
John Blum
7b5824f4c7 Add Integration Tests testing the Inline Caching support using a RDBMS (HSQLDB Database). 2019-06-13 00:19:10 -07:00
John Blum
82a3887f89 Add RegionConfigurer to enable Inline Caching capabilities using a SD CrudRepository for an application Region. 2019-06-12 18:06:10 -07:00
John Blum
7278f2af6e Add RegionConfigurer to register a SD CrudRepository as a Region CacheWriter to write-through to an external data source for Inline Caching. 2019-06-12 11:00:34 -07:00
John Blum
f82bf7380a Add RegionConfigurer to register a SD CrudRepository as a Region CacheLoader to handle cache misses in Inline Caching. 2019-06-12 10:59:23 -07:00
John Blum
7617fddd78 Add a concrete o.s.g.cache.RepositoryCacheLoader class, which implements org.apache.geode.cache.CacheLoader and uses (delegates to) a Spring Data CrudRepository. 2019-05-09 19:52:09 -07:00
John Blum
c33d75db27 Add a concrete o.s.g.cache.RepositoryCacheWriter class, which implements org.apache.geode.cache.CacheWriter and uses (delegates to) a Spring Data CrudRepository. 2019-05-09 19:51:11 -07:00
John Blum
a1300c5fc5 Add abstract base class supporting the development of Spring Data Repository, Apache Geode CacheLoader/CacheWriter implementations. 2019-05-09 19:49:29 -07:00
John Blum
b9578f679d Add abstract utility class for working with java.util.function.Functions. 2019-05-09 19:45:50 -07:00
John Blum
cdcbbca6a4 Encapsulate configuration of Apache Geode/Pivotal GemFire (PCC) Security (Auth) using an enabling Annotation with the CacheFactory API. 2019-05-06 16:48:23 -07:00
John Blum
fa421c6da4 Refactor SecurityManagerProxy class.
Remove init(:Properties) method call from constructor.

Implement the o.s.beans.factory.BeanFactoryAware interface.

Override the locateBeanFactory() method.

Switch the test configuration to use the new @EnableSecurityManagerProxy annotation.
2019-05-06 16:48:23 -07:00
John Blum
71c93615d9 Refactor test class setup and tearDown.
Remove GemfireBeanFactoryLocator cleanup.  Rely on IntegrationTestsSupport to cleanup the GemfireBeanFactoryLocator state.

Rename setup/tearDown method from cleanUpBeanFactoryLocatorReferences to cleanupSecurityManagerProxyInstance.
2019-05-06 16:48:23 -07:00
John Blum
a366c7abd5 Add findMethod(:Class, :String, :Object[]):Optional<Method> and supporting private Predicate creation methods.
findMethod(..) matches a Method based on the Object's Class type, the Method name and whether the arguments passed can be used to invoek a (potentially) overloaded method by the same name.

Add a resolveInvocationTarget(:Object, :Method) to resolve the target of the Method invocation.

The target of the Method invocation is determined by whether the Method is static; if the Method is static, then the resolved target is null, otherwise it is the target Object.
2019-04-29 16:13:00 -07:00
Spring Operator
928d96e0f5 URL Cleanup.
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* [ ] http://cloudcache-9defb33a-6b8b-49f0-bd35-cf6f7b2f222f.sys.tunis.cf-app.com/gemfire/v1 (ConnectTimeoutException) with 1 occurrences migrated to:
  https://cloudcache-9defb33a-6b8b-49f0-bd35-cf6f7b2f222f.sys.tunis.cf-app.com/gemfire/v1 ([https](https://cloudcache-9defb33a-6b8b-49f0-bd35-cf6f7b2f222f.sys.tunis.cf-app.com/gemfire/v1) result ConnectTimeoutException).
* [ ] http://cloudcache-9defb33a-6b8b-49f0-bd35-cf6f7b2f222f.sys.tunis.cf-app.com/pulse (ConnectTimeoutException) with 2 occurrences migrated to:
  https://cloudcache-9defb33a-6b8b-49f0-bd35-cf6f7b2f222f.sys.tunis.cf-app.com/pulse ([https](https://cloudcache-9defb33a-6b8b-49f0-bd35-cf6f7b2f222f.sys.tunis.cf-app.com/pulse) result ConnectTimeoutException).
* [ ] http://gemfire- (UnknownHostException) with 1 occurrences migrated to:
  https://gemfire- ([https](https://gemfire-) result UnknownHostException).
* [ ] http://skullbox:7070/v1/gemfire (UnknownHostException) with 1 occurrences migrated to:
  https://skullbox:7070/v1/gemfire ([https](https://skullbox:7070/v1/gemfire) result UnknownHostException).

These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* [ ] http://geode.apache.org/ with 3 occurrences migrated to:
  https://geode.apache.org/ ([https](https://geode.apache.org/) result 200).
* [ ] http://geode.apache.org/docs/guide/ with 1 occurrences migrated to:
  https://geode.apache.org/docs/guide/ ([https](https://geode.apache.org/docs/guide/) result 200).
* [ ] http://geode.apache.org/releases/latest/javadoc with 1 occurrences migrated to:
  https://geode.apache.org/releases/latest/javadoc ([https](https://geode.apache.org/releases/latest/javadoc) result 200).
* [ ] http://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/client/ClientCache.html with 1 occurrences migrated to:
  https://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/client/ClientCache.html ([https](https://geode.apache.org/releases/latest/javadoc/org/apache/geode/cache/client/ClientCache.html) result 200).
* [ ] http://projects.spring.io/spring-boot/ with 3 occurrences migrated to:
  https://projects.spring.io/spring-boot/ ([https](https://projects.spring.io/spring-boot/) result 200).
* [ ] http://projects.spring.io/spring-data-gemfire/ with 2 occurrences migrated to:
  https://projects.spring.io/spring-data-gemfire/ ([https](https://projects.spring.io/spring-data-gemfire/) result 200).
* [ ] http://shiro.apache.org/realm.html with 1 occurrences migrated to:
  https://shiro.apache.org/realm.html ([https](https://shiro.apache.org/realm.html) result 200).
* [ ] http://stackoverflow.com with 1 occurrences migrated to:
  https://stackoverflow.com ([https](https://stackoverflow.com) result 200).
* [ ] http://stackoverflow.com/tags/spring-session with 1 occurrences migrated to:
  https://stackoverflow.com/tags/spring-session ([https](https://stackoverflow.com/tags/spring-session) result 200).
* [ ] http://www.slf4j.org/codes.html with 1 occurrences migrated to:
  https://www.slf4j.org/codes.html ([https](https://www.slf4j.org/codes.html) result 200).
* [ ] http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* [ ] http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* [ ] http://docs.pivotal.io/p-cloud-cache/ with 1 occurrences migrated to:
  https://docs.pivotal.io/p-cloud-cache/ ([https](https://docs.pivotal.io/p-cloud-cache/) result 301).
* [ ] http://docs.spring.io/spring-data-gemfire/docs/current/reference/html/ with 1 occurrences migrated to:
  https://docs.spring.io/spring-data-gemfire/docs/current/reference/html/ ([https](https://docs.spring.io/spring-data-gemfire/docs/current/reference/html/) result 301).
* [ ] http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/ with 1 occurrences migrated to:
  https://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/ ([https](https://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/) result 301).
* [ ] http://gemfire.docs.pivotal.io/ with 1 occurrences migrated to:
  https://gemfire.docs.pivotal.io/ ([https](https://gemfire.docs.pivotal.io/) result 302).

These URLs were intentionally ignored.

* http://localhost:%d/session/attribute with 1 occurrences
* http://localhost:7070/v1/gemfire with 1 occurrences

Resolves gh-28.
2019-03-21 21:11:53 -07:00
John Blum
8da5755ed8 Update copyright to 2019.
Resolves gh-19.
2019-03-21 18:07:02 -07:00
John Blum
fb6fc6c93c Fix failing tests. 2019-01-29 15:05:00 -08:00
John Blum
60d23c9b8f Apply Java 8 constructs and features (e.g. Method References). 2019-01-28 09:41:27 -08:00
John Blum
fe54953e00 Add logic to ignore member name if 'spring.data.gemfire.name' or 'spring.data.gemfire.cache.name' properties are set.
Add logic to ignore member name if the 'spring.application.name' property is set.

Add integration tests asserting that @UseMemberName overrides the name attribute specified in the caching annotations (e.g. @ClientCacheApplication#name() or @PeerCacheApplication#name()).
2018-10-02 16:13:24 -07:00
John Blum
b6e47a6578 Add test cases for getting the value of an Object Field. 2018-09-20 00:07:13 -07:00