availableCaches) {
diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManager.java b/modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManagerImpl.java
similarity index 97%
rename from modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManager.java
rename to modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManagerImpl.java
index a48434c99..9bdcdefa4 100644
--- a/modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManager.java
+++ b/modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManagerImpl.java
@@ -48,7 +48,7 @@
*
*/
@Slf4j
-public class FireflyCacheManager implements CacheAdapter {
+public class FireflyCacheManagerImpl implements CacheAdapter {
private final CacheAdapter primaryCache;
private final CacheAdapter fallbackCache;
@@ -60,7 +60,7 @@ public class FireflyCacheManager implements CacheAdapter {
*
* @param cache the cache adapter to use
*/
- public FireflyCacheManager(CacheAdapter cache) {
+ public FireflyCacheManagerImpl(CacheAdapter cache) {
this(cache, null);
}
@@ -70,11 +70,11 @@ public FireflyCacheManager(CacheAdapter cache) {
* @param primaryCache the primary cache adapter
* @param fallbackCache optional fallback cache adapter (can be null)
*/
- public FireflyCacheManager(CacheAdapter primaryCache, CacheAdapter fallbackCache) {
+ public FireflyCacheManagerImpl(CacheAdapter primaryCache, CacheAdapter fallbackCache) {
this(primaryCache, fallbackCache, CacheOperationPolicy.LEGACY);
}
- public FireflyCacheManager(CacheAdapter primaryCache, CacheAdapter fallbackCache, CacheOperationPolicy policy) {
+ public FireflyCacheManagerImpl(CacheAdapter primaryCache, CacheAdapter fallbackCache, CacheOperationPolicy policy) {
this.operationPolicy = java.util.Objects.requireNonNull(policy, "Cache operation policy required");
if (policy == CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS
&& (primaryCache == null || fallbackCache != null || primaryCache.operationPolicy() != policy)) {
diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheHealthIndicator.java b/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheHealthIndicatorImpl.java
similarity index 94%
rename from modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheHealthIndicator.java
rename to modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheHealthIndicatorImpl.java
index 36fbdb239..6653a3658 100644
--- a/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheHealthIndicator.java
+++ b/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheHealthIndicatorImpl.java
@@ -31,7 +31,7 @@
*
* Marks the cache as DOWN when the probe fails or exceeds {@code 1s}.
*/
-public class CacheHealthIndicator extends FireflyHealthIndicator {
+public class CacheHealthIndicatorImpl extends FireflyHealthIndicator {
private static final Duration LATENCY_THRESHOLD = Duration.ofSeconds(1);
private static final String HEALTH_KEY_PREFIX = "firefly.cache.health.";
@@ -39,7 +39,7 @@ public class CacheHealthIndicator extends FireflyHealthIndicator {
private final CacheAdapter cacheAdapter;
private final String adapterName;
- public CacheHealthIndicator(CacheAdapter cacheAdapter, String adapterName) {
+ public CacheHealthIndicatorImpl(CacheAdapter cacheAdapter, String adapterName) {
super("cache");
this.cacheAdapter = cacheAdapter;
this.adapterName = adapterName;
diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheMetrics.java b/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheMetricsImpl.java
similarity index 97%
rename from modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheMetrics.java
rename to modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheMetricsImpl.java
index efb811237..0678e3b99 100644
--- a/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheMetrics.java
+++ b/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheMetricsImpl.java
@@ -37,7 +37,7 @@
*
* When the {@link MeterRegistry} is unavailable, all methods become no-ops with zero overhead.
*/
-public class CacheMetrics extends FireflyMetricsSupport {
+public class CacheMetricsImpl extends FireflyMetricsSupport {
private static final String TAG_RESULT = "result";
private static final String TAG_ADAPTER = "adapter";
@@ -45,7 +45,7 @@ public class CacheMetrics extends FireflyMetricsSupport {
private static final String RESULT_HIT = "hit";
private static final String RESULT_MISS = "miss";
- public CacheMetrics(MeterRegistry meterRegistry) {
+ public CacheMetricsImpl(MeterRegistry meterRegistry) {
super(meterRegistry, "cache");
}
diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheObservabilityAutoConfiguration.java b/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheObservabilityAutoConfiguration.java
index b7c41043c..bfaeb986d 100644
--- a/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheObservabilityAutoConfiguration.java
+++ b/modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheObservabilityAutoConfiguration.java
@@ -18,7 +18,7 @@
import io.micrometer.core.instrument.MeterRegistry;
import org.fireflyframework.cache.core.CacheAdapter;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.health.contributor.HealthIndicator;
import org.springframework.boot.autoconfigure.AutoConfiguration;
@@ -46,8 +46,8 @@ public class CacheObservabilityAutoConfiguration {
@ConditionalOnBean(MeterRegistry.class)
@ConditionalOnProperty(prefix = "firefly.observability.metrics", name = "enabled",
havingValue = "true", matchIfMissing = true)
- CacheMetrics cacheMetrics(MeterRegistry meterRegistry) {
- return new CacheMetrics(meterRegistry);
+ CacheMetricsImpl cacheMetrics(MeterRegistry meterRegistry) {
+ return new CacheMetricsImpl(meterRegistry);
}
@Bean
@@ -56,11 +56,11 @@ CacheMetrics cacheMetrics(MeterRegistry meterRegistry) {
@ConditionalOnSingleCandidate(CacheAdapter.class)
@ConditionalOnProperty(prefix = "firefly.observability.health", name = "enabled",
havingValue = "true", matchIfMissing = true)
- HealthIndicator cacheHealthIndicator(ObjectProvider managerProvider,
+ HealthIndicator cacheHealthIndicator(ObjectProvider managerProvider,
ObjectProvider adapterProvider) {
CacheAdapter adapter = adapterProvider.getIfUnique();
- FireflyCacheManager manager = managerProvider.getIfUnique();
+ FireflyCacheManagerImpl manager = managerProvider.getIfUnique();
String adapterName = manager != null ? "firefly" : "cache";
- return new CacheHealthIndicator(adapter, adapterName);
+ return new CacheHealthIndicatorImpl(adapter, adapterName);
}
}
diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/serialization/JsonCacheSerializer.java b/modules/cache/src/main/java/org/fireflyframework/cache/serialization/JsonCacheSerializerImpl.java
similarity index 97%
rename from modules/cache/src/main/java/org/fireflyframework/cache/serialization/JsonCacheSerializer.java
rename to modules/cache/src/main/java/org/fireflyframework/cache/serialization/JsonCacheSerializerImpl.java
index f6f83ae10..27dee12dc 100644
--- a/modules/cache/src/main/java/org/fireflyframework/cache/serialization/JsonCacheSerializer.java
+++ b/modules/cache/src/main/java/org/fireflyframework/cache/serialization/JsonCacheSerializerImpl.java
@@ -32,12 +32,12 @@
* good compatibility across different systems.
*/
@Slf4j
-public class JsonCacheSerializer implements CacheSerializer {
+public class JsonCacheSerializerImpl implements CacheSerializer {
private final ObjectMapper objectMapper;
private final Set> supportedTypes;
- public JsonCacheSerializer(ObjectMapper objectMapper) {
+ public JsonCacheSerializerImpl(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
// Most types are supported by JSON, except for very special cases
this.supportedTypes = Set.of(); // Empty means all types are supported by default
diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/spi/CacheProviderFactory.java b/modules/cache/src/main/java/org/fireflyframework/cache/spi/CacheProviderFactory.java
index fa9e0482f..5d21ccef9 100644
--- a/modules/cache/src/main/java/org/fireflyframework/cache/spi/CacheProviderFactory.java
+++ b/modules/cache/src/main/java/org/fireflyframework/cache/spi/CacheProviderFactory.java
@@ -20,7 +20,7 @@
package org.fireflyframework.cache.spi;
import com.fasterxml.jackson.databind.ObjectMapper;
-import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheAdapter;
+import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheAdapterImpl;
import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheConfig;
import org.fireflyframework.cache.core.CacheAdapter;
import org.fireflyframework.cache.core.CacheOperationPolicy;
diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/spi/providers/CaffeineProvider.java b/modules/cache/src/main/java/org/fireflyframework/cache/spi/providers/CaffeineProviderImpl.java
similarity index 93%
rename from modules/cache/src/main/java/org/fireflyframework/cache/spi/providers/CaffeineProvider.java
rename to modules/cache/src/main/java/org/fireflyframework/cache/spi/providers/CaffeineProviderImpl.java
index d5bd599f7..eb57df22f 100644
--- a/modules/cache/src/main/java/org/fireflyframework/cache/spi/providers/CaffeineProvider.java
+++ b/modules/cache/src/main/java/org/fireflyframework/cache/spi/providers/CaffeineProviderImpl.java
@@ -16,7 +16,7 @@
package org.fireflyframework.cache.spi.providers;
-import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheAdapter;
+import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheAdapterImpl;
import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheConfig;
import org.fireflyframework.cache.core.CacheAdapter;
import org.fireflyframework.cache.core.CacheType;
@@ -24,7 +24,7 @@
import java.time.Duration;
-public class CaffeineProvider implements CacheProviderFactory {
+public class CaffeineProviderImpl implements CacheProviderFactory {
@Override
public CacheType getType() { return CacheType.CAFFEINE; }
@Override
@@ -45,6 +45,6 @@ public CacheAdapter create(String cacheName, String keyPrefix, Duration defaultT
.weakValues(caffeineProps.isWeakValues())
.softValues(caffeineProps.isSoftValues())
.build();
- return new CaffeineCacheAdapter(cacheName, config);
+ return new CaffeineCacheAdapterImpl(cacheName, config);
}
}
diff --git a/modules/cache/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory b/modules/cache/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory
index ae4c0644f..4409ae30a 100644
--- a/modules/cache/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory
+++ b/modules/cache/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory
@@ -1 +1 @@
-org.fireflyframework.cache.spi.providers.CaffeineProvider
+org.fireflyframework.cache.spi.providers.CaffeineProviderImpl
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterLoggingTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterLoggingTest.java
index d9ba17717..358d19501 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterLoggingTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterLoggingTest.java
@@ -31,7 +31,7 @@
class CaffeineCacheAdapterLoggingTest {
private static final String NAME = "cache\r\nregion\u000bvertical\fform\u0085next\u2028line\u2029paragraph";
- private final Logger logger = (Logger) LoggerFactory.getLogger(CaffeineCacheAdapter.class);
+ private final Logger logger = (Logger) LoggerFactory.getLogger(CaffeineCacheAdapterImpl.class);
private final ListAppender events = new ListAppender<>();
private Level previousLevel;
private boolean previousAdditive;
@@ -56,7 +56,7 @@ private static final class Key {
@Override public String toString() { renders++; return "PRIVATE_KEY\r\nforged\u2028entry"; }
}
- private CaffeineCacheAdapter adapter() { return new CaffeineCacheAdapter(NAME, CaffeineCacheConfig.builder().maximumSize(10L).build()); }
+ private CaffeineCacheAdapterImpl adapter() { return new CaffeineCacheAdapterImpl(NAME, CaffeineCacheConfig.builder().maximumSize(10L).build()); }
@Test void successfulOperationsLogKeyPresenceAndEscapeOnlyTheCacheName() {
var cache = adapter(); var key = new Key(); cache.put(key, "value").block();
safeEvent(Level.DEBUG, false); assertEquals(1, key.renders);
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterTest.java
index 20b249368..5dadb7609 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterTest.java
@@ -33,7 +33,7 @@
*/
class CaffeineCacheAdapterTest {
- private CaffeineCacheAdapter cacheAdapter;
+ private CaffeineCacheAdapterImpl cacheAdapter;
private CaffeineCacheConfig config;
@BeforeEach
@@ -44,7 +44,7 @@ void setUp() {
.recordStats(true)
.build();
- cacheAdapter = new CaffeineCacheAdapter("test-cache", config);
+ cacheAdapter = new CaffeineCacheAdapterImpl("test-cache", config);
}
@Test
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapterTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapterTest.java
index d3fabe191..aaadd707f 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapterTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapterTest.java
@@ -16,7 +16,7 @@
package org.fireflyframework.cache.adapter.smart;
-import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheAdapter;
+import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheAdapterImpl;
import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheConfig;
import org.fireflyframework.cache.core.CacheAdapter;
import org.fireflyframework.cache.core.CacheStats;
@@ -34,7 +34,7 @@ class SmartCacheAdapterTest {
private CacheAdapter l1;
private CacheAdapter l2;
- private SmartCacheAdapter smart;
+ private SmartCacheAdapterImpl smart;
@BeforeEach
void setUp() {
@@ -50,9 +50,9 @@ void setUp() {
.expireAfterWrite(Duration.ofMinutes(10))
.recordStats(true)
.build();
- l1 = new CaffeineCacheAdapter("smart", cfg1);
- l2 = new CaffeineCacheAdapter("smart", cfg2);
- smart = new SmartCacheAdapter("smart", l1, l2, Duration.ofMinutes(10), true);
+ l1 = new CaffeineCacheAdapterImpl("smart", cfg1);
+ l2 = new CaffeineCacheAdapterImpl("smart", cfg2);
+ smart = new SmartCacheAdapterImpl("smart", l1, l2, Duration.ofMinutes(10), true);
// clean
l1.clear().block();
l2.clear().block();
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationCaffeineDefaultTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationCaffeineDefaultTest.java
index 8f9283d76..11cd6f396 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationCaffeineDefaultTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationCaffeineDefaultTest.java
@@ -17,7 +17,7 @@
package org.fireflyframework.cache.config;
import org.fireflyframework.cache.core.CacheType;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
@@ -41,7 +41,7 @@ class CacheAutoConfigurationCaffeineDefaultTest {
void shouldStartWithExplicitCaffeineSelection() {
this.contextRunner.run(context -> {
assertThat(context).hasNotFailed();
- assertThat(context).hasSingleBean(FireflyCacheManager.class);
+ assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class);
});
}
@@ -52,9 +52,9 @@ void shouldCreateCaffeineCacheManagerWhenExplicitlySelected() {
// The default fireflyCacheManager bean must be present and Caffeine-backed.
assertThat(context).hasBean("fireflyCacheManager");
- assertThat(context).hasSingleBean(FireflyCacheManager.class);
+ assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class);
- FireflyCacheManager manager = context.getBean(FireflyCacheManager.class);
+ FireflyCacheManagerImpl manager = context.getBean(FireflyCacheManagerImpl.class);
assertThat(manager.getCacheType()).isEqualTo(CacheType.CAFFEINE);
assertThat(manager.getCacheName()).isEqualTo("default");
});
@@ -81,9 +81,9 @@ void shouldWorkWithCustomCaffeineConfiguration() {
)
.run(context -> {
assertThat(context).hasNotFailed();
- assertThat(context).hasSingleBean(FireflyCacheManager.class);
+ assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class);
- FireflyCacheManager manager = context.getBean(FireflyCacheManager.class);
+ FireflyCacheManagerImpl manager = context.getBean(FireflyCacheManagerImpl.class);
assertThat(manager.getCacheType()).isEqualTo(CacheType.CAFFEINE);
});
}
@@ -96,7 +96,7 @@ void shouldDisableCacheWhenPropertySetToFalse() {
assertThat(context).hasNotFailed();
// Should NOT have cache manager when disabled
- assertThat(context).doesNotHaveBean(FireflyCacheManager.class);
+ assertThat(context).doesNotHaveBean(FireflyCacheManagerImpl.class);
});
}
@@ -117,7 +117,7 @@ void shouldUseCacheNameFromCaffeineConfig() {
.run(context -> {
assertThat(context).hasNotFailed();
- FireflyCacheManager manager = context.getBean(FireflyCacheManager.class);
+ FireflyCacheManagerImpl manager = context.getBean(FireflyCacheManagerImpl.class);
assertThat(manager).isNotNull();
assertThat(manager.getCacheName()).isEqualTo("my-custom-cache");
});
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationExplicitCaffeineTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationExplicitCaffeineTest.java
index 46a9ddfd0..13db90814 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationExplicitCaffeineTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationExplicitCaffeineTest.java
@@ -17,7 +17,7 @@
package org.fireflyframework.cache.config;
import org.fireflyframework.cache.core.CacheType;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.test.context.runner.ApplicationContextRunner;
@@ -35,7 +35,7 @@ class CacheAutoConfigurationExplicitCaffeineTest {
void shouldStartWithExplicitCaffeine() {
this.contextRunner.run(context -> {
assertThat(context).hasNotFailed();
- assertThat(context).hasSingleBean(FireflyCacheManager.class);
+ assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class);
});
}
@@ -46,9 +46,9 @@ void shouldCreateExplicitCaffeineCacheManager() {
// The default fireflyCacheManager bean must be present and Caffeine-backed.
assertThat(context).hasBean("fireflyCacheManager");
- assertThat(context).hasSingleBean(FireflyCacheManager.class);
+ assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class);
- FireflyCacheManager manager = context.getBean(FireflyCacheManager.class);
+ FireflyCacheManagerImpl manager = context.getBean(FireflyCacheManagerImpl.class);
assertThat(manager.getCacheType()).isEqualTo(CacheType.CAFFEINE);
assertThat(manager.getCacheName()).isEqualTo("default");
});
@@ -75,9 +75,9 @@ void shouldWorkWithCustomCaffeineConfiguration() {
)
.run(context -> {
assertThat(context).hasNotFailed();
- assertThat(context).hasSingleBean(FireflyCacheManager.class);
+ assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class);
- FireflyCacheManager manager = context.getBean(FireflyCacheManager.class);
+ FireflyCacheManagerImpl manager = context.getBean(FireflyCacheManagerImpl.class);
assertThat(manager.getCacheType()).isEqualTo(CacheType.CAFFEINE);
});
}
@@ -90,7 +90,7 @@ void shouldDisableCacheWhenPropertySetToFalse() {
assertThat(context).hasNotFailed();
// Should NOT have cache manager when disabled
- assertThat(context).doesNotHaveBean(FireflyCacheManager.class);
+ assertThat(context).doesNotHaveBean(FireflyCacheManagerImpl.class);
});
}
@@ -111,7 +111,7 @@ void shouldUseCacheNameFromCaffeineConfig() {
.run(context -> {
assertThat(context).hasNotFailed();
- FireflyCacheManager manager = context.getBean(FireflyCacheManager.class);
+ FireflyCacheManagerImpl manager = context.getBean(FireflyCacheManagerImpl.class);
assertThat(manager).isNotNull();
assertThat(manager.getCacheName()).isEqualTo("my-custom-cache");
});
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationPostgresDefaultTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationPostgresDefaultTest.java
index c591f23ba..784011044 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationPostgresDefaultTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationPostgresDefaultTest.java
@@ -3,7 +3,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import org.fireflyframework.cache.core.CacheType;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import org.fireflyframework.cache.properties.CacheProperties;
import org.junit.jupiter.api.Test;
import org.springframework.boot.autoconfigure.AutoConfigurations;
@@ -56,7 +56,7 @@ void explicitlySelectedCaffeineRemainsUsableWithoutPostgresConfiguration() {
cache.withPropertyValues("firefly.cache.default-cache-type=CAFFEINE")
.run(context -> {
assertThat(context).hasNotFailed();
- assertThat(context.getBean(FireflyCacheManager.class).getCacheType()).isEqualTo(CacheType.CAFFEINE);
+ assertThat(context.getBean(FireflyCacheManagerImpl.class).getCacheType()).isEqualTo(CacheType.CAFFEINE);
assertThat(context).doesNotHaveBean("fireflyCachePostgresConnectionFactory");
});
}
@@ -65,7 +65,7 @@ void explicitlySelectedCaffeineRemainsUsableWithoutPostgresConfiguration() {
void disabledCachingCreatesNoManagerOrPostgresFactory() {
cache.withPropertyValues("firefly.cache.enabled=false").run(context -> {
assertThat(context).hasNotFailed();
- assertThat(context).doesNotHaveBean(FireflyCacheManager.class);
+ assertThat(context).doesNotHaveBean(FireflyCacheManagerImpl.class);
assertThat(context).doesNotHaveBean("fireflyCachePostgresConnectionFactory");
});
}
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/factory/PrimaryOnlyCacheFactoryTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/factory/PrimaryOnlyCacheFactoryTest.java
index 8bc07ba6f..645e9fe29 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/factory/PrimaryOnlyCacheFactoryTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/factory/PrimaryOnlyCacheFactoryTest.java
@@ -17,7 +17,7 @@ CacheManagerFactory factory(CacheProviderFactory... providers) {
var factory=new CacheManagerFactory(properties,new ObjectMapper(),null,null,null);
ReflectionTestUtils.setField(factory,"providerFactories",List.of(providers));return factory;
}
- org.fireflyframework.cache.manager.FireflyCacheManager create(CacheManagerFactory factory,CacheType type) {
+ org.fireflyframework.cache.manager.FireflyCacheManagerImpl create(CacheManagerFactory factory,CacheType type) {
return factory.createCacheManager("policy",type,
"service:policy",Duration.ofMinutes(1),"primary-only test","test",CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS);
}
@@ -56,7 +56,7 @@ static class ExplicitProvider extends LegacyProvider {
assertThatThrownBy(()->create(factory(empty),CacheType.POSTGRES)).isInstanceOf(IllegalStateException.class);
}
@Test void currentlyUnsupportedBuiltinProviderRefusesExplicitly() {
- assertThatThrownBy(()->create(factory(new org.fireflyframework.cache.spi.providers.CaffeineProvider()),CacheType.CAFFEINE))
+ assertThatThrownBy(()->create(factory(new org.fireflyframework.cache.spi.providers.CaffeineProviderImpl()),CacheType.CAFFEINE))
.isInstanceOf(UnsupportedOperationException.class);
}
@Test void providerCannotReturnADifferentBackend() {
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/factory/PrimaryOnlyServiceDiscoveryTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/factory/PrimaryOnlyServiceDiscoveryTest.java
index 3e6c3b3e5..682112ad3 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/factory/PrimaryOnlyServiceDiscoveryTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/factory/PrimaryOnlyServiceDiscoveryTest.java
@@ -20,7 +20,7 @@
import org.fireflyframework.cache.core.CacheAdapter;
import org.fireflyframework.cache.core.CacheOperationPolicy;
import org.fireflyframework.cache.core.CacheType;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import org.fireflyframework.cache.properties.CacheProperties;
import org.fireflyframework.cache.spi.CacheProviderFactory;
import org.junit.jupiter.api.BeforeEach;
@@ -145,7 +145,7 @@ private void incomplete(CacheManagerFactory factory) {
assertEquals(0, STRICT_CREATES.get()); assertEquals(0, LEGACY_CREATES.get()); assertEquals(0, RESOLVERS.get());
}
- private FireflyCacheManager strict(CacheManagerFactory factory) {
+ private FireflyCacheManagerImpl strict(CacheManagerFactory factory) {
return factory.createCacheManager("fixture", CacheType.POSTGRES, "fixture:", Duration.ofMinutes(1),
"ServiceLoader completion fixture", "test", CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS);
}
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/manager/FireflyCacheManagerLoggingTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/manager/FireflyCacheManagerLoggingTest.java
index 60b5c03e6..78003d35f 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/manager/FireflyCacheManagerLoggingTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/manager/FireflyCacheManagerLoggingTest.java
@@ -31,7 +31,7 @@
class FireflyCacheManagerLoggingTest {
private static final String NAME = "cache\r\nregion\u000bvertical\fform\u0085next\u2028line\u2029paragraph";
- private final Logger logger = (Logger) LoggerFactory.getLogger(FireflyCacheManager.class);
+ private final Logger logger = (Logger) LoggerFactory.getLogger(FireflyCacheManagerImpl.class);
private final ListAppender events = new ListAppender<>();
private Level previousLevel;
private boolean previousAdditive;
@@ -63,7 +63,7 @@ private org.fireflyframework.cache.core.CacheAdapter primary() {
@Test void genericGetErrorsKeepEmptyFallbackWithoutRenderingKeysOrPayload() {
var primary = primary(); var key = new Key();
when(primary.get(key)).thenReturn(Mono.error(new IllegalStateException("PRIVATE_MESSAGE\r\nforged")));
- assertEquals(Optional.empty(), new FireflyCacheManager(primary).get(key).block());
+ assertEquals(Optional.empty(), new FireflyCacheManagerImpl(primary).get(key).block());
safeEvent(Level.ERROR, true); assertEquals(0, key.renders);
}
@Test void typedGetAndOtherFallbacksRetainResultsAndErrorLevels() {
@@ -75,7 +75,7 @@ private org.fireflyframework.cache.core.CacheAdapter primary() {
when(primary.clear()).thenReturn(Mono.error(failure));
when(primary.keys()).thenReturn(Mono.error(failure));
when(primary.size()).thenReturn(Mono.error(failure));
- var manager = new FireflyCacheManager(primary);
+ var manager = new FireflyCacheManagerImpl(primary);
assertEquals(Optional.empty(), manager.get(key, String.class).block()); safeEvent(Level.ERROR, true);
assertNull(manager.put(key, "value").block()); safeEvent(Level.ERROR, true);
assertEquals(false, manager.evict(key).block()); safeEvent(Level.ERROR, true);
@@ -90,7 +90,7 @@ private org.fireflyframework.cache.core.CacheAdapter primary() {
var reads = new java.util.concurrent.atomic.AtomicInteger();
var error = new IllegalStateException() { @Override public String getMessage() { reads.incrementAndGet(); return "PRIVATE_MESSAGE"; } };
when(primary.get(key)).thenReturn(Mono.error(error));
- assertEquals(Optional.empty(), new FireflyCacheManager(primary).get(key).block());
+ assertEquals(Optional.empty(), new FireflyCacheManagerImpl(primary).get(key).block());
assertEquals(0, key.renders); assertEquals(0, reads.get()); assertTrue(events.list.isEmpty());
}
}
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/manager/FireflyCacheManagerTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/manager/FireflyCacheManagerTest.java
index 1c8cec3d4..87b53374b 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/manager/FireflyCacheManagerTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/manager/FireflyCacheManagerTest.java
@@ -16,7 +16,7 @@
package org.fireflyframework.cache.manager;
-import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheAdapter;
+import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheAdapterImpl;
import org.fireflyframework.cache.adapter.caffeine.CaffeineCacheConfig;
import org.fireflyframework.cache.core.CacheAdapter;
import org.fireflyframework.cache.core.CacheType;
@@ -34,7 +34,7 @@
*/
class FireflyCacheManagerTest {
- private FireflyCacheManager cacheManager;
+ private FireflyCacheManagerImpl cacheManager;
private CacheAdapter primaryCache;
@BeforeEach
@@ -44,9 +44,9 @@ void setUp() {
.maximumSize(100L)
.recordStats(true)
.build();
- primaryCache = new CaffeineCacheAdapter("test-cache", config);
+ primaryCache = new CaffeineCacheAdapterImpl("test-cache", config);
- cacheManager = new FireflyCacheManager(primaryCache);
+ cacheManager = new FireflyCacheManagerImpl(primaryCache);
}
@Test
@@ -211,9 +211,9 @@ void shouldFallbackToFallbackCacheWhenPrimaryUnavailable() {
CaffeineCacheConfig fallbackConfig = CaffeineCacheConfig.builder()
.maximumSize(50L)
.build();
- CacheAdapter fallbackCache = new CaffeineCacheAdapter("fallback-cache", fallbackConfig);
+ CacheAdapter fallbackCache = new CaffeineCacheAdapterImpl("fallback-cache", fallbackConfig);
- FireflyCacheManager managerWithFallback = new FireflyCacheManager(primaryCache, fallbackCache);
+ FireflyCacheManagerImpl managerWithFallback = new FireflyCacheManagerImpl(primaryCache, fallbackCache);
// When - put data in primary
managerWithFallback.put("key1", "value1").block();
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/manager/LegacyCacheOperationCompatibilityTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/manager/LegacyCacheOperationCompatibilityTest.java
index c9ec622b9..0f9dc7289 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/manager/LegacyCacheOperationCompatibilityTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/manager/LegacyCacheOperationCompatibilityTest.java
@@ -10,7 +10,7 @@
/** Existing API controls can be compiled against674 and the candidate without new-policy symbols. */
class LegacyCacheOperationCompatibilityTest {
final CacheAdapter adapter=mock(CacheAdapter.class);
- final FireflyCacheManager manager=new FireflyCacheManager(adapter);
+ final FireflyCacheManagerImpl manager=new FireflyCacheManagerImpl(adapter);
LegacyCacheOperationCompatibilityTest(){when(adapter.isAvailable()).thenReturn(true);}
@Test void oldReadFailureRecoveryRemainsAReportedMiss(){doReturn(Mono.error(new IllegalStateException("controlled failure"))).when(adapter).get("key");StepVerifier.create(manager.get("key")).expectNext(Optional.empty()).verifyComplete();}
@Test void oldWriteFailureRecoveryRemainsCompleted(){doReturn(Mono.error(new IllegalStateException("controlled failure"))).when(adapter).put("key","value");StepVerifier.create(manager.put("key","value")).verifyComplete();}
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/manager/PrimaryOnlyCacheManagerTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/manager/PrimaryOnlyCacheManagerTest.java
index e28764082..159642e21 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/manager/PrimaryOnlyCacheManagerTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/manager/PrimaryOnlyCacheManagerTest.java
@@ -14,8 +14,8 @@
class PrimaryOnlyCacheManagerTest {
final CacheAdapter primary=mock(CacheAdapter.class);
PrimaryOnlyCacheManagerTest() { when(primary.operationPolicy()).thenReturn(CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS); }
- FireflyCacheManager manager() { return new FireflyCacheManager(primary,null,CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS); }
- List> dataOperations(FireflyCacheManager manager) {
+ FireflyCacheManagerImpl manager() { return new FireflyCacheManagerImpl(primary,null,CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS); }
+ List> dataOperations(FireflyCacheManagerImpl manager) {
return List.of(manager.get("key"),manager.get("key",String.class),manager.put("key","value"),
manager.put("key","value",Duration.ofSeconds(1)),manager.putIfAbsent("key","value"),
manager.putIfAbsent("key","value",Duration.ofSeconds(1)),manager.evict("key"),manager.clear(),
@@ -72,8 +72,8 @@ void answers(Mono> answer) {
}
@Test void unknownAdapterAndAnyFallbackRefuseStrictConstruction() {
var legacy=mock(CacheAdapter.class);when(legacy.operationPolicy()).thenReturn(CacheOperationPolicy.LEGACY);
- assertThatThrownBy(()->new FireflyCacheManager(legacy,null,CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS)).isInstanceOf(IllegalArgumentException.class);
- assertThatThrownBy(()->new FireflyCacheManager(primary,legacy,CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS)).isInstanceOf(IllegalArgumentException.class);
+ assertThatThrownBy(()->new FireflyCacheManagerImpl(legacy,null,CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS)).isInstanceOf(IllegalArgumentException.class);
+ assertThatThrownBy(()->new FireflyCacheManagerImpl(primary,legacy,CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS)).isInstanceOf(IllegalArgumentException.class);
}
@Test void closeFailurePropagatesAndClosedInstanceRefusesDataOperations() {
var failure=new IllegalStateException("controlled close failure");doThrow(failure).when(primary).close();var manager=manager();
@@ -84,7 +84,7 @@ void answers(Mono> answer) {
when(primary.getHealth()).thenReturn(Mono.empty());StepVerifier.create(manager().getHealth()).expectError(CacheException.class).verify();
}
@Test void legacyManagerKeepsExistingFailureRecovery() {
- answers(Mono.error(new IllegalStateException("controlled legacy failure")));var legacy=new FireflyCacheManager(primary);
+ answers(Mono.error(new IllegalStateException("controlled legacy failure")));var legacy=new FireflyCacheManagerImpl(primary);
when(primary.isAvailable()).thenReturn(true);StepVerifier.create(legacy.get("key")).expectNext(Optional.empty()).verifyComplete();
StepVerifier.create(legacy.put("key","value")).verifyComplete();assertThat(legacy.operationPolicy()).isEqualTo(CacheOperationPolicy.LEGACY);
}
diff --git a/modules/cache/src/test/java/org/fireflyframework/cache/serialization/JsonCacheSerializerLoggingTest.java b/modules/cache/src/test/java/org/fireflyframework/cache/serialization/JsonCacheSerializerLoggingTest.java
index e099f74e2..93a61ba4b 100644
--- a/modules/cache/src/test/java/org/fireflyframework/cache/serialization/JsonCacheSerializerLoggingTest.java
+++ b/modules/cache/src/test/java/org/fireflyframework/cache/serialization/JsonCacheSerializerLoggingTest.java
@@ -14,7 +14,7 @@
class JsonCacheSerializerLoggingTest {
static final String PRIVATE="PRIVATE_SECRET_VALUE";
- final Logger logger=(Logger)LoggerFactory.getLogger(JsonCacheSerializer.class);
+ final Logger logger=(Logger)LoggerFactory.getLogger(JsonCacheSerializerImpl.class);
final ListAppender events=new ListAppender<>();
Level previousLevel;boolean previousAdditive;
@BeforeEach void capture(){previousLevel=logger.getLevel();previousAdditive=logger.isAdditive();logger.setLevel(Level.ERROR);logger.setAdditive(false);events.start();logger.addAppender(events);}
@@ -22,14 +22,14 @@ class JsonCacheSerializerLoggingTest {
void safeEvent(){assertEquals(1,events.list.size());var event=events.list.getFirst();assertNull(event.getThrowableProxy());assertFalse(event.getMessage().contains(PRIVATE));assertFalse(event.getFormattedMessage().contains(PRIVATE));assertTrue(event.getFormattedMessage().contains("java.lang.IllegalStateException"));for(Object argument:event.getArgumentArray())assertFalse(String.valueOf(argument).contains(PRIVATE));}
@Test void serializeFailureRetainsCauseWithoutLoggingPayloadOrThrowable()throws Exception{
var mapper=mock(ObjectMapper.class);var failure=new IllegalStateException(PRIVATE);when(mapper.writeValueAsString(any())).thenThrow(failure);
- var exception=assertThrows(SerializationException.class,()->new JsonCacheSerializer(mapper).serialize(Map.of("secret",PRIVATE)));assertSame(failure,exception.getCause());safeEvent();
+ var exception=assertThrows(SerializationException.class,()->new JsonCacheSerializerImpl(mapper).serialize(Map.of("secret",PRIVATE)));assertSame(failure,exception.getCause());safeEvent();
}
@Test void stringDecodeFailureRetainsCauseWithoutLoggingPayloadOrThrowable()throws Exception{
var mapper=mock(ObjectMapper.class);var failure=new IllegalStateException(PRIVATE);when(mapper.readValue(eq(PRIVATE),eq(Map.class))).thenThrow(failure);
- var exception=assertThrows(SerializationException.class,()->new JsonCacheSerializer(mapper).deserialize(PRIVATE,Map.class));assertSame(failure,exception.getCause());safeEvent();
+ var exception=assertThrows(SerializationException.class,()->new JsonCacheSerializerImpl(mapper).deserialize(PRIVATE,Map.class));assertSame(failure,exception.getCause());safeEvent();
}
@Test void conversionFailureRetainsCauseWithoutLoggingPayloadOrThrowable()throws Exception{
var mapper=mock(ObjectMapper.class);var failure=new IllegalStateException(PRIVATE);when(mapper.writeValueAsString(any())).thenThrow(failure);
- var exception=assertThrows(SerializationException.class,()->new JsonCacheSerializer(mapper).deserialize(Map.of("secret",PRIVATE),List.class));assertSame(failure,exception.getCause());safeEvent();
+ var exception=assertThrows(SerializationException.class,()->new JsonCacheSerializerImpl(mapper).deserialize(Map.of("secret",PRIVATE),List.class));assertSame(failure,exception.getCause());safeEvent();
}
}
diff --git a/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/CallbackManagementEndToEndTest.java b/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/CallbackManagementEndToEndTest.java
index ec0a0fa85..cbdfd7871 100644
--- a/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/CallbackManagementEndToEndTest.java
+++ b/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/CallbackManagementEndToEndTest.java
@@ -24,7 +24,7 @@
import org.fireflyframework.callbacks.interfaces.enums.HttpMethod;
import org.fireflyframework.callbacks.web.config.TestKafkaListenerConfig;
import org.fireflyframework.cache.core.CacheType;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.client.WireMock;
import org.apache.kafka.clients.producer.KafkaProducer;
@@ -100,7 +100,7 @@ class CallbackManagementEndToEndTest {
private ObjectMapper objectMapper;
@Autowired
- private FireflyCacheManager cacheManager;
+ private FireflyCacheManagerImpl cacheManager;
@Autowired
private TestKafkaListenerConfig.TestDynamicEventListenerRegistry testRegistry;
diff --git a/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/SpringContextTest.java b/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/SpringContextTest.java
index abb5b1d9b..9aa368374 100644
--- a/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/SpringContextTest.java
+++ b/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/SpringContextTest.java
@@ -19,7 +19,7 @@
import org.fireflyframework.callbacks.web.controller.AuthorizedDomainController;
import org.fireflyframework.callbacks.web.controller.CallbackConfigurationController;
import org.fireflyframework.cache.core.CacheType;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -68,7 +68,7 @@ static void configureProperties(DynamicPropertyRegistry registry) {
@Test
void contextLoads() {
assertThat(context).isNotNull();
- assertThat(context.getBean(FireflyCacheManager.class).getCacheType()).isEqualTo(CacheType.CAFFEINE);
+ assertThat(context.getBean(FireflyCacheManagerImpl.class).getCacheType()).isEqualTo(CacheType.CAFFEINE);
}
@Test
diff --git a/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/integration/CallbackEndToEndIntegrationTest.java b/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/integration/CallbackEndToEndIntegrationTest.java
index f861d986c..0ac5f86b5 100644
--- a/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/integration/CallbackEndToEndIntegrationTest.java
+++ b/modules/callbacks/fireflyframework-callbacks-web/src/test/java/org/fireflyframework/callbacks/web/integration/CallbackEndToEndIntegrationTest.java
@@ -22,7 +22,7 @@
import org.fireflyframework.callbacks.interfaces.enums.CallbackStatus;
import org.fireflyframework.callbacks.interfaces.enums.HttpMethod;
import org.fireflyframework.cache.core.CacheType;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.client.WireMock;
import org.junit.jupiter.api.*;
@@ -119,7 +119,7 @@ void resetWireMock() {
private ObjectMapper objectMapper;
@Autowired
- private FireflyCacheManager cacheManager;
+ private FireflyCacheManagerImpl cacheManager;
@Test
@Order(1)
diff --git a/modules/client/docs/ADVANCED_FEATURES.md b/modules/client/docs/ADVANCED_FEATURES.md
index df2ef0242..d8fc42b81 100644
--- a/modules/client/docs/ADVANCED_FEATURES.md
+++ b/modules/client/docs/ADVANCED_FEATURES.md
@@ -41,7 +41,7 @@ FaultInjectionConfig config = FaultInjectionConfig.builder()
.build();
// Create chaos interceptor
-ChaosEngineeringInterceptor chaosInterceptor = new ChaosEngineeringInterceptor(config);
+ChaosEngineeringInterceptorImpl chaosInterceptor = new ChaosEngineeringInterceptorImpl(config);
// Add to client
RestClient client = ServiceClient.rest("user-service")
@@ -96,7 +96,7 @@ HttpCacheConfig cacheConfig = HttpCacheConfig.builder()
HttpCacheManager cacheManager = new HttpCacheManager(cacheConfig);
// Use with interceptor
-HttpCacheInterceptor cacheInterceptor = new HttpCacheInterceptor(cacheManager, cacheConfig);
+HttpCacheInterceptorImpl cacheInterceptor = new HttpCacheInterceptorImpl(cacheManager, cacheConfig);
RestClient client = ServiceClient.rest("user-service")
.baseUrl("http://localhost:8080")
diff --git a/modules/client/docs/OBSERVABILITY.md b/modules/client/docs/OBSERVABILITY.md
index 38952158f..4bbdd9195 100644
--- a/modules/client/docs/OBSERVABILITY.md
+++ b/modules/client/docs/OBSERVABILITY.md
@@ -137,7 +137,7 @@ management:
```java
@Autowired
-private ServiceClientMetrics metrics;
+private ServiceClientMetricsImpl metrics;
// Get total requests
long totalRequests = metrics.getTotalRequests("user-service");
@@ -407,7 +407,7 @@ stats.forEach((endpoint, statistics) -> {
### Performance Metrics Collector
-The `PerformanceMetricsCollector` provides advanced performance tracking.
+The `PerformanceMetricsCollectorImpl` provides advanced performance tracking.
#### Usage
@@ -415,7 +415,7 @@ The `PerformanceMetricsCollector` provides advanced performance tracking.
@Autowired
private MeterRegistry meterRegistry;
-PerformanceMetricsCollector collector = new PerformanceMetricsCollector(meterRegistry);
+PerformanceMetricsCollectorImpl collector = new PerformanceMetricsCollectorImpl(meterRegistry);
// Record a request
collector.recordRequest("user-service", "GET", "/users/123",
@@ -503,7 +503,7 @@ Create a custom endpoint for service client statistics:
public class ServiceClientsEndpoint {
@Autowired
- private ServiceClientMetrics metrics;
+ private ServiceClientMetricsImpl metrics;
@ReadOperation
public Map serviceClients() {
diff --git a/modules/client/src/main/java/org/fireflyframework/client/cache/HttpCacheInterceptor.java b/modules/client/src/main/java/org/fireflyframework/client/cache/HttpCacheInterceptorImpl.java
similarity index 95%
rename from modules/client/src/main/java/org/fireflyframework/client/cache/HttpCacheInterceptor.java
rename to modules/client/src/main/java/org/fireflyframework/client/cache/HttpCacheInterceptorImpl.java
index 766ec062d..42cef7b2f 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/cache/HttpCacheInterceptor.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/cache/HttpCacheInterceptorImpl.java
@@ -38,12 +38,12 @@
* @since 1.0.0
*/
@Slf4j
-public class HttpCacheInterceptor implements ServiceClientInterceptor {
+public class HttpCacheInterceptorImpl implements ServiceClientInterceptor {
private final HttpCacheManager cacheManager;
private final HttpCacheConfig config;
- public HttpCacheInterceptor(HttpCacheManager cacheManager, HttpCacheConfig config) {
+ public HttpCacheInterceptorImpl(HttpCacheManager cacheManager, HttpCacheConfig config) {
this.cacheManager = cacheManager;
this.config = config;
}
diff --git a/modules/client/src/main/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptor.java b/modules/client/src/main/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptorImpl.java
similarity index 98%
rename from modules/client/src/main/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptor.java
rename to modules/client/src/main/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptorImpl.java
index efb81f7b8..b8beaf3bd 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptor.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptorImpl.java
@@ -71,7 +71,7 @@
* @since 1.0.0
*/
@Slf4j
-public class ChaosEngineeringInterceptor implements ServiceClientInterceptor {
+public class ChaosEngineeringInterceptorImpl implements ServiceClientInterceptor {
private final FaultInjectionConfig config;
private final AtomicLong totalRequests = new AtomicLong(0);
@@ -81,7 +81,7 @@ public class ChaosEngineeringInterceptor implements ServiceClientInterceptor {
private final AtomicLong networkFailureInjections = new AtomicLong(0);
private final AtomicLong responseCorruptions = new AtomicLong(0);
- public ChaosEngineeringInterceptor(FaultInjectionConfig config) {
+ public ChaosEngineeringInterceptorImpl(FaultInjectionConfig config) {
this.config = config;
if (config.isEnabled()) {
diff --git a/modules/client/src/main/java/org/fireflyframework/client/config/ServiceClientAutoConfiguration.java b/modules/client/src/main/java/org/fireflyframework/client/config/ServiceClientAutoConfiguration.java
index 49c914198..bfdaa8122 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/config/ServiceClientAutoConfiguration.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/config/ServiceClientAutoConfiguration.java
@@ -20,7 +20,7 @@
import org.fireflyframework.client.tracing.TracingWebClients;
import org.fireflyframework.client.builder.GrpcClientBuilder;
import org.fireflyframework.client.builder.RestClientBuilder;
-import org.fireflyframework.client.metrics.ServiceClientMetrics;
+import org.fireflyframework.client.metrics.ServiceClientMetricsImpl;
import org.fireflyframework.resilience.CircuitBreakerConfig;
import org.fireflyframework.resilience.CircuitBreakerManager;
import io.micrometer.core.instrument.MeterRegistry;
@@ -197,9 +197,9 @@ public GrpcClientBuilderFactory grpcClientBuilderFactory(CircuitBreakerManager c
@ConditionalOnBean(MeterRegistry.class)
@ConditionalOnMissingBean
@ConditionalOnProperty(prefix = "firefly.service-client.metrics", name = "enabled", havingValue = "true", matchIfMissing = true)
- public ServiceClientMetrics serviceClientMetrics(MeterRegistry meterRegistry) {
+ public ServiceClientMetricsImpl serviceClientMetrics(MeterRegistry meterRegistry) {
log.info("Configuring ServiceClient metrics integration with Micrometer");
- return new ServiceClientMetrics(meterRegistry);
+ return new ServiceClientMetricsImpl(meterRegistry);
}
/**
diff --git a/modules/client/src/main/java/org/fireflyframework/client/discovery/ConsulServiceDiscoveryClient.java b/modules/client/src/main/java/org/fireflyframework/client/discovery/ConsulServiceDiscoveryClientImpl.java
similarity index 98%
rename from modules/client/src/main/java/org/fireflyframework/client/discovery/ConsulServiceDiscoveryClient.java
rename to modules/client/src/main/java/org/fireflyframework/client/discovery/ConsulServiceDiscoveryClientImpl.java
index 86942b8b7..74b699e10 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/discovery/ConsulServiceDiscoveryClient.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/discovery/ConsulServiceDiscoveryClientImpl.java
@@ -37,12 +37,12 @@
* @since 1.0.0
*/
@Slf4j
-public class ConsulServiceDiscoveryClient implements ServiceDiscoveryClient {
+public class ConsulServiceDiscoveryClientImpl implements ServiceDiscoveryClient {
private final String consulUrl;
private final WebClient webClient;
- public ConsulServiceDiscoveryClient(String consulUrl) {
+ public ConsulServiceDiscoveryClientImpl(String consulUrl) {
this.consulUrl = consulUrl.endsWith("/") ? consulUrl.substring(0, consulUrl.length() - 1) : consulUrl;
this.webClient = org.fireflyframework.client.tracing.TracingWebClients.builder()
.baseUrl(this.consulUrl)
diff --git a/modules/client/src/main/java/org/fireflyframework/client/discovery/EurekaServiceDiscoveryClient.java b/modules/client/src/main/java/org/fireflyframework/client/discovery/EurekaServiceDiscoveryClientImpl.java
similarity index 98%
rename from modules/client/src/main/java/org/fireflyframework/client/discovery/EurekaServiceDiscoveryClient.java
rename to modules/client/src/main/java/org/fireflyframework/client/discovery/EurekaServiceDiscoveryClientImpl.java
index 299e18118..eff3c59f8 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/discovery/EurekaServiceDiscoveryClient.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/discovery/EurekaServiceDiscoveryClientImpl.java
@@ -37,12 +37,12 @@
* @since 1.0.0
*/
@Slf4j
-public class EurekaServiceDiscoveryClient implements ServiceDiscoveryClient {
+public class EurekaServiceDiscoveryClientImpl implements ServiceDiscoveryClient {
private final String eurekaUrl;
private final WebClient webClient;
- public EurekaServiceDiscoveryClient(String eurekaUrl) {
+ public EurekaServiceDiscoveryClientImpl(String eurekaUrl) {
this.eurekaUrl = eurekaUrl.endsWith("/") ? eurekaUrl.substring(0, eurekaUrl.length() - 1) : eurekaUrl;
this.webClient = org.fireflyframework.client.tracing.TracingWebClients.builder()
.baseUrl(this.eurekaUrl)
diff --git a/modules/client/src/main/java/org/fireflyframework/client/discovery/KubernetesServiceDiscoveryClient.java b/modules/client/src/main/java/org/fireflyframework/client/discovery/KubernetesServiceDiscoveryClientImpl.java
similarity index 95%
rename from modules/client/src/main/java/org/fireflyframework/client/discovery/KubernetesServiceDiscoveryClient.java
rename to modules/client/src/main/java/org/fireflyframework/client/discovery/KubernetesServiceDiscoveryClientImpl.java
index 1ce930734..f4c0c9c4f 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/discovery/KubernetesServiceDiscoveryClient.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/discovery/KubernetesServiceDiscoveryClientImpl.java
@@ -32,11 +32,11 @@
* @since 1.0.0
*/
@Slf4j
-public class KubernetesServiceDiscoveryClient implements ServiceDiscoveryClient {
+public class KubernetesServiceDiscoveryClientImpl implements ServiceDiscoveryClient {
private final String namespace;
- public KubernetesServiceDiscoveryClient(String namespace) {
+ public KubernetesServiceDiscoveryClientImpl(String namespace) {
this.namespace = namespace;
log.info("Initialized Kubernetes Service Discovery for namespace: {}", namespace);
}
diff --git a/modules/client/src/main/java/org/fireflyframework/client/discovery/ServiceDiscoveryClient.java b/modules/client/src/main/java/org/fireflyframework/client/discovery/ServiceDiscoveryClient.java
index 579457404..69d53d11a 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/discovery/ServiceDiscoveryClient.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/discovery/ServiceDiscoveryClient.java
@@ -147,28 +147,28 @@ enum HealthStatus {
* Creates a Kubernetes service discovery client.
*/
static ServiceDiscoveryClient kubernetes(String namespace) {
- return new KubernetesServiceDiscoveryClient(namespace);
+ return new KubernetesServiceDiscoveryClientImpl(namespace);
}
/**
* Creates an Eureka service discovery client.
*/
static ServiceDiscoveryClient eureka(String eurekaUrl) {
- return new EurekaServiceDiscoveryClient(eurekaUrl);
+ return new EurekaServiceDiscoveryClientImpl(eurekaUrl);
}
/**
* Creates a Consul service discovery client.
*/
static ServiceDiscoveryClient consul(String consulUrl) {
- return new ConsulServiceDiscoveryClient(consulUrl);
+ return new ConsulServiceDiscoveryClientImpl(consulUrl);
}
/**
* Creates a static service discovery client.
*/
static ServiceDiscoveryClient staticConfig(java.util.Map> serviceEndpoints) {
- return new StaticServiceDiscoveryClient(serviceEndpoints);
+ return new StaticServiceDiscoveryClientImpl(serviceEndpoints);
}
}
diff --git a/modules/client/src/main/java/org/fireflyframework/client/discovery/StaticServiceDiscoveryClient.java b/modules/client/src/main/java/org/fireflyframework/client/discovery/StaticServiceDiscoveryClientImpl.java
similarity index 95%
rename from modules/client/src/main/java/org/fireflyframework/client/discovery/StaticServiceDiscoveryClient.java
rename to modules/client/src/main/java/org/fireflyframework/client/discovery/StaticServiceDiscoveryClientImpl.java
index 33acd4f6f..843a2ba8d 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/discovery/StaticServiceDiscoveryClient.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/discovery/StaticServiceDiscoveryClientImpl.java
@@ -33,11 +33,11 @@
* @since 1.0.0
*/
@Slf4j
-public class StaticServiceDiscoveryClient implements ServiceDiscoveryClient {
+public class StaticServiceDiscoveryClientImpl implements ServiceDiscoveryClient {
private final Map> serviceEndpoints;
- public StaticServiceDiscoveryClient(Map> serviceEndpoints) {
+ public StaticServiceDiscoveryClientImpl(Map> serviceEndpoints) {
this.serviceEndpoints = new ConcurrentHashMap<>(serviceEndpoints);
log.info("Initialized Static Service Discovery with {} services", serviceEndpoints.size());
}
diff --git a/modules/client/src/main/java/org/fireflyframework/client/dynamic/DynamicClassGenerator.java b/modules/client/src/main/java/org/fireflyframework/client/dynamic/DynamicClassGenerator.java
index 187407e47..ec5bacbee 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/dynamic/DynamicClassGenerator.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/dynamic/DynamicClassGenerator.java
@@ -86,7 +86,7 @@ public static Object generateClass(String className, JsonNode jsonNode, ObjectMa
*/
private static Object createDynamicProxy(String className, Map data) {
// Create an invocation handler that handles method calls
- InvocationHandler handler = new DynamicObjectHandler(className, data);
+ InvocationHandler handler = new DynamicObjectHandlerImpl(className, data);
// Create a proxy that implements DynamicDTO interface
return Proxy.newProxyInstance(
@@ -142,11 +142,11 @@ public interface DynamicDTO {
/**
* Invocation handler for dynamic proxy objects.
*/
- private static class DynamicObjectHandler implements InvocationHandler {
+ private static class DynamicObjectHandlerImpl implements InvocationHandler {
private final String className;
private final Map data;
- public DynamicObjectHandler(String className, Map data) {
+ public DynamicObjectHandlerImpl(String className, Map data) {
this.className = className;
this.data = new HashMap<>(data);
}
@@ -177,8 +177,8 @@ public Object invoke(Object proxy, Method method, Object[] args) throws Throwabl
if (args[0] == proxy) return true;
if (Proxy.isProxyClass(args[0].getClass())) {
InvocationHandler otherHandler = Proxy.getInvocationHandler(args[0]);
- if (otherHandler instanceof DynamicObjectHandler) {
- return data.equals(((DynamicObjectHandler) otherHandler).data);
+ if (otherHandler instanceof DynamicObjectHandlerImpl) {
+ return data.equals(((DynamicObjectHandlerImpl) otherHandler).data);
}
}
return false;
diff --git a/modules/client/src/main/java/org/fireflyframework/client/health/ServiceClientHealthIndicator.java b/modules/client/src/main/java/org/fireflyframework/client/health/ServiceClientHealthIndicatorImpl.java
similarity index 96%
rename from modules/client/src/main/java/org/fireflyframework/client/health/ServiceClientHealthIndicator.java
rename to modules/client/src/main/java/org/fireflyframework/client/health/ServiceClientHealthIndicatorImpl.java
index 42740f16b..04b7361fc 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/health/ServiceClientHealthIndicator.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/health/ServiceClientHealthIndicatorImpl.java
@@ -73,7 +73,7 @@
* @since 1.0.0
*/
@Slf4j
-public class ServiceClientHealthIndicator implements ReactiveHealthIndicator {
+public class ServiceClientHealthIndicatorImpl implements ReactiveHealthIndicator {
private final ServiceClientHealthManager healthManager;
private final Duration healthCheckTimeout;
@@ -84,7 +84,7 @@ public class ServiceClientHealthIndicator implements ReactiveHealthIndicator {
* @param healthManager the health manager
* @param healthCheckTimeout timeout for health checks
*/
- public ServiceClientHealthIndicator(ServiceClientHealthManager healthManager, Duration healthCheckTimeout) {
+ public ServiceClientHealthIndicatorImpl(ServiceClientHealthManager healthManager, Duration healthCheckTimeout) {
this.healthManager = healthManager;
this.healthCheckTimeout = healthCheckTimeout;
log.info("Initialized ServiceClient health indicator for Spring Boot Actuator");
@@ -95,7 +95,7 @@ public ServiceClientHealthIndicator(ServiceClientHealthManager healthManager, Du
*
* @param healthManager the health manager
*/
- public ServiceClientHealthIndicator(ServiceClientHealthManager healthManager) {
+ public ServiceClientHealthIndicatorImpl(ServiceClientHealthManager healthManager) {
this(healthManager, Duration.ofSeconds(5));
}
diff --git a/modules/client/src/main/java/org/fireflyframework/client/impl/RestServiceClientImpl.java b/modules/client/src/main/java/org/fireflyframework/client/impl/RestServiceClientImpl.java
index 91ae92bbd..d34b338f7 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/impl/RestServiceClientImpl.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/impl/RestServiceClientImpl.java
@@ -132,52 +132,52 @@ public RestServiceClientImpl(String serviceName,
@Override
public RequestBuilder get(String endpoint, Class responseType) {
- return new RestRequestBuilder<>("GET", endpoint, responseType, null);
+ return new RestRequestBuilderImpl<>("GET", endpoint, responseType, null);
}
@Override
public RequestBuilder get(String endpoint, TypeReference typeReference) {
- return new RestRequestBuilder<>("GET", endpoint, null, typeReference);
+ return new RestRequestBuilderImpl<>("GET", endpoint, null, typeReference);
}
@Override
public RequestBuilder post(String endpoint, Class responseType) {
- return new RestRequestBuilder<>("POST", endpoint, responseType, null);
+ return new RestRequestBuilderImpl<>("POST", endpoint, responseType, null);
}
@Override
public RequestBuilder post(String endpoint, TypeReference typeReference) {
- return new RestRequestBuilder<>("POST", endpoint, null, typeReference);
+ return new RestRequestBuilderImpl<>("POST", endpoint, null, typeReference);
}
@Override
public RequestBuilder put(String endpoint, Class responseType) {
- return new RestRequestBuilder<>("PUT", endpoint, responseType, null);
+ return new RestRequestBuilderImpl<>("PUT", endpoint, responseType, null);
}
@Override
public RequestBuilder put(String endpoint, TypeReference typeReference) {
- return new RestRequestBuilder<>("PUT", endpoint, null, typeReference);
+ return new RestRequestBuilderImpl<>("PUT", endpoint, null, typeReference);
}
@Override
public RequestBuilder delete(String endpoint, Class responseType) {
- return new RestRequestBuilder<>("DELETE", endpoint, responseType, null);
+ return new RestRequestBuilderImpl<>("DELETE", endpoint, responseType, null);
}
@Override
public RequestBuilder delete(String endpoint, TypeReference typeReference) {
- return new RestRequestBuilder<>("DELETE", endpoint, null, typeReference);
+ return new RestRequestBuilderImpl<>("DELETE", endpoint, null, typeReference);
}
@Override
public RequestBuilder patch(String endpoint, Class responseType) {
- return new RestRequestBuilder<>("PATCH", endpoint, responseType, null);
+ return new RestRequestBuilderImpl<>("PATCH", endpoint, responseType, null);
}
@Override
public RequestBuilder patch(String endpoint, TypeReference typeReference) {
- return new RestRequestBuilder<>("PATCH", endpoint, null, typeReference);
+ return new RestRequestBuilderImpl<>("PATCH", endpoint, null, typeReference);
}
@@ -260,7 +260,7 @@ private WebClient createDefaultWebClient() {
// Inner RequestBuilder Implementation
// ========================================
- private class RestRequestBuilder implements RestClient.RequestBuilder {
+ private class RestRequestBuilderImpl implements RestClient.RequestBuilder {
private final String method;
private final String endpoint;
private final Class responseType;
@@ -272,7 +272,7 @@ private class RestRequestBuilder implements RestClient.RequestBuilder {
private Map headers = new java.util.HashMap<>();
private Duration requestTimeout = timeout;
- public RestRequestBuilder(String method, String endpoint, Class responseType, TypeReference typeReference) {
+ public RestRequestBuilderImpl(String method, String endpoint, Class responseType, TypeReference typeReference) {
this.method = method;
this.endpoint = endpoint;
this.responseType = responseType;
diff --git a/modules/client/src/main/java/org/fireflyframework/client/impl/SoapServiceClientImpl.java b/modules/client/src/main/java/org/fireflyframework/client/impl/SoapServiceClientImpl.java
index 85ba7ed6e..0de9a078c 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/impl/SoapServiceClientImpl.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/impl/SoapServiceClientImpl.java
@@ -410,7 +410,7 @@ private List parseWsdlOperations() {
// ========================================
public OperationBuilder invoke(String operationName) {
- return new SoapOperationBuilder(operationName);
+ return new SoapOperationBuilderImpl(operationName);
}
public Mono invokeAsync(String operationName, Req request, Class responseType) {
@@ -703,13 +703,13 @@ private Mono applyCircuitBreakerProtection(Mono mono) {
/**
* SOAP-specific operation builder implementation.
*/
- private class SoapOperationBuilder implements SoapClient.OperationBuilder {
+ private class SoapOperationBuilderImpl implements SoapClient.OperationBuilder {
private final String operationName;
private final Map parameters = new HashMap<>();
private final Map headers = new HashMap<>();
private Duration requestTimeout;
- public SoapOperationBuilder(String operationName) {
+ public SoapOperationBuilderImpl(String operationName) {
this.operationName = operationName;
this.requestTimeout = timeout;
}
diff --git a/modules/client/src/main/java/org/fireflyframework/client/interceptor/LoggingInterceptor.java b/modules/client/src/main/java/org/fireflyframework/client/interceptor/LoggingInterceptorImpl.java
similarity index 97%
rename from modules/client/src/main/java/org/fireflyframework/client/interceptor/LoggingInterceptor.java
rename to modules/client/src/main/java/org/fireflyframework/client/interceptor/LoggingInterceptorImpl.java
index ac4eb18e2..a7a5b2fe8 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/interceptor/LoggingInterceptor.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/interceptor/LoggingInterceptorImpl.java
@@ -43,7 +43,7 @@
* @since 2.0.0
*/
@Slf4j
-public class LoggingInterceptor implements ServiceClientInterceptor {
+public class LoggingInterceptorImpl implements ServiceClientInterceptor {
private final LogLevel logLevel;
private final boolean logHeaders;
@@ -53,7 +53,7 @@ public class LoggingInterceptor implements ServiceClientInterceptor {
private final Set sensitiveHeaders;
private final Set excludedServices;
- private LoggingInterceptor(Builder builder) {
+ private LoggingInterceptorImpl(Builder builder) {
this.logLevel = builder.logLevel;
this.logHeaders = builder.logHeaders;
this.logBody = builder.logBody;
@@ -259,8 +259,8 @@ public Builder excludedServices(java.util.Set services) {
return this;
}
- public LoggingInterceptor build() {
- return new LoggingInterceptor(this);
+ public LoggingInterceptorImpl build() {
+ return new LoggingInterceptorImpl(this);
}
}
}
diff --git a/modules/client/src/main/java/org/fireflyframework/client/interceptor/MetricsInterceptor.java b/modules/client/src/main/java/org/fireflyframework/client/interceptor/MetricsInterceptorImpl.java
similarity index 97%
rename from modules/client/src/main/java/org/fireflyframework/client/interceptor/MetricsInterceptor.java
rename to modules/client/src/main/java/org/fireflyframework/client/interceptor/MetricsInterceptorImpl.java
index 10a37938d..5c39f32e7 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/interceptor/MetricsInterceptor.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/interceptor/MetricsInterceptorImpl.java
@@ -45,13 +45,13 @@
* @since 2.0.0
*/
@Slf4j
-public class MetricsInterceptor implements ServiceClientInterceptor {
+public class MetricsInterceptorImpl implements ServiceClientInterceptor {
private final MetricsCollector metricsCollector;
private final boolean collectDetailedMetrics;
private final boolean collectHistograms;
- public MetricsInterceptor(MetricsCollector metricsCollector, boolean collectDetailedMetrics, boolean collectHistograms) {
+ public MetricsInterceptorImpl(MetricsCollector metricsCollector, boolean collectDetailedMetrics, boolean collectHistograms) {
this.metricsCollector = metricsCollector;
this.collectDetailedMetrics = collectDetailedMetrics;
this.collectHistograms = collectHistograms;
@@ -140,7 +140,7 @@ void recordDetailedMetrics(String serviceName, String endpoint, String method, S
/**
* Simple in-memory metrics collector implementation.
*/
- public static class InMemoryMetricsCollector implements MetricsCollector {
+ public static class InMemoryMetricsCollectorImpl implements MetricsCollector {
private final Map requestCounts = new ConcurrentHashMap<>();
private final Map successCounts = new ConcurrentHashMap<>();
diff --git a/modules/client/src/main/java/org/fireflyframework/client/loadbalancer/LoadBalancerStrategy.java b/modules/client/src/main/java/org/fireflyframework/client/loadbalancer/LoadBalancerStrategy.java
index 8e77d56cb..53febfe86 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/loadbalancer/LoadBalancerStrategy.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/loadbalancer/LoadBalancerStrategy.java
@@ -53,7 +53,7 @@ public interface LoadBalancerStrategy {
/**
* Round Robin load balancer.
*/
- class RoundRobin implements LoadBalancerStrategy {
+ class RoundRobinImpl implements LoadBalancerStrategy {
private final AtomicInteger counter = new AtomicInteger(0);
@Override
@@ -70,11 +70,11 @@ public Optional selectInstance(List instances)
/**
* Weighted Round Robin load balancer.
*/
- class WeightedRoundRobin implements LoadBalancerStrategy {
+ class WeightedRoundRobinImpl implements LoadBalancerStrategy {
private final AtomicInteger counter = new AtomicInteger(0);
private final Map weights;
- public WeightedRoundRobin(Map weights) {
+ public WeightedRoundRobinImpl(Map weights) {
this.weights = weights;
}
@@ -100,7 +100,7 @@ public Optional selectInstance(List instances)
/**
* Random load balancer.
*/
- class Random implements LoadBalancerStrategy {
+ class RandomImpl implements LoadBalancerStrategy {
@Override
public Optional selectInstance(List instances) {
if (instances == null || instances.isEmpty()) {
@@ -115,7 +115,7 @@ public Optional selectInstance(List instances)
/**
* Least Connections load balancer.
*/
- class LeastConnections implements LoadBalancerStrategy {
+ class LeastConnectionsImpl implements LoadBalancerStrategy {
private final Map connections = new ConcurrentHashMap<>();
@Override
@@ -144,11 +144,11 @@ public void decrementConnections(String instanceId) {
/**
* Sticky Session load balancer.
*/
- class StickySession implements LoadBalancerStrategy {
+ class StickySessionImpl implements LoadBalancerStrategy {
private final Map sessionMap = new ConcurrentHashMap<>();
private final LoadBalancerStrategy fallbackStrategy;
- public StickySession(LoadBalancerStrategy fallbackStrategy) {
+ public StickySessionImpl(LoadBalancerStrategy fallbackStrategy) {
this.fallbackStrategy = fallbackStrategy;
}
@@ -184,11 +184,11 @@ public void clearSession(String sessionId) {
/**
* Zone-aware load balancer (prefers instances in same zone).
*/
- class ZoneAware implements LoadBalancerStrategy {
+ class ZoneAwareImpl implements LoadBalancerStrategy {
private final String preferredZone;
private final LoadBalancerStrategy fallbackStrategy;
- public ZoneAware(String preferredZone, LoadBalancerStrategy fallbackStrategy) {
+ public ZoneAwareImpl(String preferredZone, LoadBalancerStrategy fallbackStrategy) {
this.preferredZone = preferredZone;
this.fallbackStrategy = fallbackStrategy;
}
diff --git a/modules/client/src/main/java/org/fireflyframework/client/metrics/PerformanceMetricsCollector.java b/modules/client/src/main/java/org/fireflyframework/client/metrics/PerformanceMetricsCollectorImpl.java
similarity index 98%
rename from modules/client/src/main/java/org/fireflyframework/client/metrics/PerformanceMetricsCollector.java
rename to modules/client/src/main/java/org/fireflyframework/client/metrics/PerformanceMetricsCollectorImpl.java
index a004ff3be..72595eba9 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/metrics/PerformanceMetricsCollector.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/metrics/PerformanceMetricsCollectorImpl.java
@@ -47,7 +47,7 @@
* @since 1.0.0
*/
@Slf4j
-public class PerformanceMetricsCollector extends FireflyMetricsSupport {
+public class PerformanceMetricsCollectorImpl extends FireflyMetricsSupport {
private final Map concurrentRequestsMap = new ConcurrentHashMap<>();
private final Map lastRequestTimeMap = new ConcurrentHashMap<>();
@@ -58,7 +58,7 @@ public class PerformanceMetricsCollector extends FireflyMetricsSupport {
*
* @param meterRegistry the Micrometer meter registry
*/
- public PerformanceMetricsCollector(MeterRegistry meterRegistry) {
+ public PerformanceMetricsCollectorImpl(MeterRegistry meterRegistry) {
super(meterRegistry, "client");
this.startTime = Instant.now();
log.info("Initialized PerformanceMetricsCollector");
diff --git a/modules/client/src/main/java/org/fireflyframework/client/metrics/ServiceClientMetrics.java b/modules/client/src/main/java/org/fireflyframework/client/metrics/ServiceClientMetricsImpl.java
similarity index 98%
rename from modules/client/src/main/java/org/fireflyframework/client/metrics/ServiceClientMetrics.java
rename to modules/client/src/main/java/org/fireflyframework/client/metrics/ServiceClientMetricsImpl.java
index 9e7c8046f..690023506 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/metrics/ServiceClientMetrics.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/metrics/ServiceClientMetricsImpl.java
@@ -42,7 +42,7 @@
* @since 1.0.0
*/
@Slf4j
-public class ServiceClientMetrics extends FireflyMetricsSupport {
+public class ServiceClientMetricsImpl extends FireflyMetricsSupport {
private final ConcurrentHashMap serviceClientTypes = new ConcurrentHashMap<>();
private final ConcurrentHashMap circuitBreakerStates = new ConcurrentHashMap<>();
@@ -52,7 +52,7 @@ public class ServiceClientMetrics extends FireflyMetricsSupport {
*
* @param meterRegistry the Micrometer meter registry
*/
- public ServiceClientMetrics(MeterRegistry meterRegistry) {
+ public ServiceClientMetricsImpl(MeterRegistry meterRegistry) {
super(meterRegistry, "client");
log.info("Initialized ServiceClient metrics with Micrometer");
}
diff --git a/modules/client/src/main/java/org/fireflyframework/client/resilience/AdvancedResilienceManager.java b/modules/client/src/main/java/org/fireflyframework/client/resilience/AdvancedResilienceManager.java
index da1ea85d3..69355a198 100644
--- a/modules/client/src/main/java/org/fireflyframework/client/resilience/AdvancedResilienceManager.java
+++ b/modules/client/src/main/java/org/fireflyframework/client/resilience/AdvancedResilienceManager.java
@@ -303,7 +303,7 @@ public interface LoadSheddingStrategy {
* Response time degradation
*
*/
- public static class SystemLoadSheddingStrategy implements LoadSheddingStrategy {
+ public static class SystemLoadSheddingStrategyImpl implements LoadSheddingStrategy {
private final double maxCpuUsage;
private final double maxMemoryUsage;
private final double maxThreadPoolUtilization;
@@ -323,7 +323,7 @@ public static class SystemLoadSheddingStrategy implements LoadSheddingStrategy {
// Service-specific metrics
private final Map serviceMetrics = new ConcurrentHashMap<>();
- public SystemLoadSheddingStrategy(double maxCpuUsage, double maxMemoryUsage,
+ public SystemLoadSheddingStrategyImpl(double maxCpuUsage, double maxMemoryUsage,
double maxThreadPoolUtilization, long maxResponseTimeMs,
int maxRequestsPerSecond) {
this.maxCpuUsage = maxCpuUsage;
@@ -339,7 +339,7 @@ public SystemLoadSheddingStrategy(double maxCpuUsage, double maxMemoryUsage,
this.gcBeans = ManagementFactory.getGarbageCollectorMXBeans();
}
- public SystemLoadSheddingStrategy(double maxCpuUsage, double maxMemoryUsage) {
+ public SystemLoadSheddingStrategyImpl(double maxCpuUsage, double maxMemoryUsage) {
this(maxCpuUsage, maxMemoryUsage, 0.9, 5000, 1000);
}
diff --git a/modules/client/src/test/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptorTest.java b/modules/client/src/test/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptorTest.java
index fbb0ba2e4..8f6a2761b 100644
--- a/modules/client/src/test/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptorTest.java
+++ b/modules/client/src/test/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptorTest.java
@@ -16,7 +16,7 @@
package org.fireflyframework.client.chaos;
-import org.fireflyframework.client.chaos.ChaosEngineeringInterceptor.ChaosStatistics;
+import org.fireflyframework.client.chaos.ChaosEngineeringInterceptorImpl.ChaosStatistics;
import org.fireflyframework.client.exception.ServiceConnectionException;
import org.fireflyframework.client.exception.ServiceTimeoutException;
import org.fireflyframework.client.interceptor.InterceptorChain;
@@ -51,7 +51,7 @@ class ChaosEngineeringInterceptorTest {
@Mock
private InterceptorChain chain;
- private ChaosEngineeringInterceptor interceptor;
+ private ChaosEngineeringInterceptorImpl interceptor;
@BeforeEach
void setUp() {
@@ -73,7 +73,7 @@ void shouldNotInjectFaultsWhenDisabled() {
.enabled(false)
.build();
- interceptor = new ChaosEngineeringInterceptor(config);
+ interceptor = new ChaosEngineeringInterceptorImpl(config);
// When
Mono result = interceptor.intercept(request, chain);
@@ -95,7 +95,7 @@ void shouldInjectLatency() {
.maxLatency(Duration.ofMillis(100))
.build();
- interceptor = new ChaosEngineeringInterceptor(config);
+ interceptor = new ChaosEngineeringInterceptorImpl(config);
// When
long startTime = System.currentTimeMillis();
@@ -122,7 +122,7 @@ void shouldInjectNetworkFailure() {
.networkFailureProbability(1.0) // Always inject
.build();
- interceptor = new ChaosEngineeringInterceptor(config);
+ interceptor = new ChaosEngineeringInterceptorImpl(config);
// When
Mono result = interceptor.intercept(request, chain);
@@ -146,7 +146,7 @@ void shouldInjectTimeout() {
.timeoutDuration(Duration.ofMillis(10))
.build();
- interceptor = new ChaosEngineeringInterceptor(config);
+ interceptor = new ChaosEngineeringInterceptorImpl(config);
// When
Mono result = interceptor.intercept(request, chain);
@@ -170,7 +170,7 @@ void shouldInjectError() {
.errorType(FaultInjectionConfig.ErrorType.SERVICE_UNAVAILABLE)
.build();
- interceptor = new ChaosEngineeringInterceptor(config);
+ interceptor = new ChaosEngineeringInterceptorImpl(config);
// When
Mono result = interceptor.intercept(request, chain);
@@ -195,7 +195,7 @@ void shouldCalculateStatistics() {
.maxLatency(Duration.ofMillis(10))
.build();
- interceptor = new ChaosEngineeringInterceptor(config);
+ interceptor = new ChaosEngineeringInterceptorImpl(config);
// When
for (int i = 0; i < 10; i++) {
@@ -220,7 +220,7 @@ void shouldResetStatistics() {
.maxLatency(Duration.ofMillis(10))
.build();
- interceptor = new ChaosEngineeringInterceptor(config);
+ interceptor = new ChaosEngineeringInterceptorImpl(config);
interceptor.intercept(request, chain).block();
// When
diff --git a/modules/client/src/test/java/org/fireflyframework/client/discovery/ServiceDiscoveryClientTest.java b/modules/client/src/test/java/org/fireflyframework/client/discovery/ServiceDiscoveryClientTest.java
index 239abc12c..ac1d63aa5 100644
--- a/modules/client/src/test/java/org/fireflyframework/client/discovery/ServiceDiscoveryClientTest.java
+++ b/modules/client/src/test/java/org/fireflyframework/client/discovery/ServiceDiscoveryClientTest.java
@@ -49,7 +49,7 @@ void shouldCreateStaticDiscoveryClient() {
ServiceDiscoveryClient client = ServiceDiscoveryClient.staticConfig(endpoints);
// Then
- assertThat(client).isInstanceOf(StaticServiceDiscoveryClient.class);
+ assertThat(client).isInstanceOf(StaticServiceDiscoveryClientImpl.class);
}
@Test
@@ -216,7 +216,7 @@ void shouldCreateKubernetesDiscoveryClient() {
ServiceDiscoveryClient client = ServiceDiscoveryClient.kubernetes("default");
// Then
- assertThat(client).isInstanceOf(KubernetesServiceDiscoveryClient.class);
+ assertThat(client).isInstanceOf(KubernetesServiceDiscoveryClientImpl.class);
}
@Test
@@ -307,7 +307,7 @@ void shouldCreateEurekaDiscoveryClient() {
ServiceDiscoveryClient client = ServiceDiscoveryClient.eureka("http://eureka:8761");
// Then
- assertThat(client).isInstanceOf(EurekaServiceDiscoveryClient.class);
+ assertThat(client).isInstanceOf(EurekaServiceDiscoveryClientImpl.class);
}
@Test
@@ -350,7 +350,7 @@ void shouldCreateConsulDiscoveryClient() {
ServiceDiscoveryClient client = ServiceDiscoveryClient.consul("http://consul:8500");
// Then
- assertThat(client).isInstanceOf(ConsulServiceDiscoveryClient.class);
+ assertThat(client).isInstanceOf(ConsulServiceDiscoveryClientImpl.class);
}
@Test
diff --git a/modules/client/src/test/java/org/fireflyframework/client/integration/AdvancedServiceClientTest.java b/modules/client/src/test/java/org/fireflyframework/client/integration/AdvancedServiceClientTest.java
index d540f57ea..99fc33478 100644
--- a/modules/client/src/test/java/org/fireflyframework/client/integration/AdvancedServiceClientTest.java
+++ b/modules/client/src/test/java/org/fireflyframework/client/integration/AdvancedServiceClientTest.java
@@ -18,7 +18,7 @@
import org.fireflyframework.client.ServiceClient;
import org.fireflyframework.client.health.ServiceClientHealthManager;
-import org.fireflyframework.client.interceptor.MetricsInterceptor;
+import org.fireflyframework.client.interceptor.MetricsInterceptorImpl;
import org.fireflyframework.client.resilience.AdvancedResilienceManager;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.DisplayName;
@@ -50,7 +50,7 @@ class AdvancedServiceClientTest {
private ServiceClient mockServiceClient;
private ServiceClientHealthManager healthManager;
- private MetricsInterceptor.InMemoryMetricsCollector metricsCollector;
+ private MetricsInterceptorImpl.InMemoryMetricsCollectorImpl metricsCollector;
private AdvancedResilienceManager resilienceManager;
@BeforeEach
@@ -61,10 +61,10 @@ void setUp() {
3
);
- metricsCollector = new MetricsInterceptor.InMemoryMetricsCollector();
+ metricsCollector = new MetricsInterceptorImpl.InMemoryMetricsCollectorImpl();
resilienceManager = new AdvancedResilienceManager(
- new AdvancedResilienceManager.SystemLoadSheddingStrategy(
+ new AdvancedResilienceManager.SystemLoadSheddingStrategyImpl(
0.8, // maxCpuUsage
0.9, // maxMemoryUsage
0.95, // maxThreadPoolUtilization
@@ -78,13 +78,13 @@ void setUp() {
@DisplayName("Should collect comprehensive metrics for banking operations")
void shouldCollectComprehensiveMetricsForBankingOperations() {
// Given: A metrics interceptor
- MetricsInterceptor metricsInterceptor = new MetricsInterceptor(metricsCollector, true, true);
+ MetricsInterceptorImpl metricsInterceptor = new MetricsInterceptorImpl(metricsCollector, true, true);
// When: Simulating multiple banking operations
simulateBankingOperations();
// Then: Metrics should be collected
- MetricsInterceptor.MetricsSnapshot snapshot = metricsCollector.getSnapshot();
+ MetricsInterceptorImpl.MetricsSnapshot snapshot = metricsCollector.getSnapshot();
assertThat(snapshot.getRequestCounts()).isNotEmpty();
assertThat(snapshot.getSuccessCounts()).isNotEmpty();
@@ -132,7 +132,7 @@ void shouldPerformHealthChecksAndDetectServiceFailures() {
void shouldApplyBulkheadIsolationForHighVolumeBankingOperations() {
// Given: Create a resilience manager without load shedding for this test
AdvancedResilienceManager testResilienceManager = new AdvancedResilienceManager(
- new AdvancedResilienceManager.SystemLoadSheddingStrategy(
+ new AdvancedResilienceManager.SystemLoadSheddingStrategyImpl(
1.0, // maxCpuUsage - 100% (disabled)
1.0, // maxMemoryUsage - 100% (disabled)
1.0, // maxThreadPoolUtilization - 100% (disabled)
diff --git a/modules/client/src/test/java/org/fireflyframework/client/loadbalancer/LoadBalancerStrategyTest.java b/modules/client/src/test/java/org/fireflyframework/client/loadbalancer/LoadBalancerStrategyTest.java
index 929aea73c..a340c6d48 100644
--- a/modules/client/src/test/java/org/fireflyframework/client/loadbalancer/LoadBalancerStrategyTest.java
+++ b/modules/client/src/test/java/org/fireflyframework/client/loadbalancer/LoadBalancerStrategyTest.java
@@ -40,7 +40,7 @@ class LoadBalancerStrategyTest {
@Test
void shouldSelectInstanceWithRoundRobin() {
// Given
- LoadBalancerStrategy strategy = new LoadBalancerStrategy.RoundRobin();
+ LoadBalancerStrategy strategy = new LoadBalancerStrategy.RoundRobinImpl();
// When
Optional first = strategy.selectInstance(instances);
@@ -59,7 +59,7 @@ void shouldSelectInstanceWithRoundRobin() {
@Test
void shouldSelectInstanceWithRandom() {
// Given
- LoadBalancerStrategy strategy = new LoadBalancerStrategy.Random();
+ LoadBalancerStrategy strategy = new LoadBalancerStrategy.RandomImpl();
// When
Optional selected = strategy.selectInstance(instances);
@@ -77,7 +77,7 @@ void shouldSelectInstanceWithWeightedRoundRobin() {
"instance-2", 1,
"instance-3", 1
);
- LoadBalancerStrategy strategy = new LoadBalancerStrategy.WeightedRoundRobin(weights);
+ LoadBalancerStrategy strategy = new LoadBalancerStrategy.WeightedRoundRobinImpl(weights);
// When
Optional selected = strategy.selectInstance(instances);
@@ -89,7 +89,7 @@ void shouldSelectInstanceWithWeightedRoundRobin() {
@Test
void shouldSelectInstanceWithLeastConnections() {
// Given
- LoadBalancerStrategy.LeastConnections strategy = new LoadBalancerStrategy.LeastConnections();
+ LoadBalancerStrategy.LeastConnectionsImpl strategy = new LoadBalancerStrategy.LeastConnectionsImpl();
// When
Optional selected = strategy.selectInstance(instances);
@@ -106,8 +106,8 @@ void shouldSelectInstanceWithLeastConnections() {
@Test
void shouldSelectInstanceWithStickySession() {
// Given
- LoadBalancerStrategy.StickySession strategy = new LoadBalancerStrategy.StickySession(
- new LoadBalancerStrategy.RoundRobin()
+ LoadBalancerStrategy.StickySessionImpl strategy = new LoadBalancerStrategy.StickySessionImpl(
+ new LoadBalancerStrategy.RoundRobinImpl()
);
// When
@@ -129,9 +129,9 @@ void shouldSelectInstanceWithZoneAware() {
new ServiceInstance("instance-3", "test-service", "localhost", 8082, false, HealthStatus.UP, Map.of("zone", "us-east-1a"))
);
- LoadBalancerStrategy strategy = new LoadBalancerStrategy.ZoneAware(
+ LoadBalancerStrategy strategy = new LoadBalancerStrategy.ZoneAwareImpl(
"us-east-1a",
- new LoadBalancerStrategy.RoundRobin()
+ new LoadBalancerStrategy.RoundRobinImpl()
);
// When
diff --git a/modules/cqrs/MIGRATION_GUIDE.md b/modules/cqrs/MIGRATION_GUIDE.md
index d0e77766c..ceb1b3b9c 100644
--- a/modules/cqrs/MIGRATION_GUIDE.md
+++ b/modules/cqrs/MIGRATION_GUIDE.md
@@ -27,7 +27,7 @@ The following internal cache components have been removed:
### New Components
- `QueryCacheAdapter` - Bridge adapter between fireflyframework-cache and CQRS query bus
-- Integration with `FireflyCacheManager` from fireflyframework-cache
+- Integration with `FireflyCacheManagerImpl` from fireflyframework-cache
- Reactive cache operations using `Mono` return types
### Configuration Changes
@@ -211,16 +211,16 @@ public class GetAccountBalanceHandler extends QueryHandler Mono send(Command command) {
@@ -112,12 +112,12 @@ public class DefaultCommandBus implements CommandBus {
└─────────────────────────────────────────────────────────────────────┘
```
-#### DefaultQueryBus Implementation
+#### DefaultQueryBusImpl Implementation
-The `DefaultQueryBus` handles query processing with built-in caching:
+The `DefaultQueryBusImpl` handles query processing with built-in caching:
```java
-public class DefaultQueryBus implements QueryBus {
+public class DefaultQueryBusImpl implements QueryBus {
private final QueryHandlerRegistry handlerRegistry;
private final AuthorizationService authorizationService;
@@ -286,7 +286,7 @@ The framework provides a comprehensive Spring Boot Actuator endpoint for CQRS me
public class CqrsMetricsEndpoint {
private final MeterRegistry meterRegistry;
- private final CommandMetricsService commandMetricsService;
+ private final CommandMetricsServiceImpl commandMetricsService;
private final CommandHandlerRegistry commandHandlerRegistry;
private final CommandBus commandBus;
private final QueryBus queryBus;
@@ -379,13 +379,13 @@ public class CqrsMetricsEndpoint {
}
```
-### CommandMetricsService
+### CommandMetricsServiceImpl
Dedicated service for comprehensive command processing metrics collection:
```java
@Component
-public class CommandMetricsService {
+public class CommandMetricsServiceImpl {
private final MeterRegistry meterRegistry;
@@ -469,7 +469,7 @@ The framework automatically collects these Micrometer metrics:
```java
@Component
-public class CqrsHealthIndicator implements HealthIndicator {
+public class CqrsHealthIndicatorImpl implements HealthIndicator {
private final CommandHandlerRegistry commandRegistry;
private final QueryHandlerRegistry queryRegistry;
@@ -517,15 +517,15 @@ public interface ExecutionContext {
// Builder pattern
static Builder builder() {
- return new DefaultExecutionContext.Builder();
+ return new DefaultExecutionContextImpl.Builder();
}
}
```
-### DefaultExecutionContext Implementation
+### DefaultExecutionContextImpl Implementation
```java
-public class DefaultExecutionContext implements ExecutionContext {
+public class DefaultExecutionContextImpl implements ExecutionContext {
private final String userId;
private final String tenantId;
diff --git a/modules/cqrs/docs/CONFIGURATION.md b/modules/cqrs/docs/CONFIGURATION.md
index a716159e9..9100863e3 100644
--- a/modules/cqrs/docs/CONFIGURATION.md
+++ b/modules/cqrs/docs/CONFIGURATION.md
@@ -357,7 +357,7 @@ Example Response Structure:
### Available Micrometer Metrics
-The `CommandMetricsService` automatically registers these metrics:
+The `CommandMetricsServiceImpl` automatically registers these metrics:
#### Global Command Metrics
- `firefly.cqrs.command.processed` - Total commands processed successfully
diff --git a/modules/cqrs/docs/DEVELOPER_GUIDE.md b/modules/cqrs/docs/DEVELOPER_GUIDE.md
index 65db4975a..7527847c7 100644
--- a/modules/cqrs/docs/DEVELOPER_GUIDE.md
+++ b/modules/cqrs/docs/DEVELOPER_GUIDE.md
@@ -936,9 +936,9 @@ public class SecureTransferCommand implements Command {
## 📊 Observability and Monitoring
-### Built-in Metrics Collection with CommandMetricsService
+### Built-in Metrics Collection with CommandMetricsServiceImpl
-The CQRS framework provides metrics collection through the dedicated `CommandMetricsService`:
+The CQRS framework provides metrics collection through the dedicated `CommandMetricsServiceImpl`:
```yaml
# Enable metrics collection in application.yml
@@ -960,13 +960,13 @@ management:
enabled: true
```
-#### CommandMetricsService API
+#### CommandMetricsServiceImpl API
The framework uses a dedicated service for thread-safe metrics collection:
```java
@Component
-public class CommandMetricsService {
+public class CommandMetricsServiceImpl {
// Records successful command processing with timing
public void recordCommandSuccess(Command> command, Duration processingTime);
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/endpoint/CqrsMetricsEndpoint.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/endpoint/CqrsMetricsEndpoint.java
index b2468cba4..7ffc6058c 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/endpoint/CqrsMetricsEndpoint.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/endpoint/CqrsMetricsEndpoint.java
@@ -2,8 +2,8 @@
import org.fireflyframework.cqrs.command.CommandBus;
import org.fireflyframework.cqrs.command.CommandHandlerRegistry;
-import org.fireflyframework.cqrs.command.CommandMetricsService;
-import org.fireflyframework.cqrs.query.DefaultQueryBus;
+import org.fireflyframework.cqrs.command.CommandMetricsServiceImpl;
+import org.fireflyframework.cqrs.query.DefaultQueryBusImpl;
import org.fireflyframework.cqrs.query.QueryBus;
import io.micrometer.core.instrument.Counter;
import io.micrometer.core.instrument.MeterRegistry;
@@ -76,7 +76,7 @@ public class CqrsMetricsEndpoint {
private static final Logger log = LoggerFactory.getLogger(CqrsMetricsEndpoint.class);
private final MeterRegistry meterRegistry;
- private final CommandMetricsService commandMetricsService;
+ private final CommandMetricsServiceImpl commandMetricsService;
private final CommandHandlerRegistry commandHandlerRegistry;
private final CommandBus commandBus;
private final QueryBus queryBus;
@@ -84,7 +84,7 @@ public class CqrsMetricsEndpoint {
public CqrsMetricsEndpoint(
@Autowired(required = false) MeterRegistry meterRegistry,
- @Autowired(required = false) CommandMetricsService commandMetricsService,
+ @Autowired(required = false) CommandMetricsServiceImpl commandMetricsService,
@Autowired(required = false) CommandHandlerRegistry commandHandlerRegistry,
@Autowired(required = false) CommandBus commandBus,
@Autowired(required = false) QueryBus queryBus) {
@@ -345,11 +345,11 @@ private Map getHandlerInfo() {
}
// Get query handler information
- if (queryBus instanceof DefaultQueryBus) {
+ if (queryBus instanceof DefaultQueryBusImpl) {
Map queryHandlers = new LinkedHashMap<>();
try {
- java.lang.reflect.Field handlersField = DefaultQueryBus.class.getDeclaredField("handlers");
+ java.lang.reflect.Field handlersField = DefaultQueryBusImpl.class.getDeclaredField("handlers");
handlersField.setAccessible(true);
@SuppressWarnings("unchecked")
Map, Object> registeredHandlers = (Map, Object>) handlersField.get(queryBus);
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/health/CqrsHealthIndicator.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/health/CqrsHealthIndicatorImpl.java
similarity index 95%
rename from modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/health/CqrsHealthIndicator.java
rename to modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/health/CqrsHealthIndicatorImpl.java
index 31e138886..ba32df2ac 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/health/CqrsHealthIndicator.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/health/CqrsHealthIndicatorImpl.java
@@ -2,7 +2,7 @@
import org.fireflyframework.cqrs.command.CommandBus;
import org.fireflyframework.cqrs.command.CommandHandlerRegistry;
-import org.fireflyframework.cqrs.command.CommandMetricsService;
+import org.fireflyframework.cqrs.command.CommandMetricsServiceImpl;
import org.fireflyframework.cqrs.query.QueryBus;
import org.fireflyframework.observability.health.FireflyHealthIndicator;
import io.micrometer.core.instrument.Counter;
@@ -28,25 +28,25 @@
* @author Firefly Common Domain Library
* @since 1.0.0
*/
-@Component
-public class CqrsHealthIndicator extends FireflyHealthIndicator {
+@Component("cqrsHealthIndicator")
+public class CqrsHealthIndicatorImpl extends FireflyHealthIndicator {
- private static final Logger log = LoggerFactory.getLogger(CqrsHealthIndicator.class);
+ private static final Logger log = LoggerFactory.getLogger(CqrsHealthIndicatorImpl.class);
// Health thresholds
private static final double ERROR_RATE_THRESHOLD = 10.0; // 10% error rate threshold
private static final double SLOW_PROCESSING_THRESHOLD = 5000.0; // 5 seconds threshold
private final MeterRegistry meterRegistry;
- private final CommandMetricsService commandMetricsService;
+ private final CommandMetricsServiceImpl commandMetricsService;
private final CommandHandlerRegistry commandHandlerRegistry;
private final CommandBus commandBus;
private final QueryBus queryBus;
private final Instant startupTime;
- public CqrsHealthIndicator(
+ public CqrsHealthIndicatorImpl(
@Autowired(required = false) MeterRegistry meterRegistry,
- @Autowired(required = false) CommandMetricsService commandMetricsService,
+ @Autowired(required = false) CommandMetricsServiceImpl commandMetricsService,
@Autowired(required = false) CommandHandlerRegistry commandHandlerRegistry,
@Autowired(required = false) CommandBus commandBus,
@Autowired(required = false) QueryBus queryBus) {
@@ -135,7 +135,7 @@ private void addHandlerRegistryDetails(Health.Builder builder) {
}
// Query handlers (if DefaultQueryBus)
- if (queryBus instanceof org.fireflyframework.cqrs.query.DefaultQueryBus) {
+ if (queryBus instanceof org.fireflyframework.cqrs.query.DefaultQueryBusImpl) {
try {
java.lang.reflect.Field handlersField = queryBus.getClass().getDeclaredField("handlers");
handlersField.setAccessible(true);
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationMetrics.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationMetricsImpl.java
similarity index 97%
rename from modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationMetrics.java
rename to modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationMetricsImpl.java
index c9539f414..354c25a41 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationMetrics.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationMetricsImpl.java
@@ -43,14 +43,14 @@
* @since 1.0.0
*/
@Slf4j
-@Component
+@Component("authorizationMetrics")
@ConditionalOnClass(MeterRegistry.class)
-public class AuthorizationMetrics extends FireflyMetricsSupport {
+public class AuthorizationMetricsImpl extends FireflyMetricsSupport {
private final AtomicLong activeAuthorizationRequests = new AtomicLong(0);
private final AtomicLong cacheSize = new AtomicLong(0);
- public AuthorizationMetrics(MeterRegistry meterRegistry) {
+ public AuthorizationMetricsImpl(MeterRegistry meterRegistry) {
super(meterRegistry, "cqrs");
gauge("authorization.active.requests", activeAuthorizationRequests, AtomicLong::get);
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationService.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationService.java
index e9efe4bff..15fa6f1bb 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationService.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationService.java
@@ -90,9 +90,9 @@
public class AuthorizationService {
private final AuthorizationProperties properties;
- private final Optional authorizationMetrics;
+ private final Optional authorizationMetrics;
- public AuthorizationService(AuthorizationProperties properties, Optional authorizationMetrics) {
+ public AuthorizationService(AuthorizationProperties properties, Optional authorizationMetrics) {
this.properties = properties;
this.authorizationMetrics = authorizationMetrics;
log.info("Authorization service initialized - using standalone custom authorization");
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/cache/QueryCacheAdapter.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/cache/QueryCacheAdapter.java
index 00a1538f6..42d2fec07 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/cache/QueryCacheAdapter.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/cache/QueryCacheAdapter.java
@@ -17,7 +17,7 @@
package org.fireflyframework.cqrs.cache;
import org.fireflyframework.cache.core.CacheAdapter;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import lombok.extern.slf4j.Slf4j;
import reactor.core.publisher.Mono;
@@ -55,7 +55,7 @@ public class QueryCacheAdapter {
*
* @param cacheManager the Firefly cache manager (which implements CacheAdapter)
*/
- public QueryCacheAdapter(FireflyCacheManager cacheManager) {
+ public QueryCacheAdapter(FireflyCacheManagerImpl cacheManager) {
this.cache = cacheManager;
log.info("QueryCacheAdapter initialized with FireflyCacheManager");
}
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/CommandMetricsService.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/CommandMetricsServiceImpl.java
similarity index 96%
rename from modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/CommandMetricsService.java
rename to modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/CommandMetricsServiceImpl.java
index 6e311a4c5..c3fc0ac83 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/CommandMetricsService.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/CommandMetricsServiceImpl.java
@@ -50,8 +50,8 @@
* @since 1.0.0
*/
@Slf4j
-@Component
-public class CommandMetricsService extends FireflyMetricsSupport {
+@Component("commandMetricsService")
+public class CommandMetricsServiceImpl extends FireflyMetricsSupport {
/**
* Constructs a new CommandMetricsService with the provided MeterRegistry.
@@ -62,7 +62,7 @@ public class CommandMetricsService extends FireflyMetricsSupport {
* @param meterRegistry the meter registry for metrics collection, may be null
*/
@Autowired
- public CommandMetricsService(@Autowired(required = false) MeterRegistry meterRegistry) {
+ public CommandMetricsServiceImpl(@Autowired(required = false) MeterRegistry meterRegistry) {
super(meterRegistry, "cqrs");
if (meterRegistry != null) {
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/DefaultCommandBus.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/DefaultCommandBusImpl.java
similarity index 98%
rename from modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/DefaultCommandBus.java
rename to modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/DefaultCommandBusImpl.java
index 11f346a3a..2f27384f0 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/DefaultCommandBus.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/DefaultCommandBusImpl.java
@@ -60,13 +60,13 @@
* @see CommandMetricsService
*/
@Slf4j
-@Component
-public class DefaultCommandBus implements CommandBus {
+@Component("defaultCommandBus")
+public class DefaultCommandBusImpl implements CommandBus {
private final CommandHandlerRegistry handlerRegistry;
private final CommandValidationService validationService;
private final AuthorizationService authorizationService;
- private final CommandMetricsService metricsService;
+ private final CommandMetricsServiceImpl metricsService;
private final CorrelationContext correlationContext;
@Autowired(required = false)
@@ -82,10 +82,10 @@ public class DefaultCommandBus implements CommandBus {
* @param correlationContext the context for distributed tracing
*/
@Autowired
- public DefaultCommandBus(CommandHandlerRegistry handlerRegistry,
+ public DefaultCommandBusImpl(CommandHandlerRegistry handlerRegistry,
CommandValidationService validationService,
AuthorizationService authorizationService,
- CommandMetricsService metricsService,
+ CommandMetricsServiceImpl metricsService,
CorrelationContext correlationContext) {
this.handlerRegistry = handlerRegistry;
this.validationService = validationService;
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsActuatorAutoConfiguration.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsActuatorAutoConfiguration.java
index 821952b53..4954e9e7f 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsActuatorAutoConfiguration.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsActuatorAutoConfiguration.java
@@ -1,10 +1,10 @@
package org.fireflyframework.cqrs.config;
import org.fireflyframework.cqrs.actuator.endpoint.CqrsMetricsEndpoint;
-import org.fireflyframework.cqrs.actuator.health.CqrsHealthIndicator;
+import org.fireflyframework.cqrs.actuator.health.CqrsHealthIndicatorImpl;
import org.fireflyframework.cqrs.command.CommandBus;
import org.fireflyframework.cqrs.command.CommandHandlerRegistry;
-import org.fireflyframework.cqrs.command.CommandMetricsService;
+import org.fireflyframework.cqrs.command.CommandMetricsServiceImpl;
import org.fireflyframework.cqrs.query.QueryBus;
import io.micrometer.core.instrument.MeterRegistry;
import org.slf4j.Logger;
@@ -98,7 +98,7 @@ public class CqrsActuatorAutoConfiguration {
@ConditionalOnAvailableEndpoint
public CqrsMetricsEndpoint cqrsMetricsEndpoint(
@Autowired(required = false) MeterRegistry meterRegistry,
- @Autowired(required = false) CommandMetricsService commandMetricsService,
+ @Autowired(required = false) CommandMetricsServiceImpl commandMetricsService,
@Autowired(required = false) CommandHandlerRegistry commandHandlerRegistry,
@Autowired(required = false) CommandBus commandBus,
@Autowired(required = false) QueryBus queryBus) {
@@ -140,14 +140,14 @@ public CqrsMetricsEndpoint cqrsMetricsEndpoint(
@Bean
@ConditionalOnMissingBean
@ConditionalOnEnabledHealthIndicator("cqrs")
- public CqrsHealthIndicator cqrsHealthIndicator(
+ public CqrsHealthIndicatorImpl cqrsHealthIndicator(
@Autowired(required = false) MeterRegistry meterRegistry,
- @Autowired(required = false) CommandMetricsService commandMetricsService,
+ @Autowired(required = false) CommandMetricsServiceImpl commandMetricsService,
@Autowired(required = false) CommandHandlerRegistry commandHandlerRegistry,
@Autowired(required = false) CommandBus commandBus,
@Autowired(required = false) QueryBus queryBus) {
log.info("Configuring CQRS Health Indicator (auto-configured)");
- return new CqrsHealthIndicator(meterRegistry, commandMetricsService, commandHandlerRegistry, commandBus, queryBus);
+ return new CqrsHealthIndicatorImpl(meterRegistry, commandMetricsService, commandHandlerRegistry, commandBus, queryBus);
}
}
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsAutoConfiguration.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsAutoConfiguration.java
index 6bb2357d0..3c00a344a 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsAutoConfiguration.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsAutoConfiguration.java
@@ -18,16 +18,16 @@
import org.fireflyframework.cache.core.CacheType;
import org.fireflyframework.cache.factory.CacheManagerFactory;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import org.fireflyframework.cqrs.cache.QueryCacheAdapter;
import java.time.Duration;
import org.fireflyframework.cqrs.command.CommandBus;
import org.fireflyframework.cqrs.command.CommandHandlerRegistry;
-import org.fireflyframework.cqrs.command.CommandMetricsService;
+import org.fireflyframework.cqrs.command.CommandMetricsServiceImpl;
import org.fireflyframework.cqrs.command.CommandValidationService;
-import org.fireflyframework.cqrs.command.DefaultCommandBus;
-import org.fireflyframework.cqrs.query.DefaultQueryBus;
+import org.fireflyframework.cqrs.command.DefaultCommandBusImpl;
+import org.fireflyframework.cqrs.query.DefaultQueryBusImpl;
import org.fireflyframework.cqrs.query.QueryBus;
import org.fireflyframework.cqrs.tracing.CorrelationContext;
import org.fireflyframework.cqrs.validation.AutoValidationProcessor;
@@ -111,7 +111,7 @@ public AuthorizationProperties authorizationProperties() {
)
public org.fireflyframework.cqrs.authorization.AuthorizationService authorizationService(
AuthorizationProperties authorizationProperties,
- @Autowired(required = false) org.fireflyframework.cqrs.authorization.AuthorizationMetrics authorizationMetrics) {
+ @Autowired(required = false) org.fireflyframework.cqrs.authorization.AuthorizationMetricsImpl authorizationMetrics) {
log.info("Configuring CQRS Authorization Service (auto-configured)");
return new org.fireflyframework.cqrs.authorization.AuthorizationService(
authorizationProperties,
@@ -121,9 +121,9 @@ public org.fireflyframework.cqrs.authorization.AuthorizationService authorizatio
@Bean
@ConditionalOnMissingBean
- public CommandMetricsService commandMetricsService(@Autowired(required = false) io.micrometer.core.instrument.MeterRegistry meterRegistry) {
+ public CommandMetricsServiceImpl commandMetricsService(@Autowired(required = false) io.micrometer.core.instrument.MeterRegistry meterRegistry) {
log.info("Configuring CQRS Command Metrics Service (auto-configured)");
- return new CommandMetricsService(meterRegistry);
+ return new CommandMetricsServiceImpl(meterRegistry);
}
@Bean
@@ -131,14 +131,14 @@ public CommandMetricsService commandMetricsService(@Autowired(required = false)
public CommandBus commandBus(CommandHandlerRegistry handlerRegistry,
CommandValidationService validationService,
@Autowired(required = false) org.fireflyframework.cqrs.authorization.AuthorizationService authorizationService,
- CommandMetricsService metricsService,
+ CommandMetricsServiceImpl metricsService,
CorrelationContext correlationContext) {
if (authorizationService != null) {
log.info("Configuring CQRS Command Bus with authorization enabled (auto-configured)");
} else {
log.info("Configuring CQRS Command Bus with authorization disabled (auto-configured)");
}
- return new DefaultCommandBus(handlerRegistry, validationService, authorizationService, metricsService, correlationContext);
+ return new DefaultCommandBusImpl(handlerRegistry, validationService, authorizationService, metricsService, correlationContext);
}
/**
@@ -150,7 +150,7 @@ public CommandBus commandBus(CommandHandlerRegistry handlerRegistry,
@Bean("cqrsQueryCacheManager")
@ConditionalOnBean(CacheManagerFactory.class)
@ConditionalOnMissingBean(name = "cqrsQueryCacheManager")
- public FireflyCacheManager cqrsQueryCacheManager(CacheManagerFactory factory, CqrsProperties properties) {
+ public FireflyCacheManagerImpl cqrsQueryCacheManager(CacheManagerFactory factory, CqrsProperties properties) {
log.info("Creating dedicated CQRS query cache manager");
String description = "CQRS Query Results Cache - Caches query handler results for improved performance";
@@ -175,7 +175,7 @@ public FireflyCacheManager cqrsQueryCacheManager(CacheManagerFactory factory, Cq
@ConditionalOnMissingBean
@ConditionalOnBean(name = "cqrsQueryCacheManager")
public QueryCacheAdapter queryCacheAdapter(
- @Qualifier("cqrsQueryCacheManager") FireflyCacheManager cacheManager) {
+ @Qualifier("cqrsQueryCacheManager") FireflyCacheManagerImpl cacheManager) {
log.info("Configuring CQRS Query Cache Adapter with dedicated cache manager");
return new QueryCacheAdapter(cacheManager);
}
@@ -200,7 +200,7 @@ public QueryBus queryBus(ApplicationContext applicationContext,
log.info("CQRS Query Bus configured without cache support (fireflyframework-cache not available)");
}
- return new DefaultQueryBus(applicationContext, correlationContext, autoValidationProcessor,
+ return new DefaultQueryBusImpl(applicationContext, correlationContext, autoValidationProcessor,
authorizationService, cacheAdapter, meterRegistry);
}
}
\ No newline at end of file
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsEdaAutoConfiguration.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsEdaAutoConfiguration.java
index a80a89473..de8ba3294 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsEdaAutoConfiguration.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsEdaAutoConfiguration.java
@@ -19,7 +19,7 @@
import org.fireflyframework.cqrs.cache.EventDrivenCacheInvalidator;
import org.fireflyframework.cqrs.cache.QueryCacheAdapter;
import org.fireflyframework.cqrs.event.CommandEventPublisher;
-import org.fireflyframework.cqrs.event.EdaCommandEventPublisher;
+import org.fireflyframework.cqrs.event.EdaCommandEventPublisherImpl;
import org.fireflyframework.eda.event.EventEnvelope;
import org.fireflyframework.eda.publisher.EventPublisher;
import org.fireflyframework.eda.publisher.EventPublisherFactory;
@@ -60,7 +60,7 @@ public class CqrsEdaAutoConfiguration {
@ConditionalOnBean(EventPublisherFactory.class)
public CommandEventPublisher commandEventPublisher(EventPublisherFactory publisherFactory) {
log.info("Configuring CQRS-EDA bridge: CommandEventPublisher enabled - @PublishDomainEvent annotations will auto-publish events");
- return new EdaCommandEventPublisher(publisherFactory);
+ return new EdaCommandEventPublisherImpl(publisherFactory);
}
@Bean
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/DefaultExecutionContext.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/DefaultExecutionContextImpl.java
similarity index 87%
rename from modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/DefaultExecutionContext.java
rename to modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/DefaultExecutionContextImpl.java
index b3ddffc2f..d057633c9 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/DefaultExecutionContext.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/DefaultExecutionContextImpl.java
@@ -31,7 +31,7 @@
* @author Firefly Software Foundation
* @since 1.0.0
*/
-public class DefaultExecutionContext implements ExecutionContext {
+public class DefaultExecutionContextImpl implements ExecutionContext {
private final String userId;
private final String tenantId;
@@ -45,7 +45,7 @@ public class DefaultExecutionContext implements ExecutionContext {
private final Map featureFlags;
private final Map properties;
- private DefaultExecutionContext(Builder builder) {
+ private DefaultExecutionContextImpl(BuilderImpl builder) {
this.userId = builder.userId;
this.tenantId = builder.tenantId;
this.organizationId = builder.organizationId;
@@ -164,7 +164,7 @@ public String toString() {
/**
* Builder implementation for creating DefaultExecutionContext instances.
*/
- public static class Builder implements ExecutionContext.Builder {
+ public static class BuilderImpl implements ExecutionContext.Builder {
private String userId;
private String tenantId;
private String organizationId;
@@ -178,61 +178,61 @@ public static class Builder implements ExecutionContext.Builder {
private final Map properties = new ConcurrentHashMap<>();
@Override
- public Builder withUserId(String userId) {
+ public BuilderImpl withUserId(String userId) {
this.userId = userId;
return this;
}
@Override
- public Builder withTenantId(String tenantId) {
+ public BuilderImpl withTenantId(String tenantId) {
this.tenantId = tenantId;
return this;
}
@Override
- public Builder withOrganizationId(String organizationId) {
+ public BuilderImpl withOrganizationId(String organizationId) {
this.organizationId = organizationId;
return this;
}
@Override
- public Builder withSessionId(String sessionId) {
+ public BuilderImpl withSessionId(String sessionId) {
this.sessionId = sessionId;
return this;
}
@Override
- public Builder withRequestId(String requestId) {
+ public BuilderImpl withRequestId(String requestId) {
this.requestId = requestId;
return this;
}
@Override
- public Builder withSource(String source) {
+ public BuilderImpl withSource(String source) {
this.source = source;
return this;
}
@Override
- public Builder withClientIp(String clientIp) {
+ public BuilderImpl withClientIp(String clientIp) {
this.clientIp = clientIp;
return this;
}
@Override
- public Builder withUserAgent(String userAgent) {
+ public BuilderImpl withUserAgent(String userAgent) {
this.userAgent = userAgent;
return this;
}
@Override
- public Builder withFeatureFlag(String flagName, boolean value) {
+ public BuilderImpl withFeatureFlag(String flagName, boolean value) {
this.featureFlags.put(flagName, value);
return this;
}
@Override
- public Builder withProperty(String key, Object value) {
+ public BuilderImpl withProperty(String key, Object value) {
this.properties.put(key, value);
return this;
}
@@ -242,14 +242,14 @@ public Builder withProperty(String key, Object value) {
* @param createdAt the creation timestamp
* @return this builder
*/
- public Builder withCreatedAt(Instant createdAt) {
+ public BuilderImpl withCreatedAt(Instant createdAt) {
this.createdAt = createdAt;
return this;
}
@Override
public ExecutionContext build() {
- return new DefaultExecutionContext(this);
+ return new DefaultExecutionContextImpl(this);
}
}
}
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/ExecutionContext.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/ExecutionContext.java
index d6ac343ab..11510272c 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/ExecutionContext.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/ExecutionContext.java
@@ -172,7 +172,7 @@ public interface ExecutionContext {
* @return a new builder
*/
static Builder builder() {
- return new DefaultExecutionContext.Builder();
+ return new DefaultExecutionContextImpl.BuilderImpl();
}
/**
@@ -180,7 +180,7 @@ static Builder builder() {
* @return an empty context
*/
static ExecutionContext empty() {
- return new DefaultExecutionContext.Builder().build();
+ return new DefaultExecutionContextImpl.BuilderImpl().build();
}
/**
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/event/EdaCommandEventPublisher.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/event/EdaCommandEventPublisherImpl.java
similarity index 95%
rename from modules/cqrs/src/main/java/org/fireflyframework/cqrs/event/EdaCommandEventPublisher.java
rename to modules/cqrs/src/main/java/org/fireflyframework/cqrs/event/EdaCommandEventPublisherImpl.java
index 72950db33..ec06984c8 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/event/EdaCommandEventPublisher.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/event/EdaCommandEventPublisherImpl.java
@@ -38,11 +38,11 @@
* @since 1.0.0
*/
@Slf4j
-public class EdaCommandEventPublisher implements CommandEventPublisher {
+public class EdaCommandEventPublisherImpl implements CommandEventPublisher {
private final EventPublisherFactory publisherFactory;
- public EdaCommandEventPublisher(EventPublisherFactory publisherFactory) {
+ public EdaCommandEventPublisherImpl(EventPublisherFactory publisherFactory) {
this.publisherFactory = publisherFactory;
log.info("EdaCommandEventPublisher initialized - CQRS commands will auto-publish domain events via EDA");
}
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/fluent/CommandBuilder.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/fluent/CommandBuilder.java
index 255eea596..bca37b521 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/fluent/CommandBuilder.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/fluent/CommandBuilder.java
@@ -323,7 +323,7 @@ private CommandCreationStrategy determineCreationStrategy(Class> commandType)
Method builderMethod = commandType.getMethod("builder");
if (Modifier.isStatic(builderMethod.getModifiers())) {
log.debug("Using LombokBuilderStrategy for command type {}", commandType.getSimpleName());
- return new LombokBuilderStrategy();
+ return new LombokBuilderStrategyImpl();
}
} catch (NoSuchMethodException e) {
// Continue to next strategy
@@ -333,7 +333,7 @@ private CommandCreationStrategy determineCreationStrategy(Class> commandType)
Constructor>[] constructors = commandType.getConstructors();
if (constructors.length > 0) {
log.debug("Using ConstructorStrategy for command type {}", commandType.getSimpleName());
- return new ConstructorStrategy();
+ return new ConstructorStrategyImpl();
}
// Strategy 3: Try factory method pattern
@@ -344,7 +344,7 @@ private CommandCreationStrategy determineCreationStrategy(Class> commandType)
commandType.isAssignableFrom(method.getReturnType()) &&
(method.getName().startsWith("create") || method.getName().startsWith("of"))) {
log.debug("Using FactoryMethodStrategy for command type {}", commandType.getSimpleName());
- return new FactoryMethodStrategy();
+ return new FactoryMethodStrategyImpl();
}
}
} catch (Exception e) {
@@ -353,7 +353,7 @@ private CommandCreationStrategy determineCreationStrategy(Class> commandType)
// Strategy 4: Try setter-based creation (fallback)
log.debug("Using SetterStrategy for command type {}", commandType.getSimpleName());
- return new SetterStrategy();
+ return new SetterStrategyImpl();
}
/**
@@ -433,7 +433,7 @@ Object createCommand(Class> commandType, Map properties,
/**
* Strategy for creating commands using Lombok @Builder pattern.
*/
- private class LombokBuilderStrategy implements CommandCreationStrategy {
+ private class LombokBuilderStrategyImpl implements CommandCreationStrategy {
@Override
public Object createCommand(Class> commandType, Map properties,
Map metadata, String commandId,
@@ -524,7 +524,7 @@ private void tryInvokeBuilderMethod(Object builder, Class> builderClass,
/**
* Strategy for creating commands using constructor-based instantiation.
*/
- private class ConstructorStrategy implements CommandCreationStrategy {
+ private class ConstructorStrategyImpl implements CommandCreationStrategy {
@Override
public Object createCommand(Class> commandType, Map properties,
Map metadata, String commandId,
@@ -618,7 +618,7 @@ private Object getDefaultValue(Class> primitiveType) {
/**
* Strategy for creating commands using factory methods.
*/
- private class FactoryMethodStrategy implements CommandCreationStrategy {
+ private class FactoryMethodStrategyImpl implements CommandCreationStrategy {
@Override
public Object createCommand(Class> commandType, Map properties,
Map metadata, String commandId,
@@ -681,7 +681,7 @@ private Object findValueByType(Class> paramType, Map propertie
/**
* Strategy for creating commands using setter methods (fallback).
*/
- private class SetterStrategy implements CommandCreationStrategy {
+ private class SetterStrategyImpl implements CommandCreationStrategy {
@Override
public Object createCommand(Class> commandType, Map properties,
Map metadata, String commandId,
diff --git a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/query/DefaultQueryBus.java b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/query/DefaultQueryBusImpl.java
similarity index 99%
rename from modules/cqrs/src/main/java/org/fireflyframework/cqrs/query/DefaultQueryBus.java
rename to modules/cqrs/src/main/java/org/fireflyframework/cqrs/query/DefaultQueryBusImpl.java
index 39583c172..8336fea23 100644
--- a/modules/cqrs/src/main/java/org/fireflyframework/cqrs/query/DefaultQueryBus.java
+++ b/modules/cqrs/src/main/java/org/fireflyframework/cqrs/query/DefaultQueryBusImpl.java
@@ -43,8 +43,8 @@
* caching support, tracing, and error handling.
*/
@Slf4j
-@Component
-public class DefaultQueryBus extends FireflyMetricsSupport implements QueryBus {
+@Component("defaultQueryBus")
+public class DefaultQueryBusImpl extends FireflyMetricsSupport implements QueryBus {
private static final Duration DEFAULT_CACHE_TTL = Duration.ofMinutes(15);
@@ -56,7 +56,7 @@ public class DefaultQueryBus extends FireflyMetricsSupport implements QueryBus {
private final QueryCacheAdapter cacheAdapter;
@Autowired
- public DefaultQueryBus(ApplicationContext applicationContext,
+ public DefaultQueryBusImpl(ApplicationContext applicationContext,
CorrelationContext correlationContext,
AutoValidationProcessor autoValidationProcessor,
AuthorizationService authorizationService,
diff --git a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/CqrsFrameworkIntegrationTest.java b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/CqrsFrameworkIntegrationTest.java
index 3ed34e645..13d1ebb37 100644
--- a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/CqrsFrameworkIntegrationTest.java
+++ b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/CqrsFrameworkIntegrationTest.java
@@ -54,19 +54,19 @@ void setUp() {
// Create the new separated services
CommandHandlerRegistry handlerRegistry = new CommandHandlerRegistry(applicationContext);
CommandValidationService validationService = new CommandValidationService(validationProcessor);
- CommandMetricsService metricsService = new CommandMetricsService(meterRegistry);
+ CommandMetricsServiceImpl metricsService = new CommandMetricsServiceImpl(meterRegistry);
- commandBus = new DefaultCommandBus(handlerRegistry, validationService,
+ commandBus = new DefaultCommandBusImpl(handlerRegistry, validationService,
new org.fireflyframework.cqrs.authorization.AuthorizationService(TestAuthorizationProperties.createDefault(), Optional.empty()),
metricsService, correlationContext);
// Note: QueryBus is created without cache adapter for this test (cache adapter is optional)
- queryBus = new DefaultQueryBus(applicationContext, correlationContext, validationProcessor,
+ queryBus = new DefaultQueryBusImpl(applicationContext, correlationContext, validationProcessor,
new org.fireflyframework.cqrs.authorization.AuthorizationService(TestAuthorizationProperties.createDefault(), Optional.empty()),
null, meterRegistry);
// Register handlers manually with explicit type specification
- ((DefaultCommandBus) commandBus).registerHandler(new TestCreateAccountHandler());
- ((DefaultQueryBus) queryBus).registerHandler(new TestGetBalanceHandler());
+ ((DefaultCommandBusImpl) commandBus).registerHandler(new TestCreateAccountHandler());
+ ((DefaultQueryBusImpl) queryBus).registerHandler(new TestGetBalanceHandler());
}
@Test
diff --git a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/actuator/CqrsActuatorIntegrationTest.java b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/actuator/CqrsActuatorIntegrationTest.java
index a5f1470b2..753d1794a 100644
--- a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/actuator/CqrsActuatorIntegrationTest.java
+++ b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/actuator/CqrsActuatorIntegrationTest.java
@@ -1,7 +1,7 @@
package org.fireflyframework.cqrs.actuator;
import org.fireflyframework.cqrs.actuator.endpoint.CqrsMetricsEndpoint;
-import org.fireflyframework.cqrs.actuator.health.CqrsHealthIndicator;
+import org.fireflyframework.cqrs.actuator.health.CqrsHealthIndicatorImpl;
import org.fireflyframework.cqrs.command.CommandBus;
import org.fireflyframework.cqrs.query.QueryBus;
import org.fireflyframework.cqrs.command.CreateAccountCommand;
@@ -45,7 +45,7 @@ class CqrsActuatorIntegrationTest {
private CqrsMetricsEndpoint cqrsMetricsEndpoint;
@Autowired
- private CqrsHealthIndicator cqrsHealthIndicator;
+ private CqrsHealthIndicatorImpl cqrsHealthIndicator;
@Autowired
private CommandBus commandBus;
diff --git a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/authorization/AuthorizationIntegrationTest.java b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/authorization/AuthorizationIntegrationTest.java
index e88bf57c2..7c2eafd43 100644
--- a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/authorization/AuthorizationIntegrationTest.java
+++ b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/authorization/AuthorizationIntegrationTest.java
@@ -20,9 +20,9 @@
import org.fireflyframework.cqrs.command.CommandBus;
import org.fireflyframework.cqrs.command.CommandHandler;
import org.fireflyframework.cqrs.command.CommandHandlerRegistry;
-import org.fireflyframework.cqrs.command.CommandMetricsService;
+import org.fireflyframework.cqrs.command.CommandMetricsServiceImpl;
import org.fireflyframework.cqrs.command.CommandValidationService;
-import org.fireflyframework.cqrs.command.DefaultCommandBus;
+import org.fireflyframework.cqrs.command.DefaultCommandBusImpl;
import org.fireflyframework.cqrs.context.ExecutionContext;
import org.fireflyframework.cqrs.tracing.CorrelationContext;
import org.fireflyframework.cqrs.validation.AutoValidationProcessor;
@@ -55,12 +55,12 @@ void setUp() {
CommandHandlerRegistry handlerRegistry = new CommandHandlerRegistry(applicationContext);
CommandValidationService validationService = new CommandValidationService(validationProcessor);
AuthorizationService authorizationService = new AuthorizationService(TestAuthorizationProperties.createDefault(), Optional.empty());
- CommandMetricsService metricsService = new CommandMetricsService(null);
+ CommandMetricsServiceImpl metricsService = new CommandMetricsServiceImpl(null);
- commandBus = new DefaultCommandBus(handlerRegistry, validationService, authorizationService, metricsService, correlationContext);
+ commandBus = new DefaultCommandBusImpl(handlerRegistry, validationService, authorizationService, metricsService, correlationContext);
// Register test handler
- ((DefaultCommandBus) commandBus).registerHandler(new BankTransferHandler());
+ ((DefaultCommandBusImpl) commandBus).registerHandler(new BankTransferHandler());
}
@Test
diff --git a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/cache/QueryCacheAdapterTest.java b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/cache/QueryCacheAdapterTest.java
index 3c7d30c15..e8535f7f0 100644
--- a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/cache/QueryCacheAdapterTest.java
+++ b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/cache/QueryCacheAdapterTest.java
@@ -17,7 +17,7 @@
package org.fireflyframework.cqrs.cache;
import org.fireflyframework.cache.core.CacheAdapter;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -43,7 +43,7 @@
class QueryCacheAdapterTest {
@Mock
- private FireflyCacheManager cacheManager;
+ private FireflyCacheManagerImpl cacheManager;
private QueryCacheAdapter queryCacheAdapter;
diff --git a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/command/CommandBusTest.java b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/command/CommandBusTest.java
index 0eb4000a9..167c44fb5 100644
--- a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/command/CommandBusTest.java
+++ b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/command/CommandBusTest.java
@@ -42,15 +42,15 @@ void setUp() {
// Create the new separated services
CommandHandlerRegistry handlerRegistry = new CommandHandlerRegistry(applicationContext);
CommandValidationService validationService = new CommandValidationService(validationProcessor);
- CommandMetricsService metricsService = new CommandMetricsService(meterRegistry);
+ CommandMetricsServiceImpl metricsService = new CommandMetricsServiceImpl(meterRegistry);
- commandBus = new DefaultCommandBus(handlerRegistry, validationService,
+ commandBus = new DefaultCommandBusImpl(handlerRegistry, validationService,
new org.fireflyframework.cqrs.authorization.AuthorizationService(TestAuthorizationProperties.createDefault(), Optional.empty()),
metricsService, correlationContext);
// Register handlers manually for testing - using the external classes with @CommandHandlerComponent
- ((DefaultCommandBus) commandBus).registerHandler(new CreateAccountHandler());
- ((DefaultCommandBus) commandBus).registerHandler(new TransferMoneyHandler());
+ ((DefaultCommandBusImpl) commandBus).registerHandler(new CreateAccountHandler());
+ ((DefaultCommandBusImpl) commandBus).registerHandler(new TransferMoneyHandler());
}
@Test
diff --git a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/context/ExecutionContextIntegrationTest.java b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/context/ExecutionContextIntegrationTest.java
index 10693f4f1..5fc159ed7 100644
--- a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/context/ExecutionContextIntegrationTest.java
+++ b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/context/ExecutionContextIntegrationTest.java
@@ -3,8 +3,8 @@
import org.fireflyframework.cqrs.config.TestAuthorizationProperties;
import org.fireflyframework.cqrs.command.CommandBus;
import org.fireflyframework.cqrs.command.CommandHandler;
-import org.fireflyframework.cqrs.command.DefaultCommandBus;
-import org.fireflyframework.cqrs.query.DefaultQueryBus;
+import org.fireflyframework.cqrs.command.DefaultCommandBusImpl;
+import org.fireflyframework.cqrs.query.DefaultQueryBusImpl;
import org.fireflyframework.cqrs.query.QueryBus;
import org.fireflyframework.cqrs.query.QueryHandler;
import org.fireflyframework.cqrs.tracing.CorrelationContext;
@@ -40,10 +40,10 @@ void setUp() {
SimpleMeterRegistry meterRegistry = new SimpleMeterRegistry();
// Set up command bus (simplified for testing)
- commandBus = mock(DefaultCommandBus.class);
+ commandBus = mock(DefaultCommandBusImpl.class);
// Set up query bus (without cache adapter for this test)
- queryBus = new DefaultQueryBus(applicationContext, correlationContext, validationProcessor,
+ queryBus = new DefaultQueryBusImpl(applicationContext, correlationContext, validationProcessor,
new org.fireflyframework.cqrs.authorization.AuthorizationService(TestAuthorizationProperties.createDefault(), Optional.empty()),
null, meterRegistry);
@@ -86,7 +86,7 @@ protected Mono doHandle(GetTenantAccountBalanceQuery query
}
};
- ((DefaultQueryBus) queryBus).registerHandler(handler);
+ ((DefaultQueryBusImpl) queryBus).registerHandler(handler);
}
@Test
diff --git a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/integration/CqrsCacheIntegrationTest.java b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/integration/CqrsCacheIntegrationTest.java
index 5bedfb93b..cc0d347f3 100644
--- a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/integration/CqrsCacheIntegrationTest.java
+++ b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/integration/CqrsCacheIntegrationTest.java
@@ -18,14 +18,14 @@
import org.fireflyframework.cache.core.CacheAdapter;
import org.fireflyframework.cache.core.CacheType;
-import org.fireflyframework.cache.manager.FireflyCacheManager;
+import org.fireflyframework.cache.manager.FireflyCacheManagerImpl;
import org.fireflyframework.cache.config.CacheAutoConfiguration;
import org.fireflyframework.cqrs.cache.QueryCacheAdapter;
import org.fireflyframework.cqrs.config.CqrsAutoConfiguration;
import org.fireflyframework.cqrs.config.CqrsProperties;
import org.fireflyframework.cqrs.query.Query;
import org.fireflyframework.cqrs.query.QueryHandler;
-import org.fireflyframework.cqrs.query.DefaultQueryBus;
+import org.fireflyframework.cqrs.query.DefaultQueryBusImpl;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -61,11 +61,11 @@
class CqrsCacheIntegrationTest {
@Autowired
- private DefaultQueryBus queryBus;
+ private DefaultQueryBusImpl queryBus;
@Autowired
@org.springframework.beans.factory.annotation.Qualifier("cqrsQueryCacheManager")
- private FireflyCacheManager cacheManager;
+ private FireflyCacheManagerImpl cacheManager;
@Autowired
private TestAccountQueryHandler handler;
@@ -94,7 +94,7 @@ public TestNonCacheableQueryHandler testNonCacheableQueryHandler(TestAccountQuer
void shouldVerifyCaffeineIsConfigured() {
// Verify we're using the real fireflyframework-cache implementation with Caffeine
assertThat(cacheManager).isNotNull();
- assertThat(cacheManager).isInstanceOf(FireflyCacheManager.class);
+ assertThat(cacheManager).isInstanceOf(FireflyCacheManagerImpl.class);
assertThat(cacheManager.getCacheType()).isEqualTo(CacheType.CAFFEINE);
assertThat(cacheManager.isAvailable()).isTrue();
}
diff --git a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/integration/QueryCacheIsolationTest.java b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/integration/QueryCacheIsolationTest.java
index f622ce9c8..fba67243e 100644
--- a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/integration/QueryCacheIsolationTest.java
+++ b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/integration/QueryCacheIsolationTest.java
@@ -5,7 +5,7 @@
import org.fireflyframework.cqrs.cache.QueryCacheAdapter;
import org.fireflyframework.cqrs.config.CqrsAutoConfiguration;
import org.fireflyframework.cqrs.context.ExecutionContext;
-import org.fireflyframework.cqrs.query.DefaultQueryBus;
+import org.fireflyframework.cqrs.query.DefaultQueryBusImpl;
import org.fireflyframework.cqrs.query.Query;
import org.fireflyframework.cqrs.query.QueryHandler;
import org.junit.jupiter.api.BeforeEach;
@@ -30,7 +30,7 @@ class QueryCacheIsolationTest {
@Configuration
static class TestConfig { }
- @Autowired DefaultQueryBus bus;
+ @Autowired DefaultQueryBusImpl bus;
@Autowired QueryCacheAdapter cache;
private UnkeyedHandler unkeyed;
private KeyedHandler keyed;
diff --git a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/query/QueryBusTest.java b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/query/QueryBusTest.java
index 5fc7112e3..c355c14fd 100644
--- a/modules/cqrs/src/test/java/org/fireflyframework/cqrs/query/QueryBusTest.java
+++ b/modules/cqrs/src/test/java/org/fireflyframework/cqrs/query/QueryBusTest.java
@@ -35,13 +35,13 @@ void setUp() {
AutoValidationProcessor validationProcessor = new AutoValidationProcessor(null);
// Create query bus without cache adapter for this test
- queryBus = new DefaultQueryBus(applicationContext, correlationContext, validationProcessor,
+ queryBus = new DefaultQueryBusImpl(applicationContext, correlationContext, validationProcessor,
new org.fireflyframework.cqrs.authorization.AuthorizationService(TestAuthorizationProperties.createDefault(), Optional.empty()),
null, null);
// Register handlers manually for testing - using the external classes with @QueryHandlerComponent
- ((DefaultQueryBus) queryBus).registerHandler(new GetAccountBalanceHandler());
- ((DefaultQueryBus) queryBus).registerHandler(new GetTransactionHistoryHandler());
+ ((DefaultQueryBusImpl) queryBus).registerHandler(new GetAccountBalanceHandler());
+ ((DefaultQueryBusImpl) queryBus).registerHandler(new GetTransactionHistoryHandler());
}
@Test
diff --git a/modules/ecm-esignature-adobe-sign/README.md b/modules/ecm-esignature-adobe-sign/README.md
index c46535f02..bb92b36c4 100644
--- a/modules/ecm-esignature-adobe-sign/README.md
+++ b/modules/ecm-esignature-adobe-sign/README.md
@@ -62,7 +62,7 @@ import reactor.core.publisher.Mono;
@RequiredArgsConstructor
public class ContractService {
- private final SignatureEnvelopePort envelopes; // AdobeSignSignatureEnvelopeAdapter injected by auto-config
+ private final SignatureEnvelopePort envelopes; // AdobeSignSignatureEnvelopeAdapterImpl injected by auto-config
@@ -73,7 +73,7 @@ public class ContractService {
}
```
-When `firefly.ecm.esignature.provider` is `adobe-sign`, `AdobeSignAutoConfiguration` registers the `WebClient`, circuit breaker, retry and `AdobeSignSignatureEnvelopeAdapter` beans automatically and exposes the adapter as the active `SignatureEnvelopePort`.
+When `firefly.ecm.esignature.provider` is `adobe-sign`, `AdobeSignAutoConfiguration` registers the `WebClient`, circuit breaker, retry and `AdobeSignSignatureEnvelopeAdapterImpl` beans automatically and exposes the adapter as the active `SignatureEnvelopePort`.
## Configuration
@@ -91,7 +91,7 @@ The `firefly.ecm.adapter.adobe-sign` namespace is bound by [AdobeSignAdapterProp
| Type | Contract and responsibility |
| --- | --- |
-| [`AdobeSignSignatureEnvelopeAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapter.java) | Defines `AdobeSignSignatureEnvelopeAdapter`, `createEnvelope`, `ensureValidAccessToken`, `buildAgreementRequest` operations. |
+| [`AdobeSignSignatureEnvelopeAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapterImpl.java) | Defines `AdobeSignSignatureEnvelopeAdapterImpl`, `createEnvelope`, `ensureValidAccessToken`, `buildAgreementRequest` operations. |
| [`AdobeSignAdapterProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignAdapterProperties.java) | Carries `clientId`, `clientSecret`, `refreshToken`, `baseUrl`, `apiVersion` data; field constraints and defaults are declared in the linked source. |
| [`AdobeSignAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignAutoConfiguration.java) | Defines `adobeSignWebClient`, `adobeSignCircuitBreaker`, `adobeSignRetry`, `adobeSignSignatureEnvelopeAdapter` operations. |
diff --git a/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignAutoConfiguration.java b/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignAutoConfiguration.java
index aaf5d801b..a9976c4b0 100644
--- a/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignAutoConfiguration.java
+++ b/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignAutoConfiguration.java
@@ -62,7 +62,7 @@ public Retry adobeSignRetry(AdobeSignAdapterProperties properties) {
@Bean
@ConditionalOnMissingBean(SignatureEnvelopePort.class)
- public AdobeSignSignatureEnvelopeAdapter adobeSignSignatureEnvelopeAdapter(
+ public AdobeSignSignatureEnvelopeAdapterImpl adobeSignSignatureEnvelopeAdapter(
WebClient adobeSignWebClient,
AdobeSignAdapterProperties properties,
ObjectMapper objectMapper,
@@ -71,7 +71,7 @@ public AdobeSignSignatureEnvelopeAdapter adobeSignSignatureEnvelopeAdapter(
CircuitBreaker adobeSignCircuitBreaker,
Retry adobeSignRetry) {
log.info("Creating Adobe Sign signature envelope adapter");
- return new AdobeSignSignatureEnvelopeAdapter(
+ return new AdobeSignSignatureEnvelopeAdapterImpl(
adobeSignWebClient,
properties,
objectMapper,
diff --git a/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapter.java b/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapterImpl.java
similarity index 98%
rename from modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapter.java
rename to modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapterImpl.java
index 71648b18f..5198a35c9 100644
--- a/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapter.java
+++ b/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapterImpl.java
@@ -45,7 +45,7 @@
optionalProperties = {"base-url", "api-version", "webhook-url", "webhook-secret", "return-url"}
)
@ConditionalOnProperty(name = "firefly.ecm.esignature.provider", havingValue = "adobe-sign")
-public class AdobeSignSignatureEnvelopeAdapter implements SignatureEnvelopePort {
+public class AdobeSignSignatureEnvelopeAdapterImpl implements SignatureEnvelopePort {
private final WebClient webClient;
private final AdobeSignAdapterProperties properties;
@@ -61,7 +61,7 @@ public class AdobeSignSignatureEnvelopeAdapter implements SignatureEnvelopePort
private volatile String accessToken;
private volatile Instant tokenExpiresAt;
- public AdobeSignSignatureEnvelopeAdapter(WebClient webClient,
+ public AdobeSignSignatureEnvelopeAdapterImpl(WebClient webClient,
AdobeSignAdapterProperties properties,
ObjectMapper objectMapper,
DocumentContentPort documentContentPort,
diff --git a/modules/ecm-esignature-adobe-sign/src/test/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignAdapterTest.java b/modules/ecm-esignature-adobe-sign/src/test/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignAdapterTest.java
index 158d5d037..1dd26b097 100644
--- a/modules/ecm-esignature-adobe-sign/src/test/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignAdapterTest.java
+++ b/modules/ecm-esignature-adobe-sign/src/test/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignAdapterTest.java
@@ -24,11 +24,11 @@ class AdobeSignAdapterTest {
@Test
void contextLoads_andAdobeSignAdapterPresent() {
- assertThat(envelopePort).isInstanceOf(AdobeSignSignatureEnvelopeAdapter.class);
+ assertThat(envelopePort).isInstanceOf(AdobeSignSignatureEnvelopeAdapterImpl.class);
}
@org.springframework.context.annotation.Configuration
- @org.springframework.context.annotation.Import(AdobeSignSignatureEnvelopeAdapter.class)
+ @org.springframework.context.annotation.Import(AdobeSignSignatureEnvelopeAdapterImpl.class)
static class TestConfig {
@org.springframework.context.annotation.Bean
org.springframework.web.reactive.function.client.WebClient adobeSignWebClient() {
diff --git a/modules/ecm-esignature-docusign/README.md b/modules/ecm-esignature-docusign/README.md
index 66f874558..dd442bfdc 100644
--- a/modules/ecm-esignature-docusign/README.md
+++ b/modules/ecm-esignature-docusign/README.md
@@ -139,7 +139,7 @@ The `firefly.ecm.adapter.docusign` namespace is bound by [DocuSignAdapterPropert
| Type | Contract and responsibility |
| --- | --- |
-| [`DocuSignSignatureEnvelopeAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapter.java) | Defines `DocuSignSignatureEnvelopeAdapter`, `createEnvelope`, `updateEnvelope`, `deleteEnvelope` operations. |
+| [`DocuSignSignatureEnvelopeAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapterImpl.java) | Defines `DocuSignSignatureEnvelopeAdapterImpl`, `createEnvelope`, `updateEnvelope`, `deleteEnvelope` operations. |
| [`DocuSignAdapterProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAdapterProperties.java) | Carries `integrationKey`, `userId`, `accountId`, `privateKey`, `baseUrl` data; field constraints and defaults are declared in the linked source. |
| [`DocuSignAdapterAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAdapterAutoConfiguration.java) | Auto-configuration for the DocuSign ECM adapter. |
diff --git a/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAdapterAutoConfiguration.java b/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAdapterAutoConfiguration.java
index e0f10ec43..e3cc17363 100644
--- a/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAdapterAutoConfiguration.java
+++ b/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAdapterAutoConfiguration.java
@@ -17,7 +17,7 @@
import com.docusign.esign.client.ApiClient;
import org.fireflyframework.ecm.adapter.docusign.client.DocuSignClientSettings;
-import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient;
+import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
@@ -41,7 +41,7 @@ public class DocuSignAdapterAutoConfiguration {
public ApiClient docuSignApiClient(DocuSignAdapterProperties properties) {
DocuSignClientSettings settings = DocuSignClientSettings.from(properties);
try {
- ApiClient client = new ManagedDocuSignApiClient(settings);
+ ApiClient client = new ManagedDocuSignApiClientImpl(settings);
log.info("Configured DocuSign client; authentication is deferred until an operation");
return client;
} catch (Exception e) {
diff --git a/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapter.java b/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapterImpl.java
similarity index 97%
rename from modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapter.java
rename to modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapterImpl.java
index 4c9b1a497..5515c225d 100644
--- a/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapter.java
+++ b/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapterImpl.java
@@ -17,7 +17,7 @@
import org.fireflyframework.ecm.port.esignature.SignatureEnvelopePort;
import org.fireflyframework.ecm.port.document.DocumentContentPort;
import org.fireflyframework.ecm.port.document.DocumentPort;
-import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient;
+import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
@@ -43,9 +43,9 @@
requiredProperties = {"integration-key", "user-id", "account-id", "private-key"},
optionalProperties = {"base-url", "auth-server", "sandbox-mode", "return-url"}
)
-@Component
+@Component("docuSignSignatureEnvelopeAdapter")
@ConditionalOnProperty(name = "firefly.ecm.esignature.provider", havingValue = "docusign")
-public class DocuSignSignatureEnvelopeAdapter implements SignatureEnvelopePort {
+public class DocuSignSignatureEnvelopeAdapterImpl implements SignatureEnvelopePort {
private final ApiClient apiClient;
private final EnvelopesApi envelopesApi;
private final SignatureEnvelopeAccountBinding accountBinding;
@@ -53,20 +53,20 @@ public class DocuSignSignatureEnvelopeAdapter implements SignatureEnvelopePort {
private final DocumentPort documentPort;
private final @Nullable SignatureEnvelopeReferenceResolver references;
- public DocuSignSignatureEnvelopeAdapter(ApiClient apiClient, DocuSignAdapterProperties properties,
+ public DocuSignSignatureEnvelopeAdapterImpl(ApiClient apiClient, DocuSignAdapterProperties properties,
DocumentContentPort documentContentPort, DocumentPort documentPort) {
this(apiClient, properties, documentContentPort, documentPort, null);
}
@Autowired
- public DocuSignSignatureEnvelopeAdapter(ApiClient apiClient, DocuSignAdapterProperties properties,
+ public DocuSignSignatureEnvelopeAdapterImpl(ApiClient apiClient, DocuSignAdapterProperties properties,
DocumentContentPort documentContentPort, DocumentPort documentPort,
@Nullable SignatureEnvelopeReferenceResolver references) {
this.apiClient = Objects.requireNonNull(apiClient);
try {
var snapshot = new SignatureEnvelopeAccountBinding(SignatureProvider.DOCUSIGN,
Objects.requireNonNull(properties).getAccountId(), apiClient.getBasePath());
- if (apiClient instanceof ManagedDocuSignApiClient managed) {
+ if (apiClient instanceof ManagedDocuSignApiClientImpl managed) {
if (!managed.accountBinding().equals(snapshot)) throw new IllegalArgumentException();
accountBinding = managed.accountBinding();
} else accountBinding = snapshot;
@@ -299,7 +299,7 @@ private Mono sdkCallable(Callable operation) {
verifyEndpoint();
return operation.call();
};
- if (apiClient instanceof ManagedDocuSignApiClient managed) return managed.execute(bound);
+ if (apiClient instanceof ManagedDocuSignApiClientImpl managed) return managed.execute(bound);
return Mono.fromCallable(bound).subscribeOn(Schedulers.boundedElastic())
.onErrorMap(error -> DocuSignAdapterException.safe(error, DocuSignAdapterException.Operation.ENVELOPE));
}
diff --git a/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/authentication/impl/JwtDocuSignAuthentication.java b/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/authentication/impl/JwtDocuSignAuthenticationImpl.java
similarity index 95%
rename from modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/authentication/impl/JwtDocuSignAuthentication.java
rename to modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/authentication/impl/JwtDocuSignAuthenticationImpl.java
index 05baa85c8..e3b3c9a38 100644
--- a/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/authentication/impl/JwtDocuSignAuthentication.java
+++ b/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/authentication/impl/JwtDocuSignAuthenticationImpl.java
@@ -25,18 +25,18 @@
import org.fireflyframework.ecm.adapter.docusign.DocuSignAdapterException;
import org.fireflyframework.ecm.adapter.docusign.authentication.DocuSignAuthentication;
import org.fireflyframework.ecm.adapter.docusign.client.DocuSignClientSettings;
-import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient;
+import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl;
/** One bounded refresh owner per configured client; no failed or unvalidated credential is published. */
-public final class JwtDocuSignAuthentication implements DocuSignAuthentication {
- private final ManagedDocuSignApiClient client;
+public final class JwtDocuSignAuthenticationImpl implements DocuSignAuthentication {
+ private final ManagedDocuSignApiClientImpl client;
private final DocuSignClientSettings settings;
private final Clock clock;
private final LongSupplier ticker;
private final ReentrantLock refresh = new ReentrantLock();
private volatile Session session;
- public JwtDocuSignAuthentication(ManagedDocuSignApiClient client, DocuSignClientSettings settings,
+ public JwtDocuSignAuthenticationImpl(ManagedDocuSignApiClientImpl client, DocuSignClientSettings settings,
Clock clock, LongSupplier ticker) {
this.client = java.util.Objects.requireNonNull(client);
this.settings = java.util.Objects.requireNonNull(settings);
diff --git a/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClient.java b/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClientImpl.java
similarity index 94%
rename from modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClient.java
rename to modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClientImpl.java
index 63bee0777..4658c958a 100644
--- a/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClient.java
+++ b/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClientImpl.java
@@ -34,7 +34,7 @@
import org.fireflyframework.ecm.domain.model.esignature.SignatureEnvelopeAccountBinding;
import org.fireflyframework.ecm.domain.enums.esignature.SignatureProvider;
import org.fireflyframework.ecm.adapter.docusign.authentication.DocuSignAuthentication;
-import org.fireflyframework.ecm.adapter.docusign.authentication.impl.JwtDocuSignAuthentication;
+import org.fireflyframework.ecm.adapter.docusign.authentication.impl.JwtDocuSignAuthenticationImpl;
import org.glassfish.jersey.client.ClientProperties;
import org.glassfish.jersey.client.JerseyClient;
import reactor.core.publisher.Mono;
@@ -42,23 +42,23 @@
import reactor.core.scheduler.Schedulers;
/** Owns only the HTTP clients it builds and its finite SDK execution lane. */
-public final class ManagedDocuSignApiClient extends ApiClient implements AutoCloseable {
+public final class ManagedDocuSignApiClientImpl extends ApiClient implements AutoCloseable {
private final Set ownedClients = ConcurrentHashMap.newKeySet();
private final Map closeObservers = new ConcurrentHashMap<>();
private final AtomicBoolean cleanupFailed = new AtomicBoolean();
private final ThreadLocal operationScope = new ThreadLocal<>();
- private final ThreadLocal authenticationScope = new ThreadLocal<>();
+ private final ThreadLocal authenticationScope = new ThreadLocal<>();
private final AtomicBoolean closed = new AtomicBoolean();
private final ReentrantLock lifecycle = new ReentrantLock();
private final DocuSignClientSettings settings;
private final SignatureEnvelopeAccountBinding accountBinding;
private final Scheduler scheduler;
- public ManagedDocuSignApiClient(DocuSignClientSettings settings) {
+ public ManagedDocuSignApiClientImpl(DocuSignClientSettings settings) {
this(settings, Clock.systemUTC());
}
- public ManagedDocuSignApiClient(DocuSignClientSettings settings, Clock clock) {
+ public ManagedDocuSignApiClientImpl(DocuSignClientSettings settings, Clock clock) {
super(isolatedProxyAuthentication(settings, clock));
this.settings = java.util.Objects.requireNonNull(settings);
accountBinding = new SignatureEnvelopeAccountBinding(SignatureProvider.DOCUSIGN, settings.accountId(), settings.baseUrl());
@@ -71,14 +71,14 @@ public ManagedDocuSignApiClient(DocuSignClientSettings settings, Clock clock) {
setUserAgent("Firefly-ECM-Library/1.0.0");
scheduler = Schedulers.newBoundedElastic(settings.maxConcurrentRequests(),
settings.maxQueuedRequestsPerThread(), "firefly-docusign", 60, true);
- DocuSignAuthentication authentication = new JwtDocuSignAuthentication(this, settings,
+ DocuSignAuthentication authentication = new JwtDocuSignAuthenticationImpl(this, settings,
java.util.Objects.requireNonNull(clock), System::nanoTime);
addAuthorization("docusignAccessCode", new ManagedOAuth(authentication));
}
@Override protected Client buildHttpClient(boolean debugging) {
if (closed != null) ensureOperationActive();
- AuthenticationScope scope = authenticationScope == null ? null : authenticationScope.get();
+ AuthenticationScopeImpl scope = authenticationScope == null ? null : authenticationScope.get();
if (scope != null) scope.remainingMillis();
Client client = super.buildHttpClient(debugging);
// The SDK invokes this hook from its constructor, before subclass fields exist.
@@ -143,7 +143,7 @@ public void ensureOperationActive() {
ensureOpen();
OperationScope operation = operationScope.get();
if (operation != null) operation.check();
- AuthenticationScope authentication = authenticationScope.get();
+ AuthenticationScopeImpl authentication = authenticationScope.get();
if (authentication != null) authentication.remainingMillis();
}
@@ -156,7 +156,7 @@ public R authenticate(Callable operation, Function publish) thro
if (authenticationScope.get() != null)
throw new DocuSignAdapterException(DocuSignAdapterException.Code.AUTHENTICATION,
DocuSignAdapterException.Operation.AUTHENTICATION);
- AuthenticationScope scope = new AuthenticationScope();
+ AuthenticationScopeImpl scope = new AuthenticationScopeImpl();
authenticationScope.set(scope);
try {
T result;
@@ -204,7 +204,7 @@ private void closeOwned(Client client) {
}
private long lifecycleWaitNanos() {
- AuthenticationScope authentication = authenticationScope.get();
+ AuthenticationScopeImpl authentication = authenticationScope.get();
return authentication == null ? settings.authenticationWaitTimeout().toNanos()
: Math.min(settings.authenticationWaitTimeout().toNanos(), authentication.remainingNanos());
}
@@ -281,7 +281,7 @@ private static DocuSignAdapterException cleanupFailure() {
DocuSignAdapterException.Operation.ENVELOPE);
}
- private final class AuthenticationScope implements AutoCloseable {
+ private final class AuthenticationScopeImpl implements AutoCloseable {
private final List clients = new ArrayList<>(2);
private final long deadline = System.nanoTime() + settings.authenticationTimeout().toNanos();
void add(Client client) {
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/CancelledSdkCallTest.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/CancelledSdkCallTest.java
index d12160c0a..b58354401 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/CancelledSdkCallTest.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/CancelledSdkCallTest.java
@@ -14,7 +14,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.fireflyframework.ecm.adapter.docusign.client.DocuSignClientSettings;
-import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient;
+import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.slf4j.LoggerFactory;
@@ -41,7 +41,7 @@ class CancelledSdkCallTest {
@Override protected void append(ILoggingEvent event) { super.append(event); dropped.countDown(); }
};
captured.start(); logger.addAppender(captured);
- try (var transport = new ScopedSdkConnector.Scope(service); var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(value))) {
+ try (var transport = new ScopedSdkConnector.Scope(service); var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(value))) {
transport.responder = wire -> {
if (wire.uri().getPath().endsWith("/envelopes/controlled-envelope")) {
entered.countDown(); boolean wasInterrupted = false; long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(2);
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAccountBindingTest.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAccountBindingTest.java
index d157d8821..1aa1db30c 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAccountBindingTest.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAccountBindingTest.java
@@ -9,7 +9,7 @@
import java.util.Base64;
import java.util.UUID;
import org.fireflyframework.ecm.adapter.docusign.client.DocuSignClientSettings;
-import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient;
+import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl;
import org.fireflyframework.ecm.domain.enums.esignature.EnvelopeStatus;
import org.fireflyframework.ecm.domain.enums.esignature.SignatureProvider;
import org.fireflyframework.ecm.domain.model.document.Document;
@@ -42,12 +42,12 @@ private ScopedSdkConnector.Scope scope() throws Exception {
var service = temporary.resolve("builder.service"); Files.writeString(service, ScopedSdkConnector.Builder.class.getName() + "\n");
return new ScopedSdkConnector.Scope(service);
}
- private DocuSignSignatureEnvelopeAdapter adapter(ApiClient client, DocuSignAdapterProperties p) {
+ private DocuSignSignatureEnvelopeAdapterImpl adapter(ApiClient client, DocuSignAdapterProperties p) {
var docs = mock(DocumentPort.class); var content = mock(DocumentContentPort.class);
when(docs.getDocument(DocuSignEnvelopeMappingTest.DOCUMENT)).thenReturn(Mono.just(Document.builder()
.id(DocuSignEnvelopeMappingTest.DOCUMENT).name("agreement.pdf").mimeType("application/pdf").build()));
when(content.getContent(DocuSignEnvelopeMappingTest.DOCUMENT)).thenReturn(Mono.just(DocuSignEnvelopeMappingTest.PDF.clone()));
- return new DocuSignSignatureEnvelopeAdapter(client, p, content, docs, (id, provider) -> Mono.just("external-envelope"));
+ return new DocuSignSignatureEnvelopeAdapterImpl(client, p, content, docs, (id, provider) -> Mono.just("external-envelope"));
}
private static T await(Mono value) { return value.block(Duration.ofSeconds(2)); }
private static ScopedSdkConnector.Reply reply(ScopedSdkConnector.Wire wire) {
@@ -88,7 +88,7 @@ private static ScopedSdkConnector.Reply reply(ScopedSdkConnector.Wire wire) {
@Test void managedClientCannotBePairedWithPropertiesForAnotherAccount() throws Exception {
try (var transport = scope()) {
var p = managedProperties();
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(p))) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(p))) {
var other = properties(); other.setAccountId(OTHER);
assertThrows(DocuSignAdapterException.class, () -> adapter(client, other)); assertTrue(transport.exchanges.isEmpty());
}
@@ -98,7 +98,7 @@ private static ScopedSdkConnector.Reply reply(ScopedSdkConnector.Wire wire) {
@Test void authenticatedAccountAndEnvelopePathStayTogetherAfterPropertiesChange() throws Exception {
try (var transport = scope()) {
var p = managedProperties();
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(p))) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(p))) {
var port = adapter(client, p); p.setAccountId(OTHER);
assertNotNull(await(port.getEnvelopeByExternalId("controlled-envelope", SignatureProvider.DOCUSIGN)));
assertEquals(3, transport.exchanges.size());
@@ -118,7 +118,7 @@ private static ScopedSdkConnector.Reply reply(ScopedSdkConnector.Wire wire) {
@Test void autoConfiguredClientAndAdapterExposeTheSameBindingWithoutAllocationOrAuthentication() throws Exception {
try (var transport = scope()) {
var p = managedProperties();
- try (var client = (ManagedDocuSignApiClient) new DocuSignAdapterAutoConfiguration().docuSignApiClient(p)) {
+ try (var client = (ManagedDocuSignApiClientImpl) new DocuSignAdapterAutoConfiguration().docuSignApiClient(p)) {
var port = adapter(client, p);
int clients = transport.clients.size();
var lookup = port.accountBinding();
@@ -148,7 +148,7 @@ private static ScopedSdkConnector.Reply reply(ScopedSdkConnector.Wire wire) {
@Test void managedEndpointCannotDriftFromItsSettingsOrExposedBinding() throws Exception {
try (var transport = scope()) {
var p = managedProperties();
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(p))) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(p))) {
assertThrows(DocuSignAdapterException.class, () -> client.setBasePath("https://other-owned.invalid/restapi"));
assertEquals(client.accountBinding().endpoint(), client.getBasePath()); assertTrue(transport.exchanges.isEmpty());
}
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAdapterTest.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAdapterTest.java
index eb8ceae09..b12477853 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAdapterTest.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAdapterTest.java
@@ -30,11 +30,11 @@ class DocuSignAdapterTest {
@Test
void contextLoads_andDocuSignAdapterPresent() {
- assertThat(envelopePort).isInstanceOf(DocuSignSignatureEnvelopeAdapter.class);
+ assertThat(envelopePort).isInstanceOf(DocuSignSignatureEnvelopeAdapterImpl.class);
}
@Configuration
- @Import({DocuSignSignatureEnvelopeAdapter.class})
+ @Import({DocuSignSignatureEnvelopeAdapterImpl.class})
static class TestConfig {
@Bean
ApiClient apiClient() {
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAuthenticationContractTest.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAuthenticationContractTest.java
index 8f3819120..e5ba8ccd5 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAuthenticationContractTest.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAuthenticationContractTest.java
@@ -185,7 +185,7 @@ private static void closeManaged(ApiClient client) throws Exception {
.run(context -> {
assertNull(context.getStartupFailure());
owned.set(context.getBean(ApiClient.class));
- assertInstanceOf(org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient.class, owned.get());
+ assertInstanceOf(org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl.class, owned.get());
assertTrue(transport.exchanges.isEmpty());
});
assertTrue(((org.glassfish.jersey.client.JerseyClient) owned.get().getHttpClient()).isClosed());
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAuthenticationLifecycleTest.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAuthenticationLifecycleTest.java
index 9ad05fcfd..718997c79 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAuthenticationLifecycleTest.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAuthenticationLifecycleTest.java
@@ -22,9 +22,9 @@
import org.fireflyframework.ecm.domain.enums.esignature.EnvelopeStatus;
import org.fireflyframework.ecm.port.document.DocumentContentPort;
import org.fireflyframework.ecm.port.document.DocumentPort;
-import org.fireflyframework.ecm.adapter.docusign.authentication.impl.JwtDocuSignAuthentication;
+import org.fireflyframework.ecm.adapter.docusign.authentication.impl.JwtDocuSignAuthenticationImpl;
import org.fireflyframework.ecm.adapter.docusign.client.DocuSignClientSettings;
-import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient;
+import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
@@ -73,7 +73,7 @@ private static final class MutableClock extends Clock {
}
@Test void successfulAuthenticationClosesItsTwoClientsAndCachesOnlyTheValidatedToken() throws Exception {
- try (var transport = scope(); var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()))) {
+ try (var transport = scope(); var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()))) {
assertEquals(1, transport.clients.size()); assertNull(client.getAccessToken());
get(client);
assertEquals(3, transport.clients.size());
@@ -88,7 +88,7 @@ private static final class MutableClock extends Clock {
try (var transport = scope()) {
var value = properties(); value.setConnectionTimeout(Duration.ofMillis(150)); value.setReadTimeout(Duration.ofMillis(250));
value.setAuthenticationTimeout(Duration.ofSeconds(1)); value.setAuthenticationWaitTimeout(Duration.ofMillis(100));
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(value))) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(value))) {
get(client);
for (var wire : transport.exchanges) {
assertTrue(wire.connectTimeout() instanceof Integer && (Integer) wire.connectTimeout() > 0 && (Integer) wire.connectTimeout() <= 150);
@@ -109,7 +109,7 @@ private static final class MutableClock extends Clock {
}
return transport.defaultReply(wire);
};
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(value))) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(value))) {
assertThrows(DocuSignAdapterException.class, () -> get(client));
assertEquals(1, transport.exchanges.size()); assertNull(client.getAccessToken());
assertEquals(1, transport.clients.stream().filter(org.glassfish.jersey.client.JerseyClient::isClosed).count());
@@ -122,7 +122,7 @@ private static final class MutableClock extends Clock {
var count = new AtomicInteger();
transport.responder = wire -> wire.uri().getPath().endsWith("/oauth/token") ? token(count.incrementAndGet()) : transport.defaultReply(wire);
var clock = new MutableClock();
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()), clock)) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()), clock)) {
get(client); get(client); assertEquals(1, count.get());
clock.advance(4000); get(client); assertEquals(2, count.get());
assertEquals("Bearer owned-token-2", transport.exchanges.getLast().authorization());
@@ -135,8 +135,8 @@ private static final class MutableClock extends Clock {
var count = new AtomicInteger();
transport.responder = wire -> wire.uri().getPath().endsWith("/oauth/token") ? token(count.incrementAndGet()) : transport.defaultReply(wire);
var settings = DocuSignClientSettings.from(properties()); var clock = new MutableClock(); var ticker = new AtomicLong();
- try (var client = new ManagedDocuSignApiClient(settings)) {
- var authentication = new JwtDocuSignAuthentication(client, settings, clock, ticker::get);
+ try (var client = new ManagedDocuSignApiClientImpl(settings)) {
+ var authentication = new JwtDocuSignAuthenticationImpl(client, settings, clock, ticker::get);
assertEquals("owned-token-1", authentication.accessToken());
clock.advance(-1000); ticker.set(TimeUnit.SECONDS.toNanos(4000));
assertEquals("owned-token-2", authentication.accessToken()); assertEquals(2, count.get());
@@ -148,8 +148,8 @@ private static final class MutableClock extends Clock {
try (var transport = scope()) {
var count = new AtomicInteger();
transport.responder = wire -> wire.uri().getPath().endsWith("/oauth/token") ? token(count.incrementAndGet()) : transport.defaultReply(wire);
- try (var first = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()));
- var second = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()))) {
+ try (var first = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()));
+ var second = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()))) {
get(first); assertEquals("owned-token-1", first.getAccessToken());
get(second); assertEquals("owned-token-2", second.getAccessToken()); assertEquals(2, count.get());
}
@@ -157,7 +157,7 @@ private static final class MutableClock extends Clock {
}
@Test void concurrentRequestsHaveExactlyOneRefreshOwner() throws Exception {
- try (var transport = scope(); var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()))) {
+ try (var transport = scope(); var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()))) {
var entered = new CountDownLatch(1); var release = new CountDownLatch(1);
transport.responder = wire -> {
if (wire.uri().getPath().endsWith("/oauth/token")) {
@@ -181,7 +181,7 @@ private static final class MutableClock extends Clock {
@Test void waitingRefreshIsBoundedAndDoesNotStartASecondAuthentication() throws Exception {
try (var transport = scope()) {
var value = properties(); value.setAuthenticationWaitTimeout(Duration.ofMillis(20));
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(value))) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(value))) {
var entered = new CountDownLatch(1); var release = new CountDownLatch(1);
transport.responder = wire -> {
if (wire.uri().getPath().endsWith("/oauth/token")) {
@@ -205,7 +205,7 @@ private static final class MutableClock extends Clock {
}
@Test void accountMismatchNeverPublishesOrUsesAToken() throws Exception {
- try (var transport = scope(); var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()))) {
+ try (var transport = scope(); var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()))) {
transport.responder = wire -> wire.uri().getPath().endsWith("/oauth/userinfo")
? new ScopedSdkConnector.Reply(200, "{\"sub\":\"00000000-0000-4000-8000-000000000002\",\"accounts\":[{\"account_id\":\"other-owned-account\"}]}") : transport.defaultReply(wire);
var failure = assertThrows(DocuSignAdapterException.class, () -> get(client));
@@ -215,7 +215,7 @@ private static final class MutableClock extends Clock {
}
@Test void actualSdkAuthenticationErrorIsSafeAndIsNotCachedOrAutomaticallyRetried() throws Exception {
- try (var transport = scope(); var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()))) {
+ try (var transport = scope(); var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()))) {
transport.responder = wire -> new ScopedSdkConnector.Reply(401, "{\"error\":\"private-provider-body\"}");
var failure = assertThrows(DocuSignAdapterException.class, () -> get(client));
assertEquals(DocuSignAdapterException.Code.AUTHENTICATION, failure.getCode()); assertEquals(401, failure.getHttpStatus());
@@ -227,7 +227,7 @@ private static final class MutableClock extends Clock {
@Test void wrongOrMissingUserInfoSubjectCannotPublishACredentialForTheConfiguredAccount() throws Exception {
for (String subject : new String[]{"\"sub\":\"other-owned-user\",", ""}) {
- try (var transport = scope(); var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()))) {
+ try (var transport = scope(); var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()))) {
transport.responder = wire -> wire.uri().getPath().endsWith("/oauth/userinfo")
? new ScopedSdkConnector.Reply(200, "{" + subject + "\"accounts\":[{\"account_id\":\"00000000-0000-4000-8000-000000000003\"}]}") : transport.defaultReply(wire);
var failure = assertThrows(DocuSignAdapterException.class, () -> get(client));
@@ -238,7 +238,7 @@ private static final class MutableClock extends Clock {
@Test void clientClosureImmediatelyBeforeTokenPublicationCannotReturnACredential() throws Exception {
try (var transport = scope()) {
- var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()));
+ var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()));
try {
var reads = new AtomicInteger();
Clock closingClock = new Clock() {
@@ -249,7 +249,7 @@ private static final class MutableClock extends Clock {
return Instant.now();
}
};
- var authentication = new JwtDocuSignAuthentication(client, DocuSignClientSettings.from(properties()),
+ var authentication = new JwtDocuSignAuthenticationImpl(client, DocuSignClientSettings.from(properties()),
closingClock, System::nanoTime);
assertThrows(DocuSignAdapterException.class, authentication::accessToken);
assertNull(client.getAccessToken()); assertEquals(2, transport.exchanges.size());
@@ -264,7 +264,7 @@ private static final class MutableClock extends Clock {
"{\"access_token\":\"owned\",\"expires_in\":3600,\"token_type\":\"Basic\"}", "{broken",
"{\"access_token\":\"owned\\r\\ninjected\",\"expires_in\":3600,\"token_type\":\"Bearer\"}",
"{\"access_token\":\"" + "x".repeat(16385) + "\",\"expires_in\":3600,\"token_type\":\"Bearer\"}"}) {
- try (var transport = scope(); var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()))) {
+ try (var transport = scope(); var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()))) {
transport.responder = wire -> new ScopedSdkConnector.Reply(200, reply);
var failure = assertThrows(DocuSignAdapterException.class, () -> get(client));
assertNull(failure.getCause()); assertNull(client.getAccessToken()); assertEquals(1, transport.exchanges.size());
@@ -274,7 +274,7 @@ private static final class MutableClock extends Clock {
@Test void closingTheManagedClientDoesNotDisposeACallerReplacementClient() throws Exception {
try (var transport = scope()) {
- var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()));
+ var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()));
var original = (org.glassfish.jersey.client.JerseyClient) client.getHttpClient();
ApiClient borrowed = new ApiClient(); client.setHttpClient(borrowed.getHttpClient()); client.close();
assertTrue(original.isClosed());
@@ -287,7 +287,7 @@ private static final class MutableClock extends Clock {
@Test void closedClientRefusesDirectSdkAuthenticationBeforeCreatingAnotherHttpClient() throws Exception {
try (var transport = scope()) {
- var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties())); client.close();
+ var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties())); client.close();
assertThrows(DocuSignAdapterException.class, () -> client.getUserInfo("owned-test-token"));
assertEquals(1, transport.clients.size()); assertTrue(transport.exchanges.isEmpty());
}
@@ -295,17 +295,17 @@ private static final class MutableClock extends Clock {
@Test void invalidConstructorDependenciesDoNotAllocateAnSdkClient() throws Exception {
try (var transport = scope()) {
- assertThrows(RuntimeException.class, () -> new ManagedDocuSignApiClient(null));
+ assertThrows(RuntimeException.class, () -> new ManagedDocuSignApiClientImpl(null));
assertTrue(transport.clients.isEmpty(), "Invalid settings must fail before SDK construction");
var settings = DocuSignClientSettings.from(properties());
- assertThrows(RuntimeException.class, () -> new ManagedDocuSignApiClient(settings, null));
+ assertThrows(RuntimeException.class, () -> new ManagedDocuSignApiClientImpl(settings, null));
assertTrue(transport.clients.isEmpty(), "Invalid clock must fail before SDK construction");
}
}
@Test void concurrentClientClosureCannotPublishCredentialsOrBuildAnotherAuthenticationClient() throws Exception {
try (var transport = scope()) {
- var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()));
+ var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()));
var entered = new CountDownLatch(1); var release = new CountDownLatch(1);
transport.responder = wire -> {
if (wire.uri().getPath().endsWith("/oauth/token")) {
@@ -328,7 +328,7 @@ private static final class MutableClock extends Clock {
@Test void failedAuthenticationCleanupPreventsPublicationAndRemainsAReportedFailure() throws Exception {
try (var transport = scope()) {
- var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()));
+ var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()));
transport.failConnectorClose = true;
try {
var failure = assertThrows(DocuSignAdapterException.class, () -> get(client));
@@ -340,7 +340,7 @@ private static final class MutableClock extends Clock {
@Test void reportedCleanupFailureKeepsTheClientClosedToFurtherAuthentication() throws Exception {
try (var transport = scope()) {
- var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()));
+ var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()));
transport.failConnectorClose = true;
assertThrows(DocuSignAdapterException.class, () -> get(client));
transport.failConnectorClose = false;
@@ -352,21 +352,21 @@ private static final class MutableClock extends Clock {
}
}
- private static DocuSignSignatureEnvelopeAdapter adapter(ApiClient client, DocuSignAdapterProperties properties) {
+ private static DocuSignSignatureEnvelopeAdapterImpl adapter(ApiClient client, DocuSignAdapterProperties properties) {
var content = org.mockito.Mockito.mock(DocumentContentPort.class);
var documents = org.mockito.Mockito.mock(DocumentPort.class);
org.mockito.Mockito.when(content.getContent(DocuSignEnvelopeMappingTest.DOCUMENT)).thenReturn(reactor.core.publisher.Mono.just(DocuSignEnvelopeMappingTest.PDF.clone()));
org.mockito.Mockito.when(documents.getDocument(DocuSignEnvelopeMappingTest.DOCUMENT)).thenReturn(reactor.core.publisher.Mono.just(
org.fireflyframework.ecm.domain.model.document.Document.builder().id(DocuSignEnvelopeMappingTest.DOCUMENT)
.name("agreement.pdf").mimeType("application/pdf").build()));
- return new DocuSignSignatureEnvelopeAdapter(client, properties, content, documents,
+ return new DocuSignSignatureEnvelopeAdapterImpl(client, properties, content, documents,
(id, provider) -> reactor.core.publisher.Mono.just("controlled-envelope"));
}
@Test void actualAdapterUsesTheOwnedLaneAndExportsOnlySafeSdkFailures() throws Exception {
try (var transport = scope()) {
var value = properties();
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(value))) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(value))) {
var thread = new AtomicReference(); var caller = Thread.currentThread();
transport.responder = wire -> {
if (wire.method().equals("POST") && wire.uri().getPath().endsWith("/envelopes")) {
@@ -387,7 +387,7 @@ private static DocuSignSignatureEnvelopeAdapter adapter(ApiClient client, DocuSi
@Test void actualExistsDoesNotTurnProviderAuthorizationFailureIntoFalse() throws Exception {
try (var transport = scope()) {
var value = properties();
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(value))) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(value))) {
transport.responder = wire -> {
if (wire.method().equals("POST") && wire.uri().getPath().endsWith("/envelopes"))
return new ScopedSdkConnector.Reply(201, "{\"envelopeId\":\"controlled-envelope\",\"status\":\"created\"}");
@@ -407,7 +407,7 @@ private static DocuSignSignatureEnvelopeAdapter adapter(ApiClient client, DocuSi
@Test void actualListDoesNotTurnProviderFailureIntoAnEmptySuccessfulFlux() throws Exception {
try (var transport = scope()) {
var value = properties();
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(value))) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(value))) {
transport.responder = wire -> wire.method().equals("GET") && wire.uri().getPath().endsWith("/envelopes")
? new ScopedSdkConnector.Reply(503, "{\"message\":\"private-provider-body\"}") : transport.defaultReply(wire);
var failure = assertThrows(DocuSignAdapterException.class,
@@ -418,7 +418,7 @@ private static DocuSignSignatureEnvelopeAdapter adapter(ApiClient client, DocuSi
}
@Test void ownedExecutionLaneReportsActualSdkErrorsWithoutExportingProviderBodies() throws Exception {
- try (var transport = scope(); var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties()))) {
+ try (var transport = scope(); var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties()))) {
transport.responder = wire -> wire.uri().getPath().endsWith("/envelopes/controlled-envelope")
? new ScopedSdkConnector.Reply(429, "{\"errorCode\":\"CONTROLLED_LIMIT\",\"message\":\"private-provider-body\"}") : transport.defaultReply(wire);
var failure = assertThrows(DocuSignAdapterException.class,
@@ -431,7 +431,7 @@ private static DocuSignSignatureEnvelopeAdapter adapter(ApiClient client, DocuSi
@Test void finiteExecutionQueueRejectsOverflowWithoutRunningAnotherTask() throws Exception {
try (var transport = scope()) {
var value = properties(); value.setMaxConcurrentRequests(1); value.setMaxQueuedRequestsPerThread(1);
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(value))) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(value))) {
var entered = new CountDownLatch(1); var release = new CountDownLatch(1); var calls = new AtomicInteger();
var first = client.execute(() -> { entered.countDown(); if (!release.await(2, TimeUnit.SECONDS)) throw new AssertionError("Owned task not released"); return true; }).toFuture();
try {
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignCancellationIsolationTest.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignCancellationIsolationTest.java
index 79ac9f3af..0ffde6cea 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignCancellationIsolationTest.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignCancellationIsolationTest.java
@@ -11,7 +11,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.fireflyframework.ecm.adapter.docusign.client.DocuSignClientSettings;
-import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient;
+import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import static org.junit.jupiter.api.Assertions.*;
@@ -44,7 +44,7 @@ private static void awaitDespiteInterrupt(CountDownLatch release, CountDownLatch
}
}
@Test void cancellingUserInfoCannotPublishAndDoesNotPoisonTheNextSubscription() throws Exception {
- try (var transport = scope(); var client = new ManagedDocuSignApiClient(settings())) {
+ try (var transport = scope(); var client = new ManagedDocuSignApiClientImpl(settings())) {
var entered = new CountDownLatch(1); var interrupted = new CountDownLatch(1);
var release = new CountDownLatch(1); var finished = new CountDownLatch(1);
var first = new AtomicBoolean(true); var emitted = new AtomicBoolean();
@@ -70,7 +70,7 @@ private static void awaitDespiteInterrupt(CountDownLatch release, CountDownLatch
}
}
@Test void cancellingARefreshOwnerDoesNotCancelAnotherSubscriptionsRefresh() throws Exception {
- try (var transport = scope(); var client = new ManagedDocuSignApiClient(settings())) {
+ try (var transport = scope(); var client = new ManagedDocuSignApiClientImpl(settings())) {
var entered = new CountDownLatch(1); var interrupted = new CountDownLatch(1); var release = new CountDownLatch(1);
var ownerFinished = new CountDownLatch(1); var waiterEntered = new CountDownLatch(1);
var first = new AtomicBoolean(true); var ownerEmitted = new AtomicBoolean();
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignEnvelopeMappingTest.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignEnvelopeMappingTest.java
index 050204bf9..6c185c6f9 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignEnvelopeMappingTest.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignEnvelopeMappingTest.java
@@ -31,14 +31,14 @@ private ScopedSdkConnector.Scope scope() throws Exception {
Files.writeString(service, ScopedSdkConnector.Builder.class.getName() + "\n");
return new ScopedSdkConnector.Scope(service);
}
- private DocuSignSignatureEnvelopeAdapter adapter(ApiClient client, boolean content) {
+ private DocuSignSignatureEnvelopeAdapterImpl adapter(ApiClient client, boolean content) {
client.setBasePath("https://owned.invalid/restapi");
var props = new DocuSignAdapterProperties(); props.setAccountId("owned-account");
var documents = mock(DocumentPort.class); var bytes = mock(DocumentContentPort.class);
when(documents.getDocument(DOCUMENT)).thenReturn(Mono.just(Document.builder().id(DOCUMENT)
.name("agreement.pdf").extension("pdf").mimeType("application/pdf").size((long) PDF.length).encrypted(true).build()));
when(bytes.getContent(DOCUMENT)).thenReturn(content ? Mono.just(PDF.clone()) : Mono.empty());
- return new DocuSignSignatureEnvelopeAdapter(client, props, bytes, documents);
+ return new DocuSignSignatureEnvelopeAdapterImpl(client, props, bytes, documents);
}
static SignatureEnvelope envelope() {
return SignatureEnvelope.builder().title("Agreement").description("Review and sign")
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignEnvelopeOperationsTest.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignEnvelopeOperationsTest.java
index aee46eb68..87f58ee52 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignEnvelopeOperationsTest.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignEnvelopeOperationsTest.java
@@ -30,14 +30,14 @@ private ScopedSdkConnector.Scope scope() throws Exception {
Files.writeString(service, ScopedSdkConnector.Builder.class.getName() + "\n");
return new ScopedSdkConnector.Scope(service);
}
- private DocuSignSignatureEnvelopeAdapter adapter(ApiClient client, SignatureEnvelopeReferenceResolver resolver) {
+ private DocuSignSignatureEnvelopeAdapterImpl adapter(ApiClient client, SignatureEnvelopeReferenceResolver resolver) {
client.setBasePath("https://owned.invalid/restapi");
var properties = new DocuSignAdapterProperties(); properties.setAccountId("owned-account");
var documents = mock(DocumentPort.class); var content = mock(DocumentContentPort.class);
when(documents.getDocument(DocuSignEnvelopeMappingTest.DOCUMENT)).thenReturn(Mono.just(Document.builder()
.id(DocuSignEnvelopeMappingTest.DOCUMENT).name("agreement.pdf").mimeType("application/pdf").build()));
when(content.getContent(DocuSignEnvelopeMappingTest.DOCUMENT)).thenReturn(Mono.just(DocuSignEnvelopeMappingTest.PDF.clone()));
- return new DocuSignSignatureEnvelopeAdapter(client, properties, content, documents, resolver);
+ return new DocuSignSignatureEnvelopeAdapterImpl(client, properties, content, documents, resolver);
}
private static ScopedSdkConnector.Reply envelope(String status) {
return new ScopedSdkConnector.Reply(200, "{\"envelopeId\":\"external-envelope\",\"status\":\"" + status + "\"}");
@@ -305,7 +305,7 @@ private static SignatureEnvelope withFields(SignatureField... fields) {
when(content.getContent(id)).thenReturn(Mono.just(id.toString().getBytes(StandardCharsets.UTF_8)));
}
transport.responder = wire -> new ScopedSdkConnector.Reply(201, "{\"envelopeId\":\"external-envelope\",\"status\":\"created\"}");
- var port = new DocuSignSignatureEnvelopeAdapter(client, properties, content, documents);
+ var port = new DocuSignSignatureEnvelopeAdapterImpl(client, properties, content, documents);
assertNotNull(await(port.createEnvelope(DocuSignEnvelopeMappingTest.envelope().toBuilder().documentIds(ids).build())));
var json = new JSON().getObjectMapper().readTree(transport.exchanges.getFirst().bytes());
assertEquals("1", json.get("documents").get(0).get("documentId").asText());
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignImmutableContentTest.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignImmutableContentTest.java
index 9e4e9470a..bb538fc06 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignImmutableContentTest.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignImmutableContentTest.java
@@ -36,14 +36,14 @@ static final class Fixture implements AutoCloseable {
final ScopedSdkConnector.Scope transport;
final DocumentPort documents = mock(DocumentPort.class);
final DocumentContentPort content = mock(DocumentContentPort.class);
- final DocuSignSignatureEnvelopeAdapter port;
+ final DocuSignSignatureEnvelopeAdapterImpl port;
final DocuSignAdapterProperties properties = new DocuSignAdapterProperties();
Fixture(Path directory) throws Exception {
var service = directory.resolve("builder.service"); Files.writeString(service, ScopedSdkConnector.Builder.class.getName() + "\n");
transport = new ScopedSdkConnector.Scope(service);
var client = new ApiClient(); client.setBasePath("https://owned.invalid/restapi");
properties.setAccountId("owned-account");
- port = new DocuSignSignatureEnvelopeAdapter(client, properties, content, documents);
+ port = new DocuSignSignatureEnvelopeAdapterImpl(client, properties, content, documents);
transport.responder = wire -> new ScopedSdkConnector.Reply(201,"{\"envelopeId\":\"external-envelope\",\"status\":\"created\"}");
}
EnvelopeDefinition sent() throws Exception {
@@ -171,9 +171,9 @@ EnvelopeDefinition sent() throws Exception {
p.setPrivateKey("-----BEGIN PRIVATE KEY-----\n" + Base64.getMimeEncoder(64, new byte[]{10})
.encodeToString(generator.generateKeyPair().getPrivate().getEncoded()) + "\n-----END PRIVATE KEY-----\n");
var docs = mock(DocumentPort.class); var content = mock(DocumentContentPort.class);
- try (var client = new org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient(
+ try (var client = new org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl(
org.fireflyframework.ecm.adapter.docusign.client.DocuSignClientSettings.from(p))) {
- var port = new DocuSignSignatureEnvelopeAdapter(client,p,content,docs);
+ var port = new DocuSignSignatureEnvelopeAdapterImpl(client,p,content,docs);
assertThrows(DocuSignAdapterException.class, () -> await(port.createEnvelope(DocuSignEnvelopeMappingTest.envelope(),
List.of(snapshot(SECOND,new byte[]{1})))));
assertTrue(transport.exchanges.isEmpty()); verifyNoInteractions(docs,content);
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignImmutableIntentTest.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignImmutableIntentTest.java
index 5a9d241ea..075d81f01 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignImmutableIntentTest.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/DocuSignImmutableIntentTest.java
@@ -12,7 +12,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.fireflyframework.ecm.adapter.docusign.client.DocuSignClientSettings;
-import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient;
+import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl;
import org.fireflyframework.ecm.port.document.DocumentPort;
import org.fireflyframework.ecm.port.document.DocumentContentPort;
import org.junit.jupiter.api.Test;
@@ -32,9 +32,9 @@ class DocuSignImmutableIntentTest {
.encodeToString(generator.generateKeyPair().getPrivate().getEncoded())+"\n-----END PRIVATE KEY-----\n");
var entered=new CountDownLatch(1);var release=new CountDownLatch(1);
try(var transport=new ScopedSdkConnector.Scope(service)) {
- try(var client=new ManagedDocuSignApiClient(DocuSignClientSettings.from(p))) {
+ try(var client=new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(p))) {
var documents=mock(DocumentPort.class);var content=mock(DocumentContentPort.class);
- var port=new DocuSignSignatureEnvelopeAdapter(client,p,content,documents);
+ var port=new DocuSignSignatureEnvelopeAdapterImpl(client,p,content,documents);
var original=DocuSignEnvelopeMappingTest.envelope();
var envelopeMetadata=new HashMap();var requestMetadata=new HashMap();var fieldMetadata=new HashMap();
var fields=new ArrayList<>(List.of(original.getSignatureRequests().getFirst().getSignatureFields().getFirst()
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentAuthCancellationProbe.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentAuthCancellationProbe.java
index 448a19a32..51817fac7 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentAuthCancellationProbe.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentAuthCancellationProbe.java
@@ -10,7 +10,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.fireflyframework.ecm.adapter.docusign.client.DocuSignClientSettings;
-import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient;
+import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl;
/** Real SDK/Jersey fixture; a cancelled token response finishes after consuming interruption. */
public final class IndependentAuthCancellationProbe {
@@ -31,7 +31,7 @@ public static void main(String[] args) throws Exception {
var release = new CountDownLatch(1); var completed = new CountDownLatch(1);
var emitted = new AtomicBoolean();
try (var transport = new ScopedSdkConnector.Scope(service);
- var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties))) {
+ var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties))) {
transport.responder = wire -> {
if (wire.uri().getPath().endsWith("/oauth/token")) {
entered.countDown(); long deadline = System.nanoTime() + TimeUnit.SECONDS.toNanos(2);
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentAuthCloseDeadlineProbe.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentAuthCloseDeadlineProbe.java
index aa3c1f167..18309abe1 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentAuthCloseDeadlineProbe.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentAuthCloseDeadlineProbe.java
@@ -10,7 +10,7 @@
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import org.fireflyframework.ecm.adapter.docusign.client.DocuSignClientSettings;
-import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient;
+import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl;
import org.glassfish.jersey.client.ClientRequest;
import org.glassfish.jersey.client.ClientResponse;
import org.glassfish.jersey.client.JerseyClient;
@@ -50,7 +50,7 @@ public Builder() { }
}
}
- private static void get(ManagedDocuSignApiClient client, DocuSignAdapterProperties properties) throws Exception {
+ private static void get(ManagedDocuSignApiClientImpl client, DocuSignAdapterProperties properties) throws Exception {
new EnvelopesApi(client).getEnvelope(properties.getAccountId(), "controlled-envelope");
}
@@ -65,11 +65,11 @@ public static void main(String[] args) throws Exception {
properties.setPrivateKey("-----BEGIN PRIVATE KEY-----\n" + Base64.getMimeEncoder(64, new byte[]{10})
.encodeToString(generator.generateKeyPair().getPrivate().getEncoded()) + "\n-----END PRIVATE KEY-----\n");
try (var transport = new ScopedSdkConnector.Scope(service)) {
- try (var warm = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties))) { get(warm, properties); }
+ try (var warm = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties))) { get(warm, properties); }
if (transport.exchanges.size() != 3) throw new AssertionError("Genuine warmup exchanges required");
properties.setAuthenticationTimeout(Duration.ofMillis(200));
properties.setAuthenticationWaitTimeout(Duration.ofMillis(20));
- try (var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties))) {
+ try (var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties))) {
long before = System.nanoTime(); delayClose = true;
DocuSignAdapterException rejected = null;
try { get(client, properties); }
diff --git a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentClientBuildCloseProbe.java b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentClientBuildCloseProbe.java
index f90a05ea9..b92cf8e05 100644
--- a/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentClientBuildCloseProbe.java
+++ b/modules/ecm-esignature-docusign/src/test/java/org/fireflyframework/ecm/adapter/docusign/IndependentClientBuildCloseProbe.java
@@ -8,7 +8,7 @@
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.fireflyframework.ecm.adapter.docusign.client.DocuSignClientSettings;
-import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClient;
+import org.fireflyframework.ecm.adapter.docusign.client.ManagedDocuSignApiClientImpl;
import org.glassfish.jersey.client.JerseyClient;
import org.glassfish.jersey.client.JerseyClientBuilder;
@@ -41,7 +41,7 @@ public static void main(String[] args) throws Exception {
properties.setPrivateKey("-----BEGIN PRIVATE KEY-----\n" + Base64.getMimeEncoder(64, new byte[]{10})
.encodeToString(generator.generateKeyPair().getPrivate().getEncoded()) + "\n-----END PRIVATE KEY-----\n");
try (var transport = new ScopedSdkConnector.Scope(service)) {
- var client = new ManagedDocuSignApiClient(DocuSignClientSettings.from(properties));
+ var client = new ManagedDocuSignApiClientImpl(DocuSignClientSettings.from(properties));
var worker = Executors.newSingleThreadExecutor();
try {
pause = true;
diff --git a/modules/ecm-esignature-logalty/README.md b/modules/ecm-esignature-logalty/README.md
index 7ae106c6e..539b46dd5 100644
--- a/modules/ecm-esignature-logalty/README.md
+++ b/modules/ecm-esignature-logalty/README.md
@@ -46,7 +46,7 @@ firefly:
base-url: https://api.logalty.com
```
-That is all the wiring required. `LogaltyAdapterAutoConfiguration` contributes the `WebClient`, `CircuitBreaker`, `Retry`, `ObjectMapper` and the `LogaltySignatureEnvelopeAdapter` bean automatically.
+That is all the wiring required. `LogaltyAdapterAutoConfiguration` contributes the `WebClient`, `CircuitBreaker`, `Retry`, `ObjectMapper` and the `LogaltySignatureEnvelopeAdapterImpl` bean automatically.
### 2. Use the ECM signature port
@@ -98,7 +98,7 @@ The `firefly.ecm.adapter.logalty` namespace is bound by [LogaltyAdapterPropertie
| Type | Contract and responsibility |
| --- | --- |
-| [`LogaltySignatureEnvelopeAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapter.java) | Defines `LogaltySignatureEnvelopeAdapter`, `createEnvelope`, `updateEnvelope`, `deleteEnvelope` operations. |
+| [`LogaltySignatureEnvelopeAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapterImpl.java) | Defines `LogaltySignatureEnvelopeAdapterImpl`, `createEnvelope`, `updateEnvelope`, `deleteEnvelope` operations. |
| [`LogaltyAdapterProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltyAdapterProperties.java) | Configuration properties for the Logalty eSignature adapter. |
| [`LogaltyAdapterAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltyAdapterAutoConfiguration.java) | Defines `logaltyWebClient`, `logaltyCircuitBreaker`, `logaltyRetry`, `logaltyObjectMapper` operations. |
diff --git a/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltyAdapterAutoConfiguration.java b/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltyAdapterAutoConfiguration.java
index 14513d3d3..d26505a88 100644
--- a/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltyAdapterAutoConfiguration.java
+++ b/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltyAdapterAutoConfiguration.java
@@ -163,7 +163,7 @@ public ObjectMapper logaltyObjectMapper() {
*/
@Bean
@ConditionalOnMissingBean
- public LogaltySignatureEnvelopeAdapter logaltySignatureEnvelopeAdapter(
+ public LogaltySignatureEnvelopeAdapterImpl logaltySignatureEnvelopeAdapter(
WebClient webClient,
LogaltyAdapterProperties properties,
ObjectMapper objectMapper,
@@ -171,7 +171,7 @@ public LogaltySignatureEnvelopeAdapter logaltySignatureEnvelopeAdapter(
DocumentPort documentPort,
@Qualifier("logaltyCircuitBreaker") CircuitBreaker circuitBreaker,
@Qualifier("logaltyRetry") Retry retry) {
- return new LogaltySignatureEnvelopeAdapter(
+ return new LogaltySignatureEnvelopeAdapterImpl(
webClient, properties, objectMapper,
documentContentPort, documentPort,
circuitBreaker, retry);
diff --git a/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapter.java b/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapterImpl.java
similarity index 99%
rename from modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapter.java
rename to modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapterImpl.java
index 0364a4ea1..f4c40143b 100644
--- a/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapter.java
+++ b/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapterImpl.java
@@ -68,7 +68,7 @@
optionalProperties = {"base-url", "api-version", "webhook-url", "webhook-secret", "return-url", "sandbox-mode"}
)
@ConditionalOnProperty(name = "firefly.ecm.esignature.provider", havingValue = "logalty")
-public class LogaltySignatureEnvelopeAdapter implements SignatureEnvelopePort {
+public class LogaltySignatureEnvelopeAdapterImpl implements SignatureEnvelopePort {
private final WebClient webClient;
private final LogaltyAdapterProperties properties;
@@ -85,7 +85,7 @@ public class LogaltySignatureEnvelopeAdapter implements SignatureEnvelopePort {
private volatile String accessToken;
private volatile Instant tokenExpiresAt;
- public LogaltySignatureEnvelopeAdapter(WebClient webClient,
+ public LogaltySignatureEnvelopeAdapterImpl(WebClient webClient,
LogaltyAdapterProperties properties,
ObjectMapper objectMapper,
DocumentContentPort documentContentPort,
diff --git a/modules/ecm-storage-aws/README.md b/modules/ecm-storage-aws/README.md
index 7fe7bafb2..0f08d1749 100644
--- a/modules/ecm-storage-aws/README.md
+++ b/modules/ecm-storage-aws/README.md
@@ -44,7 +44,7 @@ firefly:
# credentials omitted -> uses the AWS default credentials provider chain (IAM role, etc.)
```
-That is all that is required. `S3AdapterAutoConfiguration` builds the `S3Client`, `S3Presigner` and credentials provider, and registers `S3DocumentContentAdapter` as the active `DocumentContentPort`.
+That is all that is required. `S3AdapterAutoConfiguration` builds the `S3Client`, `S3Presigner` and credentials provider, and registers `S3DocumentContentAdapterImpl` as the active `DocumentContentPort`.
2. Inject and use the port from your services (program against the SPI, not the S3 type):
@@ -82,7 +82,7 @@ public class DocumentService {
3. (Optional) generate a pre-signed upload URL for direct browser-to-S3 uploads by injecting the concrete adapter:
```java
-import org.fireflyframework.ecm.adapter.s3.S3DocumentContentAdapter;
+import org.fireflyframework.ecm.adapter.s3.S3DocumentContentAdapterImpl;
// 15-minute pre-signed PUT URL
Mono url = s3Adapter.generateUploadUrl(documentId, 15);
@@ -104,7 +104,7 @@ The `firefly.ecm.adapter.s3` namespace is bound by [S3AdapterProperties.java](ht
| Type | Contract and responsibility |
| --- | --- |
-| [`S3DocumentContentAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapter.java) | Defines `S3DocumentContentAdapter`, `storeContent`, `storeContentStream`, `deleteContent` operations. |
+| [`S3DocumentContentAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterImpl.java) | Defines `S3DocumentContentAdapterImpl`, `storeContent`, `storeContentStream`, `deleteContent` operations. |
| [`S3AdapterProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3AdapterProperties.java) | Configuration properties for the Amazon S3 ECM adapter. |
| [`S3AdapterAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3AdapterAutoConfiguration.java) | Defines `awsCredentialsProvider`, `s3Client` operations. |
diff --git a/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3AdapterAutoConfiguration.java b/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3AdapterAutoConfiguration.java
index c6a4a964e..b7fafbef1 100644
--- a/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3AdapterAutoConfiguration.java
+++ b/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3AdapterAutoConfiguration.java
@@ -46,7 +46,7 @@
// Register the presigner beans and the DocumentContentPort adapter. Both are @ConditionalOnProperty-gated
// on the same discriminator, but they live in this package and would otherwise never be component-scanned
// by a consuming application, so import them explicitly from the auto-configuration.
-@Import({S3Beans.class, S3DocumentContentAdapter.class})
+@Import({S3Beans.class, S3DocumentContentAdapterImpl.class})
public class S3AdapterAutoConfiguration {
@Bean
diff --git a/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapter.java b/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterImpl.java
similarity index 98%
rename from modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapter.java
rename to modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterImpl.java
index 7b7125fe5..3aaa364ba 100644
--- a/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapter.java
+++ b/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterImpl.java
@@ -70,16 +70,16 @@
requiredProperties = {"bucket-name", "region"},
optionalProperties = {"access-key", "secret-key", "endpoint", "path-prefix"}
)
-@Component
+@Component("S3DocumentContentAdapter")
@ConditionalOnProperty(name = "firefly.ecm.adapter-type", havingValue = "s3")
-public class S3DocumentContentAdapter implements DocumentContentPort {
+public class S3DocumentContentAdapterImpl implements DocumentContentPort {
private final S3Client s3Client;
private final S3AdapterProperties properties;
private final DataBufferFactory dataBufferFactory;
private final S3Presigner s3Presigner;
- public S3DocumentContentAdapter(S3Client s3Client, S3AdapterProperties properties, S3Presigner s3Presigner) {
+ public S3DocumentContentAdapterImpl(S3Client s3Client, S3AdapterProperties properties, S3Presigner s3Presigner) {
this.s3Client = s3Client;
this.properties = properties;
this.dataBufferFactory = new DefaultDataBufferFactory();
diff --git a/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3AdapterAutoConfigurationTest.java b/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3AdapterAutoConfigurationTest.java
index 5cc7ea75e..31464eaa1 100644
--- a/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3AdapterAutoConfigurationTest.java
+++ b/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3AdapterAutoConfigurationTest.java
@@ -8,7 +8,7 @@
import static org.assertj.core.api.Assertions.assertThat;
-@SpringBootTest(classes = {S3AdapterAutoConfiguration.class, S3Beans.class, S3DocumentContentAdapter.class})
+@SpringBootTest(classes = {S3AdapterAutoConfiguration.class, S3Beans.class, S3DocumentContentAdapterImpl.class})
@TestPropertySource(properties = {
"firefly.ecm.enabled=true",
"firefly.ecm.adapter-type=s3",
@@ -22,6 +22,6 @@ class S3AdapterAutoConfigurationTest {
@Test
void contextLoads_andS3DocumentContentAdapterPresent() {
- assertThat(contentPort).isInstanceOf(S3DocumentContentAdapter.class);
+ assertThat(contentPort).isInstanceOf(S3DocumentContentAdapterImpl.class);
}
}
diff --git a/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterTest.java b/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterTest.java
index b80659531..85a566943 100644
--- a/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterTest.java
+++ b/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterTest.java
@@ -33,7 +33,7 @@
@SpringBootTest(classes = {
S3DocumentContentAdapterTest.TestConfig.class,
- S3DocumentContentAdapter.class
+ S3DocumentContentAdapterImpl.class
})
@TestPropertySource(properties = {
"firefly.ecm.enabled=true",
@@ -131,7 +131,7 @@ void getContentRange_readsRequestedRange_andReturnsBytes() throws Exception {
);
when(s3Client.getObject(any(GetObjectRequest.class))).thenReturn(ris);
- byte[] result = ((S3DocumentContentAdapter) contentPort).getContentRange(documentId, 1L, 3L).block();
+ byte[] result = ((S3DocumentContentAdapterImpl) contentPort).getContentRange(documentId, 1L, 3L).block();
assertThat(new String(result)).isEqualTo("bcd");
ArgumentCaptor captor = ArgumentCaptor.forClass(GetObjectRequest.class);
diff --git a/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3PresignTest.java b/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3PresignTest.java
index 91edc8d91..b5b1b70d1 100644
--- a/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3PresignTest.java
+++ b/modules/ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3PresignTest.java
@@ -20,7 +20,7 @@
*/
class S3PresignTest {
- private S3DocumentContentAdapter adapter;
+ private S3DocumentContentAdapterImpl adapter;
private static S3AdapterProperties baseProps() {
S3AdapterProperties p = new S3AdapterProperties();
@@ -38,7 +38,7 @@ void setUp() {
.credentialsProvider(StaticCredentialsProvider.create(
AwsBasicCredentials.create("AKIDTEST", "SECRETTEST")))
.build();
- adapter = new S3DocumentContentAdapter(mock(S3Client.class), props, presigner);
+ adapter = new S3DocumentContentAdapterImpl(mock(S3Client.class), props, presigner);
}
@Test
@@ -75,7 +75,7 @@ void presigner_withEndpointAndPathStyle_producesPathStyleUrl() {
props.setAccessKey("AKIDTEST");
props.setSecretKey("SECRETTEST");
S3Presigner presigner = new S3Beans().s3Presigner(props);
- S3DocumentContentAdapter local = new S3DocumentContentAdapter(mock(S3Client.class), props, presigner);
+ S3DocumentContentAdapterImpl local = new S3DocumentContentAdapterImpl(mock(S3Client.class), props, presigner);
String url = local.generateDownloadUrlByPath("documents/t/x.pdf", Duration.ofMinutes(5)).block();
// path-style => host is the endpoint, bucket lives in the path (not a subdomain)
diff --git a/modules/ecm-storage-azure/README.md b/modules/ecm-storage-azure/README.md
index 31cdf441f..d6a44c42e 100644
--- a/modules/ecm-storage-azure/README.md
+++ b/modules/ecm-storage-azure/README.md
@@ -57,7 +57,7 @@ public class DocumentService {
private final DocumentContentPort content;
public DocumentService(DocumentContentPort content) {
- this.content = content; // AzureBlobDocumentContentAdapter at runtime
+ this.content = content; // AzureBlobDocumentContentAdapterImpl at runtime
}
public Mono upload(UUID documentId, byte[] bytes, String mimeType) {
@@ -89,7 +89,7 @@ The `firefly.ecm.adapter.azure-blob` namespace is bound by [AzureBlobAdapterProp
| Type | Contract and responsibility |
| --- | --- |
-| [`AzureBlobDocumentContentAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapter.java) | Defines `AzureBlobDocumentContentAdapter`, `storeContent`, `storeContentStream`, `deleteContent` operations. |
+| [`AzureBlobDocumentContentAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapterImpl.java) | Defines `AzureBlobDocumentContentAdapterImpl`, `storeContent`, `storeContentStream`, `deleteContent` operations. |
| [`AzureBlobAdapterProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobAdapterProperties.java) | Configuration properties for the Microsoft Azure Blob Storage ECM adapter. |
| [`AzureBlobAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobAutoConfiguration.java) | Defines `blobServiceClient`, `blobContainerClient`, `objectMapper`, `azureBlobCircuitBreaker` operations. |
diff --git a/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapter.java b/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapterImpl.java
similarity index 98%
rename from modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapter.java
rename to modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapterImpl.java
index 50a5961ee..580ea03ed 100644
--- a/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapter.java
+++ b/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapterImpl.java
@@ -78,9 +78,9 @@
optionalProperties = {"account-key", "connection-string", "sas-token", "managed-identity",
"endpoint", "path-prefix", "block-size", "block-upload-threshold"}
)
-@Component
+@Component("azureBlobDocumentContentAdapter")
@ConditionalOnProperty(name = "firefly.ecm.adapter-type", havingValue = "azure-blob")
-public class AzureBlobDocumentContentAdapter implements DocumentContentPort {
+public class AzureBlobDocumentContentAdapterImpl implements DocumentContentPort {
private final BlobContainerClient containerClient;
private final AzureBlobAdapterProperties properties;
@@ -88,7 +88,7 @@ public class AzureBlobDocumentContentAdapter implements DocumentContentPort {
private final CircuitBreaker circuitBreaker;
private final Retry retry;
- public AzureBlobDocumentContentAdapter(BlobContainerClient containerClient,
+ public AzureBlobDocumentContentAdapterImpl(BlobContainerClient containerClient,
AzureBlobAdapterProperties properties,
@Qualifier("azureBlobCircuitBreaker") CircuitBreaker circuitBreaker,
@Qualifier("azureBlobRetry") Retry retry) {
diff --git a/modules/ecm-storage-azure/src/test/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobAdapterTest.java b/modules/ecm-storage-azure/src/test/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobAdapterTest.java
index 3f2f1784f..b69923015 100644
--- a/modules/ecm-storage-azure/src/test/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobAdapterTest.java
+++ b/modules/ecm-storage-azure/src/test/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobAdapterTest.java
@@ -25,11 +25,11 @@ class AzureBlobAdapterTest {
@Test
void contextLoads_andAzureDocumentContentAdapterPresent() {
- assertThat(contentPort).isInstanceOf(AzureBlobDocumentContentAdapter.class);
+ assertThat(contentPort).isInstanceOf(AzureBlobDocumentContentAdapterImpl.class);
}
@Configuration
- @Import(AzureBlobDocumentContentAdapter.class)
+ @Import(AzureBlobDocumentContentAdapterImpl.class)
static class TestConfig {
@Bean
BlobContainerClient blobContainerClient() {
diff --git a/modules/ecm/README.md b/modules/ecm/README.md
index ab12b9c54..75af6b609 100644
--- a/modules/ecm/README.md
+++ b/modules/ecm/README.md
@@ -81,9 +81,9 @@ public class DocumentService {
firefly:
ecm:
search:
- enabled: true # registers LocalDocumentSearchAdapter
+ enabled: true # registers LocalDocumentSearchAdapterImpl
permissions:
- enabled: true # registers LocalPermissionAdapter
+ enabled: true # registers LocalPermissionAdapterImpl
```
To write your own adapter, annotate a port implementation with `@EcmAdapter` and the registry will discover it:
@@ -98,7 +98,7 @@ import org.fireflyframework.ecm.port.document.DocumentContentPort;
description = "AWS S3 content storage adapter",
supportedFeatures = { AdapterFeature.CONTENT_STORAGE, AdapterFeature.STREAMING, AdapterFeature.CLOUD_STORAGE }
)
-public class S3DocumentContentAdapter implements DocumentContentPort {
+public class S3DocumentContentAdapterImpl implements DocumentContentPort {
// ... reactive implementation ...
}
```
diff --git a/modules/ecm/docs/adapters/s3-integration-guide.md b/modules/ecm/docs/adapters/s3-integration-guide.md
index 6b6b2eb24..bbd0cc2b2 100644
--- a/modules/ecm/docs/adapters/s3-integration-guide.md
+++ b/modules/ecm/docs/adapters/s3-integration-guide.md
@@ -4,7 +4,7 @@ This guide provides step-by-step instructions for integrating the Amazon S3 adap
## Overview
-The shipped `S3DocumentContentAdapter` implements `DocumentContentPort`: store and retrieve bytes/streams, delete or inspect content, calculate checksums, and generate configured presigned URLs. The application supplies document metadata, folders, and access policy separately.
+The shipped `S3DocumentContentAdapterImpl` implements `DocumentContentPort`: store and retrieve bytes/streams, delete or inspect content, calculate checksums, and generate configured presigned URLs. The application supplies document metadata, folders, and access policy separately.
## Prerequisites
diff --git a/modules/ecm/docs/idp/README.md b/modules/ecm/docs/idp/README.md
index 81eb3bd0e..ac2556449 100644
--- a/modules/ecm/docs/idp/README.md
+++ b/modules/ecm/docs/idp/README.md
@@ -328,7 +328,7 @@ Implement proper monitoring for IDP operations:
```java
@Component
-public class IdpMetrics {
+public class IdpMetricsImpl {
private final MeterRegistry meterRegistry;
diff --git a/modules/ecm/docs/testing.md b/modules/ecm/docs/testing.md
index 67074817e..e6fa03fcc 100644
--- a/modules/ecm/docs/testing.md
+++ b/modules/ecm/docs/testing.md
@@ -320,7 +320,7 @@ Test each adapter against its current port contract. Mocked service tests check
#### S3 adapter testing
-The shipped adapter is `S3DocumentContentAdapter`, implementing `DocumentContentPort`. Its [test fixture](../../ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterTest.java) supplies the Spring configuration, mock client, presigner, properties, and imports. This method is an excerpt from that fixture, not a standalone test:
+The shipped adapter is `S3DocumentContentAdapterImpl`, implementing `DocumentContentPort`. Its [test fixture](../../ecm-storage-aws/src/test/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterTest.java) supplies the Spring configuration, mock client, presigner, properties, and imports. This method is an excerpt from that fixture, not a standalone test:
```java
@Test
@@ -355,7 +355,7 @@ class DocuSignSignatureEnvelopeAdapterTest {
@Mock
private DocuSignAdapterProperties properties;
- private DocuSignSignatureEnvelopeAdapter adapter;
+ private DocuSignSignatureEnvelopeAdapterImpl adapter;
@BeforeEach
void setUp() throws Exception {
@@ -369,10 +369,10 @@ class DocuSignSignatureEnvelopeAdapterTest {
apiClient = new ApiClient();
apiClient.setBasePath("https://demo.docusign.net/restapi");
- adapter = new DocuSignSignatureEnvelopeAdapter(apiClient, properties, documentContentPort, documentPort);
+ adapter = new DocuSignSignatureEnvelopeAdapterImpl(apiClient, properties, documentContentPort, documentPort);
// Use reflection to inject mocked EnvelopesApi
- Field envelopesApiField = DocuSignSignatureEnvelopeAdapter.class.getDeclaredField("envelopesApi");
+ Field envelopesApiField = DocuSignSignatureEnvelopeAdapterImpl.class.getDeclaredField("envelopesApi");
envelopesApiField.setAccessible(true);
envelopesApiField.set(adapter, envelopesApi);
}
diff --git a/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalDocumentSearchAdapter.java b/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalDocumentSearchAdapterImpl.java
similarity index 99%
rename from modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalDocumentSearchAdapter.java
rename to modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalDocumentSearchAdapterImpl.java
index 26e18f6b1..7f5ade6ad 100644
--- a/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalDocumentSearchAdapter.java
+++ b/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalDocumentSearchAdapterImpl.java
@@ -43,7 +43,7 @@
description = "Local in-memory DocumentSearchPort adapter",
supportedFeatures = { AdapterFeature.SEARCH, AdapterFeature.METADATA_SEARCH }
)
-public class LocalDocumentSearchAdapter implements DocumentSearchPort {
+public class LocalDocumentSearchAdapterImpl implements DocumentSearchPort {
private final Map index = new ConcurrentHashMap<>();
diff --git a/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalPermissionAdapter.java b/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalPermissionAdapterImpl.java
similarity index 99%
rename from modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalPermissionAdapter.java
rename to modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalPermissionAdapterImpl.java
index 84212a39f..fb2bf6d29 100644
--- a/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalPermissionAdapter.java
+++ b/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalPermissionAdapterImpl.java
@@ -43,7 +43,7 @@
description = "Local in-memory PermissionPort adapter",
supportedFeatures = { AdapterFeature.PERMISSIONS }
)
-public class LocalPermissionAdapter implements PermissionPort {
+public class LocalPermissionAdapterImpl implements PermissionPort {
private final Map store = new ConcurrentHashMap<>();
diff --git a/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpAdapterFactory.java b/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpAdapterFactory.java
index ce6ebea73..f98ad408f 100644
--- a/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpAdapterFactory.java
+++ b/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpAdapterFactory.java
@@ -57,7 +57,7 @@ public class NoOpAdapterFactory {
*/
public DocumentPort createDocumentPort() {
log.info("Creating no-op DocumentPort adapter as fallback");
- return new NoOpGenericAdapter<>("DocumentPort", DocumentPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("DocumentPort", DocumentPort.class).getProxy();
}
/**
@@ -67,7 +67,7 @@ public DocumentPort createDocumentPort() {
*/
public DocumentContentPort createDocumentContentPort() {
log.info("Creating no-op DocumentContentPort adapter as fallback");
- return new NoOpGenericAdapter<>("DocumentContentPort", DocumentContentPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("DocumentContentPort", DocumentContentPort.class).getProxy();
}
/**
@@ -77,7 +77,7 @@ public DocumentContentPort createDocumentContentPort() {
*/
public DocumentSecurityPort createDocumentSecurityPort() {
log.info("Creating no-op DocumentSecurityPort adapter as fallback");
- return new NoOpGenericAdapter<>("DocumentSecurityPort", DocumentSecurityPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("DocumentSecurityPort", DocumentSecurityPort.class).getProxy();
}
/**
@@ -87,7 +87,7 @@ public DocumentSecurityPort createDocumentSecurityPort() {
*/
public DocumentVersionPort createDocumentVersionPort() {
log.info("Creating no-op DocumentVersionPort adapter as fallback");
- return new NoOpGenericAdapter<>("DocumentVersionPort", DocumentVersionPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("DocumentVersionPort", DocumentVersionPort.class).getProxy();
}
/**
@@ -97,7 +97,7 @@ public DocumentVersionPort createDocumentVersionPort() {
*/
public DocumentSearchPort createDocumentSearchPort() {
log.info("Creating no-op DocumentSearchPort adapter as fallback");
- return new NoOpGenericAdapter<>("DocumentSearchPort", DocumentSearchPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("DocumentSearchPort", DocumentSearchPort.class).getProxy();
}
/**
@@ -107,7 +107,7 @@ public DocumentSearchPort createDocumentSearchPort() {
*/
public FolderPort createFolderPort() {
log.info("Creating no-op FolderPort adapter as fallback");
- return new NoOpGenericAdapter<>("FolderPort", FolderPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("FolderPort", FolderPort.class).getProxy();
}
/**
@@ -117,7 +117,7 @@ public FolderPort createFolderPort() {
*/
public FolderHierarchyPort createFolderHierarchyPort() {
log.info("Creating no-op FolderHierarchyPort adapter as fallback");
- return new NoOpGenericAdapter<>("FolderHierarchyPort", FolderHierarchyPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("FolderHierarchyPort", FolderHierarchyPort.class).getProxy();
}
/**
@@ -127,7 +127,7 @@ public FolderHierarchyPort createFolderHierarchyPort() {
*/
public PermissionPort createPermissionPort() {
log.info("Creating no-op PermissionPort adapter as fallback");
- return new NoOpGenericAdapter<>("PermissionPort", PermissionPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("PermissionPort", PermissionPort.class).getProxy();
}
/**
@@ -137,7 +137,7 @@ public PermissionPort createPermissionPort() {
*/
public AuditPort createAuditPort() {
log.info("Creating no-op AuditPort adapter as fallback");
- return new NoOpGenericAdapter<>("AuditPort", AuditPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("AuditPort", AuditPort.class).getProxy();
}
/**
@@ -147,7 +147,7 @@ public AuditPort createAuditPort() {
*/
public SignatureEnvelopePort createSignatureEnvelopePort() {
log.info("Creating no-op SignatureEnvelopePort adapter as fallback");
- return new NoOpGenericAdapter<>("SignatureEnvelopePort", SignatureEnvelopePort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("SignatureEnvelopePort", SignatureEnvelopePort.class).getProxy();
}
/**
@@ -157,7 +157,7 @@ public SignatureEnvelopePort createSignatureEnvelopePort() {
*/
public SignatureRequestPort createSignatureRequestPort() {
log.info("Creating no-op SignatureRequestPort adapter as fallback");
- return new NoOpGenericAdapter<>("SignatureRequestPort", SignatureRequestPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("SignatureRequestPort", SignatureRequestPort.class).getProxy();
}
/**
@@ -167,7 +167,7 @@ public SignatureRequestPort createSignatureRequestPort() {
*/
public SignatureValidationPort createSignatureValidationPort() {
log.info("Creating no-op SignatureValidationPort adapter as fallback");
- return new NoOpGenericAdapter<>("SignatureValidationPort", SignatureValidationPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("SignatureValidationPort", SignatureValidationPort.class).getProxy();
}
/**
@@ -177,7 +177,7 @@ public SignatureValidationPort createSignatureValidationPort() {
*/
public SignatureProofPort createSignatureProofPort() {
log.info("Creating no-op SignatureProofPort adapter as fallback");
- return new NoOpGenericAdapter<>("SignatureProofPort", SignatureProofPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("SignatureProofPort", SignatureProofPort.class).getProxy();
}
/**
@@ -187,7 +187,7 @@ public SignatureProofPort createSignatureProofPort() {
*/
public DocumentExtractionPort createDocumentExtractionPort() {
log.info("Creating no-op DocumentExtractionPort adapter as fallback");
- return new NoOpGenericAdapter<>("DocumentExtractionPort", DocumentExtractionPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("DocumentExtractionPort", DocumentExtractionPort.class).getProxy();
}
/**
@@ -197,7 +197,7 @@ public DocumentExtractionPort createDocumentExtractionPort() {
*/
public DocumentClassificationPort createDocumentClassificationPort() {
log.info("Creating no-op DocumentClassificationPort adapter as fallback");
- return new NoOpGenericAdapter<>("DocumentClassificationPort", DocumentClassificationPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("DocumentClassificationPort", DocumentClassificationPort.class).getProxy();
}
/**
@@ -207,7 +207,7 @@ public DocumentClassificationPort createDocumentClassificationPort() {
*/
public DocumentValidationPort createDocumentValidationPort() {
log.info("Creating no-op DocumentValidationPort adapter as fallback");
- return new NoOpGenericAdapter<>("DocumentValidationPort", DocumentValidationPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("DocumentValidationPort", DocumentValidationPort.class).getProxy();
}
/**
@@ -217,6 +217,6 @@ public DocumentValidationPort createDocumentValidationPort() {
*/
public DataExtractionPort createDataExtractionPort() {
log.info("Creating no-op DataExtractionPort adapter as fallback");
- return new NoOpGenericAdapter<>("DataExtractionPort", DataExtractionPort.class).getProxy();
+ return new NoOpGenericAdapterImpl<>("DataExtractionPort", DataExtractionPort.class).getProxy();
}
}
diff --git a/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpGenericAdapter.java b/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpGenericAdapterImpl.java
similarity index 97%
rename from modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpGenericAdapter.java
rename to modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpGenericAdapterImpl.java
index 73c9af07e..25ed9c78a 100644
--- a/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpGenericAdapter.java
+++ b/modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpGenericAdapterImpl.java
@@ -51,7 +51,7 @@
* @see NoOpAdapterBase
*/
@Slf4j
-public class NoOpGenericAdapter extends NoOpAdapterBase implements InvocationHandler {
+public class NoOpGenericAdapterImpl extends NoOpAdapterBase implements InvocationHandler {
private final Class interfaceClass;
private final T proxyInstance;
@@ -63,7 +63,7 @@ public class NoOpGenericAdapter extends NoOpAdapterBase implements Invocation
* @param interfaceClass the port interface class
*/
@SuppressWarnings("unchecked")
- public NoOpGenericAdapter(String adapterType, Class interfaceClass) {
+ public NoOpGenericAdapterImpl(String adapterType, Class interfaceClass) {
super(adapterType);
this.interfaceClass = interfaceClass;
this.proxyInstance = (T) Proxy.newProxyInstance(
diff --git a/modules/ecm/src/main/java/org/fireflyframework/ecm/config/EcmAutoConfiguration.java b/modules/ecm/src/main/java/org/fireflyframework/ecm/config/EcmAutoConfiguration.java
index 69e8deaf4..0a91e6c2e 100644
--- a/modules/ecm/src/main/java/org/fireflyframework/ecm/config/EcmAutoConfiguration.java
+++ b/modules/ecm/src/main/java/org/fireflyframework/ecm/config/EcmAutoConfiguration.java
@@ -17,8 +17,8 @@
import org.fireflyframework.ecm.adapter.AdapterRegistry;
import org.fireflyframework.ecm.adapter.AdapterSelector;
-import org.fireflyframework.ecm.adapter.local.LocalDocumentSearchAdapter;
-import org.fireflyframework.ecm.adapter.local.LocalPermissionAdapter;
+import org.fireflyframework.ecm.adapter.local.LocalDocumentSearchAdapterImpl;
+import org.fireflyframework.ecm.adapter.local.LocalPermissionAdapterImpl;
import org.fireflyframework.ecm.adapter.noop.NoOpAdapterFactory;
import org.fireflyframework.ecm.port.document.*;
import org.fireflyframework.ecm.port.folder.*;
@@ -159,8 +159,8 @@ public EcmPortProvider ecmPortProvider(AdapterSelector adapterSelector, EcmPrope
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty(name = "firefly.ecm.search.enabled", havingValue = "true", matchIfMissing = false)
- public LocalDocumentSearchAdapter localDocumentSearchAdapter() {
- return new LocalDocumentSearchAdapter();
+ public LocalDocumentSearchAdapterImpl localDocumentSearchAdapter() {
+ return new LocalDocumentSearchAdapterImpl();
}
/**
@@ -176,8 +176,8 @@ public LocalDocumentSearchAdapter localDocumentSearchAdapter() {
@Bean
@ConditionalOnMissingBean
@ConditionalOnProperty(name = "firefly.ecm.permissions.enabled", havingValue = "true", matchIfMissing = false)
- public LocalPermissionAdapter localPermissionAdapter() {
- return new LocalPermissionAdapter();
+ public LocalPermissionAdapterImpl localPermissionAdapter() {
+ return new LocalPermissionAdapterImpl();
}
/**
diff --git a/modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmMetrics.java b/modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmMetricsImpl.java
similarity index 96%
rename from modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmMetrics.java
rename to modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmMetricsImpl.java
index 63531a92f..3f7457f2d 100644
--- a/modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmMetrics.java
+++ b/modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmMetricsImpl.java
@@ -36,13 +36,13 @@
* {@code firefly.ecm.signatures.completed} — successful e-signature workflows by {@code provider}
*
*/
-public class EcmMetrics extends FireflyMetricsSupport {
+public class EcmMetricsImpl extends FireflyMetricsSupport {
private static final String TAG_OPERATION = "operation";
private static final String TAG_PROVIDER = "provider";
private static final String TAG_DIRECTION = "direction";
- public EcmMetrics(MeterRegistry meterRegistry) {
+ public EcmMetricsImpl(MeterRegistry meterRegistry) {
super(meterRegistry, "ecm");
}
diff --git a/modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmObservabilityAutoConfiguration.java b/modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmObservabilityAutoConfiguration.java
index aa5044abf..d7937b87f 100644
--- a/modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmObservabilityAutoConfiguration.java
+++ b/modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmObservabilityAutoConfiguration.java
@@ -37,7 +37,7 @@ public class EcmObservabilityAutoConfiguration {
@Bean
@ConditionalOnMissingBean
@ConditionalOnBean(MeterRegistry.class)
- EcmMetrics ecmMetrics(MeterRegistry meterRegistry) {
- return new EcmMetrics(meterRegistry);
+ EcmMetricsImpl ecmMetrics(MeterRegistry meterRegistry) {
+ return new EcmMetricsImpl(meterRegistry);
}
}
diff --git a/modules/ecm/src/test/java/org/fireflyframework/ecm/adapter/noop/NoOpAdapterLoggingTest.java b/modules/ecm/src/test/java/org/fireflyframework/ecm/adapter/noop/NoOpAdapterLoggingTest.java
index 4a379a3ee..0f3a185d6 100644
--- a/modules/ecm/src/test/java/org/fireflyframework/ecm/adapter/noop/NoOpAdapterLoggingTest.java
+++ b/modules/ecm/src/test/java/org/fireflyframework/ecm/adapter/noop/NoOpAdapterLoggingTest.java
@@ -72,7 +72,7 @@ void tearDown() {
*/
@Test
void shouldLogWarningsForDocumentAdapterMethods() {
- DocumentPort adapter = new NoOpGenericAdapter<>("DocumentPort", DocumentPort.class).getProxy();
+ DocumentPort adapter = new NoOpGenericAdapterImpl<>("DocumentPort", DocumentPort.class).getProxy();
UUID testDocumentId = UUID.randomUUID();
// Call a query method
@@ -106,7 +106,7 @@ void shouldLogWarningsForDocumentAdapterMethods() {
*/
@Test
void shouldLogWarningsForContentAdapterMethods() {
- DocumentContentPort adapter = new NoOpGenericAdapter<>("DocumentContentPort", DocumentContentPort.class).getProxy();
+ DocumentContentPort adapter = new NoOpGenericAdapterImpl<>("DocumentContentPort", DocumentContentPort.class).getProxy();
UUID testDocumentId = UUID.randomUUID();
byte[] testContent = "test content".getBytes();
@@ -141,7 +141,7 @@ void shouldLogWarningsForContentAdapterMethods() {
*/
@Test
void shouldLogWarningsForSecurityAdapterMethods() {
- DocumentSecurityPort adapter = new NoOpGenericAdapter<>("DocumentSecurityPort", DocumentSecurityPort.class).getProxy();
+ DocumentSecurityPort adapter = new NoOpGenericAdapterImpl<>("DocumentSecurityPort", DocumentSecurityPort.class).getProxy();
UUID testDocumentId = UUID.randomUUID();
UUID testUserId = UUID.randomUUID();
@@ -177,9 +177,9 @@ void shouldLogWarningsForSecurityAdapterMethods() {
*/
@Test
void shouldReturnCorrectAdapterNames() {
- DocumentPort documentAdapter = new NoOpGenericAdapter<>("DocumentPort", DocumentPort.class).getProxy();
- DocumentContentPort contentAdapter = new NoOpGenericAdapter<>("DocumentContentPort", DocumentContentPort.class).getProxy();
- DocumentSecurityPort securityAdapter = new NoOpGenericAdapter<>("DocumentSecurityPort", DocumentSecurityPort.class).getProxy();
+ DocumentPort documentAdapter = new NoOpGenericAdapterImpl<>("DocumentPort", DocumentPort.class).getProxy();
+ DocumentContentPort contentAdapter = new NoOpGenericAdapterImpl<>("DocumentContentPort", DocumentContentPort.class).getProxy();
+ DocumentSecurityPort securityAdapter = new NoOpGenericAdapterImpl<>("DocumentSecurityPort", DocumentSecurityPort.class).getProxy();
// Test that getAdapterName method works for DocumentPort (which has this method)
assertThat(documentAdapter.getAdapterName()).isEqualTo("NoOpDocumentPortAdapter");
diff --git a/modules/eda-kafka/README.md b/modules/eda-kafka/README.md
index 6ceea297f..113e3ba1c 100644
--- a/modules/eda-kafka/README.md
+++ b/modules/eda-kafka/README.md
@@ -94,10 +94,10 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con
| Type | Contract and responsibility |
| --- | --- |
-| [`KafkaEventPublisher`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/publisher/kafka/KafkaEventPublisher.java) | Kafka event publisher implementation using Spring Kafka. |
-| [`KafkaEventConsumer`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumer.java) | Kafka event consumer implementation with dynamic topic subscription. |
+| [`KafkaEventPublisherImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/publisher/kafka/KafkaEventPublisherImpl.java) | Kafka event publisher implementation using Spring Kafka. |
+| [`KafkaEventConsumerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumerImpl.java) | Kafka event consumer implementation with dynamic topic subscription. |
| [`FireflyEdaKafkaConsumerAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaConsumerAutoConfiguration.java) | Auto-configuration for Kafka Consumer infrastructure. |
-| [`FireflyEdaKafkaEnvironmentPostProcessor`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaEnvironmentPostProcessor.java) | Environment post-processor that conditionally excludes Spring Boot's Kafka auto-configuration when the Firefly EDA Kafka transport is not enabled. |
+| [`FireflyEdaKafkaEnvironmentPostProcessorImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaEnvironmentPostProcessorImpl.java) | Environment post-processor that conditionally excludes Spring Boot's Kafka auto-configuration when the Firefly EDA Kafka transport is not enabled. |
| [`FireflyEdaKafkaPublisherAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaPublisherAutoConfiguration.java) | Auto-configuration for Kafka Publisher infrastructure. |
## Continue the application
diff --git a/modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaEnvironmentPostProcessor.java b/modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaEnvironmentPostProcessorImpl.java
similarity index 97%
rename from modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaEnvironmentPostProcessor.java
rename to modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaEnvironmentPostProcessorImpl.java
index b3140621f..559d099a0 100644
--- a/modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaEnvironmentPostProcessor.java
+++ b/modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaEnvironmentPostProcessorImpl.java
@@ -46,7 +46,7 @@
*
* Any existing {@code spring.autoconfigure.exclude} entries are preserved.
*/
-public class FireflyEdaKafkaEnvironmentPostProcessor implements EnvironmentPostProcessor {
+public class FireflyEdaKafkaEnvironmentPostProcessorImpl implements EnvironmentPostProcessor {
private static final String EXCLUDE_PROPERTY = "spring.autoconfigure.exclude";
private static final String KAFKA_AUTO_CONFIG = "org.springframework.boot.kafka.autoconfigure.KafkaAutoConfiguration";
diff --git a/modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumer.java b/modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumerImpl.java
similarity index 97%
rename from modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumer.java
rename to modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumerImpl.java
index 684b07a8e..cee1a285d 100644
--- a/modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumer.java
+++ b/modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumerImpl.java
@@ -19,7 +19,7 @@
import org.fireflyframework.eda.consumer.ConsumerHealth;
import org.fireflyframework.eda.consumer.EventConsumer;
import org.fireflyframework.eda.event.EventEnvelope;
-import org.fireflyframework.eda.listener.EventListenerProcessor;
+import org.fireflyframework.eda.listener.EventListenerProcessorImpl;
import org.fireflyframework.eda.properties.EdaProperties;
import org.fireflyframework.eda.serialization.MessageSerializer;
import lombok.extern.slf4j.Slf4j;
@@ -53,16 +53,16 @@
*
* If no @EventListener annotations are found, it falls back to the configured default topic pattern.
*/
-@Component
+@Component("kafkaEventConsumer")
@ConditionalOnClass(KafkaTemplate.class)
@ConditionalOnProperty(prefix = "firefly.eda.consumer", name = "enabled", havingValue = "true")
@org.springframework.boot.autoconfigure.condition.ConditionalOnBean(name = "fireflyEdaKafkaListenerContainerFactory")
@org.springframework.context.annotation.DependsOn("eventListenerProcessor")
@Slf4j
-public class KafkaEventConsumer implements EventConsumer {
+public class KafkaEventConsumerImpl implements EventConsumer {
private final EdaProperties edaProperties;
- private final EventListenerProcessor eventListenerProcessor;
+ private final EventListenerProcessorImpl eventListenerProcessor;
private final MessageSerializer messageSerializer;
private volatile Sinks.Many eventSink = Sinks.many().multicast().onBackpressureBuffer();
private final AtomicBoolean running = new AtomicBoolean(false);
@@ -71,7 +71,7 @@ public class KafkaEventConsumer implements EventConsumer {
@Autowired(required = false)
private KafkaListenerEndpointRegistry kafkaListenerEndpointRegistry;
- public KafkaEventConsumer(EdaProperties edaProperties, EventListenerProcessor eventListenerProcessor, MessageSerializer messageSerializer) {
+ public KafkaEventConsumerImpl(EdaProperties edaProperties, EventListenerProcessorImpl eventListenerProcessor, MessageSerializer messageSerializer) {
this.edaProperties = edaProperties;
this.eventListenerProcessor = eventListenerProcessor;
this.messageSerializer = messageSerializer;
@@ -312,7 +312,7 @@ public void handleKafkaMessage(ConsumerRecord record) {
String eventType = getEventType(headers, topic);
// Create acknowledgment callback (auto-ack with RECORD mode)
- EventEnvelope.AckCallback ackCallback = new KafkaAckCallback(null);
+ EventEnvelope.AckCallback ackCallback = new KafkaAckCallbackImpl(null);
// Create event envelope using unified EventEnvelope
EventEnvelope envelope = EventEnvelope.forConsuming(
@@ -397,10 +397,10 @@ private String getTransactionId(Map headers) {
/**
* Kafka-specific acknowledgment callback implementation.
*/
- private static class KafkaAckCallback implements EventEnvelope.AckCallback {
+ private static class KafkaAckCallbackImpl implements EventEnvelope.AckCallback {
private final Acknowledgment acknowledgment;
- public KafkaAckCallback(Acknowledgment acknowledgment) {
+ public KafkaAckCallbackImpl(Acknowledgment acknowledgment) {
this.acknowledgment = acknowledgment;
}
diff --git a/modules/eda-kafka/src/main/java/org/fireflyframework/eda/publisher/kafka/KafkaEventPublisher.java b/modules/eda-kafka/src/main/java/org/fireflyframework/eda/publisher/kafka/KafkaEventPublisherImpl.java
similarity index 98%
rename from modules/eda-kafka/src/main/java/org/fireflyframework/eda/publisher/kafka/KafkaEventPublisher.java
rename to modules/eda-kafka/src/main/java/org/fireflyframework/eda/publisher/kafka/KafkaEventPublisherImpl.java
index fc63f2853..78293ba0e 100644
--- a/modules/eda-kafka/src/main/java/org/fireflyframework/eda/publisher/kafka/KafkaEventPublisher.java
+++ b/modules/eda-kafka/src/main/java/org/fireflyframework/eda/publisher/kafka/KafkaEventPublisherImpl.java
@@ -50,17 +50,17 @@
* Comprehensive error handling
*
*/
-@Component
+@Component("kafkaEventPublisher")
@ConditionalOnClass(KafkaTemplate.class)
@Slf4j
-public class KafkaEventPublisher implements EventPublisher, ConnectionAwarePublisher {
+public class KafkaEventPublisherImpl implements EventPublisher, ConnectionAwarePublisher {
private final ObjectProvider> kafkaTemplateProvider;
private final MessageSerializer messageSerializer;
private final EdaProperties edaProperties;
private String connectionId = "default";
- public KafkaEventPublisher(
+ public KafkaEventPublisherImpl(
@org.springframework.beans.factory.annotation.Qualifier("fireflyEdaKafkaTemplate")
ObjectProvider> kafkaTemplateProvider,
MessageSerializer messageSerializer,
diff --git a/modules/eda-kafka/src/main/resources/META-INF/spring.factories b/modules/eda-kafka/src/main/resources/META-INF/spring.factories
index ebc83b2ed..a4fc34a6f 100644
--- a/modules/eda-kafka/src/main/resources/META-INF/spring.factories
+++ b/modules/eda-kafka/src/main/resources/META-INF/spring.factories
@@ -1 +1 @@
-org.springframework.boot.EnvironmentPostProcessor=org.fireflyframework.eda.config.FireflyEdaKafkaEnvironmentPostProcessor
+org.springframework.boot.EnvironmentPostProcessor=org.fireflyframework.eda.config.FireflyEdaKafkaEnvironmentPostProcessorImpl
diff --git a/modules/eda-kafka/src/test/java/org/fireflyframework/eda/integration/KafkaIntegrationTest.java b/modules/eda-kafka/src/test/java/org/fireflyframework/eda/integration/KafkaIntegrationTest.java
index 911714e28..99ffc1ba9 100644
--- a/modules/eda-kafka/src/test/java/org/fireflyframework/eda/integration/KafkaIntegrationTest.java
+++ b/modules/eda-kafka/src/test/java/org/fireflyframework/eda/integration/KafkaIntegrationTest.java
@@ -19,7 +19,7 @@
import org.fireflyframework.eda.annotation.PublisherType;
import org.fireflyframework.eda.publisher.EventPublisher;
import org.fireflyframework.eda.publisher.EventPublisherFactory;
-import org.fireflyframework.eda.publisher.kafka.KafkaEventPublisher;
+import org.fireflyframework.eda.publisher.kafka.KafkaEventPublisherImpl;
import org.fireflyframework.eda.testconfig.BaseIntegrationTest;
import org.fireflyframework.eda.testconfig.TestEventModels;
import org.apache.kafka.clients.consumer.ConsumerConfig;
@@ -72,7 +72,7 @@ class KafkaIntegrationTest extends BaseIntegrationTest {
);
@Autowired(required = false)
- private KafkaEventPublisher kafkaPublisher;
+ private KafkaEventPublisherImpl kafkaPublisher;
@Autowired(required = false)
private EventPublisherFactory publisherFactory;
diff --git a/modules/eda-kafka/src/test/java/org/fireflyframework/eda/integration/consumer/KafkaConsumerIntegrationTest.java b/modules/eda-kafka/src/test/java/org/fireflyframework/eda/integration/consumer/KafkaConsumerIntegrationTest.java
index fdabb3a37..44a9badb1 100644
--- a/modules/eda-kafka/src/test/java/org/fireflyframework/eda/integration/consumer/KafkaConsumerIntegrationTest.java
+++ b/modules/eda-kafka/src/test/java/org/fireflyframework/eda/integration/consumer/KafkaConsumerIntegrationTest.java
@@ -19,7 +19,7 @@
import org.fireflyframework.eda.annotation.PublisherType;
import org.fireflyframework.eda.consumer.EventConsumer;
import org.fireflyframework.eda.event.EventEnvelope;
-import org.fireflyframework.eda.publisher.kafka.KafkaEventPublisher;
+import org.fireflyframework.eda.publisher.kafka.KafkaEventPublisherImpl;
import org.fireflyframework.eda.testconfig.BaseIntegrationTest;
import org.fireflyframework.eda.testconfig.TestApplication;
import org.fireflyframework.eda.testconfig.TestEventListeners;
@@ -73,7 +73,7 @@ class KafkaConsumerIntegrationTest extends BaseIntegrationTest {
private EventConsumer kafkaConsumer;
@Autowired(required = false)
- private KafkaEventPublisher kafkaPublisher;
+ private KafkaEventPublisherImpl kafkaPublisher;
@Autowired(required = false)
private KafkaAdmin kafkaAdmin;
diff --git a/modules/eda-postgres/README.md b/modules/eda-postgres/README.md
index 02a231722..8da95bddf 100644
--- a/modules/eda-postgres/README.md
+++ b/modules/eda-postgres/README.md
@@ -110,15 +110,15 @@ public class PaymentListener {
```java
@Bean
PostgresEventDecoder postgresEventDecoder(MessageSerializer serializer) {
- return new RegisteredPostgresEventDecoder(serializer, Map.of(
+ return new RegisteredPostgresEventDecoderImpl(serializer, Map.of(
PaymentCompleted.class.getName(), PaymentCompleted.class,
"payment.completed", PaymentCompleted.class));
}
```
-Import `PostgresEventDecoder` from `org.fireflyframework.eda.consumer.postgres`, `RegisteredPostgresEventDecoder` from its `impl` package, and `MessageSerializer` from `org.fireflyframework.eda.serialization`. An unknown class identifier fails decoding even if another event type is registered. `Object.class` decoding requires an explicit registration.
+Import `PostgresEventDecoder` from `org.fireflyframework.eda.consumer.postgres`, `RegisteredPostgresEventDecoderImpl` from its `impl` package, and `MessageSerializer` from `org.fireflyframework.eda.serialization`. An unknown class identifier fails decoding even if another event type is registered. `Object.class` decoding requires an explicit registration.
-6. Install the reviewed delivery protocol below and explicitly activate the worker through `PostgresEventConsumer.start()` or a processing subscription to `consume()`. Compose and await the returned publisher in the application's lifecycle. A configured/enabled bean is not a running or ready worker; this block adds no automatic lifecycle activation.
+6. Install the reviewed delivery protocol below and explicitly activate the worker through `PostgresEventConsumerImpl.start()` or a processing subscription to `consume()`. Compose and await the returned publisher in the application's lifecycle. A configured/enabled bean is not a running or ready worker; this block adds no automatic lifecycle activation.
Application handlers use the event port. The technical adapter owns channel mapping and its named resources; schema installation remains an operator action.
@@ -128,25 +128,25 @@ Configuration binds through the shared `EdaProperties` class under `firefly.eda.
`fireflyEdaPostgresConsumerQueryConnectionFactory` is a lazy, named, non-default bounded query pool. `fireflyEdaPostgresConsumerConnectionFactory` supplies separate raw LISTEN connections. Neither replaces a Core business factory, template, repository, or transaction manager. An explicitly supplied query factory must be independent and compatible with the repository's ownership contract. The framework closes only its own query pool when the context closes; `stop()` preserves that pool for a later start and never disposes an external factory.
-The original five-argument `PostgresEventConsumer` constructor remains link-compatible, but starting that legacy construction now fails before resource access because it lacks the mandatory repository and decoder. Migrate direct callers to the additive seven-argument constructor or the configured bean. Missing decoder configuration fails selected-consumer bean creation; missing or incompatible protocol fails `start()` before admission.
+The original five-argument `PostgresEventConsumerImpl` constructor remains link-compatible, but starting that legacy construction now fails before resource access because it lacks the mandatory repository and decoder. Migrate direct callers to the additive seven-argument constructor or the configured bean. Missing decoder configuration fails selected-consumer bean creation; missing or incompatible protocol fails `start()` before admission.
## API overview
| Type | Contract and responsibility |
| --- | --- |
-| [`PostgresEventPublisher`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/PostgresEventPublisher.java) | Persists events in a PostgreSQL delivery table and dispatches through `LISTEN`/`NOTIFY`; publication uses Spring Data and joins an owner transaction on its configured connection factory. |
-| [`PostgresEventConsumer`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumer.java) | PostgreSQL implementation of `EventConsumer`. |
+| [`PostgresEventPublisherImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/PostgresEventPublisherImpl.java) | Persists events in a PostgreSQL delivery table and dispatches through `LISTEN`/`NOTIFY`; publication uses Spring Data and joins an owner transaction on its configured connection factory. |
+| [`PostgresEventConsumerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumerImpl.java) | PostgreSQL implementation of `EventConsumer`. |
| [`FireflyEdaPostgresConsumerAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresConsumerAutoConfiguration.java) | Defines `FireflyEdaPostgresConsumerAutoConfiguration`, `fireflyEdaPostgresConsumerConnectionFactory` operations. |
| [`FireflyEdaPostgresPublisherAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresPublisherAutoConfiguration.java) | Defines `FireflyEdaPostgresPublisherAutoConfiguration`, `fireflyEdaPostgresPublisherConnectionFactory`, `initialiseSchema`, `executeAll` operations. |
| [`PostgresChannelMapper`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/PostgresChannelMapper.java) | Maps arbitrary destination strings (e.g., `"order-events"`, `"user.created"`) to deterministic, valid PostgreSQL channel names suitable for use with `LISTEN`/`NOTIFY`. |
## Fenced delivery repository
-`PostgresDeliveryRepository` provides bounded claims, fenced acknowledgments and retries, dead-letter transitions, and protocol verification through Spring Data. `SpringDataPostgresDeliveryRepository` accepts an explicit independent technical connection factory, schema, table, and a transaction timeout of 1–60 whole seconds. Each operation uses its own `REQUIRES_NEW` transaction and completes connection release before returning a result. An outer transaction does not own a claim. A release error after commit withholds the result; the durable claim then recovers through lease expiry.
+`PostgresDeliveryRepository` provides bounded claims, fenced acknowledgments and retries, dead-letter transitions, and protocol verification through Spring Data. `SpringDataPostgresDeliveryRepositoryImpl` accepts an explicit independent technical connection factory, schema, table, and a transaction timeout of 1–60 whole seconds. Each operation uses its own `REQUIRES_NEW` transaction and completes connection release before returning a result. An outer transaction does not own a claim. A release error after commit withholds the result; the durable claim then recovers through lease expiry.
Supply the underlying independent factory explicitly. Transaction-aware proxies, single-connection factories, scoped factories, and their supported infrastructure aliases are rejected before acquisition or scoped target resolution. Custom connection-reusing or close-suppressing wrappers are unsupported. The repository neither looks up nor disposes a default/business pool.
-`PostgresEventConsumer` uses this repository for every claim and durable transition. A bounded/coalesced poll and notification loop shares concurrency permits; a committed batch is released from the query connection before handlers run. Query or LISTEN failures recover with bounded delays. Stop interrupts waiting handlers and bounds cleanup; no lease is renewed. Transport delivery remains at least once, and Core operation journals/retry keys remain authoritative for business effects.
+`PostgresEventConsumerImpl` uses this repository for every claim and durable transition. A bounded/coalesced poll and notification loop shares concurrency permits; a committed batch is released from the query connection before handlers run. Query or LISTEN failures recover with bounded delays. Stop interrupts waiting handlers and bounds cleanup; no lease is renewed. Transport delivery remains at least once, and Core operation journals/retry keys remain authoritative for business effects.
The default `ANNOTATED` mode waits for the strict listener outcome before fenced ACK/retry/dead-letter handling. `consume()` subscribers in this mode are read-only observers; missing observer demand cannot block handlers or ACK rows. `MANUAL` mode permits exactly one processing subscriber, claims only against positive demand, does not invoke annotations, and exposes cold fenced `acknowledge()`/`reject()` callbacks. Cancelling, timing out, or losing a subscriber never substitutes an ACK for missing processing. An already submitted mutation can have an unknown outcome if its result is lost. Stale callbacks fail rather than acknowledging a newer claim. A callback failure can leave the row leased until expiry; the runtime does not infer a successful transition from a lost result.
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresConsumerAutoConfiguration.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresConsumerAutoConfiguration.java
index bbe16c3b6..bf497a637 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresConsumerAutoConfiguration.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresConsumerAutoConfiguration.java
@@ -24,12 +24,12 @@
import java.time.Duration;
import java.util.HashMap;
import org.fireflyframework.eda.consumer.postgres.*;
-import org.fireflyframework.eda.consumer.postgres.impl.PostgresConsumerQueryPool;
-import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresDeliveryRepository;
-import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresConsumerGroupRepository;
+import org.fireflyframework.eda.consumer.postgres.impl.PostgresConsumerQueryPoolImpl;
+import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresDeliveryRepositoryImpl;
+import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresConsumerGroupRepositoryImpl;
import org.fireflyframework.eda.consumer.postgres.model.ConsumerGroupId;
import org.fireflyframework.eda.consumer.postgres.model.ConsumerGroupTables;
-import org.fireflyframework.eda.listener.EventListenerProcessor;
+import org.fireflyframework.eda.listener.EventListenerProcessorImpl;
import org.fireflyframework.eda.properties.EdaProperties;
import org.fireflyframework.eda.serialization.MessageSerializer;
import org.springframework.beans.factory.ObjectProvider;
@@ -59,7 +59,7 @@ public FireflyEdaPostgresConsumerAutoConfiguration(EdaProperties props){ }
public PostgresqlConnectionFactory fireflyEdaPostgresConsumerConnectionFactory(EdaProperties props){
var config=props.getConsumer().getPostgres().get("default");
if(config==null||config.getHost()==null||config.getHost().isBlank()||config.getDatabase()==null||config.getDatabase().isBlank()||config.getUsername()==null||config.getUsername().isBlank()||config.getPort()<1||config.getPort()>65535)throw new IllegalArgumentException("PostgreSQL consumer connection configuration is incomplete");
- PostgresConsumerQueryPool.requireTimeout(config.getConnectTimeout());
+ PostgresConsumerQueryPoolImpl.requireTimeout(config.getConnectTimeout());
var builder=PostgresqlConnectionConfiguration.builder().host(config.getHost()).port(config.getPort()).database(config.getDatabase()).username(config.getUsername()).connectTimeout(config.getConnectTimeout());
if(config.getPassword()!=null)builder.password(config.getPassword());if(config.getSchema()!=null)builder.schema(config.getSchema());
if(config.getProperties()!=null&&!config.getProperties().isEmpty()){
@@ -75,25 +75,25 @@ public PostgresqlConnectionFactory fireflyEdaPostgresConsumerConnectionFactory(E
public PostgresDeliveryRepository fireflyEdaPostgresDeliveryRepository(@Qualifier("fireflyEdaPostgresConsumerQueryConnectionFactory")ConnectionFactory factory,EdaProperties props){
var config=props.getConsumer().getPostgres().get("default");Duration timeout=config.getQueryTimeout();
if(timeout==null||timeout.getNano()!=0||timeout.getSeconds()<1||timeout.getSeconds()>60)throw new IllegalArgumentException("PostgreSQL consumer query timeout requires one to sixty whole seconds");
- if(config.getGroupId()!=null)return new SpringDataPostgresConsumerGroupRepository(factory,
+ if(config.getGroupId()!=null)return new SpringDataPostgresConsumerGroupRepositoryImpl(factory,
new ConsumerGroupTables(config.getSchema(),config.getOutboxTable(),config.getGroupRegistryTable(),config.getGroupDeliveriesTable(),config.getGroupRedrivesTable()),
new ConsumerGroupId(config.getGroupId()),timeout);
- return new SpringDataPostgresDeliveryRepository(factory,config.getSchema(),config.getOutboxTable(),timeout);
+ return new SpringDataPostgresDeliveryRepositoryImpl(factory,config.getSchema(),config.getOutboxTable(),timeout);
}
@Bean(name="postgresEventConsumer")
- @ConditionalOnMissingBean(PostgresEventConsumer.class)
+ @ConditionalOnMissingBean(PostgresEventConsumerImpl.class)
@ConditionalOnExpression(SELECTED)
- public PostgresEventConsumer postgresEventConsumer(PostgresEventDecoder decoder,
+ public PostgresEventConsumerImpl postgresEventConsumer(PostgresEventDecoder decoder,
@Qualifier("fireflyEdaPostgresDeliveryRepository")PostgresDeliveryRepository repository,
@Qualifier("fireflyEdaPostgresConsumerConnectionFactory")ObjectProvider listenFactory,
- EventListenerProcessor processor,MessageSerializer serializer,EdaProperties props,ObjectMapper mapper){
+ EventListenerProcessorImpl processor,MessageSerializer serializer,EdaProperties props,ObjectMapper mapper){
var config=props.getConsumer().getPostgres().get("default");
if(config.getGroupId()!=null){
new ConsumerGroupId(config.getGroupId());
new ConsumerGroupTables(config.getSchema(),config.getOutboxTable(),config.getGroupRegistryTable(),config.getGroupDeliveriesTable(),config.getGroupRedrivesTable());
}
- return new PostgresEventConsumer(listenFactory,processor,serializer,props,mapper,repository,decoder);
+ return new PostgresEventConsumerImpl(listenFactory,processor,serializer,props,mapper,repository,decoder);
}
@Configuration(proxyBeanMethods=false)
@@ -105,11 +105,11 @@ public PostgresEventConsumer postgresEventConsumer(PostgresEventDecoder decoder,
static class QueryPoolConfiguration {
@Bean(name="fireflyEdaPostgresConsumerQueryPoolOwner",destroyMethod="close")
@Lazy
- PostgresConsumerQueryPool fireflyEdaPostgresConsumerQueryPoolOwner(@Qualifier("fireflyEdaPostgresConsumerConnectionFactory")ConnectionFactory raw,EdaProperties props){
- return new PostgresConsumerQueryPool(raw,props.getConsumer().getPostgres().get("default"));
+ PostgresConsumerQueryPoolImpl fireflyEdaPostgresConsumerQueryPoolOwner(@Qualifier("fireflyEdaPostgresConsumerConnectionFactory")ConnectionFactory raw,EdaProperties props){
+ return new PostgresConsumerQueryPoolImpl(raw,props.getConsumer().getPostgres().get("default"));
}
@Bean(name="fireflyEdaPostgresConsumerQueryConnectionFactory",defaultCandidate=false,destroyMethod="")
@Lazy
- ConnectionFactory fireflyEdaPostgresConsumerQueryConnectionFactory(@Qualifier("fireflyEdaPostgresConsumerQueryPoolOwner")PostgresConsumerQueryPool owner){return owner.connectionFactory();}
+ ConnectionFactory fireflyEdaPostgresConsumerQueryConnectionFactory(@Qualifier("fireflyEdaPostgresConsumerQueryPoolOwner")PostgresConsumerQueryPoolImpl owner){return owner.connectionFactory();}
}
}
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresPublisherAutoConfiguration.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresPublisherAutoConfiguration.java
index 09dde5213..74d67b3a7 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresPublisherAutoConfiguration.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresPublisherAutoConfiguration.java
@@ -24,7 +24,7 @@
import io.r2dbc.spi.ConnectionFactory;
import lombok.extern.slf4j.Slf4j;
import org.fireflyframework.eda.properties.EdaProperties;
-import org.fireflyframework.eda.publisher.postgres.PostgresEventPublisher;
+import org.fireflyframework.eda.publisher.postgres.PostgresEventPublisherImpl;
import org.fireflyframework.eda.serialization.MessageSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.ObjectProvider;
@@ -49,7 +49,7 @@
* and, when {@code firefly.eda.publishers.postgres.default.auto-create-schema}
* is {@code true}, provisions the outbox table, supporting index, NOTIFY
* function, and AFTER INSERT trigger required by the
- * {@link org.fireflyframework.eda.publisher.postgres.PostgresEventPublisher}.
+ * {@link org.fireflyframework.eda.publisher.postgres.PostgresEventPublisherImpl}.
*
* Configuration source:
* {@code firefly.eda.publishers.postgres.default.*} -- never
@@ -137,12 +137,12 @@ public ConnectionPool fireflyEdaPostgresPublisherConnectionFactory(EdaProperties
}
@Bean
- @ConditionalOnMissingBean(PostgresEventPublisher.class)
+ @ConditionalOnMissingBean(PostgresEventPublisherImpl.class)
@ConditionalOnBean(name = "fireflyEdaPostgresPublisherConnectionFactory")
- public PostgresEventPublisher postgresEventPublisher(
+ public PostgresEventPublisherImpl postgresEventPublisher(
@Qualifier("fireflyEdaPostgresPublisherConnectionFactory") ObjectProvider factory,
MessageSerializer serializer, EdaProperties properties, ObjectMapper mapper) {
- return new PostgresEventPublisher(factory, serializer, properties, mapper);
+ return new PostgresEventPublisherImpl(factory, serializer, properties, mapper);
}
/**
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumer.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumerImpl.java
similarity index 76%
rename from modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumer.java
rename to modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumerImpl.java
index 5bdef8dad..649f02006 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumer.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumerImpl.java
@@ -21,9 +21,9 @@
import jakarta.annotation.PreDestroy;
import org.fireflyframework.eda.consumer.ConsumerHealth;
import org.fireflyframework.eda.consumer.EventConsumer;
-import org.fireflyframework.eda.consumer.postgres.impl.PostgresDeliveryRuntime;
+import org.fireflyframework.eda.consumer.postgres.impl.PostgresDeliveryRuntimeImpl;
import org.fireflyframework.eda.event.EventEnvelope;
-import org.fireflyframework.eda.listener.EventListenerProcessor;
+import org.fireflyframework.eda.listener.EventListenerProcessorImpl;
import org.fireflyframework.eda.properties.EdaProperties;
import org.fireflyframework.eda.serialization.MessageSerializer;
import org.springframework.beans.factory.ObjectProvider;
@@ -33,21 +33,21 @@
import reactor.core.scheduler.Scheduler;
/** A single processing owner over committed PostgreSQL delivery claims. */
-public class PostgresEventConsumer implements EventConsumer {
- private final PostgresDeliveryRuntime runtime;
- public PostgresEventConsumer(@Qualifier("fireflyEdaPostgresConsumerConnectionFactory") ObjectProvider provider,
- EventListenerProcessor processor, MessageSerializer serializer, EdaProperties properties, ObjectMapper mapper) {
+public class PostgresEventConsumerImpl implements EventConsumer {
+ private final PostgresDeliveryRuntimeImpl runtime;
+ public PostgresEventConsumerImpl(@Qualifier("fireflyEdaPostgresConsumerConnectionFactory") ObjectProvider provider,
+ EventListenerProcessorImpl processor, MessageSerializer serializer, EdaProperties properties, ObjectMapper mapper) {
this(provider,processor,serializer,properties,mapper,null,null);
}
- public PostgresEventConsumer(ObjectProvider provider, EventListenerProcessor processor,
+ public PostgresEventConsumerImpl(ObjectProvider provider, EventListenerProcessorImpl processor,
MessageSerializer serializer, EdaProperties properties, ObjectMapper mapper,
PostgresDeliveryRepository repository, PostgresEventDecoder decoder) {
this(provider,processor,serializer,properties,mapper,repository,decoder,null);
}
- PostgresEventConsumer(ObjectProvider provider, EventListenerProcessor processor,
+ PostgresEventConsumerImpl(ObjectProvider provider, EventListenerProcessorImpl processor,
MessageSerializer serializer, EdaProperties properties, ObjectMapper mapper,
PostgresDeliveryRepository repository, PostgresEventDecoder decoder, Scheduler scheduler) {
- runtime=new PostgresDeliveryRuntime(provider,processor,properties,mapper,repository,decoder,scheduler);
+ runtime=new PostgresDeliveryRuntimeImpl(provider,processor,properties,mapper,repository,decoder,scheduler);
}
@Override public Flux consume(){return runtime.consume();}
@Override public Flux consume(String... destinations){return runtime.consume(destinations);}
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundary.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundaryImpl.java
similarity index 92%
rename from modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundary.java
rename to modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundaryImpl.java
index 8a4478ab0..8cef8011d 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundary.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundaryImpl.java
@@ -30,12 +30,12 @@
import reactor.core.publisher.Mono;
/** Owns a short query transaction while preserving Spring's original resource key. */
-final class DeliveryTransactionBoundary {
+final class DeliveryTransactionBoundaryImpl {
private final Object observationKey = new Object();
private final TransactionalOperator transactions;
private final Duration timeout;
- DeliveryTransactionBoundary(ConnectionFactory factory, Duration timeout) {
+ DeliveryTransactionBoundaryImpl(ConnectionFactory factory, Duration timeout) {
Objects.requireNonNull(factory, "factory");
if (factory instanceof ScopedObject) {
throw new IllegalArgumentException("Delivery requires the underlying independent ConnectionFactory");
@@ -53,7 +53,7 @@ final class DeliveryTransactionBoundary {
definition.setIsolationLevel(TransactionDefinition.ISOLATION_READ_COMMITTED);
definition.setTimeout(Math.toIntExact(timeout.toSeconds()));
definition.setName("firefly.eda.postgres.delivery");
- transactions = TransactionalOperator.create(new R2dbcTransactionManager(new ObservedFactory(factory)), definition);
+ transactions = TransactionalOperator.create(new R2dbcTransactionManager(new ObservedFactoryImpl(factory)), definition);
}
private static boolean reusesConnections(Object factory) {
@@ -72,10 +72,10 @@ Mono execute(Supplier> work) {
});
}
- private final class ObservedFactory implements ConnectionFactory, InfrastructureProxy {
+ private final class ObservedFactoryImpl implements ConnectionFactory, InfrastructureProxy {
private final ConnectionFactory target;
- private ObservedFactory(ConnectionFactory target) { this.target = target; }
+ private ObservedFactoryImpl(ConnectionFactory target) { this.target = target; }
@Override
public Object getWrappedObject() {
@@ -92,7 +92,7 @@ public Publisher extends Connection> create() {
return Mono.from(connection.close()).then(Mono.error(
new IllegalStateException("Delivery transaction acquired multiple connections")));
}
- return Mono.just(new ObservedConnection(connection, observation));
+ return Mono.just(new ObservedConnectionImpl(connection, observation));
});
});
}
@@ -114,11 +114,11 @@ private void verifyReleased() {
}
}
- private static final class ObservedConnection implements Connection {
+ private static final class ObservedConnectionImpl implements Connection {
private final Connection target;
private final Observation observation;
- private ObservedConnection(Connection target, Observation observation) {
+ private ObservedConnectionImpl(Connection target, Observation observation) {
this.target = target;
this.observation = observation;
}
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresConsumerQueryPool.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresConsumerQueryPoolImpl.java
similarity index 92%
rename from modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresConsumerQueryPool.java
rename to modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresConsumerQueryPoolImpl.java
index 5427d8258..ca333cf2d 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresConsumerQueryPool.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresConsumerQueryPoolImpl.java
@@ -10,12 +10,12 @@
import org.fireflyframework.eda.properties.EdaProperties.Consumer.PostgresConfig;
/** Container-owned query connections; the supplied raw factory remains external. */
-public final class PostgresConsumerQueryPool implements AutoCloseable {
+public final class PostgresConsumerQueryPoolImpl implements AutoCloseable {
private final ConnectionPool pool;
private final Duration shutdownTimeout;
private final AtomicBoolean closed=new AtomicBoolean();
- public PostgresConsumerQueryPool(ConnectionFactory raw,PostgresConfig config) {
+ public PostgresConsumerQueryPoolImpl(ConnectionFactory raw,PostgresConfig config) {
Objects.requireNonNull(raw);
if(config.getMaxPoolSize()<1||config.getMaxPoolSize()>100)throw new IllegalArgumentException("Invalid PostgreSQL consumer pool bounds");
requireTimeout(config.getConnectTimeout());requireTimeout(config.getAcquireTimeout());requireTimeout(config.getShutdownTimeout());
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresDeliveryRuntime.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresDeliveryRuntimeImpl.java
similarity index 94%
rename from modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresDeliveryRuntime.java
rename to modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresDeliveryRuntimeImpl.java
index c2a6b0aa9..b34fb2801 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresDeliveryRuntime.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresDeliveryRuntimeImpl.java
@@ -22,7 +22,7 @@
import org.fireflyframework.eda.consumer.postgres.model.*;
import org.fireflyframework.eda.event.EventEnvelope;
import org.fireflyframework.eda.listener.EventDeliveryOutcome;
-import org.fireflyframework.eda.listener.EventListenerProcessor;
+import org.fireflyframework.eda.listener.EventListenerProcessorImpl;
import org.fireflyframework.eda.properties.EdaProperties;
import org.fireflyframework.eda.properties.EdaProperties.Consumer.PostgresConfig;
import org.fireflyframework.eda.publisher.postgres.PostgresChannelMapper;
@@ -37,9 +37,9 @@
import reactor.util.retry.Retry;
/** Owns bounded dispatch; the repository alone owns durable lease authority. */
-public final class PostgresDeliveryRuntime {
+public final class PostgresDeliveryRuntimeImpl {
private final ObjectProvider provider;
- private final EventListenerProcessor processor;
+ private final EventListenerProcessorImpl processor;
private final EdaProperties properties;
private final ObjectMapper mapper;
private final PostgresDeliveryRepository repository;
@@ -48,7 +48,7 @@ public final class PostgresDeliveryRuntime {
private volatile Run current;
private final AtomicLong consumed=new AtomicLong(),processed=new AtomicLong(),failures=new AtomicLong();
- public PostgresDeliveryRuntime(ObjectProvider provider, EventListenerProcessor processor,
+ public PostgresDeliveryRuntimeImpl(ObjectProvider provider, EventListenerProcessorImpl processor,
EdaProperties properties, ObjectMapper mapper, PostgresDeliveryRepository repository,
PostgresEventDecoder decoder, Scheduler scheduler) {
this.provider=provider;this.processor=Objects.requireNonNull(processor);this.properties=properties;
@@ -91,7 +91,7 @@ private final class Run {
final Sinks.Empty stopped=Sinks.empty();
final Sinks.Many observations=Sinks.many().multicast().directBestEffort();
final AtomicReference worker=new AtomicReference<>();
- final Set manualDeliveries=ConcurrentHashMap.newKeySet();
+ final Set manualDeliveries=ConcurrentHashMap.newKeySet();
final Mono started;
volatile boolean running,verified,stopping,backingOff,queryFailed;
volatile Disposable polling,notifications,drain;
@@ -102,7 +102,7 @@ private final class Run {
Run(Settings settings){
this.settings=settings;scheduler=suppliedScheduler==null?Schedulers.newSingle("firefly-pg-consumer"):suppliedScheduler;ownsScheduler=suppliedScheduler==null;permits=new Semaphore(settings.concurrency);
started=Mono.defer(()->{if(stopping)return Mono.error(startupStopped);var selected=channels();if(selected.isEmpty())return Mono.error(new IllegalArgumentException("PostgreSQL delivery channels are required"));return repository.verifyProtocol(new ClaimRequest(selected,settings.batch,settings.maxAttempts,settings.lease));})
- .timeout(settings.query,scheduler).then(Mono.fromRunnable(this::activate)).doOnError(e->{if(!stopping){if(ownsScheduler)scheduler.dispose();synchronized(PostgresDeliveryRuntime.this){if(current==this)current=null;}}}).cache();
+ .timeout(settings.query,scheduler).then(Mono.fromRunnable(this::activate)).doOnError(e->{if(!stopping){if(ownsScheduler)scheduler.dispose();synchronized(PostgresDeliveryRuntimeImpl.this){if(current==this)current=null;}}}).cache();
}
synchronized void activate(){
if(stopping)throw startupStopped;
@@ -176,18 +176,18 @@ Mono withPermit(Mono work){
Runnable release=()->{if(released.compareAndSet(false,true))permits.release();};
return work.doOnSuccess(v->release.run()).doOnError(e->release.run()).doFinally(signal->release.run());
}
- Mono transition(Mono result){return PostgresDeliveryRuntime.transition(result).timeout(settings.query,scheduler);}
+ Mono transition(Mono result){return PostgresDeliveryRuntimeImpl.transition(result).timeout(settings.query,scheduler);}
Mono process(DeliveryClaim claim,Worker owner){
var failed=new AtomicBoolean();Runnable markFailure=()->{if(failed.compareAndSet(false,true))failures.incrementAndGet();};
return Mono.defer(()->{
consumed.incrementAndGet();
if(!running){markFailure.run();return transition(repository.reject(claim,FailureKind.LISTENER_FAILURE,settings.retry));}
final EventEnvelope event;
- try {event=new PostgresEnvelopeMapper(mapper).map(claim,Objects.requireNonNull(decoder.decode(claim.row().payload(),claim.row().eventClass(),claim.row().eventType())),readOnly());}
+ try {event=new PostgresEnvelopeMapperImpl(mapper).map(claim,Objects.requireNonNull(decoder.decode(claim.row().payload(),claim.row().eventClass(),claim.row().eventType())),readOnly());}
catch(Exception error){markFailure.run();return transition(repository.reject(claim,FailureKind.DESERIALIZATION_FAILURE,settings.retry));}
if(settings.mode==PostgresConfig.DeliveryMode.MANUAL){
if(owner==null||owner!=worker.get()||owner.sink.isCancelled()){markFailure.run();return transition(repository.reject(claim,FailureKind.LISTENER_FAILURE,settings.retry));}
- ManualDelivery delivery=new ManualDelivery(claim,owner,event,markFailure);manualDeliveries.add(delivery);
+ ManualDeliveryImpl delivery=new ManualDeliveryImpl(claim,owner,event,markFailure);manualDeliveries.add(delivery);
if(!owner.emit(delivery.envelope))return delivery.abort().doFinally(s->manualDeliveries.remove(delivery));
return Mono.firstWithSignal(delivery.finished.asMono(),owner.cancelled.asMono().then(Mono.error(new IllegalStateException("Manual processing cancelled"))),stopped.asMono().then(Mono.error(new IllegalStateException("Consumer stopped"))))
.timeout(settings.handler,scheduler).onErrorResume(e->delivery.abort()).doFinally(s->manualDeliveries.remove(delivery));
@@ -257,10 +257,10 @@ final class Worker {
Worker(FluxSink sink,Set destinations){this.sink=sink;channels=destinations.stream().map(PostgresChannelMapper::toChannel).collect(java.util.stream.Collectors.toUnmodifiableSet());}
boolean emit(EventEnvelope envelope){if(sink.isCancelled()||sink.requestedFromDownstream()==0)return false;sink.next(envelope);return !sink.isCancelled();}
}
- final class ManualDelivery implements EventEnvelope.AckCallback {
+ final class ManualDeliveryImpl implements EventEnvelope.AckCallback {
final DeliveryClaim claim;final Worker owner;final EventEnvelope envelope;final Sinks.Empty finished=Sinks.empty();
String action;Mono operation;final Runnable markFailure;
- ManualDelivery(DeliveryClaim claim,Worker owner,EventEnvelope e,Runnable markFailure){this.claim=claim;this.owner=owner;this.markFailure=markFailure;envelope=new EventEnvelope(e.destination(),e.eventType(),e.payload(),e.transactionId(),e.headers(),e.metadata(),e.timestamp(),e.publisherType(),e.consumerType(),e.connectionId(),this);}
+ ManualDeliveryImpl(DeliveryClaim claim,Worker owner,EventEnvelope e,Runnable markFailure){this.claim=claim;this.owner=owner;this.markFailure=markFailure;envelope=new EventEnvelope(e.destination(),e.eventType(),e.payload(),e.transactionId(),e.headers(),e.metadata(),e.timestamp(),e.publisherType(),e.consumerType(),e.connectionId(),this);}
public Mono acknowledge(){return Mono.defer(()->call("ACK"));}
public Mono reject(Throwable error){return Mono.defer(()->call("NACK"));}
synchronized Mono call(String requestedAction){
@@ -289,7 +289,7 @@ static Settings from(EdaProperties props){
int n=props.getConsumer().getConcurrency();if(n<1||n>100||c.getBatchSize()<1||c.getBatchSize()>1024||c.getMaxAttempts()<1||c.getMaxPoolSize()<1||c.getMaxPoolSize()>100)throw new IllegalArgumentException("Invalid PostgreSQL delivery admission bounds");
Duration poll=positive(c.getPollingInterval()),lease=positive(c.getLeaseDuration()),handler=positive(c.getHandlerTimeout()),backoff=positive(c.getRecoveryBackoff()),maxBackoff=positive(c.getMaxRecoveryBackoff()),shutdown=positive(c.getShutdownTimeout());
DeliveryBounds.milliseconds(lease,false);DeliveryBounds.milliseconds(c.getRetryDelay(),true);
- DeliveryBounds.milliseconds(poll,false);PostgresConsumerQueryPool.requireTimeout(c.getConnectTimeout());PostgresConsumerQueryPool.requireTimeout(c.getAcquireTimeout());PostgresConsumerQueryPool.requireTimeout(shutdown);
+ DeliveryBounds.milliseconds(poll,false);PostgresConsumerQueryPoolImpl.requireTimeout(c.getConnectTimeout());PostgresConsumerQueryPoolImpl.requireTimeout(c.getAcquireTimeout());PostgresConsumerQueryPoolImpl.requireTimeout(shutdown);
Duration query=c.getQueryTimeout();if(query==null||query.getNano()!=0||query.getSeconds()<1||query.getSeconds()>60)throw new IllegalArgumentException("PostgreSQL consumer query timeout requires one to sixty whole seconds");
if(handler.compareTo(lease)>0||backoff.compareTo(maxBackoff)>0||maxBackoff.compareTo(Duration.ofSeconds(60))>0||shutdown.compareTo(Duration.ofSeconds(60))>0)throw new IllegalArgumentException("Invalid PostgreSQL delivery time bounds");
var channels=new LinkedHashSet();if(c.getChannels()!=null)for(String value:c.getChannels().split(","))if(!value.isBlank()&&!value.trim().equals("*"))channels.add(PostgresChannelMapper.toChannel(value.trim()));
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapper.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapperImpl.java
similarity index 95%
rename from modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapper.java
rename to modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapperImpl.java
index 444ec313d..a55e81315 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapper.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapperImpl.java
@@ -10,9 +10,9 @@
import org.fireflyframework.eda.consumer.postgres.model.DeliveryClaim;
import org.fireflyframework.eda.event.EventEnvelope;
-final class PostgresEnvelopeMapper {
+final class PostgresEnvelopeMapperImpl {
private final ObjectMapper mapper;
- PostgresEnvelopeMapper(ObjectMapper mapper){this.mapper=mapper;}
+ PostgresEnvelopeMapperImpl(ObjectMapper mapper){this.mapper=mapper;}
EventEnvelope map(DeliveryClaim claim,Object payload,EventEnvelope.AckCallback callback)throws Exception{
var row=claim.row();Map headers=Map.of();
if(row.headers()!=null){JsonNode node=mapper.readTree(row.headers().asString());if(node==null||!node.isObject())throw new IllegalArgumentException("Delivery headers must be an object");headers=object(node,0);}
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/RegisteredPostgresEventDecoder.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/RegisteredPostgresEventDecoderImpl.java
similarity index 90%
rename from modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/RegisteredPostgresEventDecoder.java
rename to modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/RegisteredPostgresEventDecoderImpl.java
index 990c129ff..ad113abb5 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/RegisteredPostgresEventDecoder.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/RegisteredPostgresEventDecoderImpl.java
@@ -7,11 +7,11 @@
import org.fireflyframework.eda.serialization.MessageSerializer;
/** Resolves wire identifiers only against operator-supplied class tokens. */
-public final class RegisteredPostgresEventDecoder implements PostgresEventDecoder {
+public final class RegisteredPostgresEventDecoderImpl implements PostgresEventDecoder {
private final MessageSerializer serializer;
private final Map> allowedTypes;
- public RegisteredPostgresEventDecoder(MessageSerializer serializer,Map> allowedTypes) {
+ public RegisteredPostgresEventDecoderImpl(MessageSerializer serializer,Map> allowedTypes) {
this.serializer=Objects.requireNonNull(serializer);
if(allowedTypes==null||allowedTypes.isEmpty()||allowedTypes.entrySet().stream().anyMatch(e->e.getKey()==null||e.getKey().isBlank()||e.getKey().indexOf(0)>=0||e.getValue()==null||e.getValue().isPrimitive())) {
throw new IllegalArgumentException("Explicit PostgreSQL event types are required");
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresConsumerGroupRepository.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresConsumerGroupRepositoryImpl.java
similarity index 98%
rename from modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresConsumerGroupRepository.java
rename to modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresConsumerGroupRepositoryImpl.java
index 470b1ef98..555a0465c 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresConsumerGroupRepository.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresConsumerGroupRepositoryImpl.java
@@ -27,18 +27,18 @@
import reactor.core.publisher.Mono;
/** Group-bound technical delivery protocol; explicit CTEs preserve atomic lock/clock/fence semantics. */
-public final class SpringDataPostgresConsumerGroupRepository implements PostgresConsumerGroupRepository {
+public final class SpringDataPostgresConsumerGroupRepositoryImpl implements PostgresConsumerGroupRepository {
private final ConsumerGroupTables tables;
private final ConsumerGroupId group;
private final R2dbcEntityTemplate operations;
- private final DeliveryTransactionBoundary transactions;
+ private final DeliveryTransactionBoundaryImpl transactions;
private final Map relations;
- public SpringDataPostgresConsumerGroupRepository(ConnectionFactory factory, ConsumerGroupTables tables,
+ public SpringDataPostgresConsumerGroupRepositoryImpl(ConnectionFactory factory, ConsumerGroupTables tables,
ConsumerGroupId group, Duration timeout) {
this.tables=Objects.requireNonNull(tables,"tables");
this.group=Objects.requireNonNull(group,"group");
- this.transactions=new DeliveryTransactionBoundary(Objects.requireNonNull(factory,"factory"),timeout);
+ this.transactions=new DeliveryTransactionBoundaryImpl(Objects.requireNonNull(factory,"factory"),timeout);
this.operations=new R2dbcEntityTemplate(DatabaseClient.builder().connectionFactory(factory)
.bindMarkers(PostgresDialect.INSTANCE.getBindMarkersFactory()).build(),PostgresDialect.INSTANCE);
this.relations=Map.of("outbox",qualified(tables.outbox()),"registry",qualified(tables.registry()),
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresDeliveryRepository.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresDeliveryRepositoryImpl.java
similarity index 97%
rename from modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresDeliveryRepository.java
rename to modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresDeliveryRepositoryImpl.java
index 9419801f2..c364f0aa2 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresDeliveryRepository.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresDeliveryRepositoryImpl.java
@@ -24,19 +24,19 @@
import reactor.core.publisher.Mono;
/** Mapped technical outbox protocol; native CTEs make lock/clock/fence one database statement. */
-public final class SpringDataPostgresDeliveryRepository implements PostgresDeliveryRepository {
+public final class SpringDataPostgresDeliveryRepositoryImpl implements PostgresDeliveryRepository {
private final String schema;
private final String table;
private final String qualified;
private final R2dbcEntityTemplate operations;
- private final DeliveryTransactionBoundary transactions;
+ private final DeliveryTransactionBoundaryImpl transactions;
- public SpringDataPostgresDeliveryRepository(ConnectionFactory factory, String schema, String table, Duration timeout) {
+ public SpringDataPostgresDeliveryRepositoryImpl(ConnectionFactory factory, String schema, String table, Duration timeout) {
Objects.requireNonNull(factory, "factory");
this.qualified = PostgresDeliverySchema.qualified(schema, table);
this.schema = schema;
this.table = table;
- this.transactions = new DeliveryTransactionBoundary(factory, timeout);
+ this.transactions = new DeliveryTransactionBoundaryImpl(factory, timeout);
this.operations = new R2dbcEntityTemplate(DatabaseClient.builder().connectionFactory(factory)
.bindMarkers(PostgresDialect.INSTANCE.getBindMarkersFactory()).build(), PostgresDialect.INSTANCE);
}
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/PostgresEventPublisher.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/PostgresEventPublisherImpl.java
similarity index 97%
rename from modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/PostgresEventPublisher.java
rename to modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/PostgresEventPublisherImpl.java
index 06a5cfa8e..814aa7001 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/PostgresEventPublisher.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/PostgresEventPublisherImpl.java
@@ -27,7 +27,7 @@
import org.fireflyframework.eda.publisher.ConnectionAwarePublisher;
import org.fireflyframework.eda.publisher.EventPublisher;
import org.fireflyframework.eda.publisher.PublisherHealth;
-import org.fireflyframework.eda.publisher.postgres.impl.SpringDataPostgresOutboxWriter;
+import org.fireflyframework.eda.publisher.postgres.impl.SpringDataPostgresOutboxWriterImpl;
import org.fireflyframework.eda.publisher.postgres.model.PostgresOutboxAppend;
import org.fireflyframework.eda.serialization.MessageSerializer;
import org.springframework.beans.factory.ObjectProvider;
@@ -61,7 +61,7 @@
*
*/
@Slf4j
-public class PostgresEventPublisher implements EventPublisher, ConnectionAwarePublisher {
+public class PostgresEventPublisherImpl implements EventPublisher, ConnectionAwarePublisher {
private final ObjectProvider connectionFactoryProvider;
private final MessageSerializer messageSerializer;
@@ -70,7 +70,7 @@ public class PostgresEventPublisher implements EventPublisher, ConnectionAwarePu
private String connectionId = "default";
private volatile WriterBinding writerBinding;
- public PostgresEventPublisher(
+ public PostgresEventPublisherImpl(
@Qualifier("fireflyEdaPostgresPublisherConnectionFactory")
ObjectProvider connectionFactoryProvider,
MessageSerializer messageSerializer,
@@ -141,7 +141,7 @@ private PostgresOutboxWriter outboxWriter(ConnectionFactory factory) {
current = writerBinding;
if (current == null || current.factory() != factory) {
current = new WriterBinding(factory,
- new SpringDataPostgresOutboxWriter(new R2dbcEntityTemplate(factory)));
+ new SpringDataPostgresOutboxWriterImpl(new R2dbcEntityTemplate(factory)));
writerBinding = current;
}
}
diff --git a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/impl/SpringDataPostgresOutboxWriter.java b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/impl/SpringDataPostgresOutboxWriterImpl.java
similarity index 93%
rename from modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/impl/SpringDataPostgresOutboxWriter.java
rename to modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/impl/SpringDataPostgresOutboxWriterImpl.java
index ba57a0541..4f43dbdcd 100644
--- a/modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/impl/SpringDataPostgresOutboxWriter.java
+++ b/modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/impl/SpringDataPostgresOutboxWriterImpl.java
@@ -15,10 +15,10 @@
import java.util.Objects;
-public final class SpringDataPostgresOutboxWriter implements PostgresOutboxWriter {
+public final class SpringDataPostgresOutboxWriterImpl implements PostgresOutboxWriter {
private final R2dbcEntityTemplate operations;
- public SpringDataPostgresOutboxWriter(R2dbcEntityTemplate operations) {
+ public SpringDataPostgresOutboxWriterImpl(R2dbcEntityTemplate operations) {
this.operations = Objects.requireNonNull(operations);
}
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/EdaPostgresCoreIsolationTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/EdaPostgresCoreIsolationTest.java
index e639949b3..da4e7e45a 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/EdaPostgresCoreIsolationTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/EdaPostgresCoreIsolationTest.java
@@ -50,11 +50,11 @@ static class SerializationBeans {
@Bean ObjectMapper objectMapper() { return new ObjectMapper(); }
@Bean MessageSerializer messageSerializer() { return mock(MessageSerializer.class); }
@Bean org.fireflyframework.eda.consumer.postgres.PostgresEventDecoder postgresEventDecoder(MessageSerializer serializer) {
- return new org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoder(serializer,java.util.Map.of("java.lang.String",String.class));
+ return new org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoderImpl(serializer,java.util.Map.of("java.lang.String",String.class));
}
- @Bean org.fireflyframework.eda.listener.EventListenerProcessor eventListenerProcessor(org.springframework.context.ApplicationContext context,
+ @Bean org.fireflyframework.eda.listener.EventListenerProcessorImpl eventListenerProcessor(org.springframework.context.ApplicationContext context,
org.springframework.context.ApplicationEventPublisher publisher,org.springframework.core.env.Environment environment) {
- return new org.fireflyframework.eda.listener.EventListenerProcessor(context,publisher,mock(org.fireflyframework.eda.error.CustomErrorHandlerRegistry.class),environment);
+ return new org.fireflyframework.eda.listener.EventListenerProcessorImpl(context,publisher,mock(org.fireflyframework.eda.error.CustomErrorHandlerRegistry.class),environment);
}
}
@@ -115,7 +115,7 @@ void assertBusiness(String business, String transport) {
assertThat(application).hasNotFailed();
if (transport.equals("PUBLISHER") || transport.equals("BOTH")) {
assertThat(application).hasBean("fireflyEdaPostgresPublisherConnectionFactory");
- assertThat(application).hasSingleBean(org.fireflyframework.eda.publisher.postgres.PostgresEventPublisher.class);
+ assertThat(application).hasSingleBean(org.fireflyframework.eda.publisher.postgres.PostgresEventPublisherImpl.class);
}
if (transport.equals("CONSUMER") || transport.equals("BOTH")) {
assertThat(application).hasBean("fireflyEdaPostgresConsumerConnectionFactory");
@@ -133,7 +133,7 @@ void assertBusiness(String business, String transport) {
assertThat(application.getBean(R2dbcEntityTemplate.class).getDatabaseClient().getConnectionFactory()).isSameAs(factory);
assertThat(application.getBean(R2dbcTransactionManager.class).getConnectionFactory()).isSameAs(factory);
if (business.equals("SHARED")) {
- var publisher = application.getBean(org.fireflyframework.eda.publisher.postgres.PostgresEventPublisher.class);
+ var publisher = application.getBean(org.fireflyframework.eda.publisher.postgres.PostgresEventPublisherImpl.class);
var provider = (org.springframework.beans.factory.ObjectProvider>)
org.springframework.test.util.ReflectionTestUtils.getField(publisher, "connectionFactoryProvider");
assertThat(provider.getObject()).isSameAs(factory);
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/PostgresConsumerAutoConfigurationTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/PostgresConsumerAutoConfigurationTest.java
index 478efa265..d70ba086d 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/PostgresConsumerAutoConfigurationTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/PostgresConsumerAutoConfigurationTest.java
@@ -14,10 +14,10 @@
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.core.InfrastructureProxy;
import org.fireflyframework.eda.consumer.postgres.*;
-import org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoder;
+import org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoderImpl;
import org.fireflyframework.eda.error.CustomErrorHandlerRegistry;
-import org.fireflyframework.eda.listener.EventListenerProcessor;
-import org.fireflyframework.eda.serialization.JsonMessageSerializer;
+import org.fireflyframework.eda.listener.EventListenerProcessorImpl;
+import org.fireflyframework.eda.serialization.JsonMessageSerializerImpl;
import org.fireflyframework.eda.serialization.MessageSerializer;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
@@ -53,7 +53,7 @@ private ApplicationContextRunner runner(boolean decoder){
"firefly.eda.consumer.postgres.default.host=127.0.0.1","firefly.eda.consumer.postgres.default.port=9",
"firefly.eda.consumer.postgres.default.database=technical","firefly.eda.consumer.postgres.default.username=technical",
"firefly.eda.consumer.postgres.default.max-pool-size=3");
- return decoder?r.withBean(PostgresEventDecoder.class,()->new RegisteredPostgresEventDecoder(new JsonMessageSerializer(new ObjectMapper()),Map.of("java.lang.String",String.class))):r;
+ return decoder?r.withBean(PostgresEventDecoder.class,()->new RegisteredPostgresEventDecoderImpl(new JsonMessageSerializerImpl(new ObjectMapper()),Map.of("java.lang.String",String.class))):r;
}
@Test void namedRealPoolIsLazyBoundedAndDistinctFromRawListen(){
final ConnectionPool[] owned=new ConnectionPool[1];
@@ -64,17 +64,17 @@ private ApplicationContextRunner runner(boolean decoder){
assertThat(owned[0].isDisposed()).isTrue();
}
@Test void explicitWorkerAndRepositoryDoNotPretendToBeRunningAtBeanCreation(){
- runner(true).run(c->{assertThat(c).hasNotFailed().hasSingleBean(PostgresEventConsumer.class).hasSingleBean(PostgresDeliveryRepository.class);assertThat(c.getBean(PostgresEventConsumer.class).isRunning()).isFalse();assertThat(c).doesNotHaveBean(R2dbcEntityTemplate.class).doesNotHaveBean(R2dbcTransactionManager.class);});
+ runner(true).run(c->{assertThat(c).hasNotFailed().hasSingleBean(PostgresEventConsumerImpl.class).hasSingleBean(PostgresDeliveryRepository.class);assertThat(c.getBean(PostgresEventConsumerImpl.class).isRunning()).isFalse();assertThat(c).doesNotHaveBean(R2dbcEntityTemplate.class).doesNotHaveBean(R2dbcTransactionManager.class);});
}
@Test void selectedPgWithoutRegisteredDecoderFailsClearly(){runner(false).run(c->assertThat(c).hasFailed());}
@Test void disabledPgDoesNotValidateOrCreateItsTechnicalResources(){
- runner(false).withPropertyValues("firefly.eda.consumer.postgres.default.enabled=false","firefly.eda.consumer.postgres.default.connect-timeout=PT0S").run(c->{assertThat(c).hasNotFailed().doesNotHaveBean(PostgresEventConsumer.class);assertThat(c).doesNotHaveBean("fireflyEdaPostgresConsumerQueryConnectionFactory");});
+ runner(false).withPropertyValues("firefly.eda.consumer.postgres.default.enabled=false","firefly.eda.consumer.postgres.default.connect-timeout=PT0S").run(c->{assertThat(c).hasNotFailed().doesNotHaveBean(PostgresEventConsumerImpl.class);assertThat(c).doesNotHaveBean("fireflyEdaPostgresConsumerQueryConnectionFactory");});
}
@Test void invalidSelectedPgDurationsFailBeforeConnectionUse(){runner(true).withPropertyValues("firefly.eda.consumer.postgres.default.connect-timeout=PT0S").run(c->assertThat(c).hasFailed());}
@Test void externalExactNamedQueryFactoryIsNeverDisposedOrReplaced(){
var external=mock(ConnectionFactory.class,withSettings().extraInterfaces(reactor.core.Disposable.class));when(external.getMetadata()).thenReturn(()->"PostgreSQL");
runner(true).withBean("fireflyEdaPostgresConsumerQueryConnectionFactory",ConnectionFactory.class,()->external,b->((AbstractBeanDefinition)b).setDefaultCandidate(false)).run(c->{
- assertThat(c).hasNotFailed().hasSingleBean(PostgresEventConsumer.class);assertThat(c.getBean("fireflyEdaPostgresConsumerQueryConnectionFactory")).isSameAs(external);assertThat(c).doesNotHaveBean("fireflyEdaPostgresConsumerQueryPoolOwner");verify(external,never()).create();});
+ assertThat(c).hasNotFailed().hasSingleBean(PostgresEventConsumerImpl.class);assertThat(c.getBean("fireflyEdaPostgresConsumerQueryConnectionFactory")).isSameAs(external);assertThat(c).doesNotHaveBean("fireflyEdaPostgresConsumerQueryPoolOwner");verify(external,never()).create();});
verify((reactor.core.Disposable)external,never()).dispose();
}
@ParameterizedTest @ValueSource(strings={"URL","DETAILS","EXPLICIT"})
@@ -122,8 +122,8 @@ static final class ExistingInfrastructureFactory implements ConnectionFactory,In
}
static class WorkerDependencies {
@Bean ObjectMapper objectMapper(){return new ObjectMapper();}
- @Bean MessageSerializer messageSerializer(ObjectMapper mapper){return new JsonMessageSerializer(mapper);}
- @Bean EventListenerProcessor eventListenerProcessor(ApplicationContext context,ApplicationEventPublisher publisher,Environment environment){return new EventListenerProcessor(context,publisher,mock(CustomErrorHandlerRegistry.class),environment);}
+ @Bean MessageSerializer messageSerializer(ObjectMapper mapper){return new JsonMessageSerializerImpl(mapper);}
+ @Bean EventListenerProcessorImpl eventListenerProcessor(ApplicationContext context,ApplicationEventPublisher publisher,Environment environment){return new EventListenerProcessorImpl(context,publisher,mock(CustomErrorHandlerRegistry.class),environment);}
}
@EnableR2dbcRepositories(basePackageClasses=PostgresConsumerAutoConfigurationTest.class,considerNestedRepositories=true,includeFilters=@ComponentScan.Filter(type=FilterType.ASSIGNABLE_TYPE,classes=BusinessRepository.class))
static class CoreRepositoryFixture { }
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/PostgresConsumerGroupSelectionTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/PostgresConsumerGroupSelectionTest.java
index 45eb40e48..92f7b739d 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/PostgresConsumerGroupSelectionTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/config/PostgresConsumerGroupSelectionTest.java
@@ -8,12 +8,12 @@
import io.r2dbc.spi.ConnectionFactory;
import io.r2dbc.spi.ConnectionFactoryOptions;
import org.fireflyframework.eda.consumer.postgres.*;
-import org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoder;
-import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresConsumerGroupRepository;
-import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresDeliveryRepository;
+import org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoderImpl;
+import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresConsumerGroupRepositoryImpl;
+import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresDeliveryRepositoryImpl;
import org.fireflyframework.eda.consumer.postgres.model.ConsumerGroupId;
import org.fireflyframework.eda.consumer.postgres.model.ConsumerGroupTables;
-import org.fireflyframework.eda.serialization.JsonMessageSerializer;
+import org.fireflyframework.eda.serialization.JsonMessageSerializerImpl;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
@@ -39,7 +39,7 @@ class PostgresConsumerGroupSelectionTest {
private ApplicationContextRunner runner(){
return new ApplicationContextRunner().withConfiguration(AutoConfigurations.of(FireflyEdaPostgresConsumerAutoConfiguration.class))
.withUserConfiguration(PostgresConsumerAutoConfigurationTest.WorkerDependencies.class)
- .withBean(PostgresEventDecoder.class,()->new RegisteredPostgresEventDecoder(new JsonMessageSerializer(new ObjectMapper()),Map.of("java.lang.String",String.class)))
+ .withBean(PostgresEventDecoder.class,()->new RegisteredPostgresEventDecoderImpl(new JsonMessageSerializerImpl(new ObjectMapper()),Map.of("java.lang.String",String.class)))
.withPropertyValues("firefly.eda.consumer.enabled=true","firefly.eda.consumer.postgres.default.enabled=true",
"firefly.eda.consumer.postgres.default.host=127.0.0.1","firefly.eda.consumer.postgres.default.port=9",
"firefly.eda.consumer.postgres.default.database=technical","firefly.eda.consumer.postgres.default.username=technical");
@@ -47,14 +47,14 @@ private ApplicationContextRunner runner(){
@Test void absentPostgresGroupKeepsGlobalCompatibilityWithoutInferringTheGlobalConsumerGroup(){
runner().withPropertyValues("firefly.eda.consumer.group-id=unrelated-global-id").run(context->{
assertThat(context).hasNotFailed();
- assertThat(context.getBean("fireflyEdaPostgresDeliveryRepository")).isInstanceOf(SpringDataPostgresDeliveryRepository.class);
+ assertThat(context.getBean("fireflyEdaPostgresDeliveryRepository")).isInstanceOf(SpringDataPostgresDeliveryRepositoryImpl.class);
});
}
@Test void actualPostgresGroupPropertySelectsTheGroupBoundAdapter(){
runner().withPropertyValues("firefly.eda.consumer.postgres.default.group-id=orders-service").run(context->{
assertThat(context).hasNotFailed();
- assertThat(context.getBean("fireflyEdaPostgresDeliveryRepository")).isInstanceOf(SpringDataPostgresConsumerGroupRepository.class);
- assertThat(context.getBean(PostgresEventConsumer.class).isRunning()).isFalse();
+ assertThat(context.getBean("fireflyEdaPostgresDeliveryRepository")).isInstanceOf(SpringDataPostgresConsumerGroupRepositoryImpl.class);
+ assertThat(context.getBean(PostgresEventConsumerImpl.class).isRunning()).isFalse();
});
}
@ParameterizedTest @ValueSource(strings={""," "})
@@ -81,7 +81,7 @@ void invalidGroupRelationNamesCannotSilentlyUseGlobalDelivery(String property){
.withBean("fireflyEdaPostgresConsumerQueryConnectionFactory",ConnectionFactory.class,()->external,bean->{
((AbstractBeanDefinition)bean).setDefaultCandidate(false);((AbstractBeanDefinition)bean).setDestroyMethodName("");
}).run(context->{
- assertThat(context).hasNotFailed();assertThat(context.getBean(PostgresDeliveryRepository.class)).isInstanceOf(SpringDataPostgresConsumerGroupRepository.class);
+ assertThat(context).hasNotFailed();assertThat(context.getBean(PostgresDeliveryRepository.class)).isInstanceOf(SpringDataPostgresConsumerGroupRepositoryImpl.class);
assertThat(context.getBean("fireflyEdaPostgresConsumerQueryConnectionFactory")).isSameAs(external);
assertThat(context.getBean("fireflyEdaPostgresConsumerConnectionFactory")).isNotSameAs(external);
assertThat(context).doesNotHaveBean("fireflyEdaPostgresConsumerQueryPoolOwner");verify(external,never()).create();
@@ -90,7 +90,7 @@ void invalidGroupRelationNamesCannotSilentlyUseGlobalDelivery(String property){
}
@Test void explicitNamedGroupPortIsPreserved(){
var factory=mock(ConnectionFactory.class);when(factory.getMetadata()).thenReturn(()->"PostgreSQL");
- var repository=new SpringDataPostgresConsumerGroupRepository(factory,new ConsumerGroupTables("public","events","registry","deliveries","redrives"),new ConsumerGroupId("orders-service"),java.time.Duration.ofSeconds(5));
+ var repository=new SpringDataPostgresConsumerGroupRepositoryImpl(factory,new ConsumerGroupTables("public","events","registry","deliveries","redrives"),new ConsumerGroupId("orders-service"),java.time.Duration.ofSeconds(5));
runner().withPropertyValues("firefly.eda.consumer.postgres.default.group-id=orders-service")
.withBean("fireflyEdaPostgresDeliveryRepository",PostgresDeliveryRepository.class,()->repository).run(context->{
assertThat(context).hasNotFailed();assertThat(context.getBean(PostgresDeliveryRepository.class)).isSameAs(repository);verify(factory,never()).create();
@@ -111,7 +111,7 @@ void selectedGroupCannotReplaceTheActualCoreFactoryTemplateTransactionManagerOrR
assertThat(context.getBean(R2dbcTransactionManager.class).getConnectionFactory()).isSameAs(businessFactory);
assertThat(context.getBean("fireflyEdaPostgresConsumerQueryConnectionFactory")).isNotSameAs(businessFactory);
assertThat(context.getBean("fireflyEdaPostgresConsumerConnectionFactory")).isNotSameAs(businessFactory);
- assertThat(context.getBean(PostgresDeliveryRepository.class)).isInstanceOf(SpringDataPostgresConsumerGroupRepository.class);
+ assertThat(context.getBean(PostgresDeliveryRepository.class)).isInstanceOf(SpringDataPostgresConsumerGroupRepositoryImpl.class);
});
}
@ParameterizedTest @ValueSource(strings={"SCOPED","INFRASTRUCTURE_SCOPED"})
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupContextMappingTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupContextMappingTest.java
index 47af62948..1ae9ee1e6 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupContextMappingTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupContextMappingTest.java
@@ -9,11 +9,11 @@
import java.util.concurrent.atomic.AtomicInteger;
import org.fireflyframework.eda.annotation.PublisherType;
import org.fireflyframework.eda.config.FireflyEdaPostgresConsumerAutoConfiguration;
-import org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoder;
+import org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoderImpl;
import org.fireflyframework.eda.consumer.postgres.model.ClaimRequest;
import org.fireflyframework.eda.error.CustomErrorHandlerRegistry;
-import org.fireflyframework.eda.listener.EventListenerProcessor;
-import org.fireflyframework.eda.serialization.JsonMessageSerializer;
+import org.fireflyframework.eda.listener.EventListenerProcessorImpl;
+import org.fireflyframework.eda.serialization.JsonMessageSerializerImpl;
import org.fireflyframework.eda.serialization.MessageSerializer;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
@@ -55,7 +55,7 @@ void configuredRelationsReachTheActualSpringDataCatalogAndMappedRegistrationRead
assertThat(query.statements).anyMatch(statement->statement.sql.startsWith("SELECT")&&statement.sql.contains("\""+schema+"\".\""+registry+"\""));
assertThat(query.statements).noneMatch(statement->statement.sql.startsWith("INSERT")||statement.sql.startsWith("UPDATE")||statement.sql.startsWith("CREATE"));
assertThat(query.committed).hasValue(1);assertThat(query.closed).hasValue(1);verifyNoInteractions(listen);
- assertThat(context.getBean(PostgresEventConsumer.class).isRunning()).isFalse();
+ assertThat(context.getBean(PostgresEventConsumerImpl.class).isRunning()).isFalse();
});
}
@Test void startupValidatesConfiguredAndRegisteredChannelsAndPolicyBeforeOpeningListen(){
@@ -68,8 +68,8 @@ void configuredRelationsReachTheActualSpringDataCatalogAndMappedRegistrationRead
runner(database.factory,listen).withPropertyValues("firefly.eda.consumer.postgres.default.channels=configured-topic",
"firefly.eda.consumer.postgres.default.max-attempts=5","firefly.eda.consumer.postgres.default.lease-duration=PT8S",
"firefly.eda.consumer.postgres.default.handler-timeout=PT8S").run(context->{
- assertThat(context).hasNotFailed();context.getBean(EventListenerProcessor.class).registerListener("listener","listener-topic",PublisherType.POSTGRES,(payload,headers)->Mono.empty());
- var consumer=context.getBean(PostgresEventConsumer.class);
+ assertThat(context).hasNotFailed();context.getBean(EventListenerProcessorImpl.class).registerListener("listener","listener-topic",PublisherType.POSTGRES,(payload,headers)->Mono.empty());
+ var consumer=context.getBean(PostgresEventConsumerImpl.class);
StepVerifier.create(consumer.start()).verifyComplete();assertThat(consumer.isRunning()).isTrue();assertThat(subscriptions).hasValue(1);
assertThat(query.statements).noneMatch(statement->statement.sql.contains("missing AS MATERIALIZED")||statement.sql.contains("claim_rows AS"));
StepVerifier.create(consumer.stop()).verifyComplete();assertThat(consumer.isRunning()).isFalse();assertThat(database.acquired).hasValue(1);
@@ -77,8 +77,8 @@ void configuredRelationsReachTheActualSpringDataCatalogAndMappedRegistrationRead
}
static class Dependencies {
@Bean ObjectMapper objectMapper(){return new ObjectMapper();}
- @Bean MessageSerializer messageSerializer(ObjectMapper mapper){return new JsonMessageSerializer(mapper);}
- @Bean PostgresEventDecoder decoder(MessageSerializer serializer){return new RegisteredPostgresEventDecoder(serializer,Map.of("java.lang.String",String.class));}
- @Bean EventListenerProcessor processor(ApplicationContext context,ApplicationEventPublisher publisher,Environment environment){return new EventListenerProcessor(context,publisher,mock(CustomErrorHandlerRegistry.class),environment);}
+ @Bean MessageSerializer messageSerializer(ObjectMapper mapper){return new JsonMessageSerializerImpl(mapper);}
+ @Bean PostgresEventDecoder decoder(MessageSerializer serializer){return new RegisteredPostgresEventDecoderImpl(serializer,Map.of("java.lang.String",String.class));}
+ @Bean EventListenerProcessorImpl processor(ApplicationContext context,ApplicationEventPublisher publisher,Environment environment){return new EventListenerProcessorImpl(context,publisher,mock(CustomErrorHandlerRegistry.class),environment);}
}
}
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupNativeFixture.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupNativeFixture.java
index b010f8afa..62d3a504e 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupNativeFixture.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupNativeFixture.java
@@ -16,7 +16,7 @@
import java.util.function.Consumer;
import org.fireflyframework.eda.config.*;
import org.fireflyframework.eda.consumer.postgres.model.*;
-import org.fireflyframework.eda.publisher.postgres.PostgresEventPublisher;
+import org.fireflyframework.eda.publisher.postgres.PostgresEventPublisherImpl;
import org.fireflyframework.eda.publisher.postgres.PostgresChannelMapper;
import org.reactivestreams.Publisher;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
@@ -72,14 +72,14 @@ void open(String group,boolean manual,Consumer action){
runner.run(context->{
assertThat(context).hasNotFailed();
var repository=context.getBean(PostgresConsumerGroupRepository.class);
- try(var worker=new Worker(group,context.getBean(PostgresEventConsumer.class),context.getBean(PostgresEventPublisher.class),context.getBean(PostgresConsumerNativeFixture.Handler.class),repository,pool,listens)){action.accept(worker);}
+ try(var worker=new Worker(group,context.getBean(PostgresEventConsumerImpl.class),context.getBean(PostgresEventPublisherImpl.class),context.getBean(PostgresConsumerNativeFixture.Handler.class),repository,pool,listens)){action.accept(worker);}
});
}finally{pool.disposeLater().block(Duration.ofSeconds(5));}
}
final class Worker implements AutoCloseable {
- final String group;final PostgresEventConsumer consumer;final PostgresEventPublisher publisher;final PostgresConsumerNativeFixture.Handler handler;
+ final String group;final PostgresEventConsumerImpl consumer;final PostgresEventPublisherImpl publisher;final PostgresConsumerNativeFixture.Handler handler;
final PostgresConsumerGroupRepository repository;final ConnectionPool queryPool;final AtomicInteger listens;
- Worker(String group,PostgresEventConsumer consumer,PostgresEventPublisher publisher,PostgresConsumerNativeFixture.Handler handler,PostgresConsumerGroupRepository repository,ConnectionPool queryPool,AtomicInteger listens){this.group=group;this.consumer=consumer;this.publisher=publisher;this.handler=handler;this.repository=repository;this.queryPool=queryPool;this.listens=listens;assertThat(consumer.isRunning()).isFalse();}
+ Worker(String group,PostgresEventConsumerImpl consumer,PostgresEventPublisherImpl publisher,PostgresConsumerNativeFixture.Handler handler,PostgresConsumerGroupRepository repository,ConnectionPool queryPool,AtomicInteger listens){this.group=group;this.consumer=consumer;this.publisher=publisher;this.handler=handler;this.repository=repository;this.queryPool=queryPool;this.listens=listens;assertThat(consumer.isRunning()).isFalse();}
void register(){register(new GroupSubscription(java.util.Set.of(PostgresChannelMapper.toChannel(destination)),3));}
void register(GroupSubscription policy){repository.registerGroup(policy,RetainedReplayPolicy.ALL_RETAINED).block(Duration.ofSeconds(5));}
void start(){consumer.start().block(Duration.ofSeconds(5));assertThat(consumer.isRunning()).isTrue();}
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupReadinessTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupReadinessTest.java
index 63fe293df..f19e6a3fe 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupReadinessTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupReadinessTest.java
@@ -31,7 +31,7 @@ void incompatibleGroupReadinessRefusesStartBeforeListenOrClaims(String mismatch)
if(mismatch.equals("MISSING"))query.registration=null;
if(mismatch.equals("CATALOG"))query.compatible=false;
try(var runtime=new PostgresConsumerRuntimeTest.Fixture()){
- runtime.current=new PostgresEventConsumer(runtime.provider,runtime.processor,mock(MessageSerializer.class),runtime.properties,new ObjectMapper(),database.repository(),(bytes,type,event)->"payload",runtime.scheduler);
+ runtime.current=new PostgresEventConsumerImpl(runtime.provider,runtime.processor,mock(MessageSerializer.class),runtime.properties,new ObjectMapper(),database.repository(),(bytes,type,event)->"payload",runtime.scheduler);
StepVerifier.create(runtime.current.start()).expectError(IllegalStateException.class).verify(Duration.ofSeconds(1));
assertThat(runtime.current.isRunning()).isFalse();verifyNoInteractions(runtime.factory);
assertThat(query.statements).noneMatch(statement->statement.sql.contains("missing AS MATERIALIZED")||statement.sql.contains("claim_rows AS"));
@@ -57,7 +57,7 @@ void incompatibleGroupReadinessRefusesStartBeforeListenOrClaims(String mismatch)
var config=runtime.properties.getConsumer().getPostgres().get("default");
config.setChannels("configured-topic");config.setMaxAttempts(5);config.setBatchSize(7);config.setLeaseDuration(Duration.ofSeconds(8));config.setHandlerTimeout(Duration.ofSeconds(8));
runtime.processor.registerListener("listener","listener-topic",PublisherType.POSTGRES,(payload,headers)->Mono.empty());
- runtime.current=new PostgresEventConsumer(runtime.provider,runtime.processor,mock(MessageSerializer.class),runtime.properties,new ObjectMapper(),repository,(bytes,type,event)->"payload",runtime.scheduler);
+ runtime.current=new PostgresEventConsumerImpl(runtime.provider,runtime.processor,mock(MessageSerializer.class),runtime.properties,new ObjectMapper(),repository,(bytes,type,event)->"payload",runtime.scheduler);
StepVerifier.create(runtime.current.start()).then(()->{
assertThat(captured.get()).isEqualTo(new ClaimRequest(Set.of("firefly_eda_configured_topic","firefly_eda_listener_topic"),7,5,Duration.ofSeconds(8)));
verifyNoInteractions(runtime.factory);assertThat(runtime.current.isRunning()).isFalse();
@@ -69,7 +69,7 @@ void incompatibleGroupReadinessRefusesStartBeforeListenOrClaims(String mismatch)
startup.registration.put("channels",new String[]{"firefly_eda_events"});
try(var runtime=new PostgresConsumerRuntimeTest.Fixture()){
runtime.mode(org.fireflyframework.eda.properties.EdaProperties.Consumer.PostgresConfig.DeliveryMode.MANUAL);
- runtime.current=new PostgresEventConsumer(runtime.provider,runtime.processor,mock(MessageSerializer.class),runtime.properties,new ObjectMapper(),database.repository(),(bytes,type,event)->"payload",runtime.scheduler);
+ runtime.current=new PostgresEventConsumerImpl(runtime.provider,runtime.processor,mock(MessageSerializer.class),runtime.properties,new ObjectMapper(),database.repository(),(bytes,type,event)->"payload",runtime.scheduler);
StepVerifier.create(runtime.current.start()).verifyComplete();
var changed=database.session();changed.registration.put("channels",new String[]{"firefly_eda_events"});
runtime.processor.registerListener("late","new-topic",PublisherType.POSTGRES,(payload,headers)->Mono.empty());
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupRepositoryIntegrationTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupRepositoryIntegrationTest.java
index 007fb195a..3aeecc995 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupRepositoryIntegrationTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerGroupRepositoryIntegrationTest.java
@@ -10,7 +10,7 @@
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;
-import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresConsumerGroupRepository;
+import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresConsumerGroupRepositoryImpl;
import org.fireflyframework.eda.consumer.postgres.model.*;
import org.junit.jupiter.api.*;
import org.junit.jupiter.params.ParameterizedTest;
@@ -47,19 +47,19 @@ class PostgresConsumerGroupRepositoryIntegrationTest {
}
String relation(String table){return PostgresDeliverySchema.qualified(tables.schema(),table);}
void install(String sql){Mono.usingWhen(Mono.from(pool.create()),c->Flux.from(c.createStatement(sql).execute()).concatMap(r->Mono.from(r.getRowsUpdated())).then(),Connection::close,(c,e)->Mono.from(c.rollbackTransaction()).then(Mono.from(c.close())),c->Mono.from(c.rollbackTransaction()).then(Mono.from(c.close()))).block(WAIT);}
- SpringDataPostgresConsumerGroupRepository repository(String group){return repository(pool,group);}
- SpringDataPostgresConsumerGroupRepository repository(ConnectionFactory cf,String group){return new SpringDataPostgresConsumerGroupRepository(cf,tables,new ConsumerGroupId(group),Duration.ofSeconds(10));}
- SpringDataPostgresConsumerGroupRepository ready(String group,int attempts){var r=repository(group);r.registerGroup(new GroupSubscription(Set.of("events"),attempts),RetainedReplayPolicy.ALL_RETAINED).block(WAIT);r.verifyProtocol().block(WAIT);return r;}
+ SpringDataPostgresConsumerGroupRepositoryImpl repository(String group){return repository(pool,group);}
+ SpringDataPostgresConsumerGroupRepositoryImpl repository(ConnectionFactory cf,String group){return new SpringDataPostgresConsumerGroupRepositoryImpl(cf,tables,new ConsumerGroupId(group),Duration.ofSeconds(10));}
+ SpringDataPostgresConsumerGroupRepositoryImpl ready(String group,int attempts){var r=repository(group);r.registerGroup(new GroupSubscription(Set.of("events"),attempts),RetainedReplayPolicy.ALL_RETAINED).block(WAIT);r.verifyProtocol().block(WAIT);return r;}
ClaimRequest request(){return request(8,3,Duration.ofSeconds(5));}
ClaimRequest request(int limit,int attempts,Duration lease){return new ClaimRequest(Set.of("events"),limit,attempts,lease);}
long append(){return database.sql("INSERT INTO "+relation(tables.outbox())+" (destination,channel,payload,headers,event_class) VALUES ('orders.created','events',decode('0001ff','hex'),'{\"decimal\":12.3400}'::pg_catalog.jsonb,'untrusted.MustNotInitialize') RETURNING id").map((row,m)->row.get("id",Long.class)).one().block(WAIT);}
- DeliveryClaim one(SpringDataPostgresConsumerGroupRepository r,ClaimRequest request){var batch=r.claim(request).block(WAIT);assertThat(batch.claims()).hasSize(1);return batch.claims().getFirst();}
+ DeliveryClaim one(SpringDataPostgresConsumerGroupRepositoryImpl r,ClaimRequest request){var batch=r.claim(request).block(WAIT);assertThat(batch.claims()).hasSize(1);return batch.claims().getFirst();}
String snapshot(String table,String where){return database.sql("SELECT pg_catalog.to_jsonb(value)::pg_catalog.text AS snapshot FROM "+relation(table)+" value WHERE "+where).map((row,m)->row.get("snapshot",String.class)).one().block(WAIT);}
long count(String table){return database.sql("SELECT pg_catalog.count(*) AS count FROM "+relation(table)).map((row,m)->row.get("count",Long.class)).one().block(WAIT);}
Map state(String group,long event){return database.sql("SELECT * FROM "+relation(tables.deliveries())+" WHERE group_id=:group AND event_id=:id").bind("group",group).bind("id",event).fetch().one().block(WAIT);}
OffsetDateTime clock(){return database.sql("SELECT pg_catalog.clock_timestamp() AS now").map((row,m)->row.get("now",OffsetDateTime.class)).one().block(WAIT);}
DeadLetterRedriveCommand command(DeliveryClaim c){return new DeadLetterRedriveCommand(UUID.randomUUID(),c.row().id(),c.row().leaseToken(),c.row().leaseGeneration(),3,"operator-supplied","reviewed technical request");}
- DeliveryClaim deadLetter(SpringDataPostgresConsumerGroupRepository r){append();var c=one(r,request());assertThat(r.reject(c,FailureKind.EXPLICIT_DEAD_LETTER,Duration.ZERO).block(WAIT)).isEqualTo(TransitionResult.APPLIED);return c;}
+ DeliveryClaim deadLetter(SpringDataPostgresConsumerGroupRepositoryImpl r){append();var c=one(r,request());assertThat(r.reject(c,FailureKind.EXPLICIT_DEAD_LETTER,Duration.ZERO).block(WAIT)).isEqualTo(TransitionResult.APPLIED);return c;}
Connection blocker(String sql){var c=Mono.from(pool.create()).block(WAIT);try{Mono.from(c.beginTransaction()).block(WAIT);Flux.from(c.createStatement(sql).execute()).concatMap(r->Flux.from(r.getRowsUpdated())).then().block(WAIT);return c;}catch(RuntimeException e){Mono.from(c.rollbackTransaction()).then(Mono.from(c.close())).block(WAIT);throw e;}}
void rollbackClose(Connection c,boolean committed){try{if(!committed)Mono.from(c.rollbackTransaction()).block(WAIT);}finally{Mono.from(c.close()).block(WAIT);}}
final class ObservedFactory implements ConnectionFactory {
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerNativeFixture.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerNativeFixture.java
index 08043516a..dbdbfcd86 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerNativeFixture.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerNativeFixture.java
@@ -23,7 +23,7 @@
import org.fireflyframework.eda.config.*;
import org.fireflyframework.eda.consumer.postgres.model.PostgresDeliveryRow;
import org.fireflyframework.eda.publisher.EventPublisherFactory;
-import org.fireflyframework.eda.publisher.postgres.PostgresEventPublisher;
+import org.fireflyframework.eda.publisher.postgres.PostgresEventPublisherImpl;
import org.fireflyframework.eda.serialization.MessageSerializer;
import org.reactivestreams.Publisher;
import org.springframework.beans.factory.support.AbstractBeanDefinition;
@@ -45,8 +45,8 @@
/** Explicit operator setup and actual configured resources, only inside an owned native test. */
public final class PostgresConsumerNativeFixture implements AutoCloseable {
public record NativeEvent(String value) { }
- public final PostgresEventConsumer consumer;
- public final PostgresEventPublisher publisher;
+ public final PostgresEventConsumerImpl consumer;
+ public final PostgresEventPublisherImpl publisher;
public final EventPublisherFactory publisherFactory;
public final Handler handler;
public final ConnectionPool queryPool;
@@ -58,7 +58,7 @@ public record NativeEvent(String value) { }
public final String destination;
private PostgresConsumerNativeFixture(AssertableApplicationContext context,ConnectionFactory inspection,String schema,
String destination,AtomicReference listen,AtomicInteger creates,boolean externalPool){
- consumer=context.getBean(PostgresEventConsumer.class);publisher=context.getBean(PostgresEventPublisher.class);publisherFactory=context.getBean(EventPublisherFactory.class);handler=context.getBean(Handler.class);
+ consumer=context.getBean(PostgresEventConsumerImpl.class);publisher=context.getBean(PostgresEventPublisherImpl.class);publisherFactory=context.getBean(EventPublisherFactory.class);handler=context.getBean(Handler.class);
queryPool=context.getBean("fireflyEdaPostgresConsumerQueryConnectionFactory",ConnectionPool.class);inspectionFactory=inspection;relation=SqlIdentifier.from(SqlIdentifier.quoted(schema),SqlIdentifier.quoted("firefly_eda_outbox"));this.destination=destination;recordedListen=listen;listenConnections=creates;this.externalPool=externalPool;
assertThat(consumer.isRunning()).isFalse();
}
@@ -82,10 +82,10 @@ public static void run(PostgreSQLContainer> postgres,boolean manual,boolean ob
}
try {
runner.run(context->{
- assertThat(context).hasNotFailed().hasSingleBean(PostgresEventConsumer.class).hasSingleBean(PostgresDeliveryRepository.class);
+ assertThat(context).hasNotFailed().hasSingleBean(PostgresEventConsumerImpl.class).hasSingleBean(PostgresDeliveryRepository.class);
// Explicit fixture/operator migration, never a runtime auto-install path.
Mono.usingWhen(raw.create(),c->Flux.from(c.createStatement(PostgresDeliverySchema.installationSql(schema,"firefly_eda_outbox")).execute()).concatMap(r->r.getRowsUpdated()).then(),Connection::close).block(Duration.ofSeconds(10));
- new org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresDeliveryRepository(
+ new org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresDeliveryRepositoryImpl(
raw,schema,"firefly_eda_outbox",Duration.ofSeconds(5)).verifyProtocol().block(Duration.ofSeconds(5));
try(var fixture=new PostgresConsumerNativeFixture(context,raw,schema,destination,listen,creates,observeListen)){action.accept(fixture);}
});
@@ -100,12 +100,12 @@ public static void run(PostgreSQLContainer> postgres,boolean manual,boolean ob
private static String quote(String value){return "\""+value.replace("\"","\"\"")+"\"";}
static class Dependencies {
@Bean ObjectMapper objectMapper(){return new ObjectMapper();}
- @Bean MessageSerializer messageSerializer(ObjectMapper mapper){return new org.fireflyframework.eda.serialization.JsonMessageSerializer(mapper);}
+ @Bean MessageSerializer messageSerializer(ObjectMapper mapper){return new org.fireflyframework.eda.serialization.JsonMessageSerializerImpl(mapper);}
@Bean org.fireflyframework.eda.error.CustomErrorHandlerRegistry customErrorHandlerRegistry(){return new org.fireflyframework.eda.error.CustomErrorHandlerRegistry();}
- @Bean org.fireflyframework.eda.listener.EventListenerProcessor eventListenerProcessor(org.springframework.context.ApplicationContext context,org.springframework.context.ApplicationEventPublisher publisher,org.fireflyframework.eda.error.CustomErrorHandlerRegistry registry,org.springframework.core.env.Environment environment){return new org.fireflyframework.eda.listener.EventListenerProcessor(context,publisher,registry,environment);}
+ @Bean org.fireflyframework.eda.listener.EventListenerProcessorImpl eventListenerProcessor(org.springframework.context.ApplicationContext context,org.springframework.context.ApplicationEventPublisher publisher,org.fireflyframework.eda.error.CustomErrorHandlerRegistry registry,org.springframework.core.env.Environment environment){return new org.fireflyframework.eda.listener.EventListenerProcessorImpl(context,publisher,registry,environment);}
@Bean EventPublisherFactory eventPublisherFactory(List publishers,org.fireflyframework.eda.properties.EdaProperties properties,org.springframework.beans.factory.ObjectProvider resilience){return new EventPublisherFactory(publishers,properties,resilience);}
- @Bean PostgresEventDecoder postgresEventDecoder(MessageSerializer serializer){return new org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoder(serializer,Map.of(NativeEvent.class.getName(),NativeEvent.class,String.class.getName(),String.class));}
+ @Bean PostgresEventDecoder postgresEventDecoder(MessageSerializer serializer){return new org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoderImpl(serializer,Map.of(NativeEvent.class.getName(),NativeEvent.class,String.class.getName(),String.class));}
@Bean Handler nativeHandler(){return new Handler();}
}
public static final class Handler {
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerRecoveryTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerRecoveryTest.java
index b726beb5b..4fbdced44 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerRecoveryTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerRecoveryTest.java
@@ -133,7 +133,7 @@ void stopReportsImmediateOwnedListenCloseFailure(boolean synchronousThrow){
}
@Test void legacyConstructorFailsBeforeAnyFactoryAccess(){
try(var f=new PostgresConsumerRuntimeTest.Fixture()){
- var old=new PostgresEventConsumer(f.provider,f.processor,mock(org.fireflyframework.eda.serialization.MessageSerializer.class),f.properties,new com.fasterxml.jackson.databind.ObjectMapper());
+ var old=new PostgresEventConsumerImpl(f.provider,f.processor,mock(org.fireflyframework.eda.serialization.MessageSerializer.class),f.properties,new com.fasterxml.jackson.databind.ObjectMapper());
StepVerifier.create(old.start()).expectErrorMessage("PostgreSQL delivery repository and registered decoder are required").verify();verifyNoInteractions(f.provider);verifyNoInteractions(f.factory);
}
}
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerRuntimeTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerRuntimeTest.java
index 725cb85dc..823cd59fd 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerRuntimeTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresConsumerRuntimeTest.java
@@ -21,7 +21,7 @@
import org.fireflyframework.eda.consumer.postgres.model.*;
import org.fireflyframework.eda.error.CustomErrorHandlerRegistry;
import org.fireflyframework.eda.event.EventEnvelope;
-import org.fireflyframework.eda.listener.EventListenerProcessor;
+import org.fireflyframework.eda.listener.EventListenerProcessorImpl;
import org.fireflyframework.eda.properties.EdaProperties;
import org.fireflyframework.eda.publisher.postgres.PostgresChannelMapper;
import org.fireflyframework.eda.serialization.MessageSerializer;
@@ -122,12 +122,12 @@ class PostgresConsumerRuntimeTest {
"firefly.eda.publishers.postgres.default.database=source_fixture","firefly.eda.publishers.postgres.default.username=source_fixture",
"firefly.eda.publishers.postgres.default.auto-create-schema=false")
.run(context->{
- assertThat(context).hasNotFailed().hasSingleBean(PostgresEventConsumer.class);
- assertThat(context.getBean(org.fireflyframework.eda.serialization.MessageSerializer.class)).isInstanceOf(org.fireflyframework.eda.serialization.JsonMessageSerializer.class);
- assertThat(context.getBean(EventListenerProcessor.class).getTopicsForConsumerType("POSTGRES")).containsExactly("native-source-events");
+ assertThat(context).hasNotFailed().hasSingleBean(PostgresEventConsumerImpl.class);
+ assertThat(context.getBean(org.fireflyframework.eda.serialization.MessageSerializer.class)).isInstanceOf(org.fireflyframework.eda.serialization.JsonMessageSerializerImpl.class);
+ assertThat(context.getBean(EventListenerProcessorImpl.class).getTopicsForConsumerType("POSTGRES")).containsExactly("native-source-events");
assertThat(context.getBean(PostgresConsumerNativeFixture.Handler.class).calls).hasValue(0);
assertThat(context.getBean("fireflyEdaPostgresConsumerQueryConnectionFactory",io.r2dbc.pool.ConnectionPool.class).getMetrics().orElseThrow().allocatedSize()).isZero();
- assertThat(context.getBean(PostgresEventConsumer.class).isRunning()).isFalse();
+ assertThat(context.getBean(PostgresEventConsumerImpl.class).isRunning()).isFalse();
});
}
static DeliveryClaim claim(long id) {
@@ -147,8 +147,8 @@ static final class RecordingRepository implements PostgresDeliveryRepository {
static final class Fixture implements AutoCloseable {
final EdaProperties properties=new EdaProperties();final RecordingRepository repo=new RecordingRepository();final VirtualTimeScheduler scheduler=VirtualTimeScheduler.create();
final ConnectionFactory factory=mock(ConnectionFactory.class);final PostgresqlConnection connection=mock(PostgresqlConnection.class);final Sinks.Many notifications=Sinks.many().multicast().directBestEffort();
- final EventListenerProcessor processor=new EventListenerProcessor(mock(ApplicationContext.class),mock(ApplicationEventPublisher.class),mock(CustomErrorHandlerRegistry.class),new MockEnvironment());
- final ObjectProvider provider;PostgresEventConsumer current;
+ final EventListenerProcessorImpl processor=new EventListenerProcessorImpl(mock(ApplicationContext.class),mock(ApplicationEventPublisher.class),mock(CustomErrorHandlerRegistry.class),new MockEnvironment());
+ final ObjectProvider provider;PostgresEventConsumerImpl current;
@SuppressWarnings("unchecked") Fixture(){
provider=mock(ObjectProvider.class);when(provider.getIfAvailable()).thenReturn(factory);properties.getConsumer().setEnabled(true);properties.getConsumer().getPostgres().get("default").setEnabled(true);
var statement=mock(io.r2dbc.postgresql.api.PostgresqlStatement.class);var result=mock(io.r2dbc.postgresql.api.PostgresqlResult.class);
@@ -156,7 +156,7 @@ static final class Fixture implements AutoCloseable {
doReturn(Flux.just(result)).when(statement).execute();doReturn(Mono.just(0L)).when(result).getRowsUpdated();when(connection.close()).thenReturn(Mono.empty());
}
void mode(EdaProperties.Consumer.PostgresConfig.DeliveryMode m){properties.getConsumer().getPostgres().get("default").setDeliveryMode(m);}
- PostgresEventConsumer consumer(){if(current==null)current=new PostgresEventConsumer(provider,processor,mock(MessageSerializer.class),properties,new ObjectMapper(),repo,(bytes,type,event)->"payload",scheduler);return current;}
+ PostgresEventConsumerImpl consumer(){if(current==null)current=new PostgresEventConsumerImpl(provider,processor,mock(MessageSerializer.class),properties,new ObjectMapper(),repo,(bytes,type,event)->"payload",scheduler);return current;}
void start(){StepVerifier.create(consumer().start()).verifyComplete();}
void tick(){scheduler.advanceTimeBy(Duration.ZERO);}
void awaitProcessed(int n){try{org.awaitility.Awaitility.await().atMost(Duration.ofSeconds(2)).until(()->repo.acknowledged==n);}catch(org.awaitility.core.ConditionTimeoutException e){throw new AssertionError("ACK="+repo.acknowledged+", claimed="+repo.claimed+", limits="+repo.limits+", rejected="+repo.rejected+", notificationSubscribers="+notifications.currentSubscriberCount()+", running="+consumer().isRunning());}}
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresDeliveryRepositoryIntegrationTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresDeliveryRepositoryIntegrationTest.java
index 87a6876f3..868a33289 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresDeliveryRepositoryIntegrationTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/PostgresDeliveryRepositoryIntegrationTest.java
@@ -21,9 +21,9 @@
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicInteger;
-import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresDeliveryRepository;
+import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresDeliveryRepositoryImpl;
import org.fireflyframework.eda.consumer.postgres.model.*;
-import org.fireflyframework.eda.publisher.postgres.impl.SpringDataPostgresOutboxWriter;
+import org.fireflyframework.eda.publisher.postgres.impl.SpringDataPostgresOutboxWriterImpl;
import org.fireflyframework.eda.publisher.postgres.model.PostgresOutboxAppend;
import org.junit.jupiter.api.*;
import org.junit.jupiter.params.ParameterizedTest;
@@ -88,16 +88,16 @@ private Mono rollbackFailedInstallation(Connection connection) {
.concatMap(result -> Mono.from(result.getRowsUpdated())).then(),
held -> Mono.defer(() -> Mono.from(held.close())));
}
- private SpringDataPostgresDeliveryRepository repository(ConnectionFactory factory) {
- return new SpringDataPostgresDeliveryRepository(factory, schema, table, Duration.ofSeconds(10));
+ private SpringDataPostgresDeliveryRepositoryImpl repository(ConnectionFactory factory) {
+ return new SpringDataPostgresDeliveryRepositoryImpl(factory, schema, table, Duration.ofSeconds(10));
}
- private SpringDataPostgresDeliveryRepository ready() {
+ private SpringDataPostgresDeliveryRepositoryImpl ready() {
install(); var repository = repository(pool); repository.verifyProtocol().block(WAIT); return repository;
}
private ClaimRequest request(int limit, int attempts, Duration lease) { return new ClaimRequest(Set.of("events"), limit, attempts, lease); }
private ClaimRequest request() { return request(8, 3, Duration.ofSeconds(5)); }
private long append(String channel) {
- new SpringDataPostgresOutboxWriter(new R2dbcEntityTemplate(database, PostgresDialect.INSTANCE))
+ new SpringDataPostgresOutboxWriterImpl(new R2dbcEntityTemplate(database, PostgresDialect.INSTANCE))
.append(schema, table, new PostgresOutboxAppend(null, "orders.created", channel, null, payload,
Json.of("{\"decimal\":12.3400}"), null, "POSTGRES", "default", "untrusted.MustNotInitialize")).block(WAIT);
return database.sql("SELECT max(id) AS id FROM " + qualified()).map((row, metadata) -> row.get("id", Long.class)).one().block(WAIT);
@@ -115,7 +115,7 @@ private void update(long id, String assignment) {
private OffsetDateTime clock() {
return database.sql("SELECT pg_catalog.clock_timestamp() AS now").map((row, metadata) -> row.get("now", OffsetDateTime.class)).one().block(WAIT);
}
- private DeliveryClaim one(SpringDataPostgresDeliveryRepository repository, ClaimRequest request) {
+ private DeliveryClaim one(SpringDataPostgresDeliveryRepositoryImpl repository, ClaimRequest request) {
var batch = repository.claim(request).block(WAIT); assertThat(batch.claims()).hasSize(1); return batch.claims().getFirst();
}
private void expire(DeliveryClaim claim) { update(claim.row().id(), "lease_until=pg_catalog.clock_timestamp()-INTERVAL '1 second'"); }
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/RegisteredPostgresEventDecoderTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/RegisteredPostgresEventDecoderTest.java
index a0dab3121..f27f43c22 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/RegisteredPostgresEventDecoderTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/RegisteredPostgresEventDecoderTest.java
@@ -4,8 +4,8 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import java.nio.charset.StandardCharsets;
import java.util.Map;
-import org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoder;
-import org.fireflyframework.eda.serialization.JsonMessageSerializer;
+import org.fireflyframework.eda.consumer.postgres.impl.RegisteredPostgresEventDecoderImpl;
+import org.fireflyframework.eda.serialization.JsonMessageSerializerImpl;
import org.fireflyframework.eda.serialization.MessageSerializer;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.*;
@@ -13,35 +13,35 @@
class RegisteredPostgresEventDecoderTest {
@Test void explicitClassTokenUsesGenuineSerializer(){
- var decoder=new RegisteredPostgresEventDecoder(new JsonMessageSerializer(new ObjectMapper()),Map.of("java.lang.String",String.class));
+ var decoder=new RegisteredPostgresEventDecoderImpl(new JsonMessageSerializerImpl(new ObjectMapper()),Map.of("java.lang.String",String.class));
assertThat(decoder.decode(bytes("payload"),"java.lang.String","String")).isEqualTo("payload");
}
@Test void explicitEventTypeAliasWorksOnlyWhenClassIsAbsent(){
- var decoder=new RegisteredPostgresEventDecoder(new JsonMessageSerializer(new ObjectMapper()),Map.of("event-map",Map.class));
+ var decoder=new RegisteredPostgresEventDecoderImpl(new JsonMessageSerializerImpl(new ObjectMapper()),Map.of("event-map",Map.class));
assertThat(decoder.decode(bytes("{\"value\":7}"),null,"event-map")).isEqualTo(Map.of("value",7));
assertThatThrownBy(()->decoder.decode(bytes("{}"),"not.registered.Class","event-map")).hasMessage("PostgreSQL event type is not registered");
}
@Test void unknownWireClassNeverCallsSerializerOrFallsBack(){
- var serializer=mock(MessageSerializer.class);var decoder=new RegisteredPostgresEventDecoder(serializer,Map.of("known",String.class));
+ var serializer=mock(MessageSerializer.class);var decoder=new RegisteredPostgresEventDecoderImpl(serializer,Map.of("known",String.class));
assertThatThrownBy(()->decoder.decode(bytes("payload"),"java.lang.Runtime","known")).isInstanceOf(IllegalArgumentException.class);verifyNoInteractions(serializer);
}
@Test void genericObjectRequiresAnExplicitEntry(){
- var serializer=new JsonMessageSerializer(new ObjectMapper());var restricted=new RegisteredPostgresEventDecoder(serializer,Map.of("known",String.class));
+ var serializer=new JsonMessageSerializerImpl(new ObjectMapper());var restricted=new RegisteredPostgresEventDecoderImpl(serializer,Map.of("known",String.class));
assertThatThrownBy(()->restricted.decode(bytes("{}"),"java.lang.Object",null)).isInstanceOf(IllegalArgumentException.class);
- var explicit=new RegisteredPostgresEventDecoder(serializer,Map.of("java.lang.Object",Object.class));assertThat(explicit.decode(bytes("{\"value\":7}"),"java.lang.Object",null)).isEqualTo(Map.of("value",7));
+ var explicit=new RegisteredPostgresEventDecoderImpl(serializer,Map.of("java.lang.Object",Object.class));assertThat(explicit.decode(bytes("{\"value\":7}"),"java.lang.Object",null)).isEqualTo(Map.of("value",7));
}
@Test void conflictingRegisteredClassAndTypeAreRefusedBeforeDecode(){
- var serializer=mock(MessageSerializer.class);var decoder=new RegisteredPostgresEventDecoder(serializer,Map.of("class",String.class,"type",Map.class));
+ var serializer=mock(MessageSerializer.class);var decoder=new RegisteredPostgresEventDecoderImpl(serializer,Map.of("class",String.class,"type",Map.class));
assertThatThrownBy(()->decoder.decode(bytes("{}"),"class","type")).hasMessage("PostgreSQL event type is ambiguous");verifyNoInteractions(serializer);
}
@Test void nullOrEmptyPayloadAndNullResultsCannotBecomeSuccess(){
- var serializer=mock(MessageSerializer.class);var decoder=new RegisteredPostgresEventDecoder(serializer,Map.of("known",String.class));
+ var serializer=mock(MessageSerializer.class);var decoder=new RegisteredPostgresEventDecoderImpl(serializer,Map.of("known",String.class));
assertThatThrownBy(()->decoder.decode(null,"known",null)).isInstanceOf(IllegalArgumentException.class);
assertThatThrownBy(()->decoder.decode(new byte[0],"known",null)).isInstanceOf(IllegalArgumentException.class);
assertThatThrownBy(()->decoder.decode(bytes("payload"),"known",null)).hasMessage("PostgreSQL event decoder returned no payload");
}
@Test void registryIsDetachedFromCallerMutation(){
- var allowed=new java.util.HashMap>();allowed.put("known",String.class);var decoder=new RegisteredPostgresEventDecoder(new JsonMessageSerializer(new ObjectMapper()),allowed);allowed.clear();
+ var allowed=new java.util.HashMap>();allowed.put("known",String.class);var decoder=new RegisteredPostgresEventDecoderImpl(new JsonMessageSerializerImpl(new ObjectMapper()),allowed);allowed.clear();
assertThat(decoder.decode(bytes("payload"),"known",null)).isEqualTo("payload");
}
private static byte[] bytes(String value){return value.getBytes(StandardCharsets.UTF_8);}
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/SpringDataPostgresConsumerGroupRepositoryTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/SpringDataPostgresConsumerGroupRepositoryTest.java
index d93972a47..43dc7c6c1 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/SpringDataPostgresConsumerGroupRepositoryTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/SpringDataPostgresConsumerGroupRepositoryTest.java
@@ -11,7 +11,7 @@
import java.util.concurrent.atomic.*;
import java.util.function.BiFunction;
import java.util.stream.Stream;
-import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresConsumerGroupRepository;
+import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresConsumerGroupRepositoryImpl;
import org.fireflyframework.eda.consumer.postgres.model.*;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
@@ -32,8 +32,8 @@ class SpringDataPostgresConsumerGroupRepositoryTest {
doReturn(Mono.defer(()->Mono.just(sessions.get(acquired.getAndIncrement()).connection))).when(factory).create();
}
ConsumerGroupTables tables(){return new ConsumerGroupTables("scope\"schema","outbox","registry","deliveries","journal");}
- SpringDataPostgresConsumerGroupRepository repository(){return repository("group-A");}
- SpringDataPostgresConsumerGroupRepository repository(String group){return new SpringDataPostgresConsumerGroupRepository(factory,tables(),new ConsumerGroupId(group),Duration.ofSeconds(10));}
+ SpringDataPostgresConsumerGroupRepositoryImpl repository(){return repository("group-A");}
+ SpringDataPostgresConsumerGroupRepositoryImpl repository(String group){return new SpringDataPostgresConsumerGroupRepositoryImpl(factory,tables(),new ConsumerGroupId(group),Duration.ofSeconds(10));}
GroupSubscription subscription(){return new GroupSubscription(Set.of("events"),3);}
ClaimRequest request(){return new ClaimRequest(Set.of("events"),4,3,Duration.ofSeconds(20));}
DeliveryClaim claim(){return new DeliveryClaim(new PostgresDeliveryRow(11L,"orders.created","events",null,new byte[]{0,1,(byte)255},Json.of("{\"a\":12.3400}"),null,"POSTGRES","default","untrusted.MustNotLoad","IN_FLIGHT",1,null,NOW,null,null,TOKEN,1,NOW.plusSeconds(20),null),7);}
@@ -231,7 +231,7 @@ void groupAdapterRejectsActualScopedProvidersBeforeTargetResolutionOrAcquisition
ConnectionFactory scoped=(ConnectionFactory)proxyFactory.getObject();
assertThat(scoped).isInstanceOf(org.springframework.aop.scope.ScopedObject.class);
ConnectionFactory supplied=provider.equals("alias")?new GroupInfrastructureAlias(scoped):scoped;
- assertThatThrownBy(()->new SpringDataPostgresConsumerGroupRepository(supplied,tables(),new ConsumerGroupId("group-A"),Duration.ofSeconds(10)))
+ assertThatThrownBy(()->new SpringDataPostgresConsumerGroupRepositoryImpl(supplied,tables(),new ConsumerGroupId("group-A"),Duration.ofSeconds(10)))
.isInstanceOf(IllegalArgumentException.class);
assertThat(resolutions.get()).isZero();assertThat(acquired.get()).isZero();
}
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/SpringDataPostgresDeliveryRepositoryTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/SpringDataPostgresDeliveryRepositoryTest.java
index 36051fab5..176f07a6a 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/SpringDataPostgresDeliveryRepositoryTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/SpringDataPostgresDeliveryRepositoryTest.java
@@ -18,7 +18,7 @@
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BiFunction;
import java.util.stream.Stream;
-import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresDeliveryRepository;
+import org.fireflyframework.eda.consumer.postgres.impl.SpringDataPostgresDeliveryRepositoryImpl;
import org.fireflyframework.eda.consumer.postgres.model.*;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
@@ -45,8 +45,8 @@ class SpringDataPostgresDeliveryRepositoryTest {
}
Session session() { var session = new Session(); sessions.add(session); return session; }
- SpringDataPostgresDeliveryRepository repository() {
- return new SpringDataPostgresDeliveryRepository(factory, "custom\"schema", "custom\"outbox", Duration.ofSeconds(10));
+ SpringDataPostgresDeliveryRepositoryImpl repository() {
+ return new SpringDataPostgresDeliveryRepositoryImpl(factory, "custom\"schema", "custom\"outbox", Duration.ofSeconds(10));
}
ClaimRequest request() { return new ClaimRequest(Set.of("events"), 4, 3, Duration.ofSeconds(20)); }
PostgresDeliveryRow row() {
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundaryTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundaryTest.java
index 49249e5a1..dc06af83e 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundaryTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundaryTest.java
@@ -41,7 +41,7 @@ class DeliveryTransactionBoundaryTest {
doReturn(Mono.defer(()->Mono.just(sessions.get(acquired.getAndIncrement()).connection))).when(factory).create();
}
Session session() {var session=new Session();sessions.add(session);return session;}
- DeliveryTransactionBoundary boundary(ConnectionFactory provided) {return new DeliveryTransactionBoundary(provided,Duration.ofSeconds(10));}
+ DeliveryTransactionBoundaryImpl boundary(ConnectionFactory provided) {return new DeliveryTransactionBoundaryImpl(provided,Duration.ofSeconds(10));}
Mono query(ConnectionFactory provided) {
var template=new R2dbcEntityTemplate(DatabaseClient.builder().connectionFactory(provided)
.bindMarkers(PostgresDialect.INSTANCE.getBindMarkersFactory()).build(),PostgresDialect.INSTANCE);
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapperTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapperTest.java
index e652ed1c5..15a5a9a03 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapperTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapperTest.java
@@ -16,20 +16,20 @@ class PostgresEnvelopeMapperTest {
@Test void ordinaryJsonScalarTypesRetainTheExistingMapContract()throws Exception{
String json="{\"small\":7,\"large\":4294967296,\"decimal\":1.25,\"nil\":null,\"flag\":true}";var mapper=new ObjectMapper();
Map expected=mapper.readValue(json,new TypeReference<>(){});
- var envelope=new PostgresEnvelopeMapper(mapper).map(claim(Json.of(json)),"payload",null);
+ var envelope=new PostgresEnvelopeMapperImpl(mapper).map(claim(Json.of(json)),"payload",null);
assertThat(envelope.headers()).isEqualTo(expected);assertThat(envelope.headers().get("small")).isInstanceOf(Integer.class);assertThat(envelope.headers().get("large")).isInstanceOf(Long.class);assertThat(envelope.headers().get("decimal")).isInstanceOf(Double.class);
}
@Test void nestedHeaderContainersAreDetachedAndReadonly()throws Exception{
- var envelope=new PostgresEnvelopeMapper(new ObjectMapper()).map(claim(Json.of("{\"nested\":{\"items\":[null,\"value\"]}}")),"payload",null);
+ var envelope=new PostgresEnvelopeMapperImpl(new ObjectMapper()).map(claim(Json.of("{\"nested\":{\"items\":[null,\"value\"]}}")),"payload",null);
assertThatThrownBy(()->envelope.headers().put("extra","value")).isInstanceOf(UnsupportedOperationException.class);
var nested=(Map,?>)envelope.headers().get("nested");assertThatThrownBy(()->nested.clear()).isInstanceOf(UnsupportedOperationException.class);var list=(java.util.List>)nested.get("items");assertThatThrownBy(()->list.clear()).isInstanceOf(UnsupportedOperationException.class);
}
@Test void headerClassAndRoutingStringsCannotOverrideTheTrustedEnvelope()throws Exception{
- var e=new PostgresEnvelopeMapper(new ObjectMapper()).map(claim(Json.of("{\"event_class\":\"java.lang.Runtime\",\"consumer_type\":\"KAFKA\",\"connection_id\":\"foreign\",\"destination\":\"other\"}")),"payload",null);
+ var e=new PostgresEnvelopeMapperImpl(new ObjectMapper()).map(claim(Json.of("{\"event_class\":\"java.lang.Runtime\",\"consumer_type\":\"KAFKA\",\"connection_id\":\"foreign\",\"destination\":\"other\"}")),"payload",null);
assertThat(e.consumerType()).isEqualTo("POSTGRES");assertThat(e.connectionId()).isEqualTo("default");assertThat(e.destination()).isEqualTo("events");assertThat(e.headers().get("event_class")).isEqualTo("java.lang.Runtime");
}
@Test void sqlNullHeadersAreEmptyAndOtherJsonShapesRefuse(){
- var mapper=new PostgresEnvelopeMapper(new ObjectMapper());assertThatCode(()->assertThat(mapper.map(claim(null),"payload",null).headers()).isEmpty()).doesNotThrowAnyException();
+ var mapper=new PostgresEnvelopeMapperImpl(new ObjectMapper());assertThatCode(()->assertThat(mapper.map(claim(null),"payload",null).headers()).isEmpty()).doesNotThrowAnyException();
for(String json:new String[]{"null","[]","7"})assertThatThrownBy(()->mapper.map(claim(Json.of(json)),"payload",null)).isInstanceOf(IllegalArgumentException.class);
}
private static DeliveryClaim claim(Json headers){var now=OffsetDateTime.parse("2026-10-30T00:00:00Z");return new DeliveryClaim(new PostgresDeliveryRow(1L,"events","channel","String",new byte[]{1},headers,null,"POSTGRES","publisher-connection","java.lang.String","IN_FLIGHT",1,null,now,null,null,UUID.randomUUID(),1,now.plusSeconds(30),null),3);}
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/publisher/postgres/PostgresPublisherTransactionIntegrationTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/publisher/postgres/PostgresPublisherTransactionIntegrationTest.java
index 971378fb7..81eadb8a0 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/publisher/postgres/PostgresPublisherTransactionIntegrationTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/publisher/postgres/PostgresPublisherTransactionIntegrationTest.java
@@ -12,7 +12,7 @@
import io.r2dbc.spi.ConnectionFactoryMetadata;
import org.fireflyframework.eda.config.FireflyEdaPostgresPublisherAutoConfiguration;
import org.fireflyframework.eda.properties.EdaProperties;
-import org.fireflyframework.eda.serialization.JsonMessageSerializer;
+import org.fireflyframework.eda.serialization.JsonMessageSerializerImpl;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
@@ -90,11 +90,11 @@ private static EdaProperties properties() {
return properties;
}
- private static PostgresEventPublisher publisher(ConnectionFactory factory, EdaProperties properties) {
+ private static PostgresEventPublisherImpl publisher(ConnectionFactory factory, EdaProperties properties) {
var beans = new StaticListableBeanFactory();
beans.addBean("fireflyEdaPostgresPublisherConnectionFactory", factory);
- return new PostgresEventPublisher(beans.getBeanProvider(ConnectionFactory.class),
- new JsonMessageSerializer(mapper), properties, mapper);
+ return new PostgresEventPublisherImpl(beans.getBeanProvider(ConnectionFactory.class),
+ new JsonMessageSerializerImpl(mapper), properties, mapper);
}
@Test
@@ -103,8 +103,8 @@ void autoConfigurationActuallyContributesItsPublisher() {
.withConfiguration(AutoConfigurations.of(FireflyEdaPostgresPublisherAutoConfiguration.class))
.withBean("fireflyEdaPostgresPublisherConnectionFactory", ConnectionFactory.class, () -> pool)
.withBean(ObjectMapper.class, () -> mapper)
- .withBean(JsonMessageSerializer.class, () -> new JsonMessageSerializer(mapper))
- .run(context -> assertThat(context).hasSingleBean(PostgresEventPublisher.class));
+ .withBean(JsonMessageSerializerImpl.class, () -> new JsonMessageSerializerImpl(mapper))
+ .run(context -> assertThat(context).hasSingleBean(PostgresEventPublisherImpl.class));
}
@Test
@@ -113,7 +113,7 @@ void actualAutoConfiguredPoolAndPublisherAppendWithoutComponentScanning() {
new ApplicationContextRunner()
.withConfiguration(AutoConfigurations.of(FireflyEdaPostgresPublisherAutoConfiguration.class))
.withBean(ObjectMapper.class, () -> mapper)
- .withBean(JsonMessageSerializer.class, () -> new JsonMessageSerializer(mapper))
+ .withBean(JsonMessageSerializerImpl.class, () -> new JsonMessageSerializerImpl(mapper))
.withPropertyValues("firefly.eda.publishers.enabled=true",
"firefly.eda.publishers.postgres.default.enabled=true",
"firefly.eda.publishers.postgres.default.auto-create-schema=false",
@@ -123,8 +123,8 @@ void actualAutoConfiguredPoolAndPublisherAppendWithoutComponentScanning() {
"firefly.eda.publishers.postgres.default.username=" + postgres.getUsername(),
"firefly.eda.publishers.postgres.default.password=" + postgres.getPassword())
.run(context -> {
- assertThat(context).hasSingleBean(PostgresEventPublisher.class);
- context.getBean(PostgresEventPublisher.class).publish("configured payload", destination).block(WAIT);
+ assertThat(context).hasSingleBean(PostgresEventPublisherImpl.class);
+ context.getBean(PostgresEventPublisherImpl.class).publish("configured payload", destination).block(WAIT);
assertThat(outboxCount(destination)).isEqualTo(1L);
});
}
diff --git a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/publisher/postgres/SpringDataPostgresOutboxWriterTest.java b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/publisher/postgres/SpringDataPostgresOutboxWriterTest.java
index 24903069d..982993b45 100644
--- a/modules/eda-postgres/src/test/java/org/fireflyframework/eda/publisher/postgres/SpringDataPostgresOutboxWriterTest.java
+++ b/modules/eda-postgres/src/test/java/org/fireflyframework/eda/publisher/postgres/SpringDataPostgresOutboxWriterTest.java
@@ -6,7 +6,7 @@
package org.fireflyframework.eda.publisher.postgres;
import io.r2dbc.postgresql.codec.Json;
-import org.fireflyframework.eda.publisher.postgres.impl.SpringDataPostgresOutboxWriter;
+import org.fireflyframework.eda.publisher.postgres.impl.SpringDataPostgresOutboxWriterImpl;
import org.fireflyframework.eda.publisher.postgres.model.PostgresOutboxAppend;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
@@ -40,7 +40,7 @@ class SpringDataPostgresOutboxWriterTest {
private String sql;
@SuppressWarnings("unchecked")
- private SpringDataPostgresOutboxWriter writer(Mono count) {
+ private SpringDataPostgresOutboxWriterImpl writer(Mono count) {
FetchSpec