Commit Graph

1271 Commits

Author SHA1 Message Date
John Blum
faaa218f51 Add ObjectAwareUtils abstract utility class for perforing functions on Spring Aware Objects.
Spring Aware Objects currently handled by ObjectAwareUtils includes, but is not limited to: ApplicationContextAware, ApplicationEventPublisherAware, BeanClassLoaderAware, BeanFactoryAware, BeanNameAware, EnvironmentAware and ResourceLoaderAware.
2020-07-22 12:42:38 -07:00
John Blum
7a13850ef0 Refactor ResourceCapableCacheDataImporterExporter import & export cache ResourceResolver base classes to be static.
Change AbstractCacheResourceResolver class to be ApplicationContextAware and EnvironmentAware.

Add getLogger() method to the AbstractCacheResourceResolver class.

Add Resource description in Logger message logged by onMissingResource(..) on export.

Annotate AbstractExportResourceResolver.onMisingResource(..) method signature with Spring Framework @NonNull and @Nullable annotations.

Separate logic from afterPropertiesSet() initializing the ApplicationContext, Environment and ResourceLoader objects on aware import/export ResourceResolvers into init methods.

Edit Javadoc.

Resolves gh-92.
2020-07-21 22:29:52 -07:00
John Blum
0cd771b236 Move filter on isImportProfilesActive(:Environment) before Region Predicate test in importInto(:Region).
Move the isImportProfilesActive(:Environment) method before the importInto(:Region) method.

Annotate toSet(..) class method signature with Spring Framework @NonNull and @Nullable annotations.

Edit Javadoc.

Resolves gh-92.
2020-07-21 22:09:49 -07:00
John Blum
bfb26e5980 Refactor ResourceLoaderResourceResolver to describe the Resource onMissingResource(..) when Resource is not null.
Remove 'final' modifier from setResourceLoader(:ResourceLoader).

Edit Javadoc.

Resolves gh-92.
2020-07-21 22:09:25 -07:00
John Blum
a439b8a81d Refactor the ResourceResolver interface, require(..) method to throw a ResourceNotFoundException.
Edit Javadoc.

Resolves gh-92.
2020-07-21 20:33:50 -07:00
John Blum
4a7de7f565 Rearrange the Management REST API property configuration to set properties alphabetically for readability. 2020-07-21 12:00:35 -07:00
John Blum
1976a5f3e6 Refactor FileResourceWriter to throw a ResourceWriteException on a IOException.
Resolves gh-92.
2020-07-20 21:51:38 -07:00
John Blum
84f0af50e4 Adapt cache data import/export auto-configuration to the new ResolverResolver, ResourceReader and ResourceWriter API.
Resolves gh-92.
2020-07-20 20:58:00 -07:00
John Blum
e60231e308 Refactor LifecycleAwareCacheDataImporterExporter to configure the ExportResourceResolver, ImportResourceResolver, ResourceLoader, ResourceReader and ResourceWriter on the decorated, wrapped CacheDataImporterExporter if the importer/exporter is ResourceLoaderAware and Resource capable.
Resolves gh-92.
2020-07-20 20:56:42 -07:00
John Blum
9aa818f398 Refactor ResourceCapableCacheDataImporterExporter to use setter injection instead of field injection.
Fix bug with FileSystemExportResourceResolve to append the file system path with the file system path separator.

Resolves gh-92.
2020-07-20 18:33:02 -07:00
John Blum
9c1f3354ac Edit Javadoc. 2020-07-20 18:25:05 -07:00
John Blum
d38442af2a Refactor AbstractResourceWriter to throw a ResourcewWriteException on an IOException during doWrite(..).
Additionally, add a preProcess(:WritableResource) to process the WritableResource before data for the target Resource is written.

Resolves gh-92.
2020-07-20 18:25:05 -07:00
John Blum
94b16dafbe Refactor AbstractResourceReader to throw a ResourceReadException on an IOException during doRead(..).
Additionally, add a preProcess(:Resource) method to process the Resource before data from the target Resource is read.

Resolves gh-92.
2020-07-20 18:25:05 -07:00
John Blum
3ed0145ea7 Refactor ResourceUtils and rename getWritableResource(:Resource) as asStrictlyWritableResource(:Resource).
Add additional, lenient asWritableResource(:Resource) method return an Optional<WritableResource> if the given Resource is not an instance of WritableResource.

Resolves gh-92.
2020-07-20 17:43:41 -07:00
John Blum
290dbc3e48 Fix Javadoc. 2020-07-20 13:38:53 -07:00
John Blum
2d1cc28188 Refactor JsonCacheDataImporterExporter to extend ResourceCapableCacheDataImporterExporter.
Change doImportInto(:Region) logic to make use of the ImportResourceResolver and ResourceReader on import.

Change doExportFrom(:Region) logic to make use of the ExportResourceResolver and ResourceWriter on export.

Resolves gh-92.
2020-07-20 13:25:26 -07:00
John Blum
4bf62d9bf0 Refactor ResourceCapableCacheDataImporterExporter class with Open/Closed Principles.
Change CacheResourceResolver, ExportResourceResolver and ImportResourceResolver interfaces into @FunctionalInterfaces; provide default implementation for the resolve(location:String):Optional<Resource> method.

Change access modifier on AbstractExportResourceResolver and AbstractImportResourceResolver from protected to public.

Resolves gh-92.
2020-07-20 13:10:20 -07:00
John Blum
e49ffa3d0f Add ResourceResolver implementation that resolves to a single (i.e. 'Singleton') Resource.
Resolve gh-92.
2020-07-20 12:41:34 -07:00
John Blum
a605bd9f40 Add a general ResourceDataAccessException, RuntimeException class indicating problems while accessing the data from a target Resource.
Add ResourceReadException extending ResourceDataAccessException to indicate problems while reading from a target Resource.

Add ResourceWriteException extending ResourceDataAccessException to indicate problems while writing to a target Resource.

Resolves gh-92.
2020-07-20 12:03:01 -07:00
John Blum
58a4992905 Move all Resource handling logic and class member constants to the ResourceCapableCacheDataImporterExporter subclass.
Edit Javadoc.

Change access modifier on getApplicationContext() from public to protected.

Resolves gh-92.
2020-07-16 14:48:01 -07:00
John Blum
681fd81ad2 Define new, abstract ResourceCapableCacheDataImporterExporter capable of handling dynamic Resources.
The primary concerns involve resolving Resources for import/export along with reading from and writing to any Resource using the Spring Resource abstraction.

Resolves gh-92.
2020-07-16 14:43:32 -07:00
John Blum
9a77049a76 Add new SpEL PropertyAccessor implementation to handle Spring Environment and EnvironmentCapable objects in safe way. 2020-07-10 14:59:57 -07:00
John Blum
a1ab9226eb Add Adapter class for a Spring Environment to use as a Map. 2020-07-10 14:59:57 -07:00
John Blum
d7f1091754 Add null-safe isReadable(:Resource) and isWritable(:Resource) utility methods.
Resolve gh-92.
2020-07-10 14:59:57 -07:00
John Blum
d21ce7d20a Utilize new enum for Resource prefixes.
Simplify ResourceLoaderResourceResolver.getResourceLoader() to use the new 'initialize' operator.

Resolves gh-92.
2020-07-10 14:59:57 -07:00
John Blum
433d152c98 Add enumeration of supported Resource prefixes (e.g. classpath:).
Additionally, the enum defines operations on the Resource prefixes for convenience.

Resolves gh-92.
2020-07-10 14:59:57 -07:00
John Blum
251f762c2d Add initialize(..) operator to promote initialization safety.
The initialize operator replaces the common initialization safety pattern using an if-then-else or Java's ternary operator to ensure that a collaborator reference has bee properly initialized:

target = target != null ? target : new Target();
2020-07-08 14:19:06 -07:00
John Blum
2da58cc548 Add ResourceLoaderResourceResolver implementation using Spring's ResourceLoader to resolve Resources.
Resolves gh-92.
2020-07-08 14:18:48 -07:00
John Blum
7de8bde27a Define ResourceResolver interface encapsulating the algorithm or strategy for resolving Resources in different contexts.
Resolves gh-92.
2020-07-08 12:33:10 -07:00
John Blum
a1ece3599c Add ResourceNotFoundException as a RuntimeException to indicate that a Resource could not be found at the specified location.
Resolves gh-92.
2020-07-08 12:33:10 -07:00
John Blum
60f748a30d Add UnhandledResourceException as a RuntimeException to indicate that a Resource could not be handled, or processed (e.g. read, written).
Resolves gh-92.
2020-07-08 12:33:10 -07:00
John Blum
703cc43282 Add ResourceUtils abstract utility class containing operations for working with Resource objects and byte arrays.
Resolves gh-92.
2020-07-08 12:33:10 -07:00
John Blum
02f06500fc Add FileResourceWriter implementation to write data to a File-based Resource.
Resolves gh-92.
2020-07-07 11:24:50 -07:00
John Blum
edd0cab1af Add AbstractResourceWriter base class containing operations common to all ResourceWriters.
Resolves gh-92.
2020-07-07 11:23:26 -07:00
John Blum
d2591f7f8c Define ResourceWriter interface for writing data to a resource identified by a Resource handle.
Resolves gh-92.
2020-07-07 11:21:47 -07:00
John Blum
8ed0f24d8b Add ByteArrayResourceReader implementation that reads the data from a Resource (e.g. ClassPathResource) into a byte array.
Resolves gh-92.
2020-07-07 11:20:15 -07:00
John Blum
2b05bc5919 Add AbstractResourceReader base class defining operations common to all ResourceReaders.
Resolves gh-92.
2020-07-07 11:18:33 -07:00
John Blum
2437b0247e Define ResourceReader interface for reading data from a resource identified by a Resource handle.
Ressolves gh-92.
2020-07-07 11:16:36 -07:00
John Blum
01696b15af Refactor and polish JSON and base cache data import/export support. 2020-06-25 17:02:56 -07:00
John Blum
4947705f1d Upgrade to Spring Boot 2.3.1.RELEASE. 2020-06-16 16:17:48 -07:00
John Blum
1439b7caf5 Edit README to refer to 1.2.8.RELEASE and 1.2.9.BUILD-SNAPSHOT in the 1.2.x release line. 2020-06-16 15:02:35 -07:00
John Blum
d84978082b Edit README to refer to 1.1.8.RELEASE and 1.1.9.BUILD-SNAPSHOT in the 1.1.x release line. 2020-06-16 15:01:54 -07:00
John Blum
ad83eef6f3 Edit changelog and include 1.2.8.RELEASE notes. 2020-06-16 15:00:52 -07:00
John Blum
59f749ab90 Edit changelog and include 1.1.8.RELEASE notes. 2020-06-16 14:59:40 -07:00
John Blum
0375955755 Edit README to refer to the 1.3.0.RELEASE and 1.3.1.BUILD-SNAPSHOT bits. 2020-06-11 01:58:25 -07:00
John Blum
8a5db8e467 Prepare next development iteration.
Upgrade to Spring Framework 5.2.7.RELEEASE.

Upgrade to Spring Boot 2.3.1.BUILD-SNAPSHOT.

Upgrade to Spring Data for Apache Geode & Pivotal GemFire 2.3.1.RELEASE.

Upgrade to Spring Data Release Train Neumann-SR1.

Set version to 1.3.1.BUILD-SNAPSHOT.
2020-06-11 01:29:55 -07:00
John Blum
e17f0aba69 Release 1.3.0.RELEASE. 2020-06-11 01:11:13 -07:00
John Blum
cca94c37f3 Edit changelog and add 1.3.0.RELEASE notes. 2020-06-11 01:03:37 -07:00
John Blum
46737c78b2 Upgrade to Gradle 6.5. 2020-06-11 00:37:03 -07:00
John Blum
f7611fd16d Upgrade to Spring Test for Apache Geode & Pivotal GemFire 0.0.16.RELEASE. 2020-06-11 00:36:10 -07:00