Commit Graph

1117 Commits

Author SHA1 Message Date
John Blum
8418082a00 Remove unnecessary ObjectMapper configuration used specifically for deserialization.
Clearly, this configuration is 'unnecessary' because the ObjectMapper is used to serialize Objects to JSON in this converter.

Removes Mixin that virtually annotated application domain model object types with @JsonIgnoreProperties for unknown/unmapped properties.

Removes configuration to accept case insensitive Enum (String) values.

Resolves gh-67.
2020-05-08 00:54:41 -07:00
John Blum
a3faf2584a Configure the ObjectMapper used to convert (serialize) Objects to JSON with Jackson.
Activates default typing using a property.

Adds Mixin to virtually annotate application domain model object types with @JsonTypeInfo.

Adds Mixin to virtually annotate application domain model object types with @JsonIgnoreProperties for unknown/unmapped properties.

Configures JsonGenerator to write BigDecimal values as a plain String.

Configures ObjectMapper to accept case insensitive Enum (String) values.

Configures ObjectMapper to sort properties alphabetically in JSON.

Registers SimpleModule with customer JsonSerializers for java.math.BigDecimal and java.math.BigInteger as well as to render typeless Collections.

Resolves gh-67.
2020-05-08 00:54:41 -07:00
John Blum
2627cf7a90 Change ObjectToJsonConverter implementation from JacksonObjectToJsonConverter to JSONFormatterPdxToJsonConverter.
Note that JSONFormatterPdxToJsonConverter extends JacksonObjectToJsonConverter and adds the capability to convert (serialize) PDX to JSON in addition to Objects.

Resolves gh-67.
2020-05-07 22:16:51 -07:00
John Blum
5b5e2e5db8 Add abstract base class implementing the ObjectArrayToJsonConverter interface to encapsulate operation common to all implementations.
The abstract base class provides convert methods to convert arrays, Iterables and Map.values(). Additionally it contains support to configure the ObjectToJsonConverter used to convert individual Objects into JSON.

Resolves gh-67.
2020-05-07 21:26:18 -07:00
John Blum
72443e95af Add ObjectArrayToJsonConverter interface specifying a contract to convert an array of Objects to JSON.
Resolves gh-67.
2020-05-07 21:24:09 -07:00
John Blum
9232180643 Add JsonToPdxConverter interface implementation converting JSON to PDX backed by Apache Geode's o.a.g.pdx.JSONFormatter class and Jackson's ObjectMapper.
Resolves gh-67.
2020-05-06 13:27:49 -07:00
John Blum
7f9b36ec18 Adds ObjectToJsonConverter interface implementation using Jackson to convert an Object to JSON.
Resolves gh-67.
2020-05-06 12:20:52 -07:00
John Blum
e76100af47 Add ObjetToJsonConverter interface implementation to convert an Object or PDX to JSON using Apache Geode's o.a.g.pdx.JSONFormatter class.
This converter extends (is backed by) the JacksonObjectToJsonConverter implementation to fallback on Jackson's ObjectMapper if the Object to convert is not a o.a.g.pdx.PdxInstance.

Resolves gh-67.
2020-05-06 11:45:47 -07:00
John Blum
cb3141f0b7 Add JsonToPdxConverter interface implementation to convert JSON to PDX using Apache Geode's o.a.g.pdx.JSONFormatter class.
Resolves gh-67.
2020-05-06 11:42:06 -07:00
John Blum
9f97a8313d Add conditional logic to handle beans of type ResolvableRegionFactoryBean.
Resolves gh-67.
2020-05-06 11:07:52 -07:00
John Blum
8aed3f95cd Add JSON examples for Integration Tests.
Resolves gh-67.
2020-05-06 00:45:06 -07:00
John Blum
68e7b54c90 Refactor importInto(:Region) to parse and convert JSON containing multiple objects into an array of PdxInstances each stored in the Region.
Edit Javadoc.

Resolves gh-67.
2020-05-06 00:43:03 -07:00
John Blum
e67c383de8 Add JsonToPdxArrayConverter interface and Spring Converter extension specifying a contract to convert JSON into PDX, as an array of PdxInstance objects.
Resolves gh-69.
2020-05-06 00:37:31 -07:00
John Blum
bbef166670 Edit Javadoc.
Resolves gh-67.
2020-05-06 00:13:17 -07:00
John Blum
8cf6a8b410 Add configurable Product.category as an enumerated type. 2020-05-05 13:40:03 -07:00
John Blum
3f05015b2f Refactor example POS application model classes to be conducive to Jackson's ObjectMapper configuration imposed by GemFire/Geode PDX framework and JSONFormatter class. 2020-05-05 13:15:24 -07:00
John Blum
c3b697e759 Complete base implementation of the JSON CacheDataImporterExporter.
Resolves gh-67.
2020-05-05 11:14:04 -07:00
John Blum
ec20642cc1 Add ObjectToJsonConverter interface specifying a contract for converting an Object to JSON.
Resolves gh-67.
2020-05-05 11:14:04 -07:00
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
98c976fe6c Add example application model classes for a PurchaseOrder in a Point-of-Sale (POS) system. 2020-05-05 11:14:04 -07:00
John Blum
a0ead741ab Add implementation of CacheDataImporter/Exporter to import/export JSON sourced data.
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
76ef0e7062 Introduce CacheDataImporterExporter interface extending the CacheDataImporter and CacheDataExporter interfaces.
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
fe6e14bb2e Upgrade to Spring Boot 2.3.0.RC1. 2020-05-05 11:01:13 -07:00
John Blum
cac192ddc8 Upgrade to Spring Framework 5.2.6.RELEASE. 2020-05-05 11:00:45 -07:00
John Blum
293eebb676 Add Spring Boot application class configuring and bootstrapping an Apache Geode (or Pivotal GemFire) ClientCache instance for documentation purposes. 2020-05-05 10:56:56 -07:00
John Blum
0053484007 Add optional 'spring-geode-starter-logging' dependency. 2020-04-29 20:55:21 -07:00
John Blum
08bb53f792 Add Smoke Tests asserting the proper behavior of a properly configured Spring ApplicationContext in the case of forced-disconnect / auto-reconnect events in a GemFire/Geode DistributedSystem (cluster). 2020-04-27 15:22:54 -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
0950ba7d9f Reorganize assertions in GeodeAssertions alphabetically. 2020-04-27 14:39:27 -07:00
John Blum
ed0989cce0 Refactor MembershipListenerAdapter away from using java.util.function.Consumer implementations to delegate the processing of membership event towards using the new MembershipEvent types along with overloaded membership event handler methods.
Move MembershipListenerAdapter from org.springframework.geode.distributed to org.springframework.geode.distributed.event.

Edit Javadoc.
2020-04-27 14:35:21 -07:00
John Blum
f134c06390 Introduce the QuorumLostEvent class extending MembershipEvent to signal that a quorum of peer members was lost in the event of a split brain or network partition. 2020-04-27 14:31:36 -07:00
John Blum
6cff7a3da0 Introduce the MemberSuspectEvent class extends MembershipEvent to signal when a peer member of the distributd system (cluster) becomes suspect.
A peer member of the distributed system (cluster) becomse suspect when it is no longer responsive to other peer members in the cluster.
2020-04-27 14:29:54 -07:00
John Blum
dad1459c44 Introduce the MemberJoinedEvent class extending MembershipEvent to signal when a new member joins the distributed system (cluster) as a peer. 2020-04-27 14:28:41 -07:00
John Blum
0f1dbc175d Introduce the MemberDepartedEvent class extending MembershipEvent to signal when a peer member departs from the distributed system (cluster). 2020-04-27 14:27:45 -07:00
John Blum
afb853646f Introduce the abstract MembershipEvent class to encapsulate the details of a membership event (e.g. memberJoined event) as defined by the o.a.g.distributed.internal.MembershipListener interface. 2020-04-27 14:25:27 -07:00
John Blum
929b2e49e5 Add MembershipListenerAdaper class implementing and adapting the o.a.g.distributed.internal.MembershipListener interface.
The internal Apache Geode API MembershipListener interface is useful for receiving notification in the event a peer cache member is disconnected (forced disconnected) and then auto-reconnected to the cluster.
2020-04-27 14:18:45 -07:00
John Blum
3770ff4569 Introduce TupleConsumer interface extending and implementing the java.util.function.Consumer interface accepting a variable number of arguments reprented by InvocationArguments. 2020-04-27 14:18:45 -07:00
John Blum
7ab6cc25b8 Introduce TriConsumer interface modeled after the java.util.function.Consumer interface that accepts 3 arguments. 2020-04-27 14:18:45 -07:00
John Blum
6f0b2ecf84 Introduce InvocationArguments type to capture the arguments passed to a method invocation's parameters. 2020-04-27 14:18:45 -07:00
John Blum
b1e9a30e10 Override ApplicationContext prepareRefresh() and onRefresh() methods.
Add option to copy configuration from the pre-refresh BeanFactory to the post-refresh BeanFactory instance.

Apply appropriate Spring @NonNull and @Nullable annotations.

Edit Javadoc.
2020-04-27 14:18:45 -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
cd85bc9112 Add SLF4J, Logback configuration file to configure the log levels for Apache Geode and Spring Framework in Integration Tests. 2020-04-24 15:50:36 -07:00
John Blum
d5a9883258 Add optional 'apache-geode-extensions' dependency. 2020-04-24 15:49:56 -07:00
John Blum
d0fb0b3485 Add optional 'org.springframework:spring-test' dependency. 2020-04-24 15:48:47 -07:00
John Blum
ee4026ae4f Downgrade to Spring Boot 2.3.0.M4 (from 2.3 build snapshots).
Currently, the Spring Boot 2.3.0.BUILD-SNAPSHOTS are unresolvable due to a maven-metadate.xml file problem involving file timestamps that Gradle cannot resolve (unlike Maven)! #sigh
2020-04-21 14:39:14 -07:00
John Blum
f2f502e288 Fix misspelling. 2020-04-20 21:18:11 -07:00