From f8607f777941fa41f3c628e067490b8cee106a43 Mon Sep 17 00:00:00 2001 From: Andres Contreras Date: Sat, 31 Oct 2026 21:43:28 -0700 Subject: [PATCH 1/2] Name concrete implementations consistently and preserve their registrations --- .../examples/onboarding-event-store/README.md | 2 +- .../onboarding/OnboardingEventStoreTest.java | 6 +- docs/immutable-local-audit.md | 4 +- docs/migration/source-path-renames.json | 273 ++++++++++++++++ docs/site/architecture.md | 2 +- docs/site/capabilities/domain-and-data.md | 2 +- docs/site/guides/onboarding-event-store.md | 4 +- .../modules/agentic-bridge-autoconfigure.md | 4 +- docs/site/modules/cache-hazelcast.md | 8 +- docs/site/modules/cache-jcache.md | 12 +- docs/site/modules/cache-postgres.md | 18 +- docs/site/modules/cache-redis.md | 6 +- docs/site/modules/cache.md | 18 +- docs/site/modules/client.md | 2 +- docs/site/modules/cqrs.md | 2 +- .../site/modules/ecm-esignature-adobe-sign.md | 16 +- docs/site/modules/ecm-esignature-docusign.md | 16 +- docs/site/modules/ecm-esignature-logalty.md | 14 +- docs/site/modules/ecm-storage-aws.md | 10 +- docs/site/modules/ecm-storage-azure.md | 14 +- docs/site/modules/ecm.md | 18 +- docs/site/modules/eda-kafka.md | 22 +- docs/site/modules/eda-postgres.md | 10 +- docs/site/modules/eda-rabbitmq.md | 12 +- docs/site/modules/eda.md | 18 +- docs/site/modules/notifications-core.md | 2 +- docs/site/modules/notifications-firebase.md | 6 +- docs/site/modules/notifications-resend.md | 12 +- docs/site/modules/notifications-sendgrid.md | 14 +- docs/site/modules/notifications-twilio.md | 12 +- docs/site/modules/notifications.md | 10 +- docs/site/modules/observability.md | 6 +- docs/site/modules/plugin-core.md | 10 +- docs/site/modules/plugins.md | 6 +- docs/site/modules/r2dbc.md | 20 +- docs/site/modules/rule-engine.md | 2 +- docs/site/modules/security-adapter-cerbos.md | 8 +- docs/site/modules/security-adapter-opa.md | 22 +- docs/site/modules/security-adapter-openfga.md | 10 +- docs/site/modules/security-adapter-r2dbc.md | 14 +- docs/site/modules/security-adapter-vault.md | 8 +- .../modules/security-authorization-server.md | 6 +- docs/site/modules/security-bff.md | 4 +- docs/site/modules/security-core.md | 30 +- docs/site/modules/security-idp-aws-cognito.md | 6 +- docs/site/modules/security-idp-azure-ad.md | 8 +- docs/site/modules/security-idp-internal-db.md | 6 +- docs/site/modules/security-idp.md | 10 +- docs/site/modules/security-method-policy.md | 10 +- docs/site/modules/security-resource-server.md | 24 +- docs/site/modules/security-spi.md | 2 +- docs/site/modules/security-test.md | 20 +- docs/site/modules/security-webflux.md | 28 +- docs/site/modules/starter-core.md | 2 +- docs/site/modules/validators.md | 10 +- docs/site/modules/web-idempotency.md | 2 +- docs/site/modules/web.md | 2 +- docs/site/modules/webhooks-core.md | 2 +- docs/site/modules/webhooks-processor.md | 2 +- docs/site/modules/webhooks-web.md | 2 +- .../2026-10-30-http-logging-streaming.md | 2 +- modules/agentic-bridge/docs/ARCHITECTURE.md | 4 +- .../README.md | 4 +- .../AgenticBridgeAutoConfiguration.java | 4 +- .../autoconfigure/AgenticBridgeFactory.java | 12 +- .../AgenticBridgeHealthAutoConfiguration.java | 4 +- ... => AgenticBridgeHealthIndicatorImpl.java} | 4 +- .../agentic/bridge/AgenticClientBuilder.java | 4 +- .../{ApiKeyAuth.java => ApiKeyAuthImpl.java} | 6 +- .../agentic/bridge/auth/AuthStrategy.java | 14 +- ...okenAuth.java => BearerTokenAuthImpl.java} | 4 +- ...positeAuth.java => CompositeAuthImpl.java} | 4 +- .../auth/{NoAuth.java => NoAuthImpl.java} | 6 +- ...dge.java => DefaultAgenticBridgeImpl.java} | 4 +- ...ent.java => DefaultAgenticClientImpl.java} | 14 +- ....java => RestConversationManagerImpl.java} | 4 +- ...va => KafkaQueueAgenticPublisherImpl.java} | 6 +- ...=> RabbitMqQueueAgenticPublisherImpl.java} | 6 +- ...va => RedisQueueAgenticPublisherImpl.java} | 4 +- ...ort.java => RestAgenticTransportImpl.java} | 4 +- ...ava => WebSocketAgenticTransportImpl.java} | 4 +- ...DefaultBackofficeContextResolverImpl.java} | 4 +- .../jdbc/OwnedRunBoundaryDatabaseTest.java | 4 +- modules/cache-hazelcast/README.md | 4 +- .../cache/factory/HazelcastCacheHelper.java | 6 +- ...ovider.java => HazelcastProviderImpl.java} | 2 +- ...lyframework.cache.spi.CacheProviderFactory | 2 +- .../HazelcastProviderWiringTest.java | 2 +- modules/cache-jcache/README.md | 6 +- .../cache/factory/JCacheCacheHelper.java | 6 +- ...eProvider.java => JCacheProviderImpl.java} | 2 +- ...lyframework.cache.spi.CacheProviderFactory | 2 +- .../providers/JCacheProviderWiringTest.java | 4 +- modules/cache-postgres/README.md | 12 +- ...ter.java => PostgresCacheAdapterImpl.java} | 10 +- .../PostgresCacheAutoConfiguration.java | 14 +- .../cache/factory/PostgresCacheHelper.java | 8 +- ...rovider.java => PostgresProviderImpl.java} | 2 +- ...lyframework.cache.spi.CacheProviderFactory | 2 +- .../PostgresCacheAdapterIntegrationTest.java | 22 +- .../PostgresCacheAdapterLoggingTest.java | 6 +- .../postgres/PostgresCacheNamespaceTest.java | 8 +- .../postgres/PostgresCacheProtocolTest.java | 8 +- .../PostgresCacheServiceIdentityTest.java | 14 +- .../PostgresPrimaryOnlyPolicyTest.java | 8 +- ...esCacheAutoConfigurationIsolationTest.java | 6 +- .../PostgresCacheNamespaceBindingTest.java | 4 +- .../factory/PostgresCacheStartupTest.java | 10 +- .../PostgresPrimaryOnlyWiringTest.java | 2 +- .../cache/spi/PostgresProviderWiringTest.java | 6 +- modules/cache-redis/README.md | 4 +- ...dapter.java => RedisCacheAdapterImpl.java} | 4 +- .../cache/factory/RedisCacheHelper.java | 8 +- ...isProvider.java => RedisProviderImpl.java} | 2 +- ...lyframework.cache.spi.CacheProviderFactory | 2 +- .../RedisCacheAdapterIntegrationTest.java | 10 +- .../redis/RedisCacheAdapterLoggingTest.java | 6 +- ...AutoConfigurationRedisIntegrationTest.java | 18 +- modules/cache/README.md | 14 +- modules/cache/docs/API_REFERENCE.md | 16 +- modules/cache/docs/ARCHITECTURE.md | 66 ++-- modules/cache/docs/AUTO_CONFIGURATION.md | 14 +- modules/cache/docs/EXAMPLES.md | 22 +- modules/cache/docs/MONITORING.md | 12 +- modules/cache/docs/OPTIONAL_DEPENDENCIES.md | 2 +- modules/cache/docs/PRIMARY_ONLY_OPERATIONS.md | 2 +- modules/cache/docs/QUICKSTART.md | 6 +- modules/cache/docs/README.md | 2 +- modules/cache/docs/TESTING.md | 30 +- ...ter.java => CaffeineCacheAdapterImpl.java} | 4 +- ...dapter.java => SmartCacheAdapterImpl.java} | 4 +- .../cache/config/CacheAutoConfiguration.java | 10 +- .../cache/factory/CacheManagerFactory.java | 22 +- ...va => AutoCacheSelectionStrategyImpl.java} | 2 +- ...ager.java => FireflyCacheManagerImpl.java} | 8 +- ...tor.java => CacheHealthIndicatorImpl.java} | 4 +- ...acheMetrics.java => CacheMetricsImpl.java} | 4 +- .../CacheObservabilityAutoConfiguration.java | 12 +- ...izer.java => JsonCacheSerializerImpl.java} | 4 +- .../cache/spi/CacheProviderFactory.java | 2 +- ...rovider.java => CaffeineProviderImpl.java} | 6 +- ...lyframework.cache.spi.CacheProviderFactory | 2 +- .../CaffeineCacheAdapterLoggingTest.java | 4 +- .../caffeine/CaffeineCacheAdapterTest.java | 4 +- .../adapter/smart/SmartCacheAdapterTest.java | 10 +- ...eAutoConfigurationCaffeineDefaultTest.java | 16 +- ...AutoConfigurationExplicitCaffeineTest.java | 16 +- ...eAutoConfigurationPostgresDefaultTest.java | 6 +- .../factory/PrimaryOnlyCacheFactoryTest.java | 4 +- .../PrimaryOnlyServiceDiscoveryTest.java | 4 +- .../FireflyCacheManagerLoggingTest.java | 8 +- .../manager/FireflyCacheManagerTest.java | 12 +- ...LegacyCacheOperationCompatibilityTest.java | 2 +- .../manager/PrimaryOnlyCacheManagerTest.java | 10 +- .../JsonCacheSerializerLoggingTest.java | 8 +- .../web/CallbackManagementEndToEndTest.java | 4 +- .../callbacks/web/SpringContextTest.java | 4 +- .../CallbackEndToEndIntegrationTest.java | 4 +- modules/client/docs/ADVANCED_FEATURES.md | 4 +- modules/client/docs/OBSERVABILITY.md | 8 +- ...tor.java => HttpCacheInterceptorImpl.java} | 4 +- ...a => ChaosEngineeringInterceptorImpl.java} | 4 +- .../ServiceClientAutoConfiguration.java | 6 +- ... => ConsulServiceDiscoveryClientImpl.java} | 4 +- ... => EurekaServiceDiscoveryClientImpl.java} | 4 +- ...KubernetesServiceDiscoveryClientImpl.java} | 4 +- .../discovery/ServiceDiscoveryClient.java | 8 +- ... => StaticServiceDiscoveryClientImpl.java} | 4 +- .../client/dynamic/DynamicClassGenerator.java | 10 +- ... => ServiceClientHealthIndicatorImpl.java} | 6 +- .../client/impl/RestServiceClientImpl.java | 24 +- .../client/impl/SoapServiceClientImpl.java | 6 +- ...eptor.java => LoggingInterceptorImpl.java} | 8 +- ...eptor.java => MetricsInterceptorImpl.java} | 6 +- .../loadbalancer/LoadBalancerStrategy.java | 18 +- ...a => PerformanceMetricsCollectorImpl.java} | 4 +- ...ics.java => ServiceClientMetricsImpl.java} | 4 +- .../resilience/AdvancedResilienceManager.java | 6 +- .../ChaosEngineeringInterceptorTest.java | 18 +- .../discovery/ServiceDiscoveryClientTest.java | 8 +- .../AdvancedServiceClientTest.java | 14 +- .../LoadBalancerStrategyTest.java | 16 +- modules/cqrs/MIGRATION_GUIDE.md | 8 +- modules/cqrs/docs/ARCHITECTURE.md | 28 +- modules/cqrs/docs/CONFIGURATION.md | 2 +- modules/cqrs/docs/DEVELOPER_GUIDE.md | 8 +- .../endpoint/CqrsMetricsEndpoint.java | 12 +- ...ator.java => CqrsHealthIndicatorImpl.java} | 16 +- ...ics.java => AuthorizationMetricsImpl.java} | 6 +- .../authorization/AuthorizationService.java | 4 +- .../cqrs/cache/QueryCacheAdapter.java | 4 +- ...ce.java => CommandMetricsServiceImpl.java} | 6 +- ...andBus.java => DefaultCommandBusImpl.java} | 10 +- .../config/CqrsActuatorAutoConfiguration.java | 12 +- .../cqrs/config/CqrsAutoConfiguration.java | 24 +- .../cqrs/config/CqrsEdaAutoConfiguration.java | 4 +- ....java => DefaultExecutionContextImpl.java} | 30 +- .../cqrs/context/ExecutionContext.java | 4 +- ...java => EdaCommandEventPublisherImpl.java} | 4 +- .../cqrs/fluent/CommandBuilder.java | 16 +- ...QueryBus.java => DefaultQueryBusImpl.java} | 6 +- .../cqrs/CqrsFrameworkIntegrationTest.java | 10 +- .../actuator/CqrsActuatorIntegrationTest.java | 4 +- .../AuthorizationIntegrationTest.java | 10 +- .../cqrs/cache/QueryCacheAdapterTest.java | 4 +- .../cqrs/command/CommandBusTest.java | 8 +- .../ExecutionContextIntegrationTest.java | 10 +- .../integration/CqrsCacheIntegrationTest.java | 10 +- .../integration/QueryCacheIsolationTest.java | 4 +- .../cqrs/query/QueryBusTest.java | 6 +- modules/ecm-esignature-adobe-sign/README.md | 6 +- .../adobesign/AdobeSignAutoConfiguration.java | 4 +- ...dobeSignSignatureEnvelopeAdapterImpl.java} | 4 +- .../adobesign/AdobeSignAdapterTest.java | 4 +- modules/ecm-esignature-docusign/README.md | 2 +- .../DocuSignAdapterAutoConfiguration.java | 4 +- ...DocuSignSignatureEnvelopeAdapterImpl.java} | 14 +- ...ava => JwtDocuSignAuthenticationImpl.java} | 8 +- ...java => ManagedDocuSignApiClientImpl.java} | 22 +- .../docusign/CancelledSdkCallTest.java | 4 +- .../docusign/DocuSignAccountBindingTest.java | 14 +- .../adapter/docusign/DocuSignAdapterTest.java | 4 +- .../DocuSignAuthenticationContractTest.java | 2 +- .../DocuSignAuthenticationLifecycleTest.java | 64 ++-- .../DocuSignCancellationIsolationTest.java | 6 +- .../docusign/DocuSignEnvelopeMappingTest.java | 4 +- .../DocuSignEnvelopeOperationsTest.java | 6 +- .../DocuSignImmutableContentTest.java | 8 +- .../docusign/DocuSignImmutableIntentTest.java | 6 +- .../IndependentAuthCancellationProbe.java | 4 +- .../IndependentAuthCloseDeadlineProbe.java | 8 +- .../IndependentClientBuildCloseProbe.java | 4 +- modules/ecm-esignature-logalty/README.md | 4 +- .../LogaltyAdapterAutoConfiguration.java | 4 +- ... LogaltySignatureEnvelopeAdapterImpl.java} | 4 +- modules/ecm-storage-aws/README.md | 6 +- .../s3/S3AdapterAutoConfiguration.java | 2 +- ...java => S3DocumentContentAdapterImpl.java} | 6 +- .../s3/S3AdapterAutoConfigurationTest.java | 4 +- .../s3/S3DocumentContentAdapterTest.java | 4 +- .../ecm/adapter/s3/S3PresignTest.java | 6 +- modules/ecm-storage-azure/README.md | 4 +- ... AzureBlobDocumentContentAdapterImpl.java} | 6 +- .../azureblob/AzureBlobAdapterTest.java | 4 +- modules/ecm/README.md | 6 +- .../ecm/docs/adapters/s3-integration-guide.md | 2 +- modules/ecm/docs/idp/README.md | 2 +- modules/ecm/docs/testing.md | 8 +- ...va => LocalDocumentSearchAdapterImpl.java} | 2 +- ...r.java => LocalPermissionAdapterImpl.java} | 2 +- .../ecm/adapter/noop/NoOpAdapterFactory.java | 34 +- ...apter.java => NoOpGenericAdapterImpl.java} | 4 +- .../ecm/config/EcmAutoConfiguration.java | 12 +- .../{EcmMetrics.java => EcmMetricsImpl.java} | 4 +- .../EcmObservabilityAutoConfiguration.java | 4 +- .../adapter/noop/NoOpAdapterLoggingTest.java | 12 +- modules/eda-kafka/README.md | 6 +- ...EdaKafkaEnvironmentPostProcessorImpl.java} | 2 +- ...sumer.java => KafkaEventConsumerImpl.java} | 16 +- ...sher.java => KafkaEventPublisherImpl.java} | 6 +- .../main/resources/META-INF/spring.factories | 2 +- .../eda/integration/KafkaIntegrationTest.java | 4 +- .../KafkaConsumerIntegrationTest.java | 4 +- modules/eda-postgres/README.md | 16 +- ...yEdaPostgresConsumerAutoConfiguration.java | 28 +- ...EdaPostgresPublisherAutoConfiguration.java | 10 +- ...er.java => PostgresEventConsumerImpl.java} | 18 +- ...a => DeliveryTransactionBoundaryImpl.java} | 16 +- ...ava => PostgresConsumerQueryPoolImpl.java} | 4 +- ....java => PostgresDeliveryRuntimeImpl.java} | 24 +- ...r.java => PostgresEnvelopeMapperImpl.java} | 4 +- ...> RegisteredPostgresEventDecoderImpl.java} | 4 +- ...aPostgresConsumerGroupRepositoryImpl.java} | 8 +- ...ngDataPostgresDeliveryRepositoryImpl.java} | 8 +- ...r.java => PostgresEventPublisherImpl.java} | 8 +- ...> SpringDataPostgresOutboxWriterImpl.java} | 4 +- .../config/EdaPostgresCoreIsolationTest.java | 10 +- ...PostgresConsumerAutoConfigurationTest.java | 18 +- .../PostgresConsumerGroupSelectionTest.java | 22 +- ...stgresConsumerGroupContextMappingTest.java | 18 +- .../PostgresConsumerGroupNativeFixture.java | 8 +- .../PostgresConsumerGroupReadinessTest.java | 6 +- ...onsumerGroupRepositoryIntegrationTest.java | 12 +- .../PostgresConsumerNativeFixture.java | 18 +- .../PostgresConsumerRecoveryTest.java | 2 +- .../postgres/PostgresConsumerRuntimeTest.java | 16 +- ...gresDeliveryRepositoryIntegrationTest.java | 14 +- .../RegisteredPostgresEventDecoderTest.java | 20 +- ...taPostgresConsumerGroupRepositoryTest.java | 8 +- ...ingDataPostgresDeliveryRepositoryTest.java | 6 +- .../impl/DeliveryTransactionBoundaryTest.java | 2 +- .../impl/PostgresEnvelopeMapperTest.java | 8 +- ...esPublisherTransactionIntegrationTest.java | 18 +- .../SpringDataPostgresOutboxWriterTest.java | 6 +- modules/eda-rabbitmq/README.md | 4 +- ...yEdaRabbitMqConsumerAutoConfiguration.java | 4 +- ...RabbitMqEnvironmentPostProcessorImpl.java} | 2 +- ...er.java => RabbitMqEventConsumerImpl.java} | 22 +- ...r.java => RabbitMqEventPublisherImpl.java} | 4 +- .../main/resources/META-INF/spring.factories | 2 +- .../integration/RabbitMqIntegrationTest.java | 4 +- .../RabbitMqConsumerIntegrationTest.java | 4 +- modules/eda/README.md | 2 +- modules/eda/docs/API_REFERENCE.md | 40 +-- modules/eda/docs/ARCHITECTURE.md | 24 +- modules/eda/docs/DEVELOPER_GUIDE.md | 8 +- ...nsumer.java => NoopEventConsumerImpl.java} | 4 +- ...> SpringApplicationEventConsumerImpl.java} | 4 +- ...dler.java => MetricsErrorHandlerImpl.java} | 6 +- ...java => NotificationErrorHandlerImpl.java} | 4 +- ...ter.java => CompositeEventFilterImpl.java} | 10 +- ...r.java => DestinationEventFilterImpl.java} | 4 +- .../eda/filter/EventFilter.java | 4 +- ...peFilter.java => EventTypeFilterImpl.java} | 6 +- ...Filter.java => HeaderEventFilterImpl.java} | 6 +- ...cator.java => EdaHealthIndicatorImpl.java} | 6 +- ...r.java => EventListenerProcessorImpl.java} | 6 +- .../{EdaMetrics.java => EdaMetricsImpl.java} | 6 +- ...ava => DestinationAwarePublisherImpl.java} | 2 +- .../eda/publisher/EventPublisherFactory.java | 2 +- ...isher.java => NoopEventPublisherImpl.java} | 4 +- ... SpringApplicationEventPublisherImpl.java} | 4 +- .../ResilientEventPublisherFactory.java | 2 +- ....java => ResilientEventPublisherImpl.java} | 2 +- ...er.java => AvroMessageSerializerImpl.java} | 8 +- ...er.java => JsonMessageSerializerImpl.java} | 4 +- ...ava => ProtobufMessageSerializerImpl.java} | 4 +- modules/eda/src/test/java/README.md | 6 +- .../eda/config/EdaAutoConfigurationTest.java | 12 +- .../eda/consumer/NoopEventConsumerTest.java | 4 +- .../SpringApplicationEventConsumerTest.java | 4 +- .../eda/error/ErrorHandlingTest.java | 8 +- .../DynamicDestinationIntegrationTest.java | 10 +- .../EventListenerDeliveryContractTest.java | 8 +- .../EventListenerDeliveryOutcomeTest.java | 6 +- .../listener/EventListenerProcessorTest.java | 4 +- .../DestinationAwarePublisherTest.java | 12 +- ...ublisherFactoryDynamicDestinationTest.java | 12 +- .../SpringApplicationEventPublisherTest.java | 2 +- .../AvroDeclaredTypeTrustTest.java | 14 +- .../AvroMessageSerializerTest.java | 6 +- .../eda/serialization/AvroReadBudgetTest.java | 12 +- .../JsonMessageSerializerTest.java | 4 +- .../ProtobufMessageSerializerTest.java | 4 +- modules/eventsourcing/docs/README.md | 8 +- modules/eventsourcing/docs/api-reference.md | 2 +- modules/eventsourcing/docs/architecture.md | 20 +- modules/eventsourcing/docs/database-schema.md | 2 +- .../docs/optional-enhancements.md | 14 +- .../EventSourcingAutoConfiguration.java | 6 +- .../EventSourcingHealthAutoConfiguration.java | 32 +- ...EventSourcingMetricsAutoConfiguration.java | 6 +- ...ntSourcingProjectionAutoConfiguration.java | 4 +- .../config/EventStoreAutoConfiguration.java | 4 +- .../config/SnapshotAutoConfiguration.java | 4 +- ...ava => EventStoreHealthIndicatorImpl.java} | 6 +- ...or.java => OutboxHealthIndicatorImpl.java} | 6 +- ...ava => ProjectionHealthIndicatorImpl.java} | 6 +- ... => SnapshotStoreHealthIndicatorImpl.java} | 6 +- ...etrics.java => EventStoreMetricsImpl.java} | 4 +- ...etrics.java => ProjectionMetricsImpl.java} | 4 +- .../projection/ProjectionService.java | 6 +- ...Store.java => R2dbcSnapshotStoreImpl.java} | 4 +- ...entStore.java => R2dbcEventStoreImpl.java} | 4 +- .../projection/ProjectionFrameworkTest.java | 4 +- .../PostgreSqlEventStoreIntegrationTest.java | 4 +- .../r2dbc/R2dbcEventStoreIntegrationTest.java | 4 +- ...a => Sha256AuditEvidenceVerifierImpl.java} | 2 +- .../audit/AuditEvidenceVerifierTest.java | 4 +- modules/notifications-firebase/README.md | 4 +- .../config/v1/FcmAutoConfiguration.java | 4 +- ...Provider.java => FcmPushProviderImpl.java} | 4 +- modules/notifications-resend/README.md | 4 +- .../config/v1/ResendAutoConfiguration.java | 4 +- ...ider.java => ResendEmailProviderImpl.java} | 2 +- modules/notifications-sendgrid/README.md | 6 +- .../config/v1/SendGridAutoConfiguration.java | 4 +- ...er.java => SendGridEmailProviderImpl.java} | 2 +- modules/notifications-twilio/README.md | 4 +- .../config/v1/TwilioAutoConfiguration.java | 6 +- ...ovider.java => TwilioSMSProviderImpl.java} | 6 +- .../v1/TwilioSMSProviderContractTest.java | 4 +- modules/notifications/ARCHITECTURE.md | 16 +- modules/notifications/README.md | 2 +- .../README.md | 2 +- ...oryNotificationPreferenceServiceImpl.java} | 2 +- ...markerNotificationTemplateEngineImpl.java} | 6 +- ...rics.java => NotificationMetricsImpl.java} | 4 +- ...icationObservabilityAutoConfiguration.java | 4 +- modules/observability/README.md | 2 +- ...FireflyObservabilityAutoConfiguration.java | 22 +- ...vabilityEnvironmentPostProcessorImpl.java} | 2 +- ...> FireflyMeterRegistryCustomizerImpl.java} | 4 +- ...ientObservationBeanPostProcessorImpl.java} | 10 +- ...a => ClientTracingExchangeFilterImpl.java} | 6 +- ...FeignMicrometerCapabilityFactoryImpl.java} | 4 +- ...HttpErrorStatusObservationFilterImpl.java} | 2 +- .../tracing/ObservedClients.java | 2 +- .../main/resources/META-INF/spring.factories | 2 +- ...flyObservabilityAutoConfigurationTest.java | 6 +- ...rvabilityEnvironmentPostProcessorTest.java | 6 +- ...ndexedAutoConfigurationExclusionsTest.java | 10 +- .../ObservabilityExporterDefaultsTest.java | 6 +- .../TracingBridgeStartupTest.java | 8 +- .../tracing/DistributedTracingTest.java | 6 +- .../ReactiveContextPropagationTest.java | 4 +- modules/orchestration/docs/configuration.md | 24 +- .../orchestration/docs/core-infrastructure.md | 44 +-- modules/orchestration/docs/foundations.md | 10 +- .../docs/recipes-and-production.md | 22 +- modules/orchestration/docs/saga.md | 42 +-- modules/orchestration/docs/tutorial.md | 4 +- .../OrchestrationAutoConfiguration.java | 38 +-- ...OrchestrationMetricsAutoConfiguration.java | 6 +- ...estrationPersistenceAutoConfiguration.java | 12 +- .../OrchestrationRestAutoConfiguration.java | 6 +- .../config/SagaAutoConfiguration.java | 4 +- ... => AdaptiveBackpressureStrategyImpl.java} | 6 +- .../BackpressureStrategyFactory.java | 16 +- ...a => BatchedBackpressureStrategyImpl.java} | 6 +- ...rcuitBreakerBackpressureStrategyImpl.java} | 6 +- ....java => InMemoryDeadLetterStoreImpl.java} | 2 +- ...> EdaOrchestrationEventPublisherImpl.java} | 4 +- ...isher.java => NoOpEventPublisherImpl.java} | 2 +- ... => OrchestrationHealthIndicatorImpl.java} | 4 +- ... => CompositeOrchestrationEventsImpl.java} | 4 +- ...ava => OrchestrationLoggerEventsImpl.java} | 2 +- ...ics.java => OrchestrationMetricsImpl.java} | 4 +- ...a => InMemoryPersistenceProviderImpl.java} | 2 +- ....java => SchedulingPostProcessorImpl.java} | 4 +- ...java => CachePersistenceProviderImpl.java} | 6 +- ... EventSourcedPersistenceProviderImpl.java} | 6 +- ...java => RedisPersistenceProviderImpl.java} | 6 +- .../CompensationErrorHandlerFactory.java | 16 +- ...ompositeCompensationErrorHandlerImpl.java} | 4 +- ... DefaultCompensationErrorHandlerImpl.java} | 2 +- ...ler.java => FailFastErrorHandlerImpl.java} | 2 +- ...va => LogAndContinueErrorHandlerImpl.java} | 2 +- ... => RetryWithBackoffErrorHandlerImpl.java} | 6 +- .../saga/compensation/SagaCompensator.java | 2 +- .../config/CompositeEventsWiringTest.java | 20 +- .../config/OrchestrationOptionalEdaTest.java | 8 +- .../config/TccPersistenceModeBootTest.java | 8 +- .../TccPersistenceModeConfigurationTest.java | 6 +- .../config/WorkflowRestSwitchTest.java | 12 +- ...rchestrationEventPublisherLoggingTest.java | 12 +- .../OrchestrationLoggerEventsLoggingTest.java | 6 +- .../integration/CrossPatternTest.java | 14 +- .../EventWiringIntegrationTest.java | 12 +- .../integration/SagaIntegrationTest.java | 10 +- .../integration/TccIntegrationTest.java | 10 +- .../integration/WorkflowIntegrationTest.java | 8 +- .../OrchestrationRuntimeLogSafetyTest.java | 22 +- .../PersistenceProviderLogSafetyTest.java | 12 +- .../unit/core/BackpressureStrategyTest.java | 10 +- .../core/BackpressureStrategyVarietyTest.java | 40 +-- .../unit/core/BackpressureWiringTest.java | 14 +- .../unit/core/DeadLetterServiceTest.java | 4 +- .../unit/core/DeadMetadataWiringTest.java | 8 +- .../unit/core/DlqInputCaptureTest.java | 16 +- .../unit/core/EventPublishingTest.java | 10 +- .../unit/core/ExecutionReportWiringTest.java | 12 +- .../core/InMemoryPersistenceProviderTest.java | 6 +- .../core/LifecycleCallbackAdvancedTest.java | 6 +- .../unit/core/MetricsEndpointTest.java | 6 +- .../unit/core/RecoveryServiceTest.java | 6 +- .../unit/core/SchedulingAlignmentTest.java | 16 +- .../unit/core/SchedulingTest.java | 28 +- .../unit/core/SuppressErrorAlignmentTest.java | 6 +- .../unit/core/TracerWiringTest.java | 12 +- .../EdaOrchestrationEventPublisherTest.java | 42 +-- .../saga/CompensationErrorHandlerTest.java | 10 +- .../CompensationErrorHandlerVarietyTest.java | 38 +-- .../CompensationErrorHandlerWiringTest.java | 6 +- .../unit/saga/ExpandEachTest.java | 2 +- .../unit/saga/LayerConcurrencyTest.java | 4 +- .../unit/saga/SagaCheckpointTest.java | 10 +- .../unit/saga/SagaCompensationPolicyTest.java | 2 +- .../unit/saga/SagaEngineTest.java | 2 +- .../unit/saga/SagaLifecycleCallbackTest.java | 4 +- .../SagaLifecycleResultInjectionTest.java | 4 +- .../unit/tcc/TccAdvancedTest.java | 12 +- .../unit/tcc/TccCheckpointTest.java | 12 +- .../orchestration/unit/tcc/TccEngineTest.java | 2 +- .../unit/tcc/TccJitterAndCheckpointTest.java | 12 +- .../unit/tcc/TccLifecycleCallbackTest.java | 4 +- .../tcc/TccLifecycleResultInjectionTest.java | 4 +- .../unit/tcc/TccRequiredPersistenceTest.java | 10 +- .../unit/tcc/TccRetryEndToEndTest.java | 4 +- .../unit/workflow/AsyncTriggerModeTest.java | 10 +- .../workflow/ChildWorkflowAnnotationTest.java | 12 +- .../CompensationStepAnnotationTest.java | 8 +- .../unit/workflow/NamedTimerWiringTest.java | 8 +- .../unit/workflow/SignalServiceTest.java | 6 +- .../unit/workflow/SuppressErrorLogicTest.java | 10 +- .../unit/workflow/WaitForAllTest.java | 10 +- .../unit/workflow/WaitForAnyTest.java | 10 +- .../unit/workflow/WorkflowCheckpointTest.java | 12 +- .../workflow/WorkflowCompensationTest.java | 12 +- .../workflow/WorkflowConditionAsyncTest.java | 8 +- .../unit/workflow/WorkflowDlqTest.java | 18 +- .../workflow/WorkflowDryRunEndToEndTest.java | 8 +- .../unit/workflow/WorkflowEngineTest.java | 8 +- .../WorkflowLayerConcurrencyTest.java | 8 +- .../WorkflowLifecycleCallbackTest.java | 10 +- .../unit/workflow/WorkflowOrderTest.java | 8 +- .../workflow/WorkflowQueryAnnotationTest.java | 6 +- .../workflow/WorkflowQueryServiceTest.java | 6 +- .../workflow/WorkflowSignalTimerTest.java | 10 +- .../WorkflowStepFailureEventTest.java | 6 +- .../workflow/WorkflowSuspendResumeTest.java | 8 +- modules/plugins/README.md | 4 +- modules/plugins/VERIFICATION.md | 4 +- modules/plugins/plugin-core/README.md | 10 +- ...java => DefaultExtensionRegistryImpl.java} | 4 +- ...ger.java => DefaultPluginManagerImpl.java} | 10 +- .../core/DefaultExtensionRegistryTest.java | 4 +- .../plugin/core/DefaultPluginManagerTest.java | 4 +- .../PluginSystemIntegrationTest.java | 4 +- modules/r2dbc/README.md | 6 +- ...gDataCompletedAuditAppendServiceImpl.java} | 4 +- ...> SpringDataLocalAuditRepositoryImpl.java} | 4 +- ...ngDataTransactionalAuditAppenderImpl.java} | 6 +- ...ava => UtcOffsetDateTimeProviderImpl.java} | 4 +- .../core/config/SwaggerAutoConfiguration.java | 6 +- ...ava => FilterParameterCustomizerImpl.java} | 6 +- ...tor.java => R2dbcHealthIndicatorImpl.java} | 4 +- ...2dbcMetrics.java => R2dbcMetricsImpl.java} | 4 +- .../R2dbcObservabilityAutoConfiguration.java | 6 +- .../transaction/BoundedR2dbcResources.java | 8 +- ...a => OwnedLeaseConnectionFactoryImpl.java} | 36 +-- ...=> DefaultBoundedRootTransactionImpl.java} | 4 +- .../core/audit/AuditTestFixture.java | 4 +- .../CompletedAuditAppendServiceTest.java | 10 +- .../core/audit/LocalAuditRepositoryTest.java | 24 +- .../audit/TransactionalAuditAppenderTest.java | 6 +- .../UtcOffsetDateTimeProviderTest.java | 10 +- .../FilterParameterCustomizerTest.java | 4 +- .../BoundedR2dbcResourcesTest.java | 14 +- .../BoundedRootTransactionTest.java | 4 +- .../BoundedTransactionBoundaryTest.java | 10 +- .../transaction/RootWorkRejectionTest.java | 6 +- modules/rule-engine/docs/architecture.md | 78 ++--- modules/rule-engine/docs/developer-guide.md | 306 +++++++++--------- .../rule-engine/docs/yaml-dsl-reference.md | 10 +- .../RuleEngineCacheAutoConfiguration.java | 6 +- .../rules/core/dsl/ASTVisitor.java | 48 +-- ...cAction.java => ArithmeticActionImpl.java} | 9 +- ...teAction.java => CalculateActionImpl.java} | 9 +- ...ion.java => CircuitBreakerActionImpl.java} | 11 +- ...Action.java => ConditionalActionImpl.java} | 11 +- ...hileAction.java => DoWhileActionImpl.java} | 11 +- ...EachAction.java => ForEachActionImpl.java} | 11 +- ...ction.java => FunctionCallActionImpl.java} | 11 +- .../{ListAction.java => ListActionImpl.java} | 9 +- .../{RunAction.java => RunActionImpl.java} | 9 +- .../{SetAction.java => SetActionImpl.java} | 9 +- ...{WhileAction.java => WhileActionImpl.java} | 11 +- ...tion.java => ComparisonConditionImpl.java} | 11 +- ...tion.java => ExpressionConditionImpl.java} | 9 +- ...ndition.java => LogicalConditionImpl.java} | 9 +- .../evaluation/ASTRulesEvaluationEngine.java | 74 ++--- ...ression.java => BinaryExpressionImpl.java} | 9 +- ...n.java => FunctionCallExpressionImpl.java} | 9 +- ...ession.java => LiteralExpressionImpl.java} | 27 +- ...pression.java => UnaryExpressionImpl.java} | 9 +- ...ssion.java => VariableExpressionImpl.java} | 11 +- ...ctionParser.java => ActionParserImpl.java} | 64 ++-- .../dsl/parser/ComplexConditionsParser.java | 22 +- ...onParser.java => ConditionParserImpl.java} | 22 +- .../rules/core/dsl/parser/DSLParser.java | 8 +- ...nParser.java => ExpressionParserImpl.java} | 42 +-- ...nExecutor.java => ActionExecutorImpl.java} | 72 ++--- ...ator.java => ExpressionEvaluatorImpl.java} | 58 ++-- ...isitor.java => ValidationVisitorImpl.java} | 54 ++-- ...etrics.java => RuleEngineMetricsImpl.java} | 4 +- ...eEngineObservabilityAutoConfiguration.java | 4 +- .../core/services/impl/CacheServiceImpl.java | 6 +- .../core/validation/YamlDslValidator.java | 72 ++--- .../core/cache/CacheIntegrationTest.java | 10 +- .../core/dsl/ASTParserIntegrationTest.java | 46 +-- .../core/dsl/AccountNumberGenerationTest.java | 8 +- .../rules/core/dsl/ForEachSimpleTest.java | 2 +- .../core/dsl/LogicalOperatorDebugTest.java | 6 +- .../dsl/parser/ASTCacheIntegrationTest.java | 10 +- .../validation/ValidInputVariableNames.java | 2 +- ...ValidInputVariableNamesValidatorImpl.java} | 2 +- modules/security-adapter-cerbos/README.md | 8 +- ...a => CerbosPolicyDecisionAdapterImpl.java} | 6 +- ...sPolicyDecisionAdapterIntegrationTest.java | 4 +- modules/security-adapter-opa/README.md | 8 +- .../VERSIONED_EVALUATION.md | 2 +- ...java => OpaPolicyDecisionAdapterImpl.java} | 6 +- ...va => OpaPolicyEvaluationAdapterImpl.java} | 6 +- ...aPolicyDecisionAdapterIntegrationTest.java | 8 +- .../OpaPolicyDecisionAdapterIssuerTest.java | 2 +- .../OpaPolicyDecisionAdapterProtocolTest.java | 6 +- .../opa/OpaPolicyEvaluationAdapterTest.java | 20 +- modules/security-adapter-openfga/README.md | 8 +- ...va => OpenFgaRelationshipAdapterImpl.java} | 6 +- ...FgaRelationshipAdapterIntegrationTest.java | 4 +- ...penFgaRelationshipAdapterProtocolTest.java | 6 +- modules/security-adapter-r2dbc/README.md | 10 +- ...r.java => R2dbcRevocationAdapterImpl.java} | 4 +- ...R2dbcRevocationAdapterIntegrationTest.java | 2 +- modules/security-adapter-vault/README.md | 8 +- ...pter.java => VaultSecretsAdapterImpl.java} | 4 +- .../VaultSecretsAdapterIntegrationTest.java | 4 +- .../AuthorizationServerConfiguration.java | 4 +- modules/security-bff/README.md | 4 +- ... BffRefreshTokenFailureWebFilterImpl.java} | 4 +- .../bff/BffSecurityAutoConfiguration.java | 12 +- ...lter.java => CsrfCookieWebFilterImpl.java} | 2 +- ...SpaServerCsrfTokenRequestHandlerImpl.java} | 2 +- ... => XhrAwareLogoutSuccessHandlerImpl.java} | 4 +- .../bff/BffRefreshFilterWiringTest.java | 6 +- .../BffRefreshTokenFailureWebFilterTest.java | 4 +- .../security/bff/CsrfCookieWebFilterTest.java | 2 +- .../SpaServerCsrfTokenRequestHandlerTest.java | 2 +- .../bff/XhrAwareLogoutSuccessHandlerTest.java | 4 +- modules/security-core/README.md | 12 +- ...java => LoggingAuditEventAdapterImpl.java} | 2 +- ...a => ConfigurableAuthorityMapperImpl.java} | 4 +- ...va => CaffeineIntrospectionCacheImpl.java} | 4 +- ... => InMemoryKeyManagementAdapterImpl.java} | 6 +- ...=> EmbeddedPolicyDecisionAdapterImpl.java} | 8 +- ...va => ConfigurableTenantResolverImpl.java} | 4 +- .../ConfigurableAuthorityMapperTest.java | 6 +- .../cache/CaffeineIntrospectionCacheTest.java | 2 +- .../key/InMemoryKeyManagementAdapterTest.java | 2 +- .../EmbeddedPolicyDecisionAdapterTest.java | 12 +- ...rictEmbeddedPolicyDecisionAdapterTest.java | 4 +- .../ConfigurableTenantResolverTest.java | 6 +- modules/security-idp-aws-cognito/README.md | 4 +- ...dapter.java => CognitoIdpAdapterImpl.java} | 2 +- .../config/CognitoAutoConfiguration.java | 4 +- .../CognitoIdpAdapterLocalStackIT.java | 4 +- .../adapter/CognitoIdpAdapterTest.java | 4 +- modules/security-idp-azure-ad/README.md | 2 +- ...dapter.java => AzureAdIdpAdapterImpl.java} | 2 +- .../config/AzureAdAutoConfiguration.java | 12 +- ...nService.java => B2CAdminServiceImpl.java} | 4 +- ...vice.java => EntraIdAdminServiceImpl.java} | 2 +- .../adapter/AzureAdIdpAdapterTest.java | 4 +- modules/security-idp-internal-db/README.md | 4 +- modules/security-idp-internal-db/docs/API.md | 2 +- .../docs/DTO_FIELD_MAPPING.md | 2 +- .../docs/technical-details.md | 2 +- ...ter.java => InternalDbIdpAdapterImpl.java} | 2 +- .../InternalDbIdpAutoConfiguration.java | 4 +- .../{IdpMetrics.java => IdpMetricsImpl.java} | 4 +- .../IdpObservabilityAutoConfiguration.java | 4 +- modules/security-method-policy/README.md | 2 +- .../MethodSecurityAutoConfiguration.java | 2 +- ...SecureMethodAuthorizationManagerImpl.java} | 6 +- ...Auth2ClientProductionRegistrationTest.java | 4 +- modules/security-resource-server/README.md | 4 +- .../docs/live-active-state-admission.md | 2 +- ...> JwtToFireflyPrincipalConverterImpl.java} | 6 +- ...der.java => LiveActiveJwtDecoderImpl.java} | 6 +- ...> LiveIntrospectionResponseGuardImpl.java} | 6 +- .../rs/ResourceServerAutoConfiguration.java | 38 +-- ...SpringLiveTokenValidationAdapterImpl.java} | 36 +-- .../security/rs/LiveActiveJwtDecoderTest.java | 12 +- .../rs/LiveIntrospectionPrivacyTest.java | 6 +- .../LiveIntrospectionResponseGuardTest.java | 8 +- .../security/rs/LiveJwtChainAdoptionTest.java | 8 +- .../rs/LiveJwtNativeVerificationTest.java | 4 +- .../rs/ResourceServerIntegrationTest.java | 4 +- .../rs/TenantPrincipalProjectionTest.java | 34 +- .../rs/TenantProjectionConfigurationTest.java | 4 +- modules/security-spi/README.md | 2 +- modules/security-test/README.md | 8 +- ...t.java => FakePolicyDecisionPortImpl.java} | 14 +- .../test/SecurityTestFixturesTest.java | 4 +- modules/security-webflux/README.md | 10 +- ...va => PolicyAuthorizationManagerImpl.java} | 4 +- ...> PrincipalHeaderBridgeWebFilterImpl.java} | 4 +- .../WebFluxBridgeAutoConfiguration.java | 8 +- ...=> ReactorSecurityContextAdapterImpl.java} | 2 +- .../authz/PolicyAuthorizationManagerTest.java | 10 +- .../PrincipalHeaderBridgeWebFilterTest.java | 8 +- .../ReactorSecurityContextAdapterTest.java | 2 +- .../docs/CACHE_ARCHITECTURE.md | 16 +- .../docs/SECURITY_CENTER_INTEGRATION.md | 18 +- modules/starter-application/docs/TESTING.md | 6 +- ...ireflyApplicationInfoContributorImpl.java} | 4 +- .../ApplicationLayerAutoConfiguration.java | 34 +- ... => ApplicationLayerBannerConfigImpl.java} | 2 +- .../config/ConfigCacheAutoConfiguration.java | 6 +- ...licationEnvironmentPostProcessorImpl.java} | 2 +- ... ApplicationLayerHealthIndicatorImpl.java} | 4 +- .../resolver/AbstractConfigResolver.java | 4 +- ...er.java => DefaultConfigResolverImpl.java} | 2 +- ...r.java => DefaultContextResolverImpl.java} | 2 +- ...aultSecurityAuthorizationServiceImpl.java} | 2 +- .../main/resources/META-INF/spring.factories | 2 +- ...FireflyApplicationInfoContributorTest.java | 14 +- .../ApplicationLayerBannerConfigTest.java | 4 +- .../config/ApplicationStartupTest.java | 4 +- .../FeatureCacheServiceNamespaceTest.java | 6 +- .../PostgresCacheArchitectureContextTest.java | 6 +- .../ApplicationLayerHealthIndicatorTest.java | 4 +- .../SecurityAuthorizationIntegrationTest.java | 6 +- modules/starter-core/docs/API.md | 2 +- modules/starter-core/docs/ARCHITECTURE.md | 16 +- .../fireflyframework/core/actuator/README.md | 2 +- ...torDefaultPropertiesAutoConfiguration.java | 2 +- .../DefaultHealthAutoConfiguration.java | 6 +- .../config/TracingAutoConfiguration.java | 2 +- ...ava => YamlPropertySourceFactoryImpl.java} | 2 +- ...r.java => LoggingHealthIndicatorImpl.java} | 4 +- .../FireflyBannerAutoConfiguration.java | 6 +- ... HeaderPropagationExchangeFilterImpl.java} | 4 +- ...va => HeaderPropagationWebFilterImpl.java} | 4 +- ...Filter.java => TransactionFilterImpl.java} | 4 +- .../config/WebClientAutoConfiguration.java | 14 +- .../config/WebFilterAutoConfiguration.java | 4 +- ...ner.java => LoggingExampleRunnerImpl.java} | 6 +- .../core/logging/LoggingUtilsTest.java | 8 +- modules/starter-data/docs/README.md | 2 +- .../starter-data/docs/common/api-reference.md | 4 +- .../starter-data/docs/common/architecture.md | 14 +- .../starter-data/docs/common/configuration.md | 2 +- .../starter-data/docs/common/data-lineage.md | 14 +- .../starter-data/docs/common/data-quality.md | 44 +-- .../docs/common/data-transformation.md | 22 +- modules/starter-data/docs/common/logging.md | 2 +- .../starter-data/docs/common/observability.md | 10 +- .../starter-data/docs/common/resiliency.md | 2 +- .../starter-data/docs/data-enrichers/guide.md | 12 +- modules/starter-data/docs/data-jobs/guide.md | 14 +- .../2026-02-22-starter-data-evolution.md | 48 +-- .../DataEnrichmentAutoConfiguration.java | 20 +- .../config/DataLineageAutoConfiguration.java | 4 +- .../JobOrchestrationAutoConfiguration.java | 12 +- .../ObservabilityAutoConfiguration.java | 16 +- ...> JobOrchestratorHealthIndicatorImpl.java} | 6 +- ...r.java => InMemoryLineageTrackerImpl.java} | 4 +- ...ervice.java => JobMetricsServiceImpl.java} | 4 +- .../operation/AbstractEnricherOperation.java | 6 +- ...{NotNullRule.java => NotNullRuleImpl.java} | 6 +- ...{PatternRule.java => PatternRuleImpl.java} | 6 +- .../{RangeRule.java => RangeRuleImpl.java} | 6 +- .../AbstractResilientDataJobService.java | 12 +- .../AbstractResilientSyncDataJobService.java | 12 +- .../data/service/DataEnricher.java | 10 +- ...java => ComputedFieldTransformerImpl.java} | 4 +- ....java => FieldMappingTransformerImpl.java} | 4 +- .../cache/EnrichmentCacheIntegrationTest.java | 6 +- .../AbstractDataJobControllerTest.java | 4 +- .../GlobalEnrichmentHealthControllerTest.java | 8 +- .../GlobalOperationsControllerTest.java | 8 +- .../CompleteDeveloperExperienceDemoTest.java | 6 +- .../examples/DataEnrichmentExamplesTest.java | 4 +- .../enricher/FinancialDataEnricher.java | 4 +- .../JobOrchestratorHealthIndicatorTest.java | 14 +- .../AsyncJobOrchestratorE2ETest.java | 6 +- .../AutoConfigurationIntegrationTest.java | 16 +- .../integration/AutomaticFeaturesE2ETest.java | 8 +- .../ConcurrencyAndThreadSafetyE2ETest.java | 6 +- .../data/integration/DataEnricherE2ETest.java | 6 +- .../integration/FullStackIntegrationTest.java | 20 +- .../QualityGateIntegrationTest.java | 28 +- .../data/lineage/LineageTrackerTest.java | 4 +- .../logging/RemainingDataLogSafetyTest.java | 10 +- .../logging/StarterDataLogSafetyTest.java | 4 +- .../observability/JobMetricsServiceTest.java | 4 +- .../data/quality/DataQualityEngineTest.java | 20 +- ...actResilientDataJobServiceTimeoutTest.java | 6 +- ...stractResilientSyncDataJobServiceTest.java | 6 +- .../data/service/DataEnricherTest.java | 6 +- .../service/DataJobDiscoveryServiceTest.java | 6 +- .../transform/TransformationChainTest.java | 16 +- .../PostgresCacheArchitectureContextTest.java | 2 +- .../RestrictedHtmlTemplateRenderer.java | 6 +- modules/validators/README.md | 2 +- .../annotations/ValidAccountNumber.java | 4 +- .../annotations/ValidAmount.java | 4 +- .../annotations/ValidBic.java | 4 +- .../annotations/ValidCVV.java | 4 +- .../annotations/ValidCreditCard.java | 6 +- .../annotations/ValidCurrencyCode.java | 4 +- .../annotations/ValidDate.java | 4 +- .../annotations/ValidDateTime.java | 4 +- .../annotations/ValidIban.java | 4 +- .../annotations/ValidInterestRate.java | 4 +- .../annotations/ValidNationalId.java | 4 +- .../annotations/ValidPIN.java | 4 +- .../annotations/ValidPasswordStrength.java | 4 +- .../annotations/ValidPhoneNumber.java | 4 +- .../annotations/ValidSortCode.java | 4 +- .../annotations/ValidTaxId.java | 4 +- ...r.java => AccountNumberValidatorImpl.java} | 6 +- ...alidator.java => AmountValidatorImpl.java} | 2 +- ...icValidator.java => BicValidatorImpl.java} | 2 +- ...VVValidator.java => CVVValidatorImpl.java} | 2 +- ...ator.java => CreditCardValidatorImpl.java} | 2 +- ...or.java => CurrencyCodeValidatorImpl.java} | 2 +- ...idator.java => DateTimeValidatorImpl.java} | 2 +- ...eValidator.java => DateValidatorImpl.java} | 2 +- ...nValidator.java => IbanValidatorImpl.java} | 2 +- ...or.java => InterestRateValidatorImpl.java} | 2 +- ...ator.java => NationalIdValidatorImpl.java} | 10 +- ...INValidator.java => PINValidatorImpl.java} | 2 +- ...ava => PasswordStrengthValidatorImpl.java} | 2 +- ...tor.java => PhoneNumberValidatorImpl.java} | 2 +- ...idator.java => SortCodeValidatorImpl.java} | 2 +- ...Validator.java => TaxIdValidatorImpl.java} | 10 +- .../AccountNumberValidatorTest.java | 4 +- .../validators/AmountValidatorTest.java | 10 +- .../validators/BicValidatorTest.java | 4 +- .../validators/CVVValidatorTest.java | 8 +- .../validators/CreditCardValidatorTest.java | 10 +- .../validators/CurrencyCodeValidatorTest.java | 4 +- .../DateTimeValidatorClockProviderTest.java | 4 +- .../validators/DateTimeValidatorTest.java | 12 +- .../validators/DateValidatorTest.java | 12 +- .../validators/IbanValidatorTest.java | 4 +- .../validators/InterestRateValidatorTest.java | 12 +- .../validators/NationalIdValidatorTest.java | 4 +- .../validators/PINValidatorTest.java | 12 +- .../PasswordStrengthValidatorTest.java | 24 +- .../validators/PhoneNumberValidatorTest.java | 4 +- .../validators/SortCodeValidatorTest.java | 4 +- .../validators/TaxIdValidatorTest.java | 4 +- .../ConditionsReportAutoConfiguration.java | 6 +- ...java => ConditionsReportListenerImpl.java} | 4 +- .../service/ConditionsReportService.java | 2 +- ... => DataAccessExceptionConverterImpl.java} | 6 +- ...xternalServiceExceptionConverterImpl.java} | 6 +- ...ttpClientErrorExceptionConverterImpl.java} | 6 +- ...ttpServerErrorExceptionConverterImpl.java} | 6 +- ...er.java => JpaExceptionConverterImpl.java} | 6 +- ...r.java => JsonExceptionConverterImpl.java} | 6 +- ...ava => NetworkExceptionConverterImpl.java} | 6 +- ...LockingFailureExceptionConverterImpl.java} | 6 +- ....java => R2dbcExceptionConverterImpl.java} | 6 +- ...> Resilience4jExceptionConverterImpl.java} | 6 +- ...va => SecurityExceptionConverterImpl.java} | 6 +- ... => ValidationExceptionConverterImpl.java} | 6 +- ...ava => WebFluxExceptionConverterImpl.java} | 6 +- .../web/error/service/ErrorResponseCache.java | 6 +- ...> FireflyCacheIdempotencyAdapterImpl.java} | 10 +- .../config/IdempotencyAutoConfiguration.java | 24 +- .../IdempotencyOpenAPIAutoConfiguration.java | 16 +- ...ter.java => IdempotencyWebFilterImpl.java} | 14 +- ...nticatedIdempotencyScopeResolverImpl.java} | 6 +- ...ender.java => PiiMaskingAppenderImpl.java} | 4 +- .../PiiMaskingLoggingConfiguration.java | 6 +- ...a => HttpRequestLoggingWebFilterImpl.java} | 6 +- ... => IdempotencyOpenAPICustomizerImpl.java} | 6 +- ...> IdempotencyOperationCustomizerImpl.java} | 2 +- ...InstantScalarOpenAPIAutoConfiguration.java | 6 +- ...> InstantScalarOpenApiCustomizerImpl.java} | 2 +- ...ConditionsReportAutoConfigurationTest.java | 8 +- .../ExceptionConverterServiceTest.java | 8 +- ...ExternalServiceExceptionConverterTest.java | 4 +- .../R2dbcExceptionConverterTest.java | 4 +- .../WebFluxExceptionConverterTest.java | 4 +- .../DataAccessResponsePrivacyTest.java | 4 +- .../error/service/ErrorResponseCacheTest.java | 4 +- .../HttpFeatureCacheServiceNamespaceTest.java | 6 +- .../IdempotencyAutoConfigurationTest.java | 4 +- .../IdempotencyHttpIntegrationTest.java | 6 +- .../filter/IdempotencyWebFilterTest.java | 4 +- .../ScopedIdempotencyWebFilterTest.java | 18 +- .../web/logging/JsonLogValidationTest.java | 14 +- .../web/logging/JsonValidityTest.java | 14 +- .../PiiMaskingAppenderPrivacyTest.java | 4 +- .../PiiMaskingLoggingConfigurationTest.java | 8 +- ...HttpRequestLoggingPrivacyDefaultsTest.java | 4 +- .../HttpRequestLoggingStreamingTest.java | 14 +- .../HttpRequestLoggingWebFilterTest.java | 4 +- .../IdempotencyOpenAPICustomizerTest.java | 6 +- ...antScalarOpenAPIAutoConfigurationTest.java | 6 +- .../InstantScalarOpenApiCustomizerTest.java | 2 +- .../openapi/InstantScalarSchemaGraphTest.java | 12 +- modules/webhooks/ARCHITECTURE.md | 22 +- modules/webhooks/CONFIGURATION.md | 8 +- ...bFilter.java => TracingWebFilterImpl.java} | 4 +- ...RedisConnectivityHealthIndicatorImpl.java} | 2 +- ...ookCircuitBreakerHealthIndicatorImpl.java} | 8 +- ...WebhookPlatformLivenessIndicatorImpl.java} | 2 +- ...ebhookPlatformReadinessIndicatorImpl.java} | 6 +- ...ce.java => WebhookMetricsServiceImpl.java} | 6 +- ...esilientWebhookProcessingServiceImpl.java} | 6 +- .../core/logging/WebhookGuardLoggingTest.java | 8 +- .../WebhookMetricsServiceLoggingTest.java | 6 +- .../metrics/WebhookMetricsServiceTest.java | 4 +- .../README.md | 2 +- .../WebhookIdempotencyAutoConfiguration.java | 12 +- ...heBasedWebhookIdempotencyServiceImpl.java} | 8 +- .../web/controllers/WebhookController.java | 4 +- .../WebhookIntegrationTestConfiguration.java | 8 +- .../WebhookControllerLoggingTest.java | 4 +- scripts/verify_migration.py | 30 +- tests/test_source_path_renames.py | 68 ++++ 898 files changed, 4371 insertions(+), 3909 deletions(-) create mode 100644 docs/migration/source-path-renames.json rename modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/{AgenticBridgeHealthIndicator.java => AgenticBridgeHealthIndicatorImpl.java} (92%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/{ApiKeyAuth.java => ApiKeyAuthImpl.java} (88%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/{BearerTokenAuth.java => BearerTokenAuthImpl.java} (90%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/{CompositeAuth.java => CompositeAuthImpl.java} (92%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/{NoAuth.java => NoAuthImpl.java} (83%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/{DefaultAgenticBridge.java => DefaultAgenticBridgeImpl.java} (94%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/{DefaultAgenticClient.java => DefaultAgenticClientImpl.java} (93%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/{RestConversationManager.java => RestConversationManagerImpl.java} (95%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/{KafkaQueueAgenticPublisher.java => KafkaQueueAgenticPublisherImpl.java} (96%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/{RabbitMqQueueAgenticPublisher.java => RabbitMqQueueAgenticPublisherImpl.java} (96%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/{RedisQueueAgenticPublisher.java => RedisQueueAgenticPublisherImpl.java} (97%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/rest/{RestAgenticTransport.java => RestAgenticTransportImpl.java} (99%) rename modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/websocket/{WebSocketAgenticTransport.java => WebSocketAgenticTransportImpl.java} (98%) rename modules/backoffice/src/main/java/org/fireflyframework/common/backoffice/resolver/{DefaultBackofficeContextResolver.java => DefaultBackofficeContextResolverImpl.java} (98%) rename modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/{HazelcastProvider.java => HazelcastProviderImpl.java} (96%) rename modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/{JCacheProvider.java => JCacheProviderImpl.java} (97%) rename modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/{PostgresCacheAdapter.java => PostgresCacheAdapterImpl.java} (99%) rename modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/{PostgresProvider.java => PostgresProviderImpl.java} (97%) rename modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/{RedisCacheAdapter.java => RedisCacheAdapterImpl.java} (99%) rename modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/{RedisProvider.java => RedisProviderImpl.java} (97%) rename modules/cache/src/main/java/org/fireflyframework/cache/adapter/caffeine/{CaffeineCacheAdapter.java => CaffeineCacheAdapterImpl.java} (99%) rename modules/cache/src/main/java/org/fireflyframework/cache/adapter/smart/{SmartCacheAdapter.java => SmartCacheAdapterImpl.java} (96%) rename modules/cache/src/main/java/org/fireflyframework/cache/manager/{AutoCacheSelectionStrategy.java => AutoCacheSelectionStrategyImpl.java} (98%) rename modules/cache/src/main/java/org/fireflyframework/cache/manager/{FireflyCacheManager.java => FireflyCacheManagerImpl.java} (97%) rename modules/cache/src/main/java/org/fireflyframework/cache/observability/{CacheHealthIndicator.java => CacheHealthIndicatorImpl.java} (94%) rename modules/cache/src/main/java/org/fireflyframework/cache/observability/{CacheMetrics.java => CacheMetricsImpl.java} (97%) rename modules/cache/src/main/java/org/fireflyframework/cache/serialization/{JsonCacheSerializer.java => JsonCacheSerializerImpl.java} (97%) rename modules/cache/src/main/java/org/fireflyframework/cache/spi/providers/{CaffeineProvider.java => CaffeineProviderImpl.java} (93%) rename modules/client/src/main/java/org/fireflyframework/client/cache/{HttpCacheInterceptor.java => HttpCacheInterceptorImpl.java} (95%) rename modules/client/src/main/java/org/fireflyframework/client/chaos/{ChaosEngineeringInterceptor.java => ChaosEngineeringInterceptorImpl.java} (98%) rename modules/client/src/main/java/org/fireflyframework/client/discovery/{ConsulServiceDiscoveryClient.java => ConsulServiceDiscoveryClientImpl.java} (98%) rename modules/client/src/main/java/org/fireflyframework/client/discovery/{EurekaServiceDiscoveryClient.java => EurekaServiceDiscoveryClientImpl.java} (98%) rename modules/client/src/main/java/org/fireflyframework/client/discovery/{KubernetesServiceDiscoveryClient.java => KubernetesServiceDiscoveryClientImpl.java} (95%) rename modules/client/src/main/java/org/fireflyframework/client/discovery/{StaticServiceDiscoveryClient.java => StaticServiceDiscoveryClientImpl.java} (95%) rename modules/client/src/main/java/org/fireflyframework/client/health/{ServiceClientHealthIndicator.java => ServiceClientHealthIndicatorImpl.java} (96%) rename modules/client/src/main/java/org/fireflyframework/client/interceptor/{LoggingInterceptor.java => LoggingInterceptorImpl.java} (97%) rename modules/client/src/main/java/org/fireflyframework/client/interceptor/{MetricsInterceptor.java => MetricsInterceptorImpl.java} (97%) rename modules/client/src/main/java/org/fireflyframework/client/metrics/{PerformanceMetricsCollector.java => PerformanceMetricsCollectorImpl.java} (98%) rename modules/client/src/main/java/org/fireflyframework/client/metrics/{ServiceClientMetrics.java => ServiceClientMetricsImpl.java} (98%) rename modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/health/{CqrsHealthIndicator.java => CqrsHealthIndicatorImpl.java} (95%) rename modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/{AuthorizationMetrics.java => AuthorizationMetricsImpl.java} (97%) rename modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/{CommandMetricsService.java => CommandMetricsServiceImpl.java} (96%) rename modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/{DefaultCommandBus.java => DefaultCommandBusImpl.java} (98%) rename modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/{DefaultExecutionContext.java => DefaultExecutionContextImpl.java} (87%) rename modules/cqrs/src/main/java/org/fireflyframework/cqrs/event/{EdaCommandEventPublisher.java => EdaCommandEventPublisherImpl.java} (95%) rename modules/cqrs/src/main/java/org/fireflyframework/cqrs/query/{DefaultQueryBus.java => DefaultQueryBusImpl.java} (99%) rename modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/{AdobeSignSignatureEnvelopeAdapter.java => AdobeSignSignatureEnvelopeAdapterImpl.java} (98%) rename modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/{DocuSignSignatureEnvelopeAdapter.java => DocuSignSignatureEnvelopeAdapterImpl.java} (97%) rename modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/authentication/impl/{JwtDocuSignAuthentication.java => JwtDocuSignAuthenticationImpl.java} (95%) rename modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/{ManagedDocuSignApiClient.java => ManagedDocuSignApiClientImpl.java} (94%) rename modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/{LogaltySignatureEnvelopeAdapter.java => LogaltySignatureEnvelopeAdapterImpl.java} (99%) rename modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/{S3DocumentContentAdapter.java => S3DocumentContentAdapterImpl.java} (98%) rename modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/{AzureBlobDocumentContentAdapter.java => AzureBlobDocumentContentAdapterImpl.java} (98%) rename modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/{LocalDocumentSearchAdapter.java => LocalDocumentSearchAdapterImpl.java} (99%) rename modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/{LocalPermissionAdapter.java => LocalPermissionAdapterImpl.java} (99%) rename modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/{NoOpGenericAdapter.java => NoOpGenericAdapterImpl.java} (97%) rename modules/ecm/src/main/java/org/fireflyframework/ecm/observability/{EcmMetrics.java => EcmMetricsImpl.java} (96%) rename modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/{FireflyEdaKafkaEnvironmentPostProcessor.java => FireflyEdaKafkaEnvironmentPostProcessorImpl.java} (97%) rename modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/{KafkaEventConsumer.java => KafkaEventConsumerImpl.java} (97%) rename modules/eda-kafka/src/main/java/org/fireflyframework/eda/publisher/kafka/{KafkaEventPublisher.java => KafkaEventPublisherImpl.java} (98%) rename modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/{PostgresEventConsumer.java => PostgresEventConsumerImpl.java} (76%) rename modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/{DeliveryTransactionBoundary.java => DeliveryTransactionBoundaryImpl.java} (92%) rename modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/{PostgresConsumerQueryPool.java => PostgresConsumerQueryPoolImpl.java} (92%) rename modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/{PostgresDeliveryRuntime.java => PostgresDeliveryRuntimeImpl.java} (94%) rename modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/{PostgresEnvelopeMapper.java => PostgresEnvelopeMapperImpl.java} (95%) rename modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/{RegisteredPostgresEventDecoder.java => RegisteredPostgresEventDecoderImpl.java} (90%) rename modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/{SpringDataPostgresConsumerGroupRepository.java => SpringDataPostgresConsumerGroupRepositoryImpl.java} (98%) rename modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/{SpringDataPostgresDeliveryRepository.java => SpringDataPostgresDeliveryRepositoryImpl.java} (97%) rename modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/{PostgresEventPublisher.java => PostgresEventPublisherImpl.java} (97%) rename modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/impl/{SpringDataPostgresOutboxWriter.java => SpringDataPostgresOutboxWriterImpl.java} (93%) rename modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/{FireflyEdaRabbitMqEnvironmentPostProcessor.java => FireflyEdaRabbitMqEnvironmentPostProcessorImpl.java} (98%) rename modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/{RabbitMqEventConsumer.java => RabbitMqEventConsumerImpl.java} (97%) rename modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/{RabbitMqEventPublisher.java => RabbitMqEventPublisherImpl.java} (98%) rename modules/eda/src/main/java/org/fireflyframework/eda/consumer/{NoopEventConsumer.java => NoopEventConsumerImpl.java} (97%) rename modules/eda/src/main/java/org/fireflyframework/eda/consumer/{SpringApplicationEventConsumer.java => SpringApplicationEventConsumerImpl.java} (97%) rename modules/eda/src/main/java/org/fireflyframework/eda/error/impl/{MetricsErrorHandler.java => MetricsErrorHandlerImpl.java} (93%) rename modules/eda/src/main/java/org/fireflyframework/eda/error/impl/{NotificationErrorHandler.java => NotificationErrorHandlerImpl.java} (97%) rename modules/eda/src/main/java/org/fireflyframework/eda/filter/{CompositeEventFilter.java => CompositeEventFilterImpl.java} (90%) rename modules/eda/src/main/java/org/fireflyframework/eda/filter/{DestinationEventFilter.java => DestinationEventFilterImpl.java} (96%) rename modules/eda/src/main/java/org/fireflyframework/eda/filter/{EventTypeFilter.java => EventTypeFilterImpl.java} (96%) rename modules/eda/src/main/java/org/fireflyframework/eda/filter/{HeaderEventFilter.java => HeaderEventFilterImpl.java} (95%) rename modules/eda/src/main/java/org/fireflyframework/eda/health/{EdaHealthIndicator.java => EdaHealthIndicatorImpl.java} (98%) rename modules/eda/src/main/java/org/fireflyframework/eda/listener/{EventListenerProcessor.java => EventListenerProcessorImpl.java} (99%) rename modules/eda/src/main/java/org/fireflyframework/eda/metrics/{EdaMetrics.java => EdaMetricsImpl.java} (98%) rename modules/eda/src/main/java/org/fireflyframework/eda/publisher/{DestinationAwarePublisher.java => DestinationAwarePublisherImpl.java} (98%) rename modules/eda/src/main/java/org/fireflyframework/eda/publisher/{NoopEventPublisher.java => NoopEventPublisherImpl.java} (96%) rename modules/eda/src/main/java/org/fireflyframework/eda/publisher/{SpringApplicationEventPublisher.java => SpringApplicationEventPublisherImpl.java} (97%) rename modules/eda/src/main/java/org/fireflyframework/eda/resilience/{ResilientEventPublisher.java => ResilientEventPublisherImpl.java} (99%) rename modules/eda/src/main/java/org/fireflyframework/eda/serialization/{AvroMessageSerializer.java => AvroMessageSerializerImpl.java} (97%) rename modules/eda/src/main/java/org/fireflyframework/eda/serialization/{JsonMessageSerializer.java => JsonMessageSerializerImpl.java} (96%) rename modules/eda/src/main/java/org/fireflyframework/eda/serialization/{ProtobufMessageSerializer.java => ProtobufMessageSerializerImpl.java} (98%) rename modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/{EventStoreHealthIndicator.java => EventStoreHealthIndicatorImpl.java} (92%) rename modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/{OutboxHealthIndicator.java => OutboxHealthIndicatorImpl.java} (93%) rename modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/{ProjectionHealthIndicator.java => ProjectionHealthIndicatorImpl.java} (95%) rename modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/{SnapshotStoreHealthIndicator.java => SnapshotStoreHealthIndicatorImpl.java} (92%) rename modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/monitoring/{EventStoreMetrics.java => EventStoreMetricsImpl.java} (98%) rename modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/{ProjectionMetrics.java => ProjectionMetricsImpl.java} (96%) rename modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/snapshot/r2dbc/{R2dbcSnapshotStore.java => R2dbcSnapshotStoreImpl.java} (99%) rename modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/store/r2dbc/{R2dbcEventStore.java => R2dbcEventStoreImpl.java} (99%) rename modules/kernel/src/main/java/org/fireflyframework/kernel/audit/impl/{Sha256AuditEvidenceVerifier.java => Sha256AuditEvidenceVerifierImpl.java} (96%) rename modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/{FcmPushProvider.java => FcmPushProviderImpl.java} (95%) rename modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/{ResendEmailProvider.java => ResendEmailProviderImpl.java} (98%) rename modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/{SendGridEmailProvider.java => SendGridEmailProviderImpl.java} (98%) rename modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/{TwilioSMSProvider.java => TwilioSMSProviderImpl.java} (95%) rename modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/preferences/{InMemoryNotificationPreferenceService.java => InMemoryNotificationPreferenceServiceImpl.java} (95%) rename modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/template/{FreemarkerNotificationTemplateEngine.java => FreemarkerNotificationTemplateEngineImpl.java} (93%) rename modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/{NotificationMetrics.java => NotificationMetricsImpl.java} (94%) rename modules/observability/src/main/java/org/fireflyframework/observability/{FireflyObservabilityEnvironmentPostProcessor.java => FireflyObservabilityEnvironmentPostProcessorImpl.java} (99%) rename modules/observability/src/main/java/org/fireflyframework/observability/metrics/{FireflyMeterRegistryCustomizer.java => FireflyMeterRegistryCustomizerImpl.java} (82%) rename modules/observability/src/main/java/org/fireflyframework/observability/tracing/{ClientObservationBeanPostProcessor.java => ClientObservationBeanPostProcessorImpl.java} (95%) rename modules/observability/src/main/java/org/fireflyframework/observability/tracing/{ClientTracingExchangeFilter.java => ClientTracingExchangeFilterImpl.java} (93%) rename modules/observability/src/main/java/org/fireflyframework/observability/tracing/{FeignMicrometerCapabilityFactory.java => FeignMicrometerCapabilityFactoryImpl.java} (86%) rename modules/observability/src/main/java/org/fireflyframework/observability/tracing/{HttpErrorStatusObservationFilter.java => HttpErrorStatusObservationFilterImpl.java} (98%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/{AdaptiveBackpressureStrategy.java => AdaptiveBackpressureStrategyImpl.java} (94%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/{BatchedBackpressureStrategy.java => BatchedBackpressureStrategyImpl.java} (90%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/{CircuitBreakerBackpressureStrategy.java => CircuitBreakerBackpressureStrategyImpl.java} (96%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/dlq/{InMemoryDeadLetterStore.java => InMemoryDeadLetterStoreImpl.java} (96%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/{EdaOrchestrationEventPublisher.java => EdaOrchestrationEventPublisherImpl.java} (97%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/{NoOpEventPublisher.java => NoOpEventPublisherImpl.java} (91%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/health/{OrchestrationHealthIndicator.java => OrchestrationHealthIndicatorImpl.java} (88%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/{CompositeOrchestrationEvents.java => CompositeOrchestrationEventsImpl.java} (97%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/{OrchestrationLoggerEvents.java => OrchestrationLoggerEventsImpl.java} (98%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/{OrchestrationMetrics.java => OrchestrationMetricsImpl.java} (96%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/persistence/{InMemoryPersistenceProvider.java => InMemoryPersistenceProviderImpl.java} (97%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/scheduling/{SchedulingPostProcessor.java => SchedulingPostProcessorImpl.java} (98%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/cache/{CachePersistenceProvider.java => CachePersistenceProviderImpl.java} (96%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/eventsourced/{EventSourcedPersistenceProvider.java => EventSourcedPersistenceProviderImpl.java} (97%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/redis/{RedisPersistenceProvider.java => RedisPersistenceProviderImpl.java} (97%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/{CompositeCompensationErrorHandler.java => CompositeCompensationErrorHandlerImpl.java} (91%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/{DefaultCompensationErrorHandler.java => DefaultCompensationErrorHandlerImpl.java} (92%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/{FailFastErrorHandler.java => FailFastErrorHandlerImpl.java} (94%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/{LogAndContinueErrorHandler.java => LogAndContinueErrorHandlerImpl.java} (94%) rename modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/{RetryWithBackoffErrorHandler.java => RetryWithBackoffErrorHandlerImpl.java} (89%) rename modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/{DefaultExtensionRegistry.java => DefaultExtensionRegistryImpl.java} (98%) rename modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/{DefaultPluginManager.java => DefaultPluginManagerImpl.java} (97%) rename modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/{SpringDataCompletedAuditAppendService.java => SpringDataCompletedAuditAppendServiceImpl.java} (94%) rename modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/{SpringDataLocalAuditRepository.java => SpringDataLocalAuditRepositoryImpl.java} (92%) rename modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/{SpringDataTransactionalAuditAppender.java => SpringDataTransactionalAuditAppenderImpl.java} (91%) rename modules/r2dbc/src/main/java/org/fireflyframework/core/auditing/{UtcOffsetDateTimeProvider.java => UtcOffsetDateTimeProviderImpl.java} (83%) rename modules/r2dbc/src/main/java/org/fireflyframework/core/filters/{FilterParameterCustomizer.java => FilterParameterCustomizerImpl.java} (99%) rename modules/r2dbc/src/main/java/org/fireflyframework/core/observability/{R2dbcHealthIndicator.java => R2dbcHealthIndicatorImpl.java} (94%) rename modules/r2dbc/src/main/java/org/fireflyframework/core/observability/{R2dbcMetrics.java => R2dbcMetricsImpl.java} (95%) rename modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/{OwnedLeaseConnectionFactory.java => OwnedLeaseConnectionFactoryImpl.java} (88%) rename modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/impl/{DefaultBoundedRootTransaction.java => DefaultBoundedRootTransactionImpl.java} (75%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/{ArithmeticAction.java => ArithmeticActionImpl.java} (92%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/{CalculateAction.java => CalculateActionImpl.java} (88%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/{CircuitBreakerAction.java => CircuitBreakerActionImpl.java} (86%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/{ConditionalAction.java => ConditionalActionImpl.java} (91%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/{DoWhileAction.java => DoWhileActionImpl.java} (90%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/{ForEachAction.java => ForEachActionImpl.java} (90%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/{FunctionCallAction.java => FunctionCallActionImpl.java} (90%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/{ListAction.java => ListActionImpl.java} (92%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/{RunAction.java => RunActionImpl.java} (90%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/{SetAction.java => SetActionImpl.java} (88%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/{WhileAction.java => WhileActionImpl.java} (90%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/{ComparisonCondition.java => ComparisonConditionImpl.java} (90%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/{ExpressionCondition.java => ExpressionConditionImpl.java} (88%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/{LogicalCondition.java => LogicalConditionImpl.java} (93%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/{BinaryExpression.java => BinaryExpressionImpl.java} (88%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/{FunctionCallExpression.java => FunctionCallExpressionImpl.java} (92%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/{LiteralExpression.java => LiteralExpressionImpl.java} (85%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/{UnaryExpression.java => UnaryExpressionImpl.java} (88%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/{VariableExpression.java => VariableExpressionImpl.java} (91%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/{ActionParser.java => ActionParserImpl.java} (88%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/{ConditionParser.java => ConditionParserImpl.java} (92%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/{ExpressionParser.java => ExpressionParserImpl.java} (89%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/{ActionExecutor.java => ActionExecutorImpl.java} (89%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/{ExpressionEvaluator.java => ExpressionEvaluatorImpl.java} (98%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/{ValidationVisitor.java => ValidationVisitorImpl.java} (95%) rename modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/{RuleEngineMetrics.java => RuleEngineMetricsImpl.java} (95%) rename modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/{ValidInputVariableNamesValidator.java => ValidInputVariableNamesValidatorImpl.java} (96%) rename modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/{CerbosPolicyDecisionAdapter.java => CerbosPolicyDecisionAdapterImpl.java} (95%) rename modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/{OpaPolicyDecisionAdapter.java => OpaPolicyDecisionAdapterImpl.java} (94%) rename modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/{OpaPolicyEvaluationAdapter.java => OpaPolicyEvaluationAdapterImpl.java} (96%) rename modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/{OpenFgaRelationshipAdapter.java => OpenFgaRelationshipAdapterImpl.java} (92%) rename modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/{R2dbcRevocationAdapter.java => R2dbcRevocationAdapterImpl.java} (95%) rename modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/{VaultSecretsAdapter.java => VaultSecretsAdapterImpl.java} (95%) rename modules/security-bff/src/main/java/org/fireflyframework/security/bff/{BffRefreshTokenFailureWebFilter.java => BffRefreshTokenFailureWebFilterImpl.java} (97%) rename modules/security-bff/src/main/java/org/fireflyframework/security/bff/{CsrfCookieWebFilter.java => CsrfCookieWebFilterImpl.java} (97%) rename modules/security-bff/src/main/java/org/fireflyframework/security/bff/{SpaServerCsrfTokenRequestHandler.java => SpaServerCsrfTokenRequestHandlerImpl.java} (96%) rename modules/security-bff/src/main/java/org/fireflyframework/security/bff/{XhrAwareLogoutSuccessHandler.java => XhrAwareLogoutSuccessHandlerImpl.java} (96%) rename modules/security-core/src/main/java/org/fireflyframework/security/core/audit/{LoggingAuditEventAdapter.java => LoggingAuditEventAdapterImpl.java} (95%) rename modules/security-core/src/main/java/org/fireflyframework/security/core/authority/{ConfigurableAuthorityMapper.java => ConfigurableAuthorityMapperImpl.java} (94%) rename modules/security-core/src/main/java/org/fireflyframework/security/core/cache/{CaffeineIntrospectionCache.java => CaffeineIntrospectionCacheImpl.java} (95%) rename modules/security-core/src/main/java/org/fireflyframework/security/core/key/{InMemoryKeyManagementAdapter.java => InMemoryKeyManagementAdapterImpl.java} (95%) rename modules/security-core/src/main/java/org/fireflyframework/security/core/policy/{EmbeddedPolicyDecisionAdapter.java => EmbeddedPolicyDecisionAdapterImpl.java} (94%) rename modules/security-core/src/main/java/org/fireflyframework/security/core/tenant/{ConfigurableTenantResolver.java => ConfigurableTenantResolverImpl.java} (95%) rename modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/{CognitoIdpAdapter.java => CognitoIdpAdapterImpl.java} (99%) rename modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/{AzureAdIdpAdapter.java => AzureAdIdpAdapterImpl.java} (99%) rename modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/{B2CAdminService.java => B2CAdminServiceImpl.java} (97%) rename modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/{EntraIdAdminService.java => EntraIdAdminServiceImpl.java} (99%) rename modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/{InternalDbIdpAdapter.java => InternalDbIdpAdapterImpl.java} (99%) rename modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/{IdpMetrics.java => IdpMetricsImpl.java} (96%) rename modules/security-method-policy/src/main/java/org/fireflyframework/security/method/{SecureMethodAuthorizationManager.java => SecureMethodAuthorizationManagerImpl.java} (93%) rename modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/{JwtToFireflyPrincipalConverter.java => JwtToFireflyPrincipalConverterImpl.java} (92%) rename modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/{LiveActiveJwtDecoder.java => LiveActiveJwtDecoderImpl.java} (97%) rename modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/{LiveIntrospectionResponseGuard.java => LiveIntrospectionResponseGuardImpl.java} (96%) rename modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/{SpringLiveTokenValidationAdapter.java => SpringLiveTokenValidationAdapterImpl.java} (84%) rename modules/security-test/src/main/java/org/fireflyframework/security/test/{FakePolicyDecisionPort.java => FakePolicyDecisionPortImpl.java} (79%) rename modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/{PolicyAuthorizationManager.java => PolicyAuthorizationManagerImpl.java} (93%) rename modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/{PrincipalHeaderBridgeWebFilter.java => PrincipalHeaderBridgeWebFilterImpl.java} (96%) rename modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/context/{ReactorSecurityContextAdapter.java => ReactorSecurityContextAdapterImpl.java} (95%) rename modules/starter-application/src/main/java/org/fireflyframework/common/application/actuator/{FireflyApplicationInfoContributor.java => FireflyApplicationInfoContributorImpl.java} (97%) rename modules/starter-application/src/main/java/org/fireflyframework/common/application/config/{ApplicationLayerBannerConfig.java => ApplicationLayerBannerConfigImpl.java} (95%) rename modules/starter-application/src/main/java/org/fireflyframework/common/application/config/{StatelessApplicationEnvironmentPostProcessor.java => StatelessApplicationEnvironmentPostProcessorImpl.java} (93%) rename modules/starter-application/src/main/java/org/fireflyframework/common/application/health/{ApplicationLayerHealthIndicator.java => ApplicationLayerHealthIndicatorImpl.java} (95%) rename modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/{DefaultConfigResolver.java => DefaultConfigResolverImpl.java} (98%) rename modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/{DefaultContextResolver.java => DefaultContextResolverImpl.java} (97%) rename modules/starter-application/src/main/java/org/fireflyframework/common/application/security/{DefaultSecurityAuthorizationService.java => DefaultSecurityAuthorizationServiceImpl.java} (96%) rename modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/{YamlPropertySourceFactory.java => YamlPropertySourceFactoryImpl.java} (95%) rename modules/starter-core/src/main/java/org/fireflyframework/core/actuator/health/{LoggingHealthIndicator.java => LoggingHealthIndicatorImpl.java} (97%) rename modules/starter-core/src/main/java/org/fireflyframework/core/config/{HeaderPropagationExchangeFilter.java => HeaderPropagationExchangeFilterImpl.java} (92%) rename modules/starter-core/src/main/java/org/fireflyframework/core/config/{HeaderPropagationWebFilter.java => HeaderPropagationWebFilterImpl.java} (95%) rename modules/starter-core/src/main/java/org/fireflyframework/core/config/{TransactionFilter.java => TransactionFilterImpl.java} (97%) rename modules/starter-core/src/main/java/org/fireflyframework/core/logging/examples/{LoggingExampleRunner.java => LoggingExampleRunnerImpl.java} (94%) rename modules/starter-data/src/main/java/org/fireflyframework/data/health/{JobOrchestratorHealthIndicator.java => JobOrchestratorHealthIndicatorImpl.java} (96%) rename modules/starter-data/src/main/java/org/fireflyframework/data/lineage/{InMemoryLineageTracker.java => InMemoryLineageTrackerImpl.java} (96%) rename modules/starter-data/src/main/java/org/fireflyframework/data/observability/{JobMetricsService.java => JobMetricsServiceImpl.java} (98%) rename modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/{NotNullRule.java => NotNullRuleImpl.java} (89%) rename modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/{PatternRule.java => PatternRuleImpl.java} (89%) rename modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/{RangeRule.java => RangeRuleImpl.java} (92%) rename modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/{ComputedFieldTransformer.java => ComputedFieldTransformerImpl.java} (89%) rename modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/{FieldMappingTransformer.java => FieldMappingTransformerImpl.java} (90%) rename modules/validators/src/main/java/org/fireflyframework/validators/{AccountNumberValidator.java => AccountNumberValidatorImpl.java} (96%) rename modules/validators/src/main/java/org/fireflyframework/validators/{AmountValidator.java => AmountValidatorImpl.java} (99%) rename modules/validators/src/main/java/org/fireflyframework/validators/{BicValidator.java => BicValidatorImpl.java} (98%) rename modules/validators/src/main/java/org/fireflyframework/validators/{CVVValidator.java => CVVValidatorImpl.java} (98%) rename modules/validators/src/main/java/org/fireflyframework/validators/{CreditCardValidator.java => CreditCardValidatorImpl.java} (98%) rename modules/validators/src/main/java/org/fireflyframework/validators/{CurrencyCodeValidator.java => CurrencyCodeValidatorImpl.java} (98%) rename modules/validators/src/main/java/org/fireflyframework/validators/{DateTimeValidator.java => DateTimeValidatorImpl.java} (99%) rename modules/validators/src/main/java/org/fireflyframework/validators/{DateValidator.java => DateValidatorImpl.java} (99%) rename modules/validators/src/main/java/org/fireflyframework/validators/{IbanValidator.java => IbanValidatorImpl.java} (99%) rename modules/validators/src/main/java/org/fireflyframework/validators/{InterestRateValidator.java => InterestRateValidatorImpl.java} (98%) rename modules/validators/src/main/java/org/fireflyframework/validators/{NationalIdValidator.java => NationalIdValidatorImpl.java} (96%) rename modules/validators/src/main/java/org/fireflyframework/validators/{PINValidator.java => PINValidatorImpl.java} (99%) rename modules/validators/src/main/java/org/fireflyframework/validators/{PasswordStrengthValidator.java => PasswordStrengthValidatorImpl.java} (98%) rename modules/validators/src/main/java/org/fireflyframework/validators/{PhoneNumberValidator.java => PhoneNumberValidatorImpl.java} (99%) rename modules/validators/src/main/java/org/fireflyframework/validators/{SortCodeValidator.java => SortCodeValidatorImpl.java} (97%) rename modules/validators/src/main/java/org/fireflyframework/validators/{TaxIdValidator.java => TaxIdValidatorImpl.java} (97%) rename modules/web/src/main/java/org/fireflyframework/web/conditions/listener/{ConditionsReportListener.java => ConditionsReportListenerImpl.java} (92%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{DataAccessExceptionConverter.java => DataAccessExceptionConverterImpl.java} (97%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{ExternalServiceExceptionConverter.java => ExternalServiceExceptionConverterImpl.java} (98%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{HttpClientErrorExceptionConverter.java => HttpClientErrorExceptionConverterImpl.java} (94%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{HttpServerErrorExceptionConverter.java => HttpServerErrorExceptionConverterImpl.java} (92%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{JpaExceptionConverter.java => JpaExceptionConverterImpl.java} (95%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{JsonExceptionConverter.java => JsonExceptionConverterImpl.java} (95%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{NetworkExceptionConverter.java => NetworkExceptionConverterImpl.java} (93%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{OptimisticLockingFailureExceptionConverter.java => OptimisticLockingFailureExceptionConverterImpl.java} (92%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{R2dbcExceptionConverter.java => R2dbcExceptionConverterImpl.java} (98%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{Resilience4jExceptionConverter.java => Resilience4jExceptionConverterImpl.java} (98%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{SecurityExceptionConverter.java => SecurityExceptionConverterImpl.java} (95%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{ValidationExceptionConverter.java => ValidationExceptionConverterImpl.java} (94%) rename modules/web/src/main/java/org/fireflyframework/web/error/converter/{WebFluxExceptionConverter.java => WebFluxExceptionConverterImpl.java} (97%) rename modules/web/src/main/java/org/fireflyframework/web/idempotency/cache/{FireflyCacheIdempotencyAdapter.java => FireflyCacheIdempotencyAdapterImpl.java} (91%) rename modules/web/src/main/java/org/fireflyframework/web/idempotency/filter/{IdempotencyWebFilter.java => IdempotencyWebFilterImpl.java} (97%) rename modules/web/src/main/java/org/fireflyframework/web/idempotency/scope/{AuthenticatedIdempotencyScopeResolver.java => AuthenticatedIdempotencyScopeResolverImpl.java} (91%) rename modules/web/src/main/java/org/fireflyframework/web/logging/appender/{PiiMaskingAppender.java => PiiMaskingAppenderImpl.java} (98%) rename modules/web/src/main/java/org/fireflyframework/web/logging/filter/{HttpRequestLoggingWebFilter.java => HttpRequestLoggingWebFilterImpl.java} (99%) rename modules/web/src/main/java/org/fireflyframework/web/openapi/{IdempotencyOpenAPICustomizer.java => IdempotencyOpenAPICustomizerImpl.java} (95%) rename modules/web/src/main/java/org/fireflyframework/web/openapi/{IdempotencyOperationCustomizer.java => IdempotencyOperationCustomizerImpl.java} (95%) rename modules/web/src/main/java/org/fireflyframework/web/openapi/{InstantScalarOpenApiCustomizer.java => InstantScalarOpenApiCustomizerImpl.java} (98%) rename modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/filter/{TracingWebFilter.java => TracingWebFilterImpl.java} (96%) rename modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/{RedisConnectivityHealthIndicator.java => RedisConnectivityHealthIndicatorImpl.java} (97%) rename modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/{WebhookCircuitBreakerHealthIndicator.java => WebhookCircuitBreakerHealthIndicatorImpl.java} (90%) rename modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/{WebhookPlatformLivenessIndicator.java => WebhookPlatformLivenessIndicatorImpl.java} (95%) rename modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/{WebhookPlatformReadinessIndicator.java => WebhookPlatformReadinessIndicatorImpl.java} (93%) rename modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/metrics/{WebhookMetricsService.java => WebhookMetricsServiceImpl.java} (94%) rename modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/resilience/{ResilientWebhookProcessingService.java => ResilientWebhookProcessingServiceImpl.java} (96%) rename modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/{CacheBasedWebhookIdempotencyService.java => CacheBasedWebhookIdempotencyServiceImpl.java} (96%) create mode 100644 tests/test_source_path_renames.py diff --git a/docs/examples/onboarding-event-store/README.md b/docs/examples/onboarding-event-store/README.md index 4f656cc0a..af87d4153 100644 --- a/docs/examples/onboarding-event-store/README.md +++ b/docs/examples/onboarding-event-store/README.md @@ -2,7 +2,7 @@ ![Onboarding event store](../../site/assets/banners/onboarding-event-store.svg) -Submit a customer application, approve it, and reconstruct its state from PostgreSQL events. The example uses Jafly's `AggregateRoot` and `R2dbcEventStore`, with an application-owned `OnboardingEventService` connecting them. +Submit a customer application, approve it, and reconstruct its state from PostgreSQL events. The example uses Jafly's `AggregateRoot` and `R2dbcEventStoreImpl`, with an application-owned `OnboardingEventService` connecting them. Run from the framework checkout after installing its libraries: diff --git a/docs/examples/onboarding-event-store/src/test/java/com/example/onboarding/OnboardingEventStoreTest.java b/docs/examples/onboarding-event-store/src/test/java/com/example/onboarding/OnboardingEventStoreTest.java index 6296c53e6..7fed53410 100644 --- a/docs/examples/onboarding-event-store/src/test/java/com/example/onboarding/OnboardingEventStoreTest.java +++ b/docs/examples/onboarding-event-store/src/test/java/com/example/onboarding/OnboardingEventStoreTest.java @@ -12,7 +12,7 @@ import org.fireflyframework.eventsourcing.config.EventSourcingProperties; import org.fireflyframework.eventsourcing.domain.Event; import org.fireflyframework.eventsourcing.store.ConcurrencyException; -import org.fireflyframework.eventsourcing.store.r2dbc.R2dbcEventStore; +import org.fireflyframework.eventsourcing.store.r2dbc.R2dbcEventStoreImpl; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.data.r2dbc.core.R2dbcEntityTemplate; @@ -39,7 +39,7 @@ class OnboardingEventStoreTest { .withInitScript("events.sql"); private DatabaseClient database; - private R2dbcEventStore store; + private R2dbcEventStoreImpl store; private OnboardingEventService service; @BeforeEach @@ -53,7 +53,7 @@ void connectToPostgres() { var mapper = new ObjectMapper().registerModule(new JavaTimeModule()); mapper.registerSubtypes(new NamedType(ApplicationSubmitted.class, "onboarding.application.submitted"), new NamedType(ApplicationApproved.class, "onboarding.application.approved")); - store = new R2dbcEventStore(database, new R2dbcEntityTemplate(connectionFactory), mapper, + store = new R2dbcEventStoreImpl(database, new R2dbcEntityTemplate(connectionFactory), mapper, new EventSourcingProperties(), manager, TransactionalOperator.create(manager), connectionFactory); service = new OnboardingEventService(store); } diff --git a/docs/immutable-local-audit.md b/docs/immutable-local-audit.md index 5bbc15947..f262a621e 100644 --- a/docs/immutable-local-audit.md +++ b/docs/immutable-local-audit.md @@ -4,7 +4,7 @@ This opt-in capability appends canonical kernel audit values and a permanent out ## Construct on the owning resource graph -The owner constructs one stable `OwnedLeaseConnectionFactory`, `DatabaseClient`, `R2dbcEntityTemplate` and `R2dbcTransactionManager`, verifies them with `BoundedR2dbcResources.verify`, and uses the existing `DefaultBoundedRootTransaction`. Pass those exact objects to `SpringDataTransactionalAuditAppender`, together with a mandatory genuine `AuditAppendAuthority` and the **same Clock and LongSupplier instances used for the original operation budget**. Do not wrap or replace a caller's client/template, converters or statement filters. +The owner constructs one stable `OwnedLeaseConnectionFactoryImpl`, `DatabaseClient`, `R2dbcEntityTemplate` and `R2dbcTransactionManager`, verifies them with `BoundedR2dbcResources.verify`, and uses the existing `DefaultBoundedRootTransactionImpl`. Pass those exact objects to `SpringDataTransactionalAuditAppenderImpl`, together with a mandatory genuine `AuditAppendAuthority` and the **same Clock and LongSupplier instances used for the original operation budget**. Do not wrap or replace a caller's client/template, converters or statement filters. The appender's `append(scope, event)` must be composed into the owning root work publisher, before that publisher completes. It proves the private active invocation and exact RootTransactionScope/resource graph before admission, then uses the transaction-bound same connection. It never invokes a second root or generic joining TransactionalOperator. Ordinary ambient transactions, stale/foreign scopes and mismatched graphs refuse. Narrowing the genuine original scope preserves its identity. @@ -14,7 +14,7 @@ The authority port must resolve the authenticated current actor, authorize the r Every public `LocalAuditRepository` operation also requires the genuine RootTransactionScope and the same verified factory/client/template/manager graph; it cannot fall back to an ordinary ambient transaction. It exposes no inherited general CRUD API. Its mapped statement helpers are private. -`SpringDataLocalAuditRepository` uses the owning template's genuine mapping strategy/converter and StatementMapper for ordinary inserts and head CAS. Every insert/update must observe exactly one actual affected row. Zero, multiple and missing observations refuse. It stores every canonical kernel field, including separate Instant seconds/nanos, with no serializer-dependent JSON. Event uniqueness is `(resource_tenant_id,event_id)` across all streams in that tenant. The stream head CAS includes the whole scope, expected sequence and previous hash. +`SpringDataLocalAuditRepositoryImpl` uses the owning template's genuine mapping strategy/converter and StatementMapper for ordinary inserts and head CAS. Every insert/update must observe exactly one actual affected row. Zero, multiple and missing observations refuse. It stores every canonical kernel field, including separate Instant seconds/nanos, with no serializer-dependent JSON. Event uniqueness is `(resource_tenant_id,event_id)` across all streams in that tenant. The stream head CAS includes the whole scope, expected sequence and previous hash. The immutable event and its immutable `AUDIT_EXPORT` intent are inserted in the same local transaction as the head and business work. The next append links the prior hash. Exact replay reads the original full event, verifies its canonical record hash and full permanent outbox, and returns the original record without changing its timestamp or sequence. Different content under the same event ID refuses. A duplicate database error propagates without reading or continuing in the aborted transaction. A mandatory append failure marks the genuine owner transaction rollback-only, so catching a logical append refusal cannot commit the business effect. Marking performs no SQL and never clears rollback-only. diff --git a/docs/migration/source-path-renames.json b/docs/migration/source-path-renames.json new file mode 100644 index 000000000..9bb2e5f93 --- /dev/null +++ b/docs/migration/source-path-renames.json @@ -0,0 +1,273 @@ +{ + "paths": { + "modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicator.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicatorImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/ApiKeyAuth.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/ApiKeyAuthImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/BearerTokenAuth.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/BearerTokenAuthImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/CompositeAuth.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/CompositeAuthImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/NoAuth.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/NoAuthImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticBridge.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticBridgeImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticClient.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticClientImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/RestConversationManager.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/RestConversationManagerImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/KafkaQueueAgenticPublisher.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/KafkaQueueAgenticPublisherImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RabbitMqQueueAgenticPublisher.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RabbitMqQueueAgenticPublisherImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RedisQueueAgenticPublisher.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RedisQueueAgenticPublisherImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/rest/RestAgenticTransport.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/rest/RestAgenticTransportImpl.java", + "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/websocket/WebSocketAgenticTransport.java": "modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/websocket/WebSocketAgenticTransportImpl.java", + "modules/backoffice/src/main/java/org/fireflyframework/common/backoffice/resolver/DefaultBackofficeContextResolver.java": "modules/backoffice/src/main/java/org/fireflyframework/common/backoffice/resolver/DefaultBackofficeContextResolverImpl.java", + "modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProvider.java": "modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProviderImpl.java", + "modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProvider.java": "modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProviderImpl.java", + "modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapter.java": "modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterImpl.java", + "modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProvider.java": "modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProviderImpl.java", + "modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapter.java": "modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterImpl.java", + "modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProvider.java": "modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProviderImpl.java", + "modules/cache/src/main/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapter.java": "modules/cache/src/main/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterImpl.java", + "modules/cache/src/main/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapter.java": "modules/cache/src/main/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapterImpl.java", + "modules/cache/src/main/java/org/fireflyframework/cache/manager/AutoCacheSelectionStrategy.java": "modules/cache/src/main/java/org/fireflyframework/cache/manager/AutoCacheSelectionStrategyImpl.java", + "modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManager.java": "modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManagerImpl.java", + "modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheHealthIndicator.java": "modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheHealthIndicatorImpl.java", + "modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheMetrics.java": "modules/cache/src/main/java/org/fireflyframework/cache/observability/CacheMetricsImpl.java", + "modules/cache/src/main/java/org/fireflyframework/cache/serialization/JsonCacheSerializer.java": "modules/cache/src/main/java/org/fireflyframework/cache/serialization/JsonCacheSerializerImpl.java", + "modules/cache/src/main/java/org/fireflyframework/cache/spi/providers/CaffeineProvider.java": "modules/cache/src/main/java/org/fireflyframework/cache/spi/providers/CaffeineProviderImpl.java", + "modules/client/src/main/java/org/fireflyframework/client/cache/HttpCacheInterceptor.java": "modules/client/src/main/java/org/fireflyframework/client/cache/HttpCacheInterceptorImpl.java", + "modules/client/src/main/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptor.java": "modules/client/src/main/java/org/fireflyframework/client/chaos/ChaosEngineeringInterceptorImpl.java", + "modules/client/src/main/java/org/fireflyframework/client/discovery/ConsulServiceDiscoveryClient.java": "modules/client/src/main/java/org/fireflyframework/client/discovery/ConsulServiceDiscoveryClientImpl.java", + "modules/client/src/main/java/org/fireflyframework/client/discovery/EurekaServiceDiscoveryClient.java": "modules/client/src/main/java/org/fireflyframework/client/discovery/EurekaServiceDiscoveryClientImpl.java", + "modules/client/src/main/java/org/fireflyframework/client/discovery/KubernetesServiceDiscoveryClient.java": "modules/client/src/main/java/org/fireflyframework/client/discovery/KubernetesServiceDiscoveryClientImpl.java", + "modules/client/src/main/java/org/fireflyframework/client/discovery/StaticServiceDiscoveryClient.java": "modules/client/src/main/java/org/fireflyframework/client/discovery/StaticServiceDiscoveryClientImpl.java", + "modules/client/src/main/java/org/fireflyframework/client/health/ServiceClientHealthIndicator.java": "modules/client/src/main/java/org/fireflyframework/client/health/ServiceClientHealthIndicatorImpl.java", + "modules/client/src/main/java/org/fireflyframework/client/interceptor/LoggingInterceptor.java": "modules/client/src/main/java/org/fireflyframework/client/interceptor/LoggingInterceptorImpl.java", + "modules/client/src/main/java/org/fireflyframework/client/interceptor/MetricsInterceptor.java": "modules/client/src/main/java/org/fireflyframework/client/interceptor/MetricsInterceptorImpl.java", + "modules/client/src/main/java/org/fireflyframework/client/metrics/PerformanceMetricsCollector.java": "modules/client/src/main/java/org/fireflyframework/client/metrics/PerformanceMetricsCollectorImpl.java", + "modules/client/src/main/java/org/fireflyframework/client/metrics/ServiceClientMetrics.java": "modules/client/src/main/java/org/fireflyframework/client/metrics/ServiceClientMetricsImpl.java", + "modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/health/CqrsHealthIndicator.java": "modules/cqrs/src/main/java/org/fireflyframework/cqrs/actuator/health/CqrsHealthIndicatorImpl.java", + "modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationMetrics.java": "modules/cqrs/src/main/java/org/fireflyframework/cqrs/authorization/AuthorizationMetricsImpl.java", + "modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/CommandMetricsService.java": "modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/CommandMetricsServiceImpl.java", + "modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/DefaultCommandBus.java": "modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/DefaultCommandBusImpl.java", + "modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/DefaultExecutionContext.java": "modules/cqrs/src/main/java/org/fireflyframework/cqrs/context/DefaultExecutionContextImpl.java", + "modules/cqrs/src/main/java/org/fireflyframework/cqrs/event/EdaCommandEventPublisher.java": "modules/cqrs/src/main/java/org/fireflyframework/cqrs/event/EdaCommandEventPublisherImpl.java", + "modules/cqrs/src/main/java/org/fireflyframework/cqrs/query/DefaultQueryBus.java": "modules/cqrs/src/main/java/org/fireflyframework/cqrs/query/DefaultQueryBusImpl.java", + "modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapter.java": "modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapterImpl.java", + "modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapter.java": "modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapterImpl.java", + "modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/authentication/impl/JwtDocuSignAuthentication.java": "modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/authentication/impl/JwtDocuSignAuthenticationImpl.java", + "modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClient.java": "modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClientImpl.java", + "modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapter.java": "modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapterImpl.java", + "modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapter.java": "modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterImpl.java", + "modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapter.java": "modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapterImpl.java", + "modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalDocumentSearchAdapter.java": "modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalDocumentSearchAdapterImpl.java", + "modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalPermissionAdapter.java": "modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/local/LocalPermissionAdapterImpl.java", + "modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpGenericAdapter.java": "modules/ecm/src/main/java/org/fireflyframework/ecm/adapter/noop/NoOpGenericAdapterImpl.java", + "modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmMetrics.java": "modules/ecm/src/main/java/org/fireflyframework/ecm/observability/EcmMetricsImpl.java", + "modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaEnvironmentPostProcessor.java": "modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaEnvironmentPostProcessorImpl.java", + "modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumer.java": "modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumerImpl.java", + "modules/eda-kafka/src/main/java/org/fireflyframework/eda/publisher/kafka/KafkaEventPublisher.java": "modules/eda-kafka/src/main/java/org/fireflyframework/eda/publisher/kafka/KafkaEventPublisherImpl.java", + "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumer.java": "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumerImpl.java", + "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundary.java": "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/DeliveryTransactionBoundaryImpl.java", + "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresConsumerQueryPool.java": "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresConsumerQueryPoolImpl.java", + "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresDeliveryRuntime.java": "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresDeliveryRuntimeImpl.java", + "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapper.java": "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/PostgresEnvelopeMapperImpl.java", + "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/RegisteredPostgresEventDecoder.java": "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/RegisteredPostgresEventDecoderImpl.java", + "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresConsumerGroupRepository.java": "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresConsumerGroupRepositoryImpl.java", + "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresDeliveryRepository.java": "modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/impl/SpringDataPostgresDeliveryRepositoryImpl.java", + "modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/PostgresEventPublisher.java": "modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/PostgresEventPublisherImpl.java", + "modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/impl/SpringDataPostgresOutboxWriter.java": "modules/eda-postgres/src/main/java/org/fireflyframework/eda/publisher/postgres/impl/SpringDataPostgresOutboxWriterImpl.java", + "modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqEnvironmentPostProcessor.java": "modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqEnvironmentPostProcessorImpl.java", + "modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumer.java": "modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumerImpl.java", + "modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisher.java": "modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisherImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/consumer/NoopEventConsumer.java": "modules/eda/src/main/java/org/fireflyframework/eda/consumer/NoopEventConsumerImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumer.java": "modules/eda/src/main/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumerImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/error/impl/MetricsErrorHandler.java": "modules/eda/src/main/java/org/fireflyframework/eda/error/impl/MetricsErrorHandlerImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/error/impl/NotificationErrorHandler.java": "modules/eda/src/main/java/org/fireflyframework/eda/error/impl/NotificationErrorHandlerImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/filter/CompositeEventFilter.java": "modules/eda/src/main/java/org/fireflyframework/eda/filter/CompositeEventFilterImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/filter/DestinationEventFilter.java": "modules/eda/src/main/java/org/fireflyframework/eda/filter/DestinationEventFilterImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/filter/EventTypeFilter.java": "modules/eda/src/main/java/org/fireflyframework/eda/filter/EventTypeFilterImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/filter/HeaderEventFilter.java": "modules/eda/src/main/java/org/fireflyframework/eda/filter/HeaderEventFilterImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/health/EdaHealthIndicator.java": "modules/eda/src/main/java/org/fireflyframework/eda/health/EdaHealthIndicatorImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/listener/EventListenerProcessor.java": "modules/eda/src/main/java/org/fireflyframework/eda/listener/EventListenerProcessorImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/metrics/EdaMetrics.java": "modules/eda/src/main/java/org/fireflyframework/eda/metrics/EdaMetricsImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/publisher/DestinationAwarePublisher.java": "modules/eda/src/main/java/org/fireflyframework/eda/publisher/DestinationAwarePublisherImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/publisher/NoopEventPublisher.java": "modules/eda/src/main/java/org/fireflyframework/eda/publisher/NoopEventPublisherImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisher.java": "modules/eda/src/main/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisherImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisher.java": "modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisherImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/serialization/AvroMessageSerializer.java": "modules/eda/src/main/java/org/fireflyframework/eda/serialization/AvroMessageSerializerImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/serialization/JsonMessageSerializer.java": "modules/eda/src/main/java/org/fireflyframework/eda/serialization/JsonMessageSerializerImpl.java", + "modules/eda/src/main/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializer.java": "modules/eda/src/main/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializerImpl.java", + "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/EventStoreHealthIndicator.java": "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/EventStoreHealthIndicatorImpl.java", + "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/OutboxHealthIndicator.java": "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/OutboxHealthIndicatorImpl.java", + "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/ProjectionHealthIndicator.java": "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/ProjectionHealthIndicatorImpl.java", + "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/SnapshotStoreHealthIndicator.java": "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/SnapshotStoreHealthIndicatorImpl.java", + "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/monitoring/EventStoreMetrics.java": "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/monitoring/EventStoreMetricsImpl.java", + "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionMetrics.java": "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionMetricsImpl.java", + "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/snapshot/r2dbc/R2dbcSnapshotStore.java": "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/snapshot/r2dbc/R2dbcSnapshotStoreImpl.java", + "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStore.java": "modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStoreImpl.java", + "modules/kernel/src/main/java/org/fireflyframework/kernel/audit/impl/Sha256AuditEvidenceVerifier.java": "modules/kernel/src/main/java/org/fireflyframework/kernel/audit/impl/Sha256AuditEvidenceVerifierImpl.java", + "modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProvider.java": "modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProviderImpl.java", + "modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProvider.java": "modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProviderImpl.java", + "modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProvider.java": "modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProviderImpl.java", + "modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProvider.java": "modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProviderImpl.java", + "modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/preferences/InMemoryNotificationPreferenceService.java": "modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/preferences/InMemoryNotificationPreferenceServiceImpl.java", + "modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/template/FreemarkerNotificationTemplateEngine.java": "modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/template/FreemarkerNotificationTemplateEngineImpl.java", + "modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationMetrics.java": "modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationMetricsImpl.java", + "modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessor.java": "modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessorImpl.java", + "modules/observability/src/main/java/org/fireflyframework/observability/metrics/FireflyMeterRegistryCustomizer.java": "modules/observability/src/main/java/org/fireflyframework/observability/metrics/FireflyMeterRegistryCustomizerImpl.java", + "modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientObservationBeanPostProcessor.java": "modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientObservationBeanPostProcessorImpl.java", + "modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientTracingExchangeFilter.java": "modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientTracingExchangeFilterImpl.java", + "modules/observability/src/main/java/org/fireflyframework/observability/tracing/FeignMicrometerCapabilityFactory.java": "modules/observability/src/main/java/org/fireflyframework/observability/tracing/FeignMicrometerCapabilityFactoryImpl.java", + "modules/observability/src/main/java/org/fireflyframework/observability/tracing/HttpErrorStatusObservationFilter.java": "modules/observability/src/main/java/org/fireflyframework/observability/tracing/HttpErrorStatusObservationFilterImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/AdaptiveBackpressureStrategy.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/AdaptiveBackpressureStrategyImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BatchedBackpressureStrategy.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BatchedBackpressureStrategyImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/CircuitBreakerBackpressureStrategy.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/CircuitBreakerBackpressureStrategyImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/dlq/InMemoryDeadLetterStore.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/dlq/InMemoryDeadLetterStoreImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisher.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisherImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/NoOpEventPublisher.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/NoOpEventPublisherImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/health/OrchestrationHealthIndicator.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/health/OrchestrationHealthIndicatorImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/CompositeOrchestrationEvents.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/CompositeOrchestrationEventsImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEvents.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEventsImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationMetrics.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationMetricsImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/persistence/InMemoryPersistenceProvider.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/persistence/InMemoryPersistenceProviderImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/scheduling/SchedulingPostProcessor.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/scheduling/SchedulingPostProcessorImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/cache/CachePersistenceProvider.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/cache/CachePersistenceProviderImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/eventsourced/EventSourcedPersistenceProvider.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/eventsourced/EventSourcedPersistenceProviderImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/redis/RedisPersistenceProvider.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/redis/RedisPersistenceProviderImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompositeCompensationErrorHandler.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompositeCompensationErrorHandlerImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/DefaultCompensationErrorHandler.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/DefaultCompensationErrorHandlerImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/FailFastErrorHandler.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/FailFastErrorHandlerImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/LogAndContinueErrorHandler.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/LogAndContinueErrorHandlerImpl.java", + "modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/RetryWithBackoffErrorHandler.java": "modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/RetryWithBackoffErrorHandlerImpl.java", + "modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistry.java": "modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistryImpl.java", + "modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManager.java": "modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManagerImpl.java", + "modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataCompletedAuditAppendService.java": "modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataCompletedAuditAppendServiceImpl.java", + "modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataLocalAuditRepository.java": "modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataLocalAuditRepositoryImpl.java", + "modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataTransactionalAuditAppender.java": "modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataTransactionalAuditAppenderImpl.java", + "modules/r2dbc/src/main/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProvider.java": "modules/r2dbc/src/main/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProviderImpl.java", + "modules/r2dbc/src/main/java/org/fireflyframework/core/filters/FilterParameterCustomizer.java": "modules/r2dbc/src/main/java/org/fireflyframework/core/filters/FilterParameterCustomizerImpl.java", + "modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcHealthIndicator.java": "modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcHealthIndicatorImpl.java", + "modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcMetrics.java": "modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcMetricsImpl.java", + "modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/OwnedLeaseConnectionFactory.java": "modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/OwnedLeaseConnectionFactoryImpl.java", + "modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/impl/DefaultBoundedRootTransaction.java": "modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/impl/DefaultBoundedRootTransactionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ArithmeticAction.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ArithmeticActionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CalculateAction.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CalculateActionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CircuitBreakerAction.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CircuitBreakerActionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ConditionalAction.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ConditionalActionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/DoWhileAction.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/DoWhileActionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ForEachAction.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ForEachActionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/FunctionCallAction.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/FunctionCallActionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ListAction.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ListActionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/RunAction.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/RunActionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/SetAction.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/SetActionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/WhileAction.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/WhileActionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ComparisonCondition.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ComparisonConditionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ExpressionCondition.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ExpressionConditionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/LogicalCondition.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/LogicalConditionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/BinaryExpression.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/BinaryExpressionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/FunctionCallExpression.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/FunctionCallExpressionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/LiteralExpression.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/LiteralExpressionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/UnaryExpression.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/UnaryExpressionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/VariableExpression.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/VariableExpressionImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ActionParser.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ActionParserImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ConditionParser.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ConditionParserImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ExpressionParser.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ExpressionParserImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ActionExecutor.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ActionExecutorImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ExpressionEvaluator.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ExpressionEvaluatorImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ValidationVisitor.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ValidationVisitorImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineMetrics.java": "modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineMetricsImpl.java", + "modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNamesValidator.java": "modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNamesValidatorImpl.java", + "modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapter.java": "modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapterImpl.java", + "modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapter.java": "modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterImpl.java", + "modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapter.java": "modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapterImpl.java", + "modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapter.java": "modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterImpl.java", + "modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapter.java": "modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapterImpl.java", + "modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapter.java": "modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapterImpl.java", + "modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilter.java": "modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilterImpl.java", + "modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilter.java": "modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilterImpl.java", + "modules/security-bff/src/main/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandler.java": "modules/security-bff/src/main/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandlerImpl.java", + "modules/security-bff/src/main/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandler.java": "modules/security-bff/src/main/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandlerImpl.java", + "modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapter.java": "modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapterImpl.java", + "modules/security-core/src/main/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapper.java": "modules/security-core/src/main/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapperImpl.java", + "modules/security-core/src/main/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCache.java": "modules/security-core/src/main/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCacheImpl.java", + "modules/security-core/src/main/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapter.java": "modules/security-core/src/main/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapterImpl.java", + "modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapter.java": "modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapterImpl.java", + "modules/security-core/src/main/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolver.java": "modules/security-core/src/main/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolverImpl.java", + "modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapter.java": "modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterImpl.java", + "modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapter.java": "modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapterImpl.java", + "modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/B2CAdminService.java": "modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/B2CAdminServiceImpl.java", + "modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/EntraIdAdminService.java": "modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/EntraIdAdminServiceImpl.java", + "modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapter.java": "modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapterImpl.java", + "modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpMetrics.java": "modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpMetricsImpl.java", + "modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManager.java": "modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManagerImpl.java", + "modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverter.java": "modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverterImpl.java", + "modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveActiveJwtDecoder.java": "modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveActiveJwtDecoderImpl.java", + "modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuard.java": "modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuardImpl.java", + "modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapter.java": "modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapterImpl.java", + "modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPort.java": "modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPortImpl.java", + "modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManager.java": "modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManagerImpl.java", + "modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilter.java": "modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilterImpl.java", + "modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapter.java": "modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapterImpl.java", + "modules/starter-application/src/main/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributor.java": "modules/starter-application/src/main/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributorImpl.java", + "modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfig.java": "modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfigImpl.java", + "modules/starter-application/src/main/java/org/fireflyframework/common/application/config/StatelessApplicationEnvironmentPostProcessor.java": "modules/starter-application/src/main/java/org/fireflyframework/common/application/config/StatelessApplicationEnvironmentPostProcessorImpl.java", + "modules/starter-application/src/main/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicator.java": "modules/starter-application/src/main/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicatorImpl.java", + "modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultConfigResolver.java": "modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultConfigResolverImpl.java", + "modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultContextResolver.java": "modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultContextResolverImpl.java", + "modules/starter-application/src/main/java/org/fireflyframework/common/application/security/DefaultSecurityAuthorizationService.java": "modules/starter-application/src/main/java/org/fireflyframework/common/application/security/DefaultSecurityAuthorizationServiceImpl.java", + "modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/YamlPropertySourceFactory.java": "modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/YamlPropertySourceFactoryImpl.java", + "modules/starter-core/src/main/java/org/fireflyframework/core/actuator/health/LoggingHealthIndicator.java": "modules/starter-core/src/main/java/org/fireflyframework/core/actuator/health/LoggingHealthIndicatorImpl.java", + "modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationExchangeFilter.java": "modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationExchangeFilterImpl.java", + "modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationWebFilter.java": "modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationWebFilterImpl.java", + "modules/starter-core/src/main/java/org/fireflyframework/core/config/TransactionFilter.java": "modules/starter-core/src/main/java/org/fireflyframework/core/config/TransactionFilterImpl.java", + "modules/starter-core/src/main/java/org/fireflyframework/core/logging/examples/LoggingExampleRunner.java": "modules/starter-core/src/main/java/org/fireflyframework/core/logging/examples/LoggingExampleRunnerImpl.java", + "modules/starter-data/src/main/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicator.java": "modules/starter-data/src/main/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicatorImpl.java", + "modules/starter-data/src/main/java/org/fireflyframework/data/lineage/InMemoryLineageTracker.java": "modules/starter-data/src/main/java/org/fireflyframework/data/lineage/InMemoryLineageTrackerImpl.java", + "modules/starter-data/src/main/java/org/fireflyframework/data/observability/JobMetricsService.java": "modules/starter-data/src/main/java/org/fireflyframework/data/observability/JobMetricsServiceImpl.java", + "modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/NotNullRule.java": "modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/NotNullRuleImpl.java", + "modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/PatternRule.java": "modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/PatternRuleImpl.java", + "modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/RangeRule.java": "modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/RangeRuleImpl.java", + "modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformer.java": "modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformerImpl.java", + "modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformer.java": "modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformerImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/AccountNumberValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/AccountNumberValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/AmountValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/AmountValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/BicValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/BicValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/CVVValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/CVVValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/CreditCardValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/CreditCardValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/CurrencyCodeValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/CurrencyCodeValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/DateTimeValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/DateTimeValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/DateValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/DateValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/IbanValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/IbanValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/InterestRateValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/InterestRateValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/NationalIdValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/NationalIdValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/PINValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/PINValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/PasswordStrengthValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/PasswordStrengthValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/PhoneNumberValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/PhoneNumberValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/SortCodeValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/SortCodeValidatorImpl.java", + "modules/validators/src/main/java/org/fireflyframework/validators/TaxIdValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/TaxIdValidatorImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/conditions/listener/ConditionsReportListener.java": "modules/web/src/main/java/org/fireflyframework/web/conditions/listener/ConditionsReportListenerImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/DataAccessExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/DataAccessExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpClientErrorExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpClientErrorExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpServerErrorExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpServerErrorExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/JpaExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/JpaExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/JsonExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/JsonExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/NetworkExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/NetworkExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/OptimisticLockingFailureExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/OptimisticLockingFailureExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/Resilience4jExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/Resilience4jExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/SecurityExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/SecurityExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/ValidationExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/ValidationExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverter.java": "modules/web/src/main/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/idempotency/cache/FireflyCacheIdempotencyAdapter.java": "modules/web/src/main/java/org/fireflyframework/web/idempotency/cache/FireflyCacheIdempotencyAdapterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilter.java": "modules/web/src/main/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/idempotency/scope/AuthenticatedIdempotencyScopeResolver.java": "modules/web/src/main/java/org/fireflyframework/web/idempotency/scope/AuthenticatedIdempotencyScopeResolverImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/logging/appender/PiiMaskingAppender.java": "modules/web/src/main/java/org/fireflyframework/web/logging/appender/PiiMaskingAppenderImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilter.java": "modules/web/src/main/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilterImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizer.java": "modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizerImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOperationCustomizer.java": "modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOperationCustomizerImpl.java", + "modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizer.java": "modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizerImpl.java", + "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/filter/TracingWebFilter.java": "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/filter/TracingWebFilterImpl.java", + "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/RedisConnectivityHealthIndicator.java": "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/RedisConnectivityHealthIndicatorImpl.java", + "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookCircuitBreakerHealthIndicator.java": "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookCircuitBreakerHealthIndicatorImpl.java", + "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformLivenessIndicator.java": "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformLivenessIndicatorImpl.java", + "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformReadinessIndicator.java": "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformReadinessIndicatorImpl.java", + "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsService.java": "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceImpl.java", + "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/resilience/ResilientWebhookProcessingService.java": "modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/resilience/ResilientWebhookProcessingServiceImpl.java", + "modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyService.java": "modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyServiceImpl.java" + } +} diff --git a/docs/site/architecture.md b/docs/site/architecture.md index e047ec99b..46071ae3d 100644 --- a/docs/site/architecture.md +++ b/docs/site/architecture.md @@ -43,7 +43,7 @@ The query-cache invalidation bridge requires the relevant cache beans and matchi A command can still return successfully when event publication fails. The bus and bridge do not turn independent work into a distributed transaction or exactly-once processing. Define the application's transaction, retry, and idempotency policy from the chosen storage and transport behavior. -Sources: [command bus pipeline](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/DefaultCommandBus.java), [bridge conditions](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsEdaAutoConfiguration.java), [event publisher factory](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/publisher/EventPublisherFactory.java). +Sources: [command bus pipeline](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cqrs/src/main/java/org/fireflyframework/cqrs/command/DefaultCommandBusImpl.java), [bridge conditions](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cqrs/src/main/java/org/fireflyframework/cqrs/config/CqrsEdaAutoConfiguration.java), [event publisher factory](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/publisher/EventPublisherFactory.java). ## Find a capability diff --git a/docs/site/capabilities/domain-and-data.md b/docs/site/capabilities/domain-and-data.md index 246c0f8b5..5808f5d66 100644 --- a/docs/site/capabilities/domain-and-data.md +++ b/docs/site/capabilities/domain-and-data.md @@ -18,7 +18,7 @@ A cache is not the durable source of an application record. A blob store does no ## Reconstruct one application -Follow [Keep an onboarding history](../guides/onboarding-event-store.md). Its separate project uses `R2dbcEventStore` with a real PostgreSQL container: +Follow [Keep an onboarding history](../guides/onboarding-event-store.md). Its separate project uses `R2dbcEventStoreImpl` with a real PostgreSQL container: 1. Submit an application and append `ApplicationSubmitted`. 2. Reload a fresh aggregate from its typed event history. diff --git a/docs/site/guides/onboarding-event-store.md b/docs/site/guides/onboarding-event-store.md index 887e68793..a4504a64e 100644 --- a/docs/site/guides/onboarding-event-store.md +++ b/docs/site/guides/onboarding-event-store.md @@ -10,7 +10,7 @@ The complete project is [`docs/examples/onboarding-event-store`](https://github. - The aggregate produces events. R2dbcEventStore appends them with an expected version in PostgreSQL. Reading the ordered, typed history reconstructs a fresh aggregate. + The aggregate produces events. R2dbcEventStoreImpl appends them with an expected version in PostgreSQL. Reading the ordered, typed history reconstructs a fresh aggregate. ## Run the project @@ -75,7 +75,7 @@ Loading creates a new aggregate and passes its ordered history to `loadFromHisto ## Configure the PostgreSQL boundary -The test creates one `PostgresqlConnectionFactory` and uses it for `DatabaseClient`, `R2dbcEntityTemplate`, `R2dbcTransactionManager`, and `TransactionalOperator`. Those objects are passed to `R2dbcEventStore`. The test also registers the concrete event types with its Jackson mapper. +The test creates one `PostgresqlConnectionFactory` and uses it for `DatabaseClient`, `R2dbcEntityTemplate`, `R2dbcTransactionManager`, and `TransactionalOperator`. Those objects are passed to `R2dbcEventStoreImpl`. The test also registers the concrete event types with its Jackson mapper. Its SQL fixture follows the event store's table contract: diff --git a/docs/site/modules/agentic-bridge-autoconfigure.md b/docs/site/modules/agentic-bridge-autoconfigure.md index 8792cdc63..fcbf94da0 100644 --- a/docs/site/modules/agentic-bridge-autoconfigure.md +++ b/docs/site/modules/agentic-bridge-autoconfigure.md @@ -68,8 +68,8 @@ Property-based wiring conditions found in this module: | [`AgenticBridgeProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeProperties.java) | Spring Boot configuration binding for `firefly.agentic-bridge.*`. | | [`AgenticBridgeFactory`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeFactory.java) | Factory that materialises framework objects from `AgenticBridgeProperties`. | | [`AgenticBridgeAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeAutoConfiguration.java) | Defines `fireflyAgenticClient`, `fireflyAgenticBridge` operations. | -| [`AgenticBridgeHealthIndicator`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicator.java) | Reactive Spring Boot Actuator health indicator backed by `AgenticBridge#health()`. | -| [`AgenticBridgeHealthAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthAutoConfiguration.java) | Wires the `AgenticBridgeHealthIndicator` when Spring Boot Actuator is on the classpath and the indicator hasn't been disabled via `management.health.firefly-agentic-bridge.enabled=false`. | +| [`AgenticBridgeHealthIndicatorImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicatorImpl.java) | Reactive Spring Boot Actuator health indicator backed by `AgenticBridge#health()`. | +| [`AgenticBridgeHealthAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthAutoConfiguration.java) | Wires the `AgenticBridgeHealthIndicatorImpl` when Spring Boot Actuator is on the classpath and the indicator hasn't been disabled via `management.health.firefly-agentic-bridge.enabled=false`. | ## Related components diff --git a/docs/site/modules/cache-hazelcast.md b/docs/site/modules/cache-hazelcast.md index 5f0cb135a..089b65470 100644 --- a/docs/site/modules/cache-hazelcast.md +++ b/docs/site/modules/cache-hazelcast.md @@ -60,7 +60,7 @@ The Java examples in this section are API fragments for application code. Use th ``` With both the `HazelcastInstance` bean on the context and the property set, the core -`CacheManagerFactory` discovers `HazelcastProvider` through the SPI and routes all cache operations to +`CacheManagerFactory` discovers `HazelcastProviderImpl` through the SPI and routes all cache operations to Hazelcast. Your application code keeps using the standard Firefly cache API. Nothing else changes. ## Configuration and wiring @@ -71,7 +71,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`HazelcastProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProvider.java) | Defines `create` operations. | +| [`HazelcastProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProviderImpl.java) | Defines `create` operations. | | [`HazelcastCacheHelper`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/factory/HazelcastCacheHelper.java) | Reflection-based helper to create a Hazelcast-backed CacheAdapter without a compile-time dependency. | ## Related components @@ -123,7 +123,7 @@ void hazelcastProviderIsDiscoveredViaServiceLoader() { .findFirst() .orElseThrow(); - assertThat(hazelcast).isInstanceOf(HazelcastProvider.class); + assertThat(hazelcast).isInstanceOf(HazelcastProviderImpl.class); } ``` @@ -138,7 +138,7 @@ Application code fireflyframework-cache ──► CacheManagerFactory │ ServiceLoader lookup of CacheProviderFactory ▼ - HazelcastProvider (CacheType.HAZELCAST, priority 20) + HazelcastProviderImpl (CacheType.HAZELCAST, priority 20) │ wraps the host HazelcastInstance bean ▼ HazelcastCacheHelper / HazelcastCacheAdapterReflective diff --git a/docs/site/modules/cache-jcache.md b/docs/site/modules/cache-jcache.md index 44667edb7..3d863e453 100644 --- a/docs/site/modules/cache-jcache.md +++ b/docs/site/modules/cache-jcache.md @@ -4,7 +4,7 @@ Adapt a host-managed JCache implementation to the common cache contract. -Provide the JCache CacheManager expected by JCacheProvider and select JCACHE through the core settings. The application owns the JSR-107 implementation and cache configuration. +Provide the JCache CacheManager expected by JCacheProviderImpl and select JCACHE through the core settings. The application owns the JSR-107 implementation and cache configuration. | Maven artifact | Packaging | Source project | | --- | --- | --- | @@ -68,7 +68,7 @@ import lombok.RequiredArgsConstructor; @RequiredArgsConstructor public class ProductService { - private final FireflyCacheManager cache; // from fireflyframework-cache + private final FireflyCacheManagerImpl cache; // from fireflyframework-cache @@ -88,7 +88,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`JCacheProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProvider.java) | Defines `create` operations. | +| [`JCacheProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProviderImpl.java) | Defines `create` operations. | | [`JCacheCacheHelper`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-jcache/src/main/java/org/fireflyframework/cache/factory/JCacheCacheHelper.java) | Reflection-based helper to create a JCache-backed CacheAdapter (JSR-107) without a compile-time dependency. | ## Related components @@ -132,7 +132,7 @@ void serviceLoaderDiscoversJCacheProvider() { assertThat(jcache) .as("ServiceLoader must discover a CacheProviderFactory with getType() == JCACHE") .isNotNull(); - assertThat(jcache).isInstanceOf(JCacheProvider.class); + assertThat(jcache).isInstanceOf(JCacheProviderImpl.class); assertThat(jcache.getType()).isEqualTo(CacheType.JCACHE); assertThat(jcache.priority()).isEqualTo(30); } @@ -159,9 +159,9 @@ All other cache tuning (default TTL, per-cache settings, statistics, health) is ### How It Works 1. At startup, the Firefly cache core scans the classpath via `ServiceLoader` for `CacheProviderFactory` implementations registered under `META-INF/services/`. -2. This module registers `JCacheProvider`, which advertises `CacheType.JCACHE` and priority `30`. +2. This module registers `JCacheProviderImpl`, which advertises `CacheType.JCACHE` and priority `30`. 3. When `firefly.cache.default-cache-type=JCACHE`, the core invokes the provider with a context carrying your `CacheManager` bean. -4. `JCacheProvider` wraps the manager in `JCacheCacheHelper` (handling `javax`/`jakarta` reflectively) and returns a reactive `CacheAdapter` with a portable TTL overlay layered on top of the JCache store. +4. `JCacheProviderImpl` wraps the manager in `JCacheCacheHelper` (handling `javax`/`jakarta` reflectively) and returns a reactive `CacheAdapter` with a portable TTL overlay layered on top of the JCache store. ## Continue the application diff --git a/docs/site/modules/cache-postgres.md b/docs/site/modules/cache-postgres.md index 133602bb4..cf5e60f1f 100644 --- a/docs/site/modules/cache-postgres.md +++ b/docs/site/modules/cache-postgres.md @@ -62,12 +62,12 @@ firefly: password: secret ``` -3. Use the unified cache API. Obtain a `CacheAdapter` from the core `FireflyCacheManager`; it is +3. Use the unified cache API. Obtain a `CacheAdapter` from the core `FireflyCacheManagerImpl`; it is now backed by PostgreSQL with no other code changes: ```java import org.fireflyframework.cache.core.CacheAdapter; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.springframework.stereotype.Service; import reactor.core.publisher.Mono; @@ -76,7 +76,7 @@ public class ProductService { private final CacheAdapter cache; - public ProductService(FireflyCacheManager cacheManager) { + public ProductService(FireflyCacheManagerImpl cacheManager) { this.cache = cacheManager.getCache("products"); // CacheType.POSTGRES when selected } @@ -104,11 +104,11 @@ Property-based wiring conditions found in this module: | Type | Contract and responsibility | | --- | --- | -| [`PostgresCacheAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapter.java) | PostgreSQL-backed reactive cache adapter implemented over R2DBC. | -| [`PostgresProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProvider.java) | `CacheProviderFactory` implementation that contributes the PostgreSQL R2DBC cache provider. | +| [`PostgresCacheAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterImpl.java) | PostgreSQL-backed reactive cache adapter implemented over R2DBC. | +| [`PostgresProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProviderImpl.java) | `CacheProviderFactory` implementation that contributes the PostgreSQL R2DBC cache provider. | | [`PostgresCacheConfig`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheConfig.java) | Configuration for the PostgreSQL R2DBC cache adapter. | | [`PostgresCacheAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/config/PostgresCacheAutoConfiguration.java) | Auto-configuration for the PostgreSQL R2DBC cache provider. | -| [`PostgresCacheHelper`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/factory/PostgresCacheHelper.java) | Self-contained factory helper that builds a `PostgresCacheAdapter`. | +| [`PostgresCacheHelper`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/factory/PostgresCacheHelper.java) | Self-contained factory helper that builds a `PostgresCacheAdapterImpl`. | ## Related components @@ -240,16 +240,16 @@ If you disable `auto-create-schema`, create this table and index manually before `META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports`. Activates when the R2DBC SPI is on the classpath and `firefly.cache.postgres.enabled=true`. Builds the pooled `fireflyCachePostgresConnectionFactory` bean and, when enabled, provisions the schema. -- `PostgresProvider` (`org.fireflyframework.cache.spi.providers`). the `CacheProviderFactory` SPI +- `PostgresProviderImpl` (`org.fireflyframework.cache.spi.providers`). the `CacheProviderFactory` SPI implementation, registered for `ServiceLoader` in `META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory`. Reports `CacheType.POSTGRES` with priority 15 and is available when the connection factory is present and the provider is enabled. - `PostgresCacheHelper` (`org.fireflyframework.cache.factory`). the factory helper the cache core references reflectively to build adapters; its fully-qualified name is load-bearing and must not be renamed or moved. -- `PostgresCacheAdapter` (`org.fireflyframework.cache.adapter.postgres`). the `CacheAdapter` +- `PostgresCacheAdapterImpl` (`org.fireflyframework.cache.adapter.postgres`). the `CacheAdapter` implementation. Stores entries in the relational table via the R2DBC `ConnectionFactory`, serializes - values with `JsonCacheSerializer`, namespaces keys per cache, enforces TTL, and reports + values with `JsonCacheSerializerImpl`, namespaces keys per cache, enforces TTL, and reports `CacheStats`/`CacheHealth`. - `PostgresCacheConfig` (`org.fireflyframework.cache.adapter.postgres`). immutable per-adapter config (cache name, key prefix, default TTL, schema, table). diff --git a/docs/site/modules/cache-redis.md b/docs/site/modules/cache-redis.md index 4a9ae1d42..9f8e3c6c4 100644 --- a/docs/site/modules/cache-redis.md +++ b/docs/site/modules/cache-redis.md @@ -93,8 +93,8 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`RedisCacheAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapter.java) | Redis-based cache adapter implementation. | -| [`RedisProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProvider.java) | Defines `create` operations. | +| [`RedisCacheAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterImpl.java) | Redis-based cache adapter implementation. | +| [`RedisProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProviderImpl.java) | Defines `create` operations. | | [`RedisCacheConfig`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheConfig.java) | Configuration class for Redis cache adapter. | | [`RedisCacheAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/config/RedisCacheAutoConfiguration.java) | Auto-configuration for Redis infrastructure beans used by fireflyframework-cache. | | [`RedisCacheHelper`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/factory/RedisCacheHelper.java) | Helper class for creating Redis cache adapters. | @@ -141,7 +141,7 @@ void shouldNotCreateRedisBeansWhenRedisDisabled() { ) .run(context -> { assertThat(context).hasSingleBean(CacheProperties.class); - assertThat(context).hasSingleBean(FireflyCacheManager.class); + assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class); // Should not create Redis beans when disabled assertThat(context).doesNotHaveBean(ReactiveRedisConnectionFactory.class); diff --git a/docs/site/modules/cache.md b/docs/site/modules/cache.md index 1b6ed5ff5..06c04805e 100644 --- a/docs/site/modules/cache.md +++ b/docs/site/modules/cache.md @@ -4,7 +4,7 @@ Use a common cache API with a local Caffeine default and pluggable distributed providers. -Depend on the core abstraction, inject FireflyCacheManager or use CacheAdapter, and choose a provider through firefly.cache. Provider discovery and selection live in the core; add only the external provider library you need. +Depend on the core abstraction, inject FireflyCacheManagerImpl or use CacheAdapter, and choose a provider through firefly.cache. Provider discovery and selection live in the core; add only the external provider library you need. | Maven artifact | Packaging | Source project | | --- | --- | --- | @@ -16,7 +16,7 @@ Part of [Domain and data](index.md#domain-and-data). ```mermaid flowchart LR - App[Application] --> Manager[FireflyCacheManager] + App[Application] --> Manager[FireflyCacheManagerImpl] Manager --> Selection[Provider selection] Selection --> SPI[CacheProviderFactory] SPI --> Local[Caffeine] @@ -48,20 +48,20 @@ The injection examples use Lombok `@RequiredArgsConstructor`. Add its provided d The Java examples in this section are API fragments for application code. Use the stated imports and supply the application-owned collaborators described alongside them. -With the dependency on the classpath, `CacheAutoConfiguration` provides a primary `FireflyCacheManager` (Caffeine by default). This application-owned API class caches onboarding status values; it does not connect itself to the tutorial repository. Compose each returned `Mono`, and evict the cached value when the authoritative status changes: +With the dependency on the classpath, `CacheAutoConfiguration` provides a primary `FireflyCacheManagerImpl` (Caffeine by default). This application-owned API class caches onboarding status values; it does not connect itself to the tutorial repository. Compose each returned `Mono`, and evict the cached value when the authoritative status changes: ```java import lombok.RequiredArgsConstructor; import java.time.Duration; import java.util.Optional; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.springframework.stereotype.Service; import reactor.core.publisher.Mono; @Service @RequiredArgsConstructor public class ApplicationStatusCache { - private final FireflyCacheManager cache; + private final FireflyCacheManagerImpl cache; @@ -84,9 +84,9 @@ Need a dedicated, namespaced cache (separate key prefix, TTL and provider)? Inje ```java import org.fireflyframework.cache.core.CacheType; import org.fireflyframework.cache.factory.CacheManagerFactory; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; -FireflyCacheManager idempotencyCache = factory.createCacheManager( +FireflyCacheManagerImpl idempotencyCache = factory.createCacheManager( "http-idempotency", CacheType.AUTO, // Redis if present, else Caffeine "firefly:http:idempotency", @@ -120,7 +120,7 @@ Property-based wiring conditions found in this module: | Type | Contract and responsibility | | --- | --- | -| [`FireflyCacheManager`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManager.java) | Unified cache manager that provides a single cache interface. | +| [`FireflyCacheManagerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManagerImpl.java) | Unified cache manager that provides a single cache interface. | | [`CacheAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache/src/main/java/org/fireflyframework/cache/core/CacheAdapter.java) | Unified interface for cache operations across different cache providers. | | [`CacheProviderFactory`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache/src/main/java/org/fireflyframework/cache/spi/CacheProviderFactory.java) | Service Provider Interface for creating cache adapters. | | [`CacheProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache/src/main/java/org/fireflyframework/cache/properties/CacheProperties.java) | Configuration properties for the Cache library. | @@ -205,7 +205,7 @@ firefly: default-cache-type: REDIS # or AUTO to auto-select the best available provider ``` -When a distributed provider is active and `firefly.cache.smart.enabled` is `true`, the factory wraps it with `SmartCacheAdapter` to provide an L1 (Caffeine) + L2 (distributed) write-through cache. +When a distributed provider is active and `firefly.cache.smart.enabled` is `true`, the factory wraps it with `SmartCacheAdapterImpl` to provide an L1 (Caffeine) + L2 (distributed) write-through cache. ### Configuration diff --git a/docs/site/modules/client.md b/docs/site/modules/client.md index 45e4eefeb..064a6c091 100644 --- a/docs/site/modules/client.md +++ b/docs/site/modules/client.md @@ -311,7 +311,7 @@ firefly: | `firefly.service-client.circuit-breaker.failure-rate-threshold` | `50.0` | Percentage of failures within the sliding window that opens the breaker. | | `firefly.service-client.retry.max-attempts` | `3` | Maximum retry attempts (with exponential backoff + optional jitter). | | `firefly.service-client.grpc.use-plaintext-by-default` | `true` | Whether new gRPC channels default to plaintext (forced to TLS in `production`). | -| `firefly.service-client.metrics.enabled` | `true` | Enables `ServiceClientMetrics` Micrometer integration (auto-disabled in `testing`). | +| `firefly.service-client.metrics.enabled` | `true` | Enables `ServiceClientMetricsImpl` Micrometer integration (auto-disabled in `testing`). | > Note: environment-aware defaults only override values you have not set explicitly, so any property you configure always wins. diff --git a/docs/site/modules/cqrs.md b/docs/site/modules/cqrs.md index a4883af2d..23c19d27f 100644 --- a/docs/site/modules/cqrs.md +++ b/docs/site/modules/cqrs.md @@ -313,7 +313,7 @@ management: Auto-configuration is split into three classes, registered via `META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports`: - `CqrsAutoConfiguration`. wires `CommandBus`, `QueryBus`, the handler registry, validation, authorization, the dedicated `cqrsQueryCacheManager`/`QueryCacheAdapter`, the correlation context, and metrics. Gated on `firefly.cqrs.enabled=true`. -- `CqrsActuatorAutoConfiguration`. registers the `CqrsMetricsEndpoint` and `CqrsHealthIndicator` when Actuator is present. +- `CqrsActuatorAutoConfiguration`. registers the `CqrsMetricsEndpoint` and `CqrsHealthIndicatorImpl` when Actuator is present. - `CqrsEdaAutoConfiguration`. registers the EDA bridge (`CommandEventPublisher`, `EventDrivenCacheInvalidator`) when `fireflyframework-eda` is on the classpath and `firefly.cqrs.eda.enabled=true`. Each command/query flows through its bus: validate → authorize → dispatch to handler → metrics & tracing. Every bean is annotated `@ConditionalOnMissingBean`, so you can override any piece by declaring your own. diff --git a/docs/site/modules/ecm-esignature-adobe-sign.md b/docs/site/modules/ecm-esignature-adobe-sign.md index a13af4218..bb47ce452 100644 --- a/docs/site/modules/ecm-esignature-adobe-sign.md +++ b/docs/site/modules/ecm-esignature-adobe-sign.md @@ -66,7 +66,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 @@ -77,7 +77,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 and wiring @@ -103,13 +103,13 @@ The `firefly.ecm.adapter.adobe-sign` namespace is bound by [AdobeSignAdapterProp Property-based wiring conditions found in this module: - `name = "firefly.ecm.esignature.provider", havingValue = "adobe-sign"`. [AdobeSignAutoConfiguration.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignAutoConfiguration.java). -- `name = "firefly.ecm.esignature.provider", havingValue = "adobe-sign"`. [AdobeSignSignatureEnvelopeAdapter.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapter.java). +- `name = "firefly.ecm.esignature.provider", havingValue = "adobe-sign"`. [AdobeSignSignatureEnvelopeAdapterImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapterImpl.java). ## Public API and extension points | 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. | @@ -140,10 +140,10 @@ Mock, local-container, and application-context tests do not establish acceptance ## API reference excerpt -Contract excerpt from [AdobeSignSignatureEnvelopeAdapter.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapter.java). This fragment needs the full type and its imports. +Contract excerpt from [AdobeSignSignatureEnvelopeAdapterImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-adobe-sign/src/main/java/org/fireflyframework/ecm/adapter/adobesign/AdobeSignSignatureEnvelopeAdapterImpl.java). This fragment needs the full type and its imports. ```java -public class AdobeSignSignatureEnvelopeAdapter implements SignatureEnvelopePort { +public class AdobeSignSignatureEnvelopeAdapterImpl implements SignatureEnvelopePort { private final WebClient webClient; private final AdobeSignAdapterProperties properties; private final ObjectMapper objectMapper; @@ -155,7 +155,7 @@ public class AdobeSignSignatureEnvelopeAdapter implements SignatureEnvelopePort private final Map externalIdMapping = new ConcurrentHashMap<>(); private volatile String accessToken; private volatile Instant tokenExpiresAt; - public AdobeSignSignatureEnvelopeAdapter(WebClient webClient, + public AdobeSignSignatureEnvelopeAdapterImpl(WebClient webClient, AdobeSignAdapterProperties properties, ObjectMapper objectMapper, DocumentContentPort documentContentPort, @@ -225,7 +225,7 @@ A ready-to-import profile is bundled at `src/main/resources/application-adobe-si ### How It Works -`AdobeSignSignatureEnvelopeAdapter` translates the provider-neutral `SignatureEnvelope` domain model into Adobe Sign *agreements*: +`AdobeSignSignatureEnvelopeAdapterImpl` translates the provider-neutral `SignatureEnvelope` domain model into Adobe Sign *agreements*: - Authentication. `ensureValidAccessToken()` exchanges the configured `refresh-token` for an access token via Adobe Sign's `/oauth/token` endpoint, caching it until shortly before expiry. - Create. `createEnvelope(...)` `POST`s an agreement to `/api/rest/{apiVersion}/agreements`, records the bidirectional mapping between the framework envelope `UUID` and the Adobe Sign agreement id, and returns the envelope in `DRAFT` status with provider `ADOBE_SIGN`. diff --git a/docs/site/modules/ecm-esignature-docusign.md b/docs/site/modules/ecm-esignature-docusign.md index bcbe05f56..c599da429 100644 --- a/docs/site/modules/ecm-esignature-docusign.md +++ b/docs/site/modules/ecm-esignature-docusign.md @@ -111,13 +111,13 @@ The `firefly.ecm.adapter.docusign` namespace is bound by [DocuSignAdapterPropert Property-based wiring conditions found in this module: - `name = "firefly.ecm.esignature.provider", havingValue = "docusign"`. [DocuSignAdapterAutoConfiguration.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignAdapterAutoConfiguration.java). -- `name = "firefly.ecm.esignature.provider", havingValue = "docusign"`. [DocuSignSignatureEnvelopeAdapter.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapter.java). +- `name = "firefly.ecm.esignature.provider", havingValue = "docusign"`. [DocuSignSignatureEnvelopeAdapterImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapterImpl.java). ## Public API and extension points | 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. | @@ -148,10 +148,10 @@ Mock, local-container, and application-context tests do not establish acceptance ## API reference excerpt -Contract excerpt from [DocuSignSignatureEnvelopeAdapter.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapter.java). This fragment needs the full type and its imports. +Contract excerpt from [DocuSignSignatureEnvelopeAdapterImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/DocuSignSignatureEnvelopeAdapterImpl.java). This fragment needs the full type and its imports. ```java -public class DocuSignSignatureEnvelopeAdapter implements SignatureEnvelopePort { +public class DocuSignSignatureEnvelopeAdapterImpl implements SignatureEnvelopePort { private final ApiClient apiClient; private final EnvelopesApi envelopesApi; private final DocuSignAdapterProperties properties; @@ -159,7 +159,7 @@ public class DocuSignSignatureEnvelopeAdapter implements SignatureEnvelopePort { private final DocumentPort documentPort; private final Map envelopeIdMapping = new ConcurrentHashMap<>(); private final Map externalIdMapping = new ConcurrentHashMap<>(); - public DocuSignSignatureEnvelopeAdapter(ApiClient apiClient, + public DocuSignSignatureEnvelopeAdapterImpl(ApiClient apiClient, DocuSignAdapterProperties properties, DocumentContentPort documentContentPort, DocumentPort documentPort) { @@ -168,7 +168,7 @@ public class DocuSignSignatureEnvelopeAdapter implements SignatureEnvelopePort { this.documentContentPort = documentContentPort; this.documentPort = documentPort; this.envelopesApi = new EnvelopesApi(apiClient); - log.info("DocuSignSignatureEnvelopeAdapter initialized for account: {} with document integration", + log.info("DocuSignSignatureEnvelopeAdapterImpl initialized for account: {} with document integration", properties.getAccountId()); } public Mono createEnvelope(SignatureEnvelope envelope) { @@ -246,9 +246,9 @@ firefly: ### How It Works -1. Activation. `DocuSignAdapterAutoConfiguration` and `DocuSignSignatureEnvelopeAdapter` are both `@ConditionalOnProperty(firefly.ecm.esignature.provider=docusign)`, and the auto-config is also `@ConditionalOnClass(ApiClient.class)`, so the adapter only engages when DocuSign is selected and the SDK is present. +1. Activation. `DocuSignAdapterAutoConfiguration` and `DocuSignSignatureEnvelopeAdapterImpl` are both `@ConditionalOnProperty(firefly.ecm.esignature.provider=docusign)`, and the auto-config is also `@ConditionalOnClass(ApiClient.class)`, so the adapter only engages when DocuSign is selected and the SDK is present. 2. Authentication. The auto-configuration builds a DocuSign `ApiClient`, sets the base path / timeouts, and performs the JWT Grant flow (`requestJWTUserToken` with `signature` + `impersonation` scopes), then validates that `account-id` is among the authenticated user's accounts. -3. Operations. `DocuSignSignatureEnvelopeAdapter` wraps `EnvelopesApi` and maps Firefly's `SignatureEnvelope` model to DocuSign `EnvelopeDefinition`/`Envelope` calls, returning reactive `Mono`/`Flux`. Internal maps track the Firefly `UUID` ↔ DocuSign envelope-ID correspondence. +3. Operations. `DocuSignSignatureEnvelopeAdapterImpl` wraps `EnvelopesApi` and maps Firefly's `SignatureEnvelope` model to DocuSign `EnvelopeDefinition`/`Envelope` calls, returning reactive `Mono`/`Flux`. Internal maps track the Firefly `UUID` ↔ DocuSign envelope-ID correspondence. 4. Override points. The `ApiClient` bean is `@ConditionalOnMissingBean`, so you can supply your own pre-authenticated client (e.g. A custom auth strategy or a test stub) and the adapter will use it. ## Continue the application diff --git a/docs/site/modules/ecm-esignature-logalty.md b/docs/site/modules/ecm-esignature-logalty.md index 3b3b976b0..3fdd90a77 100644 --- a/docs/site/modules/ecm-esignature-logalty.md +++ b/docs/site/modules/ecm-esignature-logalty.md @@ -50,7 +50,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 @@ -110,13 +110,13 @@ The `firefly.ecm.adapter.logalty` namespace is bound by [LogaltyAdapterPropertie Property-based wiring conditions found in this module: - `name = "firefly.ecm.esignature.provider", havingValue = "logalty"`. [LogaltyAdapterAutoConfiguration.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltyAdapterAutoConfiguration.java). -- `name = "firefly.ecm.esignature.provider", havingValue = "logalty"`. [LogaltySignatureEnvelopeAdapter.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapter.java). +- `name = "firefly.ecm.esignature.provider", havingValue = "logalty"`. [LogaltySignatureEnvelopeAdapterImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapterImpl.java). ## Public API and extension points | 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. | @@ -143,10 +143,10 @@ This subproject has no authored `src/test/java` suite. Its Maven build still val ## API reference excerpt -Contract excerpt from [LogaltySignatureEnvelopeAdapter.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapter.java). This fragment needs the full type and its imports. +Contract excerpt from [LogaltySignatureEnvelopeAdapterImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-esignature-logalty/src/main/java/org/fireflyframework/ecm/adapter/logalty/LogaltySignatureEnvelopeAdapterImpl.java). This fragment needs the full type and its imports. ```java -public class LogaltySignatureEnvelopeAdapter implements SignatureEnvelopePort { +public class LogaltySignatureEnvelopeAdapterImpl implements SignatureEnvelopePort { private final WebClient webClient; private final LogaltyAdapterProperties properties; private final ObjectMapper objectMapper; @@ -158,7 +158,7 @@ public class LogaltySignatureEnvelopeAdapter implements SignatureEnvelopePort { private final Map externalIdMapping = new ConcurrentHashMap<>(); private volatile String accessToken; private volatile Instant tokenExpiresAt; - public LogaltySignatureEnvelopeAdapter(WebClient webClient, + public LogaltySignatureEnvelopeAdapterImpl(WebClient webClient, LogaltyAdapterProperties properties, ObjectMapper objectMapper, DocumentContentPort documentContentPort, @@ -256,7 +256,7 @@ firefly: - a named `logaltyCircuitBreaker` (`CircuitBreaker`). 50% failure-rate threshold, 30s open state, sliding window of 10, automatic open→half-open transition; - a named `logaltyRetry` (`Retry`). `max-retries` attempts retrying socket/IO/`WebClientRequestException` failures; - a Logalty-tuned `ObjectMapper`; and -- the `LogaltySignatureEnvelopeAdapter` (`SignatureEnvelopePort`) wired with the ECM `DocumentPort` and `DocumentContentPort`. +- the `LogaltySignatureEnvelopeAdapterImpl` (`SignatureEnvelopePort`) wired with the ECM `DocumentPort` and `DocumentContentPort`. Every outbound call goes through `ensureValidAccessToken()` (cached OAuth2 token with a 60-second safety margin) and is decorated with the circuit breaker and retry operators (`transformDeferred(CircuitBreakerOperator.of(...))` / `RetryOperator.of(...)`). Logalty status values are normalised to the ECM `EnvelopeStatus` enum (`DRAFT`, `SENT`, `COMPLETED`, `VOIDED`, `EXPIRED`). diff --git a/docs/site/modules/ecm-storage-aws.md b/docs/site/modules/ecm-storage-aws.md index 734edd296..a45374e11 100644 --- a/docs/site/modules/ecm-storage-aws.md +++ b/docs/site/modules/ecm-storage-aws.md @@ -48,7 +48,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): @@ -86,7 +86,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); @@ -117,13 +117,13 @@ Property-based wiring conditions found in this module: - `name = "firefly.ecm.adapter-type", havingValue = "s3"`. [S3AdapterAutoConfiguration.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3AdapterAutoConfiguration.java). - `name = "firefly.ecm.adapter-type", havingValue = "s3"`. [S3Beans.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3Beans.java). -- `name = "firefly.ecm.adapter-type", havingValue = "s3"`. [S3DocumentContentAdapter.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapter.java). +- `name = "firefly.ecm.adapter-type", havingValue = "s3"`. [S3DocumentContentAdapterImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-aws/src/main/java/org/fireflyframework/ecm/adapter/s3/S3DocumentContentAdapterImpl.java). ## Public API and extension points | 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. | @@ -169,7 +169,7 @@ ResponseInputStream ris = new ResponseInputStream<>( ); 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/docs/site/modules/ecm-storage-azure.md b/docs/site/modules/ecm-storage-azure.md index 44ed5a9f5..cc054ee44 100644 --- a/docs/site/modules/ecm-storage-azure.md +++ b/docs/site/modules/ecm-storage-azure.md @@ -61,7 +61,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) { @@ -101,13 +101,13 @@ The `firefly.ecm.adapter.azure-blob` namespace is bound by [AzureBlobAdapterProp Property-based wiring conditions found in this module: - `name = "firefly.ecm.adapter-type", havingValue = "azure-blob"`. [AzureBlobAutoConfiguration.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobAutoConfiguration.java). -- `name = "firefly.ecm.adapter-type", havingValue = "azure-blob"`. [AzureBlobDocumentContentAdapter.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapter.java). +- `name = "firefly.ecm.adapter-type", havingValue = "azure-blob"`. [AzureBlobDocumentContentAdapterImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapterImpl.java). ## Public API and extension points | 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. | @@ -138,23 +138,23 @@ Mock, local-container, and application-context tests do not establish acceptance ## API reference excerpt -Contract excerpt from [AzureBlobDocumentContentAdapter.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapter.java). This fragment needs the full type and its imports. +Contract excerpt from [AzureBlobDocumentContentAdapterImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/ecm-storage-azure/src/main/java/org/fireflyframework/ecm/adapter/azureblob/AzureBlobDocumentContentAdapterImpl.java). This fragment needs the full type and its imports. ```java -public class AzureBlobDocumentContentAdapter implements DocumentContentPort { +public class AzureBlobDocumentContentAdapterImpl implements DocumentContentPort { private final BlobContainerClient containerClient; private final AzureBlobAdapterProperties properties; private final DataBufferFactory dataBufferFactory; private final CircuitBreaker circuitBreaker; private final Retry retry; - public AzureBlobDocumentContentAdapter(BlobContainerClient containerClient, + public AzureBlobDocumentContentAdapterImpl(BlobContainerClient containerClient, AzureBlobAdapterProperties properties, this.containerClient = containerClient; this.properties = properties; this.dataBufferFactory = new DefaultDataBufferFactory(); this.circuitBreaker = circuitBreaker; this.retry = retry; - log.info("AzureBlobDocumentContentAdapter initialized with container: {}, prefix: {}, resilience enabled", + log.info("AzureBlobDocumentContentAdapterImpl initialized with container: {}, prefix: {}, resilience enabled", properties.getContainerName(), properties.getPathPrefix()); } public Flux getContentStream(UUID documentId) { diff --git a/docs/site/modules/ecm.md b/docs/site/modules/ecm.md index c40d1d4ef..0bb9daa68 100644 --- a/docs/site/modules/ecm.md +++ b/docs/site/modules/ecm.md @@ -98,9 +98,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: @@ -115,7 +115,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 ... } ``` @@ -263,9 +263,9 @@ firefly: # The two built-in local adapters are opt-in and live outside the blocks above: search: - enabled: false # registers LocalDocumentSearchAdapter when true + enabled: false # registers LocalDocumentSearchAdapterImpl when true permissions: - enabled: false # registers LocalPermissionAdapter when true + enabled: false # registers LocalPermissionAdapterImpl when true ``` Key properties: @@ -280,8 +280,8 @@ Key properties: | `firefly.ecm.defaults.*` | see above | Upload validation: size limit, allowed/blocked extensions, checksum algorithm, default folder. | | `firefly.ecm.connection.*` | see above | Timeouts, pool size and retry attempts for adapter connections. | | `firefly.ecm.performance.*` | see above | Batch size, caching and compression toggles. | -| `firefly.ecm.search.enabled` | `false` | Registers the in-memory `LocalDocumentSearchAdapter`. | -| `firefly.ecm.permissions.enabled` | `false` | Registers the in-memory `LocalPermissionAdapter`. | +| `firefly.ecm.search.enabled` | `false` | Registers the in-memory `LocalDocumentSearchAdapterImpl`. | +| `firefly.ecm.permissions.enabled` | `false` | Registers the in-memory `LocalPermissionAdapterImpl`. | > Security note: if `permissions` or `security` is enabled but no real adapter is found, the no-op fallback denies by default and logs a warning. Always configure a real adapter for production. @@ -301,7 +301,7 @@ your application │ (by adapter-type / esignature.provider) │ │ │ │ Fallback: NoOpAdapterFactory (deny-by-default for security) │ -│ Built-in: LocalDocumentSearchAdapter, LocalPermissionAdapter│ +│ Built-in: LocalDocumentSearchAdapterImpl, LocalPermissionAdapterImpl│ └─────────────────────────────────────────────────────────────┘ ▲ ▲ │ classpath adapters │ @@ -313,7 +313,7 @@ your application ### Observability -`EcmMetrics` (auto-configured via `EcmObservabilityAutoConfiguration`, built on `fireflyframework-observability`) publishes Micrometer meters: +`EcmMetricsImpl` (auto-configured via `EcmObservabilityAutoConfiguration`, built on `fireflyframework-observability`) publishes Micrometer meters: - `firefly.ecm.documents.operations`. counter, tagged by `operation` - `firefly.ecm.operation.duration`. timer, tagged by `operation`, `provider` diff --git a/docs/site/modules/eda-kafka.md b/docs/site/modules/eda-kafka.md index 737135868..132233998 100644 --- a/docs/site/modules/eda-kafka.md +++ b/docs/site/modules/eda-kafka.md @@ -98,16 +98,16 @@ Property-based wiring conditions found in this module: - `prefix = "firefly.eda", name = "enabled", havingValue = "true", matchIfMissing = true`. [FireflyEdaKafkaConsumerAutoConfiguration.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaConsumerAutoConfiguration.java). - `prefix = "firefly.eda", name = "enabled", havingValue = "true", matchIfMissing = true`. [FireflyEdaKafkaPublisherAutoConfiguration.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/config/FireflyEdaKafkaPublisherAutoConfiguration.java). -- `prefix = "firefly.eda.consumer", name = "enabled", havingValue = "true"`. [KafkaEventConsumer.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumer.java). +- `prefix = "firefly.eda.consumer", name = "enabled", havingValue = "true"`. [KafkaEventConsumerImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-kafka/src/main/java/org/fireflyframework/eda/consumer/kafka/KafkaEventConsumerImpl.java). ## Public API and extension points | 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. | ## Related components @@ -157,7 +157,7 @@ void shouldGetKafkaPublisherFromFactory() { EventPublisher publisher = publisherFactory.getPublisher(PublisherType.KAFKA, "default"); // Assert - May be null if Kafka is not configured - // Publisher may be wrapped in ResilientEventPublisher, so check publisher type instead of class + // Publisher may be wrapped in ResilientEventPublisherImpl, so check publisher type instead of class if (publisher != null) { assertThat(publisher.getPublisherType()).isEqualTo(PublisherType.KAFKA); assertThat(publisher.isAvailable()).isTrue(); @@ -209,7 +209,7 @@ Key properties: | `firefly.eda.publishers.kafka.default.default-topic` | `events` | Destination used when a publish call supplies no topic. | | `firefly.eda.publishers.kafka.default.key-serializer` / `value-serializer` | `StringSerializer` | Producer serializers. | | `firefly.eda.publishers.kafka.default.properties` | `{}` | Pass-through map of raw Kafka producer config. | -| `firefly.eda.consumer.enabled` | `false` | Global consumer switch; required for the consumer beans and `KafkaEventConsumer`. | +| `firefly.eda.consumer.enabled` | `false` | Global consumer switch; required for the consumer beans and `KafkaEventConsumerImpl`. | | `firefly.eda.consumer.group-id` | `firefly-eda` | Consumer group id applied to the listener. | | `firefly.eda.consumer.kafka.default.enabled` | `false` | Enables the Kafka consumer for the `default` connection. | | `firefly.eda.consumer.kafka.default.bootstrap-servers` | _(none)_ | Broker list; beans are only created when this is non-empty. | @@ -222,11 +222,11 @@ Key properties: ### How It Works -1. Startup gating. `FireflyEdaKafkaEnvironmentPostProcessor` runs first and excludes Spring Boot's `KafkaAutoConfiguration` unless the Kafka publisher or consumer is enabled (or `spring.kafka.bootstrap-servers` is explicitly set). -2. Publisher wiring. `FireflyEdaKafkaPublisherAutoConfiguration` creates `fireflyEdaKafkaProducerFactory` and `fireflyEdaKafkaTemplate` only when publishers are enabled, the Kafka publisher is enabled, and `bootstrap-servers` is non-empty. `KafkaEventPublisher` consumes the template via an `ObjectProvider`. -3. Consumer wiring. `FireflyEdaKafkaConsumerAutoConfiguration` creates `fireflyEdaKafkaConsumerFactory` and the `@Primary` `fireflyEdaKafkaListenerContainerFactory` under the equivalent conditions. `KafkaEventConsumer` registers a single `@KafkaListener` whose `topicPattern` is computed from discovered `@EventListener` annotations. -4. Dynamic topics. When listeners are added at runtime, `EventListenerProcessor` notifies the consumer, which restarts its listener containers to pick up the new topic pattern (a brief consumption pause). If no annotations are found, it falls back to `firefly.eda.consumer.kafka.default.topics`. -5. Envelope flow. Inbound records are wrapped in the unified `EventEnvelope`, emitted to a reactive `Sinks.Many` stream, and dispatched through `EventListenerProcessor` to your handlers. +1. Startup gating. `FireflyEdaKafkaEnvironmentPostProcessorImpl` runs first and excludes Spring Boot's `KafkaAutoConfiguration` unless the Kafka publisher or consumer is enabled (or `spring.kafka.bootstrap-servers` is explicitly set). +2. Publisher wiring. `FireflyEdaKafkaPublisherAutoConfiguration` creates `fireflyEdaKafkaProducerFactory` and `fireflyEdaKafkaTemplate` only when publishers are enabled, the Kafka publisher is enabled, and `bootstrap-servers` is non-empty. `KafkaEventPublisherImpl` consumes the template via an `ObjectProvider`. +3. Consumer wiring. `FireflyEdaKafkaConsumerAutoConfiguration` creates `fireflyEdaKafkaConsumerFactory` and the `@Primary` `fireflyEdaKafkaListenerContainerFactory` under the equivalent conditions. `KafkaEventConsumerImpl` registers a single `@KafkaListener` whose `topicPattern` is computed from discovered `@EventListener` annotations. +4. Dynamic topics. When listeners are added at runtime, `EventListenerProcessorImpl` notifies the consumer, which restarts its listener containers to pick up the new topic pattern (a brief consumption pause). If no annotations are found, it falls back to `firefly.eda.consumer.kafka.default.topics`. +5. Envelope flow. Inbound records are wrapped in the unified `EventEnvelope`, emitted to a reactive `Sinks.Many` stream, and dispatched through `EventListenerProcessorImpl` to your handlers. ## Continue the application diff --git a/docs/site/modules/eda-postgres.md b/docs/site/modules/eda-postgres.md index 9f199bd77..dad967236 100644 --- a/docs/site/modules/eda-postgres.md +++ b/docs/site/modules/eda-postgres.md @@ -110,14 +110,14 @@ Property-based wiring conditions found in this module: - `prefix = "firefly.eda", name = "enabled", havingValue = "true", matchIfMissing = true`. [FireflyEdaPostgresConsumerAutoConfiguration.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresConsumerAutoConfiguration.java). - `prefix = "firefly.eda", name = "enabled", havingValue = "true", matchIfMissing = true`. [FireflyEdaPostgresPublisherAutoConfiguration.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-postgres/src/main/java/org/fireflyframework/eda/config/FireflyEdaPostgresPublisherAutoConfiguration.java). -- `prefix = "firefly.eda.consumer", name = "enabled", havingValue = "true"`. [PostgresEventConsumer.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumer.java). +- `prefix = "firefly.eda.consumer", name = "enabled", havingValue = "true"`. [PostgresEventConsumerImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-postgres/src/main/java/org/fireflyframework/eda/consumer/postgres/PostgresEventConsumerImpl.java). ## Public API and extension points | 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`. | @@ -179,7 +179,7 @@ void publisherIdentifiesItself() { ### How It Works ``` -@PublishResult ──▶ PostgresEventPublisher +@PublishResult ──▶ PostgresEventPublisherImpl │ INSERT INTO firefly_eda_outbox (... status='PENDING') ▼ ┌──────────────────────────┐ @@ -188,7 +188,7 @@ void publisherIdentifiesItself() { └──────────────────────────┘ │ NOTIFY (id only) │ polling fallback ▼ ▼ (PENDING rows, attempts < max) - PostgresEventConsumer ── LISTEN ── drains row, dispatches to @EventListener + PostgresEventConsumerImpl ── LISTEN ── drains row, dispatches to @EventListener │ success ──▶ status='PROCESSED' │ failure ──▶ attempts++ (DEAD_LETTER once attempts ≥ max-attempts) ``` diff --git a/docs/site/modules/eda-rabbitmq.md b/docs/site/modules/eda-rabbitmq.md index c37b9cbe3..e573f6c85 100644 --- a/docs/site/modules/eda-rabbitmq.md +++ b/docs/site/modules/eda-rabbitmq.md @@ -114,8 +114,8 @@ Property-based wiring conditions found in this module: | Type | Contract and responsibility | | --- | --- | -| [`RabbitMqEventPublisher`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisher.java) | Defines `RabbitMqEventPublisher`, `publish` operations. | -| [`RabbitMqEventConsumer`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumer.java) | Defines `RabbitMqEventConsumer`, `initialize`, `shutdown`, `stop` operations. | +| [`RabbitMqEventPublisherImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisherImpl.java) | Defines `RabbitMqEventPublisherImpl`, `publish` operations. | +| [`RabbitMqEventConsumerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumerImpl.java) | Defines `RabbitMqEventConsumerImpl`, `initialize`, `shutdown`, `stop` operations. | | [`FireflyEdaAmqpAdminAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaAmqpAdminAutoConfiguration.java) | Defines `FireflyEdaAmqpAdminAutoConfiguration`, `fireflyEdaAmqpAdmin` operations. | | [`FireflyEdaRabbitMqAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqAutoConfiguration.java) | Defines `FireflyEdaRabbitMqAutoConfiguration`, `fireflyEdaRabbitPublisherConnectionFactory`, `fireflyEdaRabbitTemplate` operations. | | [`FireflyEdaRabbitMqConsumerAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqConsumerAutoConfiguration.java) | Defines `FireflyEdaRabbitMqConsumerAutoConfiguration`, `fireflyEdaRabbitConsumerConnectionFactory` operations. | @@ -167,7 +167,7 @@ void shouldGetRabbitMqPublisherFromFactory() { EventPublisher publisher = publisherFactory.getPublisher(PublisherType.RABBITMQ, "default"); // Assert - May be null if RabbitMQ is not configured - // Publisher may be wrapped in ResilientEventPublisher, so check publisher type instead of class + // Publisher may be wrapped in ResilientEventPublisherImpl, so check publisher type instead of class if (publisher != null) { assertThat(publisher.getPublisherType()).isEqualTo(PublisherType.RABBITMQ); assertThat(publisher.isAvailable()).isTrue(); @@ -244,9 +244,9 @@ firefly: The adapter creates separate publisher-side and consumer-side connection factories so each can be tuned and excluded independently: -- Publisher path. `FireflyEdaRabbitMqAutoConfiguration` builds `fireflyEdaRabbitPublisherConnectionFactory` and `fireflyEdaRabbitTemplate` from `firefly.eda.publishers.rabbitmq.default.*`; `FireflyEdaAmqpAdminAutoConfiguration` reuses that factory for a `RabbitAdmin`. `RabbitMqEventPublisher` is `@ConditionalOnBean(name = "fireflyEdaRabbitTemplate")`. -- Consumer path. `RabbitMqEventConsumer` is guarded by `@ConditionalOnBean(name = "fireflyEdaRabbitConsumerConnectionFactory")` and injects that bean by qualifier. `FireflyEdaRabbitMqConsumerAutoConfiguration` creates this `fireflyEdaRabbitConsumerConnectionFactory` (a `CachingConnectionFactory` from `firefly.eda.consumer.rabbitmq.default.*`), mirroring the publisher-side factory. this is what makes the consumer wire and run when `firefly.eda.consumer.enabled=true` and the RabbitMQ consumer is enabled. -- Native auto-config exclusion. `FireflyEdaRabbitMqEnvironmentPostProcessor` (registered via `spring.factories`) excludes Spring Boot's `RabbitAutoConfiguration` unless you explicitly opt in with `spring.rabbitmq.host`. This avoids the ambiguity where Boot's `rabbitListenerContainerFactory` cannot choose between the two Firefly `ConnectionFactory` beans, and prevents connection/health failures when RabbitMQ is not in use. +- Publisher path. `FireflyEdaRabbitMqAutoConfiguration` builds `fireflyEdaRabbitPublisherConnectionFactory` and `fireflyEdaRabbitTemplate` from `firefly.eda.publishers.rabbitmq.default.*`; `FireflyEdaAmqpAdminAutoConfiguration` reuses that factory for a `RabbitAdmin`. `RabbitMqEventPublisherImpl` is `@ConditionalOnBean(name = "fireflyEdaRabbitTemplate")`. +- Consumer path. `RabbitMqEventConsumerImpl` is guarded by `@ConditionalOnBean(name = "fireflyEdaRabbitConsumerConnectionFactory")` and injects that bean by qualifier. `FireflyEdaRabbitMqConsumerAutoConfiguration` creates this `fireflyEdaRabbitConsumerConnectionFactory` (a `CachingConnectionFactory` from `firefly.eda.consumer.rabbitmq.default.*`), mirroring the publisher-side factory. this is what makes the consumer wire and run when `firefly.eda.consumer.enabled=true` and the RabbitMQ consumer is enabled. +- Native auto-config exclusion. `FireflyEdaRabbitMqEnvironmentPostProcessorImpl` (registered via `spring.factories`) excludes Spring Boot's `RabbitAutoConfiguration` unless you explicitly opt in with `spring.rabbitmq.host`. This avoids the ambiguity where Boot's `rabbitListenerContainerFactory` cannot choose between the two Firefly `ConnectionFactory` beans, and prevents connection/health failures when RabbitMQ is not in use. ## Continue the application diff --git a/docs/site/modules/eda.md b/docs/site/modules/eda.md index 8814997c3..347a3a6db 100644 --- a/docs/site/modules/eda.md +++ b/docs/site/modules/eda.md @@ -81,14 +81,14 @@ The `firefly.eda` namespace is bound by [EdaProperties.java](https://github.com/ Property-based wiring conditions found in this module: - `prefix = "firefly.eda", name = "enabled", havingValue = "true", matchIfMissing = true`. [FireflyEdaAutoConfiguration.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/config/FireflyEdaAutoConfiguration.java). -- `prefix = "firefly.eda.consumer.noop", name = "enabled", havingValue = "true"`. [NoopEventConsumer.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/consumer/NoopEventConsumer.java). -- `prefix = "firefly.eda.consumer.application-event", name = "enabled", havingValue = "true"`. [SpringApplicationEventConsumer.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumer.java). -- `prefix = "firefly.eda.error.metrics", name = "enabled", havingValue = "true", matchIfMissing = true`. [MetricsErrorHandler.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/MetricsErrorHandler.java). -- `prefix = "firefly.eda.error.notification", name = "enabled", havingValue = "true"`. [NotificationErrorHandler.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/NotificationErrorHandler.java). -- `prefix = "firefly.eda", name = "health-enabled", havingValue = "true", matchIfMissing = true`. [EdaHealthIndicator.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/health/EdaHealthIndicator.java). -- `prefix = "firefly.eda", name = "metrics-enabled", havingValue = "true", matchIfMissing = true`. [EdaMetrics.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/metrics/EdaMetrics.java). -- `prefix = "firefly.eda.publishers.noop", name = "enabled", havingValue = "true"`. [NoopEventPublisher.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/publisher/NoopEventPublisher.java). -- `prefix = "firefly.eda.publishers.application-event", name = "enabled", havingValue = "true", matchIfMissing = true`. [SpringApplicationEventPublisher.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisher.java). +- `prefix = "firefly.eda.consumer.noop", name = "enabled", havingValue = "true"`. [NoopEventConsumerImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/consumer/NoopEventConsumerImpl.java). +- `prefix = "firefly.eda.consumer.application-event", name = "enabled", havingValue = "true"`. [SpringApplicationEventConsumerImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumerImpl.java). +- `prefix = "firefly.eda.error.metrics", name = "enabled", havingValue = "true", matchIfMissing = true`. [MetricsErrorHandlerImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/MetricsErrorHandlerImpl.java). +- `prefix = "firefly.eda.error.notification", name = "enabled", havingValue = "true"`. [NotificationErrorHandlerImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/NotificationErrorHandlerImpl.java). +- `prefix = "firefly.eda", name = "health-enabled", havingValue = "true", matchIfMissing = true`. [EdaHealthIndicatorImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/health/EdaHealthIndicatorImpl.java). +- `prefix = "firefly.eda", name = "metrics-enabled", havingValue = "true", matchIfMissing = true`. [EdaMetricsImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/metrics/EdaMetricsImpl.java). +- `prefix = "firefly.eda.publishers.noop", name = "enabled", havingValue = "true"`. [NoopEventPublisherImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/publisher/NoopEventPublisherImpl.java). +- `prefix = "firefly.eda.publishers.application-event", name = "enabled", havingValue = "true", matchIfMissing = true`. [SpringApplicationEventPublisherImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisherImpl.java). - `prefix = "firefly.eda.resilience", name = "enabled", havingValue = "true", matchIfMissing = true`. [ResilientEventPublisherFactory.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisherFactory.java). ## Public API and extension points @@ -281,7 +281,7 @@ firefly: | `firefly.eda.publishers.enabled` | `false` | Global opt-in for all publishers. | | `firefly.eda.consumer.enabled` | `false` | Global opt-in for all consumers. | | `firefly.eda.consumer.group-id` | `firefly-eda` | Default consumer group id (used by group-based transports such as Kafka). | -| `firefly.eda.resilience.*` | see above | Circuit breaker, retry and rate-limiter settings applied by `ResilientEventPublisher`. | +| `firefly.eda.resilience.*` | see above | Circuit breaker, retry and rate-limiter settings applied by `ResilientEventPublisherImpl`. | The `kafka.*`, `rabbitmq.*` and `postgres.*` sub-trees are mapped by connection id (the `default` key shown above), letting you define multiple named connections per transport. These keys are recognized by the core's property schema even before the corresponding adapter is installed; the actual transport beans only activate when the matching adapter module is on the classpath and enabled. diff --git a/docs/site/modules/notifications-core.md b/docs/site/modules/notifications-core.md index 6c1705f69..62a1887c0 100644 --- a/docs/site/modules/notifications-core.md +++ b/docs/site/modules/notifications-core.md @@ -72,7 +72,7 @@ Mono result = emailService.sendEmail(request); | SMS | `org.fireflyframework.notifications.core.services.sms.v1.SMSServiceImpl` | `SMSProvider` | | Push | `org.fireflyframework.notifications.core.services.push.v1.PushServiceImpl` | `PushProvider` | -Template email additionally needs a `NotificationTemplateEngine` bean, for example `new FreemarkerNotificationTemplateEngine()` with templates under `src/main/resources/notification-templates`. A preference service must also be registered and invoked explicitly when the application applies user preferences; the in-memory implementation is process-local. +Template email additionally needs a `NotificationTemplateEngine` bean, for example `new FreemarkerNotificationTemplateEngineImpl()` with templates under `src/main/resources/notification-templates`. A preference service must also be registered and invoked explicitly when the application applies user preferences; the in-memory implementation is process-local. ## Configuration and wiring diff --git a/docs/site/modules/notifications-firebase.md b/docs/site/modules/notifications-firebase.md index 4eb3b2520..0eb0fbfe1 100644 --- a/docs/site/modules/notifications-firebase.md +++ b/docs/site/modules/notifications-firebase.md @@ -79,7 +79,7 @@ import java.util.Map; @RequiredArgsConstructor public class AlertService { - private final PushProvider pushProvider; // FcmPushProvider injected by auto-config + private final PushProvider pushProvider; // FcmPushProviderImpl injected by auto-config @@ -117,7 +117,7 @@ Property-based wiring conditions found in this module: | --- | --- | | [`FcmProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/properties/v1/FcmProperties.java) | Carries `credentialsPath`, `projectId` data; field constraints and defaults are declared in the linked source. | | [`FcmAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/config/v1/FcmAutoConfiguration.java) | Defines `firebaseApp`, `firebaseMessaging`, `fcmPushProvider` operations. | -| [`FcmPushProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProvider.java) | Defines `FcmPushProvider`, `sendPush` operations. | +| [`FcmPushProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProviderImpl.java) | Defines `FcmPushProviderImpl`, `sendPush` operations. | ## Related components @@ -184,7 +184,7 @@ When both conditions hold it contributes three beans (each `@ConditionalOnMissin 1. `FirebaseApp`. Built from `credentials-path` (or Application Default Credentials) and `project-id`; an already-initialized default app is reused if present. 2. `FirebaseMessaging`. Obtained from the `FirebaseApp`. -3. `PushProvider`. An `FcmPushProvider` wrapping the `FirebaseMessaging` client, consumed by the notifications core. +3. `PushProvider`. An `FcmPushProviderImpl` wrapping the `FirebaseMessaging` client, consumed by the notifications core. ## Continue the application diff --git a/docs/site/modules/notifications-resend.md b/docs/site/modules/notifications-resend.md index 7d74ad729..8dfea6a01 100644 --- a/docs/site/modules/notifications-resend.md +++ b/docs/site/modules/notifications-resend.md @@ -64,7 +64,7 @@ import reactor.core.publisher.Mono; @RequiredArgsConstructor public class WelcomeEmailService { - private final EmailProvider emailProvider; // ResendEmailProvider, auto-wired + private final EmailProvider emailProvider; // ResendEmailProviderImpl, auto-wired @@ -103,7 +103,7 @@ Property-based wiring conditions found in this module: | Type | Contract and responsibility | | --- | --- | -| [`ResendEmailProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProvider.java) | Defines `sendEmail`, `buildPayload` operations. | +| [`ResendEmailProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProviderImpl.java) | Defines `sendEmail`, `buildPayload` operations. | | [`ResendProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/properties/v1/ResendProperties.java) | Carries `apiKey`, `defaultFrom`, `baseUrl` data; field constraints and defaults are declared in the linked source. | | [`ResendAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/config/v1/ResendAutoConfiguration.java) | Defines `resendRestClient`, `resendEmailProvider` operations. | @@ -131,10 +131,10 @@ This subproject has no authored `src/test/java` suite. Its Maven build still val ## API reference excerpt -Contract excerpt from [ResendEmailProvider.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProvider.java). This fragment needs the full type and its imports. +Contract excerpt from [ResendEmailProviderImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProviderImpl.java). This fragment needs the full type and its imports. ```java -public class ResendEmailProvider implements EmailProvider { +public class ResendEmailProviderImpl implements EmailProvider { private final ResendProperties properties; private final RestClient resendClient; public Mono sendEmail(EmailRequestDTO request) { @@ -190,8 +190,8 @@ The auto-configuration is gated by two conditions: `firefly.notifications.email. 1. `ResendAutoConfiguration` is imported via `META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports` and activates when `firefly.notifications.email.provider=resend`. 2. It builds a named `resend` `RestClient` from `ServiceClient.rest("resend")` with the configured `base-url`, JSON content type, and an `Authorization: Bearer ` header. -3. It registers `ResendEmailProvider` as the `EmailProvider` bean (unless one is already defined). -4. `ResendEmailProvider.sendEmail(...)` translates the `EmailRequestDTO` into the Resend JSON payload (`from`, `to`, `subject`, `html`/`text`, `cc`, `bcc`, Base64 `attachments`) and `POST`s it to `/emails`, mapping the response id into `EmailResponseDTO.success(id)`. +3. It registers `ResendEmailProviderImpl` as the `EmailProvider` bean (unless one is already defined). +4. `ResendEmailProviderImpl.sendEmail(...)` translates the `EmailRequestDTO` into the Resend JSON payload (`from`, `to`, `subject`, `html`/`text`, `cc`, `bcc`, Base64 `attachments`) and `POST`s it to `/emails`, mapping the response id into `EmailResponseDTO.success(id)`. ## Continue the application diff --git a/docs/site/modules/notifications-sendgrid.md b/docs/site/modules/notifications-sendgrid.md index c129a8c3e..76940bee7 100644 --- a/docs/site/modules/notifications-sendgrid.md +++ b/docs/site/modules/notifications-sendgrid.md @@ -102,10 +102,10 @@ public class WelcomeMailer { } ``` -The auto-configuration builds the `SendGrid` client and the `SendGridEmailProvider` bean for you. The returned `EmailResponseDTO` +The auto-configuration builds the `SendGrid` client and the `SendGridEmailProviderImpl` bean for you. The returned `EmailResponseDTO` carries `success`/`error` status and, on success, the SendGrid `X-Message-Id`. -You can also depend on the `EmailProvider` SPI directly if you prefer to bypass the `EmailService` facade. The same `SendGridEmailProvider` bean satisfies it. +You can also depend on the `EmailProvider` SPI directly if you prefer to bypass the `EmailService` facade. The same `SendGridEmailProviderImpl` bean satisfies it. ## Configuration and wiring @@ -124,7 +124,7 @@ Property-based wiring conditions found in this module: | Type | Contract and responsibility | | --- | --- | -| [`SendGridEmailProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProvider.java) | Defines `sendEmail`, `buildMail` operations. | +| [`SendGridEmailProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProviderImpl.java) | Defines `sendEmail`, `buildMail` operations. | | [`SendGridProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/properties/v1/SendGridProperties.java) | Carries `apiKey` data; field constraints and defaults are declared in the linked source. | | [`SendGridAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/config/v1/SendGridAutoConfiguration.java) | Defines `sendGrid`, `sendGridEmailProvider` operations. | @@ -151,10 +151,10 @@ This subproject has no authored `src/test/java` suite. Its Maven build still val ## API reference excerpt -Contract excerpt from [SendGridEmailProvider.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProvider.java). This fragment needs the full type and its imports. +Contract excerpt from [SendGridEmailProviderImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProviderImpl.java). This fragment needs the full type and its imports. ```java -public class SendGridEmailProvider implements EmailProvider { +public class SendGridEmailProviderImpl implements EmailProvider { private final SendGridProperties properties; private final SendGrid sendGrid; public Mono sendEmail(EmailRequestDTO request) { @@ -211,9 +211,9 @@ Notes: `SendGridAutoConfiguration` activates only when `firefly.notifications.email.provider=sendgrid` and `com.sendgrid.SendGrid` is on the classpath. It then: 1. Creates a `SendGrid` client from `firefly.notifications.sendgrid.api-key` (only when the key is present). -2. Registers `SendGridEmailProvider` as the `EmailProvider`, unless another `EmailProvider` bean already exists. +2. Registers `SendGridEmailProviderImpl` as the `EmailProvider`, unless another `EmailProvider` bean already exists. -On each `sendEmail(...)` call, `SendGridEmailProvider` builds a SendGrid `Mail` (mapping subject, HTML/text content, CC, BCC, and Base64-encoded attachments), issues a `POST mail/send`, and maps the result: 2xx -> `EmailResponseDTO.success(X-Message-Id)`, anything else (or an `IOException`) -> `EmailResponseDTO.error(...)`. The whole call runs via `Mono.fromCallable(...).subscribeOn(Schedulers.boundedElastic())` to keep blocking I/O off the reactive event loop. +On each `sendEmail(...)` call, `SendGridEmailProviderImpl` builds a SendGrid `Mail` (mapping subject, HTML/text content, CC, BCC, and Base64-encoded attachments), issues a `POST mail/send`, and maps the result: 2xx -> `EmailResponseDTO.success(X-Message-Id)`, anything else (or an `IOException`) -> `EmailResponseDTO.error(...)`. The whole call runs via `Mono.fromCallable(...).subscribeOn(Schedulers.boundedElastic())` to keep blocking I/O off the reactive event loop. ## Continue the application diff --git a/docs/site/modules/notifications-twilio.md b/docs/site/modules/notifications-twilio.md index a1d9ac546..5f2063919 100644 --- a/docs/site/modules/notifications-twilio.md +++ b/docs/site/modules/notifications-twilio.md @@ -64,7 +64,7 @@ public class OtpService { private final SMSProvider smsProvider; public OtpService(SMSProvider smsProvider) { - this.smsProvider = smsProvider; // TwilioSMSProvider injected by auto-config + this.smsProvider = smsProvider; // TwilioSMSProviderImpl injected by auto-config } public Mono sendOtp(String phoneNumber, String code) { @@ -103,7 +103,7 @@ Property-based wiring conditions found in this module: | Type | Contract and responsibility | | --- | --- | -| [`TwilioSMSProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProvider.java) | Defines `TwilioSMSProvider`, `sendSMS`, `PhoneNumber` operations. | +| [`TwilioSMSProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProviderImpl.java) | Defines `TwilioSMSProviderImpl`, `sendSMS`, `PhoneNumber` operations. | | [`TwilioProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/properties/v1/TwilioProperties.java) | Carries `accountSid`, `authToken`, `phoneNumber` data; field constraints and defaults are declared in the linked source. | | [`TwilioAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/config/v1/TwilioAutoConfiguration.java) | Defines `twilioInit`, `twilioSMSProvider` operations. | @@ -130,12 +130,12 @@ This subproject has no authored `src/test/java` suite. Its Maven build still val ## API reference excerpt -Contract excerpt from [TwilioSMSProvider.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProvider.java). This fragment needs the full type and its imports. +Contract excerpt from [TwilioSMSProviderImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProviderImpl.java). This fragment needs the full type and its imports. ```java -public class TwilioSMSProvider implements SMSProvider { +public class TwilioSMSProviderImpl implements SMSProvider { private final TwilioProperties twilioProperties; - public TwilioSMSProvider(TwilioProperties twilioProperties) { + public TwilioSMSProviderImpl(TwilioProperties twilioProperties) { this.twilioProperties = twilioProperties; } public Mono sendSMS(SMSRequestDTO request) { @@ -193,7 +193,7 @@ firefly: - `@ConditionalOnClass(com.twilio.Twilio.class)`. only when the Twilio SDK is present. - `@EnableConfigurationProperties(TwilioProperties.class)`. binds the `firefly.notifications.twilio.*` keys. -When active, it initializes the static Twilio client with `Twilio.init(accountSid, authToken)` and registers a `TwilioSMSProvider` as the `SMSProvider` bean (both `@ConditionalOnMissingBean`, so you can override either). `TwilioSMSProvider.sendSMS` validates the request, builds a Twilio `Message` (recipient, sender, body), executes the REST call on `Schedulers.boundedElastic()`, and maps the result to an `SMSResponseDTO`. +When active, it initializes the static Twilio client with `Twilio.init(accountSid, authToken)` and registers a `TwilioSMSProviderImpl` as the `SMSProvider` bean (both `@ConditionalOnMissingBean`, so you can override either). `TwilioSMSProviderImpl.sendSMS` validates the request, builds a Twilio `Message` (recipient, sender, body), executes the REST call on `Schedulers.boundedElastic()`, and maps the result to an `SMSResponseDTO`. ## Continue the application diff --git a/docs/site/modules/notifications.md b/docs/site/modules/notifications.md index 09d2a719b..a27a47879 100644 --- a/docs/site/modules/notifications.md +++ b/docs/site/modules/notifications.md @@ -127,7 +127,7 @@ Templated email. Provide a `NotificationTemplateEngine` bean (the FreeMarker eng ```java @Bean NotificationTemplateEngine notificationTemplateEngine() { - return new FreemarkerNotificationTemplateEngine(); // classpath:/notification-templates + return new FreemarkerNotificationTemplateEngineImpl(); // classpath:/notification-templates } // ... @@ -188,7 +188,7 @@ firefly: provider: firebase observability: metrics: - enabled: true # default; set false to skip NotificationMetrics registration + enabled: true # default; set false to skip NotificationMetricsImpl registration ``` | Property | Default | Description | @@ -196,13 +196,13 @@ firefly: | `firefly.notifications.email.provider` | _(none)_ | Selects the email `EmailProvider` adapter. `sendgrid` or `resend`. Defined by the adapter module. | | `firefly.notifications.sms.provider` | _(none)_ | Selects the SMS `SMSProvider` adapter. `twilio`. Defined by the adapter module. | | `firefly.notifications.push.provider` | _(none)_ | Selects the push `PushProvider` adapter. `firebase`. Defined by the adapter module. | -| `firefly.observability.metrics.enabled` | `true` | When `true` (and a `MeterRegistry` is present), registers the shared `NotificationMetrics` bean used by all adapters. | +| `firefly.observability.metrics.enabled` | `true` | When `true` (and a `MeterRegistry` is present), registers the shared `NotificationMetricsImpl` bean used by all adapters. | Provider-specific keys (for example `firefly.notifications.sendgrid.*`, `firefly.notifications.twilio.*`, `firefly.notifications.firebase.*`) are documented in each adapter's README. -Template engine. `FreemarkerNotificationTemplateEngine` is not auto-registered; declare it as a bean. Its constructor accepts a classpath prefix (default `/notification-templates`) and an optional filesystem directory for template overrides. Without a `NotificationTemplateEngine` bean, `sendTemplateEmail` fails fast with an `UnsupportedOperationException`. +Template engine. `FreemarkerNotificationTemplateEngineImpl` is not auto-registered; declare it as a bean. Its constructor accepts a classpath prefix (default `/notification-templates`) and an optional filesystem directory for template overrides. Without a `NotificationTemplateEngine` bean, `sendTemplateEmail` fails fast with an `UnsupportedOperationException`. -Notification preferences. `InMemoryNotificationPreferenceService` is suitable for development and single-instance deployments. For multi-instance/production usage, provide your own `NotificationPreferenceService` backed by R2DBC or a cache. +Notification preferences. `InMemoryNotificationPreferenceServiceImpl` is suitable for development and single-instance deployments. For multi-instance/production usage, provide your own `NotificationPreferenceService` backed by R2DBC or a cache. ## Continue the application diff --git a/docs/site/modules/observability.md b/docs/site/modules/observability.md index 955923d88..4eb8646b4 100644 --- a/docs/site/modules/observability.md +++ b/docs/site/modules/observability.md @@ -137,7 +137,7 @@ Property-based wiring conditions found in this module: | [`FireflyHealthIndicator`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/observability/src/main/java/org/fireflyframework/observability/health/FireflyHealthIndicator.java) | Abstract base class for all Firefly health indicators. | | [`FireflyObservabilityProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityProperties.java) | Unified configuration properties for Firefly observability. | | [`FireflyObservabilityAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityAutoConfiguration.java) | Master auto-configuration for Firefly Framework observability. | -| [`FireflyObservabilityEnvironmentPostProcessor`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessor.java) | Configures observability backends at startup based on Firefly properties. | +| [`FireflyObservabilityEnvironmentPostProcessorImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessorImpl.java) | Configures observability backends at startup based on Firefly properties. | ## Build and test @@ -358,12 +358,12 @@ An explicitly configured `includeContext=true` exports encoder-owned global cont fireflyframework-observability/ ├── FireflyObservabilityAutoConfiguration # Master auto-configuration ├── FireflyObservabilityProperties # Unified @ConfigurationProperties -├── FireflyObservabilityEnvironmentPostProcessor # Config-based bridge + exporter selection +├── FireflyObservabilityEnvironmentPostProcessorImpl # Config-based bridge + exporter selection ├── metrics/ │ ├── FireflyMetricsSupport # Abstract base for ALL module metrics │ ├── MetricNaming # Enforces firefly.{module}.{metric} │ ├── MetricTags # Standard tag constants -│ └── FireflyMeterRegistryCustomizer # Common tags: app, env, instance +│ └── FireflyMeterRegistryCustomizerImpl # Common tags: app, env, instance ├── tracing/ │ ├── FireflyTracingSupport # Reactive-safe tracing (Mono/Flux) │ ├── FireflyBaggageConfiguration # Standard baggage fields diff --git a/docs/site/modules/plugin-core.md b/docs/site/modules/plugin-core.md index 359d1fcd7..4d104c1cd 100644 --- a/docs/site/modules/plugin-core.md +++ b/docs/site/modules/plugin-core.md @@ -4,7 +4,7 @@ Load plugins, resolve dependencies, and manage extension registration in a host process. -Create DefaultPluginManager for the host and use the plugin-api contracts for lifecycle operations. Inspect dependency-resolution and lifecycle tests before changing load/start order or unloading extensions still used by the host. +Create DefaultPluginManagerImpl for the host and use the plugin-api contracts for lifecycle operations. Inspect dependency-resolution and lifecycle tests before changing load/start order or unloading extensions still used by the host. | Maven artifact | Packaging | Source project | | --- | --- | --- | @@ -35,7 +35,7 @@ The Java examples in this section are API fragments for application code. Use th The host can use the concrete implementation with the API lifecycle operations: ```java -PluginManager manager = new DefaultPluginManager(); +PluginManager manager = new DefaultPluginManagerImpl(); manager.initialize(); PluginDescriptor descriptor = manager.loadPlugin(MyPlugin.class); manager.startPlugin(descriptor.getId()); @@ -43,7 +43,7 @@ manager.startPlugin(descriptor.getId()); manager.shutdown(); ``` -Import `DefaultPluginManager` from `org.fireflyframework.plugin.core` and the API/model types from `plugin-api`. `MyPlugin` is an application implementation with a no-argument constructor, as required by the loader. The default manager owns an extension registry and dependency resolver; an alternate `ExtensionRegistry` can be supplied through its constructor. +Import `DefaultPluginManagerImpl` from `org.fireflyframework.plugin.core` and the API/model types from `plugin-api`. `MyPlugin` is an application implementation with a no-argument constructor, as required by the loader. The default manager owns an extension registry and dependency resolver; an alternate `ExtensionRegistry` can be supplied through its constructor. ## Configuration and wiring @@ -53,8 +53,8 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`DefaultPluginManager`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManager.java) | Default implementation of PluginManager. | -| [`DefaultExtensionRegistry`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistry.java) | Thread-safe implementation of ExtensionRegistry. | +| [`DefaultPluginManagerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManagerImpl.java) | Default implementation of PluginManager. | +| [`DefaultExtensionRegistryImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistryImpl.java) | Thread-safe implementation of ExtensionRegistry. | | [`PluginDependencyResolver`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/PluginDependencyResolver.java) | Resolves plugin dependencies and determines the correct loading order. | ## Related components diff --git a/docs/site/modules/plugins.md b/docs/site/modules/plugins.md index 6578a8209..8a9011d23 100644 --- a/docs/site/modules/plugins.md +++ b/docs/site/modules/plugins.md @@ -114,9 +114,9 @@ public class StripePlugin implements org.fireflyframework.plugin.api.Plugin { ```java import org.fireflyframework.plugin.api.ExtensionRegistry; import org.fireflyframework.plugin.api.PluginManager; -import org.fireflyframework.plugin.core.DefaultPluginManager; +import org.fireflyframework.plugin.core.DefaultPluginManagerImpl; -PluginManager manager = new DefaultPluginManager(); +PluginManager manager = new DefaultPluginManagerImpl(); manager.initialize(); ExtensionRegistry registry = manager.getExtensionRegistry(); @@ -169,7 +169,7 @@ This subproject has no authored `src/test/java` suite. Its Maven build still val ### Configuration -This module has no configuration properties. It contains no Spring Boot auto-configuration and no `@ConfigurationProperties` classes. You wire a `PluginManager` (typically `DefaultPluginManager`) yourself, as a plain object or as a Spring `@Bean`, and drive it through its API. Plugin metadata (ids, versions, dependencies, extension priorities) is declared in code via annotations or the `PluginMetadata` builder, not in `application.yml`. +This module has no configuration properties. It contains no Spring Boot auto-configuration and no `@ConfigurationProperties` classes. You wire a `PluginManager` (typically `DefaultPluginManagerImpl`) yourself, as a plain object or as a Spring `@Bean`, and drive it through its API. Plugin metadata (ids, versions, dependencies, extension priorities) is declared in code via annotations or the `PluginMetadata` builder, not in `application.yml`. ## Continue the application diff --git a/docs/site/modules/r2dbc.md b/docs/site/modules/r2dbc.md index 48df66327..f9644d2d6 100644 --- a/docs/site/modules/r2dbc.md +++ b/docs/site/modules/r2dbc.md @@ -48,9 +48,9 @@ spring: ### Opt-in bounded root transactions -The source tree provides `BoundedRootTransaction` and `impl.DefaultBoundedRootTransaction` for an application-owned R2DBC transaction with a finite operation budget. Use a source build containing these classes until the corresponding release is published. This API does not register beans or change the default transaction manager. +The source tree provides `BoundedRootTransaction` and `impl.DefaultBoundedRootTransactionImpl` for an application-owned R2DBC transaction with a finite operation budget. Use a source build containing these classes until the corresponding release is published. This API does not register beans or change the default transaction manager. -Build one `OwnedLeaseConnectionFactory` around the application connection factory, then construct the actual `DatabaseClient`, customized `R2dbcEntityTemplate`, Spring Data repositories, and `R2dbcTransactionManager` with that same wrapper. `BoundedR2dbcResources.verify` checks the factory/client/template/manager identities; preserve the host converter, callbacks, and repository configuration. The helper refuses an ambient transaction rather than joining another owner's work. It owns individual acquired leases and never closes the application pool. +Build one `OwnedLeaseConnectionFactoryImpl` around the application connection factory, then construct the actual `DatabaseClient`, customized `R2dbcEntityTemplate`, Spring Data repositories, and `R2dbcTransactionManager` with that same wrapper. `BoundedR2dbcResources.verify` checks the factory/client/template/manager identities; preserve the host converter, callbacks, and repository configuration. The helper refuses an ambient transaction rather than joining another owner's work. It owns individual acquired leases and never closes the application pool. Capture the monotonic anchor before obtaining an original observation. Pass its original observation time, absolute expiration, explicit maximum duration, clock, and the same monotonic supplier to `R2dbcOperationBudget.observed`. Execute with a `PROPAGATION_REQUIRED` transaction definition and return one result; other propagation modes are refused. Compose an already observed dependency limit with `original.intersect(inherited)` before passing the budget to `execute`, so connection acquisition and transaction begin use the earlier bound. Use `RootTransactionScope.narrow` when a later native observation or dependency imposes an earlier bound. Original and narrowed budgets must share the identical `Clock` object and monotonic supplier. Budget checks include acquisition, transaction completion, and final cleanup; an expired budget does not grant a fresh timeout. Configure rollback and close limits separately with `CleanupPolicy`. @@ -60,7 +60,7 @@ Run the module and its reactor dependencies with `./mvnw -B -ntp -pl :fireflyfra ### Optional completed audit append read -`CompletedAuditAppendService` and `impl.SpringDataCompletedAuditAppendService` verify an append that has already completed inside its still-active original bounded owner root. Construct the service explicitly with the original `BoundedR2dbcResources`, the same `DatabaseClient`, customized `R2dbcEntityTemplate`, transaction manager, `Clock` and monotonic supplier. Its Spring Data repository is built from that retained template; there is no automatic bean, injected arbitrary repository or ambient-transaction fallback. +`CompletedAuditAppendService` and `impl.SpringDataCompletedAuditAppendServiceImpl` verify an append that has already completed inside its still-active original bounded owner root. Construct the service explicitly with the original `BoundedR2dbcResources`, the same `DatabaseClient`, customized `R2dbcEntityTemplate`, transaction manager, `Clock` and monotonic supplier. Its Spring Data repository is built from that retained template; there is no automatic bean, injected arbitrary repository or ambient-transaction fallback. Call `requireCompleted(scope, contextNonce, provisionalAppend)` with the exact native context nonce supplied through the existing appender's call-local nonce supplier and its actual `ProvisionalAppend`. The provisional record does not expose or create a nonce. The new service requires exactly one typed native row, rejects NULL numeric projections and out-of-range raw nanos, narrows the original scope to the observed native window, recomputes the full canonical record through `AuditRows.Event.record()`, and compares the entire expected record. A mismatch, read error or late result marks that same root rollback-only, even if the caller catches the error. No separate read transaction is started. @@ -199,17 +199,17 @@ This module relies on the standard Spring `spring.r2dbc.*` and `spring.flyway.*` firefly: observability: metrics: - enabled: true # default true — register R2dbcMetrics when a MeterRegistry is present + enabled: true # default true — register R2dbcMetricsImpl when a MeterRegistry is present health: enabled: true # default true — register the R2DBC health indicator ``` | Property | Default | Description | | --- | --- | --- | -| `firefly.observability.metrics.enabled` | `true` | Registers `R2dbcMetrics` (the `firefly.r2dbc.*` timers/counters) when a Micrometer `MeterRegistry` bean exists. Set `false` to disable. | +| `firefly.observability.metrics.enabled` | `true` | Registers `R2dbcMetricsImpl` (the `firefly.r2dbc.*` timers/counters) when a Micrometer `MeterRegistry` bean exists. Set `false` to disable. | | `firefly.observability.health.enabled` | `true` | Registers the R2DBC `HealthIndicator` that probes the database with `SELECT 1`. Set `false` to disable. | -Both beans use `matchIfMissing = true`, so they are active by default and back off cleanly if the host service disables observability or the underlying classes/beans (`MeterRegistry`, `ConnectionFactory`) are absent. The `ReactiveTransactionManager` and the springdoc `FilterParameterCustomizer` are both `@ConditionalOnMissingBean`, so you can override either by declaring your own bean. +Both beans use `matchIfMissing = true`, so they are active by default and back off cleanly if the host service disables observability or the underlying classes/beans (`MeterRegistry`, `ConnectionFactory`) are absent. The `ReactiveTransactionManager` and the springdoc `FilterParameterCustomizerImpl` are both `@ConditionalOnMissingBean`, so you can override either by declaring your own bean. This module ships an `application-logging.yml` profile fragment that sets `org.springframework.data.r2dbc` and `io.r2dbc` logging to `INFO`. @@ -238,14 +238,14 @@ The module registers four Spring Boot auto-configurations (see `META-INF/spring/ | --- | --- | | `R2dbcAutoConfiguration` | On startup, hands the application's `R2dbcEntityTemplate` to `FilterUtils.initializeTemplate(...)` so the static filtering engine can run queries. | | `R2dbcTransactionAutoConfiguration` | Enables `@EnableTransactionManagement` and provides an `R2dbcTransactionManager`-backed `ReactiveTransactionManager`. | -| `SwaggerAutoConfiguration` | Registers the `FilterParameterCustomizer` springdoc `OperationCustomizer`. | -| `R2dbcObservabilityAutoConfiguration` | Wires `R2dbcMetrics` and the R2DBC `HealthIndicator`, gated by `firefly.observability.*`. | +| `SwaggerAutoConfiguration` | Registers the `FilterParameterCustomizerImpl` springdoc `OperationCustomizer`. | +| `R2dbcObservabilityAutoConfiguration` | Wires `R2dbcMetricsImpl` and the R2DBC `HealthIndicator`, gated by `firefly.observability.*`. | Filtering follows a fixed precedence per field: `NULL` / `NOT NULL` markers first, then ID handling (skip or exact match), then collections/arrays (`IN`), then non-empty strings (`LIKE`), then enums (exact, by `name()`), then exact match for everything else. Reflected fields are cached per class for performance. ### Observability -When a Micrometer `MeterRegistry` is present, `R2dbcMetrics` exposes wrappers you can use to instrument repository methods: +When a Micrometer `MeterRegistry` is present, `R2dbcMetricsImpl` exposes wrappers you can use to instrument repository methods: - `firefly.r2dbc.query.duration`. query latency, tagged by `operation` (e.g. select/insert/update/delete) - `firefly.r2dbc.queries`. query counts, tagged by `operation` and `status` @@ -254,7 +254,7 @@ When a Micrometer `MeterRegistry` is present, `R2dbcMetrics` exposes wrappers yo ```java @RequiredArgsConstructor public class ProductRepository { - private final R2dbcMetrics metrics; // auto-configured bean + private final R2dbcMetricsImpl metrics; // auto-configured bean public Mono findById(Long id) { return metrics.timedQuery("select", delegate.findById(id)); diff --git a/docs/site/modules/rule-engine.md b/docs/site/modules/rule-engine.md index 08a38c46f..6d1865183 100644 --- a/docs/site/modules/rule-engine.md +++ b/docs/site/modules/rule-engine.md @@ -237,7 +237,7 @@ Key properties: | `firefly.rules.cache.provider` | `CAFFEINE` | Cache backend for definitions/ASTs/constants/validation. Set to `REDIS` for distributed rule evaluation across instances. | | `firefly.rules.cache.caffeine.ast-cache.*` | size 1000, write 2h | Sizing/TTL for the parsed-AST cache (the hottest cache). | | `firefly.rules.cache.caffeine.rule-definitions-cache.*` | size 200, write 10m | Cache of stored rule definitions loaded from the database. | -| `firefly.observability.metrics.enabled` | `true` | Gates registration of `RuleEngineMetrics` (Micrometer). | +| `firefly.observability.metrics.enabled` | `true` | Gates registration of `RuleEngineMetricsImpl` (Micrometer). | | `spring.r2dbc.*` / `spring.flyway.*` | see above | PostgreSQL connection, pool sizing, and migration of the rule/constant/audit schema. | The web module ships `dev`, `testing`, and `prod` profiles that tune pool sizing and cache capacity. Cache TTLs and pool settings have no hard-coded annotations. They are plain Spring config and can be overridden per environment or via environment variables. diff --git a/docs/site/modules/security-adapter-cerbos.md b/docs/site/modules/security-adapter-cerbos.md index 9322b98f1..190e815dd 100644 --- a/docs/site/modules/security-adapter-cerbos.md +++ b/docs/site/modules/security-adapter-cerbos.md @@ -4,7 +4,7 @@ Delegate PolicyDecisionPort decisions to the Cerbos CheckResources API. -Construct CerbosPolicyDecisionAdapter with a WebClient pointing to Cerbos. Resources are interpreted as kind:id; principal authorities become roles and context becomes resource attributes. Only EFFECT_ALLOW permits; transport failure returns an indeterminate decision. +Construct CerbosPolicyDecisionAdapterImpl with a WebClient pointing to Cerbos. Resources are interpreted as kind:id; principal authorities become roles and context becomes resource attributes. Only EFFECT_ALLOW permits; transport failure returns an indeterminate decision. | Maven artifact | Packaging | Source project | | --- | --- | --- | @@ -40,11 +40,11 @@ PolicyDecisionPort policyDecisionPort() { WebClient client = WebClient.builder() .baseUrl(System.getenv("CERBOS_URL")) .build(); - return new CerbosPolicyDecisionAdapter(client); + return new CerbosPolicyDecisionAdapterImpl(client); } ``` -With a framework `SecurityPrincipal`, call `policyDecisionPort.authorize(principal, "read", "document:budget", Map.of())`. The resource becomes kind `document`, id `budget`; authorities become Cerbos roles, and the context map becomes resource attributes. The adapter calls `/api/check/resources`; only `EFFECT_ALLOW` yields `Decision.permit()`. Other effects deny, and transport errors yield `Decision.indeterminate(...)`. Imports: `org.fireflyframework.security.spi.PolicyDecisionPort`, `org.fireflyframework.security.adapter.cerbos.CerbosPolicyDecisionAdapter`, Spring `Bean`, and WebFlux `WebClient`. +With a framework `SecurityPrincipal`, call `policyDecisionPort.authorize(principal, "read", "document:budget", Map.of())`. The resource becomes kind `document`, id `budget`; authorities become Cerbos roles, and the context map becomes resource attributes. The adapter calls `/api/check/resources`; only `EFFECT_ALLOW` yields `Decision.permit()`. Other effects deny, and transport errors yield `Decision.indeterminate(...)`. Imports: `org.fireflyframework.security.spi.PolicyDecisionPort`, `org.fireflyframework.security.adapter.cerbos.CerbosPolicyDecisionAdapterImpl`, Spring `Bean`, and WebFlux `WebClient`. ## Configuration and wiring @@ -54,7 +54,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`CerbosPolicyDecisionAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapter.java) | Maps principals, actions, resources, and context to Cerbos CheckResources decisions; non-allow effects deny. | +| [`CerbosPolicyDecisionAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapterImpl.java) | Maps principals, actions, resources, and context to Cerbos CheckResources decisions; non-allow effects deny. | ## Related components diff --git a/docs/site/modules/security-adapter-opa.md b/docs/site/modules/security-adapter-opa.md index 3f2f4ca13..4a174c189 100644 --- a/docs/site/modules/security-adapter-opa.md +++ b/docs/site/modules/security-adapter-opa.md @@ -32,10 +32,10 @@ Delegate an onboarding authorization decision to a configured OPA policy through The Java examples in this section are API fragments for application code. Use the stated imports and supply the application-owned collaborators described alongside them. -Contribute an `OpaPolicyDecisionAdapter` as your `PolicyDecisionPort`. Because `security-webflux` selects whatever `PolicyDecisionPort` bean is present, this single bean replaces the in-process `EmbeddedPolicyDecisionAdapter` for every non-permitted exchange. No other wiring required: +Contribute an `OpaPolicyDecisionAdapterImpl` as your `PolicyDecisionPort`. Because `security-webflux` selects whatever `PolicyDecisionPort` bean is present, this single bean replaces the in-process `EmbeddedPolicyDecisionAdapterImpl` for every non-permitted exchange. No other wiring required: ```java -import org.fireflyframework.security.adapter.opa.OpaPolicyDecisionAdapter; +import org.fireflyframework.security.adapter.opa.OpaPolicyDecisionAdapterImpl; import org.fireflyframework.security.spi.PolicyDecisionPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -47,7 +47,7 @@ class OpaPolicyConfiguration { @Bean PolicyDecisionPort policyDecisionPort() { WebClient opa = WebClient.create("http://opa:8181"); - return new OpaPolicyDecisionAdapter(opa, "firefly/allow"); + return new OpaPolicyDecisionAdapterImpl(opa, "firefly/allow"); } } ``` @@ -67,7 +67,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`OpaPolicyDecisionAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapter.java) | `PolicyDecisionPort` backed by Open Policy Agent. | +| [`OpaPolicyDecisionAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterImpl.java) | `PolicyDecisionPort` backed by Open Policy Agent. | ## Related components @@ -104,7 +104,7 @@ The `permitsAllowedActionForAnySubject` test demonstrates one concrete behavior. ```java @Test void permitsAllowedActionForAnySubject() { - OpaPolicyDecisionAdapter adapter = new OpaPolicyDecisionAdapter(webClient, "firefly/allow"); + OpaPolicyDecisionAdapterImpl adapter = new OpaPolicyDecisionAdapterImpl(webClient, "firefly/allow"); StepVerifier.create(adapter.authorize(principal(Set.of("teller")), "read", "doc:1", Map.of())) .expectNextMatches(d -> d.granted()) .verifyComplete(); @@ -127,15 +127,15 @@ security-api → security-spi → security-core → security-webflux → - `security-api` defines the domain this adapter speaks in: `SecurityPrincipal` (the subject) and `Decision` (the outcome, with its `Effect` enum). - `security-spi` defines the driven port this module implements: `PolicyDecisionPort`. -- `security-core` ships the in-process default, `EmbeddedPolicyDecisionAdapter`, which this module replaces. -- `security-webflux` consumes whichever `PolicyDecisionPort` bean is present through its `PolicyAuthorizationManager`, so swapping the embedded engine for OPA is transparent to the filter chain. -- This module is an outboard adapter: contribute an `OpaPolicyDecisionAdapter` bean and every non-permitted exchange is authorized by your OPA server instead of in-process rules. +- `security-core` ships the in-process default, `EmbeddedPolicyDecisionAdapterImpl`, which this module replaces. +- `security-webflux` consumes whichever `PolicyDecisionPort` bean is present through its `PolicyAuthorizationManagerImpl`, so swapping the embedded engine for OPA is transparent to the filter chain. +- This module is an outboard adapter: contribute an `OpaPolicyDecisionAdapterImpl` bean and every non-permitted exchange is authorized by your OPA server instead of in-process rules. This adapter depends only on `security-api`, `security-spi`, `spring-webflux`, and `jackson-databind`. It pulls in no vendor SDK and no Spring Boot auto-configuration. It is a plain port implementation you wire as a bean. ### What it provides -`OpaPolicyDecisionAdapter` contributes a single capability: a `PolicyDecisionPort` whose decisions come from a live OPA server. +`OpaPolicyDecisionAdapterImpl` contributes a single capability: a `PolicyDecisionPort` whose decisions come from a live OPA server. - Reactive, SDK-free transport. Construction takes a `WebClient` whose base URL points at the OPA server plus a `decisionPath` (the OPA data path of the boolean allow rule, e.g. `firefly/allow`). A leading slash on the path is tolerated and stripped. The call is issued against `/v1/data/` and is non-blocking throughout. - A stable `input` shape. Every request sends OPA an `input` document with a nested `subject` (`subject`, `authorities`, `scopes`, `tenantId` drawn from the `SecurityPrincipal`), plus top-level `action`, `resource`, and `context` (a `null` context is sent as an empty object). Rego policies bind against this contract. @@ -146,8 +146,8 @@ This adapter depends only on `security-api`, `security-spi`, `spring-webflux`, a | Type | Role | | --- | --- | -| `OpaPolicyDecisionAdapter` | `PolicyDecisionPort` implementation; POSTs the `input` document to OPA's Data API and maps the boolean result to a `Decision`, fail-closed. | -| `OpaPolicyDecisionAdapter.OpaResult` | Package-private `record OpaResult(Boolean result)`. the deserialized subset of OPA's data response (`{"result": }`), `@JsonIgnoreProperties(ignoreUnknown = true)`. | +| `OpaPolicyDecisionAdapterImpl` | `PolicyDecisionPort` implementation; POSTs the `input` document to OPA's Data API and maps the boolean result to a `Decision`, fail-closed. | +| `OpaPolicyDecisionAdapterImpl.OpaResult` | Package-private `record OpaResult(Boolean result)`. the deserialized subset of OPA's data response (`{"result": }`), `@JsonIgnoreProperties(ignoreUnknown = true)`. | Port implemented (from `security-spi`): `PolicyDecisionPort`. Domain types consumed (from `security-api`): `SecurityPrincipal`, `Decision` (and its `Decision.Effect`). diff --git a/docs/site/modules/security-adapter-openfga.md b/docs/site/modules/security-adapter-openfga.md index aefa308dc..98e4cfd3b 100644 --- a/docs/site/modules/security-adapter-openfga.md +++ b/docs/site/modules/security-adapter-openfga.md @@ -4,7 +4,7 @@ Check relationship authorization through an OpenFGA store. -Construct OpenFgaRelationshipAdapter with a WebClient and store ID, then call check(subject, relation, object). The adapter posts tuple_key to the store check route and returns false for transport errors. Provision the authorization model and tuples in OpenFGA separately. +Construct OpenFgaRelationshipAdapterImpl with a WebClient and store ID, then call check(subject, relation, object). The adapter posts tuple_key to the store check route and returns false for transport errors. Provision the authorization model and tuples in OpenFGA separately. | Maven artifact | Packaging | Source project | | --- | --- | --- | @@ -40,12 +40,12 @@ RelationshipPort relationshipPort() { WebClient client = WebClient.builder() .baseUrl(System.getenv("OPENFGA_URL")) .build(); - return new OpenFgaRelationshipAdapter( + return new OpenFgaRelationshipAdapterImpl( client, System.getenv("OPENFGA_STORE_ID")); } ``` -Call `relationshipPort.check("user:alice", "viewer", "document:budget")` to obtain `Mono`. The adapter sends these values as `tuple_key.user`, `tuple_key.relation`, and `tuple_key.object` to `/stores/{storeId}/check`. It returns `false` on transport errors. Add any deployment authentication headers to the host-owned `WebClient`. Imports: `org.fireflyframework.security.spi.RelationshipPort`, `org.fireflyframework.security.adapter.openfga.OpenFgaRelationshipAdapter`, Spring `Bean`, and WebFlux `WebClient`. +Call `relationshipPort.check("user:alice", "viewer", "document:budget")` to obtain `Mono`. The adapter sends these values as `tuple_key.user`, `tuple_key.relation`, and `tuple_key.object` to `/stores/{storeId}/check`. It returns `false` on transport errors. Add any deployment authentication headers to the host-owned `WebClient`. Imports: `org.fireflyframework.security.spi.RelationshipPort`, `org.fireflyframework.security.adapter.openfga.OpenFgaRelationshipAdapterImpl`, Spring `Bean`, and WebFlux `WebClient`. ## Configuration and wiring @@ -55,7 +55,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`OpenFgaRelationshipAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapter.java) | Maps subject/relation/object checks to an OpenFGA store; transport failures return false. | +| [`OpenFgaRelationshipAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterImpl.java) | Maps subject/relation/object checks to an OpenFGA store; transport failures return false. | ## Related components @@ -92,7 +92,7 @@ The `allowsRelatedSubject` test demonstrates one concrete behavior. Excerpt from ```java @Test void allowsRelatedSubject() { - OpenFgaRelationshipAdapter adapter = new OpenFgaRelationshipAdapter(webClient, storeId); + OpenFgaRelationshipAdapterImpl adapter = new OpenFgaRelationshipAdapterImpl(webClient, storeId); StepVerifier.create(adapter.check("user:alice", "viewer", "document:budget")) .expectNext(true).verifyComplete(); } diff --git a/docs/site/modules/security-adapter-r2dbc.md b/docs/site/modules/security-adapter-r2dbc.md index 2c4d1cbe7..eb79f6a36 100644 --- a/docs/site/modules/security-adapter-r2dbc.md +++ b/docs/site/modules/security-adapter-r2dbc.md @@ -4,7 +4,7 @@ Persist token revocation records through a relational R2DBC adapter. -Provide DatabaseClient, apply the documented schema, and wire R2dbcRevocationAdapter into the security engine. Verify expiry and revocation queries against the same database dialect and clock behavior used in production. +Provide DatabaseClient, apply the documented schema, and wire R2dbcRevocationAdapterImpl into the security engine. Verify expiry and revocation queries against the same database dialect and clock behavior used in production. | Maven artifact | Packaging | Source project | | --- | --- | --- | @@ -32,12 +32,12 @@ Store revoked token IDs when the application uses PostgreSQL for that security s The Java examples in this section are API fragments for application code. Use the stated imports and supply the application-owned collaborators described alongside them. -`R2dbcRevocationAdapter` implements `RevocationPort` only. It does not implement `TokenIntrospectionCachePort`, and the default resource-server JWT decoder does not consult it automatically. Connect the port explicitly to the application's token-validation policy before relying on revocation. +`R2dbcRevocationAdapterImpl` implements `RevocationPort` only. It does not implement `TokenIntrospectionCachePort`, and the default resource-server JWT decoder does not consult it automatically. Connect the port explicitly to the application's token-validation policy before relying on revocation. Provide the adapter as the application's `RevocationPort` bean, wired from a Spring R2DBC `DatabaseClient`: ```java -import org.fireflyframework.security.adapter.r2dbc.R2dbcRevocationAdapter; +import org.fireflyframework.security.adapter.r2dbc.R2dbcRevocationAdapterImpl; import org.fireflyframework.security.spi.RevocationPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -48,7 +48,7 @@ class SecurityRevocationConfig { @Bean RevocationPort revocationPort(DatabaseClient databaseClient) { - return new R2dbcRevocationAdapter(databaseClient); + return new R2dbcRevocationAdapterImpl(databaseClient); } } ``` @@ -74,7 +74,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`R2dbcRevocationAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapter.java) | Relational-database `RevocationPort` backed by R2DBC. | +| [`R2dbcRevocationAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapterImpl.java) | Relational-database `RevocationPort` backed by R2DBC. | ## Related components @@ -138,12 +138,12 @@ The shipped resource-server decoder does not automatically call `RevocationPort` ### What it provides -#### `R2dbcRevocationAdapter` (implements `org.fireflyframework.security.spi.RevocationPort`) +#### `R2dbcRevocationAdapterImpl` (implements `org.fireflyframework.security.spi.RevocationPort`) A reactive, R2DBC-backed revocation list. Constructed with a single Spring `DatabaseClient`: ```java -public R2dbcRevocationAdapter(DatabaseClient databaseClient) +public R2dbcRevocationAdapterImpl(DatabaseClient databaseClient) ``` It implements the two `RevocationPort` operations: diff --git a/docs/site/modules/security-adapter-vault.md b/docs/site/modules/security-adapter-vault.md index 9fe33d1fd..7becdfded 100644 --- a/docs/site/modules/security-adapter-vault.md +++ b/docs/site/modules/security-adapter-vault.md @@ -4,7 +4,7 @@ Read a configured field from HashiCorp Vault KV v2 through SecretsPort. -Construct VaultSecretsAdapter with a Vault WebClient carrying X-Vault-Token, the KV mount, and value field name. GetSecret reads /v1/{mount}/data/{name}; a missing field or transport failure produces an error signal. Supply tokens through the runtime environment, not committed YAML. +Construct VaultSecretsAdapterImpl with a Vault WebClient carrying X-Vault-Token, the KV mount, and value field name. GetSecret reads /v1/{mount}/data/{name}; a missing field or transport failure produces an error signal. Supply tokens through the runtime environment, not committed YAML. | Maven artifact | Packaging | Source project | | --- | --- | --- | @@ -41,11 +41,11 @@ SecretsPort secretsPort() { .baseUrl(System.getenv("VAULT_ADDR")) .defaultHeader("X-Vault-Token", System.getenv("VAULT_TOKEN")) .build(); - return new VaultSecretsAdapter(client, "secret", "value"); + return new VaultSecretsAdapterImpl(client, "secret", "value"); } ``` -Inject `SecretsPort` and call `getSecret("payments-api")` as part of a reactive flow. The returned `Mono` contains the configured field; missing secrets/fields and HTTP failures propagate as `IllegalStateException`. Imports: `org.fireflyframework.security.spi.SecretsPort`, `org.fireflyframework.security.adapter.vault.VaultSecretsAdapter`, Spring's `Bean`, and WebFlux `WebClient`. This module provides explicit adapter construction, not a `firefly.vault.*` auto-configuration namespace. +Inject `SecretsPort` and call `getSecret("payments-api")` as part of a reactive flow. The returned `Mono` contains the configured field; missing secrets/fields and HTTP failures propagate as `IllegalStateException`. Imports: `org.fireflyframework.security.spi.SecretsPort`, `org.fireflyframework.security.adapter.vault.VaultSecretsAdapterImpl`, Spring's `Bean`, and WebFlux `WebClient`. This module provides explicit adapter construction, not a `firefly.vault.*` auto-configuration namespace. ## Configuration and wiring @@ -55,7 +55,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`VaultSecretsAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapter.java) | Reads one configured field from Vault KV v2 through SecretsPort; missing fields and HTTP failures propagate as errors. | +| [`VaultSecretsAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapterImpl.java) | Reads one configured field from Vault KV v2 through SecretsPort; missing fields and HTTP failures propagate as errors. | ## Related components diff --git a/docs/site/modules/security-authorization-server.md b/docs/site/modules/security-authorization-server.md index 090fee29e..658f15ba5 100644 --- a/docs/site/modules/security-authorization-server.md +++ b/docs/site/modules/security-authorization-server.md @@ -152,7 +152,7 @@ security-api → security-spi → security-core → security-authorization - `security-api` defines the domain. including `SigningKey`, the RSA key-pair record this server turns into JWKS entries. - `security-spi` defines the driven port this module consumes: `KeyManagementPort` (`activeSigningKey()`, `verificationKeys()`, `jwkSetJson()`, `rotate()`). -- `security-core` supplies the framework-neutral default key adapter, `InMemoryKeyManagementAdapter`, used as the dev/default `KeyManagementPort`. +- `security-core` supplies the framework-neutral default key adapter, `InMemoryKeyManagementAdapterImpl`, used as the dev/default `KeyManagementPort`. - This module binds the above into a concrete Spring Authorization Server deployment: it builds a Nimbus `JWKSource` from the port's `verificationKeys()` and wires the standard OAuth2/OIDC filter chains. - Adapters (key management, client store) replace the in-process defaults by contributing their own `KeyManagementPort` or `RegisteredClientRepository` beans. e.g. a Vault/AWS-KMS key adapter and an internal-db client store for production. @@ -167,7 +167,7 @@ This module depends only on `security-spi` and `security-core` (which transitive - A JWKS sourced from the framework key port. `jwkSource(KeyManagementPort)` (`@ConditionalOnMissingBean`) collects `KeyManagementPort.verificationKeys()`, converts each `SigningKey` into a Nimbus `RSAKey` (public key, private key, and `kid`), and exposes them as an `ImmutableJWKSet`. The published JWKS and signer use this key set. Resource servers must be configured to trust the published keys. - A JWT decoder built from that JWK source via `OAuth2AuthorizationServerConfiguration.jwtDecoder(jwkSource)`, for the server's own introspection/validation needs. - Authorization-server settings. A default `AuthorizationServerSettings` (`@ConditionalOnMissingBean`), overridable to customise issuer URL and endpoint paths. -- A default `KeyManagementPort`. `authorizationServerKeyManagementPort()` (`@ConditionalOnMissingBean`) returns an `InMemoryKeyManagementAdapter` so the server boots with a working dev key; production contributes a real key adapter and this default steps aside. +- A default `KeyManagementPort`. `authorizationServerKeyManagementPort()` (`@ConditionalOnMissingBean`) returns an `InMemoryKeyManagementAdapterImpl` so the server boots with a working dev key; production contributes a real key adapter and this default steps aside. - A demo `client_credentials` client. `registeredClientRepository()` (`@ConditionalOnMissingBean`) registers a single `RegisteredClient`. client id `firefly-demo`, secret `{noop}firefly-secret`, `client_secret_basic` authentication, the `client_credentials` grant, and scope `read`. in an `InMemoryRegisteredClientRepository`. Production overrides this bean (e.g. with an internal-db-backed store). The auto-configuration is registered via `META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports`. @@ -178,7 +178,7 @@ The auto-configuration is registered via `META-INF/spring/org.springframework.bo | --- | --- | | `AuthorizationServerConfiguration` | `@AutoConfiguration` entry point; builds the two servlet `SecurityFilterChain`s, the `JWKSource`, the `JwtDecoder`, the `AuthorizationServerSettings`, the default `KeyManagementPort`, and the demo `RegisteredClientRepository`. | -Port consumed (from `security-spi`): `KeyManagementPort`. Domain type (from `security-api`): `SigningKey`. Default key adapter (from `security-core`): `InMemoryKeyManagementAdapter`. The protocol machinery (`OAuth2AuthorizationServerConfiguration`, `OAuth2AuthorizationServerConfigurer`, `RegisteredClient`, `InMemoryRegisteredClientRepository`, `AuthorizationServerSettings`, Nimbus `JWKSource`/`RSAKey`) comes from Spring Authorization Server and Nimbus JOSE. +Port consumed (from `security-spi`): `KeyManagementPort`. Domain type (from `security-api`): `SigningKey`. Default key adapter (from `security-core`): `InMemoryKeyManagementAdapterImpl`. The protocol machinery (`OAuth2AuthorizationServerConfiguration`, `OAuth2AuthorizationServerConfigurer`, `RegisteredClient`, `InMemoryRegisteredClientRepository`, `AuthorizationServerSettings`, Nimbus `JWKSource`/`RSAKey`) comes from Spring Authorization Server and Nimbus JOSE. ### Endpoints diff --git a/docs/site/modules/security-bff.md b/docs/site/modules/security-bff.md index f4afa4cda..e5eda7ca1 100644 --- a/docs/site/modules/security-bff.md +++ b/docs/site/modules/security-bff.md @@ -98,9 +98,9 @@ Property-based wiring conditions found in this module: | --- | --- | | [`BffLoginHook`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffLoginHook.java) | Opt-in extension point invoked once per successful login , in the oauth2Login success handler, before the post-login redirect. | | [`BffSecurityProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffSecurityProperties.java) | Configuration for the token-handler BFF security chain (`BffSecurityAutoConfiguration`). | -| [`BffRefreshTokenFailureWebFilter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilter.java) | Turns a dead-session token failure into a clean, actionable response. | +| [`BffRefreshTokenFailureWebFilterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilterImpl.java) | Turns a dead-session token failure into a clean, actionable response. | | [`BffSecurityAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffSecurityAutoConfiguration.java) | Defines `bffSecurityWebFilterChain`, `NegatedServerWebExchangeMatcher`, `bffAuthorizedClientManager`, `DefaultReactiveOAuth2AuthorizedClientManager` operations. | -| [`CsrfCookieWebFilter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilter.java) | Materializes the CSRF token so the `XSRF-TOKEN` cookie is actually delivered to the browser. | +| [`CsrfCookieWebFilterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilterImpl.java) | Materializes the CSRF token so the `XSRF-TOKEN` cookie is actually delivered to the browser. | ## Build and test diff --git a/docs/site/modules/security-core.md b/docs/site/modules/security-core.md index 00b72d590..6755d5609 100644 --- a/docs/site/modules/security-core.md +++ b/docs/site/modules/security-core.md @@ -53,7 +53,7 @@ The core is normally wired by `security-autoconfigure`, but every component is a ```java import org.fireflyframework.security.api.domain.Decision; import org.fireflyframework.security.api.domain.SecurityPrincipal; -import org.fireflyframework.security.core.authority.ConfigurableAuthorityMapper; +import org.fireflyframework.security.core.authority.ConfigurableAuthorityMapperImpl; import org.fireflyframework.security.core.authz.SecureAuthorizationEvaluator; import org.fireflyframework.security.core.authz.SecureRequirement; import org.fireflyframework.security.core.context.PrincipalFactory; @@ -62,7 +62,7 @@ import java.util.List; import java.util.Map; // 1. Project validated claims into a generic principal, normalizing authorities/scopes. -var authorityMapper = new ConfigurableAuthorityMapper(null); // null -> sensible defaults +var authorityMapper = new ConfigurableAuthorityMapperImpl(null); // null -> sensible defaults var principalFactory = new PrincipalFactory(authorityMapper); Map claims = Map.of( @@ -95,10 +95,10 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | | [`SecureAuthorizationEvaluator`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/authz/SecureAuthorizationEvaluator.java) | Evaluates a `SecureRequirement` against a `SecurityPrincipal`. | -| [`EmbeddedPolicyDecisionAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapter.java) | Zero-dependency, in-process default `PolicyDecisionPort`. | -| [`AuthorityMappingProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/authority/AuthorityMappingProperties.java) | Configuration for `ConfigurableAuthorityMapper`: which claim paths carry roles/groups and scopes, and an optional authority prefix. | -| [`PolicyRule`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/PolicyRule.java) | A single in-process ABAC rule for the `EmbeddedPolicyDecisionAdapter`. | -| [`LoggingAuditEventAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapter.java) | Default `AuditEventPort`: emits structured audit lines to a dedicated logger. | +| [`EmbeddedPolicyDecisionAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapterImpl.java) | Zero-dependency, in-process default `PolicyDecisionPort`. | +| [`AuthorityMappingProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/authority/AuthorityMappingProperties.java) | Configuration for `ConfigurableAuthorityMapperImpl`: which claim paths carry roles/groups and scopes, and an optional authority prefix. | +| [`PolicyRule`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/PolicyRule.java) | A single in-process ABAC rule for the `EmbeddedPolicyDecisionAdapterImpl`. | +| [`LoggingAuditEventAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapterImpl.java) | Default `AuditEventPort`: emits structured audit lines to a dedicated logger. | ## Related components @@ -171,13 +171,13 @@ Each type below is a default implementation of a `security-spi` port, or a self- | Type | Port implemented | Responsibility | | --- | --- | --- | -| `ConfigurableAuthorityMapper` | `AuthorityMappingPort` | Reads roles/groups and scopes from configured dot-path claims and normalizes them into authorities. Absorbs the old `JwtClaimsRoleExtractor`. | +| `ConfigurableAuthorityMapperImpl` | `AuthorityMappingPort` | Reads roles/groups and scopes from configured dot-path claims and normalizes them into authorities. Absorbs the old `JwtClaimsRoleExtractor`. | | `SecureAuthorizationEvaluator` | _(backs `@Secure`)_ | Evaluates a `SecureRequirement` against a `SecurityPrincipal` with fixed AND-across-dimensions semantics, real SpEL, and default-deny. | -| `EmbeddedPolicyDecisionAdapter` | `PolicyDecisionPort` | Zero-dependency in-process PDP combining `PolicyRule`s with deny-overrides; fail-closed. The default until OPA/Cerbos/OpenFGA adapters are bound. | -| `CaffeineIntrospectionCache` | `TokenIntrospectionCachePort` | In-memory cache of opaque-introspection results with per-entry TTL bounded by token expiry. | -| `InMemoryKeyManagementAdapter` | `KeyManagementPort` | Dev-default RS256 key source: generates a key pair, serves a JWKS, rotates with an overlap window. Not for production. | +| `EmbeddedPolicyDecisionAdapterImpl` | `PolicyDecisionPort` | Zero-dependency in-process PDP combining `PolicyRule`s with deny-overrides; fail-closed. The default until OPA/Cerbos/OpenFGA adapters are bound. | +| `CaffeineIntrospectionCacheImpl` | `TokenIntrospectionCachePort` | In-memory cache of opaque-introspection results with per-entry TTL bounded by token expiry. | +| `InMemoryKeyManagementAdapterImpl` | `KeyManagementPort` | Dev-default RS256 key source: generates a key pair, serves a JWKS, rotates with an overlap window. Not for production. | | `PrincipalFactory` | _(projection helper)_ | Projects a validated claims map into a `SecurityPrincipal` via the `AuthorityMappingPort`; stack-neutral (JWT and opaque paths). | -| `LoggingAuditEventAdapter` | `AuditEventPort` | Emits structured audit lines to a dedicated logger; never throws, never blocks the request path. | +| `LoggingAuditEventAdapterImpl` | `AuditEventPort` | Emits structured audit lines to a dedicated logger; never throws, never blocks the request path. | | `BearerTokenExtractor` | _(parsing helper)_ | Parses the `Authorization` header into a classified `BearerToken`, matching the `Bearer` scheme case-insensitively (RFC 6750). | Supporting types: `SecureRequirement` (a framework-neutral view of `@Secure`, built from the annotation or programmatically), `AuthorityMappingProperties` (role/scope claim paths + authority prefix; defaults cover Keycloak `realm_access.roles`, Cognito `cognito:groups`, and generic `roles`/`groups`/`scope`/`scp`), `ClaimPaths` (dot-path traversal + string-set coercion), and `PolicyRule` (a `@FunctionalInterface` ABAC rule returning PERMIT / DENY / INDETERMINATE). @@ -190,9 +190,9 @@ Scalar `scope` and configured `scp` strings use ASCII spaces as scope separators The engine is deliberately fail-closed at every decision point: - `SecureAuthorizationEvaluator`. a `null` (unauthenticated) principal is denied. Declared dimensions (roles, scopes, permissions, expression) are AND-ed; within a dimension, `requireAll*` selects ALL vs ANY (ANY by default). An empty requirement permits any authenticated principal ("require authentication"). A SpEL expression that evaluates false, or throws / is malformed, denies. -- `EmbeddedPolicyDecisionAdapter`. The original constructor preserves legacy deny-overrides semantics and permits with no rules to defer to a separate RBAC gate. The `(List, boolean strict)` overload with `true` denies missing rules, failed/empty publishers, malformed decisions without an effect and explicit denials, requires an explicit permit, and retains permit obligations in rule order. Normal indeterminate abstention may coexist with an explicit permit. An enforcing caller must fulfill returned obligations or deny; a provider bean is not evidence of an institution policy. The resource-server binding selects this overload with `firefly.security.resource-server.strict-policy: true`. -- `InMemoryKeyManagementAdapter`. flagged not-for-production; the autoconfigure layer fails closed at startup if no real key source resolves under prod profiles. -- `CaffeineIntrospectionCache`. TTL is bounded by the token's own expiry, so a revoked-by-expiry token cannot outlive its `exp`. +- `EmbeddedPolicyDecisionAdapterImpl`. The original constructor preserves legacy deny-overrides semantics and permits with no rules to defer to a separate RBAC gate. The `(List, boolean strict)` overload with `true` denies missing rules, failed/empty publishers, malformed decisions without an effect and explicit denials, requires an explicit permit, and retains permit obligations in rule order. Normal indeterminate abstention may coexist with an explicit permit. An enforcing caller must fulfill returned obligations or deny; a provider bean is not evidence of an institution policy. The resource-server binding selects this overload with `firefly.security.resource-server.strict-policy: true`. +- `InMemoryKeyManagementAdapterImpl`. flagged not-for-production; the autoconfigure layer fails closed at startup if no real key source resolves under prod profiles. +- `CaffeineIntrospectionCacheImpl`. TTL is bounded by the token's own expiry, so a revoked-by-expiry token cannot outlive its `exp`. ### Dependencies @@ -202,7 +202,7 @@ Runtime dependencies are intentionally minimal and SDK-free: - `fireflyframework-security-spi`. the driven-port interfaces implemented here - `io.projectreactor:reactor-core`. `Mono`/`Flux` for the reactive ports - `org.springframework:spring-expression`. SpEL for `@Secure.expression` (the expression engine only. not Spring Security or Spring web) -- `com.github.ben-manes.caffeine:caffeine`. backing store for `CaffeineIntrospectionCache` +- `com.github.ben-manes.caffeine:caffeine`. backing store for `CaffeineIntrospectionCacheImpl` - `org.slf4j:slf4j-api`. logging facade (audit + policy/expression denials) - `org.projectlombok:lombok`. provided-scope, compile-time only diff --git a/docs/site/modules/security-idp-aws-cognito.md b/docs/site/modules/security-idp-aws-cognito.md index 32221d89f..e12bef9a0 100644 --- a/docs/site/modules/security-idp-aws-cognito.md +++ b/docs/site/modules/security-idp-aws-cognito.md @@ -63,7 +63,7 @@ import reactor.core.publisher.Mono; @RequiredArgsConstructor public class AuthService { - private final IdpAdapter idp; // CognitoIdpAdapter wired by CognitoAutoConfiguration + private final IdpAdapter idp; // CognitoIdpAdapterImpl wired by CognitoAutoConfiguration @@ -101,7 +101,7 @@ Property-based wiring conditions found in this module: | Type | Contract and responsibility | | --- | --- | -| [`CognitoIdpAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapter.java) | AWS Cognito implementation of the Firefly IDP Adapter. | +| [`CognitoIdpAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterImpl.java) | AWS Cognito implementation of the Firefly IDP Adapter. | | [`CognitoProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/properties/CognitoProperties.java) | Configuration properties for AWS Cognito Identity Provider. | | [`CognitoClientFactory`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/client/CognitoClientFactory.java) | Factory for creating and managing AWS Cognito Identity Provider clients. | | [`CognitoAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/config/CognitoAutoConfiguration.java) | Spring auto-configuration for AWS Cognito IDP Adapter. | @@ -206,7 +206,7 @@ When active, it contributes (each `@ConditionalOnMissingBean`, so you can overri 1. `CognitoClientFactory`. Builds the AWS SDK v2 client from `CognitoProperties`, applying the endpoint override when configured. 2. `CognitoUserService` and `CognitoAdminService`. The end-user and administrative operation services. -3. `IdpAdapter` (a `CognitoIdpAdapter`). Registered only if no other `IdpAdapter` bean exists, so a single provider wins. +3. `IdpAdapter` (a `CognitoIdpAdapterImpl`). Registered only if no other `IdpAdapter` bean exists, so a single provider wins. Each adapter call delegates to the matching service, which obtains the lazily-cached client from the factory and invokes the corresponding Cognito API inside a `Mono.fromCallable(...)`, returning the framework's neutral response DTOs. The client is closed on application shutdown via `@PreDestroy`. diff --git a/docs/site/modules/security-idp-azure-ad.md b/docs/site/modules/security-idp-azure-ad.md index bd88811b1..0fa290bda 100644 --- a/docs/site/modules/security-idp-azure-ad.md +++ b/docs/site/modules/security-idp-azure-ad.md @@ -112,7 +112,7 @@ Property-based wiring conditions found in this module: | Type | Contract and responsibility | | --- | --- | -| [`AzureAdIdpAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapter.java) | Azure AD implementation of the Firefly IDP Adapter. | +| [`AzureAdIdpAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapterImpl.java) | Azure AD implementation of the Firefly IDP Adapter. | | [`AzureAdProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/config/AzureAdProperties.java) | Carries `mode`, `tenantId`, `clientId`, `clientSecret`, `b2c` data; field constraints and defaults are declared in the linked source. | | [`AzureAdAdminService`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/AzureAdAdminService.java) | Admin service interface for Azure AD user management operations. | | [`GraphClientFactory`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/client/GraphClientFactory.java) | Defines `createClient`, `destroy` operations. | @@ -228,12 +228,12 @@ at startup if any is missing. The effective MSAL authority is derived automatica - `AzureAdAutoConfiguration`. `@ConditionalOnProperty(firefly.security.idp.provider=azure-ad)` and `@ConditionalOnClass(ConfidentialClientApplication.class)`; registers the client factories, services, and the `IdpAdapter` bean. The admin-service bean is chosen by `firefly.security.idp.azure-ad.mode`. -- `AzureAdIdpAdapter`. implements `IdpAdapter`; delegates auth/token calls to `AzureAdAuthService` and +- `AzureAdIdpAdapterImpl`. implements `IdpAdapter`; delegates auth/token calls to `AzureAdAuthService` and admin calls to the selected `AzureAdAdminService`. - `AzureAdAuthService`. login (ROPC), refresh, logout, introspect, user info, and token revocation via MSAL4J + Graph. -- `EntraIdAdminService` / `B2CAdminService`. user, role, session, and password operations via the - Microsoft Graph SDK; `B2CAdminService extends EntraIdAdminService` with B2C local-account overrides. +- `EntraIdAdminServiceImpl` / `B2CAdminServiceImpl`. user, role, session, and password operations via the + Microsoft Graph SDK; `B2CAdminServiceImpl extends EntraIdAdminServiceImpl` with B2C local-account overrides. - `MsalClientFactory` / `GraphClientFactory`. lazily build and cache the confidential-client and Graph clients, released on shutdown. - `AzureAdTokenParser`. local, dependency-free JWT decoding for introspection and user-ID extraction. diff --git a/docs/site/modules/security-idp-internal-db.md b/docs/site/modules/security-idp-internal-db.md index 69bef8db4..68f5c97a0 100644 --- a/docs/site/modules/security-idp-internal-db.md +++ b/docs/site/modules/security-idp-internal-db.md @@ -73,7 +73,7 @@ import reactor.core.publisher.Mono; @RequiredArgsConstructor public class AuthController { - private final IdpAdapter idp; // InternalDbIdpAdapter, wired by auto-configuration + private final IdpAdapter idp; // InternalDbIdpAdapterImpl, wired by auto-configuration @PostMapping("/auth/login") public Mono> login(@RequestBody LoginRequest request) { @@ -107,7 +107,7 @@ Property-based wiring conditions found in this module: | Type | Contract and responsibility | | --- | --- | -| [`InternalDbIdpAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapter.java) | Internal Database implementation of the Firefly IDP Adapter. | +| [`InternalDbIdpAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapterImpl.java) | Internal Database implementation of the Firefly IDP Adapter. | | [`InternalDbProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/config/InternalDbProperties.java) | Configuration properties for Internal Database IDP implementation. | | [`PasswordResetTokenRepository`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/repository/PasswordResetTokenRepository.java) | Reactive repository for password reset token operations. | | [`RefreshTokenRepository`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/repository/RefreshTokenRepository.java) | Reactive repository for RefreshToken entity operations. | @@ -243,7 +243,7 @@ User records store BCrypt password hashes, account status flags, and TOTP MFA en 1. Enables `InternalDbProperties` and the R2DBC repositories in `org.fireflyframework.security.idp.internaldb.repository`. 2. Registers a strength-12 `BCryptPasswordEncoder` (unless one is already defined). 3. Wires the service layer. JWT, authentication, user management, roles, password reset, password policy and MFA. -4. Exposes the `InternalDbIdpAdapter` as the `IdpAdapter` bean consumed by the IDP core web layer. +4. Exposes the `InternalDbIdpAdapterImpl` as the `IdpAdapter` bean consumed by the IDP core web layer. Because every bean is `@ConditionalOnMissingBean`, you can replace any individual collaborator (for example, supply a custom `PasswordEncoder` or `JwtTokenService`) without forking the module. diff --git a/docs/site/modules/security-idp.md b/docs/site/modules/security-idp.md index 6b95dcad7..9ce9d5578 100644 --- a/docs/site/modules/security-idp.md +++ b/docs/site/modules/security-idp.md @@ -156,18 +156,18 @@ firefly: provider: keycloak # REQUIRED — selects the active adapter (no default; @NotBlank) observability: metrics: - enabled: true # default true — gates IdpMetrics registration + enabled: true # default true — gates IdpMetricsImpl registration ``` | Property | Default | Description | | --- | --- | --- | | `firefly.security.idp.provider` | _(none, required)_ | Selects the active IDP adapter. One of `keycloak`, `cognito`, `azure-ad`, `internal-db`. Validated as `@NotBlank` via `IdpProperties`. | -| `firefly.observability.metrics.enabled` | `true` | When `true` (or absent), registers the `IdpMetrics` bean. Set to `false` to disable IDP metrics. | +| `firefly.observability.metrics.enabled` | `true` | When `true` (or absent), registers the `IdpMetricsImpl` bean. Set to `false` to disable IDP metrics. | Auto-configuration entry points (`META-INF/spring/...AutoConfiguration.imports`): - `IdpWebAutoConfiguration`. registers `IdpController` when an `IdpAdapter` bean exists and the app is a reactive web application (`@ConditionalOnWebApplication(REACTIVE)`); also enables `IdpProperties`. -- `IdpObservabilityAutoConfiguration`. registers `IdpMetrics` when a Micrometer `MeterRegistry` is present and metrics are enabled. +- `IdpObservabilityAutoConfiguration`. registers `IdpMetricsImpl` when a Micrometer `MeterRegistry` is present and metrics are enabled. ### REST API @@ -199,7 +199,7 @@ When the `IdpController` is auto-mounted, the following endpoints are exposed un ### Observability -`IdpMetrics` (auto-configured) records, all tagged by `provider`: +`IdpMetricsImpl` (auto-configured) records, all tagged by `provider`: - `firefly.security.idp.authentications`. total auth attempts, tagged `status=success|failure` - `firefly.security.idp.authentication.duration`. authentication latency timer @@ -207,7 +207,7 @@ When the `IdpController` is auto-mounted, the following endpoints are exposed un - `firefly.security.idp.token.refreshed`. token refreshes - `firefly.security.idp.errors`. failed IDP operations, tagged `operation`, `error.type` -Adapters wrap their authentication calls with `IdpMetrics.timedAuthentication(provider, mono)` to get success/failure counters and the latency timer for free. +Adapters wrap their authentication calls with `IdpMetricsImpl.timedAuthentication(provider, mono)` to get success/failure counters and the latency timer for free. ## Continue the application diff --git a/docs/site/modules/security-method-policy.md b/docs/site/modules/security-method-policy.md index 94732ca4f..5d0fb7f4d 100644 --- a/docs/site/modules/security-method-policy.md +++ b/docs/site/modules/security-method-policy.md @@ -76,7 +76,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | | [`MethodSecurityAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/MethodSecurityAutoConfiguration.java) | Enables reactive method security (`@PreAuthorize`/`@PostAuthorize`) and registers the `Secure` interceptor so `@Secure` works as ergonomic, fail-closed sugar on top of it. | -| [`SecureMethodAuthorizationManager`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManager.java) | Reactive `ReactiveAuthorizationManager` that enforces the `Secure` annotation on methods (or their declaring class) using the framework's `SecureAuthorizationEvaluator`. | +| [`SecureMethodAuthorizationManagerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManagerImpl.java) | Reactive `ReactiveAuthorizationManager` that enforces the `Secure` annotation on methods (or their declaring class) using the framework's `SecureAuthorizationEvaluator`. | ## Related components @@ -142,9 +142,9 @@ This module depends only on `security-core` and `security-webflux` (which transi `MethodSecurityAutoConfiguration` (annotated `@AutoConfiguration @EnableReactiveMethodSecurity`) contributes: - Reactive method security, by carrying `@EnableReactiveMethodSecurity`. This enables Spring's standard `@PreAuthorize`/`@PostAuthorize` reactive interceptors against `ReactiveSecurityContextHolder`. -- The `@Secure` interceptor. a single `AuthorizationManagerBeforeReactiveMethodInterceptor` bean (`fireflySecureMethodInterceptor`, registered with `BeanDefinition.ROLE_INFRASTRUCTURE`). Its pointcut matches the `@Secure` annotation on either a method or its declaring type (a `ComposablePointcut` union of two `AnnotationMatchingPointcut`s), and it delegates the allow/deny decision to `SecureMethodAuthorizationManager`. +- The `@Secure` interceptor. a single `AuthorizationManagerBeforeReactiveMethodInterceptor` bean (`fireflySecureMethodInterceptor`, registered with `BeanDefinition.ROLE_INFRASTRUCTURE`). Its pointcut matches the `@Secure` annotation on either a method or its declaring type (a `ComposablePointcut` union of two `AnnotationMatchingPointcut`s), and it delegates the allow/deny decision to `SecureMethodAuthorizationManagerImpl`. -`SecureMethodAuthorizationManager` is a `ReactiveAuthorizationManager` that: +`SecureMethodAuthorizationManagerImpl` is a `ReactiveAuthorizationManager` that: 1. Resolves the effective `@Secure` annotation. Method-level first (`AnnotatedElementUtils.findMergedAnnotation`), then the target class (via `AopUtils.getTargetClass`). If none is present, it permits (so the interceptor is inert on unannotated methods). 2. Converts the annotation to a neutral `SecureRequirement` (`SecureRequirement.from(...)`). @@ -158,7 +158,7 @@ It is fail-closed: an unauthenticated caller (empty/anonymous context) yields `n | Type | Role | | --- | --- | | `MethodSecurityAutoConfiguration` | `@AutoConfiguration @EnableReactiveMethodSecurity` entry point; enables reactive method security and registers the `@Secure` interceptor. | -| `SecureMethodAuthorizationManager` | `ReactiveAuthorizationManager` that resolves `@Secure`, builds a `SecureRequirement`, and evaluates it against the reactive `SecurityPrincipal`, fail-closed. | +| `SecureMethodAuthorizationManagerImpl` | `ReactiveAuthorizationManager` that resolves `@Secure`, builds a `SecureRequirement`, and evaluates it against the reactive `SecurityPrincipal`, fail-closed. | Annotation enforced (from `security-api`): `@Secure` (`roles`, `scopes`, `permissions`, `requireAllRoles`/`requireAllScopes`/`requireAllPermissions`, `expression`). Engine consumed (from `security-core`): `SecureRequirement`, `SecureAuthorizationEvaluator`, `Decision`. Reactive glue consumed (from `security-webflux`): `PrincipalSupport`, `FireflyAuthenticationToken`. Domain (from `security-api`): `SecurityPrincipal`. @@ -169,7 +169,7 @@ The auto-configuration is registered via `META-INF/spring/org.springframework.bo ``` Mono method() guarded by @Secure → fireflySecureMethodInterceptor (pointcut: @Secure on method or class) - → SecureMethodAuthorizationManager.check(...) + → SecureMethodAuthorizationManagerImpl.check(...) → resolve @Secure (method first, then target class) → SecureRequirement.from(secure) → PrincipalSupport.extract(Authentication) // from ReactiveSecurityContextHolder diff --git a/docs/site/modules/security-resource-server.md b/docs/site/modules/security-resource-server.md index e535ab4c7..7eca36386 100644 --- a/docs/site/modules/security-resource-server.md +++ b/docs/site/modules/security-resource-server.md @@ -69,7 +69,7 @@ class MeController { } ``` -Add ABAC/ReBAC decisions by contributing one or more `PolicyRule` beans; they are collected by the default `EmbeddedPolicyDecisionAdapter` and consulted on every non-permitted exchange, fail-closed: +Add ABAC/ReBAC decisions by contributing one or more `PolicyRule` beans; they are collected by the default `EmbeddedPolicyDecisionAdapterImpl` and consulted on every non-permitted exchange, fail-closed: ```java @Bean @@ -123,7 +123,7 @@ Property-based wiring conditions found in this module: | --- | --- | | [`ResourceServerAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/ResourceServerAutoConfiguration.java) | Auto-configures a secure-by-default reactive OAuth2 resource server. | | [`ResourceServerProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/ResourceServerProperties.java) | Configuration for the secure-by-default resource server. | -| [`JwtToFireflyPrincipalConverter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverter.java) | Converts a signature-validated `Jwt` into a `FireflyAuthenticationToken` whose principal is a `SecurityPrincipal` with normalized authorities/scopes. | +| [`JwtToFireflyPrincipalConverterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverterImpl.java) | Converts a signature-validated `Jwt` into a `FireflyAuthenticationToken` whose principal is a `SecurityPrincipal` with normalized authorities/scopes. | ## Related components @@ -183,8 +183,8 @@ security-api → security-spi → security-core → security-webflux → - `security-api` defines the domain (`SecurityPrincipal`, `Decision`, `SigningKey`) and driving ports. - `security-spi` defines the driven ports this module consumes: `KeyManagementPort`, `AuthorityMappingPort`, `PolicyDecisionPort`, `AuditEventPort`, `SecurityContextPort`. -- `security-core` supplies the framework-neutral default implementations (`InMemoryKeyManagementAdapter`, `ConfigurableAuthorityMapper`, `PrincipalFactory`, `EmbeddedPolicyDecisionAdapter`, `LoggingAuditEventAdapter`). -- `security-webflux` supplies the reactive Spring Security glue (`FireflyAuthenticationToken`, `PolicyAuthorizationManager`, `ReactorSecurityContextAdapter`). +- `security-core` supplies the framework-neutral default implementations (`InMemoryKeyManagementAdapterImpl`, `ConfigurableAuthorityMapperImpl`, `PrincipalFactory`, `EmbeddedPolicyDecisionAdapterImpl`, `LoggingAuditEventAdapterImpl`). +- `security-webflux` supplies the reactive Spring Security glue (`FireflyAuthenticationToken`, `PolicyAuthorizationManagerImpl`, `ReactorSecurityContextAdapterImpl`). - This module binds all of the above into a concrete `SecurityWebFilterChain` and is delivered to applications transitively via the application starter. - Adapters (key management, policy, idp providers) replace the in-process defaults by simply contributing their own port beans. @@ -196,11 +196,11 @@ This module depends only on `security-webflux` (which transitively brings `secur - A verifying JWT decoder. `NimbusReactiveJwtDecoder.withPublicKey(...)` built from the active RSA `SigningKey` resolved through `KeyManagementPort.activeSigningKey()`, pinned to `RS256`. If no RSA key resolves, the context fails to start (fail-closed) rather than booting an unprotected server. - A validator chain. A `DelegatingOAuth2TokenValidator` always enforcing required expiration and timestamp validation through `AccessTokenValidators.timestamps()` (including nbf/skew validation), plus `JwtIssuerValidator` when `issuer` is configured and a custom audience validator when `audiences` is non-empty. -- Claim-to-authority mapping. An `AuthorityMappingPort` (default `ConfigurableAuthorityMapper`) driven by configurable role/scope claim paths and authority prefix, normalizing provider-specific claims (Keycloak/Cognito/Entra) into a uniform authority/scope set. -- A framework principal. `JwtToFireflyPrincipalConverter` replaces Spring's default `JwtAuthenticationToken` with a `FireflyAuthenticationToken` whose principal is a `SecurityPrincipal` (built by `PrincipalFactory.fromClaims(...)`), so `@AuthenticationPrincipal SecurityPrincipal` works with its default configuration. -- An authenticated policy filter chain. `fireflySecurityWebFilterChain` disables CSRF, HTTP-Basic, form-login, and logout; permits only the explicitly configured `permitMatchers`; and routes `anyExchange()` through a `PolicyAuthorizationManager` backed by `PolicyDecisionPort`. Anonymous requests to unconfigured routes are denied. Authenticated authorization depends on the configured policy mode; strict mode requires an explicit permit. +- Claim-to-authority mapping. An `AuthorityMappingPort` (default `ConfigurableAuthorityMapperImpl`) driven by configurable role/scope claim paths and authority prefix, normalizing provider-specific claims (Keycloak/Cognito/Entra) into a uniform authority/scope set. +- A framework principal. `JwtToFireflyPrincipalConverterImpl` replaces Spring's default `JwtAuthenticationToken` with a `FireflyAuthenticationToken` whose principal is a `SecurityPrincipal` (built by `PrincipalFactory.fromClaims(...)`), so `@AuthenticationPrincipal SecurityPrincipal` works with its default configuration. +- An authenticated policy filter chain. `fireflySecurityWebFilterChain` disables CSRF, HTTP-Basic, form-login, and logout; permits only the explicitly configured `permitMatchers`; and routes `anyExchange()` through a `PolicyAuthorizationManagerImpl` backed by `PolicyDecisionPort`. Anonymous requests to unconfigured routes are denied. Authenticated authorization depends on the configured policy mode; strict mode requires an explicit permit. - Hardened response headers on every response: `X-Frame-Options: DENY`, `Referrer-Policy: no-referrer`, a strict `Content-Security-Policy` (`default-src 'none'; frame-ancestors 'none'`), and HSTS (`includeSubDomains`, 365-day max-age). -- Framework defaults for the remaining ports. `EmbeddedPolicyDecisionAdapter` (collecting any `PolicyRule` beans), `LoggingAuditEventAdapter`, and `ReactorSecurityContextAdapter`. all overridable. +- Framework defaults for the remaining ports. `EmbeddedPolicyDecisionAdapterImpl` (collecting any `PolicyRule` beans), `LoggingAuditEventAdapterImpl`, and `ReactorSecurityContextAdapterImpl`. all overridable. ### Key types @@ -208,7 +208,7 @@ This module depends only on `security-webflux` (which transitively brings `secur | --- | --- | | `ResourceServerAutoConfiguration` | `@AutoConfiguration @EnableWebFluxSecurity` entry point; builds the decoder, converter, and `SecurityWebFilterChain`. | | `ResourceServerProperties` | `@ConfigurationProperties("firefly.security.resource-server")`. permit matchers, issuer, audiences, authority prefix, role/scope claim paths. | -| `JwtToFireflyPrincipalConverter` | `Converter>` mapping a validated `Jwt` to a `FireflyAuthenticationToken` carrying a `SecurityPrincipal`. | +| `JwtToFireflyPrincipalConverterImpl` | `Converter>` mapping a validated `Jwt` to a `FireflyAuthenticationToken` carrying a `SecurityPrincipal`. | Ports consumed (from `security-spi`): `KeyManagementPort`, `AuthorityMappingPort`, `PolicyDecisionPort`, `AuditEventPort`, `SecurityContextPort`. Domain types (from `security-api`): `SecurityPrincipal`, `Decision`, `SigningKey`. @@ -236,8 +236,8 @@ With no configuration at all, every route requires a validated bearer token and Bearer token → fireflySecurityWebFilterChain → NimbusReactiveJwtDecoder (RS256, key from KeyManagementPort) → DelegatingOAuth2TokenValidator (timestamp [+ issuer] [+ audience]) - → JwtToFireflyPrincipalConverter → FireflyAuthenticationToken(SecurityPrincipal) - → authorizeExchange: permitMatchers → permitAll, else PolicyAuthorizationManager (PolicyDecisionPort, explicit strict mode or legacy RBAC deferral) + → JwtToFireflyPrincipalConverterImpl → FireflyAuthenticationToken(SecurityPrincipal) + → authorizeExchange: permitMatchers → permitAll, else PolicyAuthorizationManagerImpl (PolicyDecisionPort, explicit strict mode or legacy RBAC deferral) → controller / handler ``` @@ -248,7 +248,7 @@ A missing or malformed token, a failed signature, an expired token, or a wrong i The module ships a `@SpringBootTest(webEnvironment = RANDOM_PORT)` integration test, `ResourceServerIntegrationTest`, that boots a real reactive server with the real auto-configuration and exercises the full filter chain over HTTP with `WebTestClient`. It signs JWTs in-test with Nimbus (`RSASSASigner`) using the active `SigningKey` from the wired `KeyManagementPort`, and asserts the secure-by-default behavior end to end: - 200. a public route (`/public/**`) is reachable without a token; a protected route returns the `SecurityPrincipal.subject()` for a valid signed JWT. -- 401. a protected route with no token; an expired token; a forged token signed by an unknown key (a fresh `InMemoryKeyManagementAdapter` the server doesn't trust). +- 401. a protected route with no token; an expired token; a forged token signed by an unknown key (a fresh `InMemoryKeyManagementAdapterImpl` the server doesn't trust). - 403. a route a contributed `PolicyRule` denies, even with a valid token (proving default-deny / policy enforcement is independent of authentication). - Headers. `X-Frame-Options: DENY`, `Referrer-Policy: no-referrer`, and `Content-Security-Policy` are present on responses. diff --git a/docs/site/modules/security-spi.md b/docs/site/modules/security-spi.md index 62f860caa..d47d22c69 100644 --- a/docs/site/modules/security-spi.md +++ b/docs/site/modules/security-spi.md @@ -50,7 +50,7 @@ import java.util.Map; @Component @RequiredArgsConstructor -public class OpaPolicyDecisionAdapter implements PolicyDecisionPort { +public class OpaPolicyDecisionAdapterImpl implements PolicyDecisionPort { private final OpaClient opa; // your engine binding diff --git a/docs/site/modules/security-test.md b/docs/site/modules/security-test.md index 207c841f8..74e7e0ac5 100644 --- a/docs/site/modules/security-test.md +++ b/docs/site/modules/security-test.md @@ -38,7 +38,7 @@ Add the module as a `test`-scoped dependency, then build identities and inject p ```java import org.fireflyframework.security.api.domain.Decision; import org.fireflyframework.security.api.domain.SecurityPrincipal; -import org.fireflyframework.security.test.FakePolicyDecisionPort; +import org.fireflyframework.security.test.FakePolicyDecisionPortImpl; import org.fireflyframework.security.test.TestPrincipals; import org.springframework.security.core.context.ReactiveSecurityContextHolder; import reactor.core.publisher.Mono; @@ -55,7 +55,7 @@ Mono underTest = handler.handle(request) .contextWrite(ReactiveSecurityContextHolder.withAuthentication(auth)); // Drive a PEP with a configurable PDP and assert what it asked -FakePolicyDecisionPort pdp = FakePolicyDecisionPort.denyAll("reports.read scope required"); +FakePolicyDecisionPortImpl pdp = FakePolicyDecisionPortImpl.denyAll("reports.read scope required"); StepVerifier.create(pep.check(alice, "read", "/api/reports", Map.of())) .expectNextMatches(Decision::granted) // ... or assert the deny path .verifyComplete(); @@ -64,7 +64,7 @@ assertThat(pdp.lastAction()).isEqualTo("read"); assertThat(pdp.lastResource()).isEqualTo("/api/reports"); ``` -`FakePolicyDecisionPort` is mutable and `volatile`-backed, so the same instance can be reconfigured between assertions with `returning(...)`. +`FakePolicyDecisionPortImpl` is mutable and `volatile`-backed, so the same instance can be reconfigured between assertions with `returning(...)`. ## Configuration and wiring @@ -74,7 +74,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`FakePolicyDecisionPort`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPort.java) | A configurable `PolicyDecisionPort` test double that returns a predetermined decision and records the last request it received, so tests can assert PEP wiring without a real policy engine. | +| [`FakePolicyDecisionPortImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPortImpl.java) | A configurable `PolicyDecisionPort` test double that returns a predetermined decision and records the last request it received, so tests can assert PEP wiring without a real policy engine. | | [`TestPrincipals`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-test/src/main/java/org/fireflyframework/security/test/TestPrincipals.java) | Factory helpers for building `SecurityPrincipal`s and `FireflyAuthenticationToken`s in tests, so application test code does not hand-roll principals or wrestle with the security context. | ## Related components @@ -109,14 +109,14 @@ The `fakePolicyDecisionPortReturnsConfiguredDecisionAndRecordsRequest` test demo ```java @Test void fakePolicyDecisionPortReturnsConfiguredDecisionAndRecordsRequest() { - FakePolicyDecisionPort permit = FakePolicyDecisionPort.permitAll(); + FakePolicyDecisionPortImpl permit = FakePolicyDecisionPortImpl.permitAll(); StepVerifier.create(permit.authorize(TestPrincipals.user("u1"), "read", "doc:1", Map.of())) .expectNextMatches(d -> d.granted()) .verifyComplete(); assertThat(permit.lastAction()).isEqualTo("read"); assertThat(permit.lastResource()).isEqualTo("doc:1"); - FakePolicyDecisionPort deny = FakePolicyDecisionPort.denyAll("nope"); + FakePolicyDecisionPortImpl deny = FakePolicyDecisionPortImpl.denyAll("nope"); StepVerifier.create(deny.authorize(TestPrincipals.user("u1"), "write", "doc:1", Map.of())) .expectNextMatches(d -> !d.granted()) .verifyComplete(); @@ -148,7 +148,7 @@ It imports no vendor SDK and starts no Spring context. | Type | Role | | --- | --- | | `TestPrincipals` | Final factory of static helpers building `SecurityPrincipal`s and authenticated `FireflyAuthenticationToken`s for tests. | -| `FakePolicyDecisionPort` | Configurable `PolicyDecisionPort` test double: returns a predetermined `Decision` and records the last `action`/`resource` it was asked to authorize. | +| `FakePolicyDecisionPortImpl` | Configurable `PolicyDecisionPort` test double: returns a predetermined `Decision` and records the last `action`/`resource` it was asked to authorize. | `TestPrincipals` (all static, the class is non-instantiable): @@ -156,10 +156,10 @@ It imports no vendor SDK and starts no Spring context. - `user(String subject, Set authorities, Set scopes)`. a principal carrying both authorities and OAuth2 scopes. - `authentication(String subject, String... authorities)`. an authenticated `FireflyAuthenticationToken` ready for `ReactiveSecurityContextHolder`. -`FakePolicyDecisionPort`: +`FakePolicyDecisionPortImpl`: - `permitAll()` / `denyAll(String reason)`. factory shortcuts wrapping `Decision.permit()` / `Decision.deny(reason)`. -- `new FakePolicyDecisionPort(Decision next)`. start from an explicit decision. +- `new FakePolicyDecisionPortImpl(Decision next)`. start from an explicit decision. - `returning(Decision decision)`. fluently swap the decision the double will replay next. - `lastAction()` / `lastResource()`. read back what the last `authorize(...)` call was asked about. - `authorize(SecurityPrincipal, String action, String resource, Map context)`. the `PolicyDecisionPort` contract; records `action`/`resource` and returns `Mono.just(next)`. @@ -202,7 +202,7 @@ If you are not inheriting the Firefly parent, pin the version explicitly: The module ships its own unit test, `SecurityTestFixturesTest`, which exercises both fixtures as plain JUnit 5 tests (no Spring context, `StepVerifier` for the reactive call): - `TestPrincipals`. `user("u1", "admin").hasAuthority("admin")` is true; `authentication("u1", "admin").securityPrincipal().subject()` equals `"u1"` and the token reports `isAuthenticated()`. -- `FakePolicyDecisionPort`. `permitAll().authorize(...)` emits a `granted()` `Decision` and records `lastAction()` / `lastResource()` (`read` / `doc:1`); `denyAll("nope").authorize(...)` emits a non-granted `Decision`. +- `FakePolicyDecisionPortImpl`. `permitAll().authorize(...)` emits a `granted()` `Decision` and records `lastAction()` / `lastResource()` (`read` / `doc:1`); `denyAll("nope").authorize(...)` emits a non-granted `Decision`. These fixtures themselves back the negative-path integration tests elsewhere in the platform. For example `ResourceServerIntegrationTest` in `fireflyframework-security-resource-server`, whose contributed deny rules prove the default-deny / policy-enforcement path independently of authentication. diff --git a/docs/site/modules/security-webflux.md b/docs/site/modules/security-webflux.md index 16638dba3..edb5785c4 100644 --- a/docs/site/modules/security-webflux.md +++ b/docs/site/modules/security-webflux.md @@ -36,7 +36,7 @@ Wire the PEP into a `SecurityWebFilterChain` (normally done for you by `security ```java import org.fireflyframework.security.spi.PolicyDecisionPort; -import org.fireflyframework.security.webflux.authz.PolicyAuthorizationManager; +import org.fireflyframework.security.webflux.authz.PolicyAuthorizationManagerImpl; import org.springframework.context.annotation.Bean; import org.springframework.security.config.web.server.ServerHttpSecurity; import org.springframework.security.web.server.SecurityWebFilterChain; @@ -47,7 +47,7 @@ SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http, PolicyDec .authorizeExchange(ex -> ex .pathMatchers("/actuator/health").permitAll() // every other exchange goes through the policy decision point (fail-closed) - .anyExchange().access(new PolicyAuthorizationManager(pdp))) + .anyExchange().access(new PolicyAuthorizationManagerImpl(pdp))) .build(); } ``` @@ -66,7 +66,7 @@ public class GreetingService { private final SecurityContextPort securityContext; public GreetingService(SecurityContextPort securityContext) { - this.securityContext = securityContext; // ReactorSecurityContextAdapter at runtime + this.securityContext = securityContext; // ReactorSecurityContextAdapterImpl at runtime } public Mono greet() { @@ -112,8 +112,8 @@ Property-based wiring conditions found in this module: | [`PrincipalHeaderBridgeProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeProperties.java) | Configuration for the principal→header bridge. | | [`FireflyAuthenticationToken`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authentication/FireflyAuthenticationToken.java) | Spring Security `org.springframework.security.core.Authentication` whose principal is the framework's `SecurityPrincipal`. | | [`PrincipalSupport`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authentication/PrincipalSupport.java) | Recovers a `SecurityPrincipal` from any Spring `Authentication`. | -| [`PolicyAuthorizationManager`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManager.java) | URL policy enforcement point. | -| [`PrincipalHeaderBridgeWebFilter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilter.java) | Derives trusted internal request headers from the validated token , never from the client. | +| [`PolicyAuthorizationManagerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManagerImpl.java) | URL policy enforcement point. | +| [`PrincipalHeaderBridgeWebFilterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilterImpl.java) | Derives trusted internal request headers from the validated token , never from the client. | ## Related components @@ -178,7 +178,7 @@ security-api driving ports + domain (SecurityPrincipal, Decision, Obligatio ▲ security-spi driven ports (PolicyDecisionPort, SecurityContextPort, TokenValidationPort, ...) ▲ -security-core framework-neutral engine (EmbeddedPolicyDecisionAdapter, authority normalization, authz engine) +security-core framework-neutral engine (EmbeddedPolicyDecisionAdapterImpl, authority normalization, authz engine) ▲ security-webflux ◀── THIS MODULE — Spring Security WebFlux binding ▲ @@ -195,21 +195,21 @@ This module depends only on `security-api` and `security-core` (which transitive | --- | --- | --- | | `FireflyAuthenticationToken` | `...webflux.authentication` | A Spring `AbstractAuthenticationToken` whose principal is a `SecurityPrincipal`. Authorities are derived from `principal.authorities()` as `SimpleGrantedAuthority`s; `getName()` returns `principal.subject()`. Exposes `securityPrincipal()` to recover the rich principal. Marked authenticated on construction (it is only ever built from an already-validated principal). | | `PrincipalSupport` | `...webflux.authentication` | Stateless helper that recovers a `SecurityPrincipal` from any Spring `Authentication`. Prefers the principal carried by a `FireflyAuthenticationToken`; falls back to a principal already set as `getPrincipal()`; otherwise builds a minimal `SecurityPrincipal` from the authentication's name and granted authorities (so third-party / JWT `Authentication`s still project cleanly). Null-safe. | -| `ReactorSecurityContextAdapter` | `...webflux.context` | Implements `SecurityContextPort` (SPI). Reads `ReactiveSecurityContextHolder.getContext()`, keeps only an authenticated `Authentication`, and projects it via `PrincipalSupport::extract`. Emits an empty `Mono` when there is no authenticated context. | -| `PolicyAuthorizationManager` | `...webflux.authz` | Implements Spring's `ReactiveAuthorizationManager`. the URL PEP. Denies unauthenticated requests; for authenticated requests it calls `PolicyDecisionPort.authorize(...)` with the HTTP method as the `action`, the request path as the `resource`, and a `{method, path}` context map, mapping `Decision.granted()` to an `AuthorizationDecision`. | +| `ReactorSecurityContextAdapterImpl` | `...webflux.context` | Implements `SecurityContextPort` (SPI). Reads `ReactiveSecurityContextHolder.getContext()`, keeps only an authenticated `Authentication`, and projects it via `PrincipalSupport::extract`. Emits an empty `Mono` when there is no authenticated context. | +| `PolicyAuthorizationManagerImpl` | `...webflux.authz` | Implements Spring's `ReactiveAuthorizationManager`. the URL PEP. Denies unauthenticated requests; for authenticated requests it calls `PolicyDecisionPort.authorize(...)` with the HTTP method as the `action`, the request path as the `resource`, and a `{method, path}` context map, mapping `Decision.granted()` to an `AuthorizationDecision`. | #### Ports -- Implements `org.fireflyframework.security.spi.SecurityContextPort` (via `ReactorSecurityContextAdapter`). -- Consumes `org.fireflyframework.security.spi.PolicyDecisionPort` (injected into `PolicyAuthorizationManager`; satisfied by `security-core`'s `EmbeddedPolicyDecisionAdapter` by default, or by an OPA/Cerbos/OpenFGA adapter). +- Implements `org.fireflyframework.security.spi.SecurityContextPort` (via `ReactorSecurityContextAdapterImpl`). +- Consumes `org.fireflyframework.security.spi.PolicyDecisionPort` (injected into `PolicyAuthorizationManagerImpl`; satisfied by `security-core`'s `EmbeddedPolicyDecisionAdapterImpl` by default, or by an OPA/Cerbos/OpenFGA adapter). - Projects `org.fireflyframework.security.api.domain.SecurityPrincipal` and reads `org.fireflyframework.security.api.domain.Decision`. ### Secure-by-default behavior -`PolicyAuthorizationManager.check(...)` is deny-biased at every branch: +`PolicyAuthorizationManagerImpl.check(...)` is deny-biased at every branch: - No authentication / unauthenticated → `AuthorizationDecision(false)` (the `defaultIfEmpty` and `isAuthenticated()` filter close the gap). -- Authenticated, policy abstains → permit. With `security-core`'s `EmbeddedPolicyDecisionAdapter` and no rules registered, ABAC is not in use and the decision defers to RBAC at the PEP; configured rules apply deny-overrides. +- Authenticated, policy abstains → permit. With `security-core`'s `EmbeddedPolicyDecisionAdapterImpl` and no rules registered, ABAC is not in use and the decision defers to RBAC at the PEP; configured rules apply deny-overrides. - Authenticated, policy denies → `AuthorizationDecision(false)`. - Policy errors / PDP unreachable → `onErrorReturn(new AuthorizationDecision(false))`. fail-closed, never permit-on-error. @@ -220,7 +220,7 @@ This matches design decision D4 (secure-by-default-hard): default-deny, validate Provided by the Firefly parent/BOM (`org.fireflyframework:fireflyframework-parent`), so versions are managed for you: - `fireflyframework-security-api`. `SecurityPrincipal`, `Decision`. -- `fireflyframework-security-core`. neutral engine, incl. `EmbeddedPolicyDecisionAdapter` (transitively brings `fireflyframework-security-spi`). +- `fireflyframework-security-core`. neutral engine, incl. `EmbeddedPolicyDecisionAdapterImpl` (transitively brings `fireflyframework-security-spi`). - `spring-security-core`, `spring-security-web`, `spring-webflux`. the binding surface this module exists to adapt. - `slf4j-api`, `lombok` (provided). @@ -237,7 +237,7 @@ It has no Spring Boot, provider-SDK or auto-configuration dependency; that wirin Unit-tested with JUnit 5, AssertJ, `reactor-test` (`StepVerifier`), `spring-security-test` and `spring-test` mocks. No running server, no Spring context: -- `PolicyAuthorizationManagerTest` drives the PEP through `MockServerWebExchange` / `AuthorizationContext` and asserts all four decision branches: denies unauthenticated requests (`Mono.empty()`), permits an authenticated request when the `EmbeddedPolicyDecisionAdapter` abstains, denies when a `PolicyDecisionPort` returns `Decision.deny(...)`, and fails closed when the port emits an error. +- `PolicyAuthorizationManagerTest` drives the PEP through `MockServerWebExchange` / `AuthorizationContext` and asserts all four decision branches: denies unauthenticated requests (`Mono.empty()`), permits an authenticated request when the `EmbeddedPolicyDecisionAdapterImpl` abstains, denies when a `PolicyDecisionPort` returns `Decision.deny(...)`, and fails closed when the port emits an error. - `ReactorSecurityContextAdapterTest` verifies the principal is projected out of the reactive context (seeded via `ReactiveSecurityContextHolder.withAuthentication(...)`) and that `currentPrincipal()` completes empty when no security context is present. Run them with: diff --git a/docs/site/modules/starter-core.md b/docs/site/modules/starter-core.md index d0ef270a3..80e9cf1fe 100644 --- a/docs/site/modules/starter-core.md +++ b/docs/site/modules/starter-core.md @@ -403,7 +403,7 @@ Registered in `META-INF/spring/org.springframework.boot.autoconfigure.AutoConfig | `WebFluxAutoConfiguration` | Jackson JSON codecs (JSR-310, ISO-8601) for WebFlux | | `WebClientAutoConfiguration` | Resilient `WebClient`, `WebClient.Builder`, and `WebClientTemplate` beans | | `WebClientBuilderCustomizer` | Applies timeouts, pooling, SSL, proxy, HTTP/2, codec config | -| `WebFilterAutoConfiguration` | Registers the `TransactionFilter` | +| `WebFilterAutoConfiguration` | Registers the `TransactionFilterImpl` | | `WebClientResilienceAutoConfiguration` | Resilience4j registries (circuit breaker, retry, time limiter, bulkhead) | | `ActuatorDefaultPropertiesAutoConfiguration` / `ActuatorAutoConfiguration` | Actuator endpoint, metrics, and health defaults | | `DefaultHealthAutoConfiguration` | Default health indicators | diff --git a/docs/site/modules/validators.md b/docs/site/modules/validators.md index 5c7952dd8..704f0ec6d 100644 --- a/docs/site/modules/validators.md +++ b/docs/site/modules/validators.md @@ -101,7 +101,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | [`ValidIban`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/annotations/ValidIban.java) | Defines `message`, `groups`, `payload` operations. | | [`ValidAmount`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAmount.java) | Defines `message`, `groups`, `payload`, `currency` operations. | | [`ValidPasswordStrength`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPasswordStrength.java) | Defines `message`, `groups`, `payload`, `minLength` operations. | -| [`IbanValidator`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/validators/IbanValidator.java) | Validator for International Bank Account Numbers (IBAN). | +| [`IbanValidatorImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/validators/IbanValidatorImpl.java) | Validator for International Bank Account Numbers (IBAN). | | [`ValidAccountNumber`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAccountNumber.java) | Defines `message`, `groups`, `payload`, `countryCode` operations. | ## Build and test @@ -163,7 +163,7 @@ All annotations live in `org.fireflyframework.annotations`; their validators liv | `@ValidBic` |. | 8 or 11 character BIC / SWIFT structure | | `@ValidAccountNumber` | `countryCode = "GB"` | Country-aware account number format | | `@ValidSortCode` |. | UK bank sort code | -| `@ValidCreditCard` | `types = {}` (any) | Network pattern + Luhn; restrict via `CreditCardValidator.CardType` | +| `@ValidCreditCard` | `types = {}` (any) | Network pattern + Luhn; restrict via `CreditCardValidatorImpl.CardType` | | `@ValidCVV` | `cardType = ANY` | `ANY` / `STANDARD` (3-digit) / `AMEX` (4-digit) | | `@ValidAmount` | `currency = "EUR"`, `min = 0.0`, `max = Double.MAX_VALUE`, `allowZero = true` | Currency-aware decimal places + bounds | | `@ValidCurrencyCode` | `europeanOnly = false`, `euroOnly = false` | ISO 4217 code | @@ -180,8 +180,8 @@ Examples of customizing constraint behavior: ```java // Only accept Visa or MasterCard -@ValidCreditCard(types = { CreditCardValidator.CardType.VISA, - CreditCardValidator.CardType.MASTERCARD }) +@ValidCreditCard(types = { CreditCardValidatorImpl.CardType.VISA, + CreditCardValidatorImpl.CardType.MASTERCARD }) private String cardNumber; // Amex 4-digit CVV only @@ -212,7 +212,7 @@ Every constraint follows the standard Bean Validation contract: - The annotation is meta-annotated with `@Constraint(validatedBy = …Validator.class)` and retained at runtime. - The paired class implements `ConstraintValidator`, reading the annotation's attributes in `initialize(...)` and performing the check in `isValid(...)`. -Because of this, the constraints integrate with the wider ecosystem with no extra wiring: Spring's `MethodValidationPostProcessor` and `@Valid` on controller arguments pick them up, validation groups and `payload` work as usual, and violations surface as standard `ConstraintViolation`s (turned into HTTP 400 responses by Spring's default error handling). Notable validators implement real domain logic rather than naive regex. E.g. `IbanValidator` performs the ISO 7064 mod-97 computation against the country-specific length table, `CreditCardValidator` combines network BIN patterns with the Luhn checksum, and `PasswordStrengthValidator` (with `PasswordStrengthUtils`) enforces composition rules and screens against a list of common passwords. +Because of this, the constraints integrate with the wider ecosystem with no extra wiring: Spring's `MethodValidationPostProcessor` and `@Valid` on controller arguments pick them up, validation groups and `payload` work as usual, and violations surface as standard `ConstraintViolation`s (turned into HTTP 400 responses by Spring's default error handling). Notable validators implement real domain logic rather than naive regex. E.g. `IbanValidatorImpl` performs the ISO 7064 mod-97 computation against the country-specific length table, `CreditCardValidatorImpl` combines network BIN patterns with the Luhn checksum, and `PasswordStrengthValidatorImpl` (with `PasswordStrengthUtils`) enforces composition rules and screens against a list of common passwords. ## Continue the application diff --git a/docs/site/modules/web-idempotency.md b/docs/site/modules/web-idempotency.md index 1a55c43d9..008431f8b 100644 --- a/docs/site/modules/web-idempotency.md +++ b/docs/site/modules/web-idempotency.md @@ -5,7 +5,7 @@ HTTP response reuse is an optimization around an authorized request. The busines ## Configure the boundary 1. Set `spring.application.name` or `firefly.web.idempotency.namespace`. Use an explicit service/environment namespace whenever deployments share a cache backend. -2. Authenticate and authorize the request before `IdempotencyWebFilter` (order `-80`). The default resolver requires an authenticated Spring `Authentication` containing a Jafly `SecurityPrincipal` with issuer and subject. It resolves tenant through the existing `TenantResolverPort`, or through the principal's nonblank `tenantId` when that port is absent. Unresolved trust bypasses response reuse. +2. Authenticate and authorize the request before `IdempotencyWebFilterImpl` (order `-80`). The default resolver requires an authenticated Spring `Authentication` containing a Jafly `SecurityPrincipal` with issuer and subject. It resolves tenant through the existing `TenantResolverPort`, or through the principal's nonblank `tenantId` when that port is absent. Unresolved trust bypasses response reuse. 3. For another authentication stack, implement `IdempotencyScopeResolver` as a bean. Return a stable namespace derived from verified issuer, caller, authorized tenant, and authorization state. Return `Mono.empty()` when trust cannot be resolved. Never derive authority from unvalidated request headers. 4. Select and qualify the backing cache using `firefly.cache.*`. The HTTP cache has its own manager/prefix. Namespace isolation is still required when multiple deployments use the same backend. 5. Keep the durable operation key inside the business command. Validate ownership and authorization on every request, including retries. If authorization exists only inside the handler, disable HTTP response reuse for that endpoint or move its policy check before this filter. diff --git a/docs/site/modules/web.md b/docs/site/modules/web.md index 943d60b57..6d4a94d68 100644 --- a/docs/site/modules/web.md +++ b/docs/site/modules/web.md @@ -215,7 +215,7 @@ The `firefly.web.pii-masking` namespace is bound by [PiiMaskingProperties.java]( | `firefly.web.pii-masking.enable-stdout-masking` | `boolean` | `true` | | `firefly.web.pii-masking.case-sensitive` | `boolean` | `false` | -When masking is enabled, `PiiMaskingAppender` creates a detached snapshot of the formatted message, metadata, MDC, key/value pairs, markers, throwable tree and caller data before handing the event to another appender. It formats permitted scalar arguments with SLF4J and discards the original argument array. Unsupported object values, cyclic or overly deep graphs, inaccessible source fields, missing masking state and masking failures omit the event with a fixed diagnostic that contains no provider exception or input data. +When masking is enabled, `PiiMaskingAppenderImpl` creates a detached snapshot of the formatted message, metadata, MDC, key/value pairs, markers, throwable tree and caller data before handing the event to another appender. It formats permitted scalar arguments with SLF4J and discards the original argument array. Unsupported object values, cyclic or overly deep graphs, inaccessible source fields, missing masking state and masking failures omit the event with a fixed diagnostic that contains no provider exception or input data. The strict `PiiMaskingService.maskLogData` logging path requires every configured pattern to compile and emits no recursive masking diagnostics. Existing nonlogging masking methods retain their result behavior. Only an explicit Boolean `false` in the configured service's enabled state preserves the original unprotected event; absent, ambiguous or unavailable state fails closed. Configured patterns define what is masked. Startup coverage, encoder-owned global properties, custom appenders and the wider logging policy require separate configuration and validation. diff --git a/docs/site/modules/webhooks-core.md b/docs/site/modules/webhooks-core.md index a9ec48aeb..e77166f73 100644 --- a/docs/site/modules/webhooks-core.md +++ b/docs/site/modules/webhooks-core.md @@ -85,7 +85,7 @@ The `firefly.webhooks.security` namespace is bound by [WebhookSecurityProperties Property-based wiring conditions found in this module: -- `name = "firefly.cache.redis.enabled", havingValue = "true", matchIfMissing = false`. [RedisConnectivityHealthIndicator.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/RedisConnectivityHealthIndicator.java). +- `name = "firefly.cache.redis.enabled", havingValue = "true", matchIfMissing = false`. [RedisConnectivityHealthIndicatorImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/RedisConnectivityHealthIndicatorImpl.java). - `name = "firefly.webhooks.batching.enabled", havingValue = "true"`. [WebhookBatchingServiceImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/services/impl/WebhookBatchingServiceImpl.java). - `name = "firefly.webhooks.compression.enabled", havingValue = "true"`. [WebhookCompressionServiceImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/services/impl/WebhookCompressionServiceImpl.java). - `name = "firefly.webhooks.metadata-enrichment.enabled", havingValue = "true", matchIfMissing = true`. [WebhookMetadataEnrichmentServiceImpl.java](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/services/impl/WebhookMetadataEnrichmentServiceImpl.java). diff --git a/docs/site/modules/webhooks-processor.md b/docs/site/modules/webhooks-processor.md index 51875f3ae..79a43546d 100644 --- a/docs/site/modules/webhooks-processor.md +++ b/docs/site/modules/webhooks-processor.md @@ -142,7 +142,7 @@ Use [EDA](eda.md) for transport configuration and [cache](cache.md) plus the sel | [`WebhookProcessingResult`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/model/WebhookProcessingResult.java) | Supplies `success`, `failed`, `retry`, and `skipped` result factories, status checks, metadata, and duration. | | [`WebhookSignatureValidator`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/port/WebhookSignatureValidator.java) | Provider-owned reactive verification contract; required verification defaults to `true`. | | [`WebhookIdempotencyService`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/port/WebhookIdempotencyService.java) | Lock acquisition, processed-record lookup/write, lock release, and optional failure recording. | -| [`CacheBasedWebhookIdempotencyService`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyService.java) | Implements duplicate tracking through `FireflyCacheManager`. | +| [`CacheBasedWebhookIdempotencyServiceImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyServiceImpl.java) | Implements duplicate tracking through `FireflyCacheManagerImpl`. | | [`TracingContextExtractor`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/tracing/TracingContextExtractor.java) | Extracts tracing/correlation context from the event payload and headers. | ## Processing contracts diff --git a/docs/site/modules/webhooks-web.md b/docs/site/modules/webhooks-web.md index 80b5896ba..59f88bc4f 100644 --- a/docs/site/modules/webhooks-web.md +++ b/docs/site/modules/webhooks-web.md @@ -94,7 +94,7 @@ Contract excerpt from [WebhookController.java](https://github.com/fireflyframewo public class WebhookController { private final WebhookProcessingService webhookProcessingService; private final WebhookValidator webhookValidator; - private final WebhookMetricsService metricsService; + private final WebhookMetricsServiceImpl metricsService; private final org.fireflyframework.webhooks.core.ratelimit.WebhookRateLimitService rateLimitService; private final WebhookMetadataEnrichmentService metadataEnrichmentService; value = "/{providerName}", diff --git a/docs/superpowers/plans/2026-10-30-http-logging-streaming.md b/docs/superpowers/plans/2026-10-30-http-logging-streaming.md index 1ef752190..c81e5fa32 100644 --- a/docs/superpowers/plans/2026-10-30-http-logging-streaming.md +++ b/docs/superpowers/plans/2026-10-30-http-logging-streaming.md @@ -35,7 +35,7 @@ ## Task 2: Transparent bounded capture -**Files:** Modify `modules/web/src/main/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilter.java`. +**Files:** Modify `modules/web/src/main/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilterImpl.java`. **Interfaces:** Preserve existing public constructor/WebFilter API. Private prefix capture accepts a borrowed DataBuffer and completes/abandons diagnostic bytes. The obsolete aggregate-list extraction helper is replaced by the same non-consuming absolute-byte copy inside the capture. diff --git a/modules/agentic-bridge/docs/ARCHITECTURE.md b/modules/agentic-bridge/docs/ARCHITECTURE.md index 257e48a46..be52a9833 100644 --- a/modules/agentic-bridge/docs/ARCHITECTURE.md +++ b/modules/agentic-bridge/docs/ARCHITECTURE.md @@ -104,8 +104,8 @@ graph TD METRICS[AgenticMetrics] subgraph Transports - REST[RestAgenticTransport
HTTP/SSE] - WS[WebSocketAgenticTransport
full-duplex] + REST[RestAgenticTransportImpl
HTTP/SSE] + WS[WebSocketAgenticTransportImpl
full-duplex] QUEUE[QueueAgenticPublisher
Kafka/RabbitMQ/Redis] end end diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/README.md b/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/README.md index 2aa39c0c0..46f2e2a8d 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/README.md +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/README.md @@ -60,8 +60,8 @@ The `firefly.agentic-bridge` namespace is bound by [AgenticBridgeProperties.java | [`AgenticBridgeProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeProperties.java) | Spring Boot configuration binding for `firefly.agentic-bridge.*`. | | [`AgenticBridgeFactory`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeFactory.java) | Factory that materialises framework objects from `AgenticBridgeProperties`. | | [`AgenticBridgeAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeAutoConfiguration.java) | Defines `fireflyAgenticClient`, `fireflyAgenticBridge` operations. | -| [`AgenticBridgeHealthIndicator`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicator.java) | Reactive Spring Boot Actuator health indicator backed by `AgenticBridge#health()`. | -| [`AgenticBridgeHealthAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthAutoConfiguration.java) | Wires the `AgenticBridgeHealthIndicator` when Spring Boot Actuator is on the classpath and the indicator hasn't been disabled via `management.health.firefly-agentic-bridge.enabled=false`. | +| [`AgenticBridgeHealthIndicatorImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicatorImpl.java) | Reactive Spring Boot Actuator health indicator backed by `AgenticBridge#health()`. | +| [`AgenticBridgeHealthAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthAutoConfiguration.java) | Wires the `AgenticBridgeHealthIndicatorImpl` when Spring Boot Actuator is on the classpath and the indicator hasn't been disabled via `management.health.firefly-agentic-bridge.enabled=false`. | ## Continue the application diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeAutoConfiguration.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeAutoConfiguration.java index 4c0707cc4..77df5908f 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeAutoConfiguration.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeAutoConfiguration.java @@ -14,7 +14,7 @@ import io.micrometer.core.instrument.MeterRegistry; import org.fireflyframework.agentic.bridge.AgenticBridge; import org.fireflyframework.agentic.bridge.AgenticClient; -import org.fireflyframework.agentic.bridge.internal.DefaultAgenticBridge; +import org.fireflyframework.agentic.bridge.internal.DefaultAgenticBridgeImpl; import org.fireflyframework.agentic.bridge.transport.queue.QueueAgenticPublisher; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -63,7 +63,7 @@ public AgenticBridge fireflyAgenticBridge(AgenticClient client, properties, objectMapper.getIfAvailable(), meterRegistry.getIfAvailable()); - return new DefaultAgenticBridge(client, publishers); + return new DefaultAgenticBridgeImpl(client, publishers); } /** diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeFactory.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeFactory.java index a3c49dcd4..78b38b949 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeFactory.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeFactory.java @@ -16,10 +16,10 @@ import org.fireflyframework.agentic.bridge.AgenticClientBuilder; import org.fireflyframework.agentic.bridge.auth.AuthStrategy; import org.fireflyframework.agentic.bridge.observability.AgenticMetrics; -import org.fireflyframework.agentic.bridge.transport.queue.KafkaQueueAgenticPublisher; +import org.fireflyframework.agentic.bridge.transport.queue.KafkaQueueAgenticPublisherImpl; import org.fireflyframework.agentic.bridge.transport.queue.QueueAgenticPublisher; -import org.fireflyframework.agentic.bridge.transport.queue.RabbitMqQueueAgenticPublisher; -import org.fireflyframework.agentic.bridge.transport.queue.RedisQueueAgenticPublisher; +import org.fireflyframework.agentic.bridge.transport.queue.RabbitMqQueueAgenticPublisherImpl; +import org.fireflyframework.agentic.bridge.transport.queue.RedisQueueAgenticPublisherImpl; import java.util.LinkedHashMap; import java.util.Map; @@ -111,19 +111,19 @@ public static QueueAgenticPublisher buildPublisher(String name, || !classpathHas("reactor.kafka.sender.KafkaSender")) { throw new IllegalStateException("Publisher '" + name + "' is configured for kafka but reactor-kafka is not on the classpath"); } - yield new KafkaQueueAgenticPublisher(name, cfg.getTopic(), cfg.getBootstrapServers(), mapper, metrics); + yield new KafkaQueueAgenticPublisherImpl(name, cfg.getTopic(), cfg.getBootstrapServers(), mapper, metrics); } case RABBITMQ -> { if (!classpathHas("reactor.rabbitmq.Sender")) { throw new IllegalStateException("Publisher '" + name + "' is configured for rabbitmq but reactor-rabbitmq is not on the classpath"); } - yield new RabbitMqQueueAgenticPublisher(name, cfg.getExchange(), cfg.getRoutingKey(), cfg.getUrl(), mapper, metrics); + yield new RabbitMqQueueAgenticPublisherImpl(name, cfg.getExchange(), cfg.getRoutingKey(), cfg.getUrl(), mapper, metrics); } case REDIS -> { if (!classpathHas("io.lettuce.core.RedisClient")) { throw new IllegalStateException("Publisher '" + name + "' is configured for redis but lettuce-core is not on the classpath"); } - yield new RedisQueueAgenticPublisher(name, cfg.getChannel(), cfg.getUrl(), mapper, metrics); + yield new RedisQueueAgenticPublisherImpl(name, cfg.getChannel(), cfg.getUrl(), mapper, metrics); } }; } diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthAutoConfiguration.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthAutoConfiguration.java index 72ec9b95c..ec2a24f61 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthAutoConfiguration.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthAutoConfiguration.java @@ -31,7 +31,7 @@ public class AgenticBridgeHealthAutoConfiguration { @ConditionalOnBean(AgenticBridge.class) @ConditionalOnMissingBean(name = "fireflyAgenticBridgeHealthIndicator") @ConditionalOnEnabledHealthIndicator("firefly-agentic-bridge") - public AgenticBridgeHealthIndicator fireflyAgenticBridgeHealthIndicator(AgenticBridge bridge) { - return new AgenticBridgeHealthIndicator(bridge); + public AgenticBridgeHealthIndicatorImpl fireflyAgenticBridgeHealthIndicator(AgenticBridge bridge) { + return new AgenticBridgeHealthIndicatorImpl(bridge); } } diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicator.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicatorImpl.java similarity index 92% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicator.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicatorImpl.java index 1a6a09583..61d851e28 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicator.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-autoconfigure/src/main/java/org/fireflyframework/agentic/bridge/autoconfigure/AgenticBridgeHealthIndicatorImpl.java @@ -22,11 +22,11 @@ * Reactive Spring Boot Actuator health indicator backed by * {@link AgenticBridge#health()}. */ -public final class AgenticBridgeHealthIndicator implements ReactiveHealthIndicator { +public final class AgenticBridgeHealthIndicatorImpl implements ReactiveHealthIndicator { private final AgenticBridge bridge; - public AgenticBridgeHealthIndicator(AgenticBridge bridge) { + public AgenticBridgeHealthIndicatorImpl(AgenticBridge bridge) { this.bridge = Objects.requireNonNull(bridge, "bridge"); } diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/AgenticClientBuilder.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/AgenticClientBuilder.java index 604fee198..53de8d893 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/AgenticClientBuilder.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/AgenticClientBuilder.java @@ -18,7 +18,7 @@ import io.netty.handler.timeout.ReadTimeoutHandler; import io.netty.handler.timeout.WriteTimeoutHandler; import org.fireflyframework.agentic.bridge.auth.AuthStrategy; -import org.fireflyframework.agentic.bridge.internal.DefaultAgenticClient; +import org.fireflyframework.agentic.bridge.internal.DefaultAgenticClientImpl; import org.fireflyframework.agentic.bridge.observability.AgenticMetrics; import org.fireflyframework.agentic.bridge.resilience.CircuitBreakerSettings; import org.fireflyframework.agentic.bridge.resilience.RetryPolicy; @@ -194,7 +194,7 @@ public AgenticClient build() { WebSocketClient effectiveWsClient = webSocketClient != null ? webSocketClient : buildWebSocketClient(); AgenticMetrics metrics = new AgenticMetrics(meterRegistry, clientName); - return new DefaultAgenticClient( + return new DefaultAgenticClientImpl( clientName, baseUrl, effectiveWebClient, diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/ApiKeyAuth.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/ApiKeyAuthImpl.java similarity index 88% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/ApiKeyAuth.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/ApiKeyAuthImpl.java index 7b05660fe..bbc83872b 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/ApiKeyAuth.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/ApiKeyAuthImpl.java @@ -19,18 +19,18 @@ * request. Reads the value from the supplied {@link Supplier} on every call * so token rotation works without rebuilding the client. */ -final class ApiKeyAuth implements AuthStrategy { +final class ApiKeyAuthImpl implements AuthStrategy { private static final String DEFAULT_HEADER = "X-API-Key"; private final String header; private final Supplier supplier; - ApiKeyAuth(Supplier supplier) { + ApiKeyAuthImpl(Supplier supplier) { this(DEFAULT_HEADER, supplier); } - ApiKeyAuth(String header, Supplier supplier) { + ApiKeyAuthImpl(String header, Supplier supplier) { this.header = Objects.requireNonNull(header, "header"); this.supplier = Objects.requireNonNull(supplier, "supplier"); } diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/AuthStrategy.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/AuthStrategy.java index b3fda807d..f24b86fce 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/AuthStrategy.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/AuthStrategy.java @@ -46,30 +46,30 @@ default String name() { } static AuthStrategy none() { - return NoAuth.INSTANCE; + return NoAuthImpl.INSTANCE; } static AuthStrategy apiKey(String value) { - return new ApiKeyAuth(() -> value); + return new ApiKeyAuthImpl(() -> value); } static AuthStrategy apiKey(Supplier supplier) { - return new ApiKeyAuth(supplier); + return new ApiKeyAuthImpl(supplier); } static AuthStrategy apiKey(String header, Supplier supplier) { - return new ApiKeyAuth(header, supplier); + return new ApiKeyAuthImpl(header, supplier); } static AuthStrategy bearer(String token) { - return new BearerTokenAuth(() -> token); + return new BearerTokenAuthImpl(() -> token); } static AuthStrategy bearer(Supplier supplier) { - return new BearerTokenAuth(supplier); + return new BearerTokenAuthImpl(supplier); } static AuthStrategy composite(AuthStrategy... strategies) { - return new CompositeAuth(strategies); + return new CompositeAuthImpl(strategies); } } diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/BearerTokenAuth.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/BearerTokenAuthImpl.java similarity index 90% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/BearerTokenAuth.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/BearerTokenAuthImpl.java index b771c821b..f8d6adf82 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/BearerTokenAuth.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/BearerTokenAuthImpl.java @@ -20,11 +20,11 @@ * so it integrates naturally with OAuth2 helpers that refresh tokens in the * background. */ -final class BearerTokenAuth implements AuthStrategy { +final class BearerTokenAuthImpl implements AuthStrategy { private final Supplier supplier; - BearerTokenAuth(Supplier supplier) { + BearerTokenAuthImpl(Supplier supplier) { this.supplier = Objects.requireNonNull(supplier, "supplier"); } diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/CompositeAuth.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/CompositeAuthImpl.java similarity index 92% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/CompositeAuth.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/CompositeAuthImpl.java index 169b83a7d..8d2aab31f 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/CompositeAuth.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/CompositeAuthImpl.java @@ -21,11 +21,11 @@ * earlier ones on header conflict. Useful when a service requires both an * API key and a tenant header for example. */ -final class CompositeAuth implements AuthStrategy { +final class CompositeAuthImpl implements AuthStrategy { private final List strategies; - CompositeAuth(AuthStrategy... strategies) { + CompositeAuthImpl(AuthStrategy... strategies) { Objects.requireNonNull(strategies, "strategies"); this.strategies = List.of(strategies); } diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/NoAuth.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/NoAuthImpl.java similarity index 83% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/NoAuth.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/NoAuthImpl.java index c60a90699..6705f2771 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/NoAuth.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/auth/NoAuthImpl.java @@ -16,11 +16,11 @@ * No-op authentication strategy used when the agentic service is reachable * over a private network or behind a service mesh. */ -final class NoAuth implements AuthStrategy { +final class NoAuthImpl implements AuthStrategy { - static final NoAuth INSTANCE = new NoAuth(); + static final NoAuthImpl INSTANCE = new NoAuthImpl(); - private NoAuth() { + private NoAuthImpl() { } @Override diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticBridge.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticBridgeImpl.java similarity index 94% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticBridge.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticBridgeImpl.java index 1f9b666f2..3a74831a4 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticBridge.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticBridgeImpl.java @@ -26,12 +26,12 @@ * Production implementation of {@link AgenticBridge}. Holds a single * {@link AgenticClient} and any number of named queue publishers. */ -public final class DefaultAgenticBridge implements AgenticBridge { +public final class DefaultAgenticBridgeImpl implements AgenticBridge { private final AgenticClient client; private final Map publishers; - public DefaultAgenticBridge(AgenticClient client, Map publishers) { + public DefaultAgenticBridgeImpl(AgenticClient client, Map publishers) { this.client = Objects.requireNonNull(client, "client"); Map copy = new LinkedHashMap<>(publishers == null ? Map.of() : publishers); this.publishers = Collections.unmodifiableMap(copy); diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticClient.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticClientImpl.java similarity index 93% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticClient.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticClientImpl.java index 3c0236819..dac80b5fc 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticClient.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/DefaultAgenticClientImpl.java @@ -29,8 +29,8 @@ import org.fireflyframework.agentic.bridge.resilience.RetryPolicy; import org.fireflyframework.agentic.bridge.streaming.StreamEvent; import org.fireflyframework.agentic.bridge.transport.AgenticTransport; -import org.fireflyframework.agentic.bridge.transport.rest.RestAgenticTransport; -import org.fireflyframework.agentic.bridge.transport.websocket.WebSocketAgenticTransport; +import org.fireflyframework.agentic.bridge.transport.rest.RestAgenticTransportImpl; +import org.fireflyframework.agentic.bridge.transport.websocket.WebSocketAgenticTransportImpl; import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.reactive.socket.client.WebSocketClient; import reactor.core.publisher.Flux; @@ -51,7 +51,7 @@ *

Construction is intentionally package-private; callers obtain instances * through {@link AgenticClient#builder(String)}.

*/ -public final class DefaultAgenticClient implements AgenticClient { +public final class DefaultAgenticClientImpl implements AgenticClient { private final String name; private final WebClient webClient; @@ -64,7 +64,7 @@ public final class DefaultAgenticClient implements AgenticClient { private final ConversationManager conversationManager; private final AtomicReference cachedCatalog = new AtomicReference<>(); - public DefaultAgenticClient(String name, + public DefaultAgenticClientImpl(String name, String baseUrl, WebClient webClient, WebSocketClient webSocketClient, @@ -84,9 +84,9 @@ public DefaultAgenticClient(String name, this.mapper = Objects.requireNonNull(mapper, "mapper"); this.responseTimeout = Objects.requireNonNull(responseTimeout, "responseTimeout"); this.metrics = Objects.requireNonNullElse(metrics, AgenticMetrics.NOOP); - this.restTransport = new RestAgenticTransport(webClient, auth, mapper, retryPolicy, responseTimeout, this.metrics); - this.websocketTransport = new WebSocketAgenticTransport(webSocketClient, baseUrl, auth, mapper, responseTimeout, this.metrics); - this.conversationManager = new RestConversationManager(webClient, auth, mapper); + this.restTransport = new RestAgenticTransportImpl(webClient, auth, mapper, retryPolicy, responseTimeout, this.metrics); + this.websocketTransport = new WebSocketAgenticTransportImpl(webSocketClient, baseUrl, auth, mapper, responseTimeout, this.metrics); + this.conversationManager = new RestConversationManagerImpl(webClient, auth, mapper); } @Override diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/RestConversationManager.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/RestConversationManagerImpl.java similarity index 95% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/RestConversationManager.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/RestConversationManagerImpl.java index 6359978f1..ad0e2fd17 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/RestConversationManager.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/internal/RestConversationManagerImpl.java @@ -31,13 +31,13 @@ /** * REST-backed implementation of {@link ConversationManager}. */ -public final class RestConversationManager implements ConversationManager { +public final class RestConversationManagerImpl implements ConversationManager { private final WebClient webClient; private final AuthStrategy auth; private final ObjectMapper mapper; - public RestConversationManager(WebClient webClient, AuthStrategy auth, ObjectMapper mapper) { + public RestConversationManagerImpl(WebClient webClient, AuthStrategy auth, ObjectMapper mapper) { this.webClient = Objects.requireNonNull(webClient, "webClient"); this.auth = Objects.requireNonNull(auth, "auth"); this.mapper = Objects.requireNonNull(mapper, "mapper"); diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/KafkaQueueAgenticPublisher.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/KafkaQueueAgenticPublisherImpl.java similarity index 96% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/KafkaQueueAgenticPublisher.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/KafkaQueueAgenticPublisherImpl.java index a127692ad..56bb4b812 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/KafkaQueueAgenticPublisher.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/KafkaQueueAgenticPublisherImpl.java @@ -39,7 +39,7 @@ * propagates W3C trace context via {@code traceparent}/{@code tracestate} * headers carried in the {@link QueueInvocation}. */ -public final class KafkaQueueAgenticPublisher implements QueueAgenticPublisher { +public final class KafkaQueueAgenticPublisherImpl implements QueueAgenticPublisher { private final String name; private final String topic; @@ -48,7 +48,7 @@ public final class KafkaQueueAgenticPublisher implements QueueAgenticPublisher { private final AgenticMetrics metrics; private final AtomicReference lastStatus = new AtomicReference<>(AgenticHealth.Status.UNKNOWN); - public KafkaQueueAgenticPublisher(String name, + public KafkaQueueAgenticPublisherImpl(String name, String topic, String bootstrapServers, ObjectMapper mapper, @@ -56,7 +56,7 @@ public KafkaQueueAgenticPublisher(String name, this(name, topic, defaultSender(bootstrapServers, name), mapper, metrics); } - public KafkaQueueAgenticPublisher(String name, + public KafkaQueueAgenticPublisherImpl(String name, String topic, KafkaSender sender, ObjectMapper mapper, diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RabbitMqQueueAgenticPublisher.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RabbitMqQueueAgenticPublisherImpl.java similarity index 96% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RabbitMqQueueAgenticPublisher.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RabbitMqQueueAgenticPublisherImpl.java index 6428cf101..094ceefbd 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RabbitMqQueueAgenticPublisher.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RabbitMqQueueAgenticPublisherImpl.java @@ -35,7 +35,7 @@ * the encoded {@link QueueInvocation} to the configured exchange + routing * key, propagating any caller-supplied headers. */ -public final class RabbitMqQueueAgenticPublisher implements QueueAgenticPublisher { +public final class RabbitMqQueueAgenticPublisherImpl implements QueueAgenticPublisher { private final String name; private final String exchange; @@ -45,7 +45,7 @@ public final class RabbitMqQueueAgenticPublisher implements QueueAgenticPublishe private final AgenticMetrics metrics; private final AtomicReference lastStatus = new AtomicReference<>(AgenticHealth.Status.UNKNOWN); - public RabbitMqQueueAgenticPublisher(String name, + public RabbitMqQueueAgenticPublisherImpl(String name, String exchange, String defaultRoutingKey, String url, @@ -54,7 +54,7 @@ public RabbitMqQueueAgenticPublisher(String name, this(name, exchange, defaultRoutingKey, defaultSender(url), mapper, metrics); } - public RabbitMqQueueAgenticPublisher(String name, + public RabbitMqQueueAgenticPublisherImpl(String name, String exchange, String defaultRoutingKey, Sender sender, diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RedisQueueAgenticPublisher.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RedisQueueAgenticPublisherImpl.java similarity index 97% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RedisQueueAgenticPublisher.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RedisQueueAgenticPublisherImpl.java index c3bd3f296..0111bbe46 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RedisQueueAgenticPublisher.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/queue/RedisQueueAgenticPublisherImpl.java @@ -36,7 +36,7 @@ * recover trace headers (matches its existing * {@code body/headers} convention). */ -public final class RedisQueueAgenticPublisher implements QueueAgenticPublisher { +public final class RedisQueueAgenticPublisherImpl implements QueueAgenticPublisher { private final String name; private final String channel; @@ -47,7 +47,7 @@ public final class RedisQueueAgenticPublisher implements QueueAgenticPublisher { private final AgenticMetrics metrics; private final AtomicReference lastStatus = new AtomicReference<>(AgenticHealth.Status.UNKNOWN); - public RedisQueueAgenticPublisher(String name, + public RedisQueueAgenticPublisherImpl(String name, String channel, String url, ObjectMapper mapper, diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/rest/RestAgenticTransport.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/rest/RestAgenticTransportImpl.java similarity index 99% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/rest/RestAgenticTransport.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/rest/RestAgenticTransportImpl.java index 3792f566c..24e10f38c 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/rest/RestAgenticTransport.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/rest/RestAgenticTransportImpl.java @@ -53,7 +53,7 @@ *

Wraps a Spring {@link WebClient} and translates HTTP errors into the * bridge's strongly-typed {@link AgenticBridgeException} hierarchy.

*/ -public final class RestAgenticTransport implements AgenticTransport { +public final class RestAgenticTransportImpl implements AgenticTransport { private static final String NAME = "rest"; private static final String AGENTS_PATH = "/agents"; @@ -66,7 +66,7 @@ public final class RestAgenticTransport implements AgenticTransport { private final Duration responseTimeout; private final AgenticMetrics metrics; - public RestAgenticTransport(WebClient webClient, + public RestAgenticTransportImpl(WebClient webClient, AuthStrategy auth, ObjectMapper mapper, RetryPolicy retryPolicy, diff --git a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/websocket/WebSocketAgenticTransport.java b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/websocket/WebSocketAgenticTransportImpl.java similarity index 98% rename from modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/websocket/WebSocketAgenticTransport.java rename to modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/websocket/WebSocketAgenticTransportImpl.java index a220a2f39..30ebb08bf 100644 --- a/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/websocket/WebSocketAgenticTransport.java +++ b/modules/agentic-bridge/fireflyframework-agentic-bridge-core/src/main/java/org/fireflyframework/agentic/bridge/transport/websocket/WebSocketAgenticTransportImpl.java @@ -50,7 +50,7 @@ * {@link AgentRequest}s through subsequent invocations sharing a * {@code conversation_id}.

*/ -public final class WebSocketAgenticTransport implements AgenticTransport { +public final class WebSocketAgenticTransportImpl implements AgenticTransport { private static final String NAME = "websocket"; @@ -61,7 +61,7 @@ public final class WebSocketAgenticTransport implements AgenticTransport { private final Duration responseTimeout; private final AgenticMetrics metrics; - public WebSocketAgenticTransport(WebSocketClient client, + public WebSocketAgenticTransportImpl(WebSocketClient client, String baseUrl, AuthStrategy auth, ObjectMapper mapper, diff --git a/modules/backoffice/src/main/java/org/fireflyframework/common/backoffice/resolver/DefaultBackofficeContextResolver.java b/modules/backoffice/src/main/java/org/fireflyframework/common/backoffice/resolver/DefaultBackofficeContextResolverImpl.java similarity index 98% rename from modules/backoffice/src/main/java/org/fireflyframework/common/backoffice/resolver/DefaultBackofficeContextResolver.java rename to modules/backoffice/src/main/java/org/fireflyframework/common/backoffice/resolver/DefaultBackofficeContextResolverImpl.java index b2186e181..2980bc35c 100644 --- a/modules/backoffice/src/main/java/org/fireflyframework/common/backoffice/resolver/DefaultBackofficeContextResolver.java +++ b/modules/backoffice/src/main/java/org/fireflyframework/common/backoffice/resolver/DefaultBackofficeContextResolverImpl.java @@ -51,10 +51,10 @@ * @author Firefly Development Team * @since 1.0.0 */ -@Component +@Component("defaultBackofficeContextResolver") @Slf4j @RequiredArgsConstructor -public class DefaultBackofficeContextResolver extends AbstractBackofficeContextResolver { +public class DefaultBackofficeContextResolverImpl extends AbstractBackofficeContextResolver { /** * Optional attribute key under which the raw (non-UUID) principal subject is preserved. diff --git a/modules/batch/src/test/java/org/fireflyframework/batch/jdbc/OwnedRunBoundaryDatabaseTest.java b/modules/batch/src/test/java/org/fireflyframework/batch/jdbc/OwnedRunBoundaryDatabaseTest.java index 9cb33d04e..112bde6e8 100644 --- a/modules/batch/src/test/java/org/fireflyframework/batch/jdbc/OwnedRunBoundaryDatabaseTest.java +++ b/modules/batch/src/test/java/org/fireflyframework/batch/jdbc/OwnedRunBoundaryDatabaseTest.java @@ -23,7 +23,7 @@ import org.fireflyframework.batch.fixture.PostgresBatchFixture; import org.fireflyframework.security.api.domain.Decision; import org.fireflyframework.security.api.domain.Obligation; -import org.fireflyframework.security.core.policy.EmbeddedPolicyDecisionAdapter; +import org.fireflyframework.security.core.policy.EmbeddedPolicyDecisionAdapterImpl; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -83,7 +83,7 @@ private OwnedRunFixture.Intent intent(String tenant, String model) { private OwnedRunFixture recipe(DataSource source, AtomicReference> current) { var policy = - new EmbeddedPolicyDecisionAdapter( + new EmbeddedPolicyDecisionAdapterImpl( List.of((principal, action, resource, context) -> current.get()), true); return new OwnedRunFixture( source, diff --git a/modules/cache-hazelcast/README.md b/modules/cache-hazelcast/README.md index 0c8bad17a..f4bedc698 100644 --- a/modules/cache-hazelcast/README.md +++ b/modules/cache-hazelcast/README.md @@ -56,7 +56,7 @@ The Java examples in this section are API fragments for application code. Use th ``` With both the `HazelcastInstance` bean on the context and the property set, the core -`CacheManagerFactory` discovers `HazelcastProvider` through the SPI and routes all cache operations to +`CacheManagerFactory` discovers `HazelcastProviderImpl` through the SPI and routes all cache operations to Hazelcast. Your application code keeps using the standard Firefly cache API. Nothing else changes. ## Configuration @@ -67,7 +67,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`HazelcastProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProvider.java) | Defines `create` operations. | +| [`HazelcastProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProviderImpl.java) | Defines `create` operations. | | [`HazelcastCacheHelper`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/factory/HazelcastCacheHelper.java) | Reflection-based helper to create a Hazelcast-backed CacheAdapter without a compile-time dependency. | ## Continue the application diff --git a/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/factory/HazelcastCacheHelper.java b/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/factory/HazelcastCacheHelper.java index 391ec8ae1..68c7b5cab 100644 --- a/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/factory/HazelcastCacheHelper.java +++ b/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/factory/HazelcastCacheHelper.java @@ -44,11 +44,11 @@ public static CacheAdapter createHazelcastCacheAdapter(String cacheName, String keyPrefix, Duration defaultTtl, Object hazelcastInstance) { - return new HazelcastCacheAdapterReflective(cacheName, keyPrefix, defaultTtl, hazelcastInstance); + return new HazelcastCacheAdapterReflectiveImpl(cacheName, keyPrefix, defaultTtl, hazelcastInstance); } /** Reflection-based Hazelcast adapter implementation. */ - private static class HazelcastCacheAdapterReflective implements CacheAdapter { + private static class HazelcastCacheAdapterReflectiveImpl implements CacheAdapter { private final String cacheName; private final String keyPrefix; private final Duration defaultTtl; @@ -67,7 +67,7 @@ private static class HazelcastCacheAdapterReflective implements CacheAdapter { private final Method sizeMethod; private final Method keySetMethod; - HazelcastCacheAdapterReflective(String cacheName, String keyPrefix, Duration defaultTtl, Object hazelcastInstance) { + HazelcastCacheAdapterReflectiveImpl(String cacheName, String keyPrefix, Duration defaultTtl, Object hazelcastInstance) { try { this.cacheName = cacheName; this.keyPrefix = (keyPrefix != null && !keyPrefix.isBlank()) diff --git a/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProvider.java b/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProviderImpl.java similarity index 96% rename from modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProvider.java rename to modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProviderImpl.java index 2d2c45270..2bba0cef3 100644 --- a/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProvider.java +++ b/modules/cache-hazelcast/src/main/java/org/fireflyframework/cache/spi/providers/HazelcastProviderImpl.java @@ -23,7 +23,7 @@ import java.time.Duration; -public class HazelcastProvider implements CacheProviderFactory { +public class HazelcastProviderImpl implements CacheProviderFactory { @Override public CacheType getType() { return CacheType.HAZELCAST; } @Override public int priority() { return 20; } diff --git a/modules/cache-hazelcast/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory b/modules/cache-hazelcast/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory index ead9644e5..0d2fef9c1 100644 --- a/modules/cache-hazelcast/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory +++ b/modules/cache-hazelcast/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory @@ -1 +1 @@ -org.fireflyframework.cache.spi.providers.HazelcastProvider +org.fireflyframework.cache.spi.providers.HazelcastProviderImpl diff --git a/modules/cache-hazelcast/src/test/java/org/fireflyframework/cache/spi/providers/HazelcastProviderWiringTest.java b/modules/cache-hazelcast/src/test/java/org/fireflyframework/cache/spi/providers/HazelcastProviderWiringTest.java index 8b3262af3..de8f70977 100644 --- a/modules/cache-hazelcast/src/test/java/org/fireflyframework/cache/spi/providers/HazelcastProviderWiringTest.java +++ b/modules/cache-hazelcast/src/test/java/org/fireflyframework/cache/spi/providers/HazelcastProviderWiringTest.java @@ -53,6 +53,6 @@ void hazelcastProviderIsDiscoveredViaServiceLoader() { .findFirst() .orElseThrow(); - assertThat(hazelcast).isInstanceOf(HazelcastProvider.class); + assertThat(hazelcast).isInstanceOf(HazelcastProviderImpl.class); } } diff --git a/modules/cache-jcache/README.md b/modules/cache-jcache/README.md index c229d8e1d..d762cd84f 100644 --- a/modules/cache-jcache/README.md +++ b/modules/cache-jcache/README.md @@ -4,7 +4,7 @@ Adapt a host-managed JCache implementation to the common cache contract. -Provide the JCache CacheManager expected by JCacheProvider and select JCACHE through the core settings. The application owns the JSR-107 implementation and cache configuration. +Provide the JCache CacheManager expected by JCacheProviderImpl and select JCACHE through the core settings. The application owns the JSR-107 implementation and cache configuration. [Module guide](../../docs/site/modules/cache-jcache.md) · [Jafly README](../../README.md) · [Module catalog](../../docs/site/modules/index.md) @@ -64,7 +64,7 @@ import lombok.RequiredArgsConstructor; @RequiredArgsConstructor public class ProductService { - private final FireflyCacheManager cache; // from fireflyframework-cache + private final FireflyCacheManagerImpl cache; // from fireflyframework-cache @@ -84,7 +84,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`JCacheProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProvider.java) | Defines `create` operations. | +| [`JCacheProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProviderImpl.java) | Defines `create` operations. | | [`JCacheCacheHelper`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-jcache/src/main/java/org/fireflyframework/cache/factory/JCacheCacheHelper.java) | Reflection-based helper to create a JCache-backed CacheAdapter (JSR-107) without a compile-time dependency. | ## Continue the application diff --git a/modules/cache-jcache/src/main/java/org/fireflyframework/cache/factory/JCacheCacheHelper.java b/modules/cache-jcache/src/main/java/org/fireflyframework/cache/factory/JCacheCacheHelper.java index 10cae2044..3c37b70db 100644 --- a/modules/cache-jcache/src/main/java/org/fireflyframework/cache/factory/JCacheCacheHelper.java +++ b/modules/cache-jcache/src/main/java/org/fireflyframework/cache/factory/JCacheCacheHelper.java @@ -43,14 +43,14 @@ public static CacheAdapter createJCacheAdapter(String cacheName, String keyPrefix, Duration defaultTtl, Object cacheManager) { - return new JCacheAdapterReflective(cacheName, keyPrefix, defaultTtl, cacheManager); + return new JCacheAdapterReflectiveImpl(cacheName, keyPrefix, defaultTtl, cacheManager); } /** * Reflective adapter for JCache providers. Because per-entry TTL is not universally supported across * providers at put-time, we implement a lightweight TTL overlay by wrapping values with an expiration. */ - private static class JCacheAdapterReflective implements CacheAdapter { + private static class JCacheAdapterReflectiveImpl implements CacheAdapter { private final String cacheName; private final String keyPrefix; private final Duration defaultTtl; @@ -73,7 +73,7 @@ private static class JCacheAdapterReflective implements CacheAdapter { // TTL overlay when provider TTL is not configured per entry private final ConcurrentHashMap ttlOverlay = new ConcurrentHashMap<>(); - JCacheAdapterReflective(String cacheName, String keyPrefix, Duration defaultTtl, Object cacheManager) { + JCacheAdapterReflectiveImpl(String cacheName, String keyPrefix, Duration defaultTtl, Object cacheManager) { try { this.cacheName = cacheName; this.keyPrefix = (keyPrefix != null && !keyPrefix.isBlank()) diff --git a/modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProvider.java b/modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProviderImpl.java similarity index 97% rename from modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProvider.java rename to modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProviderImpl.java index dfce0d1e4..026a1fb28 100644 --- a/modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProvider.java +++ b/modules/cache-jcache/src/main/java/org/fireflyframework/cache/spi/providers/JCacheProviderImpl.java @@ -23,7 +23,7 @@ import java.time.Duration; -public class JCacheProvider implements CacheProviderFactory { +public class JCacheProviderImpl implements CacheProviderFactory { @Override public CacheType getType() { return CacheType.JCACHE; } @Override public int priority() { return 30; } diff --git a/modules/cache-jcache/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory b/modules/cache-jcache/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory index f3e3153ca..8142bb5e6 100644 --- a/modules/cache-jcache/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory +++ b/modules/cache-jcache/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory @@ -1 +1 @@ -org.fireflyframework.cache.spi.providers.JCacheProvider +org.fireflyframework.cache.spi.providers.JCacheProviderImpl diff --git a/modules/cache-jcache/src/test/java/org/fireflyframework/cache/spi/providers/JCacheProviderWiringTest.java b/modules/cache-jcache/src/test/java/org/fireflyframework/cache/spi/providers/JCacheProviderWiringTest.java index e1b9c5c72..882cb4c1c 100644 --- a/modules/cache-jcache/src/test/java/org/fireflyframework/cache/spi/providers/JCacheProviderWiringTest.java +++ b/modules/cache-jcache/src/test/java/org/fireflyframework/cache/spi/providers/JCacheProviderWiringTest.java @@ -51,7 +51,7 @@ void serviceLoaderDiscoversJCacheProvider() { assertThat(jcache) .as("ServiceLoader must discover a CacheProviderFactory with getType() == JCACHE") .isNotNull(); - assertThat(jcache).isInstanceOf(JCacheProvider.class); + assertThat(jcache).isInstanceOf(JCacheProviderImpl.class); assertThat(jcache.getType()).isEqualTo(CacheType.JCACHE); assertThat(jcache.priority()).isEqualTo(30); } @@ -63,7 +63,7 @@ void providerIsAvailableAndCreatesWorkingAdapterWithHostSuppliedCacheManager() { CacheProviderFactory.ProviderContext ctx = new CacheProviderFactory.ProviderContext( null, null, null, null, cacheManager); - JCacheProvider provider = new JCacheProvider(); + JCacheProviderImpl provider = new JCacheProviderImpl(); assertThat(provider.isAvailable(ctx)) .as("JCache provider must report available when a JSR-107 CacheManager bean is supplied") diff --git a/modules/cache-postgres/README.md b/modules/cache-postgres/README.md index 086928431..c71bbe71b 100644 --- a/modules/cache-postgres/README.md +++ b/modules/cache-postgres/README.md @@ -60,12 +60,12 @@ firefly: auto-create-schema: false ``` -3. Use the unified cache API. Obtain a `CacheAdapter` from the core `FireflyCacheManager`; it is +3. Use the unified cache API. Obtain a `CacheAdapter` from the core `FireflyCacheManagerImpl`; it is now backed by PostgreSQL with no other code changes: ```java import org.fireflyframework.cache.core.CacheAdapter; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.springframework.stereotype.Service; import reactor.core.publisher.Mono; @@ -74,7 +74,7 @@ public class ProductService { private final CacheAdapter cache; - public ProductService(FireflyCacheManager cacheManager) { + public ProductService(FireflyCacheManagerImpl cacheManager) { this.cache = cacheManager.getCache("products"); // CacheType.POSTGRES when selected } @@ -121,11 +121,11 @@ Programmatic factories/helpers must supply the service namespace through `CacheP | Type | Contract and responsibility | | --- | --- | -| [`PostgresCacheAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapter.java) | PostgreSQL-backed reactive cache adapter implemented over R2DBC. | -| [`PostgresProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProvider.java) | `CacheProviderFactory` implementation that contributes the PostgreSQL R2DBC cache provider. | +| [`PostgresCacheAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterImpl.java) | PostgreSQL-backed reactive cache adapter implemented over R2DBC. | +| [`PostgresProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProviderImpl.java) | `CacheProviderFactory` implementation that contributes the PostgreSQL R2DBC cache provider. | | [`PostgresCacheConfig`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheConfig.java) | Configuration for the PostgreSQL R2DBC cache adapter. | | [`PostgresCacheAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/config/PostgresCacheAutoConfiguration.java) | Auto-configuration for the PostgreSQL R2DBC cache provider. | -| [`PostgresCacheHelper`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/factory/PostgresCacheHelper.java) | Self-contained factory helper that builds a `PostgresCacheAdapter`. | +| [`PostgresCacheHelper`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-postgres/src/main/java/org/fireflyframework/cache/factory/PostgresCacheHelper.java) | Self-contained factory helper that builds a `PostgresCacheAdapterImpl`. | ## Continue the application diff --git a/modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapter.java b/modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterImpl.java similarity index 99% rename from modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapter.java rename to modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterImpl.java index 828f2a775..0750de137 100644 --- a/modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapter.java +++ b/modules/cache-postgres/src/main/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterImpl.java @@ -62,9 +62,9 @@ * {@link ConnectionFactory}; connections are acquired and released per operation * via {@link Mono#usingWhen(Publisher, java.util.function.Function, java.util.function.Function)}. */ -public class PostgresCacheAdapter implements CacheAdapter { +public class PostgresCacheAdapterImpl implements CacheAdapter { - private static final Logger log = LoggerFactory.getLogger(PostgresCacheAdapter.class); + private static final Logger log = LoggerFactory.getLogger(PostgresCacheAdapterImpl.class); private final String cacheName; private final String keyPrefix; @@ -83,7 +83,7 @@ public class PostgresCacheAdapter implements CacheAdapter { private final AtomicLong totalLoadTime = new AtomicLong(); /** Retains direct callers whose explicit prefix supplies both service and feature identity. */ - public PostgresCacheAdapter(String cacheName, + public PostgresCacheAdapterImpl(String cacheName, ConnectionFactory connectionFactory, PostgresCacheConfig config, CacheSerializer serializer) { @@ -91,7 +91,7 @@ public PostgresCacheAdapter(String cacheName, } /** Keeps a factory's service identity independent of a caller's feature prefix. */ - public PostgresCacheAdapter(String cacheName, + public PostgresCacheAdapterImpl(String cacheName, ConnectionFactory connectionFactory, PostgresCacheConfig config, CacheSerializer serializer, @@ -99,7 +99,7 @@ public PostgresCacheAdapter(String cacheName, this(cacheName, connectionFactory, config, serializer, serviceNamespace, CacheOperationPolicy.LEGACY); } - public PostgresCacheAdapter(String cacheName, + public PostgresCacheAdapterImpl(String cacheName, ConnectionFactory connectionFactory, PostgresCacheConfig config, CacheSerializer serializer, diff --git a/modules/cache-postgres/src/main/java/org/fireflyframework/cache/config/PostgresCacheAutoConfiguration.java b/modules/cache-postgres/src/main/java/org/fireflyframework/cache/config/PostgresCacheAutoConfiguration.java index 73d01af2c..bd6887bda 100644 --- a/modules/cache-postgres/src/main/java/org/fireflyframework/cache/config/PostgresCacheAutoConfiguration.java +++ b/modules/cache-postgres/src/main/java/org/fireflyframework/cache/config/PostgresCacheAutoConfiguration.java @@ -47,10 +47,10 @@ @ConditionalOnProperty(prefix = "firefly.cache", name = {"enabled", "postgres.enabled"}, havingValue = "true", matchIfMissing = true) @ConditionalOnMissingBean(name = "fireflyCachePostgresConnectionFactory") -@Conditional(PostgresCacheAutoConfiguration.ConfiguredPostgres.class) +@Conditional(PostgresCacheAutoConfiguration.ConfiguredPostgresImpl.class) @EnableConfigurationProperties(CacheProperties.class) public class PostgresCacheAutoConfiguration { - static final class ConfiguredPostgres implements Condition { + static final class ConfiguredPostgresImpl implements Condition { @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { String database = context.getEnvironment().getProperty("firefly.cache.postgres.database"); @@ -61,7 +61,7 @@ public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) @Bean(destroyMethod = "close") @Lazy - OwnedPostgresPool fireflyCachePostgresOwnedPool(CacheProperties properties) { + OwnedPostgresPoolImpl fireflyCachePostgresOwnedPool(CacheProperties properties) { var cfg = properties.getPostgres(); requireText(cfg.getHost(), "host"); requireText(cfg.getDatabase(), "database"); @@ -97,12 +97,12 @@ OwnedPostgresPool fireflyCachePostgresOwnedPool(CacheProperties properties) { .maxSize(cfg.getMaxPoolSize()).initialSize(cfg.getMinPoolSize()).minIdle(cfg.getMinPoolSize()) .maxAcquireTime(cfg.getAcquireTimeout()).maxCreateConnectionTime(cfg.getConnectTimeout()) .maxValidationTime(cfg.getAcquireTimeout()).acquireRetry(0).maxIdleTime(Duration.ofMinutes(5)).build(); - return new OwnedPostgresPool(new ConnectionPool(configuration), cfg.getShutdownTimeout()); + return new OwnedPostgresPoolImpl(new ConnectionPool(configuration), cfg.getShutdownTimeout()); } @Bean(name = "fireflyCachePostgresConnectionFactory", destroyMethod = "", defaultCandidate = false) @Lazy - public ConnectionFactory fireflyCachePostgresConnectionFactory(OwnedPostgresPool owner) { + public ConnectionFactory fireflyCachePostgresConnectionFactory(OwnedPostgresPoolImpl owner) { return owner.pool; } @@ -118,12 +118,12 @@ private static void requirePositive(Duration timeout) { } } - static final class OwnedPostgresPool implements AutoCloseable { + static final class OwnedPostgresPoolImpl implements AutoCloseable { private final ConnectionPool pool; private final Duration shutdownTimeout; private final AtomicBoolean closed = new AtomicBoolean(); - OwnedPostgresPool(ConnectionPool pool, Duration shutdownTimeout) { + OwnedPostgresPoolImpl(ConnectionPool pool, Duration shutdownTimeout) { this.pool = pool; this.shutdownTimeout = shutdownTimeout; } diff --git a/modules/cache-postgres/src/main/java/org/fireflyframework/cache/factory/PostgresCacheHelper.java b/modules/cache-postgres/src/main/java/org/fireflyframework/cache/factory/PostgresCacheHelper.java index 4b94784c1..21b5bc9e6 100644 --- a/modules/cache-postgres/src/main/java/org/fireflyframework/cache/factory/PostgresCacheHelper.java +++ b/modules/cache-postgres/src/main/java/org/fireflyframework/cache/factory/PostgresCacheHelper.java @@ -18,13 +18,13 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.r2dbc.spi.ConnectionFactory; -import org.fireflyframework.cache.adapter.postgres.PostgresCacheAdapter; +import org.fireflyframework.cache.adapter.postgres.PostgresCacheAdapterImpl; import org.fireflyframework.cache.adapter.postgres.PostgresCacheConfig; import org.fireflyframework.cache.core.CacheAdapter; import org.fireflyframework.cache.core.CacheOperationPolicy; import org.fireflyframework.cache.properties.CacheProperties; import org.fireflyframework.cache.serialization.CacheSerializer; -import org.fireflyframework.cache.serialization.JsonCacheSerializer; +import org.fireflyframework.cache.serialization.JsonCacheSerializerImpl; import java.time.Duration; @@ -72,7 +72,7 @@ public static CacheAdapter createPostgresCacheAdapter(String cacheName, ObjectMapper objectMapper, CacheOperationPolicy policy) { java.util.Objects.requireNonNull(policy, "Cache operation policy required"); - CacheSerializer serializer = new JsonCacheSerializer(objectMapper); + CacheSerializer serializer = new JsonCacheSerializerImpl(objectMapper); CacheProperties.PostgresConfig postgres = properties.getPostgres(); Duration ttl = defaultTtl != null @@ -92,6 +92,6 @@ public static CacheAdapter createPostgresCacheAdapter(String cacheName, config.validate(cacheName, serviceNamespace); ConnectionFactory connectionFactory = (ConnectionFactory) r2dbcConnectionFactory; PostgresCacheInitializer.initialize(connectionFactory, postgres, config); - return new PostgresCacheAdapter(cacheName, connectionFactory, config, serializer, serviceNamespace, policy); + return new PostgresCacheAdapterImpl(cacheName, connectionFactory, config, serializer, serviceNamespace, policy); } } diff --git a/modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProvider.java b/modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProviderImpl.java similarity index 97% rename from modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProvider.java rename to modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProviderImpl.java index 31b8bfbbf..56e4a602c 100644 --- a/modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProvider.java +++ b/modules/cache-postgres/src/main/java/org/fireflyframework/cache/spi/providers/PostgresProviderImpl.java @@ -28,7 +28,7 @@ * {@link CacheProviderFactory} implementation that contributes the PostgreSQL * R2DBC cache provider. Discovered via {@code ServiceLoader}. */ -public class PostgresProvider implements CacheProviderFactory { +public class PostgresProviderImpl implements CacheProviderFactory { @Override public CacheType getType() { diff --git a/modules/cache-postgres/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory b/modules/cache-postgres/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory index 23b6d843b..f663ac67e 100644 --- a/modules/cache-postgres/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory +++ b/modules/cache-postgres/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory @@ -1 +1 @@ -org.fireflyframework.cache.spi.providers.PostgresProvider +org.fireflyframework.cache.spi.providers.PostgresProviderImpl diff --git a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterIntegrationTest.java b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterIntegrationTest.java index cd29d01d1..5988a00e7 100644 --- a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterIntegrationTest.java +++ b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterIntegrationTest.java @@ -25,7 +25,7 @@ import org.fireflyframework.cache.core.CacheHealth; import org.fireflyframework.cache.core.CacheType; import org.fireflyframework.cache.serialization.CacheSerializer; -import org.fireflyframework.cache.serialization.JsonCacheSerializer; +import org.fireflyframework.cache.serialization.JsonCacheSerializerImpl; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; @@ -61,7 +61,7 @@ class PostgresCacheAdapterIntegrationTest { private static final String TABLE = "firefly_cache_entries"; private static ConnectionPool pool; - private PostgresCacheAdapter adapter; + private PostgresCacheAdapterImpl adapter; @BeforeAll static void startPool() { @@ -113,7 +113,7 @@ private static void createTable() { @BeforeEach void setUp() { ObjectMapper objectMapper = new ObjectMapper(); - CacheSerializer serializer = new JsonCacheSerializer(objectMapper); + CacheSerializer serializer = new JsonCacheSerializerImpl(objectMapper); PostgresCacheConfig config = PostgresCacheConfig.builder() .cacheName("itest") .keyPrefix("firefly:cache") @@ -121,7 +121,7 @@ void setUp() { .schema(SCHEMA) .cacheTable(TABLE) .build(); - adapter = new PostgresCacheAdapter("itest", pool, config, serializer); + adapter = new PostgresCacheAdapterImpl("itest", pool, config, serializer); // Ensure a clean cache for each test. adapter.clear().block(Duration.ofSeconds(10)); } @@ -301,10 +301,10 @@ void statsTrackHitsAndMisses() { private static final Duration PROTOCOL_WAIT = Duration.ofSeconds(10); - private static PostgresCacheAdapter scoped(String namespace, String logicalName, io.r2dbc.spi.ConnectionFactory factory) { - return new PostgresCacheAdapter(logicalName, factory, PostgresCacheConfig.builder() + private static PostgresCacheAdapterImpl scoped(String namespace, String logicalName, io.r2dbc.spi.ConnectionFactory factory) { + return new PostgresCacheAdapterImpl(logicalName, factory, PostgresCacheConfig.builder() .keyPrefix(namespace).schema(SCHEMA).cacheTable(TABLE).build(), - new JsonCacheSerializer(new ObjectMapper())); + new JsonCacheSerializerImpl(new ObjectMapper())); } private static Mono technical(java.util.function.Function> work) { @@ -429,11 +429,11 @@ void applicationNameDefaultsSeparateActualPostgresCacheManagers() { .withPropertyValues("firefly.cache.postgres.schema=" + SCHEMA); contexts.withPropertyValues("spring.application.name=service-a-" + suffix).run(firstContext -> { assertThat(firstContext).hasNotFailed(); - var first = firstContext.getBean(org.fireflyframework.cache.manager.FireflyCacheManager.class); + var first = firstContext.getBean(org.fireflyframework.cache.manager.FireflyCacheManagerImpl.class); first.put("shared", "first").block(PROTOCOL_WAIT); contexts.withPropertyValues("spring.application.name=service-b-" + suffix).run(secondContext -> { assertThat(secondContext).hasNotFailed(); - var second = secondContext.getBean(org.fireflyframework.cache.manager.FireflyCacheManager.class); + var second = secondContext.getBean(org.fireflyframework.cache.manager.FireflyCacheManagerImpl.class); assertThat(second.get("shared", String.class).block(PROTOCOL_WAIT)).isEmpty(); second.put("shared", "second").block(PROTOCOL_WAIT); first.clear().block(PROTOCOL_WAIT); @@ -489,12 +489,12 @@ void actualOwnedPoolsShareSameServiceEntriesExpireThemAndCloseWithTheirContexts( contexts.run(firstContext -> { assertThat(firstContext).hasNotFailed(); firstPool.set(firstContext.getBean("fireflyCachePostgresConnectionFactory", ConnectionPool.class)); - var first = firstContext.getBean(org.fireflyframework.cache.manager.FireflyCacheManager.class); + var first = firstContext.getBean(org.fireflyframework.cache.manager.FireflyCacheManagerImpl.class); contexts.run(secondContext -> { assertThat(secondContext).hasNotFailed(); secondPool.set(secondContext.getBean("fireflyCachePostgresConnectionFactory", ConnectionPool.class)); assertThat(firstPool.get()).isNotSameAs(secondPool.get()); - var second = secondContext.getBean(org.fireflyframework.cache.manager.FireflyCacheManager.class); + var second = secondContext.getBean(org.fireflyframework.cache.manager.FireflyCacheManagerImpl.class); first.put("shared", "cross-instance", Duration.ofSeconds(1)).block(PROTOCOL_WAIT); assertThat(second.get("shared", String.class).block(PROTOCOL_WAIT)).contains("cross-instance"); await().atMost(PROTOCOL_WAIT).until(() -> second.get("shared", String.class).block(PROTOCOL_WAIT).isEmpty()); diff --git a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterLoggingTest.java b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterLoggingTest.java index 9f78a908f..166d26b8a 100644 --- a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterLoggingTest.java +++ b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheAdapterLoggingTest.java @@ -31,7 +31,7 @@ class PostgresCacheAdapterLoggingTest { private static final String NAME = "cache\r\nregion\u000bvertical\fform\u0085next\u2028line\u2029paragraph"; - private final Logger logger = (Logger) LoggerFactory.getLogger(PostgresCacheAdapter.class); + private final Logger logger = (Logger) LoggerFactory.getLogger(PostgresCacheAdapterImpl.class); private final ListAppender events = new ListAppender<>(); private Level previousLevel; private boolean previousAdditive; @@ -59,7 +59,7 @@ private static final class Key { @Test void readEvictAndExistsErrorsKeepTheirFallbacksAndTypeOnlyWarnings() { var factory = mock(io.r2dbc.spi.ConnectionFactory.class); var failure = new IllegalStateException("PRIVATE_MESSAGE\r\nforged"); when(factory.create()).thenAnswer(invocation -> Mono.error(failure)); - var adapter = new PostgresCacheAdapter(NAME, factory, PostgresCacheConfig.builder().keyPrefix("synthetic-service").build(), mock(org.fireflyframework.cache.serialization.CacheSerializer.class)); + var adapter = new PostgresCacheAdapterImpl(NAME, factory, PostgresCacheConfig.builder().keyPrefix("synthetic-service").build(), mock(org.fireflyframework.cache.serialization.CacheSerializer.class)); var key = new Key(); assertEquals(Optional.empty(), adapter.get(key).block()); safeEvent(Level.WARN, true); assertEquals(1,key.renders); assertEquals(false, adapter.evict(key).block()); safeEvent(Level.WARN, true); assertEquals(2,key.renders); assertEquals(false, adapter.exists(key).block()); safeEvent(Level.WARN, true); assertEquals(3,key.renders); @@ -74,7 +74,7 @@ private static final class Key { when(result.map(any(java.util.function.BiFunction.class))).thenAnswer(invocation -> reactor.core.publisher.Flux.just(((java.util.function.BiFunction)invocation.getArgument(0)).apply(row,mock(io.r2dbc.spi.RowMetadata.class)))); var serializer = mock(org.fireflyframework.cache.serialization.CacheSerializer.class); when(serializer.deserialize(any(),any())).thenThrow(new IllegalStateException("PRIVATE_MESSAGE\r\nforged")); - var adapter = new PostgresCacheAdapter(NAME,factory,PostgresCacheConfig.builder().keyPrefix("synthetic-service").build(),serializer); var key = new Key(); + var adapter = new PostgresCacheAdapterImpl(NAME,factory,PostgresCacheConfig.builder().keyPrefix("synthetic-service").build(),serializer); var key = new Key(); assertEquals(Optional.empty(),adapter.get(key,String.class).block()); safeEvent(Level.WARN,true); assertEquals(1,key.renders); verify(connection).close(); } diff --git a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheNamespaceTest.java b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheNamespaceTest.java index ccba4688e..c6662adda 100644 --- a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheNamespaceTest.java +++ b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheNamespaceTest.java @@ -9,7 +9,7 @@ import java.util.*; import java.util.function.BiFunction; import com.fasterxml.jackson.databind.ObjectMapper; -import org.fireflyframework.cache.serialization.JsonCacheSerializer; +import org.fireflyframework.cache.serialization.JsonCacheSerializerImpl; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; @@ -38,9 +38,9 @@ class PostgresCacheNamespaceTest { .apply(row,mock(RowMetadata.class)))); } - PostgresCacheAdapter adapter(String namespace,String logical) { - return new PostgresCacheAdapter(logical,factory,PostgresCacheConfig.builder().keyPrefix(namespace).build(), - new JsonCacheSerializer(new ObjectMapper())); + PostgresCacheAdapterImpl adapter(String namespace,String logical) { + return new PostgresCacheAdapterImpl(logical,factory,PostgresCacheConfig.builder().keyPrefix(namespace).build(), + new JsonCacheSerializerImpl(new ObjectMapper())); } @ParameterizedTest @CsvSource(delimiter='|',value={ diff --git a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheProtocolTest.java b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheProtocolTest.java index 2fad350e8..4778d12ee 100644 --- a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheProtocolTest.java +++ b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheProtocolTest.java @@ -7,7 +7,7 @@ import io.r2dbc.spi.*; import java.time.Duration; import java.util.*; -import org.fireflyframework.cache.serialization.JsonCacheSerializer; +import org.fireflyframework.cache.serialization.JsonCacheSerializerImpl; import com.fasterxml.jackson.databind.ObjectMapper; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -35,9 +35,9 @@ class PostgresCacheProtocolTest { when(result.getRowsUpdated()).thenReturn(Mono.just(1L)); } - PostgresCacheAdapter adapter() { - return new PostgresCacheAdapter("logical",factory,PostgresCacheConfig.builder().keyPrefix("service").build(), - new JsonCacheSerializer(new ObjectMapper())); + PostgresCacheAdapterImpl adapter() { + return new PostgresCacheAdapterImpl("logical",factory,PostgresCacheConfig.builder().keyPrefix("service").build(), + new JsonCacheSerializerImpl(new ObjectMapper())); } @Test void expiredConflictUsesOneAtomicConditionalUpdateWithPostLockDatabaseClocks() { diff --git a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheServiceIdentityTest.java b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheServiceIdentityTest.java index 606b43887..ca31c49cd 100644 --- a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheServiceIdentityTest.java +++ b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresCacheServiceIdentityTest.java @@ -12,7 +12,7 @@ import org.fireflyframework.cache.factory.PostgresCacheHelper; import org.fireflyframework.cache.properties.CacheProperties; import org.fireflyframework.cache.serialization.CacheSerializer; -import org.fireflyframework.cache.serialization.JsonCacheSerializer; +import org.fireflyframework.cache.serialization.JsonCacheSerializerImpl; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -28,7 +28,7 @@ class PostgresCacheServiceIdentityTest { final Result result=mock(Result.class); final AtomicReference physical=new AtomicReference<>(); final AtomicReference fullKey=new AtomicReference<>(); - final CacheSerializer serializer=new JsonCacheSerializer(new ObjectMapper()); + final CacheSerializer serializer=new JsonCacheSerializerImpl(new ObjectMapper()); @SuppressWarnings({"unchecked","rawtypes"}) PostgresCacheServiceIdentityTest() { doReturn(Mono.just(connection)).when(factory).create();when(connection.close()).thenReturn(Mono.empty()); @@ -38,12 +38,12 @@ class PostgresCacheServiceIdentityTest { doReturn(Flux.just(result)).when(statement).execute();when(result.getRowsUpdated()).thenReturn(Mono.just(0L)); when(result.map(any(BiFunction.class))).thenReturn(Flux.empty()); } - PostgresCacheAdapter helper(String service,String logical,String feature) { + PostgresCacheAdapterImpl helper(String service,String logical,String feature) { var properties=new CacheProperties();properties.getPostgres().setKeyPrefix(service); - return (PostgresCacheAdapter)PostgresCacheHelper.createPostgresCacheAdapter(logical,feature,Duration.ofMinutes(1), + return (PostgresCacheAdapterImpl)PostgresCacheHelper.createPostgresCacheAdapter(logical,feature,Duration.ofMinutes(1), factory,properties,new ObjectMapper()); } - String capture(PostgresCacheAdapter cache) {cache.clear().block();return physical.get();} + String capture(PostgresCacheAdapterImpl cache) {cache.clear().block();return physical.get();} @Test void fixedFeaturePrefixCannotOverrideDifferentServiceNamespaces() { assertThat(capture(helper("service-a","logical","fixed-feature"))) .isNotEqualTo(capture(helper("service-b","logical","fixed-feature"))); @@ -66,11 +66,11 @@ PostgresCacheAdapter helper(String service,String logical,String feature) { assertThat(capture(helper("other-service","logical",""))).isNotEqualTo(emptyPhysical); } @Test void retainedDirectConstructorAndHelperAgreeWhenServiceAndFeatureCoincide() { - var direct=new PostgresCacheAdapter("logical",factory,PostgresCacheConfig.builder().keyPrefix("service").build(),serializer); + var direct=new PostgresCacheAdapterImpl("logical",factory,PostgresCacheConfig.builder().keyPrefix("service").build(),serializer); assertThat(capture(direct)).isEqualTo(capture(helper("service","logical","service"))); } @Test void explicitNamespaceOverloadAndHelperHaveTheSameIdentity() throws Exception { - var constructor=PostgresCacheAdapter.class.getConstructor(String.class,ConnectionFactory.class, + var constructor=PostgresCacheAdapterImpl.class.getConstructor(String.class,ConnectionFactory.class, PostgresCacheConfig.class,CacheSerializer.class,String.class); var direct=constructor.newInstance("logical",factory,PostgresCacheConfig.builder().keyPrefix("feature").build(),serializer,"service"); assertThat(capture(direct)).isEqualTo(capture(helper("service","logical","feature"))); diff --git a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresPrimaryOnlyPolicyTest.java b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresPrimaryOnlyPolicyTest.java index d84f53cb3..d50743524 100644 --- a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresPrimaryOnlyPolicyTest.java +++ b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/adapter/postgres/PostgresPrimaryOnlyPolicyTest.java @@ -9,7 +9,7 @@ import java.util.*; import java.util.function.BiFunction; import org.fireflyframework.cache.core.*; -import org.fireflyframework.cache.serialization.JsonCacheSerializer; +import org.fireflyframework.cache.serialization.JsonCacheSerializerImpl; import org.junit.jupiter.api.Test; import reactor.core.publisher.*; import reactor.test.StepVerifier; @@ -28,8 +28,8 @@ class PostgresPrimaryOnlyPolicyTest { when(row.get("value")).thenReturn("value".getBytes(StandardCharsets.UTF_8)); when(result.map(any(BiFunction.class))).thenAnswer(call->Flux.just(((BiFunction)call.getArgument(0)).apply(row,mock(RowMetadata.class)))); } - PostgresCacheAdapter strict() {return new PostgresCacheAdapter("policy",factory,PostgresCacheConfig.builder().keyPrefix("service").build(),new JsonCacheSerializer(new ObjectMapper()),"service",CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS);} - PostgresCacheAdapter legacy() {return new PostgresCacheAdapter("policy",factory,PostgresCacheConfig.builder().keyPrefix("service").build(),new JsonCacheSerializer(new ObjectMapper()));} + PostgresCacheAdapterImpl strict() {return new PostgresCacheAdapterImpl("policy",factory,PostgresCacheConfig.builder().keyPrefix("service").build(),new JsonCacheSerializerImpl(new ObjectMapper()),"service",CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS);} + PostgresCacheAdapterImpl legacy() {return new PostgresCacheAdapterImpl("policy",factory,PostgresCacheConfig.builder().keyPrefix("service").build(),new JsonCacheSerializerImpl(new ObjectMapper()));} @Test void acquireFailureIsNotAMissFalseOrSuccessfulWrite() { doReturn(Mono.error(new IllegalStateException("controlled acquire failure"))).when(factory).create();var cache=strict(); for(var operation:List.of(cache.get("key",String.class),cache.exists("key"),cache.evict("key"),cache.put("key","value"),cache.clear(),cache.getStats())) @@ -80,7 +80,7 @@ class PostgresPrimaryOnlyPolicyTest { } @Test void missingOrUnsupportedSerializedValueRefusesBeforeAcquisition() { var serializer=mock(org.fireflyframework.cache.serialization.CacheSerializer.class); - var cache=new PostgresCacheAdapter("policy",factory,PostgresCacheConfig.builder().keyPrefix("service").build(),serializer,"service",CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS); + var cache=new PostgresCacheAdapterImpl("policy",factory,PostgresCacheConfig.builder().keyPrefix("service").build(),serializer,"service",CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS); StepVerifier.create(cache.put("key","value")).expectError().verify(); when(serializer.serialize("value")).thenReturn(new Object());StepVerifier.create(cache.put("key","value")).expectError().verify();verifyNoInteractions(factory); } diff --git a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/config/PostgresCacheAutoConfigurationIsolationTest.java b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/config/PostgresCacheAutoConfigurationIsolationTest.java index e3792092d..6560319b6 100644 --- a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/config/PostgresCacheAutoConfigurationIsolationTest.java +++ b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/config/PostgresCacheAutoConfigurationIsolationTest.java @@ -6,7 +6,7 @@ import io.r2dbc.spi.ConnectionFactory; import java.util.concurrent.atomic.AtomicInteger; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -38,7 +38,7 @@ void explicitCaffeineDoesNotResolveAnExternalNamedPostgresFactory() { .withPropertyValues("firefly.cache.default-cache-type=CAFFEINE") .run(application -> { assertThat(application).hasNotFailed(); - assertThat(application).hasSingleBean(FireflyCacheManager.class); + assertThat(application).hasSingleBean(FireflyCacheManagerImpl.class); assertThat(application.getBean(AtomicInteger.class).get()).isZero(); }); } @@ -73,7 +73,7 @@ void autoWithoutPostgresConfigurationCanSelectAnAvailableLocalProvider() { context.withPropertyValues("firefly.cache.default-cache-type=AUTO") .run(application -> { assertThat(application).hasNotFailed(); - assertThat(application.getBean(FireflyCacheManager.class).getCacheType()) + assertThat(application.getBean(FireflyCacheManagerImpl.class).getCacheType()) .isEqualTo(org.fireflyframework.cache.core.CacheType.CAFFEINE); assertThat(application).doesNotHaveBean("fireflyCachePostgresConnectionFactory"); }); diff --git a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/config/PostgresCacheNamespaceBindingTest.java b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/config/PostgresCacheNamespaceBindingTest.java index 7aeaf4e06..b58068dbd 100644 --- a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/config/PostgresCacheNamespaceBindingTest.java +++ b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/config/PostgresCacheNamespaceBindingTest.java @@ -6,7 +6,7 @@ import io.r2dbc.spi.*; import java.util.function.BiFunction; -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; @@ -33,7 +33,7 @@ ConnectionFactory cacheFactory() { @Test void applicationNameProvidesTheNamespaceOnlyWhenExplicitPrefixIsMissing() { context.withPropertyValues("spring.application.name=service-a").run(application -> { - assertThat(application).hasNotFailed();assertThat(application).hasSingleBean(FireflyCacheManager.class); + assertThat(application).hasNotFailed();assertThat(application).hasSingleBean(FireflyCacheManagerImpl.class); assertThat(application.getBean(CacheProperties.class).getPostgres().getKeyPrefix()).isEqualTo("service-a"); }); } diff --git a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/factory/PostgresCacheStartupTest.java b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/factory/PostgresCacheStartupTest.java index 590470384..97a28d977 100644 --- a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/factory/PostgresCacheStartupTest.java +++ b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/factory/PostgresCacheStartupTest.java @@ -12,7 +12,7 @@ import java.util.ArrayList; import java.util.List; import java.util.function.BiFunction; -import org.fireflyframework.cache.adapter.postgres.PostgresCacheAdapter; +import org.fireflyframework.cache.adapter.postgres.PostgresCacheAdapterImpl; import org.fireflyframework.cache.adapter.postgres.PostgresCacheConfig; import org.fireflyframework.cache.core.CacheType; import org.fireflyframework.cache.properties.CacheProperties; @@ -40,8 +40,8 @@ class PostgresCacheStartupTest { when(connection.close()).thenReturn(Mono.empty()); } - PostgresCacheAdapter create() { - return (PostgresCacheAdapter) PostgresCacheHelper.createPostgresCacheAdapter( + PostgresCacheAdapterImpl create() { + return (PostgresCacheAdapterImpl) PostgresCacheHelper.createPostgresCacheAdapter( "orders", "tenant", Duration.ofMinutes(7), factory, properties, new ObjectMapper()); } @@ -111,7 +111,7 @@ PostgresCacheAdapter create() { var manager = new CacheManagerFactory(properties, new ObjectMapper(), null, null, null, factory) .createDefaultCacheManager("default"); assertThat(ReflectionTestUtils.getField(manager, "primaryCache").getClass().getSimpleName()) - .isEqualTo("SmartCacheAdapter"); + .isEqualTo("SmartCacheAdapterImpl"); } @Test void automaticAdapterSelectionPrefersPostgresToRedis() { @@ -123,7 +123,7 @@ PostgresCacheAdapter create() { when(redis.getCacheType()).thenReturn(CacheType.REDIS); when(postgres.getCacheName()).thenReturn("z-postgres"); when(redis.getCacheName()).thenReturn("a-redis"); - assertThat(new org.fireflyframework.cache.manager.AutoCacheSelectionStrategy() + assertThat(new org.fireflyframework.cache.manager.AutoCacheSelectionStrategyImpl() .selectCache(List.of(redis, postgres))).contains(postgres); } diff --git a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/factory/PostgresPrimaryOnlyWiringTest.java b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/factory/PostgresPrimaryOnlyWiringTest.java index 22b1bd06c..8fa860d8e 100644 --- a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/factory/PostgresPrimaryOnlyWiringTest.java +++ b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/factory/PostgresPrimaryOnlyWiringTest.java @@ -27,7 +27,7 @@ class PostgresPrimaryOnlyWiringTest { "policy",CacheType.POSTGRES,"service:policy",Duration.ofMinutes(1),"policy test","test",CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS); assertThat(manager.operationPolicy()).isEqualTo(CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS); var primary=(CacheAdapter)ReflectionTestUtils.getField(manager,"primaryCache"); - assertThat(primary).isInstanceOf(org.fireflyframework.cache.adapter.postgres.PostgresCacheAdapter.class); + assertThat(primary).isInstanceOf(org.fireflyframework.cache.adapter.postgres.PostgresCacheAdapterImpl.class); assertThat(primary.operationPolicy()).isEqualTo(CacheOperationPolicy.PRIMARY_ONLY_PROPAGATE_ERRORS); assertThat(ReflectionTestUtils.getField(manager,"fallbackCache")).isNull();verify(connection).close(); } diff --git a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/spi/PostgresProviderWiringTest.java b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/spi/PostgresProviderWiringTest.java index 89e67ca3d..87996edec 100644 --- a/modules/cache-postgres/src/test/java/org/fireflyframework/cache/spi/PostgresProviderWiringTest.java +++ b/modules/cache-postgres/src/test/java/org/fireflyframework/cache/spi/PostgresProviderWiringTest.java @@ -17,7 +17,7 @@ package org.fireflyframework.cache.spi; import org.fireflyframework.cache.core.CacheType; -import org.fireflyframework.cache.spi.providers.PostgresProvider; +import org.fireflyframework.cache.spi.providers.PostgresProviderImpl; import org.junit.jupiter.api.Test; import java.util.ServiceLoader; @@ -38,7 +38,7 @@ void serviceLoaderDiscoversPostgresProvider() { for (CacheProviderFactory factory : loader) { if (factory.getType() == CacheType.POSTGRES) { found = true; - assertThat(factory).isInstanceOf(PostgresProvider.class); + assertThat(factory).isInstanceOf(PostgresProviderImpl.class); assertThat(factory.priority()).isEqualTo(5); } } @@ -50,7 +50,7 @@ void serviceLoaderDiscoversPostgresProvider() { @Test void postgresProviderReportsExpectedType() { - PostgresProvider provider = new PostgresProvider(); + PostgresProviderImpl provider = new PostgresProviderImpl(); assertThat(provider.getType()).isEqualTo(CacheType.POSTGRES); assertThat(provider.priority()).isEqualTo(5); } diff --git a/modules/cache-redis/README.md b/modules/cache-redis/README.md index 89e1d95ca..839a24945 100644 --- a/modules/cache-redis/README.md +++ b/modules/cache-redis/README.md @@ -89,8 +89,8 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`RedisCacheAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapter.java) | Redis-based cache adapter implementation. | -| [`RedisProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProvider.java) | Defines `create` operations. | +| [`RedisCacheAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterImpl.java) | Redis-based cache adapter implementation. | +| [`RedisProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProviderImpl.java) | Defines `create` operations. | | [`RedisCacheConfig`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheConfig.java) | Configuration class for Redis cache adapter. | | [`RedisCacheAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/config/RedisCacheAutoConfiguration.java) | Auto-configuration for Redis infrastructure beans used by fireflyframework-cache. | | [`RedisCacheHelper`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache-redis/src/main/java/org/fireflyframework/cache/factory/RedisCacheHelper.java) | Helper class for creating Redis cache adapters. | diff --git a/modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapter.java b/modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterImpl.java similarity index 99% rename from modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapter.java rename to modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterImpl.java index b7adf2e7b..62fd0e79e 100644 --- a/modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapter.java +++ b/modules/cache-redis/src/main/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterImpl.java @@ -55,7 +55,7 @@ * */ @Slf4j -public class RedisCacheAdapter implements CacheAdapter { +public class RedisCacheAdapterImpl implements CacheAdapter { private final ReactiveRedisTemplate redisTemplate; private final ReactiveRedisConnectionFactory connectionFactory; @@ -72,7 +72,7 @@ public class RedisCacheAdapter implements CacheAdapter { private final AtomicLong evictionCount = new AtomicLong(0); private final AtomicLong totalLoadTime = new AtomicLong(0); - public RedisCacheAdapter(String cacheName, ReactiveRedisTemplate redisTemplate, + public RedisCacheAdapterImpl(String cacheName, ReactiveRedisTemplate redisTemplate, ReactiveRedisConnectionFactory connectionFactory, RedisCacheConfig config, CacheSerializer serializer) { this.cacheName = cacheName; diff --git a/modules/cache-redis/src/main/java/org/fireflyframework/cache/factory/RedisCacheHelper.java b/modules/cache-redis/src/main/java/org/fireflyframework/cache/factory/RedisCacheHelper.java index 2559f02c3..1656b36ff 100644 --- a/modules/cache-redis/src/main/java/org/fireflyframework/cache/factory/RedisCacheHelper.java +++ b/modules/cache-redis/src/main/java/org/fireflyframework/cache/factory/RedisCacheHelper.java @@ -17,12 +17,12 @@ package org.fireflyframework.cache.factory; import com.fasterxml.jackson.databind.ObjectMapper; -import org.fireflyframework.cache.adapter.redis.RedisCacheAdapter; +import org.fireflyframework.cache.adapter.redis.RedisCacheAdapterImpl; import org.fireflyframework.cache.adapter.redis.RedisCacheConfig; import org.fireflyframework.cache.core.CacheAdapter; import org.fireflyframework.cache.properties.CacheProperties; import org.fireflyframework.cache.serialization.CacheSerializer; -import org.fireflyframework.cache.serialization.JsonCacheSerializer; +import org.fireflyframework.cache.serialization.JsonCacheSerializerImpl; import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory; import org.springframework.data.redis.core.ReactiveRedisTemplate; import org.springframework.data.redis.serializer.GenericJackson2JsonRedisSerializer; @@ -63,7 +63,7 @@ public static CacheAdapter createRedisCacheAdapter( } CacheProperties.RedisConfig redisProps = properties.getRedis(); - CacheSerializer serializer = new JsonCacheSerializer(objectMapper); + CacheSerializer serializer = new JsonCacheSerializerImpl(objectMapper); // Create Redis template with custom key prefix StringRedisSerializer stringSerializer = new StringRedisSerializer(); @@ -96,6 +96,6 @@ public static CacheAdapter createRedisCacheAdapter( .ssl(redisProps.isSsl()) .build(); - return new RedisCacheAdapter(cacheName, redisTemplate, redisConnectionFactory, config, serializer); + return new RedisCacheAdapterImpl(cacheName, redisTemplate, redisConnectionFactory, config, serializer); } } diff --git a/modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProvider.java b/modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProviderImpl.java similarity index 97% rename from modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProvider.java rename to modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProviderImpl.java index cf5952e5e..e338422df 100644 --- a/modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProvider.java +++ b/modules/cache-redis/src/main/java/org/fireflyframework/cache/spi/providers/RedisProviderImpl.java @@ -24,7 +24,7 @@ import java.time.Duration; -public class RedisProvider implements CacheProviderFactory { +public class RedisProviderImpl implements CacheProviderFactory { @Override public CacheType getType() { return CacheType.REDIS; } @Override public int priority() { return 10; } diff --git a/modules/cache-redis/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory b/modules/cache-redis/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory index f3339ed06..cfe63ca3e 100644 --- a/modules/cache-redis/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory +++ b/modules/cache-redis/src/main/resources/META-INF/services/org.fireflyframework.cache.spi.CacheProviderFactory @@ -1 +1 @@ -org.fireflyframework.cache.spi.providers.RedisProvider +org.fireflyframework.cache.spi.providers.RedisProviderImpl diff --git a/modules/cache-redis/src/test/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterIntegrationTest.java b/modules/cache-redis/src/test/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterIntegrationTest.java index d22bcc4d6..194b496c3 100644 --- a/modules/cache-redis/src/test/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterIntegrationTest.java +++ b/modules/cache-redis/src/test/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterIntegrationTest.java @@ -21,7 +21,7 @@ import org.fireflyframework.cache.core.CacheHealth; import org.fireflyframework.cache.core.CacheStats; import org.fireflyframework.cache.core.CacheType; -import org.fireflyframework.cache.serialization.JsonCacheSerializer; +import org.fireflyframework.cache.serialization.JsonCacheSerializerImpl; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -59,10 +59,10 @@ class RedisCacheAdapterIntegrationTest { .withExposedPorts(6379) .withReuse(true); - private RedisCacheAdapter cacheAdapter; + private RedisCacheAdapterImpl cacheAdapter; private ReactiveRedisTemplate redisTemplate; private ReactiveRedisConnectionFactory connectionFactory; - private JsonCacheSerializer serializer; + private JsonCacheSerializerImpl serializer; @BeforeEach void setUp() { @@ -96,7 +96,7 @@ void setUp() { redisTemplate = new ReactiveRedisTemplate<>(connectionFactory, serializationContext); // Create cache serializer - serializer = new JsonCacheSerializer(objectMapper); + serializer = new JsonCacheSerializerImpl(objectMapper); // Create cache config RedisCacheConfig config = RedisCacheConfig.builder() @@ -110,7 +110,7 @@ void setUp() { .build(); // Create cache adapter - cacheAdapter = new RedisCacheAdapter("test-cache", redisTemplate, connectionFactory, config, serializer); + cacheAdapter = new RedisCacheAdapterImpl("test-cache", redisTemplate, connectionFactory, config, serializer); // Clear any existing data redisTemplate.getConnectionFactory() diff --git a/modules/cache-redis/src/test/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterLoggingTest.java b/modules/cache-redis/src/test/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterLoggingTest.java index b9c1c9beb..e21638838 100644 --- a/modules/cache-redis/src/test/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterLoggingTest.java +++ b/modules/cache-redis/src/test/java/org/fireflyframework/cache/adapter/redis/RedisCacheAdapterLoggingTest.java @@ -31,7 +31,7 @@ class RedisCacheAdapterLoggingTest { private static final String NAME = "cache\r\nregion\u000bvertical\fform\u0085next\u2028line\u2029paragraph"; - private final Logger logger = (Logger) LoggerFactory.getLogger(RedisCacheAdapter.class); + private final Logger logger = (Logger) LoggerFactory.getLogger(RedisCacheAdapterImpl.class); private final ListAppender events = new ListAppender<>(); private Level previousLevel; private boolean previousAdditive; @@ -56,13 +56,13 @@ private static final class Key { @Override public String toString() { renders++; return "PRIVATE_KEY\r\nforged\u2028entry"; } } - private record Fixture(RedisCacheAdapter adapter, org.springframework.data.redis.core.ReactiveValueOperations values, org.fireflyframework.cache.serialization.CacheSerializer serializer) { } + private record Fixture(RedisCacheAdapterImpl adapter, org.springframework.data.redis.core.ReactiveValueOperations values, org.fireflyframework.cache.serialization.CacheSerializer serializer) { } @SuppressWarnings("unchecked") private Fixture fixture() { var template = mock(org.springframework.data.redis.core.ReactiveRedisTemplate.class); var values = mock(org.springframework.data.redis.core.ReactiveValueOperations.class); var serializer = mock(org.fireflyframework.cache.serialization.CacheSerializer.class); when(template.opsForValue()).thenReturn(values); - return new Fixture(new RedisCacheAdapter(NAME, template, mock(org.springframework.data.redis.connection.ReactiveRedisConnectionFactory.class), RedisCacheConfig.builder().build(), serializer), values, serializer); + return new Fixture(new RedisCacheAdapterImpl(NAME, template, mock(org.springframework.data.redis.connection.ReactiveRedisConnectionFactory.class), RedisCacheConfig.builder().build(), serializer), values, serializer); } @Test void bothReadOverloadsKeepHitsWithoutExtraKeyRendering() { for (boolean typed : new boolean[]{false,true}) { diff --git a/modules/cache-redis/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationRedisIntegrationTest.java b/modules/cache-redis/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationRedisIntegrationTest.java index ead4b3750..5b970dbe6 100644 --- a/modules/cache-redis/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationRedisIntegrationTest.java +++ b/modules/cache-redis/src/test/java/org/fireflyframework/cache/config/CacheAutoConfigurationRedisIntegrationTest.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.fireflyframework.cache.properties.CacheProperties; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -58,7 +58,7 @@ void shouldCreateRedisBeansWhenRedisIsConfigured() { .run(context -> { // Verify core beans exist assertThat(context).hasSingleBean(CacheProperties.class); - assertThat(context).hasSingleBean(FireflyCacheManager.class); + assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class); // Verify Redis-specific beans assertThat(context).hasSingleBean(ReactiveRedisConnectionFactory.class); @@ -84,7 +84,7 @@ void shouldUseExplicitCaffeineWithoutRedisConfiguration() { ) .run(context -> { assertThat(context).hasSingleBean(CacheProperties.class); - assertThat(context).hasSingleBean(FireflyCacheManager.class); + assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class); // Should not create Redis beans without configuration assertThat(context).doesNotHaveBean(ReactiveRedisConnectionFactory.class); @@ -92,7 +92,7 @@ void shouldUseExplicitCaffeineWithoutRedisConfiguration() { CacheProperties properties = context.getBean(CacheProperties.class); assertThat(properties.getDefaultCacheType()).isEqualTo(CacheType.CAFFEINE); - assertThat(context.getBean(FireflyCacheManager.class).getCacheType()).isEqualTo(CacheType.CAFFEINE); + assertThat(context.getBean(FireflyCacheManagerImpl.class).getCacheType()).isEqualTo(CacheType.CAFFEINE); }); } @@ -109,14 +109,14 @@ void shouldCreateBothCaffeineAndRedisWhenBothEnabled() { ) .run(context -> { assertThat(context).hasSingleBean(CacheProperties.class); - assertThat(context).hasSingleBean(FireflyCacheManager.class); + assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class); // Should have both Caffeine and Redis components assertThat(context).hasSingleBean(ReactiveRedisConnectionFactory.class); assertThat(context).hasSingleBean(ReactiveRedisTemplate.class); // Verify cache manager has adapters (indirectly) - FireflyCacheManager cacheManager = context.getBean(FireflyCacheManager.class); + FireflyCacheManagerImpl cacheManager = context.getBean(FireflyCacheManagerImpl.class); assertThat(cacheManager).isNotNull(); }); } @@ -139,7 +139,7 @@ void shouldRespectRedisConfigurationProperties() { CacheProperties properties = context.getBean(CacheProperties.class); CacheProperties.RedisConfig redisConfig = properties.getRedis(); - assertThat(context.getBean(FireflyCacheManager.class).getCacheType()).isEqualTo(CacheType.REDIS); + assertThat(context.getBean(FireflyCacheManagerImpl.class).getCacheType()).isEqualTo(CacheType.REDIS); assertThat(redisConfig.getHost()).isEqualTo(redisContainer.getHost()); assertThat(redisConfig.getPort()).isEqualTo(redisContainer.getMappedPort(6379)); assertThat(redisConfig.getDatabase()).isEqualTo(2); @@ -161,8 +161,8 @@ void shouldNotCreateRedisBeansWhenRedisDisabled() { ) .run(context -> { assertThat(context).hasSingleBean(CacheProperties.class); - assertThat(context).hasSingleBean(FireflyCacheManager.class); - assertThat(context.getBean(FireflyCacheManager.class).getCacheType()).isEqualTo(CacheType.CAFFEINE); + assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class); + assertThat(context.getBean(FireflyCacheManagerImpl.class).getCacheType()).isEqualTo(CacheType.CAFFEINE); // Should not create Redis beans when disabled assertThat(context).doesNotHaveBean(ReactiveRedisConnectionFactory.class); diff --git a/modules/cache/README.md b/modules/cache/README.md index 7d2146c7a..7e0211956 100644 --- a/modules/cache/README.md +++ b/modules/cache/README.md @@ -4,7 +4,7 @@ Use a common cache API with a PostgreSQL default and explicit local or distributed providers. -Depend on the core abstraction, inject FireflyCacheManager or use CacheAdapter, and choose a provider through firefly.cache. Provider discovery and selection live in the core; add only the external provider library you need. +Depend on the core abstraction, inject FireflyCacheManagerImpl or use CacheAdapter, and choose a provider through firefly.cache. Provider discovery and selection live in the core; add only the external provider library you need. For an explicitly selected primary without L1/fallback and with operation failures propagated, see [Primary-only operations](docs/PRIMARY_ONLY_OPERATIONS.md). This opt-in source addition preserves legacy defaults and requires a matching qualified framework release. @@ -32,20 +32,20 @@ The injection examples use Lombok `@RequiredArgsConstructor`. Add its provided d The Java examples in this section are API fragments for application code. Use the stated imports and supply the application-owned collaborators described alongside them. -With the dependency on the classpath, `CacheAutoConfiguration` provides a primary `FireflyCacheManager` (PostgreSQL by default, with the PostgreSQL adapter and configuration). This application-owned API class caches onboarding status values; it does not connect itself to the tutorial repository. Compose each returned `Mono`, and evict the cached value when the authoritative status changes: +With the dependency on the classpath, `CacheAutoConfiguration` provides a primary `FireflyCacheManagerImpl` (PostgreSQL by default, with the PostgreSQL adapter and configuration). This application-owned API class caches onboarding status values; it does not connect itself to the tutorial repository. Compose each returned `Mono`, and evict the cached value when the authoritative status changes: ```java import lombok.RequiredArgsConstructor; import java.time.Duration; import java.util.Optional; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.springframework.stereotype.Service; import reactor.core.publisher.Mono; @Service @RequiredArgsConstructor public class ApplicationStatusCache { - private final FireflyCacheManager cache; + private final FireflyCacheManagerImpl cache; @@ -68,9 +68,9 @@ Need a dedicated, namespaced cache (separate key prefix, TTL and provider)? Inje ```java import org.fireflyframework.cache.core.CacheType; import org.fireflyframework.cache.factory.CacheManagerFactory; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; -FireflyCacheManager idempotencyCache = factory.createCacheManager( +FireflyCacheManagerImpl idempotencyCache = factory.createCacheManager( "http-idempotency", CacheType.AUTO, // Configured PostgreSQL first, then available providers "firefly:http:idempotency", @@ -103,7 +103,7 @@ The built-in application-config and HTTP-idempotency cache factories also honor | Type | Contract and responsibility | | --- | --- | -| [`FireflyCacheManager`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManager.java) | Unified cache manager that provides a single cache interface. | +| [`FireflyCacheManagerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache/src/main/java/org/fireflyframework/cache/manager/FireflyCacheManagerImpl.java) | Unified cache manager that provides a single cache interface. | | [`CacheAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache/src/main/java/org/fireflyframework/cache/core/CacheAdapter.java) | Unified interface for cache operations across different cache providers. | | [`CacheProviderFactory`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache/src/main/java/org/fireflyframework/cache/spi/CacheProviderFactory.java) | Service Provider Interface for creating cache adapters. | | [`CacheProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/cache/src/main/java/org/fireflyframework/cache/properties/CacheProperties.java) | Configuration properties for the Cache library. | diff --git a/modules/cache/docs/API_REFERENCE.md b/modules/cache/docs/API_REFERENCE.md index 5b7a626ef..f4addcb07 100644 --- a/modules/cache/docs/API_REFERENCE.md +++ b/modules/cache/docs/API_REFERENCE.md @@ -4,24 +4,24 @@ Complete API reference for the Firefly Common Cache Library. ## Table of Contents -- [FireflyCacheManager](#fireflycachemanager) +- [FireflyCacheManagerImpl](#fireflycachemanager) - [CacheAdapter](#cacheadapter) - [Annotations](#annotations) - [Configuration Classes](#configuration-classes) - [Health and Statistics](#health-and-statistics) - [Exceptions](#exceptions) -## FireflyCacheManager +## FireflyCacheManagerImpl -Package: `org.fireflyframework.cache.manager.FireflyCacheManager` +Package: `org.fireflyframework.cache.manager.FireflyCacheManagerImpl` The main entry point for cache operations. Manages multiple cache instances and provides a unified API. ### Constructor ```java -public FireflyCacheManager() -public FireflyCacheManager(CacheSelectionStrategy selectionStrategy, String defaultCacheName) +public FireflyCacheManagerImpl() +public FireflyCacheManagerImpl(CacheSelectionStrategy selectionStrategy, String defaultCacheName) ``` ### Cache Operations (Default Cache) @@ -198,7 +198,7 @@ Parameters: Example: ```java -CaffeineCacheAdapter adapter = new CaffeineCacheAdapter("my-cache", config); +CaffeineCacheAdapterImpl adapter = new CaffeineCacheAdapterImpl("my-cache", config); cacheManager.registerCache("my-cache", adapter); ``` @@ -359,8 +359,8 @@ void close() ### Implementations -- CaffeineCacheAdapter: In-memory cache using Caffeine -- RedisCacheAdapter: Distributed cache using Redis +- CaffeineCacheAdapterImpl: In-memory cache using Caffeine +- RedisCacheAdapterImpl: Distributed cache using Redis ## Annotations diff --git a/modules/cache/docs/ARCHITECTURE.md b/modules/cache/docs/ARCHITECTURE.md index 58f3fb969..2090ab61a 100644 --- a/modules/cache/docs/ARCHITECTURE.md +++ b/modules/cache/docs/ARCHITECTURE.md @@ -8,7 +8,7 @@ This document explains the simplified architecture of the Firefly Common Cache l The library follows these key principles: -1. Simplicity First: `FireflyCacheManager` IS the cache instance (no Spring Cache abstraction required) +1. Simplicity First: `FireflyCacheManagerImpl` IS the cache instance (no Spring Cache abstraction required) 2. Multiple Isolated Caches: Create as many independent caches as you need via `CacheManagerFactory` 3. Automatic Fallback: Built-in support for primary/fallback pattern (e.g., Redis → Caffeine) 4. Hexagonal Architecture: Clean separation between public API and internal adapters @@ -21,7 +21,7 @@ The library follows these key principles: │ Application Layer │ │ │ │ ┌────────────────────────────────────────────────────────┐ │ -│ │ FireflyCacheManager (implements CacheAdapter) │ │ +│ │ FireflyCacheManagerImpl (implements CacheAdapter) │ │ │ │ │ │ │ │ • Direct cache operations (get, put, evict, etc.) │ │ │ │ • Automatic fallback support │ │ @@ -50,7 +50,7 @@ The library follows these key principles: ## Hexagonal Architecture (Ports and Adapters) ### Public API (Application Layer) -- `FireflyCacheManager`: Cache instance API (manager implements cache) +- `FireflyCacheManagerImpl`: Cache instance API (manager implements cache) - Implements `CacheAdapter` directly - One bean per logical cache in your app (e.g., default, http-idempotency, rule-engine, webhooks) - Delegates to primary cache with optional fallback @@ -63,8 +63,8 @@ The library follows these key principles: - Not exposed to application code ### Adapters (Infrastructure Layer) -- `CaffeineCacheAdapter`: High-performance in-memory cache (always available) -- `RedisCacheAdapter`: Distributed cache with persistence (optional) +- `CaffeineCacheAdapterImpl`: High-performance in-memory cache (always available) +- `RedisCacheAdapterImpl`: Distributed cache with persistence (optional) - `Hazelcast`/`JCache` adapters: Optional providers discovered via SPI - `NoOpCacheAdapter`: Disabled cache for testing @@ -75,18 +75,18 @@ Smart L1+L2 cache - Reads hit L1; on L1 miss, read from L2 and optionally backfill L1; writes update both. - Benefits: low latency, fewer network trips, consistent keys, safe isolation per cache name/prefix. -The main entry point is the `FireflyCacheManager` class: +The main entry point is the `FireflyCacheManagerImpl` class: ```java package org.fireflyframework.cache.manager; -public class FireflyCacheManager implements CacheAdapter { +public class FireflyCacheManagerImpl implements CacheAdapter { // Constructor with primary cache only - public FireflyCacheManager(CacheAdapter primaryCache); + public FireflyCacheManagerImpl(CacheAdapter primaryCache); // Constructor with primary and fallback caches - public FireflyCacheManager(CacheAdapter primaryCache, CacheAdapter fallbackCache); + public FireflyCacheManagerImpl(CacheAdapter primaryCache, CacheAdapter fallbackCache); // Cache operations (from CacheAdapter interface) Mono> get(K key); @@ -158,19 +158,19 @@ For Caffeine + Redis (distributed cache): ``` -### 2. Inject FireflyCacheManager +### 2. Inject FireflyCacheManagerImpl ```java -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.springframework.stereotype.Service; import reactor.core.publisher.Mono; @Service public class MyService { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; - public MyService(FireflyCacheManager cacheManager) { + public MyService(FireflyCacheManagerImpl cacheManager) { this.cacheManager = cacheManager; } @@ -199,7 +199,7 @@ public class MyService { If you want to enable features only when the cache is available: ```java -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -208,14 +208,14 @@ import org.springframework.context.annotation.Configuration; public class MyConfiguration { @Bean - @ConditionalOnBean(FireflyCacheManager.class) - public MyCachedService myCachedService(FireflyCacheManager cacheManager) { + @ConditionalOnBean(FireflyCacheManagerImpl.class) + public MyCachedService myCachedService(FireflyCacheManagerImpl cacheManager) { return new MyCachedService(cacheManager); } } ``` -Important: Always use `org.fireflyframework.cache.manager.FireflyCacheManager` (the concrete class) in `@ConditionalOnBean`. +Important: Always use `org.fireflyframework.cache.manager.FireflyCacheManagerImpl` (the concrete class) in `@ConditionalOnBean`. ## Auto-Configuration @@ -225,7 +225,7 @@ The library provides two auto-configuration classes: - Package: `org.fireflyframework.cache.config` - Provides: - `CacheManagerFactory` bean (to create named cache instances) - - `FireflyCacheManager` default bean (primary cache instance) + - `FireflyCacheManagerImpl` default bean (primary cache instance) - `CacheSerializer` bean (JSON serialization) ### 2. RedisCacheAutoConfiguration (Conditionally Loaded) @@ -248,7 +248,7 @@ fireflyframework-cache exposes an SPI so new providers can be plugged in without ```java @Bean @Primary -public FireflyCacheManager fireflyCacheManager( +public FireflyCacheManagerImpl fireflyCacheManager( CacheProperties properties, List cacheAdapters) { @@ -258,7 +258,7 @@ public FireflyCacheManager fireflyCacheManager( // Optional fallback cache CacheAdapter fallback = selectFallbackCache(properties, cacheAdapters, primary); - return new FireflyCacheManager(primary, fallback); + return new FireflyCacheManagerImpl(primary, fallback); } ``` @@ -297,16 +297,16 @@ firefly: ```java // Always use the full package name for clarity -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; // Inject the concrete class @Autowired -private FireflyCacheManager cacheManager; +private FireflyCacheManagerImpl cacheManager; // Use in @ConditionalOnBean @Bean -@ConditionalOnBean(FireflyCacheManager.class) -public MyService myService(FireflyCacheManager cacheManager) { +@ConditionalOnBean(FireflyCacheManagerImpl.class) +public MyService myService(FireflyCacheManagerImpl cacheManager) { return new MyService(cacheManager); } ``` @@ -321,7 +321,7 @@ public MyService myService(FireflyCacheManager cacheManager) { - Clear ownership via bean names and key prefixes 2. Direct Implementation of CacheAdapter - - `FireflyCacheManager` implements `CacheAdapter` directly + - `FireflyCacheManagerImpl` implements `CacheAdapter` directly - No need for `selectCache()` or `getCache()` methods - Direct method calls: `cacheManager.get()`, `cacheManager.put()` @@ -357,8 +357,8 @@ void testCacheManager() { .maximumSize(100L) .build(); - CacheAdapter primaryCache = new CaffeineCacheAdapter("test", config); - FireflyCacheManager manager = new FireflyCacheManager(primaryCache); + CacheAdapter primaryCache = new CaffeineCacheAdapterImpl("test", config); + FireflyCacheManagerImpl manager = new FireflyCacheManagerImpl(primaryCache); // Direct usage - manager IS the cache manager.put("key", "value").block(); @@ -380,7 +380,7 @@ void testCacheManager() { class MyIntegrationTest { @Autowired - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @Test void testCacheIsAvailable() { @@ -404,14 +404,14 @@ class MyIntegrationTest { 1. Always use the full package name ```java - import org.fireflyframework.cache.manager.FireflyCacheManager; + import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; ``` 2. Use `@ConditionalOnBean` for optional features ```java @Bean - @ConditionalOnBean(FireflyCacheManager.class) - public MyService myService(FireflyCacheManager cacheManager) { + @ConditionalOnBean(FireflyCacheManagerImpl.class) + public MyService myService(FireflyCacheManagerImpl cacheManager) { return new MyService(cacheManager); } ``` @@ -433,7 +433,7 @@ class MyIntegrationTest { ## Summary -- ✅ Public API: `org.fireflyframework.cache.manager.FireflyCacheManager` +- ✅ Public API: `org.fireflyframework.cache.manager.FireflyCacheManagerImpl` - ✅ Internal API: `org.fireflyframework.cache.core.CacheAdapter` - ✅ Single cache instance: One cache per application - ✅ Automatic fallback: Primary/fallback pattern built-in @@ -441,7 +441,7 @@ class MyIntegrationTest { - ✅ Redis is optional: Works without Redis dependencies - ✅ Auto-configuration: Automatically sets up based on classpath - ✅ Reactive API: Non-blocking operations with Project Reactor -- ✅ Bean matching: Use `FireflyCacheManager.class` in conditions +- ✅ Bean matching: Use `FireflyCacheManagerImpl.class` in conditions - ✅ Clean architecture: Clear separation of concerns For more information, see: diff --git a/modules/cache/docs/AUTO_CONFIGURATION.md b/modules/cache/docs/AUTO_CONFIGURATION.md index 4591112f4..f8a00f1a0 100644 --- a/modules/cache/docs/AUTO_CONFIGURATION.md +++ b/modules/cache/docs/AUTO_CONFIGURATION.md @@ -43,7 +43,7 @@ When you add the library as a dependency, Spring Boot automatically configures: 2. ObjectMapper - JSON serialization (if not already present) 3. CacheSerializer - Cache value serialization 4. CacheManagerFactory - Factory to create multiple independent caches -5. FireflyCacheManager (default) - Primary default cache instance +5. FireflyCacheManagerImpl (default) - Primary default cache instance 6. Redis infrastructure - Connection factory and template (if Redis is configured) ### Activation Conditions @@ -212,7 +212,7 @@ Register additional caches programmatically: public class AdditionalCachesConfig { @Bean - public ApplicationRunner registerAdditionalCaches(FireflyCacheManager cacheManager) { + public ApplicationRunner registerAdditionalCaches(FireflyCacheManagerImpl cacheManager) { return args -> { // Create and register a custom cache CaffeineCacheConfig config = CaffeineCacheConfig.builder() @@ -220,7 +220,7 @@ public class AdditionalCachesConfig { .expireAfterWrite(Duration.ofMinutes(30)) .build(); - CaffeineCacheAdapter adapter = new CaffeineCacheAdapter("custom-cache", config); + CaffeineCacheAdapterImpl adapter = new CaffeineCacheAdapterImpl("custom-cache", config); cacheManager.registerCache("custom-cache", adapter); }; } @@ -237,7 +237,7 @@ void shouldAutoConfigureWithDefaults() { new ApplicationContextRunner() .withConfiguration(AutoConfigurations.of(CacheAutoConfiguration.class)) .run(context -> { - assertThat(context).hasSingleBean(FireflyCacheManager.class); + assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class); assertThat(context).hasSingleBean(CacheProperties.class); }); } @@ -254,7 +254,7 @@ void shouldAutoConfigureWithDefaults() { class CacheIntegrationTest { @Autowired - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @Test void shouldAutoWireCacheManager() { @@ -271,7 +271,7 @@ class CacheIntegrationTest { class DisabledCacheTest { @Autowired(required = false) - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @Test void shouldNotAutoConfigureWhenDisabled() { @@ -351,7 +351,7 @@ firefly: ### Cache Not Auto-Configuring -Problem: FireflyCacheManager bean not found +Problem: FireflyCacheManagerImpl bean not found Solutions: 1. Check that `firefly.cache.enabled` is not set to `false` diff --git a/modules/cache/docs/EXAMPLES.md b/modules/cache/docs/EXAMPLES.md index b32da9b7d..c1fd6d6d2 100644 --- a/modules/cache/docs/EXAMPLES.md +++ b/modules/cache/docs/EXAMPLES.md @@ -24,7 +24,7 @@ Practical examples and common use cases for the Firefly Common Cache Library. @RequiredArgsConstructor public class BasicCacheExample { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; public Mono getValue(String key) { return cacheManager.get(key, String.class) @@ -61,11 +61,11 @@ Complete example of caching user data. @Slf4j public class UserService { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private final UserRepository userRepository; @Qualifier("userCacheManager") -private final FireflyCacheManager userCacheManager; // dedicated cache manager for users +private final FireflyCacheManagerImpl userCacheManager; // dedicated cache manager for users private static final Duration USER_TTL = Duration.ofMinutes(30); /** @@ -157,7 +157,7 @@ Caching product information with different TTLs. @Slf4j public class ProductService { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private final ProductRepository productRepository; private static final String PRODUCT_CACHE = "products"; @@ -239,7 +239,7 @@ Using cache for session storage. @RequiredArgsConstructor public class SessionService { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private static final String SESSION_CACHE = "sessions"; private static final Duration SESSION_TTL = Duration.ofMinutes(30); @@ -309,7 +309,7 @@ Implementing rate limiting with cache. @Slf4j public class RateLimiter { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private static final String RATE_LIMIT_CACHE = "rate-limits"; private static final int MAX_REQUESTS = 100; @@ -373,7 +373,7 @@ The most common caching pattern. @RequiredArgsConstructor public class CacheAsideExample { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private final DataRepository repository; /** @@ -411,7 +411,7 @@ Update cache and database together. @RequiredArgsConstructor public class WriteThroughExample { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private final DataRepository repository; /** @@ -441,7 +441,7 @@ Pre-populate cache on startup. @Slf4j public class CacheWarmer { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private final ProductRepository productRepository; @EventListener(ApplicationReadyEvent.class) @@ -469,7 +469,7 @@ Using multiple caches for different data types. @RequiredArgsConstructor public class MultiLevelCacheExample { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; /** * Use different caches for different data @@ -519,7 +519,7 @@ Graceful error handling with caching. @Slf4j public class ErrorHandlingExample { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private final ExternalApiClient apiClient; /** diff --git a/modules/cache/docs/MONITORING.md b/modules/cache/docs/MONITORING.md index ec1c8e733..cce56cfee 100644 --- a/modules/cache/docs/MONITORING.md +++ b/modules/cache/docs/MONITORING.md @@ -91,7 +91,7 @@ curl http://localhost:8080/actuator/health/cache @RequiredArgsConstructor public class CacheHealthMonitor { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; /** * Check health of all caches @@ -221,7 +221,7 @@ Response: @Slf4j public class CacheStatsService { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; /** * Get statistics for all caches @@ -290,7 +290,7 @@ public class CacheStats { @Slf4j public class CacheStatsMonitor { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; @Scheduled(fixedRate = 60000) // Every minute public void logCacheStats() { @@ -414,7 +414,7 @@ public class CacheLoggingExample { @RequiredArgsConstructor public class HitRateAlert { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private final AlertService alertService; @Scheduled(fixedRate = 300000) // Every 5 minutes @@ -440,7 +440,7 @@ public class HitRateAlert { @RequiredArgsConstructor public class CacheAvailabilityAlert { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private final AlertService alertService; @Scheduled(fixedRate = 60000) // Every minute @@ -538,7 +538,7 @@ rate(cache_get_duration_count[5m]) @RequiredArgsConstructor public class CacheMonitoringController { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; @GetMapping("/dashboard") public Mono getDashboard() { diff --git a/modules/cache/docs/OPTIONAL_DEPENDENCIES.md b/modules/cache/docs/OPTIONAL_DEPENDENCIES.md index 2e78d28ec..be79f9122 100644 --- a/modules/cache/docs/OPTIONAL_DEPENDENCIES.md +++ b/modules/cache/docs/OPTIONAL_DEPENDENCIES.md @@ -186,7 +186,7 @@ void shouldStartWithoutRedis() { contextRunner.run(context -> { assertThat(context).hasNotFailed(); - assertThat(context).hasSingleBean(FireflyCacheManager.class); + assertThat(context).hasSingleBean(FireflyCacheManagerImpl.class); assertThat(context).hasSingleBean(CacheAdapter.class); }); } diff --git a/modules/cache/docs/PRIMARY_ONLY_OPERATIONS.md b/modules/cache/docs/PRIMARY_ONLY_OPERATIONS.md index 19e50aff3..c96959a69 100644 --- a/modules/cache/docs/PRIMARY_ONLY_OPERATIONS.md +++ b/modules/cache/docs/PRIMARY_ONLY_OPERATIONS.md @@ -21,7 +21,7 @@ var cache = factory.createCacheManager( This construction selects exactly one explicit provider. AUTO and NOOP refuse. Smart/L1 and fallback settings are not applied to this instance, even if globally enabled. No operation selects a different provider based on isAvailable/getHealth. Capability comes from the provider's explicit policy-aware construction contract; a cache type or health response cannot prove it. Provider construction failures propagate instead of falling back. -PostgreSQL is the recommended and first supported built-in provider. Caffeine, Redis, Hazelcast and JCache remain explicit unsupported choices for this policy until their provider implementations opt in and are qualified. Their legacy operation behavior is unchanged. Old third-party providers inherit a default refusal for the new policy; they must implement it deliberately. A policy-configured adapter without a policy-configured manager is insufficient: old FireflyCacheManager constructors still select LEGACY. Prefer the policy-aware factory overload. +PostgreSQL is the recommended and first supported built-in provider. Caffeine, Redis, Hazelcast and JCache remain explicit unsupported choices for this policy until their provider implementations opt in and are qualified. Their legacy operation behavior is unchanged. Old third-party providers inherit a default refusal for the new policy; they must implement it deliberately. A policy-configured adapter without a policy-configured manager is insufficient: old FireflyCacheManagerImpl constructors still select LEGACY. Prefer the policy-aware factory overload. ## Observe operations honestly diff --git a/modules/cache/docs/QUICKSTART.md b/modules/cache/docs/QUICKSTART.md index 479c94fd1..280f244d7 100644 --- a/modules/cache/docs/QUICKSTART.md +++ b/modules/cache/docs/QUICKSTART.md @@ -8,7 +8,7 @@ Cache repeated application-status reads after defining expiry and invalidation. ## Choose the integration -Inject `FireflyCacheManager` for the configured cache. The default is local Caffeine; add a provider adapter and its deployment settings when instances need shared state. A cache hit is returned as an `Optional` inside a `Mono`, so a missing key must be handled explicitly. +Inject `FireflyCacheManagerImpl` for the configured cache. The default is local Caffeine; add a provider adapter and its deployment settings when instances need shared state. A cache hit is returned as an `Optional` inside a `Mono`, so a missing key must be handled explicitly. ### Cache a status value @@ -18,14 +18,14 @@ This API class needs the cache dependency and Spring wiring. Call `evict` when t import lombok.RequiredArgsConstructor; import java.time.Duration; import java.util.Optional; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.springframework.stereotype.Service; import reactor.core.publisher.Mono; @Service @RequiredArgsConstructor public class ApplicationStatusCache { - private final FireflyCacheManager cache; + private final FireflyCacheManagerImpl cache; diff --git a/modules/cache/docs/README.md b/modules/cache/docs/README.md index f17749c7d..5525fa51d 100644 --- a/modules/cache/docs/README.md +++ b/modules/cache/docs/README.md @@ -37,7 +37,7 @@ Welcome to the Firefly Common Cache Library documentation! This directory contai - Best practices - [API Reference](API_REFERENCE.md) - Detailed API documentation - - FireflyCacheManager API + - FireflyCacheManagerImpl API - CacheAdapter interface - Annotations (@Cacheable, @CacheEvict, @CachePut) - Configuration classes diff --git a/modules/cache/docs/TESTING.md b/modules/cache/docs/TESTING.md index 8574fcf3f..5bb718866 100644 --- a/modules/cache/docs/TESTING.md +++ b/modules/cache/docs/TESTING.md @@ -24,14 +24,14 @@ The Firefly Common Cache Library is designed to be testable. This guide covers: ## Unit Testing -### Testing with Mocked FireflyCacheManager +### Testing with Mocked FireflyCacheManagerImpl ```java @ExtendWith(MockitoExtension.class) class UserServiceTest { @Mock - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @Mock private UserRepository userRepository; @@ -108,7 +108,7 @@ class UserServiceTest { class CacheOperationsTest { @Mock - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @Test void shouldPutAndGetValue() { @@ -164,7 +164,7 @@ class CacheOperationsTest { class CacheIntegrationTest { @Autowired - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @Test void shouldCacheAndRetrieveValues() { @@ -243,7 +243,7 @@ class CacheIntegrationTest { class CaffeineCacheTest { @Autowired - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @Test void shouldHandleComplexObjects() { @@ -322,7 +322,7 @@ class RedisCacheIntegrationTest { } @Autowired - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @Test void shouldCacheInRedis() { @@ -410,12 +410,12 @@ class CustomCacheAdapterTest { class CacheSpyTest { @Autowired - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @Test void shouldVerifyCacheInteractions() { // Given - FireflyCacheManager spyManager = spy(cacheManager); + FireflyCacheManagerImpl spyManager = spy(cacheManager); String key = "spy-test-key"; String value = "spy-test-value"; @@ -467,16 +467,16 @@ public class CacheTestConfig { @Bean @Primary - public FireflyCacheManager testCacheManager() { + public FireflyCacheManagerImpl testCacheManager() { CaffeineCacheConfig config = CaffeineCacheConfig.builder() .maximumSize(10L) .expireAfterWrite(Duration.ofSeconds(30)) .recordStats(true) .build(); - CaffeineCacheAdapter adapter = new CaffeineCacheAdapter("test-cache", config); + CaffeineCacheAdapterImpl adapter = new CaffeineCacheAdapterImpl("test-cache", config); - FireflyCacheManager manager = new FireflyCacheManager(); + FireflyCacheManagerImpl manager = new FireflyCacheManagerImpl(); manager.registerCache("default", adapter); return manager; @@ -492,7 +492,7 @@ public class CacheTestConfig { class ServiceWithTestCacheTest { @Autowired - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @Autowired private UserService userService; @@ -514,14 +514,14 @@ class ServiceWithTestCacheTest { @ExtendWith(MockitoExtension.class) class UnitTest { @Mock - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; } // Integration test - use real cache @SpringBootTest class IntegrationTest { @Autowired - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; } ``` @@ -532,7 +532,7 @@ class IntegrationTest { class CleanupTest { @Autowired - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @AfterEach void cleanup() { diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapter.java b/modules/cache/src/main/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterImpl.java similarity index 99% rename from modules/cache/src/main/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapter.java rename to modules/cache/src/main/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterImpl.java index d9f5b07bc..370e8f520 100644 --- a/modules/cache/src/main/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapter.java +++ b/modules/cache/src/main/java/org/fireflyframework/cache/adapter/caffeine/CaffeineCacheAdapterImpl.java @@ -50,7 +50,7 @@ * */ @Slf4j -public class CaffeineCacheAdapter implements CacheAdapter { +public class CaffeineCacheAdapterImpl implements CacheAdapter { private final Cache cache; private final String cacheName; @@ -58,7 +58,7 @@ public class CaffeineCacheAdapter implements CacheAdapter { private final CaffeineCacheConfig config; private final ConcurrentHashMap expirationTimes; - public CaffeineCacheAdapter(String cacheName, CaffeineCacheConfig config) { + public CaffeineCacheAdapterImpl(String cacheName, CaffeineCacheConfig config) { this.cacheName = cacheName; this.keyPrefix = buildKeyPrefix(cacheName, config.getKeyPrefix()); this.config = config; diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapter.java b/modules/cache/src/main/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapterImpl.java similarity index 96% rename from modules/cache/src/main/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapter.java rename to modules/cache/src/main/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapterImpl.java index ede0a2c39..81602668b 100644 --- a/modules/cache/src/main/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapter.java +++ b/modules/cache/src/main/java/org/fireflyframework/cache/adapter/smart/SmartCacheAdapterImpl.java @@ -32,14 +32,14 @@ import java.util.Set; @Slf4j -public class SmartCacheAdapter implements CacheAdapter { +public class SmartCacheAdapterImpl implements CacheAdapter { private final CacheAdapter l1; // expected CAFFEINE private final CacheAdapter l2; // distributed (REDIS/HAZELCAST/JCACHE) private final String cacheName; private final Duration defaultTtl; // used for backfill private final boolean backfillOnRead; - public SmartCacheAdapter(String cacheName, CacheAdapter l1, CacheAdapter l2, Duration defaultTtl, boolean backfillOnRead) { + public SmartCacheAdapterImpl(String cacheName, CacheAdapter l1, CacheAdapter l2, Duration defaultTtl, boolean backfillOnRead) { this.cacheName = cacheName; this.l1 = l1; this.l2 = l2; diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/config/CacheAutoConfiguration.java b/modules/cache/src/main/java/org/fireflyframework/cache/config/CacheAutoConfiguration.java index 053f5c227..4620e49b9 100644 --- a/modules/cache/src/main/java/org/fireflyframework/cache/config/CacheAutoConfiguration.java +++ b/modules/cache/src/main/java/org/fireflyframework/cache/config/CacheAutoConfiguration.java @@ -18,13 +18,13 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -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.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.fireflyframework.cache.properties.CacheProperties; import org.fireflyframework.cache.serialization.CacheSerializer; -import org.fireflyframework.cache.serialization.JsonCacheSerializer; +import org.fireflyframework.cache.serialization.JsonCacheSerializerImpl; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -83,7 +83,7 @@ public ObjectMapper cacheObjectMapper() { @ConditionalOnMissingBean public CacheSerializer cacheSerializer(@Qualifier("cacheObjectMapper") ObjectMapper objectMapper) { log.debug("Creating JSON cache serializer"); - return new JsonCacheSerializer(objectMapper); + return new JsonCacheSerializerImpl(objectMapper); } /** @@ -163,7 +163,7 @@ public org.fireflyframework.cache.factory.CacheManagerFactory cacheManagerFactor @Bean @Primary @ConditionalOnMissingBean - public FireflyCacheManager fireflyCacheManager(org.fireflyframework.cache.factory.CacheManagerFactory factory) { + public FireflyCacheManagerImpl fireflyCacheManager(org.fireflyframework.cache.factory.CacheManagerFactory factory) { log.info("Creating default FireflyCacheManager"); return factory.createDefaultCacheManager("default"); } diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/factory/CacheManagerFactory.java b/modules/cache/src/main/java/org/fireflyframework/cache/factory/CacheManagerFactory.java index ae70c94c3..d5d60dbbb 100644 --- a/modules/cache/src/main/java/org/fireflyframework/cache/factory/CacheManagerFactory.java +++ b/modules/cache/src/main/java/org/fireflyframework/cache/factory/CacheManagerFactory.java @@ -17,12 +17,12 @@ package org.fireflyframework.cache.factory; 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; 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 lombok.extern.slf4j.Slf4j; @@ -171,7 +171,7 @@ private boolean checkJCacheAvailable() { /** * Creates a new cache manager with custom configuration. */ - public FireflyCacheManager createCacheManager(String cacheName, + public FireflyCacheManagerImpl createCacheManager(String cacheName, CacheType cacheType, String keyPrefix, Duration defaultTtl) { @@ -189,7 +189,7 @@ public FireflyCacheManager createCacheManager(String cacheName, * @param requestedBy the component/module requesting this cache (optional, will be auto-detected) * @return a configured FireflyCacheManager */ - public FireflyCacheManager createCacheManager(String cacheName, + public FireflyCacheManagerImpl createCacheManager(String cacheName, CacheType cacheType, String keyPrefix, Duration defaultTtl, @@ -261,7 +261,7 @@ public FireflyCacheManager createCacheManager(String cacheName, // If smart composite is enabled and we have L2 + L1, wrap as Smart if (resolvedType != CacheType.CAFFEINE && properties.getSmart().isEnabled() && properties.getCaffeine().isEnabled()) { CacheAdapter l1 = createCaffeineCacheAdapter(cacheName, keyPrefix, defaultTtl); - primaryCache = new org.fireflyframework.cache.adapter.smart.SmartCacheAdapter( + primaryCache = new org.fireflyframework.cache.adapter.smart.SmartCacheAdapterImpl( cacheName, l1, primaryCache, defaultTtl, properties.getSmart().isBackfillL1OnRead()); fallbackCache = null; // Smart includes both log.info("Cache '{}' created: SMART(L1+L2) over {} (TTL: {})", cacheName, resolvedType, defaultTtl); @@ -273,11 +273,11 @@ public FireflyCacheManager createCacheManager(String cacheName, log.info("Cache '{}' created: {} (TTL: {})", cacheName, resolvedType, defaultTtl); } - return new FireflyCacheManager(primaryCache, fallbackCache); + return new FireflyCacheManagerImpl(primaryCache, fallbackCache); } /** Creates an explicitly selected primary with an immutable operation policy. */ - public FireflyCacheManager createCacheManager(String cacheName, + public FireflyCacheManagerImpl createCacheManager(String cacheName, CacheType cacheType, String keyPrefix, Duration defaultTtl, @@ -306,7 +306,7 @@ public FireflyCacheManager createCacheManager(String cacheName, if (primary.getCacheType() != cacheType) { throw new IllegalStateException("The selected provider must construct the requested cache backend"); } - return new FireflyCacheManager(primary, null, policy); + return new FireflyCacheManagerImpl(primary, null, policy); } catch (RuntimeException | Error failure) { try { primary.close(); } catch (RuntimeException | Error cleanup) { if (cleanup != failure) failure.addSuppressed(cleanup); } @@ -353,7 +353,7 @@ private CacheAdapter createCaffeineCacheAdapter(String cacheName, String keyPref .softValues(caffeineProps.isSoftValues()) .build(); - return new CaffeineCacheAdapter(cacheName, config); + return new CaffeineCacheAdapterImpl(cacheName, config); } /** @@ -491,7 +491,7 @@ private CacheAdapter createJCacheAdapterViaReflection(String cacheName, String k } /** Creates a feature cache with global provider selection and caller-supplied identity and TTL. */ - public FireflyCacheManager createDefaultCacheManager(String cacheName, String keyPrefix, Duration defaultTtl, + public FireflyCacheManagerImpl createDefaultCacheManager(String cacheName, String keyPrefix, Duration defaultTtl, String description, String requestedBy) { return createCacheManager(cacheName, properties.getDefaultCacheType(), keyPrefix, defaultTtl, description, requestedBy); } @@ -502,7 +502,7 @@ public FireflyCacheManager createDefaultCacheManager(String cacheName, String ke * @param cacheName the name of the cache * @return a configured FireflyCacheManager */ - public FireflyCacheManager createDefaultCacheManager(String cacheName) { + public FireflyCacheManagerImpl createDefaultCacheManager(String cacheName) { CacheType cacheType = properties.getDefaultCacheType(); if (cacheType == CacheType.AUTO) { cacheType = selectBestProviderType(); diff --git a/modules/cache/src/main/java/org/fireflyframework/cache/manager/AutoCacheSelectionStrategy.java b/modules/cache/src/main/java/org/fireflyframework/cache/manager/AutoCacheSelectionStrategyImpl.java similarity index 98% rename from modules/cache/src/main/java/org/fireflyframework/cache/manager/AutoCacheSelectionStrategy.java rename to modules/cache/src/main/java/org/fireflyframework/cache/manager/AutoCacheSelectionStrategyImpl.java index 86af6d3a5..2aa930bae 100644 --- a/modules/cache/src/main/java/org/fireflyframework/cache/manager/AutoCacheSelectionStrategy.java +++ b/modules/cache/src/main/java/org/fireflyframework/cache/manager/AutoCacheSelectionStrategyImpl.java @@ -31,7 +31,7 @@ * Unavailable caches are filtered before provider priority is compared. */ @Slf4j -public class AutoCacheSelectionStrategy implements CacheSelectionStrategy { +public class AutoCacheSelectionStrategyImpl implements CacheSelectionStrategy { @Override public Optional selectCache(Collection 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 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> fetch = mock(FetchSpec.class); when(database.sql(any(Supplier.class))).thenAnswer(call -> { PreparedOperation statement = call.getArgument(0); @@ -55,7 +55,7 @@ private SpringDataPostgresOutboxWriter writer(Mono count) { }); when(execution.fetch()).thenReturn(fetch); when(fetch.rowsUpdated()).thenReturn(count); - return new SpringDataPostgresOutboxWriter(new R2dbcEntityTemplate(database, + return new SpringDataPostgresOutboxWriterImpl(new R2dbcEntityTemplate(database, new DefaultReactiveDataAccessStrategy(PostgresDialect.INSTANCE))); } diff --git a/modules/eda-rabbitmq/README.md b/modules/eda-rabbitmq/README.md index ae5f34017..b39688dee 100644 --- a/modules/eda-rabbitmq/README.md +++ b/modules/eda-rabbitmq/README.md @@ -104,8 +104,8 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`RabbitMqEventPublisher`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisher.java) | Defines `RabbitMqEventPublisher`, `publish` operations. | -| [`RabbitMqEventConsumer`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumer.java) | Defines `RabbitMqEventConsumer`, `initialize`, `shutdown`, `stop` operations. | +| [`RabbitMqEventPublisherImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisherImpl.java) | Defines `RabbitMqEventPublisherImpl`, `publish` operations. | +| [`RabbitMqEventConsumerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumerImpl.java) | Defines `RabbitMqEventConsumerImpl`, `initialize`, `shutdown`, `stop` operations. | | [`FireflyEdaAmqpAdminAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaAmqpAdminAutoConfiguration.java) | Defines `FireflyEdaAmqpAdminAutoConfiguration`, `fireflyEdaAmqpAdmin` operations. | | [`FireflyEdaRabbitMqAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqAutoConfiguration.java) | Defines `FireflyEdaRabbitMqAutoConfiguration`, `fireflyEdaRabbitPublisherConnectionFactory`, `fireflyEdaRabbitTemplate` operations. | | [`FireflyEdaRabbitMqConsumerAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqConsumerAutoConfiguration.java) | Defines `FireflyEdaRabbitMqConsumerAutoConfiguration`, `fireflyEdaRabbitConsumerConnectionFactory` operations. | diff --git a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqConsumerAutoConfiguration.java b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqConsumerAutoConfiguration.java index 0ec579509..5b4bcec64 100644 --- a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqConsumerAutoConfiguration.java +++ b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqConsumerAutoConfiguration.java @@ -32,7 +32,7 @@ * Firefly EDA RabbitMQ Consumer Auto-Configuration. * *

    This configuration creates the RabbitMQ {@code ConnectionFactory} that the - * {@link org.fireflyframework.eda.consumer.rabbitmq.RabbitMqEventConsumer} requires, + * {@link org.fireflyframework.eda.consumer.rabbitmq.RabbitMqEventConsumerImpl} requires, * using ONLY {@code firefly.eda.consumer.rabbitmq.*} properties. * *

    Bug fix (dormant consumer): The @@ -86,7 +86,7 @@ public FireflyEdaRabbitMqConsumerAutoConfiguration(EdaProperties props) { * * *

    This is the missing bean that the - * {@link org.fireflyframework.eda.consumer.rabbitmq.RabbitMqEventConsumer} + * {@link org.fireflyframework.eda.consumer.rabbitmq.RabbitMqEventConsumerImpl} * depends on via {@code @ConditionalOnBean} / {@code @Qualifier}. * *

    Configuration Source: firefly.eda.consumer.rabbitmq.default.* diff --git a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqEnvironmentPostProcessor.java b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqEnvironmentPostProcessorImpl.java similarity index 98% rename from modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqEnvironmentPostProcessor.java rename to modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqEnvironmentPostProcessorImpl.java index b5f9c66b9..6166a9d1f 100644 --- a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqEnvironmentPostProcessor.java +++ b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/config/FireflyEdaRabbitMqEnvironmentPostProcessorImpl.java @@ -62,7 +62,7 @@ * *

    Any existing {@code spring.autoconfigure.exclude} entries are preserved. */ -public class FireflyEdaRabbitMqEnvironmentPostProcessor implements EnvironmentPostProcessor { +public class FireflyEdaRabbitMqEnvironmentPostProcessorImpl implements EnvironmentPostProcessor { private static final String EXCLUDE_PROPERTY = "spring.autoconfigure.exclude"; private static final String RABBIT_AUTO_CONFIG = "org.springframework.boot.amqp.autoconfigure.RabbitAutoConfiguration"; diff --git a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumer.java b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumerImpl.java similarity index 97% rename from modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumer.java rename to modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumerImpl.java index bbe99af95..8e88ae159 100644 --- a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumer.java +++ b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumerImpl.java @@ -20,7 +20,7 @@ import org.fireflyframework.eda.consumer.EventConsumer; import org.fireflyframework.eda.event.EventEnvelope; import org.fireflyframework.eda.filter.EventFilter; -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; @@ -73,19 +73,19 @@ @org.springframework.boot.autoconfigure.condition.ConditionalOnProperty(prefix = "firefly.eda.consumer", name = "enabled", havingValue = "true") @org.springframework.context.annotation.DependsOn("eventListenerProcessor") @Slf4j -public class RabbitMqEventConsumer implements EventConsumer, ApplicationContextAware { +public class RabbitMqEventConsumerImpl implements EventConsumer, ApplicationContextAware { private final ConnectionFactory connectionFactory; private final MessageSerializer messageSerializer; - private final EventListenerProcessor eventListenerProcessor; + private final EventListenerProcessorImpl eventListenerProcessor; private final EdaProperties edaProperties; private final List eventFilters; - public RabbitMqEventConsumer( + public RabbitMqEventConsumerImpl( @org.springframework.beans.factory.annotation.Qualifier("fireflyEdaRabbitConsumerConnectionFactory") ConnectionFactory connectionFactory, MessageSerializer messageSerializer, - EventListenerProcessor eventListenerProcessor, + EventListenerProcessorImpl eventListenerProcessor, EdaProperties edaProperties, @org.springframework.beans.factory.annotation.Autowired(required = false) List eventFilters) { this.connectionFactory = connectionFactory; @@ -173,7 +173,7 @@ public void initialize() { // Create and configure the listener container but don't start it automatically listenerContainer = new SimpleMessageListenerContainer(connectionFactory); - listenerContainer.setMessageListener(new RabbitMqMessageListener()); + listenerContainer.setMessageListener(new RabbitMqMessageListenerImpl()); listenerContainer.setAcknowledgeMode(org.springframework.amqp.core.AcknowledgeMode.AUTO); listenerContainer.setConcurrentConsumers(config.getConcurrentConsumers()); listenerContainer.setMaxConcurrentConsumers(config.getMaxConcurrentConsumers()); @@ -270,7 +270,7 @@ public Flux consume() { // Use the existing listener container approach but bridge to Flux // This creates a bridge between the message listener and the reactive stream - RabbitMqFluxMessageListener fluxListener = new RabbitMqFluxMessageListener(sink); + RabbitMqFluxMessageListenerImpl fluxListener = new RabbitMqFluxMessageListenerImpl(sink); try { // Create a new listener container for this consumption @@ -315,7 +315,7 @@ public Flux consume(String... destinations) { return; } - RabbitMqFluxMessageListener fluxListener = new RabbitMqFluxMessageListener(sink); + RabbitMqFluxMessageListenerImpl fluxListener = new RabbitMqFluxMessageListenerImpl(sink); try { SimpleMessageListenerContainer fluxContainer = new SimpleMessageListenerContainer(connectionFactory); @@ -449,10 +449,10 @@ private Object deserializeEvent(String messageBody, Map headers) /** * Flux-based message listener that emits EventEnvelopes to a Flux sink. */ - private class RabbitMqFluxMessageListener implements MessageListener { + private class RabbitMqFluxMessageListenerImpl implements MessageListener { private final reactor.core.publisher.FluxSink sink; - public RabbitMqFluxMessageListener(reactor.core.publisher.FluxSink sink) { + public RabbitMqFluxMessageListenerImpl(reactor.core.publisher.FluxSink sink) { this.sink = sink; } @@ -546,7 +546,7 @@ private String extractTransactionId(Map headers) { /** * Inner class to handle RabbitMQ messages. */ - private class RabbitMqMessageListener implements MessageListener { + private class RabbitMqMessageListenerImpl implements MessageListener { @Override public void onMessage(Message message) { diff --git a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisher.java b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisherImpl.java similarity index 98% rename from modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisher.java rename to modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisherImpl.java index 9ad1608b7..68b2bad71 100644 --- a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisher.java +++ b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisherImpl.java @@ -54,7 +54,7 @@ @ConditionalOnClass({AmqpTemplate.class, ConnectionFactory.class}) @ConditionalOnBean(name = "fireflyEdaRabbitTemplate") @Slf4j -public class RabbitMqEventPublisher implements EventPublisher, ConnectionAwarePublisher { +public class RabbitMqEventPublisherImpl implements EventPublisher, ConnectionAwarePublisher { private final AmqpTemplate amqpTemplate; private final ConnectionFactory connectionFactory; @@ -62,7 +62,7 @@ public class RabbitMqEventPublisher implements EventPublisher, ConnectionAwarePu private final EdaProperties edaProperties; private String connectionId; - public RabbitMqEventPublisher( + public RabbitMqEventPublisherImpl( @org.springframework.beans.factory.annotation.Qualifier("fireflyEdaRabbitTemplate") AmqpTemplate amqpTemplate, @org.springframework.beans.factory.annotation.Qualifier("fireflyEdaRabbitPublisherConnectionFactory") diff --git a/modules/eda-rabbitmq/src/main/resources/META-INF/spring.factories b/modules/eda-rabbitmq/src/main/resources/META-INF/spring.factories index aec16eec5..a372ee701 100644 --- a/modules/eda-rabbitmq/src/main/resources/META-INF/spring.factories +++ b/modules/eda-rabbitmq/src/main/resources/META-INF/spring.factories @@ -1,2 +1,2 @@ org.springframework.boot.EnvironmentPostProcessor=\ - org.fireflyframework.eda.config.FireflyEdaRabbitMqEnvironmentPostProcessor + org.fireflyframework.eda.config.FireflyEdaRabbitMqEnvironmentPostProcessorImpl diff --git a/modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/integration/RabbitMqIntegrationTest.java b/modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/integration/RabbitMqIntegrationTest.java index 8ab912fed..e68591025 100644 --- a/modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/integration/RabbitMqIntegrationTest.java +++ b/modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/integration/RabbitMqIntegrationTest.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.rabbitmq.RabbitMqEventPublisher; +import org.fireflyframework.eda.publisher.rabbitmq.RabbitMqEventPublisherImpl; import org.fireflyframework.eda.testconfig.BaseIntegrationTest; import org.fireflyframework.eda.testconfig.TestEventModels; import com.rabbitmq.client.Channel; @@ -73,7 +73,7 @@ class RabbitMqIntegrationTest extends BaseIntegrationTest { ); @Autowired(required = false) - private RabbitMqEventPublisher rabbitMqPublisher; + private RabbitMqEventPublisherImpl rabbitMqPublisher; @Autowired(required = false) private EventPublisherFactory publisherFactory; diff --git a/modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/integration/consumer/RabbitMqConsumerIntegrationTest.java b/modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/integration/consumer/RabbitMqConsumerIntegrationTest.java index 235ac6b95..86ec148f4 100644 --- a/modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/integration/consumer/RabbitMqConsumerIntegrationTest.java +++ b/modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/integration/consumer/RabbitMqConsumerIntegrationTest.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.rabbitmq.RabbitMqEventPublisher; +import org.fireflyframework.eda.publisher.rabbitmq.RabbitMqEventPublisherImpl; import org.fireflyframework.eda.testconfig.BaseIntegrationTest; import org.fireflyframework.eda.testconfig.TestApplication; import org.fireflyframework.eda.testconfig.TestContainersConfiguration; @@ -74,7 +74,7 @@ class RabbitMqConsumerIntegrationTest extends BaseIntegrationTest { private EventConsumer rabbitMqConsumer; @Autowired(required = false) - private RabbitMqEventPublisher rabbitMqPublisher; + private RabbitMqEventPublisherImpl rabbitMqPublisher; @Autowired(required = false) private TestEventListeners testEventListeners; diff --git a/modules/eda/README.md b/modules/eda/README.md index f05e4dcff..f9503acaf 100644 --- a/modules/eda/README.md +++ b/modules/eda/README.md @@ -90,7 +90,7 @@ Per-operation models register Avro's standard UUID, big-decimal, duration, and d The default serializer refuses nonempty decoding to `Object.class`. An explicitly constructed serializer may bind that request to one concrete root; this is equivalent to supplying that root class directly, not payload type detection: ```java -AvroMessageSerializer serializer = new AvroMessageSerializer( +AvroMessageSerializerImpl serializer = new AvroMessageSerializerImpl( new AvroTypeBindings(Set.of(), ApplicationSubmitted.class)); ``` diff --git a/modules/eda/docs/API_REFERENCE.md b/modules/eda/docs/API_REFERENCE.md index 69bc42556..3bf186211 100644 --- a/modules/eda/docs/API_REFERENCE.md +++ b/modules/eda/docs/API_REFERENCE.md @@ -1067,45 +1067,45 @@ public interface EventFilter { ### Built-in Filter Implementations -#### DestinationEventFilter +#### DestinationEventFilterImpl Filters events based on destination patterns. ```java -public class DestinationEventFilter implements EventFilter { - public DestinationEventFilter(String destinationPattern); - public DestinationEventFilter(Pattern destinationPattern); +public class DestinationEventFilterImpl implements EventFilter { + public DestinationEventFilterImpl(String destinationPattern); + public DestinationEventFilterImpl(Pattern destinationPattern); } ``` -#### EventTypeFilter +#### EventTypeFilterImpl Filters events based on event type patterns with glob support. ```java -public class EventTypeFilter implements EventFilter { - public EventTypeFilter(String eventTypePattern); - public EventTypeFilter(Pattern eventTypePattern); +public class EventTypeFilterImpl implements EventFilter { + public EventTypeFilterImpl(String eventTypePattern); + public EventTypeFilterImpl(Pattern eventTypePattern); } ``` -#### HeaderEventFilter +#### HeaderEventFilterImpl Filters events based on header values. ```java -public class HeaderEventFilter implements EventFilter { - public HeaderEventFilter(String headerName, String expectedValue); - public HeaderEventFilter(String headerName, Pattern valuePattern); +public class HeaderEventFilterImpl implements EventFilter { + public HeaderEventFilterImpl(String headerName, String expectedValue); + public HeaderEventFilterImpl(String headerName, Pattern valuePattern); } ``` -#### CompositeEventFilter +#### CompositeEventFilterImpl Combines multiple filters with logical operations. ```java -public class CompositeEventFilter implements EventFilter { +public class CompositeEventFilterImpl implements EventFilter { public enum LogicType { AND, OR } - public CompositeEventFilter(LogicType logicType, EventFilter... filters); - public CompositeEventFilter(LogicType logicType, List filters); + public CompositeEventFilterImpl(LogicType logicType, EventFilter... filters); + public CompositeEventFilterImpl(LogicType logicType, List filters); } ``` @@ -1161,13 +1161,13 @@ firefly.eda.retry.attempt{publisher_type, attempt, status} firefly.eda.rate.limiter.rejection{publisher_type} ``` -### EdaMetrics Class +### EdaMetricsImpl Class Service for recording custom metrics. ```java @Component -public class EdaMetrics { +public class EdaMetricsImpl { /** * Records a successful event publication. */ @@ -1221,7 +1221,7 @@ public class EdaMetrics { ## Health Indicators -### EdaHealthIndicator +### EdaHealthIndicatorImpl The EDA library provides a built-in health indicator component: @@ -1229,7 +1229,7 @@ The EDA library provides a built-in health indicator component: @Component @ConditionalOnClass(name = "org.springframework.boot.actuator.health.HealthIndicator") @ConditionalOnProperty(prefix = "firefly.eda", name = "health-enabled", havingValue = "true", matchIfMissing = true) -public class EdaHealthIndicator { +public class EdaHealthIndicatorImpl { /** * Returns comprehensive health information about: * - EDA library configuration and availability diff --git a/modules/eda/docs/ARCHITECTURE.md b/modules/eda/docs/ARCHITECTURE.md index 29d4d7821..6af20aa80 100644 --- a/modules/eda/docs/ARCHITECTURE.md +++ b/modules/eda/docs/ARCHITECTURE.md @@ -153,9 +153,9 @@ sequenceDiagram participant App as Application participant Aspect as @PublishResult Aspect participant Factory as EventPublisherFactory - participant Resilient as ResilientEventPublisher + participant Resilient as ResilientEventPublisherImpl participant Platform as PlatformPublisher - participant Metrics as EdaMetrics + participant Metrics as EdaMetricsImpl App->>Aspect: Method execution Aspect->>Factory: getPublisher(type, connection) @@ -173,7 +173,7 @@ sequenceDiagram ```mermaid sequenceDiagram participant Platform as PlatformConsumer - participant Processor as EventListenerProcessor + participant Processor as EventListenerProcessorImpl participant Filter as EventFilter participant Handler as @EventListener Method participant Envelope as EventEnvelope @@ -275,10 +275,10 @@ EventFilter complexFilter = EventFilter.and( ``` Filter Types: -- DestinationEventFilter: Topic/queue matching -- EventTypeFilter: Type pattern matching (with globs) -- HeaderEventFilter: Header-based filtering -- CompositeEventFilter: Logical combinations (AND/OR/NOT) +- DestinationEventFilterImpl: Topic/queue matching +- EventTypeFilterImpl: Type pattern matching (with globs) +- HeaderEventFilterImpl: Header-based filtering +- CompositeEventFilterImpl: Logical combinations (AND/OR/NOT) ## Serialization Layer @@ -297,9 +297,9 @@ public interface MessageSerializer { ``` Available Implementations: -- JsonMessageSerializer: Jackson-based JSON serialization -- AvroMessageSerializer: Schema-based binary serialization (planned) -- ProtobufMessageSerializer: Protocol Buffers support (planned) +- JsonMessageSerializerImpl: Jackson-based JSON serialization +- AvroMessageSerializerImpl: Schema-based binary serialization (planned) +- ProtobufMessageSerializerImpl: Protocol Buffers support (planned) ### Serialization Strategy @@ -439,7 +439,7 @@ Spring Boot Actuator integration: ```java @Component -public class EdaHealthIndicator implements HealthIndicator { +public class EdaHealthIndicatorImpl implements HealthIndicator { @Override public Health health() { Health.Builder builder = new Health.Builder(); @@ -521,7 +521,7 @@ public class CustomMessageSerializer implements MessageSerializer { ### Structural Patterns - Adapter Pattern: Platform-specific publisher/consumer adapters -- Decorator Pattern: ResilientEventPublisher wrapping +- Decorator Pattern: ResilientEventPublisherImpl wrapping - Facade Pattern: EventPublisherFactory simplifying access - Composite Pattern: EventFilter combinations diff --git a/modules/eda/docs/DEVELOPER_GUIDE.md b/modules/eda/docs/DEVELOPER_GUIDE.md index 5c759f125..9ae292b7e 100644 --- a/modules/eda/docs/DEVELOPER_GUIDE.md +++ b/modules/eda/docs/DEVELOPER_GUIDE.md @@ -323,13 +323,13 @@ Implement the `MessageSerializer` interface: ```java @Component -public class AvroMessageSerializer implements MessageSerializer { +public class AvroMessageSerializerImpl implements MessageSerializer { private final Schema schema; private final SpecificDatumWriter datumWriter; private final SpecificDatumReader datumReader; - public AvroMessageSerializer() { + public AvroMessageSerializerImpl() { this.schema = loadSchema(); this.datumWriter = new SpecificDatumWriter<>(schema); this.datumReader = new SpecificDatumReader<>(schema); @@ -419,12 +419,12 @@ public class SerializationConfig { @Bean public MessageSerializer protobufSerializer() { - return new ProtobufMessageSerializer(); + return new ProtobufMessageSerializerImpl(); } @Bean public MessageSerializer customJsonSerializer() { - return JsonMessageSerializer.builder() + return JsonMessageSerializerImpl.builder() .objectMapper(customObjectMapper()) .compressionEnabled(true) .build(); diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/consumer/NoopEventConsumer.java b/modules/eda/src/main/java/org/fireflyframework/eda/consumer/NoopEventConsumerImpl.java similarity index 97% rename from modules/eda/src/main/java/org/fireflyframework/eda/consumer/NoopEventConsumer.java rename to modules/eda/src/main/java/org/fireflyframework/eda/consumer/NoopEventConsumerImpl.java index f678025ad..dd7670691 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/consumer/NoopEventConsumer.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/consumer/NoopEventConsumerImpl.java @@ -37,10 +37,10 @@ *

    * All consume operations return empty streams and perform no actual work. */ -@Component +@Component("noopEventConsumer") @ConditionalOnProperty(prefix = "firefly.eda.consumer.noop", name = "enabled", havingValue = "true") @Slf4j -public class NoopEventConsumer implements EventConsumer { +public class NoopEventConsumerImpl implements EventConsumer { private volatile boolean running = false; diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumer.java b/modules/eda/src/main/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumerImpl.java similarity index 97% rename from modules/eda/src/main/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumer.java rename to modules/eda/src/main/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumerImpl.java index 1b4802b1a..6efcb301c 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumer.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumerImpl.java @@ -38,10 +38,10 @@ * It listens for EventEnvelope instances published through Spring's event mechanism * and bridges them to the reactive streams API. */ -@Component +@Component("springApplicationEventConsumer") @ConditionalOnProperty(prefix = "firefly.eda.consumer.application-event", name = "enabled", havingValue = "true") @Slf4j -public class SpringApplicationEventConsumer implements EventConsumer { +public class SpringApplicationEventConsumerImpl implements EventConsumer { private final Sinks.Many eventSink = Sinks.many().multicast().directBestEffort(); private final AtomicBoolean running = new AtomicBoolean(false); diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/MetricsErrorHandler.java b/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/MetricsErrorHandlerImpl.java similarity index 93% rename from modules/eda/src/main/java/org/fireflyframework/eda/error/impl/MetricsErrorHandler.java rename to modules/eda/src/main/java/org/fireflyframework/eda/error/impl/MetricsErrorHandlerImpl.java index a5d6e5f7c..81cf112a2 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/MetricsErrorHandler.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/MetricsErrorHandlerImpl.java @@ -31,13 +31,13 @@ /** * Custom error handler that records error metrics via {@link FireflyMetricsSupport}. */ -@Component +@Component("metricsErrorHandler") @ConditionalOnClass(MeterRegistry.class) @ConditionalOnProperty(prefix = "firefly.eda.error.metrics", name = "enabled", havingValue = "true", matchIfMissing = true) @Slf4j -public class MetricsErrorHandler extends FireflyMetricsSupport implements CustomErrorHandler { +public class MetricsErrorHandlerImpl extends FireflyMetricsSupport implements CustomErrorHandler { - public MetricsErrorHandler(MeterRegistry meterRegistry) { + public MetricsErrorHandlerImpl(MeterRegistry meterRegistry) { super(meterRegistry, "eda"); } diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/NotificationErrorHandler.java b/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/NotificationErrorHandlerImpl.java similarity index 97% rename from modules/eda/src/main/java/org/fireflyframework/eda/error/impl/NotificationErrorHandler.java rename to modules/eda/src/main/java/org/fireflyframework/eda/error/impl/NotificationErrorHandlerImpl.java index 40b65b0b1..0a8c182c2 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/NotificationErrorHandler.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/error/impl/NotificationErrorHandlerImpl.java @@ -30,10 +30,10 @@ * This handler demonstrates how to implement custom error handling logic * for specific error types or conditions. */ -@Component +@Component("notificationErrorHandler") @ConditionalOnProperty(prefix = "firefly.eda.error.notification", name = "enabled", havingValue = "true") @Slf4j -public class NotificationErrorHandler implements CustomErrorHandler { +public class NotificationErrorHandlerImpl implements CustomErrorHandler { @Override public Mono handleError(Object event, Map headers, diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/filter/CompositeEventFilter.java b/modules/eda/src/main/java/org/fireflyframework/eda/filter/CompositeEventFilterImpl.java similarity index 90% rename from modules/eda/src/main/java/org/fireflyframework/eda/filter/CompositeEventFilter.java rename to modules/eda/src/main/java/org/fireflyframework/eda/filter/CompositeEventFilterImpl.java index 245ab9b27..e0d188e55 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/filter/CompositeEventFilter.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/filter/CompositeEventFilterImpl.java @@ -35,7 +35,7 @@ *

  • Complex nested combinations using multiple composite filters
  • * */ -public class CompositeEventFilter implements EventFilter { +public class CompositeEventFilterImpl implements EventFilter { /** * Logic type for combining filters. @@ -47,12 +47,12 @@ public enum LogicType { private final LogicType logicType; private final List filters; - public CompositeEventFilter(LogicType logicType, EventFilter... filters) { + public CompositeEventFilterImpl(LogicType logicType, EventFilter... filters) { this.logicType = logicType; this.filters = Arrays.asList(filters); } - public CompositeEventFilter(LogicType logicType, List filters) { + public CompositeEventFilterImpl(LogicType logicType, List filters) { this.logicType = logicType; this.filters = filters; } @@ -108,10 +108,10 @@ public List getFilters() { * Adds additional filters to this composite filter. * Note: This creates a new filter instance. */ - public CompositeEventFilter addFilters(EventFilter... additionalFilters) { + public CompositeEventFilterImpl addFilters(EventFilter... additionalFilters) { List combined = Arrays.asList(additionalFilters); combined.addAll(this.filters); - return new CompositeEventFilter(this.logicType, combined); + return new CompositeEventFilterImpl(this.logicType, combined); } /** diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/filter/DestinationEventFilter.java b/modules/eda/src/main/java/org/fireflyframework/eda/filter/DestinationEventFilterImpl.java similarity index 96% rename from modules/eda/src/main/java/org/fireflyframework/eda/filter/DestinationEventFilter.java rename to modules/eda/src/main/java/org/fireflyframework/eda/filter/DestinationEventFilterImpl.java index 236fb70bb..eb74c672e 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/filter/DestinationEventFilter.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/filter/DestinationEventFilterImpl.java @@ -29,12 +29,12 @@ * a configured pattern that supports wildcards. */ @RequiredArgsConstructor -public class DestinationEventFilter implements EventFilter { +public class DestinationEventFilterImpl implements EventFilter { private final String destinationPattern; private final Pattern compiledPattern; - public DestinationEventFilter(String destinationPattern) { + public DestinationEventFilterImpl(String destinationPattern) { this.destinationPattern = destinationPattern; this.compiledPattern = compilePattern(destinationPattern); } diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/filter/EventFilter.java b/modules/eda/src/main/java/org/fireflyframework/eda/filter/EventFilter.java index ebc8dc651..094b77731 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/filter/EventFilter.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/filter/EventFilter.java @@ -117,7 +117,7 @@ static EventFilter byHeader(String headerName, String headerValue) { * @return a new composite filter */ static EventFilter and(EventFilter... filters) { - return new CompositeEventFilter(CompositeEventFilter.LogicType.AND, filters); + return new CompositeEventFilterImpl(CompositeEventFilterImpl.LogicType.AND, filters); } /** @@ -127,7 +127,7 @@ static EventFilter and(EventFilter... filters) { * @return a new composite filter */ static EventFilter or(EventFilter... filters) { - return new CompositeEventFilter(CompositeEventFilter.LogicType.OR, filters); + return new CompositeEventFilterImpl(CompositeEventFilterImpl.LogicType.OR, filters); } /** diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/filter/EventTypeFilter.java b/modules/eda/src/main/java/org/fireflyframework/eda/filter/EventTypeFilterImpl.java similarity index 96% rename from modules/eda/src/main/java/org/fireflyframework/eda/filter/EventTypeFilter.java rename to modules/eda/src/main/java/org/fireflyframework/eda/filter/EventTypeFilterImpl.java index d2701edde..649d5b7b7 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/filter/EventTypeFilter.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/filter/EventTypeFilterImpl.java @@ -35,19 +35,19 @@ */ @RequiredArgsConstructor @Slf4j -public class EventTypeFilter implements EventFilter { +public class EventTypeFilterImpl implements EventFilter { private final String eventTypePattern; private final Pattern compiledPattern; private final MessageSerializer messageSerializer; - public EventTypeFilter(String eventTypePattern) { + public EventTypeFilterImpl(String eventTypePattern) { this.eventTypePattern = eventTypePattern; this.compiledPattern = compilePattern(eventTypePattern); this.messageSerializer = null; // Will use header-based matching only } - public EventTypeFilter(String eventTypePattern, MessageSerializer messageSerializer) { + public EventTypeFilterImpl(String eventTypePattern, MessageSerializer messageSerializer) { this.eventTypePattern = eventTypePattern; this.compiledPattern = compilePattern(eventTypePattern); this.messageSerializer = messageSerializer; diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/filter/HeaderEventFilter.java b/modules/eda/src/main/java/org/fireflyframework/eda/filter/HeaderEventFilterImpl.java similarity index 95% rename from modules/eda/src/main/java/org/fireflyframework/eda/filter/HeaderEventFilter.java rename to modules/eda/src/main/java/org/fireflyframework/eda/filter/HeaderEventFilterImpl.java index 07deedd2e..e4cbe8522 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/filter/HeaderEventFilter.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/filter/HeaderEventFilterImpl.java @@ -28,13 +28,13 @@ * its value against a pattern that supports wildcards. */ @RequiredArgsConstructor -public class HeaderEventFilter implements EventFilter { +public class HeaderEventFilterImpl implements EventFilter { private final String headerName; private final String expectedValue; private final Pattern compiledPattern; - public HeaderEventFilter(String headerName, String expectedValue) { + public HeaderEventFilterImpl(String headerName, String expectedValue) { this.headerName = headerName; this.expectedValue = expectedValue; this.compiledPattern = compilePattern(expectedValue); @@ -43,7 +43,7 @@ public HeaderEventFilter(String headerName, String expectedValue) { /** * Creates a filter that only checks for header presence (value can be anything). */ - public HeaderEventFilter(String headerName) { + public HeaderEventFilterImpl(String headerName) { this.headerName = headerName; this.expectedValue = null; this.compiledPattern = null; diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/health/EdaHealthIndicator.java b/modules/eda/src/main/java/org/fireflyframework/eda/health/EdaHealthIndicatorImpl.java similarity index 98% rename from modules/eda/src/main/java/org/fireflyframework/eda/health/EdaHealthIndicator.java rename to modules/eda/src/main/java/org/fireflyframework/eda/health/EdaHealthIndicatorImpl.java index 08b034ac8..cfa8e31eb 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/health/EdaHealthIndicator.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/health/EdaHealthIndicatorImpl.java @@ -47,18 +47,18 @@ *
  • Overall system health based on component availability
  • * */ -@Component +@Component("edaHealthIndicator") @ConditionalOnClass(name = "org.springframework.boot.health.contributor.HealthIndicator") @ConditionalOnProperty(prefix = "firefly.eda", name = "health-enabled", havingValue = "true", matchIfMissing = true) @Lazy @Slf4j -public class EdaHealthIndicator extends FireflyHealthIndicator { +public class EdaHealthIndicatorImpl extends FireflyHealthIndicator { private final EdaProperties edaProperties; private final EventPublisherFactory publisherFactory; private final ObjectProvider eventConsumersProvider; - public EdaHealthIndicator(EdaProperties edaProperties, + public EdaHealthIndicatorImpl(EdaProperties edaProperties, EventPublisherFactory publisherFactory, ObjectProvider eventConsumersProvider) { super("eda"); diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/listener/EventListenerProcessor.java b/modules/eda/src/main/java/org/fireflyframework/eda/listener/EventListenerProcessorImpl.java similarity index 99% rename from modules/eda/src/main/java/org/fireflyframework/eda/listener/EventListenerProcessor.java rename to modules/eda/src/main/java/org/fireflyframework/eda/listener/EventListenerProcessorImpl.java index 63b6f0bb5..b2f82bab1 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/listener/EventListenerProcessor.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/listener/EventListenerProcessorImpl.java @@ -56,9 +56,9 @@ * Uses {@code ApplicationListener} to initialize event listeners * after all beans are fully initialized, avoiding circular reference issues. */ -@Component +@Component("eventListenerProcessor") @Slf4j -public class EventListenerProcessor implements ApplicationListener, DynamicEventListenerRegistry { +public class EventListenerProcessorImpl implements ApplicationListener, DynamicEventListenerRegistry { private final ApplicationContext applicationContext; private final ApplicationEventPublisher applicationEventPublisher; @@ -83,7 +83,7 @@ public class EventListenerProcessor implements ApplicationListenerCircuit breaker and resilience metrics * */ -@Component +@Component("edaMetrics") @ConditionalOnClass(MeterRegistry.class) @ConditionalOnProperty(prefix = "firefly.eda", name = "metrics-enabled", havingValue = "true", matchIfMissing = true) @Slf4j -public class EdaMetrics extends FireflyMetricsSupport { +public class EdaMetricsImpl extends FireflyMetricsSupport { private final ConcurrentMap publisherHealthGauges = new ConcurrentHashMap<>(); private final ConcurrentMap consumerHealthGauges = new ConcurrentHashMap<>(); - public EdaMetrics(MeterRegistry meterRegistry) { + public EdaMetricsImpl(MeterRegistry meterRegistry) { super(meterRegistry, "eda"); } diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/publisher/DestinationAwarePublisher.java b/modules/eda/src/main/java/org/fireflyframework/eda/publisher/DestinationAwarePublisherImpl.java similarity index 98% rename from modules/eda/src/main/java/org/fireflyframework/eda/publisher/DestinationAwarePublisher.java rename to modules/eda/src/main/java/org/fireflyframework/eda/publisher/DestinationAwarePublisherImpl.java index 37f4be65a..d96e28503 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/publisher/DestinationAwarePublisher.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/publisher/DestinationAwarePublisherImpl.java @@ -36,7 +36,7 @@ */ @RequiredArgsConstructor @Slf4j -public class DestinationAwarePublisher implements EventPublisher { +public class DestinationAwarePublisherImpl implements EventPublisher { private final EventPublisher delegate; private final String customDefaultDestination; diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/publisher/EventPublisherFactory.java b/modules/eda/src/main/java/org/fireflyframework/eda/publisher/EventPublisherFactory.java index 963821d7f..45c9bd176 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/publisher/EventPublisherFactory.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/publisher/EventPublisherFactory.java @@ -158,7 +158,7 @@ public EventPublisher getPublisherWithDestination(PublisherType publisherType, S // Wrap with destination-aware publisher log.debug("Creating destination-aware publisher: type={}, connectionId={}, customDestination={}", publisherType, connectionId, trimmedDestination); - return new DestinationAwarePublisher(basePublisher, trimmedDestination); + return new DestinationAwarePublisherImpl(basePublisher, trimmedDestination); } /** diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/publisher/NoopEventPublisher.java b/modules/eda/src/main/java/org/fireflyframework/eda/publisher/NoopEventPublisherImpl.java similarity index 96% rename from modules/eda/src/main/java/org/fireflyframework/eda/publisher/NoopEventPublisher.java rename to modules/eda/src/main/java/org/fireflyframework/eda/publisher/NoopEventPublisherImpl.java index b1bf0c7c6..2580b1ea5 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/publisher/NoopEventPublisher.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/publisher/NoopEventPublisherImpl.java @@ -36,10 +36,10 @@ *

    * All publish operations complete successfully but perform no actual work. */ -@Component +@Component("noopEventPublisher") @ConditionalOnProperty(prefix = "firefly.eda.publishers.noop", name = "enabled", havingValue = "true") @Slf4j -public class NoopEventPublisher implements EventPublisher { +public class NoopEventPublisherImpl implements EventPublisher { @Override public Mono publish(Object event, String destination, Map headers) { diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisher.java b/modules/eda/src/main/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisherImpl.java similarity index 97% rename from modules/eda/src/main/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisher.java rename to modules/eda/src/main/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisherImpl.java index 1dd1683ce..03a469587 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisher.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisherImpl.java @@ -36,11 +36,11 @@ * application event mechanism. It's suitable for single-instance applications, * testing, and scenarios where external messaging infrastructure is not available. */ -@Component +@Component("springApplicationEventPublisher") @ConditionalOnProperty(prefix = "firefly.eda.publishers.application-event", name = "enabled", havingValue = "true", matchIfMissing = true) @RequiredArgsConstructor @Slf4j -public class SpringApplicationEventPublisher implements EventPublisher { +public class SpringApplicationEventPublisherImpl implements EventPublisher { private final ApplicationEventPublisher springEventPublisher; private final EdaProperties edaProperties; diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisherFactory.java b/modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisherFactory.java index 5700f89ae..d6440cad1 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisherFactory.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisherFactory.java @@ -87,7 +87,7 @@ public EventPublisher createResilientPublisher(EventPublisher publisher, String log.debug("Created rate limiter for publisher: {}", name); } - return new ResilientEventPublisher(publisher, circuitBreaker, retry, rateLimiter, config); + return new ResilientEventPublisherImpl(publisher, circuitBreaker, retry, rateLimiter, config); } /** diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisher.java b/modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisherImpl.java similarity index 99% rename from modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisher.java rename to modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisherImpl.java index 0e6bf6e76..7aba0d486 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisher.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/resilience/ResilientEventPublisherImpl.java @@ -45,7 +45,7 @@ */ @RequiredArgsConstructor @Slf4j -public class ResilientEventPublisher implements EventPublisher { +public class ResilientEventPublisherImpl implements EventPublisher { private final EventPublisher delegate; private final CircuitBreaker circuitBreaker; diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/serialization/AvroMessageSerializer.java b/modules/eda/src/main/java/org/fireflyframework/eda/serialization/AvroMessageSerializerImpl.java similarity index 97% rename from modules/eda/src/main/java/org/fireflyframework/eda/serialization/AvroMessageSerializer.java rename to modules/eda/src/main/java/org/fireflyframework/eda/serialization/AvroMessageSerializerImpl.java index c770d7275..0353254a9 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/serialization/AvroMessageSerializer.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/serialization/AvroMessageSerializerImpl.java @@ -35,16 +35,16 @@ import java.util.Objects; /** Avro serialization with operation-local authority from exact declared class tokens. */ -@Component +@Component("avroMessageSerializer") @ConditionalOnClass(Schema.class) -public class AvroMessageSerializer implements MessageSerializer { +public class AvroMessageSerializerImpl implements MessageSerializer { private final AvroTypeBindings bindings; - public AvroMessageSerializer() { + public AvroMessageSerializerImpl() { this(AvroTypeBindings.strict()); } - public AvroMessageSerializer(AvroTypeBindings bindings) { + public AvroMessageSerializerImpl(AvroTypeBindings bindings) { this.bindings = Objects.requireNonNull(bindings, "Avro type bindings"); Class objectRoot = bindings.objectRoot(); if (objectRoot != null) { diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/serialization/JsonMessageSerializer.java b/modules/eda/src/main/java/org/fireflyframework/eda/serialization/JsonMessageSerializerImpl.java similarity index 96% rename from modules/eda/src/main/java/org/fireflyframework/eda/serialization/JsonMessageSerializer.java rename to modules/eda/src/main/java/org/fireflyframework/eda/serialization/JsonMessageSerializerImpl.java index 72d6a9b29..4cb42dc99 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/serialization/JsonMessageSerializer.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/serialization/JsonMessageSerializerImpl.java @@ -31,10 +31,10 @@ * This serializer converts objects to JSON format and then to UTF-8 bytes. * It provides good human readability and wide compatibility. */ -@Component +@Component("jsonMessageSerializer") @Primary @RequiredArgsConstructor -public class JsonMessageSerializer implements MessageSerializer { +public class JsonMessageSerializerImpl implements MessageSerializer { private final ObjectMapper objectMapper; diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializer.java b/modules/eda/src/main/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializerImpl.java similarity index 98% rename from modules/eda/src/main/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializer.java rename to modules/eda/src/main/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializerImpl.java index 345ac0288..fc6cb8a2d 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializer.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializerImpl.java @@ -45,10 +45,10 @@ * that extend {@link Message}. For POJOs, use {@link JsonMessageSerializer} * or {@link AvroMessageSerializer}. */ -@Component +@Component("protobufMessageSerializer") @ConditionalOnClass(Message.class) @Slf4j -public class ProtobufMessageSerializer implements MessageSerializer { +public class ProtobufMessageSerializerImpl implements MessageSerializer { @Override public byte[] serialize(Object payload) throws SerializationException { diff --git a/modules/eda/src/test/java/README.md b/modules/eda/src/test/java/README.md index 6dc368492..41866e6fe 100644 --- a/modules/eda/src/test/java/README.md +++ b/modules/eda/src/test/java/README.md @@ -239,9 +239,9 @@ The test suite validates the hexagonal architecture principles: - `MessageSerializer` interface contract ### 2. Adapter Testing (Implementations) -- Kafka adapter (KafkaEventPublisher) -- RabbitMQ adapter (RabbitMqEventPublisher) -- Application Event adapter (SpringApplicationEventPublisher) +- Kafka adapter (KafkaEventPublisherImpl) +- RabbitMQ adapter (RabbitMqEventPublisherImpl) +- Application Event adapter (SpringApplicationEventPublisherImpl) ### 3. Business Behavior Preservation diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/config/EdaAutoConfigurationTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/config/EdaAutoConfigurationTest.java index dda974cf4..4cec2357d 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/config/EdaAutoConfigurationTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/config/EdaAutoConfigurationTest.java @@ -20,8 +20,8 @@ import org.fireflyframework.eda.properties.EdaProperties; import org.fireflyframework.eda.publisher.EventPublisher; import org.fireflyframework.eda.publisher.EventPublisherFactory; -import org.fireflyframework.eda.publisher.SpringApplicationEventPublisher; -import org.fireflyframework.eda.serialization.JsonMessageSerializer; +import org.fireflyframework.eda.publisher.SpringApplicationEventPublisherImpl; +import org.fireflyframework.eda.serialization.JsonMessageSerializerImpl; import org.fireflyframework.eda.serialization.MessageSerializer; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -85,14 +85,14 @@ void shouldCreateMessageSerializerBean() { // Assert MessageSerializer serializer = applicationContext.getBean(MessageSerializer.class); assertThat(serializer).isNotNull(); - assertThat(serializer).isInstanceOf(JsonMessageSerializer.class); + assertThat(serializer).isInstanceOf(JsonMessageSerializerImpl.class); } @Test @DisplayName("Should create SpringApplicationEventPublisher bean") void shouldCreateSpringApplicationEventPublisherBean() { // Assert - SpringApplicationEventPublisher publisher = applicationContext.getBean(SpringApplicationEventPublisher.class); + SpringApplicationEventPublisherImpl publisher = applicationContext.getBean(SpringApplicationEventPublisherImpl.class); assertThat(publisher).isNotNull(); assertThat(publisher.isAvailable()).isTrue(); } @@ -114,7 +114,7 @@ void shouldDiscoverAllEventPublisherImplementations() { // Assert - At minimum, SpringApplicationEventPublisher should be present assertThat(publishers).isNotEmpty(); assertThat(publishers.values()) - .anyMatch(p -> p instanceof SpringApplicationEventPublisher); + .anyMatch(p -> p instanceof SpringApplicationEventPublisherImpl); } /** @@ -155,7 +155,7 @@ static class DisabledApplicationEventPublisherTest { @DisplayName("Should not create SpringApplicationEventPublisher when disabled") void shouldNotCreateSpringApplicationEventPublisherWhenDisabled() { // Assert - SpringApplicationEventPublisher should not be created - boolean hasPublisher = applicationContext.getBeansOfType(SpringApplicationEventPublisher.class) + boolean hasPublisher = applicationContext.getBeansOfType(SpringApplicationEventPublisherImpl.class) .values().stream() .anyMatch(p -> p.isAvailable()); diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/consumer/NoopEventConsumerTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/consumer/NoopEventConsumerTest.java index 34b62b0b6..1e91683dd 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/consumer/NoopEventConsumerTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/consumer/NoopEventConsumerTest.java @@ -31,11 +31,11 @@ @DisplayName("NoopEventConsumer Tests") class NoopEventConsumerTest { - private NoopEventConsumer consumer; + private NoopEventConsumerImpl consumer; @BeforeEach void setUp() { - consumer = new NoopEventConsumer(); + consumer = new NoopEventConsumerImpl(); } @Test diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumerTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumerTest.java index d283c4624..8b94f2b69 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumerTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/consumer/SpringApplicationEventConsumerTest.java @@ -35,11 +35,11 @@ @DisplayName("SpringApplicationEventConsumer Tests") class SpringApplicationEventConsumerTest { - private SpringApplicationEventConsumer consumer; + private SpringApplicationEventConsumerImpl consumer; @BeforeEach void setUp() { - consumer = new SpringApplicationEventConsumer(); + consumer = new SpringApplicationEventConsumerImpl(); } @Test diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/error/ErrorHandlingTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/error/ErrorHandlingTest.java index 278582977..54042bd46 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/error/ErrorHandlingTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/error/ErrorHandlingTest.java @@ -17,8 +17,8 @@ package org.fireflyframework.eda.error; import org.fireflyframework.eda.annotation.ErrorHandlingStrategy; -import org.fireflyframework.eda.error.impl.MetricsErrorHandler; -import org.fireflyframework.eda.error.impl.NotificationErrorHandler; +import org.fireflyframework.eda.error.impl.MetricsErrorHandlerImpl; +import org.fireflyframework.eda.error.impl.NotificationErrorHandlerImpl; import org.fireflyframework.eda.testconfig.TestEventModels.SimpleTestEvent; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.simple.SimpleMeterRegistry; @@ -198,7 +198,7 @@ void shouldReturnFalseWhenUnregisteringNonExistentHandler() { @Test void shouldInitializeWithSpringBeans() { // Arrange - MetricsErrorHandler metricsHandler = new MetricsErrorHandler(meterRegistry); + MetricsErrorHandlerImpl metricsHandler = new MetricsErrorHandlerImpl(meterRegistry); List handlers = List.of(metricsHandler); CustomErrorHandlerRegistry registry = new CustomErrorHandlerRegistry(); @@ -210,7 +210,7 @@ void shouldInitializeWithSpringBeans() { // Assert assertThat(registry.hasHandlers()).isTrue(); assertThat(registry.getRegisteredHandlers()).hasSize(1); - assertThat(registry.getRegisteredHandlers().get(0)).isInstanceOf(MetricsErrorHandler.class); + assertThat(registry.getRegisteredHandlers().get(0)).isInstanceOf(MetricsErrorHandlerImpl.class); } @Test diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/integration/DynamicDestinationIntegrationTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/integration/DynamicDestinationIntegrationTest.java index 74122bffb..5d9fdaf92 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/integration/DynamicDestinationIntegrationTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/integration/DynamicDestinationIntegrationTest.java @@ -17,7 +17,7 @@ package org.fireflyframework.eda.integration; import org.fireflyframework.eda.annotation.PublisherType; -import org.fireflyframework.eda.publisher.DestinationAwarePublisher; +import org.fireflyframework.eda.publisher.DestinationAwarePublisherImpl; import org.fireflyframework.eda.publisher.EventPublisher; import org.fireflyframework.eda.publisher.EventPublisherFactory; import org.fireflyframework.eda.testconfig.BaseIntegrationTest; @@ -56,7 +56,7 @@ void shouldCreatePublisherWithCustomDestinationOverridingConfiguration() { // Then assertThat(publisher).isNotNull(); - assertThat(publisher).isInstanceOf(DestinationAwarePublisher.class); + assertThat(publisher).isInstanceOf(DestinationAwarePublisherImpl.class); assertThat(publisher.getDefaultDestination()).isEqualTo(customDestination); assertThat(publisher.getPublisherType()).isEqualTo(PublisherType.APPLICATION_EVENT); assertThat(publisher.isAvailable()).isTrue(); @@ -107,7 +107,7 @@ void shouldGetDefaultPublisherWithCustomDestination() { // Then assertThat(publisher).isNotNull(); - assertThat(publisher).isInstanceOf(DestinationAwarePublisher.class); + assertThat(publisher).isInstanceOf(DestinationAwarePublisherImpl.class); assertThat(publisher.getDefaultDestination()).isEqualTo(customDestination); assertThat(publisher.getPublisherType()).isEqualTo(PublisherType.APPLICATION_EVENT); // Default type } @@ -166,7 +166,7 @@ void shouldMaintainBackwardCompatibilityWithStandardPublisherMethods() { // When & Then - Should work as before assertThat(standardPublisher).isNotNull(); - assertThat(standardPublisher).isNotInstanceOf(DestinationAwarePublisher.class); + assertThat(standardPublisher).isNotInstanceOf(DestinationAwarePublisherImpl.class); assertThat(standardPublisher.getDefaultDestination()).isEqualTo("default-app-events"); // From config TestEventModels.UserRegisteredEvent event = TestEventModels.UserRegisteredEvent.create( @@ -189,7 +189,7 @@ void shouldHandleConnectionSpecificPublishersWithCustomDestinations() { // Then assertThat(publisher).isNotNull(); - assertThat(publisher).isInstanceOf(DestinationAwarePublisher.class); + assertThat(publisher).isInstanceOf(DestinationAwarePublisherImpl.class); assertThat(publisher.getDefaultDestination()).isEqualTo(customDestination); } diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerDeliveryContractTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerDeliveryContractTest.java index 12a1a4be0..4f73b88ad 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerDeliveryContractTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerDeliveryContractTest.java @@ -50,7 +50,7 @@ import reactor.test.StepVerifier; class EventListenerDeliveryContractTest { - private EventListenerProcessor processor(Object... beans) { + private EventListenerProcessorImpl processor(Object... beans) { var context = mock(ApplicationContext.class); var environment = mock(Environment.class); when(environment.resolvePlaceholders(anyString())).thenAnswer(call -> call.getArgument(0)); @@ -60,7 +60,7 @@ private EventListenerProcessor processor(Object... beans) { when(context.getBean(names[i])).thenReturn(beans[i]); } when(context.getBeanDefinitionNames()).thenReturn(names); - var processor = new EventListenerProcessor(context, mock(ApplicationEventPublisher.class), + var processor = new EventListenerProcessorImpl(context, mock(ApplicationEventPublisher.class), mock(CustomErrorHandlerRegistry.class), environment); processor.initializeEventListeners(); return processor; @@ -76,7 +76,7 @@ private EventEnvelope envelope(String destination, String consumer, String conne mock(EventEnvelope.AckCallback.class)); } - private EventDeliveryOutcome run(EventListenerProcessor processor, EventEnvelope envelope) { + private EventDeliveryOutcome run(EventListenerProcessorImpl processor, EventEnvelope envelope) { return processor.processDelivery(envelope).block(Duration.ofSeconds(2)); } @@ -119,7 +119,7 @@ void invalidConditionNeverAcknowledgesOrLogsRawExpression(Object bean) { var appender = new ListAppender(); appender.start(); Logger evaluator = (Logger) LoggerFactory.getLogger(SpelExpressionEvaluator.class); - Logger listener = (Logger) LoggerFactory.getLogger(EventListenerProcessor.class); + Logger listener = (Logger) LoggerFactory.getLogger(EventListenerProcessorImpl.class); evaluator.addAppender(appender); listener.addAppender(appender); try { diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerDeliveryOutcomeTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerDeliveryOutcomeTest.java index c8fcbc92d..002ec80a8 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerDeliveryOutcomeTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerDeliveryOutcomeTest.java @@ -42,7 +42,7 @@ import reactor.core.publisher.Sinks; class EventListenerDeliveryOutcomeTest { - private EventListenerProcessor processor(Object... beans) { + private EventListenerProcessorImpl processor(Object... beans) { var context = mock(ApplicationContext.class); var environment = mock(Environment.class); when(environment.resolvePlaceholders(anyString())).thenAnswer(call -> call.getArgument(0)); @@ -52,7 +52,7 @@ private EventListenerProcessor processor(Object... beans) { when(context.getBean(names[i])).thenReturn(beans[i]); } when(context.getBeanDefinitionNames()).thenReturn(names); - var processor = new EventListenerProcessor(context, mock(ApplicationEventPublisher.class), + var processor = new EventListenerProcessorImpl(context, mock(ApplicationEventPublisher.class), mock(CustomErrorHandlerRegistry.class), environment); processor.initializeEventListeners(); return processor; @@ -64,7 +64,7 @@ private EventEnvelope envelope() { "POSTGRES", "default", mock(EventEnvelope.AckCallback.class)); } - private EventDeliveryOutcome run(EventListenerProcessor processor, EventEnvelope envelope) { + private EventDeliveryOutcome run(EventListenerProcessorImpl processor, EventEnvelope envelope) { return processor.processDelivery(envelope).block(Duration.ofSeconds(2)); } diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerProcessorTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerProcessorTest.java index f7325be38..dde211204 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerProcessorTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/listener/EventListenerProcessorTest.java @@ -63,7 +63,7 @@ class EventListenerProcessorTest { @Mock private Environment environment; - private EventListenerProcessor eventListenerProcessor; + private EventListenerProcessorImpl eventListenerProcessor; private TestEventListenerBean testBean; @BeforeEach @@ -78,7 +78,7 @@ void setUp() { // Mock environment to resolve placeholders (lenient because not all tests use it) lenient().when(environment.resolvePlaceholders(any())).thenAnswer(invocation -> invocation.getArgument(0)); - eventListenerProcessor = new EventListenerProcessor( + eventListenerProcessor = new EventListenerProcessorImpl( applicationContext, applicationEventPublisher, customErrorHandlerRegistry, environment ); } diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/publisher/DestinationAwarePublisherTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/publisher/DestinationAwarePublisherTest.java index d86dc37fc..2597deb23 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/publisher/DestinationAwarePublisherTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/publisher/DestinationAwarePublisherTest.java @@ -40,7 +40,7 @@ class DestinationAwarePublisherTest { @Mock(lenient = true) private EventPublisher delegate; - private DestinationAwarePublisher publisher; + private DestinationAwarePublisherImpl publisher; private final String customDefaultDestination = "custom-destination"; @BeforeEach @@ -49,7 +49,7 @@ void setUp() { when(delegate.isAvailable()).thenReturn(true); when(delegate.getDefaultDestination()).thenReturn("delegate-default"); - publisher = new DestinationAwarePublisher(delegate, customDefaultDestination); + publisher = new DestinationAwarePublisherImpl(delegate, customDefaultDestination); } @Test @@ -118,7 +118,7 @@ void shouldUseExplicitDestinationWhenProvided() { @DisplayName("Should fall back to delegate default when custom default is null") void shouldFallBackToDelegateDefaultWhenCustomDefaultIsNull() { // Given - DestinationAwarePublisher publisherWithNullCustom = new DestinationAwarePublisher(delegate, null); + DestinationAwarePublisherImpl publisherWithNullCustom = new DestinationAwarePublisherImpl(delegate, null); Object event = new Object(); String delegateDefault = "delegate-default"; when(delegate.publish(any(), eq(delegateDefault), any())).thenReturn(Mono.empty()); @@ -135,7 +135,7 @@ void shouldFallBackToDelegateDefaultWhenCustomDefaultIsNull() { @DisplayName("Should fall back to delegate default when custom default is empty") void shouldFallBackToDelegateDefaultWhenCustomDefaultIsEmpty() { // Given - DestinationAwarePublisher publisherWithEmptyCustom = new DestinationAwarePublisher(delegate, ""); + DestinationAwarePublisherImpl publisherWithEmptyCustom = new DestinationAwarePublisherImpl(delegate, ""); Object event = new Object(); String delegateDefault = "delegate-default"; when(delegate.publish(any(), eq(delegateDefault), any())).thenReturn(Mono.empty()); @@ -187,7 +187,7 @@ void shouldReturnCustomDefaultDestinationFromGetDefaultDestination() { @DisplayName("Should return delegate default when custom default is null") void shouldReturnDelegateDefaultWhenCustomDefaultIsNull() { // Given - DestinationAwarePublisher publisherWithNullCustom = new DestinationAwarePublisher(delegate, null); + DestinationAwarePublisherImpl publisherWithNullCustom = new DestinationAwarePublisherImpl(delegate, null); // When String defaultDestination = publisherWithNullCustom.getDefaultDestination(); @@ -318,7 +318,7 @@ void shouldHandleDestinationResolutionPriorityCorrectly() { verify(delegate).publish(event, customDefaultDestination, null); // 3. Delegate default (when custom is null) - DestinationAwarePublisher publisherWithNullCustom = new DestinationAwarePublisher(delegate, null); + DestinationAwarePublisherImpl publisherWithNullCustom = new DestinationAwarePublisherImpl(delegate, null); reset(delegate); when(delegate.getDefaultDestination()).thenReturn("delegate-default"); when(delegate.publish(any(), eq("delegate-default"), any())).thenReturn(Mono.empty()); diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/publisher/EventPublisherFactoryDynamicDestinationTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/publisher/EventPublisherFactoryDynamicDestinationTest.java index f9cbed8bb..ea16f1172 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/publisher/EventPublisherFactoryDynamicDestinationTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/publisher/EventPublisherFactoryDynamicDestinationTest.java @@ -95,7 +95,7 @@ void shouldReturnDestinationAwarePublisherWithCustomDestination() { // Then assertThat(publisher).isNotNull(); - assertThat(publisher).isInstanceOf(DestinationAwarePublisher.class); + assertThat(publisher).isInstanceOf(DestinationAwarePublisherImpl.class); assertThat(publisher.getDefaultDestination()).isEqualTo("custom-topic"); assertThat(publisher.getPublisherType()).isEqualTo(PublisherType.KAFKA); } @@ -109,7 +109,7 @@ void shouldReturnDestinationAwarePublisherWithConnectionIdAndCustomDestination() // Then assertThat(publisher).isNotNull(); - assertThat(publisher).isInstanceOf(DestinationAwarePublisher.class); + assertThat(publisher).isInstanceOf(DestinationAwarePublisherImpl.class); assertThat(publisher.getDefaultDestination()).isEqualTo("custom-exchange"); assertThat(publisher.getPublisherType()).isEqualTo(PublisherType.RABBITMQ); } @@ -122,7 +122,7 @@ void shouldReturnStandardPublisherWhenCustomDestinationIsNull() { // Then assertThat(publisher).isNotNull(); - assertThat(publisher).isNotInstanceOf(DestinationAwarePublisher.class); + assertThat(publisher).isNotInstanceOf(DestinationAwarePublisherImpl.class); assertThat(publisher).isSameAs(mockKafkaPublisher); } @@ -134,7 +134,7 @@ void shouldReturnStandardPublisherWhenCustomDestinationIsEmpty() { // Then assertThat(publisher).isNotNull(); - assertThat(publisher).isNotInstanceOf(DestinationAwarePublisher.class); + assertThat(publisher).isNotInstanceOf(DestinationAwarePublisherImpl.class); assertThat(publisher).isSameAs(mockKafkaPublisher); } @@ -146,7 +146,7 @@ void shouldReturnStandardPublisherWhenCustomDestinationIsWhitespace() { // Then assertThat(publisher).isNotNull(); - assertThat(publisher).isNotInstanceOf(DestinationAwarePublisher.class); + assertThat(publisher).isNotInstanceOf(DestinationAwarePublisherImpl.class); assertThat(publisher).isSameAs(mockKafkaPublisher); } @@ -168,7 +168,7 @@ void shouldReturnDefaultPublisherWithCustomDestination() { // Then assertThat(publisher).isNotNull(); - assertThat(publisher).isInstanceOf(DestinationAwarePublisher.class); + assertThat(publisher).isInstanceOf(DestinationAwarePublisherImpl.class); assertThat(publisher.getDefaultDestination()).isEqualTo("custom-default-topic"); assertThat(publisher.getPublisherType()).isEqualTo(PublisherType.KAFKA); // Default type } diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisherTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisherTest.java index 836a0cd04..346280777 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisherTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/publisher/SpringApplicationEventPublisherTest.java @@ -56,7 +56,7 @@ class SpringApplicationEventPublisherTest { @Autowired - private SpringApplicationEventPublisher publisher; + private SpringApplicationEventPublisherImpl publisher; @Autowired private TestEventListener testEventListener; diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroDeclaredTypeTrustTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroDeclaredTypeTrustTest.java index a58559f90..125b6bcf8 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroDeclaredTypeTrustTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroDeclaredTypeTrustTest.java @@ -78,12 +78,12 @@ public static class Specific extends SpecificRecordBase { public Object get(int index) { return switch(index) { case 0 -> name; case 1 -> child; case 2 -> fixed; default -> throw new IndexOutOfBoundsException(); }; } public void put(int index, Object value) { switch(index) { case 0 -> name = (CharSequence)value; case 1 -> child = value; case 2 -> fixed = (Fixed)value; default -> throw new IndexOutOfBoundsException(); } } } - private final AvroMessageSerializer serializer = new AvroMessageSerializer(); + private final AvroMessageSerializerImpl serializer = new AvroMessageSerializerImpl(); private Value value() { Value v = new Value(); v.children = List.of(new Child("list")); v.labels = Set.of("label"); v.values = Map.of("key", new Child("map")); v.array = new Child[]{new Child("array")}; v.kind = Kind.SECOND; v.bytes = new byte[]{0,1,-1}; v.buffer = ByteBuffer.wrap(new byte[]{3,4}); return v; } @Test void nestedCollectionsEnumsArraysAndBytesRoundTrip() { Value a = serializer.deserialize(serializer.serialize(value()), Value.class); assertThat(a.children.getFirst().name).isEqualTo("list"); assertThat(a.labels).containsExactly("label"); assertThat(a.values.get("key").name).isEqualTo("map"); assertThat(a.array[0].name).isEqualTo("array"); assertThat(a.kind).isEqualTo(Kind.SECOND); assertThat(a.bytes).containsExactly(0,1,-1); assertThat(a.buffer).isEqualTo(ByteBuffer.wrap(new byte[]{3,4})); } @Test void emptyContainersRoundTrip() { Value v=value(); v.children=List.of();v.labels=Set.of();v.values=Map.of();v.array=new Child[0];Value a=serializer.deserialize(serializer.serialize(v),Value.class);assertThat(a.children).isEmpty();assertThat(a.labels).isEmpty();assertThat(a.values).isEmpty();assertThat(a.array).isEmpty(); } @Test void nullAndRawBytesStayCompatible() { byte[] b={1,2}; assertThat(serializer.serialize(null)).isEmpty();assertThat(serializer.deserialize((byte[])null,Value.class)).isNull();assertThat(serializer.deserialize(new byte[0],Object.class)).isNull();assertThat(serializer.serialize(b)).isSameAs(b);assertThat(serializer.deserialize(b,byte[].class)).isSameAs(b); } - @Test void concreteObjectOptInIsExactlyOneRoot() { var bound=new AvroMessageSerializer(new AvroTypeBindings(Set.of(),Child.class));byte[] b=bound.serialize(new Child("bound"));assertThat(((Child)bound.deserialize(b,Object.class)).name).isEqualTo("bound");assertThatThrownBy(()->serializer.deserialize(b,Object.class)).isInstanceOf(SerializationException.class); } + @Test void concreteObjectOptInIsExactlyOneRoot() { var bound=new AvroMessageSerializerImpl(new AvroTypeBindings(Set.of(),Child.class));byte[] b=bound.serialize(new Child("bound"));assertThat(((Child)bound.deserialize(b,Object.class)).name).isEqualTo("bound");assertThatThrownBy(()->serializer.deserialize(b,Object.class)).isInstanceOf(SerializationException.class); } @Test void rawGenericIsRefused() { assertThat(serializer.canSerialize(Raw.class)).isFalse();assertThatThrownBy(()->serializer.serialize(new Raw())).isInstanceOf(SerializationException.class); } @Test void unknownObjectFieldIsRefused() { assertThat(serializer.canSerialize(Unknown.class)).isFalse();assertThatThrownBy(()->serializer.serialize(new Unknown())).isInstanceOf(SerializationException.class); } @Test void unapprovedSubclassIsRefused() { Typed v=new Typed();v.value=new Other();v.value.name="other";assertThatThrownBy(()->serializer.serialize(v)).isInstanceOf(SerializationException.class); } @@ -95,14 +95,14 @@ public static class Specific extends SpecificRecordBase { @Test void finiteRecursiveValuesRoundTrip() { Node n=new Node();n.name="root";n.next=new Node();n.next.name="leaf";Node a=serializer.deserialize(serializer.serialize(n),Node.class);assertThat(a.next.name).isEqualTo("leaf");assertThat(a.next.next).isNull(); } @Test void valueDepthIsBounded() { Node n=new Node();n.name="0";Node current=n;for(int i=0;i<34;i++){current.next=new Node();current=current.next;current.name="x";}assertThatThrownBy(()->serializer.serialize(n)).isInstanceOf(SerializationException.class); } @Test void sharedAcyclicChildIsAllowed() { Value v=value();v.array=new Child[]{v.children.getFirst(),v.children.getFirst()};Value a=serializer.deserialize(serializer.serialize(v),Value.class);assertThat(a.array).extracting(c->c.name).containsExactly("list","list"); } - @Test void generatedSpecificNestedBranchesRequireExplicitTokens() { Specific v=new Specific();v.name="specific";v.child=new SpecificChild("nested");v.fixed=new Fixed(new byte[]{7,8});assertThatThrownBy(()->serializer.serialize(v)).isInstanceOf(SerializationException.class);var bound=new AvroMessageSerializer(new AvroTypeBindings(Set.of(SpecificChild.class),null));Specific a=bound.deserialize(bound.serialize(v),Specific.class);assertThat(a.name.toString()).isEqualTo("specific");assertThat(((SpecificChild)a.child).name.toString()).isEqualTo("nested");assertThat(a.fixed.bytes()).containsExactly(7,8); } + @Test void generatedSpecificNestedBranchesRequireExplicitTokens() { Specific v=new Specific();v.name="specific";v.child=new SpecificChild("nested");v.fixed=new Fixed(new byte[]{7,8});assertThatThrownBy(()->serializer.serialize(v)).isInstanceOf(SerializationException.class);var bound=new AvroMessageSerializerImpl(new AvroTypeBindings(Set.of(SpecificChild.class),null));Specific a=bound.deserialize(bound.serialize(v),Specific.class);assertThat(a.name.toString()).isEqualTo("specific");assertThat(((SpecificChild)a.child).name.toString()).isEqualTo("nested");assertThat(a.fixed.bytes()).containsExactly(7,8); } @Test void genericRecordEncodingWithoutHintsRemainsSupported() { Schema schema=SchemaBuilder.record("Plain").fields().requiredString("value").endRecord();var record=new GenericData.Record(schema);record.put("value","generic");assertThat(serializer.serialize(record)).isNotEmpty();assertThatThrownBy(()->serializer.deserialize(new byte[]{1},org.apache.avro.generic.GenericRecord.class)).isInstanceOf(SerializationException.class); } @Test void genericRecordCannotGrantJavaClassAuthority() { Schema schema=SchemaBuilder.record("Plain").fields().requiredString("value").endRecord();schema.addProp("java-class",Child.class.getName());var record=new GenericData.Record(schema);record.put("value","generic");assertThatThrownBy(()->serializer.serialize(record)).isInstanceOf(SerializationException.class); } @Test void capabilityPreservesPrimitiveEnumInterfaceAndTimeExclusions() { assertThat(serializer.canSerialize(int.class)).isFalse();assertThat(serializer.canSerialize(Kind.class)).isFalse();assertThat(serializer.canSerialize(Runnable.class)).isFalse();assertThat(serializer.canSerialize(java.time.Instant.class)).isFalse(); } - @Test void unsupportedObjectBindingIsRefused() { assertThatThrownBy(()->new AvroMessageSerializer(new AvroTypeBindings(Set.of(),Object.class))).isInstanceOf(IllegalArgumentException.class); } + @Test void unsupportedObjectBindingIsRefused() { assertThatThrownBy(()->new AvroMessageSerializerImpl(new AvroTypeBindings(Set.of(),Object.class))).isInstanceOf(IllegalArgumentException.class); } @Test void bindingsAreSnapshotted() { Set> set=new HashSet<>();set.add(Child.class);var b=new AvroTypeBindings(set,null);set.clear();assertThat(b.schemaTypes()).containsExactly(Child.class);assertThatThrownBy(()->b.schemaTypes().clear()).isInstanceOf(UnsupportedOperationException.class); } @Test void truncatedArrayIsRejected() { byte[] b=serializer.serialize(value());assertThatThrownBy(()->serializer.deserialize(Arrays.copyOf(b,b.length-2),Value.class)).isInstanceOf(SerializationException.class); } - @Test void interleavedInstancesDoNotLeakBindingsOrGlobalPolicy() throws Exception { boolean before=stockPermits();var allowed=new AvroMessageSerializer(new AvroTypeBindings(Set.of(),Child.class));try(var pool=Executors.newFixedThreadPool(4)){List> tasks=new ArrayList<>();for(int i=0;i<100;i++)tasks.add(()->{byte[] b=allowed.serialize(new Child("x"));assertThat(((Child)allowed.deserialize(b,Object.class)).name).isEqualTo("x");assertThatThrownBy(()->serializer.deserialize(b,Object.class)).isInstanceOf(SerializationException.class);return true;});for(var f:pool.invokeAll(tasks))assertThat(f.get()).isTrue();}assertThat(stockPermits()).isEqualTo(before); } + @Test void interleavedInstancesDoNotLeakBindingsOrGlobalPolicy() throws Exception { boolean before=stockPermits();var allowed=new AvroMessageSerializerImpl(new AvroTypeBindings(Set.of(),Child.class));try(var pool=Executors.newFixedThreadPool(4)){List> tasks=new ArrayList<>();for(int i=0;i<100;i++)tasks.add(()->{byte[] b=allowed.serialize(new Child("x"));assertThat(((Child)allowed.deserialize(b,Object.class)).name).isEqualTo("x");assertThatThrownBy(()->serializer.deserialize(b,Object.class)).isInstanceOf(SerializationException.class);return true;});for(var f:pool.invokeAll(tasks))assertThat(f.get()).isTrue();}assertThat(stockPermits()).isEqualTo(before); } private static int encodingConstructors; public static class Encoding extends CustomEncoding { public Encoding() { encodingConstructors++; } @@ -116,7 +116,7 @@ public static class Many { public List values; public Many() {} } public static class Empty { public Empty() {} } public static class EmptyArray { public Empty[] values; public EmptyArray() {} } @Test void customEncodingIsRefusedBeforeConstruction() { Encoded v=new Encoded();v.value=new Child("x");assertThatThrownBy(()->serializer.serialize(v)).isInstanceOf(SerializationException.class);assertThat(encodingConstructors).isZero(); } - @Test void extraKnownTokenAtWrongSchemaLocationIsRefused() { WrongHint v=new WrongHint();v.value="x";var bound=new AvroMessageSerializer(new AvroTypeBindings(Set.of(Child.class),null));assertThatThrownBy(()->bound.serialize(v)).isInstanceOf(SerializationException.class); } + @Test void extraKnownTokenAtWrongSchemaLocationIsRefused() { WrongHint v=new WrongHint();v.value="x";var bound=new AvroMessageSerializerImpl(new AvroTypeBindings(Set.of(Child.class),null));assertThatThrownBy(()->bound.serialize(v)).isInstanceOf(SerializationException.class); } @Test void genericValueCycleIsRefused() { Schema schema=Schema.createRecord("Cycle",null,"probe",false);schema.setFields(List.of(new Schema.Field("next",Schema.createUnion(Schema.create(Schema.Type.NULL),schema),null,(Object)null)));var value=new GenericData.Record(schema);value.put("next",value);assertThatThrownBy(()->serializer.serialize(value)).isInstanceOf(SerializationException.class); } @Test void actualValueVisitCountIsBounded() { Many v=new Many();v.values=Collections.nCopies(100001,new Child("x"));assertThatThrownBy(()->serializer.serialize(v)).isInstanceOf(SerializationException.class); } @Test void zeroWidthArraysRoundTripAndRejectTruncatedCounts() { EmptyArray v=new EmptyArray();v.values=new Empty[]{new Empty(),new Empty()};EmptyArray a=serializer.deserialize(serializer.serialize(v),EmptyArray.class);assertThat(a.values).hasSize(2);assertThatThrownBy(()->serializer.deserialize(new byte[]{(byte)0x80},EmptyArray.class)).isInstanceOf(SerializationException.class); } @@ -162,7 +162,7 @@ public static class TooManyBranches { @Union({Child.class,String.class,Integer.c @Test void additionalTokenCountIsBounded() { assertThatThrownBy(()->new AvroTypeBindings(Set.of(Child.class,String.class,Integer.class,Long.class,Float.class,Double.class,Boolean.class,Byte.class,Short.class,Character.class,Kind.class,Node.class,Value.class,Typed.class,Specific.class,SpecificChild.class,Fixed.class),null)).isInstanceOf(IllegalArgumentException.class); } @Test void declaredFieldCountIsBounded() { assertThat(serializer.canSerialize(generated("TooManyFields", java.util.stream.IntStream.range(0,4097).mapToObj(i->"public int f"+i+";").collect(java.util.stream.Collectors.joining())) )).isFalse(); } @Test void distinctDeclaredTypeCountIsBounded() { assertThat(serializer.canSerialize(generated("TooManyTypes", java.util.stream.IntStream.range(0,130).mapToObj(i->"public java.util.List f"+i+";public static class Bound"+i+"{}").collect(java.util.stream.Collectors.joining())) )).isFalse(); } - @Test void identicalNamesFromDifferentLoadersAreRejected() throws Exception { byte[] bytes;try(var in=Child.class.getResourceAsStream("AvroDeclaredTypeTrustTest$Child.class")){bytes=Objects.requireNonNull(in).readAllBytes();}class Loader extends ClassLoader { Class define(byte[] code) { return defineClass(null,code,0,code.length); } }Class duplicate=new Loader().define(bytes);assertThat(duplicate.getName()).isEqualTo(Child.class.getName());assertThat(duplicate).isNotSameAs(Child.class);assertThatThrownBy(()->new AvroMessageSerializer(new AvroTypeBindings(Set.of(duplicate),Child.class))).isInstanceOf(IllegalArgumentException.class); } + @Test void identicalNamesFromDifferentLoadersAreRejected() throws Exception { byte[] bytes;try(var in=Child.class.getResourceAsStream("AvroDeclaredTypeTrustTest$Child.class")){bytes=Objects.requireNonNull(in).readAllBytes();}class Loader extends ClassLoader { Class define(byte[] code) { return defineClass(null,code,0,code.length); } }Class duplicate=new Loader().define(bytes);assertThat(duplicate.getName()).isEqualTo(Child.class.getName());assertThat(duplicate).isNotSameAs(Child.class);assertThatThrownBy(()->new AvroMessageSerializerImpl(new AvroTypeBindings(Set.of(duplicate),Child.class))).isInstanceOf(IllegalArgumentException.class); } @Test void trustPropertiesStayUnchanged() { String classes=System.getProperty("org.apache.avro.SERIALIZABLE_CLASSES"),packages=System.getProperty("org.apache.avro.SERIALIZABLE_PACKAGES");serializer.deserialize(serializer.serialize(new Child("x")),Child.class);assertThat(System.getProperty("org.apache.avro.SERIALIZABLE_CLASSES")).isEqualTo(classes);assertThat(System.getProperty("org.apache.avro.SERIALIZABLE_PACKAGES")).isEqualTo(packages); } private static Class generated(String name, String body) { var compiler = javax.tools.ToolProvider.getSystemJavaCompiler(); diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroMessageSerializerTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroMessageSerializerTest.java index 53542997b..77e8ca3e2 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroMessageSerializerTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroMessageSerializerTest.java @@ -44,11 +44,11 @@ @DisplayName("AvroMessageSerializer Tests") class AvroMessageSerializerTest { - private AvroMessageSerializer serializer; + private AvroMessageSerializerImpl serializer; @BeforeEach void setUp() { - serializer = new AvroMessageSerializer(); + serializer = new AvroMessageSerializerImpl(); } @Test @@ -232,7 +232,7 @@ void shouldProduceMoreCompactOutputThanJsonForSimpleObjects() throws Serializati // Configure ObjectMapper with JavaTimeModule for proper JSON serialization com.fasterxml.jackson.databind.ObjectMapper objectMapper = new com.fasterxml.jackson.databind.ObjectMapper(); objectMapper.registerModule(new com.fasterxml.jackson.datatype.jsr310.JavaTimeModule()); - JsonMessageSerializer jsonSerializer = new JsonMessageSerializer(objectMapper); + JsonMessageSerializerImpl jsonSerializer = new JsonMessageSerializerImpl(objectMapper); // Act byte[] avroSerialized = serializer.serialize(testObject); diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroReadBudgetTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroReadBudgetTest.java index ae04aa67c..7c0b5976a 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroReadBudgetTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/serialization/AvroReadBudgetTest.java @@ -84,19 +84,19 @@ public static class SpecificMany extends SpecificRecordBase { } @Test void shallowIncomingReflectedRecursionRemainsSupported() throws IOException { - var value = new AvroMessageSerializer().deserialize(nodes(4), ReflectedNode.class); + var value = new AvroMessageSerializerImpl().deserialize(nodes(4), ReflectedNode.class); assertThat(value.name).isEmpty(); assertThat(value.next.next.next.next).isNull(); } @Test void shallowIncomingSpecificRecursionRemainsSupported() throws IOException { - var value = new AvroMessageSerializer().deserialize(nodes(4), SpecificNode.class); + var value = new AvroMessageSerializerImpl().deserialize(nodes(4), SpecificNode.class); assertThat(value.name.toString()).isEmpty(); assertThat(value.next.next.next.next).isNull(); } @Test void deepIncomingReflectedRecursionIsRejectedBeforeConstructionExhaustsTheStack() throws IOException { - var serializer = new AvroMessageSerializer(); + var serializer = new AvroMessageSerializerImpl(); byte[] data = nodes(20_000); ReflectedNode.constructions = 0; assertThatThrownBy(() -> serializer.deserialize(data, ReflectedNode.class)) @@ -108,7 +108,7 @@ public static class SpecificMany extends SpecificRecordBase { } @Test void deepIncomingSpecificRecursionIsRejectedBeforeConstructionExhaustsTheStack() throws IOException { - var serializer = new AvroMessageSerializer(); + var serializer = new AvroMessageSerializerImpl(); byte[] data = nodes(20_000); SpecificNode.constructions = 0; assertThatThrownBy(() -> serializer.deserialize(data, SpecificNode.class)) @@ -122,7 +122,7 @@ public static class SpecificMany extends SpecificRecordBase { @Test void incomingReflectedRecordVisitsAreRejectedDuringReading() throws IOException { byte[] data = emptyRecords(100_001); Empty.constructions = 0; - assertThatThrownBy(() -> new AvroMessageSerializer().deserialize(data, ReflectedMany.class)) + assertThatThrownBy(() -> new AvroMessageSerializerImpl().deserialize(data, ReflectedMany.class)) .isInstanceOf(SerializationException.class) .hasRootCauseMessage("Avro read traversal exceeds bounds"); assertThat(Empty.constructions).isBetween(1, 100_000); @@ -131,7 +131,7 @@ public static class SpecificMany extends SpecificRecordBase { @Test void incomingSpecificRecordVisitsAreRejectedDuringReading() throws IOException { byte[] data = emptyRecords(100_001); SpecificEmpty.constructions = 0; - assertThatThrownBy(() -> new AvroMessageSerializer().deserialize(data, SpecificMany.class)) + assertThatThrownBy(() -> new AvroMessageSerializerImpl().deserialize(data, SpecificMany.class)) .isInstanceOf(SerializationException.class) .hasRootCauseMessage("Avro read traversal exceeds bounds"); assertThat(SpecificEmpty.constructions).isBetween(1, 100_000); diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/serialization/JsonMessageSerializerTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/serialization/JsonMessageSerializerTest.java index f4984d7a3..e6f15427f 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/serialization/JsonMessageSerializerTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/serialization/JsonMessageSerializerTest.java @@ -43,14 +43,14 @@ */ class JsonMessageSerializerTest { - private JsonMessageSerializer serializer; + private JsonMessageSerializerImpl serializer; private ObjectMapper objectMapper; @BeforeEach void setUp() { objectMapper = new ObjectMapper(); objectMapper.registerModule(new JavaTimeModule()); - serializer = new JsonMessageSerializer(objectMapper); + serializer = new JsonMessageSerializerImpl(objectMapper); } @Test diff --git a/modules/eda/src/test/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializerTest.java b/modules/eda/src/test/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializerTest.java index e03f8bd9f..7c4e7b0f1 100644 --- a/modules/eda/src/test/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializerTest.java +++ b/modules/eda/src/test/java/org/fireflyframework/eda/serialization/ProtobufMessageSerializerTest.java @@ -43,11 +43,11 @@ @DisplayName("ProtobufMessageSerializer Tests") class ProtobufMessageSerializerTest { - private ProtobufMessageSerializer serializer; + private ProtobufMessageSerializerImpl serializer; @BeforeEach void setUp() { - serializer = new ProtobufMessageSerializer(); + serializer = new ProtobufMessageSerializerImpl(); } @Test diff --git a/modules/eventsourcing/docs/README.md b/modules/eventsourcing/docs/README.md index bf78f21f0..4ea01982a 100644 --- a/modules/eventsourcing/docs/README.md +++ b/modules/eventsourcing/docs/README.md @@ -24,16 +24,16 @@ Read the documents in this order to go from "what is event sourcing?" to "I can | `o.f.eventsourcing.aggregate` | `AggregateRoot`, `EventHandlerException` | | `o.f.eventsourcing.annotation` | `@DomainEvent`, `@EventSourcingTransactional` | | `o.f.eventsourcing.store` | `EventStore`, `ConcurrencyException`, `EventStoreException` | -| `o.f.eventsourcing.store.r2dbc` | `R2dbcEventStore`, `EventEntity`, `GenericEvent` | +| `o.f.eventsourcing.store.r2dbc` | `R2dbcEventStoreImpl`, `EventEntity`, `GenericEvent` | | `o.f.eventsourcing.snapshot` | `Snapshot`, `AbstractSnapshot`, `SnapshotStore`, `SnapshotTrigger` | -| `o.f.eventsourcing.snapshot.r2dbc` | `R2dbcSnapshotStore` | +| `o.f.eventsourcing.snapshot.r2dbc` | `R2dbcSnapshotStoreImpl` | | `o.f.eventsourcing.config` | Auto-configuration classes, `EventSourcingProperties`, `EventTypeRegistry` | | `o.f.eventsourcing.publisher` | `EventSourcingPublisher` | | `o.f.eventsourcing.outbox` | `EventOutboxService`, `EventOutboxProcessor`, `EventOutboxRepository` | -| `o.f.eventsourcing.projection` | `ProjectionService`, `ProjectionHealth`, `ProjectionMetrics` | +| `o.f.eventsourcing.projection` | `ProjectionService`, `ProjectionHealth`, `ProjectionMetricsImpl` | | `o.f.eventsourcing.transaction` | `EventSourcingTransactionalAspect` | | `o.f.eventsourcing.logging` | `EventSourcingLoggingContext` (16 MDC keys) | -| `o.f.eventsourcing.monitoring` | `EventStoreMetrics` | +| `o.f.eventsourcing.monitoring` | `EventStoreMetricsImpl` | | `o.f.eventsourcing.health` | Health indicators for EventStore, Outbox, Snapshot, Projection | | `o.f.eventsourcing.resilience` | `CircuitBreakerAutoConfiguration` | | `o.f.eventsourcing.multitenancy` | `TenantContext`, `MultiTenancyAutoConfiguration` | diff --git a/modules/eventsourcing/docs/api-reference.md b/modules/eventsourcing/docs/api-reference.md index 94bb87c6f..d25594715 100644 --- a/modules/eventsourcing/docs/api-reference.md +++ b/modules/eventsourcing/docs/api-reference.md @@ -130,7 +130,7 @@ Mono loadEventStream(UUID aggregateId, String aggregateType, long f Mono loadEventStream(UUID aggregateId, String aggregateType, long fromVersion, long toVersion); -// Get current aggregate version (-1 if not found, per R2dbcEventStore) +// Get current aggregate version (-1 if not found, per R2dbcEventStoreImpl) Mono getAggregateVersion(UUID aggregateId, String aggregateType); // Check if aggregate exists (version >= 0) diff --git a/modules/eventsourcing/docs/architecture.md b/modules/eventsourcing/docs/architecture.md index de641e308..2604ca62c 100644 --- a/modules/eventsourcing/docs/architecture.md +++ b/modules/eventsourcing/docs/architecture.md @@ -12,8 +12,8 @@ +----------------------+ +------------------------+ | Domain Layer | | Infrastructure Layer | | | | | -| Event | | R2dbcEventStore | -| AbstractDomainEvent | | R2dbcSnapshotStore | +| Event | | R2dbcEventStoreImpl | +| AbstractDomainEvent | | R2dbcSnapshotStoreImpl | | AggregateRoot | | EventTypeRegistry | | @DomainEvent | | EventOutboxService | | StoredEventEnvelope | | EventSourcingPublisher | @@ -101,7 +101,7 @@ Event handler resolution (in the private `applyEvent` method): ## Infrastructure Layer -### R2dbcEventStore +### R2dbcEventStoreImpl Implements `EventStore` using Spring R2DBC `DatabaseClient`. Key behaviors: @@ -112,7 +112,7 @@ Implements `EventStore` using Spring R2DBC `DatabaseClient`. Key behaviors: JSON data is bound as `String` (TEXT columns), not as JSONB. This makes the store database-agnostic. -### R2dbcSnapshotStore +### R2dbcSnapshotStoreImpl Implements `SnapshotStore` using `DatabaseClient`. The `snapshots` table has a composite PK of `(aggregate_id, aggregate_type)`, meaning only one snapshot per aggregate is stored (UPSERT on save). @@ -175,13 +175,13 @@ The library has 9 auto-configuration classes. They are loaded via Spring Boot's | Order | Class | Condition | Creates | |-------|-------|-----------|---------| | 1 | `R2dbcBeansAutoConfiguration` | `@ConditionalOnClass(ConnectionFactory, R2dbcEntityTemplate)` | `DatabaseClient`, `R2dbcEntityTemplate` (fallbacks) | -| 2 | `EventStoreAutoConfiguration` | `@AutoConfigureAfter(R2dbcBeansAutoConfiguration)`, `@ConditionalOnBean(DatabaseClient, R2dbcEntityTemplate, ConnectionFactory)` | `R2dbcEventStore` | -| 3 | `SnapshotAutoConfiguration` | `firefly.eventsourcing.snapshot.enabled=true` (default) | `R2dbcSnapshotStore`, `SnapshotTrigger` | -| 4 | `EventSourcingAutoConfiguration` | `firefly.eventsourcing.enabled=true` (default) | `EventSourcingPublisher`, `ObjectMapper`, `EventStoreMetrics`, `EventTypeRegistry`, `EventSourcingTransactionalAspect`, `EventUpcastingService`, `EventOutboxService`, `EventOutboxProcessor` | +| 2 | `EventStoreAutoConfiguration` | `@AutoConfigureAfter(R2dbcBeansAutoConfiguration)`, `@ConditionalOnBean(DatabaseClient, R2dbcEntityTemplate, ConnectionFactory)` | `R2dbcEventStoreImpl` | +| 3 | `SnapshotAutoConfiguration` | `firefly.eventsourcing.snapshot.enabled=true` (default) | `R2dbcSnapshotStoreImpl`, `SnapshotTrigger` | +| 4 | `EventSourcingAutoConfiguration` | `firefly.eventsourcing.enabled=true` (default) | `EventSourcingPublisher`, `ObjectMapper`, `EventStoreMetricsImpl`, `EventTypeRegistry`, `EventSourcingTransactionalAspect`, `EventUpcastingService`, `EventOutboxService`, `EventOutboxProcessor` | | 5 | `EventSourcingJacksonConfiguration` | `@ConditionalOnMissingBean(ObjectMapper)` | `ObjectMapper` with JavaTimeModule, polymorphic Event handling | -| 6 | `EventSourcingHealthAutoConfiguration` | `@ConditionalOnClass(HealthIndicator)` | `EventStoreHealthIndicator`, `OutboxHealthIndicator`, `SnapshotStoreHealthIndicator`, `ProjectionHealthIndicator` | -| 7 | `EventSourcingMetricsAutoConfiguration` | `@ConditionalOnClass(MeterRegistry)` | `EventStoreMetrics` | -| 8 | `EventSourcingProjectionAutoConfiguration` | `@ConditionalOnClass(ProjectionService, MeterRegistry)` | `ProjectionHealthIndicator` | +| 6 | `EventSourcingHealthAutoConfiguration` | `@ConditionalOnClass(HealthIndicator)` | `EventStoreHealthIndicatorImpl`, `OutboxHealthIndicatorImpl`, `SnapshotStoreHealthIndicatorImpl`, `ProjectionHealthIndicatorImpl` | +| 7 | `EventSourcingMetricsAutoConfiguration` | `@ConditionalOnClass(MeterRegistry)` | `EventStoreMetricsImpl` | +| 8 | `EventSourcingProjectionAutoConfiguration` | `@ConditionalOnClass(ProjectionService, MeterRegistry)` | `ProjectionHealthIndicatorImpl` | | 9 | `CircuitBreakerAutoConfiguration` | `@ConditionalOnClass(CircuitBreaker)`, `firefly.eventsourcing.resilience.circuit-breaker.enabled=true` (default: false) | `eventStoreCircuitBreaker`, `outboxCircuitBreaker`, `projectionCircuitBreaker` | Additionally, `MultiTenancyAutoConfiguration` loads when `firefly.eventsourcing.multitenancy.enabled=true` (default: false). diff --git a/modules/eventsourcing/docs/database-schema.md b/modules/eventsourcing/docs/database-schema.md index 5367388c6..0abaff628 100644 --- a/modules/eventsourcing/docs/database-schema.md +++ b/modules/eventsourcing/docs/database-schema.md @@ -34,7 +34,7 @@ CREATE TABLE events ( Key points: - `event_data` and `metadata` are TEXT, not JSONB. This makes the store database-agnostic. -- `global_sequence` is BIGSERIAL -- the database auto-assigns it. The R2dbcEventStore INSERT statement excludes `global_sequence`. +- `global_sequence` is BIGSERIAL -- the database auto-assigns it. The R2dbcEventStoreImpl INSERT statement excludes `global_sequence`. - The `UNIQUE(aggregate_id, aggregate_version)` constraint enforces optimistic concurrency at the database level. V1 Indexes: diff --git a/modules/eventsourcing/docs/optional-enhancements.md b/modules/eventsourcing/docs/optional-enhancements.md index 58f4af351..6a7a4d32f 100644 --- a/modules/eventsourcing/docs/optional-enhancements.md +++ b/modules/eventsourcing/docs/optional-enhancements.md @@ -65,7 +65,7 @@ Each breaker logs state transitions at `WARN` level and errors at `ERROR` level ## Metrics (Micrometer) -`EventStoreMetrics` extends `FireflyMetricsSupport` (from `fireflyframework-observability`) and registers the following metrics when a `MeterRegistry` is on the classpath. +`EventStoreMetricsImpl` extends `FireflyMetricsSupport` (from `fireflyframework-observability`) and registers the following metrics when a `MeterRegistry` is on the classpath. ### Metrics Reference @@ -96,10 +96,10 @@ The auto-configuration class is `EventSourcingMetricsAutoConfiguration` (`@Condi ### PerformanceSummary -`EventStoreMetrics` provides a `getPerformanceSummary()` method that returns a `PerformanceSummary` object with all current metric values. This is useful for custom monitoring dashboards: +`EventStoreMetricsImpl` provides a `getPerformanceSummary()` method that returns a `PerformanceSummary` object with all current metric values. This is useful for custom monitoring dashboards: ```java -EventStoreMetrics.PerformanceSummary summary = eventStoreMetrics.getPerformanceSummary(); +EventStoreMetricsImpl.PerformanceSummary summary = eventStoreMetrics.getPerformanceSummary(); log.info("Average append time: {}ms, events appended: {}, conflicts: {}", summary.getAverageAppendTime(), summary.getEventsAppended(), @@ -114,10 +114,10 @@ When Spring Boot Actuator is on the classpath, the library registers four health | Indicator | Bean | Condition | Checks | |-----------|------|-----------|--------| -| `EventStoreHealthIndicator` | `eventStoreHealthIndicator` | `EventStore` bean exists | Event store connectivity | -| `OutboxHealthIndicator` | `outboxHealthIndicator` | `EventOutboxService` bean exists | Outbox processing status | -| `SnapshotStoreHealthIndicator` | `snapshotStoreHealthIndicator` | `SnapshotStore` bean exists | Snapshot store connectivity | -| `ProjectionHealthIndicator` | `projectionHealthIndicator` | `ProjectionService` beans exist | Projection lag and status | +| `EventStoreHealthIndicatorImpl` | `eventStoreHealthIndicator` | `EventStore` bean exists | Event store connectivity | +| `OutboxHealthIndicatorImpl` | `outboxHealthIndicator` | `EventOutboxService` bean exists | Outbox processing status | +| `SnapshotStoreHealthIndicatorImpl` | `snapshotStoreHealthIndicator` | `SnapshotStore` bean exists | Snapshot store connectivity | +| `ProjectionHealthIndicatorImpl` | `projectionHealthIndicator` | `ProjectionService` beans exist | Projection lag and status | ### Activation diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingAutoConfiguration.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingAutoConfiguration.java index 9a7d1fb64..19998630c 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingAutoConfiguration.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingAutoConfiguration.java @@ -19,7 +19,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import io.micrometer.core.instrument.MeterRegistry; import org.fireflyframework.eda.publisher.EventPublisherFactory; -import org.fireflyframework.eventsourcing.monitoring.EventStoreMetrics; +import org.fireflyframework.eventsourcing.monitoring.EventStoreMetricsImpl; import org.fireflyframework.eventsourcing.outbox.EventOutboxProcessor; import org.fireflyframework.eventsourcing.outbox.EventOutboxRepository; import org.fireflyframework.eventsourcing.outbox.EventOutboxService; @@ -112,9 +112,9 @@ public ObjectMapper eventSourcingObjectMapper() { @Bean @ConditionalOnMissingBean @ConditionalOnBean(MeterRegistry.class) - public EventStoreMetrics eventStoreMetrics(MeterRegistry meterRegistry) { + public EventStoreMetricsImpl eventStoreMetrics(MeterRegistry meterRegistry) { log.debug("Creating EventStoreMetrics bean"); - return new EventStoreMetrics(meterRegistry); + return new EventStoreMetricsImpl(meterRegistry); } /** diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingHealthAutoConfiguration.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingHealthAutoConfiguration.java index 8774e7527..d8d14c280 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingHealthAutoConfiguration.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingHealthAutoConfiguration.java @@ -17,10 +17,10 @@ package org.fireflyframework.eventsourcing.config; import lombok.extern.slf4j.Slf4j; -import org.fireflyframework.eventsourcing.health.EventStoreHealthIndicator; -import org.fireflyframework.eventsourcing.health.OutboxHealthIndicator; -import org.fireflyframework.eventsourcing.health.ProjectionHealthIndicator; -import org.fireflyframework.eventsourcing.health.SnapshotStoreHealthIndicator; +import org.fireflyframework.eventsourcing.health.EventStoreHealthIndicatorImpl; +import org.fireflyframework.eventsourcing.health.OutboxHealthIndicatorImpl; +import org.fireflyframework.eventsourcing.health.ProjectionHealthIndicatorImpl; +import org.fireflyframework.eventsourcing.health.SnapshotStoreHealthIndicatorImpl; import org.fireflyframework.eventsourcing.outbox.EventOutboxService; import org.fireflyframework.eventsourcing.projection.ProjectionService; import org.fireflyframework.eventsourcing.snapshot.SnapshotStore; @@ -52,34 +52,34 @@ public EventSourcingHealthAutoConfiguration() { @Bean @ConditionalOnBean(EventStore.class) - @ConditionalOnMissingBean(EventStoreHealthIndicator.class) - public EventStoreHealthIndicator eventStoreHealthIndicator(EventStore eventStore) { + @ConditionalOnMissingBean(EventStoreHealthIndicatorImpl.class) + public EventStoreHealthIndicatorImpl eventStoreHealthIndicator(EventStore eventStore) { log.debug("Creating EventStoreHealthIndicator bean"); - return new EventStoreHealthIndicator(eventStore); + return new EventStoreHealthIndicatorImpl(eventStore); } @Bean @ConditionalOnBean(EventOutboxService.class) - @ConditionalOnMissingBean(OutboxHealthIndicator.class) - public OutboxHealthIndicator outboxHealthIndicator(EventOutboxService outboxService) { + @ConditionalOnMissingBean(OutboxHealthIndicatorImpl.class) + public OutboxHealthIndicatorImpl outboxHealthIndicator(EventOutboxService outboxService) { log.debug("Creating OutboxHealthIndicator bean"); - return new OutboxHealthIndicator(outboxService); + return new OutboxHealthIndicatorImpl(outboxService); } @Bean @ConditionalOnBean(SnapshotStore.class) - @ConditionalOnMissingBean(SnapshotStoreHealthIndicator.class) - public SnapshotStoreHealthIndicator snapshotStoreHealthIndicator(SnapshotStore snapshotStore) { + @ConditionalOnMissingBean(SnapshotStoreHealthIndicatorImpl.class) + public SnapshotStoreHealthIndicatorImpl snapshotStoreHealthIndicator(SnapshotStore snapshotStore) { log.debug("Creating SnapshotStoreHealthIndicator bean"); - return new SnapshotStoreHealthIndicator(snapshotStore); + return new SnapshotStoreHealthIndicatorImpl(snapshotStore); } @Bean - @ConditionalOnMissingBean(ProjectionHealthIndicator.class) - public ProjectionHealthIndicator projectionHealthIndicator(List> projectionServices, + @ConditionalOnMissingBean(ProjectionHealthIndicatorImpl.class) + public ProjectionHealthIndicatorImpl projectionHealthIndicator(List> projectionServices, EventSourcingProjectionProperties projectionProperties) { log.debug("Creating ProjectionHealthIndicator bean with {} projections", projectionServices.size()); - return new ProjectionHealthIndicator( + return new ProjectionHealthIndicatorImpl( projectionServices, projectionProperties.getHealthCheck().getTimeout(), projectionProperties.getHealthCheck().getMaxAcceptableLag() diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingMetricsAutoConfiguration.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingMetricsAutoConfiguration.java index 381317cdc..56c90b9e3 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingMetricsAutoConfiguration.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingMetricsAutoConfiguration.java @@ -18,7 +18,7 @@ import io.micrometer.core.instrument.MeterRegistry; import lombok.extern.slf4j.Slf4j; -import org.fireflyframework.eventsourcing.monitoring.EventStoreMetrics; +import org.fireflyframework.eventsourcing.monitoring.EventStoreMetricsImpl; import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -50,8 +50,8 @@ public EventSourcingMetricsAutoConfiguration() { @Bean @ConditionalOnBean(MeterRegistry.class) @ConditionalOnMissingBean - public EventStoreMetrics eventStoreMetrics(MeterRegistry meterRegistry) { + public EventStoreMetricsImpl eventStoreMetrics(MeterRegistry meterRegistry) { log.info("Creating EventStoreMetrics bean via metrics configuration"); - return new EventStoreMetrics(meterRegistry); + return new EventStoreMetricsImpl(meterRegistry); } } diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingProjectionAutoConfiguration.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingProjectionAutoConfiguration.java index 198c78160..f39e2f2b1 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingProjectionAutoConfiguration.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventSourcingProjectionAutoConfiguration.java @@ -16,7 +16,7 @@ package org.fireflyframework.eventsourcing.config; -import org.fireflyframework.eventsourcing.health.ProjectionHealthIndicator; +import org.fireflyframework.eventsourcing.health.ProjectionHealthIndicatorImpl; import org.fireflyframework.eventsourcing.projection.ProjectionService; import io.micrometer.core.instrument.MeterRegistry; import lombok.extern.slf4j.Slf4j; @@ -54,7 +54,7 @@ public HealthIndicator projectionHealthIndicator( log.info("Registering ProjectionHealthIndicator with {} projection services", projectionServices.size()); - return new ProjectionHealthIndicator( + return new ProjectionHealthIndicatorImpl( projectionServices, properties.getHealthCheck().getTimeout(), properties.getHealthCheck().getMaxAcceptableLag() diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventStoreAutoConfiguration.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventStoreAutoConfiguration.java index e36be3b65..c617aee37 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventStoreAutoConfiguration.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/EventStoreAutoConfiguration.java @@ -18,7 +18,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.fireflyframework.eventsourcing.store.EventStore; -import org.fireflyframework.eventsourcing.store.r2dbc.R2dbcEventStore; +import org.fireflyframework.eventsourcing.store.r2dbc.R2dbcEventStoreImpl; import io.r2dbc.spi.ConnectionFactory; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.AutoConfigureAfter; @@ -70,7 +70,7 @@ public EventStore r2dbcEventStore( TransactionalOperator transactionalOperator = TransactionalOperator.create(transactionManager); - return new R2dbcEventStore( + return new R2dbcEventStoreImpl( databaseClient, entityTemplate, objectMapper, diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/SnapshotAutoConfiguration.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/SnapshotAutoConfiguration.java index 4d60dc597..f9ccd6872 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/SnapshotAutoConfiguration.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/config/SnapshotAutoConfiguration.java @@ -20,7 +20,7 @@ import lombok.extern.slf4j.Slf4j; import org.fireflyframework.eventsourcing.snapshot.SnapshotStore; import org.fireflyframework.eventsourcing.snapshot.SnapshotTrigger; -import org.fireflyframework.eventsourcing.snapshot.r2dbc.R2dbcSnapshotStore; +import org.fireflyframework.eventsourcing.snapshot.r2dbc.R2dbcSnapshotStoreImpl; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; @@ -48,7 +48,7 @@ public SnapshotAutoConfiguration() { @ConditionalOnMissingBean public SnapshotStore snapshotStore(DatabaseClient databaseClient, ObjectMapper objectMapper) { log.info("Creating R2dbcSnapshotStore bean"); - return new R2dbcSnapshotStore(databaseClient, objectMapper); + return new R2dbcSnapshotStoreImpl(databaseClient, objectMapper); } @Bean diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/EventStoreHealthIndicator.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/EventStoreHealthIndicatorImpl.java similarity index 92% rename from modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/EventStoreHealthIndicator.java rename to modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/EventStoreHealthIndicatorImpl.java index 30a9bc4e2..e76a47464 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/EventStoreHealthIndicator.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/EventStoreHealthIndicatorImpl.java @@ -28,16 +28,16 @@ * Reports R2DBC connectivity, event count, and latest global sequence. */ @Slf4j -public class EventStoreHealthIndicator implements HealthIndicator { +public class EventStoreHealthIndicatorImpl implements HealthIndicator { private final EventStore eventStore; private final Duration timeout; - public EventStoreHealthIndicator(EventStore eventStore) { + public EventStoreHealthIndicatorImpl(EventStore eventStore) { this(eventStore, Duration.ofSeconds(5)); } - public EventStoreHealthIndicator(EventStore eventStore, Duration timeout) { + public EventStoreHealthIndicatorImpl(EventStore eventStore, Duration timeout) { this.eventStore = eventStore; this.timeout = timeout; } diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/OutboxHealthIndicator.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/OutboxHealthIndicatorImpl.java similarity index 93% rename from modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/OutboxHealthIndicator.java rename to modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/OutboxHealthIndicatorImpl.java index fa41739b0..1415dc76c 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/OutboxHealthIndicator.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/OutboxHealthIndicatorImpl.java @@ -28,18 +28,18 @@ * Reports pending and failed entry counts, with configurable thresholds. */ @Slf4j -public class OutboxHealthIndicator implements HealthIndicator { +public class OutboxHealthIndicatorImpl implements HealthIndicator { private final EventOutboxService outboxService; private final Duration timeout; private final long pendingWarningThreshold; private final long failedDownThreshold; - public OutboxHealthIndicator(EventOutboxService outboxService) { + public OutboxHealthIndicatorImpl(EventOutboxService outboxService) { this(outboxService, Duration.ofSeconds(5), 1000L, 100L); } - public OutboxHealthIndicator(EventOutboxService outboxService, Duration timeout, + public OutboxHealthIndicatorImpl(EventOutboxService outboxService, Duration timeout, long pendingWarningThreshold, long failedDownThreshold) { this.outboxService = outboxService; this.timeout = timeout; diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/ProjectionHealthIndicator.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/ProjectionHealthIndicatorImpl.java similarity index 95% rename from modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/ProjectionHealthIndicator.java rename to modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/ProjectionHealthIndicatorImpl.java index 09fc08163..f7a64f4e1 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/ProjectionHealthIndicator.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/ProjectionHealthIndicatorImpl.java @@ -33,7 +33,7 @@ * Integrates with Spring Boot Actuator to provide health status of all registered projections. */ @Slf4j -public class ProjectionHealthIndicator implements HealthIndicator { +public class ProjectionHealthIndicatorImpl implements HealthIndicator { private final List> projectionServices; private final Duration healthCheckTimeout; @@ -42,14 +42,14 @@ public class ProjectionHealthIndicator implements HealthIndicator { /** * Constructor with default values. */ - public ProjectionHealthIndicator(List> projectionServices) { + public ProjectionHealthIndicatorImpl(List> projectionServices) { this(projectionServices, Duration.ofSeconds(5), 1000L); } /** * Constructor with custom timeout and max acceptable lag. */ - public ProjectionHealthIndicator(List> projectionServices, + public ProjectionHealthIndicatorImpl(List> projectionServices, Duration healthCheckTimeout, long maxAcceptableLag) { this.projectionServices = projectionServices; diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/SnapshotStoreHealthIndicator.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/SnapshotStoreHealthIndicatorImpl.java similarity index 92% rename from modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/SnapshotStoreHealthIndicator.java rename to modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/SnapshotStoreHealthIndicatorImpl.java index 5aa009bbe..8d578d3fb 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/SnapshotStoreHealthIndicator.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/health/SnapshotStoreHealthIndicatorImpl.java @@ -28,16 +28,16 @@ * Reports connectivity and basic statistics. */ @Slf4j -public class SnapshotStoreHealthIndicator implements HealthIndicator { +public class SnapshotStoreHealthIndicatorImpl implements HealthIndicator { private final SnapshotStore snapshotStore; private final Duration timeout; - public SnapshotStoreHealthIndicator(SnapshotStore snapshotStore) { + public SnapshotStoreHealthIndicatorImpl(SnapshotStore snapshotStore) { this(snapshotStore, Duration.ofSeconds(5)); } - public SnapshotStoreHealthIndicator(SnapshotStore snapshotStore, Duration timeout) { + public SnapshotStoreHealthIndicatorImpl(SnapshotStore snapshotStore, Duration timeout) { this.snapshotStore = snapshotStore; this.timeout = timeout; } diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/monitoring/EventStoreMetrics.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/monitoring/EventStoreMetricsImpl.java similarity index 98% rename from modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/monitoring/EventStoreMetrics.java rename to modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/monitoring/EventStoreMetricsImpl.java index fe46ff053..7cc19470a 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/monitoring/EventStoreMetrics.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/monitoring/EventStoreMetricsImpl.java @@ -41,7 +41,7 @@ * - firefly.eventsourcing.batch.size (DistributionSummary) */ @Slf4j -public class EventStoreMetrics extends FireflyMetricsSupport { +public class EventStoreMetricsImpl extends FireflyMetricsSupport { // Gauges private final AtomicLong activeConnections = new AtomicLong(0); @@ -53,7 +53,7 @@ public class EventStoreMetrics extends FireflyMetricsSupport { private volatile Instant lastHealthCheck = Instant.now(); private volatile String lastError; - public EventStoreMetrics(MeterRegistry meterRegistry) { + public EventStoreMetricsImpl(MeterRegistry meterRegistry) { super(meterRegistry, "eventsourcing"); gauge("connection.pool.active", activeConnections, AtomicLong::get); diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionMetrics.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionMetricsImpl.java similarity index 96% rename from modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionMetrics.java rename to modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionMetricsImpl.java index 27ef477f6..5377faa0a 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionMetrics.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionMetricsImpl.java @@ -28,7 +28,7 @@ * Provides counters, timers, and gauges for monitoring projection performance and health. */ @Slf4j -public class ProjectionMetrics extends FireflyMetricsSupport { +public class ProjectionMetricsImpl extends FireflyMetricsSupport { private final String projectionName; @@ -36,7 +36,7 @@ public class ProjectionMetrics extends FireflyMetricsSupport { private final AtomicLong lagAmount = new AtomicLong(0L); private final AtomicLong lastProcessedAt = new AtomicLong(System.currentTimeMillis()); - public ProjectionMetrics(String projectionName, MeterRegistry meterRegistry) { + public ProjectionMetricsImpl(String projectionName, MeterRegistry meterRegistry) { super(meterRegistry, "eventsourcing"); this.projectionName = projectionName; diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionService.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionService.java index d313615d5..d73424885 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionService.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/projection/ProjectionService.java @@ -47,7 +47,7 @@ @Slf4j public abstract class ProjectionService { - private final ProjectionMetrics metrics; + private final ProjectionMetricsImpl metrics; private volatile long latestGlobalSequence = 0L; /** @@ -56,7 +56,7 @@ public abstract class ProjectionService { * @param meterRegistry the meter registry for metrics collection */ protected ProjectionService(MeterRegistry meterRegistry) { - this.metrics = new ProjectionMetrics(getProjectionName(), meterRegistry); + this.metrics = new ProjectionMetricsImpl(getProjectionName(), meterRegistry); } /** @@ -292,7 +292,7 @@ protected Map extractMetadata(StoredEventEnvelope envelope) { * * @return the projection metrics instance */ - protected ProjectionMetrics getMetrics() { + protected ProjectionMetricsImpl getMetrics() { return metrics; } diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/snapshot/r2dbc/R2dbcSnapshotStore.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/snapshot/r2dbc/R2dbcSnapshotStoreImpl.java similarity index 99% rename from modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/snapshot/r2dbc/R2dbcSnapshotStore.java rename to modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/snapshot/r2dbc/R2dbcSnapshotStoreImpl.java index f57667628..b9519857a 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/snapshot/r2dbc/R2dbcSnapshotStore.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/snapshot/r2dbc/R2dbcSnapshotStoreImpl.java @@ -42,12 +42,12 @@ * requiring {@code @JsonTypeInfo} on the Snapshot interface.

    */ @Slf4j -public class R2dbcSnapshotStore implements SnapshotStore { +public class R2dbcSnapshotStoreImpl implements SnapshotStore { private final DatabaseClient databaseClient; private final ObjectMapper objectMapper; - public R2dbcSnapshotStore(DatabaseClient databaseClient, ObjectMapper objectMapper) { + public R2dbcSnapshotStoreImpl(DatabaseClient databaseClient, ObjectMapper objectMapper) { this.databaseClient = databaseClient; this.objectMapper = objectMapper; log.info("R2dbcSnapshotStore initialized"); diff --git a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStore.java b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStoreImpl.java similarity index 99% rename from modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStore.java rename to modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStoreImpl.java index 687a83e62..415f5f89e 100644 --- a/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStore.java +++ b/modules/eventsourcing/src/main/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStoreImpl.java @@ -77,7 +77,7 @@ * */ @Slf4j -public class R2dbcEventStore implements EventStore { +public class R2dbcEventStoreImpl implements EventStore { private final DatabaseClient databaseClient; private final R2dbcEntityTemplate entityTemplate; @@ -91,7 +91,7 @@ public class R2dbcEventStore implements EventStore { @Autowired(required = false) private EventOutboxService outboxService; - public R2dbcEventStore(DatabaseClient databaseClient, + public R2dbcEventStoreImpl(DatabaseClient databaseClient, R2dbcEntityTemplate entityTemplate, ObjectMapper objectMapper, EventSourcingProperties properties, diff --git a/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/projection/ProjectionFrameworkTest.java b/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/projection/ProjectionFrameworkTest.java index 7ddf659cf..6473b93dc 100644 --- a/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/projection/ProjectionFrameworkTest.java +++ b/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/projection/ProjectionFrameworkTest.java @@ -44,7 +44,7 @@ void shouldCreateProjectionMetrics() { String projectionName = "test-projection"; // When - ProjectionMetrics metrics = new ProjectionMetrics(projectionName, meterRegistry); + ProjectionMetricsImpl metrics = new ProjectionMetricsImpl(projectionName, meterRegistry); // Then assertThat(metrics.getProjectionName()).isEqualTo(projectionName); @@ -69,7 +69,7 @@ void shouldCreateProjectionMetrics() { @Test void shouldRecordMetricsCorrectly() { // Given - ProjectionMetrics metrics = new ProjectionMetrics("test-projection", meterRegistry); + ProjectionMetricsImpl metrics = new ProjectionMetricsImpl("test-projection", meterRegistry); // When metrics.recordEventProcessed(); diff --git a/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/store/r2dbc/PostgreSqlEventStoreIntegrationTest.java b/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/store/r2dbc/PostgreSqlEventStoreIntegrationTest.java index 8cd191350..d8eb3179e 100644 --- a/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/store/r2dbc/PostgreSqlEventStoreIntegrationTest.java +++ b/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/store/r2dbc/PostgreSqlEventStoreIntegrationTest.java @@ -63,7 +63,7 @@ class PostgreSqlEventStoreIntegrationTest { .withPassword("test_password") .withReuse(false); - private R2dbcEventStore eventStore; + private R2dbcEventStoreImpl eventStore; private DatabaseClient databaseClient; private R2dbcEntityTemplate entityTemplate; private ConnectionFactory connectionFactory; @@ -92,7 +92,7 @@ void setUp() { objectMapper.registerModule(new JavaTimeModule()); EventSourcingProperties properties = new EventSourcingProperties(); - eventStore = new R2dbcEventStore( + eventStore = new R2dbcEventStoreImpl( databaseClient, entityTemplate, objectMapper, diff --git a/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStoreIntegrationTest.java b/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStoreIntegrationTest.java index 57f14e194..792e6aeeb 100644 --- a/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStoreIntegrationTest.java +++ b/modules/eventsourcing/src/test/java/org/fireflyframework/eventsourcing/store/r2dbc/R2dbcEventStoreIntegrationTest.java @@ -54,7 +54,7 @@ */ class R2dbcEventStoreIntegrationTest { - private R2dbcEventStore eventStore; + private R2dbcEventStoreImpl eventStore; private DatabaseClient databaseClient; private R2dbcEntityTemplate entityTemplate; private ConnectionFactory connectionFactory; @@ -80,7 +80,7 @@ void setUp() { objectMapper.registerModule(new JavaTimeModule()); EventSourcingProperties properties = new EventSourcingProperties(); - eventStore = new R2dbcEventStore( + eventStore = new R2dbcEventStoreImpl( databaseClient, entityTemplate, objectMapper, diff --git a/modules/kernel/src/main/java/org/fireflyframework/kernel/audit/impl/Sha256AuditEvidenceVerifier.java b/modules/kernel/src/main/java/org/fireflyframework/kernel/audit/impl/Sha256AuditEvidenceVerifierImpl.java similarity index 96% rename from modules/kernel/src/main/java/org/fireflyframework/kernel/audit/impl/Sha256AuditEvidenceVerifier.java rename to modules/kernel/src/main/java/org/fireflyframework/kernel/audit/impl/Sha256AuditEvidenceVerifierImpl.java index 7753b45dd..700fc7ebc 100644 --- a/modules/kernel/src/main/java/org/fireflyframework/kernel/audit/impl/Sha256AuditEvidenceVerifier.java +++ b/modules/kernel/src/main/java/org/fireflyframework/kernel/audit/impl/Sha256AuditEvidenceVerifierImpl.java @@ -25,7 +25,7 @@ import java.util.Objects; import java.util.UUID; -public final class Sha256AuditEvidenceVerifier implements AuditEvidenceVerifier { +public final class Sha256AuditEvidenceVerifierImpl implements AuditEvidenceVerifier { @Override public void verify(AuditCheckpoint trustedStart, AuditCheckpoint trustedEnd, List records) { Objects.requireNonNull(trustedStart, "Required audit checkpoint is absent"); diff --git a/modules/kernel/src/test/java/org/fireflyframework/kernel/audit/AuditEvidenceVerifierTest.java b/modules/kernel/src/test/java/org/fireflyframework/kernel/audit/AuditEvidenceVerifierTest.java index 958b478d4..5d8afe7b2 100644 --- a/modules/kernel/src/test/java/org/fireflyframework/kernel/audit/AuditEvidenceVerifierTest.java +++ b/modules/kernel/src/test/java/org/fireflyframework/kernel/audit/AuditEvidenceVerifierTest.java @@ -15,7 +15,7 @@ */ package org.fireflyframework.kernel.audit; -import org.fireflyframework.kernel.audit.impl.Sha256AuditEvidenceVerifier; +import org.fireflyframework.kernel.audit.impl.Sha256AuditEvidenceVerifierImpl; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.DynamicTest; import org.junit.jupiter.api.TestFactory; @@ -36,7 +36,7 @@ class AuditEvidenceVerifierTest { private final AuditStream stream = new AuditStream(id(1), "core-payments", "payment", id(2)); private final AuditActor actor = new AuditActor("https://issuer.example.invalid", "subject", "terminal", PLATFORM_TENANT, "employees", id(4)); - private final AuditEvidenceVerifier verifier = new Sha256AuditEvidenceVerifier(); + private final AuditEvidenceVerifier verifier = new Sha256AuditEvidenceVerifierImpl(); private static UUID id(long n) { return new UUID(0, n); } diff --git a/modules/notifications-firebase/README.md b/modules/notifications-firebase/README.md index bdd85e1a3..11ec66a9d 100644 --- a/modules/notifications-firebase/README.md +++ b/modules/notifications-firebase/README.md @@ -75,7 +75,7 @@ import java.util.Map; @RequiredArgsConstructor public class AlertService { - private final PushProvider pushProvider; // FcmPushProvider injected by auto-config + private final PushProvider pushProvider; // FcmPushProviderImpl injected by auto-config @@ -109,7 +109,7 @@ The `firefly.notifications.firebase` namespace is bound by [FcmProperties.java]( | --- | --- | | [`FcmProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/properties/v1/FcmProperties.java) | Carries `credentialsPath`, `projectId` data; field constraints and defaults are declared in the linked source. | | [`FcmAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/config/v1/FcmAutoConfiguration.java) | Defines `firebaseApp`, `firebaseMessaging`, `fcmPushProvider` operations. | -| [`FcmPushProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProvider.java) | Defines `FcmPushProvider`, `sendPush` operations. | +| [`FcmPushProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProviderImpl.java) | Defines `FcmPushProviderImpl`, `sendPush` operations. | ## Continue the application diff --git a/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/config/v1/FcmAutoConfiguration.java b/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/config/v1/FcmAutoConfiguration.java index b551d28ec..1693c563a 100644 --- a/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/config/v1/FcmAutoConfiguration.java +++ b/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/config/v1/FcmAutoConfiguration.java @@ -18,7 +18,7 @@ package org.fireflyframework.notifications.providers.firebase.config.v1; import org.fireflyframework.notifications.interfaces.providers.push.v1.PushProvider; -import org.fireflyframework.notifications.providers.firebase.core.v1.FcmPushProvider; +import org.fireflyframework.notifications.providers.firebase.core.v1.FcmPushProviderImpl; import org.fireflyframework.notifications.providers.firebase.properties.v1.FcmProperties; import com.google.auth.oauth2.GoogleCredentials; import com.google.firebase.FirebaseApp; @@ -75,6 +75,6 @@ public FirebaseMessaging firebaseMessaging(FirebaseApp firebaseApp) { @Bean @ConditionalOnMissingBean(PushProvider.class) public PushProvider fcmPushProvider(FirebaseMessaging firebaseMessaging) { - return new FcmPushProvider(firebaseMessaging); + return new FcmPushProviderImpl(firebaseMessaging); } } diff --git a/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProvider.java b/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProviderImpl.java similarity index 95% rename from modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProvider.java rename to modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProviderImpl.java index dcb5a2a75..b2346a524 100644 --- a/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProvider.java +++ b/modules/notifications-firebase/src/main/java/org/fireflyframework/notifications/providers/firebase/core/v1/FcmPushProviderImpl.java @@ -28,11 +28,11 @@ import java.util.Map; -public class FcmPushProvider implements PushProvider { +public class FcmPushProviderImpl implements PushProvider { private final FirebaseMessaging messaging; - public FcmPushProvider(FirebaseMessaging messaging) { + public FcmPushProviderImpl(FirebaseMessaging messaging) { this.messaging = messaging; } diff --git a/modules/notifications-resend/README.md b/modules/notifications-resend/README.md index 77db1e4d9..1397da155 100644 --- a/modules/notifications-resend/README.md +++ b/modules/notifications-resend/README.md @@ -60,7 +60,7 @@ import reactor.core.publisher.Mono; @RequiredArgsConstructor public class WelcomeEmailService { - private final EmailProvider emailProvider; // ResendEmailProvider, auto-wired + private final EmailProvider emailProvider; // ResendEmailProviderImpl, auto-wired @@ -94,7 +94,7 @@ The `firefly.notifications.resend` namespace is bound by [ResendProperties.java] | Type | Contract and responsibility | | --- | --- | -| [`ResendEmailProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProvider.java) | Defines `sendEmail`, `buildPayload` operations. | +| [`ResendEmailProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProviderImpl.java) | Defines `sendEmail`, `buildPayload` operations. | | [`ResendProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/properties/v1/ResendProperties.java) | Carries `apiKey`, `defaultFrom`, `baseUrl` data; field constraints and defaults are declared in the linked source. | | [`ResendAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/config/v1/ResendAutoConfiguration.java) | Defines `resendRestClient`, `resendEmailProvider` operations. | diff --git a/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/config/v1/ResendAutoConfiguration.java b/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/config/v1/ResendAutoConfiguration.java index fedc605d0..8e29e0690 100644 --- a/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/config/v1/ResendAutoConfiguration.java +++ b/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/config/v1/ResendAutoConfiguration.java @@ -20,7 +20,7 @@ import org.fireflyframework.client.RestClient; import org.fireflyframework.client.ServiceClient; import org.fireflyframework.notifications.interfaces.providers.email.v1.EmailProvider; -import org.fireflyframework.notifications.providers.resend.core.v1.ResendEmailProvider; +import org.fireflyframework.notifications.providers.resend.core.v1.ResendEmailProviderImpl; import org.fireflyframework.notifications.providers.resend.properties.v1.ResendProperties; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -52,6 +52,6 @@ public RestClient resendRestClient(ResendProperties properties) { @Bean @ConditionalOnMissingBean(EmailProvider.class) public EmailProvider resendEmailProvider(ResendProperties properties, RestClient resendRestClient) { - return new ResendEmailProvider(properties, resendRestClient); + return new ResendEmailProviderImpl(properties, resendRestClient); } } diff --git a/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProvider.java b/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProviderImpl.java similarity index 98% rename from modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProvider.java rename to modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProviderImpl.java index 72efcbaf9..8032b4fd0 100644 --- a/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProvider.java +++ b/modules/notifications-resend/src/main/java/org/fireflyframework/notifications/providers/resend/core/v1/ResendEmailProviderImpl.java @@ -34,7 +34,7 @@ @Slf4j @RequiredArgsConstructor -public class ResendEmailProvider implements EmailProvider { +public class ResendEmailProviderImpl implements EmailProvider { private final ResendProperties properties; diff --git a/modules/notifications-sendgrid/README.md b/modules/notifications-sendgrid/README.md index 668d89e8b..cc60db6fa 100644 --- a/modules/notifications-sendgrid/README.md +++ b/modules/notifications-sendgrid/README.md @@ -98,10 +98,10 @@ public class WelcomeMailer { } ``` -The auto-configuration builds the `SendGrid` client and the `SendGridEmailProvider` bean for you. The returned `EmailResponseDTO` +The auto-configuration builds the `SendGrid` client and the `SendGridEmailProviderImpl` bean for you. The returned `EmailResponseDTO` carries `success`/`error` status and, on success, the SendGrid `X-Message-Id`. -You can also depend on the `EmailProvider` SPI directly if you prefer to bypass the `EmailService` facade. The same `SendGridEmailProvider` bean satisfies it. +You can also depend on the `EmailProvider` SPI directly if you prefer to bypass the `EmailService` facade. The same `SendGridEmailProviderImpl` bean satisfies it. ## Configuration @@ -115,7 +115,7 @@ The `firefly.notifications.sendgrid` namespace is bound by [SendGridProperties.j | Type | Contract and responsibility | | --- | --- | -| [`SendGridEmailProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProvider.java) | Defines `sendEmail`, `buildMail` operations. | +| [`SendGridEmailProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProviderImpl.java) | Defines `sendEmail`, `buildMail` operations. | | [`SendGridProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/properties/v1/SendGridProperties.java) | Carries `apiKey` data; field constraints and defaults are declared in the linked source. | | [`SendGridAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/config/v1/SendGridAutoConfiguration.java) | Defines `sendGrid`, `sendGridEmailProvider` operations. | diff --git a/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/config/v1/SendGridAutoConfiguration.java b/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/config/v1/SendGridAutoConfiguration.java index 457cdf579..607f05d53 100644 --- a/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/config/v1/SendGridAutoConfiguration.java +++ b/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/config/v1/SendGridAutoConfiguration.java @@ -18,7 +18,7 @@ package org.fireflyframework.notifications.providers.sendgrid.config.v1; import org.fireflyframework.notifications.interfaces.providers.email.v1.EmailProvider; -import org.fireflyframework.notifications.providers.sendgrid.core.v1.SendGridEmailProvider; +import org.fireflyframework.notifications.providers.sendgrid.core.v1.SendGridEmailProviderImpl; import org.fireflyframework.notifications.providers.sendgrid.properties.v1.SendGridProperties; import com.sendgrid.SendGrid; import lombok.extern.slf4j.Slf4j; @@ -47,6 +47,6 @@ public SendGrid sendGrid(SendGridProperties properties) { @Bean @ConditionalOnMissingBean(EmailProvider.class) public EmailProvider sendGridEmailProvider(SendGridProperties properties, SendGrid sendGrid) { - return new SendGridEmailProvider(properties, sendGrid); + return new SendGridEmailProviderImpl(properties, sendGrid); } } \ No newline at end of file diff --git a/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProvider.java b/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProviderImpl.java similarity index 98% rename from modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProvider.java rename to modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProviderImpl.java index a9a114918..13c7f6bf4 100644 --- a/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProvider.java +++ b/modules/notifications-sendgrid/src/main/java/org/fireflyframework/notifications/providers/sendgrid/core/v1/SendGridEmailProviderImpl.java @@ -39,7 +39,7 @@ @Slf4j @RequiredArgsConstructor -public class SendGridEmailProvider implements EmailProvider { +public class SendGridEmailProviderImpl implements EmailProvider { private final SendGridProperties properties; diff --git a/modules/notifications-twilio/README.md b/modules/notifications-twilio/README.md index 1e97e8461..f0a283044 100644 --- a/modules/notifications-twilio/README.md +++ b/modules/notifications-twilio/README.md @@ -60,7 +60,7 @@ public class OtpService { private final SMSProvider smsProvider; public OtpService(SMSProvider smsProvider) { - this.smsProvider = smsProvider; // TwilioSMSProvider injected by auto-config + this.smsProvider = smsProvider; // TwilioSMSProviderImpl injected by auto-config } public Mono sendOtp(String phoneNumber, String code) { @@ -108,7 +108,7 @@ The `firefly.notifications.twilio` namespace is bound by [TwilioProperties.java] | Type | Contract and responsibility | | --- | --- | -| [`TwilioSMSProvider`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProvider.java) | Defines `TwilioSMSProvider`, `sendSMS`, `PhoneNumber` operations. | +| [`TwilioSMSProviderImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProviderImpl.java) | Defines `TwilioSMSProviderImpl`, `sendSMS`, `PhoneNumber` operations. | | [`TwilioProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/properties/v1/TwilioProperties.java) | Carries `accountSid`, `authToken`, `phoneNumber` data; field constraints and defaults are declared in the linked source. | | [`TwilioAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/config/v1/TwilioAutoConfiguration.java) | Defines `twilioInit`, `twilioSMSProvider` operations. | diff --git a/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/config/v1/TwilioAutoConfiguration.java b/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/config/v1/TwilioAutoConfiguration.java index 1f1cc275a..c181a81d2 100644 --- a/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/config/v1/TwilioAutoConfiguration.java +++ b/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/config/v1/TwilioAutoConfiguration.java @@ -18,7 +18,7 @@ package org.fireflyframework.notifications.providers.twilio.config.v1; import org.fireflyframework.notifications.interfaces.providers.sms.v1.SMSProvider; -import org.fireflyframework.notifications.providers.twilio.core.v1.TwilioSMSProvider; +import org.fireflyframework.notifications.providers.twilio.core.v1.TwilioSMSProviderImpl; import org.fireflyframework.notifications.providers.twilio.properties.v1.TwilioProperties; import com.twilio.Twilio; import com.twilio.http.TwilioRestClient; @@ -58,12 +58,12 @@ public TwilioRestClient twilioRestClient(TwilioProperties twilioProperties) { } public SMSProvider twilioSMSProvider(TwilioProperties twilioProperties) { - return new TwilioSMSProvider(twilioProperties); + return new TwilioSMSProviderImpl(twilioProperties); } @Bean @ConditionalOnMissingBean(SMSProvider.class) public SMSProvider twilioSMSProvider(TwilioProperties twilioProperties, TwilioRestClient client) { - return new TwilioSMSProvider(twilioProperties, client); + return new TwilioSMSProviderImpl(twilioProperties, client); } } diff --git a/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProvider.java b/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProviderImpl.java similarity index 95% rename from modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProvider.java rename to modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProviderImpl.java index bdd16016b..b8ce47efd 100644 --- a/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProvider.java +++ b/modules/notifications-twilio/src/main/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProviderImpl.java @@ -30,16 +30,16 @@ import reactor.core.publisher.Mono; import reactor.core.scheduler.Schedulers; -public class TwilioSMSProvider implements SMSProvider { +public class TwilioSMSProviderImpl implements SMSProvider { private final TwilioProperties twilioProperties; private volatile TwilioRestClient client; - public TwilioSMSProvider(TwilioProperties twilioProperties) { + public TwilioSMSProviderImpl(TwilioProperties twilioProperties) { this.twilioProperties = twilioProperties; } - public TwilioSMSProvider(TwilioProperties twilioProperties, TwilioRestClient client) { + public TwilioSMSProviderImpl(TwilioProperties twilioProperties, TwilioRestClient client) { this(twilioProperties); this.client = Objects.requireNonNull(client, "Twilio client"); } diff --git a/modules/notifications-twilio/src/test/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProviderContractTest.java b/modules/notifications-twilio/src/test/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProviderContractTest.java index 3c13d6035..051a51c36 100644 --- a/modules/notifications-twilio/src/test/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProviderContractTest.java +++ b/modules/notifications-twilio/src/test/java/org/fireflyframework/notifications/providers/twilio/core/v1/TwilioSMSProviderContractTest.java @@ -119,14 +119,14 @@ ApplicationContextRunner runner(String account, String token, TwilioRestClient c assertThat(trap.requests).isEmpty(); } @Test void legacyConstructorStillValidatesANullRequestWithoutInitializingAClient() { - var result = new TwilioSMSProvider(new TwilioProperties()).sendSMS(null).block(WAIT); + var result = new TwilioSMSProviderImpl(new TwilioProperties()).sendSMS(null).block(WAIT); assertThat(result.getStatus()).isEqualTo("FAILED"); assertThat(result.getErrorMessage()).isEqualTo("Request cannot be null"); } @ParameterizedTest @ValueSource(strings={"RECIPIENT", "BODY", "SENDER"}) void originalValidationFailuresNeverIssueSdkRequests(String field) { var transport = new Transport(SID_A); Twilio.setRestClient(client(ACCOUNT_A, TOKEN_A, transport)); var properties = properties(); var request = request(); if (field.equals("RECIPIENT")) request.setPhoneNumber(" "); if (field.equals("BODY")) request.setMessage(" "); if (field.equals("SENDER")) properties.setPhoneNumber(" "); - var result = new TwilioSMSProvider(properties).sendSMS(request).block(WAIT); assertThat(result.getStatus()).isEqualTo("FAILED"); assertThat(result.getErrorMessage()).isNotBlank(); assertThat(transport.requests).isEmpty(); + var result = new TwilioSMSProviderImpl(properties).sendSMS(request).block(WAIT); assertThat(result.getStatus()).isEqualTo("FAILED"); assertThat(result.getErrorMessage()).isNotBlank(); assertThat(transport.requests).isEmpty(); } void exercise(Transport transport, java.util.function.Consumer action) { var instance = client(ACCOUNT_A, TOKEN_A, transport); diff --git a/modules/notifications/ARCHITECTURE.md b/modules/notifications/ARCHITECTURE.md index 0c33367f4..87146ab3d 100644 --- a/modules/notifications/ARCHITECTURE.md +++ b/modules/notifications/ARCHITECTURE.md @@ -68,7 +68,7 @@ Traditional layered architectures often suffer from tight coupling between busin │ │ fireflyframework-notifications- │ │ fireflyframework-notifications- │ │ │ │ sendgrid │ │ resend │ │ │ │ │ │ │ │ -│ │ SendGridEmailProvider│ │ ResendEmailProvider │ │ +│ │ SendGridEmailProviderImpl│ │ ResendEmailProviderImpl │ │ │ │ implements │ │ implements │ │ │ │ EmailProvider │ │ EmailProvider │ │ │ └──────────────────────┘ └──────────────────────┘ │ @@ -77,7 +77,7 @@ Traditional layered architectures often suffer from tight coupling between busin │ │ fireflyframework-notifications- │ │ fireflyframework-notifications- │ │ │ │ twilio │ │ firebase │ │ │ │ │ │ │ │ -│ │ TwilioSMSProvider │ │ FcmPushProvider │ │ +│ │ TwilioSMSProviderImpl │ │ FcmPushProviderImpl │ │ │ │ implements │ │ implements │ │ │ │ SMSProvider │ │ PushProvider │ │ │ └──────────────────────┘ └──────────────────────┘ │ @@ -115,7 +115,7 @@ public class EmailServiceImpl implements EmailService { @Service public class EmailServiceImpl implements EmailService { @Autowired - private SendGridEmailProvider sendGridProvider; // Concrete class - bad! + private SendGridEmailProviderImpl sendGridProvider; // Concrete class - bad! } ``` @@ -225,7 +225,7 @@ fireflyframework-notifications-sendgrid/ ├── README.md # Adapter-specific docs └── src/main/java/.../providers/sendgrid/ ├── core/v1/ - │ └── SendGridEmailProvider.java # Port implementation + │ └── SendGridEmailProviderImpl.java # Port implementation ├── config/v1/ │ └── SendGridConfig.java # Spring configuration └── properties/v1/ @@ -236,7 +236,7 @@ Adapter Implementation Example: ```java @Component // Spring bean -public class SendGridEmailProvider implements EmailProvider { +public class SendGridEmailProviderImpl implements EmailProvider { @Autowired private SendGridProperties properties; @@ -280,10 +280,10 @@ fireflyframework-notifications-firebase (Adapter) ``` 1. Spring scans for @Component/@Service beans 2. Finds EmailServiceImpl (needs EmailProvider) -3. Finds SendGridEmailProvider (implements EmailProvider) -4. Injects SendGridEmailProvider into EmailServiceImpl +3. Finds SendGridEmailProviderImpl (implements EmailProvider) +4. Injects SendGridEmailProviderImpl into EmailServiceImpl 5. Client code calls EmailService methods -6. Calls are routed to SendGridEmailProvider at runtime +6. Calls are routed to SendGridEmailProviderImpl at runtime ``` ### Key Insight diff --git a/modules/notifications/README.md b/modules/notifications/README.md index db12840bd..35fa01a06 100644 --- a/modules/notifications/README.md +++ b/modules/notifications/README.md @@ -106,7 +106,7 @@ Templated email. Provide a `NotificationTemplateEngine` bean (the FreeMarker eng ```java @Bean NotificationTemplateEngine notificationTemplateEngine() { - return new FreemarkerNotificationTemplateEngine(); // classpath:/notification-templates + return new FreemarkerNotificationTemplateEngineImpl(); // classpath:/notification-templates } // ... diff --git a/modules/notifications/fireflyframework-notifications-core/README.md b/modules/notifications/fireflyframework-notifications-core/README.md index 2748c52d4..2fb585e2f 100644 --- a/modules/notifications/fireflyframework-notifications-core/README.md +++ b/modules/notifications/fireflyframework-notifications-core/README.md @@ -68,7 +68,7 @@ Mono result = emailService.sendEmail(request); | SMS | `org.fireflyframework.notifications.core.services.sms.v1.SMSServiceImpl` | `SMSProvider` | | Push | `org.fireflyframework.notifications.core.services.push.v1.PushServiceImpl` | `PushProvider` | -Template email additionally needs a `NotificationTemplateEngine` bean, for example `new FreemarkerNotificationTemplateEngine()` with templates under `src/main/resources/notification-templates`. A preference service must also be registered and invoked explicitly when the application applies user preferences; the in-memory implementation is process-local. +Template email additionally needs a `NotificationTemplateEngine` bean, for example `new FreemarkerNotificationTemplateEngineImpl()` with templates under `src/main/resources/notification-templates`. A preference service must also be registered and invoked explicitly when the application applies user preferences; the in-memory implementation is process-local. ## Configuration diff --git a/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/preferences/InMemoryNotificationPreferenceService.java b/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/preferences/InMemoryNotificationPreferenceServiceImpl.java similarity index 95% rename from modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/preferences/InMemoryNotificationPreferenceService.java rename to modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/preferences/InMemoryNotificationPreferenceServiceImpl.java index ddf14a581..f7d1f03a0 100644 --- a/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/preferences/InMemoryNotificationPreferenceService.java +++ b/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/preferences/InMemoryNotificationPreferenceServiceImpl.java @@ -29,7 +29,7 @@ * For production multi-instance deployments, use a persistent-backed implementation. */ @Slf4j -public class InMemoryNotificationPreferenceService implements NotificationPreferenceService { +public class InMemoryNotificationPreferenceServiceImpl implements NotificationPreferenceService { private final ConcurrentHashMap store = new ConcurrentHashMap<>(); diff --git a/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/template/FreemarkerNotificationTemplateEngine.java b/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/template/FreemarkerNotificationTemplateEngineImpl.java similarity index 93% rename from modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/template/FreemarkerNotificationTemplateEngine.java rename to modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/template/FreemarkerNotificationTemplateEngineImpl.java index 74939a952..3530703f8 100644 --- a/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/template/FreemarkerNotificationTemplateEngine.java +++ b/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/core/services/template/FreemarkerNotificationTemplateEngineImpl.java @@ -43,17 +43,17 @@ * and an optional filesystem directory. Template files use the {@code .ftl} extension by convention. */ @Slf4j -public class FreemarkerNotificationTemplateEngine implements NotificationTemplateEngine { +public class FreemarkerNotificationTemplateEngineImpl implements NotificationTemplateEngine { private final Configuration configuration; - public FreemarkerNotificationTemplateEngine(String classpathPrefix, String filesystemDir) { + public FreemarkerNotificationTemplateEngineImpl(String classpathPrefix, String filesystemDir) { this.configuration = buildConfiguration(classpathPrefix, filesystemDir); log.info("FreemarkerNotificationTemplateEngine initialized (classpath: {}, filesystem: {})", classpathPrefix, filesystemDir); } - public FreemarkerNotificationTemplateEngine() { + public FreemarkerNotificationTemplateEngineImpl() { this("/notification-templates", null); } diff --git a/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationMetrics.java b/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationMetricsImpl.java similarity index 94% rename from modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationMetrics.java rename to modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationMetricsImpl.java index b7a3fe2a1..e3c6a9026 100644 --- a/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationMetrics.java +++ b/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationMetricsImpl.java @@ -32,13 +32,13 @@ *
  • {@code firefly.notifications.templates.rendered} — template renders, tagged by template name
  • * */ -public class NotificationMetrics extends FireflyMetricsSupport { +public class NotificationMetricsImpl extends FireflyMetricsSupport { private static final String TAG_CHANNEL = "channel"; private static final String TAG_PROVIDER = "provider"; private static final String TAG_TEMPLATE = "template"; - public NotificationMetrics(MeterRegistry meterRegistry) { + public NotificationMetricsImpl(MeterRegistry meterRegistry) { super(meterRegistry, "notifications"); } diff --git a/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationObservabilityAutoConfiguration.java b/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationObservabilityAutoConfiguration.java index 3599eba8d..236c9b0dd 100644 --- a/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationObservabilityAutoConfiguration.java +++ b/modules/notifications/fireflyframework-notifications-core/src/main/java/org/fireflyframework/notifications/observability/NotificationObservabilityAutoConfiguration.java @@ -37,7 +37,7 @@ public class NotificationObservabilityAutoConfiguration { @Bean @ConditionalOnMissingBean @ConditionalOnBean(MeterRegistry.class) - NotificationMetrics notificationMetrics(MeterRegistry meterRegistry) { - return new NotificationMetrics(meterRegistry); + NotificationMetricsImpl notificationMetrics(MeterRegistry meterRegistry) { + return new NotificationMetricsImpl(meterRegistry); } } diff --git a/modules/observability/README.md b/modules/observability/README.md index 1dc78eeb8..22cfe561e 100644 --- a/modules/observability/README.md +++ b/modules/observability/README.md @@ -121,7 +121,7 @@ The `firefly.observability` namespace is bound by [FireflyObservabilityPropertie | [`FireflyHealthIndicator`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/observability/src/main/java/org/fireflyframework/observability/health/FireflyHealthIndicator.java) | Abstract base class for all Firefly health indicators. | | [`FireflyObservabilityProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityProperties.java) | Unified configuration properties for Firefly observability. | | [`FireflyObservabilityAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityAutoConfiguration.java) | Master auto-configuration for Firefly Framework observability. | -| [`FireflyObservabilityEnvironmentPostProcessor`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessor.java) | Configures observability backends at startup based on Firefly properties. | +| [`FireflyObservabilityEnvironmentPostProcessorImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessorImpl.java) | Configures observability backends at startup based on Firefly properties. | ## Continue the application diff --git a/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityAutoConfiguration.java b/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityAutoConfiguration.java index 7f5776923..1d679e396 100644 --- a/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityAutoConfiguration.java +++ b/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityAutoConfiguration.java @@ -3,12 +3,12 @@ import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.observation.ObservationRegistry; import org.fireflyframework.observability.health.HealthMetricsBridge; -import org.fireflyframework.observability.metrics.FireflyMeterRegistryCustomizer; -import org.fireflyframework.observability.tracing.ClientObservationBeanPostProcessor; -import org.fireflyframework.observability.tracing.FeignMicrometerCapabilityFactory; +import org.fireflyframework.observability.metrics.FireflyMeterRegistryCustomizerImpl; +import org.fireflyframework.observability.tracing.ClientObservationBeanPostProcessorImpl; +import org.fireflyframework.observability.tracing.FeignMicrometerCapabilityFactoryImpl; import org.fireflyframework.observability.tracing.FireflyBaggageConfiguration; import org.fireflyframework.observability.tracing.FireflyTracingSupport; -import org.fireflyframework.observability.tracing.HttpErrorStatusObservationFilter; +import org.fireflyframework.observability.tracing.HttpErrorStatusObservationFilterImpl; import org.fireflyframework.observability.tracing.TracingRegistry; import org.springframework.beans.factory.FactoryBean; import org.springframework.beans.factory.annotation.Value; @@ -48,10 +48,10 @@ static class MetricsConfiguration { @Bean @ConditionalOnMissingBean - FireflyMeterRegistryCustomizer fireflyMeterRegistryCustomizer( + FireflyMeterRegistryCustomizerImpl fireflyMeterRegistryCustomizer( @Value("${spring.application.name:unknown}") String appName, @Value("${spring.profiles.active:default}") String environment) { - return new FireflyMeterRegistryCustomizer(appName, environment); + return new FireflyMeterRegistryCustomizerImpl(appName, environment); } } @@ -77,8 +77,8 @@ FireflyBaggageConfiguration fireflyBaggageConfiguration(FireflyObservabilityProp @Bean @ConditionalOnMissingBean - HttpErrorStatusObservationFilter httpErrorStatusObservationFilter() { - return new HttpErrorStatusObservationFilter(); + HttpErrorStatusObservationFilterImpl httpErrorStatusObservationFilter() { + return new HttpErrorStatusObservationFilterImpl(); } @Bean @@ -89,8 +89,8 @@ ObservationRegistryCustomizer fireflyObservationRegistryIns @Bean @ConditionalOnMissingBean - static ClientObservationBeanPostProcessor clientObservationBeanPostProcessor(Environment environment) { - return new ClientObservationBeanPostProcessor(environment); + static ClientObservationBeanPostProcessorImpl clientObservationBeanPostProcessor(Environment environment) { + return new ClientObservationBeanPostProcessorImpl(environment); } @Bean @@ -98,7 +98,7 @@ static ClientObservationBeanPostProcessor clientObservationBeanPostProcessor(Env @ConditionalOnMissingBean(name = "fireflyFeignMicrometerCapability") FactoryBean fireflyFeignMicrometerCapability(ObservationRegistry observationRegistry) throws ClassNotFoundException { - return new FeignMicrometerCapabilityFactory(observationRegistry); + return new FeignMicrometerCapabilityFactoryImpl(observationRegistry); } } diff --git a/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessor.java b/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessorImpl.java similarity index 99% rename from modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessor.java rename to modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessorImpl.java index 46103fa14..598e2f0b4 100644 --- a/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessor.java +++ b/modules/observability/src/main/java/org/fireflyframework/observability/FireflyObservabilityEnvironmentPostProcessorImpl.java @@ -56,7 +56,7 @@ * @see FireflyObservabilityProperties.TracingBridge * @see FireflyObservabilityProperties.MetricsExporter */ -public class FireflyObservabilityEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered { +public class FireflyObservabilityEnvironmentPostProcessorImpl implements EnvironmentPostProcessor, Ordered { // --- Tracing properties --- private static final String BRIDGE_PROPERTY = "firefly.observability.tracing.bridge"; diff --git a/modules/observability/src/main/java/org/fireflyframework/observability/metrics/FireflyMeterRegistryCustomizer.java b/modules/observability/src/main/java/org/fireflyframework/observability/metrics/FireflyMeterRegistryCustomizerImpl.java similarity index 82% rename from modules/observability/src/main/java/org/fireflyframework/observability/metrics/FireflyMeterRegistryCustomizer.java rename to modules/observability/src/main/java/org/fireflyframework/observability/metrics/FireflyMeterRegistryCustomizerImpl.java index fe4a8510c..5c4c501a4 100644 --- a/modules/observability/src/main/java/org/fireflyframework/observability/metrics/FireflyMeterRegistryCustomizer.java +++ b/modules/observability/src/main/java/org/fireflyframework/observability/metrics/FireflyMeterRegistryCustomizerImpl.java @@ -9,12 +9,12 @@ * registered in the {@link MeterRegistry}. This ensures every metric emitted * by any Firefly module carries consistent identifying labels. */ -public class FireflyMeterRegistryCustomizer implements MeterRegistryCustomizer { +public class FireflyMeterRegistryCustomizerImpl implements MeterRegistryCustomizer { private final String applicationName; private final String environment; - public FireflyMeterRegistryCustomizer(String applicationName, String environment) { + public FireflyMeterRegistryCustomizerImpl(String applicationName, String environment) { this.applicationName = applicationName; this.environment = environment; } diff --git a/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientObservationBeanPostProcessor.java b/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientObservationBeanPostProcessorImpl.java similarity index 95% rename from modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientObservationBeanPostProcessor.java rename to modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientObservationBeanPostProcessorImpl.java index 9a807eef3..86a8e71ae 100644 --- a/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientObservationBeanPostProcessor.java +++ b/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientObservationBeanPostProcessorImpl.java @@ -28,20 +28,20 @@ * Spring Boot property ({@code spring.kafka.*} / {@code spring.rabbitmq.*}) is also * honored so an explicit {@code false} in application configuration wins. */ -public class ClientObservationBeanPostProcessor implements BeanPostProcessor, BeanFactoryAware, PriorityOrdered { +public class ClientObservationBeanPostProcessorImpl implements BeanPostProcessor, BeanFactoryAware, PriorityOrdered { - private static final Logger log = LoggerFactory.getLogger(ClientObservationBeanPostProcessor.class); + private static final Logger log = LoggerFactory.getLogger(ClientObservationBeanPostProcessorImpl.class); private static final boolean WEB_CLIENT_PRESENT = ClassUtils.isPresent( "org.springframework.web.reactive.function.client.WebClient", - ClientObservationBeanPostProcessor.class.getClassLoader()); + ClientObservationBeanPostProcessorImpl.class.getClassLoader()); private static final Class WEB_CLIENT_TYPE = loadWebClientType("org.springframework.web.reactive.function.client.WebClient"); private static final Class WEB_CLIENT_BUILDER_TYPE = loadWebClientType("org.springframework.web.reactive.function.client.WebClient$Builder"); private final Environment environment; private BeanFactory beanFactory; - public ClientObservationBeanPostProcessor(Environment environment) { + public ClientObservationBeanPostProcessorImpl(Environment environment) { this.environment = environment; } @@ -116,7 +116,7 @@ private static Class loadWebClientType(String name) { return null; } try { - return Class.forName(name, false, ClientObservationBeanPostProcessor.class.getClassLoader()); + return Class.forName(name, false, ClientObservationBeanPostProcessorImpl.class.getClassLoader()); } catch (ClassNotFoundException ex) { return null; } diff --git a/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientTracingExchangeFilter.java b/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientTracingExchangeFilterImpl.java similarity index 93% rename from modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientTracingExchangeFilter.java rename to modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientTracingExchangeFilterImpl.java index 4e4503bdd..53157448e 100644 --- a/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientTracingExchangeFilter.java +++ b/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ClientTracingExchangeFilterImpl.java @@ -23,14 +23,14 @@ * client observation (Spring's {@code observationRegistry} on the builder), the filter * does nothing and does not open a second span. */ -public final class ClientTracingExchangeFilter implements ExchangeFilterFunction { +public final class ClientTracingExchangeFilterImpl implements ExchangeFilterFunction { - public static final ClientTracingExchangeFilter INSTANCE = new ClientTracingExchangeFilter(); + public static final ClientTracingExchangeFilterImpl INSTANCE = new ClientTracingExchangeFilterImpl(); private static final DefaultClientRequestObservationConvention CONVENTION = new DefaultClientRequestObservationConvention(); - private ClientTracingExchangeFilter() { + private ClientTracingExchangeFilterImpl() { } @Override diff --git a/modules/observability/src/main/java/org/fireflyframework/observability/tracing/FeignMicrometerCapabilityFactory.java b/modules/observability/src/main/java/org/fireflyframework/observability/tracing/FeignMicrometerCapabilityFactoryImpl.java similarity index 86% rename from modules/observability/src/main/java/org/fireflyframework/observability/tracing/FeignMicrometerCapabilityFactory.java rename to modules/observability/src/main/java/org/fireflyframework/observability/tracing/FeignMicrometerCapabilityFactoryImpl.java index 0cb74970e..071d9a375 100644 --- a/modules/observability/src/main/java/org/fireflyframework/observability/tracing/FeignMicrometerCapabilityFactory.java +++ b/modules/observability/src/main/java/org/fireflyframework/observability/tracing/FeignMicrometerCapabilityFactoryImpl.java @@ -12,12 +12,12 @@ * on Feign. Spring Cloud OpenFeign adds every {@code feign.Capability} bean to clients * it builds, which creates CLIENT spans and writes {@code traceparent}. */ -public final class FeignMicrometerCapabilityFactory implements FactoryBean { +public final class FeignMicrometerCapabilityFactoryImpl implements FactoryBean { private final ObservationRegistry observationRegistry; private final Class capabilityType; - public FeignMicrometerCapabilityFactory(ObservationRegistry observationRegistry) throws ClassNotFoundException { + public FeignMicrometerCapabilityFactoryImpl(ObservationRegistry observationRegistry) throws ClassNotFoundException { this.observationRegistry = observationRegistry; this.capabilityType = Class.forName("feign.micrometer.MicrometerCapability"); } diff --git a/modules/observability/src/main/java/org/fireflyframework/observability/tracing/HttpErrorStatusObservationFilter.java b/modules/observability/src/main/java/org/fireflyframework/observability/tracing/HttpErrorStatusObservationFilterImpl.java similarity index 98% rename from modules/observability/src/main/java/org/fireflyframework/observability/tracing/HttpErrorStatusObservationFilter.java rename to modules/observability/src/main/java/org/fireflyframework/observability/tracing/HttpErrorStatusObservationFilterImpl.java index ffcf960f7..97d4bd180 100644 --- a/modules/observability/src/main/java/org/fireflyframework/observability/tracing/HttpErrorStatusObservationFilter.java +++ b/modules/observability/src/main/java/org/fireflyframework/observability/tracing/HttpErrorStatusObservationFilterImpl.java @@ -21,7 +21,7 @@ * {@code error} is the signal {@code TracingObservationHandler} already understands: * it calls {@code span.error()}, which records the exception and sets the error status. */ -public class HttpErrorStatusObservationFilter implements ObservationFilter { +public class HttpErrorStatusObservationFilterImpl implements ObservationFilter { static final String ERROR_KEY = "error"; diff --git a/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ObservedClients.java b/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ObservedClients.java index 76d9d7814..138b8c1cd 100644 --- a/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ObservedClients.java +++ b/modules/observability/src/main/java/org/fireflyframework/observability/tracing/ObservedClients.java @@ -41,7 +41,7 @@ public static WebClient.Builder instrument(WebClient.Builder builder) { builder.observationRegistry(registry); } else { // Built before tracing started. The filter reads the registry on each call. - builder.filter(ClientTracingExchangeFilter.INSTANCE); + builder.filter(ClientTracingExchangeFilterImpl.INSTANCE); } return builder; } diff --git a/modules/observability/src/main/resources/META-INF/spring.factories b/modules/observability/src/main/resources/META-INF/spring.factories index ee615a711..28003664d 100644 --- a/modules/observability/src/main/resources/META-INF/spring.factories +++ b/modules/observability/src/main/resources/META-INF/spring.factories @@ -1,3 +1,3 @@ # EnvironmentPostProcessor registration (Spring Boot uses spring.factories for this SPI) org.springframework.boot.EnvironmentPostProcessor=\ - org.fireflyframework.observability.FireflyObservabilityEnvironmentPostProcessor + org.fireflyframework.observability.FireflyObservabilityEnvironmentPostProcessorImpl diff --git a/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/FireflyObservabilityAutoConfigurationTest.java b/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/FireflyObservabilityAutoConfigurationTest.java index 6652ea8b1..ea81a1602 100644 --- a/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/FireflyObservabilityAutoConfigurationTest.java +++ b/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/FireflyObservabilityAutoConfigurationTest.java @@ -5,7 +5,7 @@ import org.fireflyframework.observability.FireflyObservabilityAutoConfiguration; import org.fireflyframework.observability.FireflyObservabilityProperties; import org.fireflyframework.observability.health.HealthMetricsBridge; -import org.fireflyframework.observability.metrics.FireflyMeterRegistryCustomizer; +import org.fireflyframework.observability.metrics.FireflyMeterRegistryCustomizerImpl; import org.fireflyframework.observability.tracing.FireflyBaggageConfiguration; import org.fireflyframework.observability.tracing.FireflyTracingSupport; import org.junit.jupiter.api.Test; @@ -24,7 +24,7 @@ void metricsCustomizerRegisteredWhenMeterRegistryAvailable() { contextRunner .withBean(MeterRegistry.class, io.micrometer.core.instrument.simple.SimpleMeterRegistry::new) .run(context -> { - assertThat(context).hasSingleBean(FireflyMeterRegistryCustomizer.class); + assertThat(context).hasSingleBean(FireflyMeterRegistryCustomizerImpl.class); }); } @@ -53,7 +53,7 @@ void metricsDisabledViaProperty() { .withPropertyValues("firefly.observability.metrics.enabled=false") .withBean(MeterRegistry.class, io.micrometer.core.instrument.simple.SimpleMeterRegistry::new) .run(context -> { - assertThat(context).doesNotHaveBean(FireflyMeterRegistryCustomizer.class); + assertThat(context).doesNotHaveBean(FireflyMeterRegistryCustomizerImpl.class); }); } diff --git a/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/FireflyObservabilityEnvironmentPostProcessorTest.java b/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/FireflyObservabilityEnvironmentPostProcessorTest.java index f41c97af2..4f09e652c 100644 --- a/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/FireflyObservabilityEnvironmentPostProcessorTest.java +++ b/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/FireflyObservabilityEnvironmentPostProcessorTest.java @@ -16,7 +16,7 @@ package org.fireflyframework.observability.autoconfigure; -import org.fireflyframework.observability.FireflyObservabilityEnvironmentPostProcessor; +import org.fireflyframework.observability.FireflyObservabilityEnvironmentPostProcessorImpl; import org.junit.jupiter.api.Test; import org.springframework.boot.SpringApplication; import org.springframework.core.env.MutablePropertySources; @@ -26,8 +26,8 @@ class FireflyObservabilityEnvironmentPostProcessorTest { - private final FireflyObservabilityEnvironmentPostProcessor processor = - new FireflyObservabilityEnvironmentPostProcessor(); + private final FireflyObservabilityEnvironmentPostProcessorImpl processor = + new FireflyObservabilityEnvironmentPostProcessorImpl(); @Test void defaultsAreLoadedFromYaml() { diff --git a/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/IndexedAutoConfigurationExclusionsTest.java b/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/IndexedAutoConfigurationExclusionsTest.java index 21a9a756b..9b5955b5d 100644 --- a/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/IndexedAutoConfigurationExclusionsTest.java +++ b/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/IndexedAutoConfigurationExclusionsTest.java @@ -1,6 +1,6 @@ package org.fireflyframework.observability.autoconfigure; -import org.fireflyframework.observability.FireflyObservabilityEnvironmentPostProcessor; +import org.fireflyframework.observability.FireflyObservabilityEnvironmentPostProcessorImpl; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.config.YamlPropertiesFactoryBean; import org.springframework.boot.SpringApplication; @@ -52,7 +52,7 @@ private List bound(MockEnvironment environment) { void yamlIndexedExclusionsSurviveTracingBridgeConfiguration() { var environment = indexedEnvironment(false); assertThat(bound(environment)).containsExactlyElementsOf(DATABASE); - new FireflyObservabilityEnvironmentPostProcessor() + new FireflyObservabilityEnvironmentPostProcessorImpl() .postProcessEnvironment(environment, new SpringApplication()); assertThat(bound(environment)).containsAll(DATABASE).contains(BRAVE); } @@ -61,7 +61,7 @@ void yamlIndexedExclusionsSurviveTracingBridgeConfiguration() { void higherPriorityIndexedListWinsOverLowerScalarDefault() { var environment = indexedEnvironment(true); assertThat(bound(environment)).containsExactlyElementsOf(DATABASE); - new FireflyObservabilityEnvironmentPostProcessor() + new FireflyObservabilityEnvironmentPostProcessorImpl() .postProcessEnvironment(environment, new SpringApplication()); assertThat(bound(environment)).containsAll(DATABASE).contains(BRAVE) .doesNotContain("org.springframework.boot.webmvc.autoconfigure.WebMvcAutoConfiguration"); @@ -70,7 +70,7 @@ void higherPriorityIndexedListWinsOverLowerScalarDefault() { @Test void existingCommaSeparatedExclusionsRemainInOrder() { var environment = new MockEnvironment().withProperty(KEY, String.join(",", DATABASE)); - new FireflyObservabilityEnvironmentPostProcessor() + new FireflyObservabilityEnvironmentPostProcessorImpl() .postProcessEnvironment(environment, new SpringApplication()); assertThat(bound(environment)).containsExactly(DATABASE.get(0), DATABASE.get(1), DATABASE.get(2), DATABASE.get(3), BRAVE); @@ -80,7 +80,7 @@ void existingCommaSeparatedExclusionsRemainInOrder() { void disabledTracingDoesNotRewriteTheIndexedList() { var environment = indexedEnvironment(true) .withProperty("firefly.observability.tracing.enabled", "false"); - new FireflyObservabilityEnvironmentPostProcessor() + new FireflyObservabilityEnvironmentPostProcessorImpl() .postProcessEnvironment(environment, new SpringApplication()); assertThat(bound(environment)).containsExactlyElementsOf(DATABASE); } diff --git a/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/ObservabilityExporterDefaultsTest.java b/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/ObservabilityExporterDefaultsTest.java index 2bce2c2a8..21bad99ef 100644 --- a/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/ObservabilityExporterDefaultsTest.java +++ b/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/ObservabilityExporterDefaultsTest.java @@ -13,7 +13,7 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.fireflyframework.observability.FireflyObservabilityEnvironmentPostProcessor; +import org.fireflyframework.observability.FireflyObservabilityEnvironmentPostProcessorImpl; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -52,7 +52,7 @@ private ApplicationContextRunner runner(String bridge, String... properties) { .withPropertyValues("spring.autoconfigure.exclude=" + String.join(",", excluded), "firefly.observability.tracing.bridge=" + bridge) .withPropertyValues(properties) - .withInitializer(context -> new FireflyObservabilityEnvironmentPostProcessor() + .withInitializer(context -> new FireflyObservabilityEnvironmentPostProcessorImpl() .postProcessEnvironment(context.getEnvironment(), new SpringApplication())); } @@ -172,7 +172,7 @@ void genuineConfigDataProfileOverridesLowPrecedenceDefaults(String profile) { environment.setActiveProfiles(profile); environment.setProperty("spring.config.location", "classpath:exporter-defaults-profiles.yml"); ConfigDataEnvironmentPostProcessor.applyTo(environment); - new FireflyObservabilityEnvironmentPostProcessor().postProcessEnvironment(environment, new SpringApplication()); + new FireflyObservabilityEnvironmentPostProcessorImpl().postProcessEnvironment(environment, new SpringApplication()); assertThat(environment.getProperty("management.tracing.export.otlp.enabled")).isEqualTo(profile.equals("export-opt-in") ? "true" : "false"); assertThat(environment.getProperty("management.logging.export.otlp.enabled")).isEqualTo(profile.equals("export-opt-in") ? "true" : "false"); } diff --git a/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/TracingBridgeStartupTest.java b/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/TracingBridgeStartupTest.java index 208109db9..51b7c5e09 100644 --- a/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/TracingBridgeStartupTest.java +++ b/modules/observability/src/test/java/org/fireflyframework/observability/autoconfigure/TracingBridgeStartupTest.java @@ -1,9 +1,9 @@ package org.fireflyframework.observability.autoconfigure; import io.micrometer.tracing.Tracer; -import org.fireflyframework.observability.tracing.ClientObservationBeanPostProcessor; +import org.fireflyframework.observability.tracing.ClientObservationBeanPostProcessorImpl; import org.fireflyframework.observability.tracing.FireflyTracingSupport; -import org.fireflyframework.observability.tracing.HttpErrorStatusObservationFilter; +import org.fireflyframework.observability.tracing.HttpErrorStatusObservationFilterImpl; import org.junit.jupiter.api.Test; import org.springframework.boot.WebApplicationType; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -35,10 +35,10 @@ private void verifyBridge(String bridge, String tracerType) { assertThat(context.getBeansOfType(Tracer.class)).hasSize(1); assertThat(context.getBean(Tracer.class).getClass().getSimpleName()).isEqualTo(tracerType); assertThat(context.getBean(FireflyTracingSupport.class)).isNotNull(); - assertThat(context.getBean(HttpErrorStatusObservationFilter.class)) + assertThat(context.getBean(HttpErrorStatusObservationFilterImpl.class)) .as("5xx responses must be able to mark span status ERROR") .isNotNull(); - assertThat(context.getBean(ClientObservationBeanPostProcessor.class)) + assertThat(context.getBean(ClientObservationBeanPostProcessorImpl.class)) .as("client and messaging beans must be instrumented at startup") .isNotNull(); } diff --git a/modules/observability/src/test/java/org/fireflyframework/observability/tracing/DistributedTracingTest.java b/modules/observability/src/test/java/org/fireflyframework/observability/tracing/DistributedTracingTest.java index 3d7fcf079..95fd21354 100644 --- a/modules/observability/src/test/java/org/fireflyframework/observability/tracing/DistributedTracingTest.java +++ b/modules/observability/src/test/java/org/fireflyframework/observability/tracing/DistributedTracingTest.java @@ -68,7 +68,7 @@ void setUp() throws IOException { new DefaultTracingObservationHandler(tracer)); registry.observationConfig() .observationHandler(tracing) - .observationFilter(new HttpErrorStatusObservationFilter()); + .observationFilter(new HttpErrorStatusObservationFilterImpl()); TracingRegistry.install(registry); traceparent.set(null); @@ -143,7 +143,7 @@ void webClientFiveHundredSetsErrorStatusWithoutAnApplicationException() { void restTemplateFiveHundredIsAnErrorSpan() { RestTemplate restTemplate = new RestTemplate(); restTemplate.setErrorHandler(response -> false); - new ClientObservationBeanPostProcessor(new MockEnvironment()) + new ClientObservationBeanPostProcessorImpl(new MockEnvironment()) .postProcessAfterInitialization(restTemplate, "restTemplate"); restTemplate.getForEntity(baseUrl() + "/fail", String.class); @@ -194,7 +194,7 @@ void unhandledExceptionRecordsTheOriginalFailure() { @Test void messagingInfrastructureBeansAreObservedByDefault() { KafkaTemplateProbe probe = new KafkaTemplateProbe(); - new ClientObservationBeanPostProcessor(new MockEnvironment()) + new ClientObservationBeanPostProcessorImpl(new MockEnvironment()) .postProcessAfterInitialization(probe, "kafka"); assertThat(probe.enabled).isTrue(); diff --git a/modules/observability/src/test/java/org/fireflyframework/observability/tracing/ReactiveContextPropagationTest.java b/modules/observability/src/test/java/org/fireflyframework/observability/tracing/ReactiveContextPropagationTest.java index a108d4985..7b98b052f 100644 --- a/modules/observability/src/test/java/org/fireflyframework/observability/tracing/ReactiveContextPropagationTest.java +++ b/modules/observability/src/test/java/org/fireflyframework/observability/tracing/ReactiveContextPropagationTest.java @@ -11,7 +11,7 @@ import java.util.List; import java.util.Set; import java.util.stream.Stream; -import org.fireflyframework.observability.FireflyObservabilityEnvironmentPostProcessor; +import org.fireflyframework.observability.FireflyObservabilityEnvironmentPostProcessorImpl; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.parallel.Isolated; @@ -73,7 +73,7 @@ private ApplicationContextRunner runner(String bridge, String... properties) { .withPropertyValues("spring.autoconfigure.exclude=" + String.join(",", excluded), "firefly.observability.tracing.bridge=" + bridge) .withPropertyValues(properties) - .withInitializer(context -> new FireflyObservabilityEnvironmentPostProcessor() + .withInitializer(context -> new FireflyObservabilityEnvironmentPostProcessorImpl() .postProcessEnvironment(context.getEnvironment(), new SpringApplication())); } diff --git a/modules/orchestration/docs/configuration.md b/modules/orchestration/docs/configuration.md index db21a4e7d..4da71010a 100644 --- a/modules/orchestration/docs/configuration.md +++ b/modules/orchestration/docs/configuration.md @@ -142,9 +142,9 @@ The module's auto-configurations load in a specific order to ensure dependencies `OrchestrationPersistenceAutoConfiguration` runs first. It creates the persistence provider based on classpath and properties: -- If `spring-data-redis-reactive` + `provider=redis` → `RedisPersistenceProvider` -- If `fireflyframework-cache` + `provider=cache` → `CachePersistenceProvider` -- If `fireflyframework-eventsourcing` + `provider=event-sourced` → `EventSourcedPersistenceProvider` +- If `spring-data-redis-reactive` + `provider=redis` → `RedisPersistenceProviderImpl` +- If `fireflyframework-cache` + `provider=cache` → `CachePersistenceProviderImpl` +- If `fireflyframework-eventsourcing` + `provider=event-sourced` → `EventSourcedPersistenceProviderImpl` - Otherwise → falls through to Phase 1 fallback ### Phase 1: Core Infrastructure @@ -155,15 +155,15 @@ The module's auto-configurations load in a specific order to ensure dependencies |------|------|-----------| | `ArgumentResolver` | `ArgumentResolver` | `@ConditionalOnMissingBean` | | `StepInvoker` | `StepInvoker` | `@ConditionalOnMissingBean` | -| `OrchestrationLoggerEvents` | `OrchestrationLoggerEvents` | `@ConditionalOnMissingBean` | -| `OrchestrationEvents` | `CompositeOrchestrationEvents` | `@Primary`: wraps all event delegates | -| `ExecutionPersistenceProvider` | `InMemoryPersistenceProvider` | `@ConditionalOnMissingBean` (fallback) | -| `DeadLetterStore` | `InMemoryDeadLetterStore` | `@ConditionalOnMissingBean` | +| `OrchestrationLoggerEventsImpl` | `OrchestrationLoggerEventsImpl` | `@ConditionalOnMissingBean` | +| `OrchestrationEvents` | `CompositeOrchestrationEventsImpl` | `@Primary`: wraps all event delegates | +| `ExecutionPersistenceProvider` | `InMemoryPersistenceProviderImpl` | `@ConditionalOnMissingBean` (fallback) | +| `DeadLetterStore` | `InMemoryDeadLetterStoreImpl` | `@ConditionalOnMissingBean` | | `DeadLetterService` | `DeadLetterService` | DLQ enabled (default: `true`) | -| `OrchestrationEventPublisher` | `NoOpEventPublisher` | `@ConditionalOnMissingBean` | +| `OrchestrationEventPublisher` | `NoOpEventPublisherImpl` | `@ConditionalOnMissingBean` | | `OrchestrationScheduler` | `OrchestrationScheduler` | `@ConditionalOnMissingBean` | | `RecoveryService` | `RecoveryService` | Recovery enabled (default: `true`) | -| `SchedulingPostProcessor` | `SchedulingPostProcessor` | `@ConditionalOnMissingBean` | +| `SchedulingPostProcessorImpl` | `SchedulingPostProcessorImpl` | `@ConditionalOnMissingBean` | | `BackpressureStrategyFactory` | Static utility | Always available (static registry) | | `OrchestrationValidator` | `OrchestrationValidator` | `validation.enabled=true` (default) | | `CompensationErrorHandlerFactory` | Static utility | Always available (static registry) | @@ -216,11 +216,11 @@ Each enabled pattern creates its registry, orchestrator, and engine: | Auto-Configuration | Bean | Classpath Condition | |--------------------|------|---------------------| -| `OrchestrationMetricsAutoConfiguration` | `OrchestrationMetrics` | `MeterRegistry` on classpath | +| `OrchestrationMetricsAutoConfiguration` | `OrchestrationMetricsImpl` | `MeterRegistry` on classpath | | `OrchestrationMetricsAutoConfiguration` | `OrchestrationMetricsEndpoint` | `MeterRegistry` + Actuator on classpath | | `OrchestrationTracingAutoConfiguration` | `OrchestrationTracer` | `ObservationRegistry` on classpath | | `OrchestrationResilienceAutoConfiguration` | `ResilienceDecorator` | `CircuitBreakerRegistry` on classpath | -| `OrchestrationRestAutoConfiguration` | `OrchestrationController`, `DeadLetterController`, `OrchestrationHealthIndicator` | Reactive web application | +| `OrchestrationRestAutoConfiguration` | `OrchestrationController`, `DeadLetterController`, `OrchestrationHealthIndicatorImpl` | Reactive web application | | `EventGatewayAutoConfiguration` | `EventGateway` + initializer | Always (after pattern engines) | Additional composition beans registered during Phase 3: @@ -316,7 +316,7 @@ firefly: ### Actuator Integration -When `health.enabled=true` and Spring Boot Actuator is on the classpath, the `OrchestrationHealthIndicator` is registered automatically. It reports: +When `health.enabled=true` and Spring Boot Actuator is on the classpath, the `OrchestrationHealthIndicatorImpl` is registered automatically. It reports: - `UP`: persistence is healthy - `DOWN`: persistence health check failed diff --git a/modules/orchestration/docs/core-infrastructure.md b/modules/orchestration/docs/core-infrastructure.md index 4f4a71c3b..33def3dbf 100644 --- a/modules/orchestration/docs/core-infrastructure.md +++ b/modules/orchestration/docs/core-infrastructure.md @@ -421,11 +421,11 @@ Factory methods: `executionStarted(...)`, `executionCompleted(...)`, `stepComple ### OrchestrationEventPublisher -Events are published through the `OrchestrationEventPublisher` interface. The default is `NoOpEventPublisher`: replace it with a custom bean for your messaging infrastructure: +Events are published through the `OrchestrationEventPublisher` interface. The default is `NoOpEventPublisherImpl`: replace it with a custom bean for your messaging infrastructure: ```java @Component -public class KafkaEventPublisher implements OrchestrationEventPublisher { +public class KafkaEventPublisherImpl implements OrchestrationEventPublisher { @Override public Mono publish(OrchestrationEvent event) { return kafkaTemplate.send(event.topic(), event.key(), event).then(); @@ -490,7 +490,7 @@ public class MultiScheduleSaga { ... } ### How Scanning Works -`SchedulingPostProcessor` is a `BeanPostProcessor` that scans all beans for `@ScheduledWorkflow`, `@ScheduledSaga`, and `@ScheduledTcc` annotations. For each annotation found, it registers a task with `OrchestrationScheduler` that invokes the corresponding engine. +`SchedulingPostProcessorImpl` is a `BeanPostProcessor` that scans all beans for `@ScheduledWorkflow`, `@ScheduledSaga`, and `@ScheduledTcc` annotations. For each annotation found, it registers a task with `OrchestrationScheduler` that invokes the corresponding engine. ### OrchestrationScheduler API @@ -679,7 +679,7 @@ firefly: ### Built-In Providers -#### InMemoryPersistenceProvider (Default) +#### InMemoryPersistenceProviderImpl (Default) - Storage: `ConcurrentHashMap` - Full query support (`findByPattern`, `findByStatus`, `findInFlight`, `findStale`) @@ -687,7 +687,7 @@ firefly: - Data lost on process restart - Best for: development, testing -#### RedisPersistenceProvider +#### RedisPersistenceProviderImpl - Requires: `spring-boot-starter-data-redis-reactive` on classpath - Condition: `firefly.orchestration.persistence.provider=redis` @@ -698,7 +698,7 @@ firefly: - Supports execution-state queries. Survival across restarts depends on the Redis deployment and its persistence configuration. - Use when execution snapshots must be shared between instances. Signal waiters and timers still belong to their process. -#### CachePersistenceProvider +#### CachePersistenceProviderImpl - Requires: `fireflyframework-cache` module on classpath - Condition: `firefly.orchestration.persistence.provider=cache` @@ -710,7 +710,7 @@ firefly: - Configurable TTL via `firefly.orchestration.persistence.key-ttl` - Best for: when you already use the Firefly Cache module -#### EventSourcedPersistenceProvider +#### EventSourcedPersistenceProviderImpl - Requires: `fireflyframework-eventsourcing` module on classpath - Condition: `firefly.orchestration.persistence.provider=event-sourced` @@ -810,7 +810,7 @@ Factory method: `DeadLetterEntry.create(executionName, correlationId, pattern, s ### Custom DLQ Store -The default `InMemoryDeadLetterStore` can be replaced: +The default `InMemoryDeadLetterStoreImpl` can be replaced: ```java @Component @@ -938,9 +938,9 @@ All orchestration lifecycle events flow through the `OrchestrationEvents` interf | `onCompositionStarted(String compositionName, String correlationId)` | Cross-pattern composition begins | | `onCompositionCompleted(String compositionName, String correlationId, boolean success)` | Composition completes | -### CompositeOrchestrationEvents +### CompositeOrchestrationEventsImpl -The auto-configuration collects **all** `OrchestrationEvents` beans and wraps them in a `CompositeOrchestrationEvents` that fans out each call to every delegate. Each delegate has error isolation: one listener failing does not prevent others from firing. +The auto-configuration collects **all** `OrchestrationEvents` beans and wraps them in a `CompositeOrchestrationEventsImpl` that fans out each call to every delegate. Each delegate has error isolation: one listener failing does not prevent others from firing. ### Custom Event Listener @@ -973,7 +973,7 @@ firefly: enabled: true # default ``` -`OrchestrationMetrics` implements `OrchestrationEvents` and records the following metrics: +`OrchestrationMetricsImpl` implements `OrchestrationEvents` and records the following metrics: | Metric Name | Type | Tags | Description | |-------------|------|------|-------------| @@ -1190,7 +1190,7 @@ All strategies accept a list of items and an `ItemProcessor` that processes each ### Implementations -#### AdaptiveBackpressureStrategy +#### AdaptiveBackpressureStrategyImpl Dynamic concurrency adjustment based on real-time error rates. Uses `AtomicInteger currentConcurrency` and `AtomicLong totalProcessed` / `AtomicLong totalErrors` for thread-safe tracking. @@ -1208,7 +1208,7 @@ Scaling behavior: Uses `Flux.flatMap(processor, currentConcurrency.get())` internally to enforce the dynamic concurrency limit. -#### BatchedBackpressureStrategy +#### BatchedBackpressureStrategyImpl Fixed-size batch processing. Batches are processed **sequentially**; items **within** a batch are processed concurrently. @@ -1223,7 +1223,7 @@ Flux.fromIterable(items) .flatMap(processor::process)) ``` -#### CircuitBreakerBackpressureStrategy +#### CircuitBreakerBackpressureStrategyImpl Three-state circuit breaker using `AtomicReference`. @@ -1251,7 +1251,7 @@ Configuration record with 9 fields: | Field | Type | Description | |-------|------|-------------| | `strategy` | `String` | Strategy name (e.g., `"adaptive"`, `"batched"`, `"circuit-breaker"`) | -| `batchSize` | `int` | Batch size for `BatchedBackpressureStrategy` | +| `batchSize` | `int` | Batch size for `BatchedBackpressureStrategyImpl` | | `failureThreshold` | `int` | Failure threshold for circuit breaker | | `recoveryTimeout` | `Duration` | Recovery timeout for circuit breaker | | `halfOpenMaxCalls` | `int` | Half-open max calls for circuit breaker | @@ -1277,11 +1277,11 @@ Pre-registered strategies (5): | Name | Strategy | Configuration | |------|----------|---------------| -| `"adaptive"` | `AdaptiveBackpressureStrategy` | Default parameters | -| `"batched"` | `BatchedBackpressureStrategy` | Default batch size (10) | -| `"circuit-breaker"` | `CircuitBreakerBackpressureStrategy` | Default parameters (threshold=5, recovery=30s, halfOpen=3) | -| `"circuit-breaker-aggressive"` | `CircuitBreakerBackpressureStrategy` | threshold=2, recovery=60s, halfOpen=1 | -| `"circuit-breaker-conservative"` | `CircuitBreakerBackpressureStrategy` | threshold=10, recovery=15s, halfOpen=5 | +| `"adaptive"` | `AdaptiveBackpressureStrategyImpl` | Default parameters | +| `"batched"` | `BatchedBackpressureStrategyImpl` | Default batch size (10) | +| `"circuit-breaker"` | `CircuitBreakerBackpressureStrategyImpl` | Default parameters (threshold=5, recovery=30s, halfOpen=3) | +| `"circuit-breaker-aggressive"` | `CircuitBreakerBackpressureStrategyImpl` | threshold=2, recovery=60s, halfOpen=1 | +| `"circuit-breaker-conservative"` | `CircuitBreakerBackpressureStrategyImpl` | threshold=10, recovery=15s, halfOpen=5 | ### Usage in Engines @@ -1495,7 +1495,7 @@ The `org.fireflyframework.orchestration.core.observability.OrchestrationMetricsE @Endpoint(id = "orchestration-metrics") ``` -Conditional on Spring Boot Actuator being on the classpath. Reads counters from the `MeterRegistry` registered by `OrchestrationMetrics` (see [§35](#38-observability-metrics--tracing)). +Conditional on Spring Boot Actuator being on the classpath. Reads counters from the `MeterRegistry` registered by `OrchestrationMetricsImpl` (see [§35](#38-observability-metrics--tracing)). ### Endpoints @@ -1720,7 +1720,7 @@ ExecutionSummary record: | `failureReason` | `String` | Failure message (if failed) | | `eventCount` | `int` | Total events processed for this execution | -### EventSourcedPersistenceProvider +### EventSourcedPersistenceProviderImpl Implements `ExecutionPersistenceProvider` with full event-sourcing semantics. diff --git a/modules/orchestration/docs/foundations.md b/modules/orchestration/docs/foundations.md index eda2cefd1..d4df7bec6 100644 --- a/modules/orchestration/docs/foundations.md +++ b/modules/orchestration/docs/foundations.md @@ -83,9 +83,9 @@ sagaEngine.execute("HelloSaga", StepInputs.of("greet", "World")) No configuration is required for development. The module starts with: - All three patterns enabled (Workflow, Saga, TCC) -- `InMemoryPersistenceProvider` for execution state -- SLF4J structured logging via `OrchestrationLoggerEvents` -- Dead-letter queue enabled with `InMemoryDeadLetterStore` +- `InMemoryPersistenceProviderImpl` for execution state +- SLF4J structured logging via `OrchestrationLoggerEventsImpl` +- Dead-letter queue enabled with `InMemoryDeadLetterStoreImpl` - Scheduler with 4 threads - No-op event publisher (replace with Kafka/RabbitMQ adapter for production) - Recovery service enabled with 1-hour stale threshold @@ -162,9 +162,9 @@ The module is organized into four layers. Your application defines orchestration **Infrastructure Layer**: Pluggable adapters: - `ExecutionPersistenceProvider`: state storage (`InMemory`, `Redis`, `Cache`, `EventSourced`) - `OrchestrationEvents`: lifecycle event callbacks (26 methods) -- `OrchestrationMetrics`: Micrometer counters and timers (8 metrics) +- `OrchestrationMetricsImpl`: Micrometer counters and timers (8 metrics) - `OrchestrationTracer`: Micrometer Observation API spans -- `OrchestrationEventPublisher`: domain event publishing (`NoOpEventPublisher` default) +- `OrchestrationEventPublisher`: domain event publishing (`NoOpEventPublisherImpl` default) - `OrchestrationMetricsEndpoint`: Actuator endpoint for orchestration metrics summary ### Data Flow diff --git a/modules/orchestration/docs/recipes-and-production.md b/modules/orchestration/docs/recipes-and-production.md index eede1e28b..e0eef189f 100644 --- a/modules/orchestration/docs/recipes-and-production.md +++ b/modules/orchestration/docs/recipes-and-production.md @@ -219,7 +219,7 @@ void saga_fullExecution_success() { var events = new OrchestrationEvents() {}; var invoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var orchestrator = new SagaExecutionOrchestrator(invoker, events, noOpPublisher); var compensator = new SagaCompensator(events, CompensationPolicy.STRICT_SEQUENTIAL, invoker); @@ -392,11 +392,11 @@ The framework provides several compensation error handler strategies. Select the | Handler | Behavior | Use When | |---------|----------|----------| -| `"default"` (`DefaultCompensationErrorHandler`) | Retry with backoff | General-purpose default | -| `"fail-fast"` (`FailFastErrorHandler`) | Always returns `FAIL_SAGA` | Critical compensations that must not be retried | -| `"log-and-continue"` (`LogAndContinueErrorHandler`) | Logs WARN, returns `CONTINUE` | Best-effort compensations | -| `"retry"` (`RetryWithBackoffErrorHandler`) | Configurable retry with backoff | Transient failures expected | -| `"robust"` (`CompositeCompensationErrorHandler`) | Chains retry then log-and-continue | Production systems | +| `"default"` (`DefaultCompensationErrorHandlerImpl`) | Retry with backoff | General-purpose default | +| `"fail-fast"` (`FailFastErrorHandlerImpl`) | Always returns `FAIL_SAGA` | Critical compensations that must not be retried | +| `"log-and-continue"` (`LogAndContinueErrorHandlerImpl`) | Logs WARN, returns `CONTINUE` | Best-effort compensations | +| `"retry"` (`RetryWithBackoffErrorHandlerImpl`) | Configurable retry with backoff | Transient failures expected | +| `"robust"` (`CompositeCompensationErrorHandlerImpl`) | Chains retry then log-and-continue | Production systems | Configure globally via application properties: @@ -448,7 +448,7 @@ Implement `OrchestrationEventPublisher` to forward to your message broker: ```java @Component -public class KafkaEventPublisher implements OrchestrationEventPublisher { +public class KafkaEventPublisherImpl implements OrchestrationEventPublisher { private final KafkaTemplate kafka; @Override @@ -670,7 +670,7 @@ Check: Steps only run in parallel if they're in the same DAG layer. Steps in the Check: 1. Is `publishEvents = true` on the `@Workflow`? (or `@StepEvent` on the saga step?) -2. Is there a custom `OrchestrationEventPublisher` bean? The default is `NoOpEventPublisher`. +2. Is there a custom `OrchestrationEventPublisher` bean? The default is `NoOpEventPublisherImpl`. 3. Is the `EventGateway` initialized? Check startup logs for `[event-gateway] Scan complete`. ### "TCC Cancel runs for participants that didn't Try" @@ -794,12 +794,12 @@ Execution reporting works the same across all patterns: ### Setup -Configure the `EventSourcedPersistenceProvider` to store execution state as an append-only event log instead of mutable snapshots: +Configure the `EventSourcedPersistenceProviderImpl` to store execution state as an append-only event log instead of mutable snapshots: ```java @Bean public ExecutionPersistenceProvider persistenceProvider(EventStore eventStore, ObjectMapper mapper) { - return new EventSourcedPersistenceProvider(eventStore, mapper); + return new EventSourcedPersistenceProviderImpl(eventStore, mapper); } ``` @@ -817,7 +817,7 @@ firefly: The event-sourced provider includes an `OrchestrationProjection` for querying materialized views of execution history: ```java -EventSourcedPersistenceProvider provider = ...; +EventSourcedPersistenceProviderImpl provider = ...; OrchestrationProjection projection = provider.getProjection(); // Find all failed executions diff --git a/modules/orchestration/docs/saga.md b/modules/orchestration/docs/saga.md index d53eebf0f..ac1d62b57 100644 --- a/modules/orchestration/docs/saga.md +++ b/modules/orchestration/docs/saga.md @@ -388,12 +388,12 @@ public interface CompensationErrorHandler { } ``` -#### DefaultCompensationErrorHandler +#### DefaultCompensationErrorHandlerImpl Always returns `CONTINUE`. This matches the legacy behavior where compensation errors are silently swallowed and subsequent compensation steps proceed regardless. ```java -public class DefaultCompensationErrorHandler implements CompensationErrorHandler { +public class DefaultCompensationErrorHandlerImpl implements CompensationErrorHandler { @Override public CompensationErrorResult handle(String sagaName, String stepId, Throwable error, int attempt) { return CompensationErrorResult.CONTINUE; @@ -401,15 +401,15 @@ public class DefaultCompensationErrorHandler implements CompensationErrorHandler } ``` -#### RetryWithBackoffErrorHandler +#### RetryWithBackoffErrorHandlerImpl Retries compensation up to `maxRetries` times. Optionally filters which exception types are retryable via the `retryableTypes` set. Returns `RETRY` if under the limit and the error is retryable, `FAIL_SAGA` otherwise. ```java -public class RetryWithBackoffErrorHandler implements CompensationErrorHandler { +public class RetryWithBackoffErrorHandlerImpl implements CompensationErrorHandler { - public RetryWithBackoffErrorHandler(int maxRetries) { ... } - public RetryWithBackoffErrorHandler(int maxRetries, Set> retryableTypes) { ... } + public RetryWithBackoffErrorHandlerImpl(int maxRetries) { ... } + public RetryWithBackoffErrorHandlerImpl(int maxRetries, Set> retryableTypes) { ... } @Override public CompensationErrorResult handle(String sagaName, String stepId, Throwable error, int attempt) { @@ -420,12 +420,12 @@ public class RetryWithBackoffErrorHandler implements CompensationErrorHandler { } ``` -#### FailFastErrorHandler +#### FailFastErrorHandlerImpl Always returns `FAIL_SAGA` and logs the error at `ERROR` level. Use this when any compensation failure should immediately abort remaining compensations. ```java -public class FailFastErrorHandler implements CompensationErrorHandler { +public class FailFastErrorHandlerImpl implements CompensationErrorHandler { @Override public CompensationErrorResult handle(String sagaName, String stepId, Throwable error, int attempt) { log.error("Failing saga '{}' due to compensation error on step '{}': {}", @@ -435,12 +435,12 @@ public class FailFastErrorHandler implements CompensationErrorHandler { } ``` -#### LogAndContinueErrorHandler +#### LogAndContinueErrorHandlerImpl Always returns `CONTINUE` and logs the error at `WARN` level. Use this when compensation errors should be recorded but not block subsequent compensations. ```java -public class LogAndContinueErrorHandler implements CompensationErrorHandler { +public class LogAndContinueErrorHandlerImpl implements CompensationErrorHandler { @Override public CompensationErrorResult handle(String sagaName, String stepId, Throwable error, int attempt) { log.warn("Compensation error on step '{}' in saga '{}' (attempt {}), continuing: {}", @@ -450,14 +450,14 @@ public class LogAndContinueErrorHandler implements CompensationErrorHandler { } ``` -#### CompositeCompensationErrorHandler +#### CompositeCompensationErrorHandlerImpl Chains multiple handlers in order. Iterates through the list and returns the first non-`CONTINUE` result. If all handlers return `CONTINUE`, the composite returns `CONTINUE`. ```java -public class CompositeCompensationErrorHandler implements CompensationErrorHandler { +public class CompositeCompensationErrorHandlerImpl implements CompensationErrorHandler { - public CompositeCompensationErrorHandler(List handlers) { ... } + public CompositeCompensationErrorHandlerImpl(List handlers) { ... } @Override public CompensationErrorResult handle(String sagaName, String stepId, Throwable error, int attempt) { @@ -488,10 +488,10 @@ Pre-registered handler names: | Name | Handler | Description | |------|---------|-------------| -| `"default"` | `DefaultCompensationErrorHandler` | Always `CONTINUE` (legacy swallow behavior) | -| `"fail-fast"` | `FailFastErrorHandler` | Always `FAIL_SAGA`, logs at ERROR | -| `"log-and-continue"` | `LogAndContinueErrorHandler` | Always `CONTINUE`, logs at WARN | -| `"retry"` | `RetryWithBackoffErrorHandler(3)` | Retry up to 3 times, then `FAIL_SAGA` | +| `"default"` | `DefaultCompensationErrorHandlerImpl` | Always `CONTINUE` (legacy swallow behavior) | +| `"fail-fast"` | `FailFastErrorHandlerImpl` | Always `FAIL_SAGA`, logs at ERROR | +| `"log-and-continue"` | `LogAndContinueErrorHandlerImpl` | Always `CONTINUE`, logs at WARN | +| `"retry"` | `RetryWithBackoffErrorHandlerImpl(3)` | Retry up to 3 times, then `FAIL_SAGA` | | `"robust"` | Composite: retry(3) + log-and-continue | Retries first, then logs and continues on exhaustion | Configuration: @@ -507,16 +507,16 @@ firefly: ```java CompensationErrorHandler handler = CompensationErrorHandlerFactory.getHandler("robust") - .orElseGet(DefaultCompensationErrorHandler::new); + .orElseGet(DefaultCompensationErrorHandlerImpl::new); // Or register a custom handler CompensationErrorHandlerFactory.registerHandler("custom", - () -> new RetryWithBackoffErrorHandler(5, Set.of(TimeoutException.class))); + () -> new RetryWithBackoffErrorHandlerImpl(5, Set.of(TimeoutException.class))); // Or build a composite inline CompensationErrorHandler composite = CompensationErrorHandlerFactory.composite( - new RetryWithBackoffErrorHandler(3), - new LogAndContinueErrorHandler() + new RetryWithBackoffErrorHandlerImpl(3), + new LogAndContinueErrorHandlerImpl() ); ``` diff --git a/modules/orchestration/docs/tutorial.md b/modules/orchestration/docs/tutorial.md index fc3b79c15..88f98e76e 100644 --- a/modules/orchestration/docs/tutorial.md +++ b/modules/orchestration/docs/tutorial.md @@ -1081,7 +1081,7 @@ spring: enabled: true ``` -The `RedisPersistenceProvider` activates automatically when: +The `RedisPersistenceProviderImpl` activates automatically when: - `spring-data-redis-reactive` is on the classpath - `firefly.orchestration.persistence.provider=redis` is set @@ -1227,7 +1227,7 @@ When the ledger step fails: 4. `@OnSagaError` fires with the error details 5. A DLQ entry is created for the failed step -The complete execution flow is visible in the logs via `OrchestrationLoggerEvents` and in metrics via `firefly.orchestration.executions.completed{success=false}`. +The complete execution flow is visible in the logs via `OrchestrationLoggerEventsImpl` and in metrics via `firefly.orchestration.executions.completed{success=false}`. --- diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationAutoConfiguration.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationAutoConfiguration.java index 4cd375405..8d4a53f9a 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationAutoConfiguration.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationAutoConfiguration.java @@ -19,18 +19,18 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.dlq.DeadLetterService; import org.fireflyframework.orchestration.core.dlq.DeadLetterStore; -import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStore; -import org.fireflyframework.orchestration.core.event.EdaOrchestrationEventPublisher; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStoreImpl; +import org.fireflyframework.orchestration.core.event.EdaOrchestrationEventPublisherImpl; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.event.OrchestrationEventPublisher; -import org.fireflyframework.orchestration.core.observability.CompositeOrchestrationEvents; +import org.fireflyframework.orchestration.core.observability.CompositeOrchestrationEventsImpl; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.observability.OrchestrationLoggerEvents; +import org.fireflyframework.orchestration.core.observability.OrchestrationLoggerEventsImpl; import org.fireflyframework.orchestration.core.persistence.ExecutionPersistenceProvider; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.recovery.RecoveryService; import org.fireflyframework.orchestration.core.scheduling.OrchestrationScheduler; -import org.fireflyframework.orchestration.core.scheduling.SchedulingPostProcessor; +import org.fireflyframework.orchestration.core.scheduling.SchedulingPostProcessorImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.core.validation.OrchestrationValidator; import org.fireflyframework.orchestration.saga.engine.SagaEngine; @@ -89,39 +89,39 @@ public OrchestrationValidator orchestrationValidator() { @Bean @ConditionalOnMissingBean - public OrchestrationLoggerEvents orchestrationLoggerEvents() { - return new OrchestrationLoggerEvents(); + public OrchestrationLoggerEventsImpl orchestrationLoggerEvents() { + return new OrchestrationLoggerEventsImpl(); } @Bean @Primary @ConditionalOnMissingBean(name = "orchestrationEvents") public OrchestrationEvents orchestrationEvents(List allEvents, - ObjectProvider loggerEvents) { + ObjectProvider loggerEvents) { List delegates = allEvents.stream() - .filter(e -> !(e instanceof CompositeOrchestrationEvents)) + .filter(e -> !(e instanceof CompositeOrchestrationEventsImpl)) .collect(Collectors.toCollection(ArrayList::new)); if (delegates.isEmpty()) { - OrchestrationLoggerEvents logger = loggerEvents.getIfAvailable(OrchestrationLoggerEvents::new); + OrchestrationLoggerEventsImpl logger = loggerEvents.getIfAvailable(OrchestrationLoggerEventsImpl::new); delegates.add(logger); } if (delegates.size() == 1) { return delegates.get(0); } - return new CompositeOrchestrationEvents(delegates); + return new CompositeOrchestrationEventsImpl(delegates); } @Bean @ConditionalOnMissingBean public ExecutionPersistenceProvider executionPersistenceProvider() { log.info("[orchestration] Using in-memory persistence provider (default)"); - return new InMemoryPersistenceProvider(); + return new InMemoryPersistenceProviderImpl(); } @Bean @ConditionalOnMissingBean public DeadLetterStore deadLetterStore() { - return new InMemoryDeadLetterStore(); + return new InMemoryDeadLetterStoreImpl(); } @Bean @@ -164,7 +164,7 @@ public OrchestrationEventPublisher edaOrchestrationEventPublisher( OrchestrationProperties properties) { String defaultTopic = properties.getEvents() != null ? properties.getEvents().getDefaultTopic() : null; log.info("[orchestration] EDA event publisher bridge activated (defaultTopic={})", defaultTopic); - return new EdaOrchestrationEventPublisher(publisherFactory, defaultTopic); + return new EdaOrchestrationEventPublisherImpl(publisherFactory, defaultTopic); } } @@ -172,7 +172,7 @@ public OrchestrationEventPublisher edaOrchestrationEventPublisher( @ConditionalOnMissingBean(OrchestrationEventPublisher.class) public OrchestrationEventPublisher orchestrationEventPublisher() { log.info("[orchestration] Using no-op event publisher (default)"); - return new NoOpEventPublisher(); + return new NoOpEventPublisherImpl(); } @Bean @@ -211,13 +211,13 @@ public SmartInitializingSingleton recoverySchedulingInitializer( @Bean @ConditionalOnMissingBean - public SchedulingPostProcessor schedulingPostProcessor(ApplicationContext applicationContext, + public SchedulingPostProcessorImpl schedulingPostProcessor(ApplicationContext applicationContext, OrchestrationScheduler scheduler, ObjectProvider sagaEngine, ObjectProvider tccEngine, ObjectProvider workflowEngine) { log.info("[orchestration] Scheduling post-processor initialized"); - return new SchedulingPostProcessor(applicationContext, scheduler, + return new SchedulingPostProcessorImpl(applicationContext, scheduler, sagaEngine.getIfAvailable(), tccEngine.getIfAvailable(), workflowEngine.getIfAvailable()); } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationMetricsAutoConfiguration.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationMetricsAutoConfiguration.java index d29d8ee71..a9fbb7695 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationMetricsAutoConfiguration.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationMetricsAutoConfiguration.java @@ -17,7 +17,7 @@ package org.fireflyframework.orchestration.config; import io.micrometer.core.instrument.MeterRegistry; -import org.fireflyframework.orchestration.core.observability.OrchestrationMetrics; +import org.fireflyframework.orchestration.core.observability.OrchestrationMetricsImpl; import org.fireflyframework.orchestration.core.observability.OrchestrationMetricsEndpoint; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.actuate.endpoint.annotation.Endpoint; @@ -44,9 +44,9 @@ public class OrchestrationMetricsAutoConfiguration { @Bean @ConditionalOnMissingBean - public OrchestrationMetrics orchestrationMetrics(MeterRegistry meterRegistry) { + public OrchestrationMetricsImpl orchestrationMetrics(MeterRegistry meterRegistry) { log.info("[orchestration] Metrics collection initialized"); - return new OrchestrationMetrics(meterRegistry); + return new OrchestrationMetricsImpl(meterRegistry); } @Bean diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationPersistenceAutoConfiguration.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationPersistenceAutoConfiguration.java index bb8c140b1..63230a768 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationPersistenceAutoConfiguration.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationPersistenceAutoConfiguration.java @@ -19,9 +19,9 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import org.fireflyframework.orchestration.core.persistence.ExecutionPersistenceProvider; -import org.fireflyframework.orchestration.persistence.cache.CachePersistenceProvider; -import org.fireflyframework.orchestration.persistence.eventsourced.EventSourcedPersistenceProvider; -import org.fireflyframework.orchestration.persistence.redis.RedisPersistenceProvider; +import org.fireflyframework.orchestration.persistence.cache.CachePersistenceProviderImpl; +import org.fireflyframework.orchestration.persistence.eventsourced.EventSourcedPersistenceProviderImpl; +import org.fireflyframework.orchestration.persistence.redis.RedisPersistenceProviderImpl; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -97,7 +97,7 @@ public ExecutionPersistenceProvider cachePersistenceProvider( org.fireflyframework.cache.core.CacheAdapter cacheAdapter, OrchestrationProperties properties) { log.info("[orchestration] Using cache-based persistence provider"); - return new CachePersistenceProvider(cacheAdapter, properties.getPersistence().getKeyTtl()); + return new CachePersistenceProviderImpl(cacheAdapter, properties.getPersistence().getKeyTtl()); } } @@ -115,7 +115,7 @@ public ExecutionPersistenceProvider redisPersistenceProvider( @Qualifier("orchestrationPersistenceObjectMapper") ObjectMapper objectMapper, OrchestrationProperties properties) { log.info("[orchestration] Using Redis-based persistence provider"); - return new RedisPersistenceProvider(redisTemplate, objectMapper, + return new RedisPersistenceProviderImpl(redisTemplate, objectMapper, properties.getPersistence().getKeyPrefix(), properties.getPersistence().getKeyTtl()); } @@ -133,7 +133,7 @@ public ExecutionPersistenceProvider eventSourcedPersistenceProvider( org.fireflyframework.eventsourcing.store.EventStore eventStore, @Qualifier("orchestrationPersistenceObjectMapper") ObjectMapper objectMapper) { log.info("[orchestration] Using event-sourced persistence provider"); - return new EventSourcedPersistenceProvider(eventStore, objectMapper); + return new EventSourcedPersistenceProviderImpl(eventStore, objectMapper); } } } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationRestAutoConfiguration.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationRestAutoConfiguration.java index e926670d2..983944bc6 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationRestAutoConfiguration.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/config/OrchestrationRestAutoConfiguration.java @@ -17,7 +17,7 @@ package org.fireflyframework.orchestration.config; import org.fireflyframework.orchestration.core.dlq.DeadLetterService; -import org.fireflyframework.orchestration.core.health.OrchestrationHealthIndicator; +import org.fireflyframework.orchestration.core.health.OrchestrationHealthIndicatorImpl; import org.fireflyframework.orchestration.core.persistence.ExecutionPersistenceProvider; import org.fireflyframework.orchestration.core.rest.DeadLetterController; import org.fireflyframework.orchestration.core.rest.OrchestrationController; @@ -62,8 +62,8 @@ public DeadLetterController deadLetterController(ObjectProvider { log.warn("[orchestration] Unknown compensation error handler '{}', falling back to default", handlerName); - return new DefaultCompensationErrorHandler(); + return new DefaultCompensationErrorHandlerImpl(); }); } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/AdaptiveBackpressureStrategy.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/AdaptiveBackpressureStrategyImpl.java similarity index 94% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/AdaptiveBackpressureStrategy.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/AdaptiveBackpressureStrategyImpl.java index 494d5ad62..b7a3841be 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/AdaptiveBackpressureStrategy.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/AdaptiveBackpressureStrategyImpl.java @@ -29,7 +29,7 @@ * based on error rates and processing performance. */ @Slf4j -public class AdaptiveBackpressureStrategy implements BackpressureStrategy { +public class AdaptiveBackpressureStrategyImpl implements BackpressureStrategy { private final int initialConcurrency; private final int maxConcurrency; @@ -39,7 +39,7 @@ public class AdaptiveBackpressureStrategy implements BackpressureStrategy { private final AtomicLong totalProcessed; private final AtomicLong totalErrors; - public AdaptiveBackpressureStrategy(int initialConcurrency, int maxConcurrency, + public AdaptiveBackpressureStrategyImpl(int initialConcurrency, int maxConcurrency, int minConcurrency, double errorRateThreshold) { this.initialConcurrency = initialConcurrency; this.maxConcurrency = maxConcurrency; @@ -50,7 +50,7 @@ public AdaptiveBackpressureStrategy(int initialConcurrency, int maxConcurrency, this.totalErrors = new AtomicLong(0); } - public AdaptiveBackpressureStrategy() { + public AdaptiveBackpressureStrategyImpl() { this(4, 16, 1, 0.1); } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BackpressureStrategyFactory.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BackpressureStrategyFactory.java index d4542007b..594b3963c 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BackpressureStrategyFactory.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BackpressureStrategyFactory.java @@ -84,14 +84,14 @@ public static void registerStrategy(String name, Supplier */ public static BackpressureStrategy fromConfig(BackpressureConfig config) { return switch (config.strategy()) { - case "adaptive" -> new AdaptiveBackpressureStrategy( + case "adaptive" -> new AdaptiveBackpressureStrategyImpl( config.initialConcurrency(), config.maxConcurrency(), config.minConcurrency(), config.errorRateThreshold() ); - case "batched" -> new BatchedBackpressureStrategy(config.batchSize()); - case "circuit-breaker" -> new CircuitBreakerBackpressureStrategy( + case "batched" -> new BatchedBackpressureStrategyImpl(config.batchSize()); + case "circuit-breaker" -> new CircuitBreakerBackpressureStrategyImpl( config.failureThreshold(), config.recoveryTimeout(), config.halfOpenMaxCalls() @@ -110,12 +110,12 @@ public static void resetDefaults() { } private static void registerDefaults() { - REGISTRY.put("adaptive", AdaptiveBackpressureStrategy::new); - REGISTRY.put("batched", BatchedBackpressureStrategy::new); - REGISTRY.put("circuit-breaker", CircuitBreakerBackpressureStrategy::new); + REGISTRY.put("adaptive", AdaptiveBackpressureStrategyImpl::new); + REGISTRY.put("batched", BatchedBackpressureStrategyImpl::new); + REGISTRY.put("circuit-breaker", CircuitBreakerBackpressureStrategyImpl::new); REGISTRY.put("circuit-breaker-aggressive", - () -> new CircuitBreakerBackpressureStrategy(2, Duration.ofSeconds(60), 1)); + () -> new CircuitBreakerBackpressureStrategyImpl(2, Duration.ofSeconds(60), 1)); REGISTRY.put("circuit-breaker-conservative", - () -> new CircuitBreakerBackpressureStrategy(10, Duration.ofSeconds(15), 5)); + () -> new CircuitBreakerBackpressureStrategyImpl(10, Duration.ofSeconds(15), 5)); } } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BatchedBackpressureStrategy.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BatchedBackpressureStrategyImpl.java similarity index 90% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BatchedBackpressureStrategy.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BatchedBackpressureStrategyImpl.java index b27e9e85a..6574edf59 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BatchedBackpressureStrategy.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/BatchedBackpressureStrategyImpl.java @@ -28,18 +28,18 @@ * are processed concurrently. */ @Slf4j -public class BatchedBackpressureStrategy implements BackpressureStrategy { +public class BatchedBackpressureStrategyImpl implements BackpressureStrategy { private final int batchSize; - public BatchedBackpressureStrategy(int batchSize) { + public BatchedBackpressureStrategyImpl(int batchSize) { if (batchSize < 1) { throw new IllegalArgumentException("Batch size must be at least 1"); } this.batchSize = batchSize; } - public BatchedBackpressureStrategy() { + public BatchedBackpressureStrategyImpl() { this(10); } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/CircuitBreakerBackpressureStrategy.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/CircuitBreakerBackpressureStrategyImpl.java similarity index 96% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/CircuitBreakerBackpressureStrategy.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/CircuitBreakerBackpressureStrategyImpl.java index ce6ea0feb..3aea4fd0b 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/CircuitBreakerBackpressureStrategy.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/backpressure/CircuitBreakerBackpressureStrategyImpl.java @@ -39,7 +39,7 @@ * */ @Slf4j -public class CircuitBreakerBackpressureStrategy implements BackpressureStrategy { +public class CircuitBreakerBackpressureStrategyImpl implements BackpressureStrategy { public enum State { CLOSED, OPEN, HALF_OPEN @@ -55,14 +55,14 @@ public enum State { private final AtomicInteger halfOpenSuccessCount = new AtomicInteger(0); private volatile Instant openedAt = Instant.MIN; - public CircuitBreakerBackpressureStrategy(int failureThreshold, Duration recoveryTimeout, + public CircuitBreakerBackpressureStrategyImpl(int failureThreshold, Duration recoveryTimeout, int halfOpenMaxCalls) { this.failureThreshold = failureThreshold; this.recoveryTimeout = recoveryTimeout; this.halfOpenMaxCalls = halfOpenMaxCalls; } - public CircuitBreakerBackpressureStrategy() { + public CircuitBreakerBackpressureStrategyImpl() { this(5, Duration.ofSeconds(30), 3); } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/dlq/InMemoryDeadLetterStore.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/dlq/InMemoryDeadLetterStoreImpl.java similarity index 96% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/dlq/InMemoryDeadLetterStore.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/dlq/InMemoryDeadLetterStoreImpl.java index d7ea8343e..a89f4b631 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/dlq/InMemoryDeadLetterStore.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/dlq/InMemoryDeadLetterStoreImpl.java @@ -23,7 +23,7 @@ import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; -public class InMemoryDeadLetterStore implements DeadLetterStore { +public class InMemoryDeadLetterStoreImpl implements DeadLetterStore { private final ConcurrentHashMap store = new ConcurrentHashMap<>(); @Override diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisher.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisherImpl.java similarity index 97% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisher.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisherImpl.java index c6c72428c..b0e9107ac 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisher.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisherImpl.java @@ -56,7 +56,7 @@ * saga instance. */ @Slf4j -public class EdaOrchestrationEventPublisher implements OrchestrationEventPublisher { +public class EdaOrchestrationEventPublisherImpl implements OrchestrationEventPublisher { private final EventPublisherFactory publisherFactory; private final String defaultTopic; @@ -70,7 +70,7 @@ public class EdaOrchestrationEventPublisher implements OrchestrationEventPublish * not specify its own; may be null/blank in which case * only events that carry an explicit topic will be published */ - public EdaOrchestrationEventPublisher(EventPublisherFactory publisherFactory, String defaultTopic) { + public EdaOrchestrationEventPublisherImpl(EventPublisherFactory publisherFactory, String defaultTopic) { this.publisherFactory = publisherFactory; this.defaultTopic = defaultTopic; } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/NoOpEventPublisher.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/NoOpEventPublisherImpl.java similarity index 91% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/NoOpEventPublisher.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/NoOpEventPublisherImpl.java index 8781d4d5b..5f619fd56 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/NoOpEventPublisher.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/event/NoOpEventPublisherImpl.java @@ -18,7 +18,7 @@ import reactor.core.publisher.Mono; -public class NoOpEventPublisher implements OrchestrationEventPublisher { +public class NoOpEventPublisherImpl implements OrchestrationEventPublisher { @Override public Mono publish(OrchestrationEvent event) { return Mono.empty(); diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/health/OrchestrationHealthIndicator.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/health/OrchestrationHealthIndicatorImpl.java similarity index 88% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/health/OrchestrationHealthIndicator.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/health/OrchestrationHealthIndicatorImpl.java index 61e5401a6..303123d90 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/health/OrchestrationHealthIndicator.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/health/OrchestrationHealthIndicatorImpl.java @@ -21,11 +21,11 @@ import org.springframework.boot.health.contributor.ReactiveHealthIndicator; import reactor.core.publisher.Mono; -public class OrchestrationHealthIndicator implements ReactiveHealthIndicator { +public class OrchestrationHealthIndicatorImpl implements ReactiveHealthIndicator { private final ExecutionPersistenceProvider persistence; - public OrchestrationHealthIndicator(ExecutionPersistenceProvider persistence) { + public OrchestrationHealthIndicatorImpl(ExecutionPersistenceProvider persistence) { this.persistence = persistence; } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/CompositeOrchestrationEvents.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/CompositeOrchestrationEventsImpl.java similarity index 97% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/CompositeOrchestrationEvents.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/CompositeOrchestrationEventsImpl.java index 5c2027741..f90e46c26 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/CompositeOrchestrationEvents.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/CompositeOrchestrationEventsImpl.java @@ -24,10 +24,10 @@ import java.util.function.Consumer; @Slf4j -public class CompositeOrchestrationEvents implements OrchestrationEvents { +public class CompositeOrchestrationEventsImpl implements OrchestrationEvents { private final List delegates; - public CompositeOrchestrationEvents(List delegates) { + public CompositeOrchestrationEventsImpl(List delegates) { this.delegates = List.copyOf(delegates); } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEvents.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEventsImpl.java similarity index 98% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEvents.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEventsImpl.java index 180e3ff19..a042f7d27 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEvents.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEventsImpl.java @@ -22,7 +22,7 @@ import lombok.extern.slf4j.Slf4j; @Slf4j -public class OrchestrationLoggerEvents implements OrchestrationEvents { +public class OrchestrationLoggerEventsImpl implements OrchestrationEvents { @Override public void onStart(String name, String correlationId, ExecutionPattern pattern) { log.info("[orchestration] started name={} correlationId={} pattern={}", LogFields.text(name), LogFields.text(correlationId), pattern); diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationMetrics.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationMetricsImpl.java similarity index 96% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationMetrics.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationMetricsImpl.java index 406c26c1f..ac1b1a110 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationMetrics.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/observability/OrchestrationMetricsImpl.java @@ -24,13 +24,13 @@ import java.time.Duration; import java.util.concurrent.ConcurrentHashMap; -public class OrchestrationMetrics implements OrchestrationEvents { +public class OrchestrationMetricsImpl implements OrchestrationEvents { private static final String PREFIX = "firefly.orchestration"; private final MeterRegistry registry; private final ConcurrentHashMap timers = new ConcurrentHashMap<>(); private final ConcurrentHashMap counters = new ConcurrentHashMap<>(); - public OrchestrationMetrics(MeterRegistry registry) { + public OrchestrationMetricsImpl(MeterRegistry registry) { this.registry = registry; } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/persistence/InMemoryPersistenceProvider.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/persistence/InMemoryPersistenceProviderImpl.java similarity index 97% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/persistence/InMemoryPersistenceProvider.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/persistence/InMemoryPersistenceProviderImpl.java index 483092c47..e419e8fcf 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/persistence/InMemoryPersistenceProvider.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/persistence/InMemoryPersistenceProviderImpl.java @@ -27,7 +27,7 @@ import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; -public class InMemoryPersistenceProvider implements ExecutionPersistenceProvider { +public class InMemoryPersistenceProviderImpl implements ExecutionPersistenceProvider { private final ConcurrentHashMap store = new ConcurrentHashMap<>(); diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/scheduling/SchedulingPostProcessor.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/scheduling/SchedulingPostProcessorImpl.java similarity index 98% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/scheduling/SchedulingPostProcessor.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/scheduling/SchedulingPostProcessorImpl.java index e8ccd5697..6b9ddc71e 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/scheduling/SchedulingPostProcessor.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/core/scheduling/SchedulingPostProcessorImpl.java @@ -40,7 +40,7 @@ * with the {@link OrchestrationScheduler}. */ @Slf4j -public class SchedulingPostProcessor implements SmartInitializingSingleton { +public class SchedulingPostProcessorImpl implements SmartInitializingSingleton { private final ApplicationContext applicationContext; private final OrchestrationScheduler scheduler; @@ -48,7 +48,7 @@ public class SchedulingPostProcessor implements SmartInitializingSingleton { private final TccEngine tccEngine; private final WorkflowEngine workflowEngine; - public SchedulingPostProcessor(ApplicationContext applicationContext, + public SchedulingPostProcessorImpl(ApplicationContext applicationContext, OrchestrationScheduler scheduler, SagaEngine sagaEngine, TccEngine tccEngine, diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/cache/CachePersistenceProvider.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/cache/CachePersistenceProviderImpl.java similarity index 96% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/cache/CachePersistenceProvider.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/cache/CachePersistenceProviderImpl.java index e139ff024..55391d7d1 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/cache/CachePersistenceProvider.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/cache/CachePersistenceProviderImpl.java @@ -46,7 +46,7 @@ * */ @Slf4j -public class CachePersistenceProvider implements ExecutionPersistenceProvider { +public class CachePersistenceProviderImpl implements ExecutionPersistenceProvider { private static final String STATE_KEY_PREFIX = "orchestration:state:"; private static final String PATTERN_INDEX_PREFIX = "orchestration:pattern:"; @@ -55,13 +55,13 @@ public class CachePersistenceProvider implements ExecutionPersistenceProvider { private final CacheAdapter cacheAdapter; private final Duration defaultTtl; - public CachePersistenceProvider(CacheAdapter cacheAdapter, Duration defaultTtl) { + public CachePersistenceProviderImpl(CacheAdapter cacheAdapter, Duration defaultTtl) { this.cacheAdapter = cacheAdapter; this.defaultTtl = defaultTtl != null ? defaultTtl : Duration.ofHours(24); log.info("[orchestration] CachePersistenceProvider initialized with TTL: {}", this.defaultTtl); } - public CachePersistenceProvider(CacheAdapter cacheAdapter) { + public CachePersistenceProviderImpl(CacheAdapter cacheAdapter) { this(cacheAdapter, Duration.ofHours(24)); } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/eventsourced/EventSourcedPersistenceProvider.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/eventsourced/EventSourcedPersistenceProviderImpl.java similarity index 97% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/eventsourced/EventSourcedPersistenceProvider.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/eventsourced/EventSourcedPersistenceProviderImpl.java index 815b2b8fc..7cefb67c1 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/eventsourced/EventSourcedPersistenceProvider.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/eventsourced/EventSourcedPersistenceProviderImpl.java @@ -49,7 +49,7 @@ * an {@link OrchestrationProjection} for read-side queries. */ @Slf4j -public class EventSourcedPersistenceProvider implements ExecutionPersistenceProvider { +public class EventSourcedPersistenceProviderImpl implements ExecutionPersistenceProvider { private static final String AGGREGATE_TYPE = "orchestration-execution"; private static final String EVENT_TYPE = "ExecutionStateChanged"; @@ -59,11 +59,11 @@ public class EventSourcedPersistenceProvider implements ExecutionPersistenceProv private final OrchestrationProjection projection; private final Map snapshots = new ConcurrentHashMap<>(); - public EventSourcedPersistenceProvider(EventStore eventStore, ObjectMapper objectMapper) { + public EventSourcedPersistenceProviderImpl(EventStore eventStore, ObjectMapper objectMapper) { this(eventStore, objectMapper, new OrchestrationProjection()); } - public EventSourcedPersistenceProvider(EventStore eventStore, ObjectMapper objectMapper, + public EventSourcedPersistenceProviderImpl(EventStore eventStore, ObjectMapper objectMapper, OrchestrationProjection projection) { this.eventStore = Objects.requireNonNull(eventStore, "eventStore"); this.objectMapper = Objects.requireNonNull(objectMapper, "objectMapper"); diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/redis/RedisPersistenceProvider.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/redis/RedisPersistenceProviderImpl.java similarity index 97% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/redis/RedisPersistenceProvider.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/redis/RedisPersistenceProviderImpl.java index 2b81d445a..81c0e56af 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/redis/RedisPersistenceProvider.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/persistence/redis/RedisPersistenceProviderImpl.java @@ -46,7 +46,7 @@ * */ @Slf4j -public class RedisPersistenceProvider implements ExecutionPersistenceProvider { +public class RedisPersistenceProviderImpl implements ExecutionPersistenceProvider { private final ReactiveRedisTemplate redisTemplate; private final ObjectMapper objectMapper; @@ -54,7 +54,7 @@ public class RedisPersistenceProvider implements ExecutionPersistenceProvider { private final String metaKeyPrefix; private final Duration keyTtl; - public RedisPersistenceProvider(ReactiveRedisTemplate redisTemplate, + public RedisPersistenceProviderImpl(ReactiveRedisTemplate redisTemplate, ObjectMapper objectMapper, String keyPrefix, Duration keyTtl) { @@ -66,7 +66,7 @@ public RedisPersistenceProvider(ReactiveRedisTemplate redisTempl log.info("[orchestration] RedisPersistenceProvider initialized with prefix: {}", LogFields.text(keyPrefix)); } - public RedisPersistenceProvider(ReactiveRedisTemplate redisTemplate, + public RedisPersistenceProviderImpl(ReactiveRedisTemplate redisTemplate, ObjectMapper objectMapper) { this(redisTemplate, objectMapper, "orchestration:", null); } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompensationErrorHandlerFactory.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompensationErrorHandlerFactory.java index 95ae1941f..941fb9d02 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompensationErrorHandlerFactory.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompensationErrorHandlerFactory.java @@ -90,7 +90,7 @@ public static void registerHandler(String name, CompensationErrorHandler handler * @return a composite handler */ public static CompensationErrorHandler composite(CompensationErrorHandler... handlers) { - return new CompositeCompensationErrorHandler(Arrays.asList(handlers)); + return new CompositeCompensationErrorHandlerImpl(Arrays.asList(handlers)); } /** @@ -102,12 +102,12 @@ public static void resetDefaults() { } private static void registerDefaults() { - REGISTRY.put("default", DefaultCompensationErrorHandler::new); - REGISTRY.put("fail-fast", FailFastErrorHandler::new); - REGISTRY.put("log-and-continue", LogAndContinueErrorHandler::new); - REGISTRY.put("retry", () -> new RetryWithBackoffErrorHandler(3)); + REGISTRY.put("default", DefaultCompensationErrorHandlerImpl::new); + REGISTRY.put("fail-fast", FailFastErrorHandlerImpl::new); + REGISTRY.put("log-and-continue", LogAndContinueErrorHandlerImpl::new); + REGISTRY.put("retry", () -> new RetryWithBackoffErrorHandlerImpl(3)); REGISTRY.put("robust", () -> { - var retryHandler = new RetryWithBackoffErrorHandler(3); + var retryHandler = new RetryWithBackoffErrorHandlerImpl(3); // Wrap retry: convert FAIL_SAGA to CONTINUE so the composite falls through // to the log-and-continue handler when retries are exhausted CompensationErrorHandler retryOrDefer = (sagaName, stepId, error, attempt) -> { @@ -115,9 +115,9 @@ private static void registerDefaults() { return result == CompensationErrorResult.FAIL_SAGA ? CompensationErrorResult.CONTINUE : result; }; - return new CompositeCompensationErrorHandler(List.of( + return new CompositeCompensationErrorHandlerImpl(List.of( retryOrDefer, - new LogAndContinueErrorHandler() + new LogAndContinueErrorHandlerImpl() )); }); } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompositeCompensationErrorHandler.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompositeCompensationErrorHandlerImpl.java similarity index 91% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompositeCompensationErrorHandler.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompositeCompensationErrorHandlerImpl.java index a944b7e08..2aaadcc32 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompositeCompensationErrorHandler.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/CompositeCompensationErrorHandlerImpl.java @@ -28,11 +28,11 @@ * CONTINUE is returned. */ @Slf4j -public class CompositeCompensationErrorHandler implements CompensationErrorHandler { +public class CompositeCompensationErrorHandlerImpl implements CompensationErrorHandler { private final List handlers; - public CompositeCompensationErrorHandler(List handlers) { + public CompositeCompensationErrorHandlerImpl(List handlers) { this.handlers = Collections.unmodifiableList(handlers); } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/DefaultCompensationErrorHandler.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/DefaultCompensationErrorHandlerImpl.java similarity index 92% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/DefaultCompensationErrorHandler.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/DefaultCompensationErrorHandlerImpl.java index a1bccfadb..b7d51761c 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/DefaultCompensationErrorHandler.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/DefaultCompensationErrorHandlerImpl.java @@ -21,7 +21,7 @@ * This matches the historical behavior where compensation errors are swallowed * and subsequent compensation steps proceed. */ -public class DefaultCompensationErrorHandler implements CompensationErrorHandler { +public class DefaultCompensationErrorHandlerImpl implements CompensationErrorHandler { @Override public CompensationErrorResult handle(String sagaName, String stepId, Throwable error, int attempt) { diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/FailFastErrorHandler.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/FailFastErrorHandlerImpl.java similarity index 94% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/FailFastErrorHandler.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/FailFastErrorHandlerImpl.java index 33426422b..680e0a11d 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/FailFastErrorHandler.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/FailFastErrorHandlerImpl.java @@ -23,7 +23,7 @@ * Use this when any compensation failure should immediately abort the entire saga. */ @Slf4j -public class FailFastErrorHandler implements CompensationErrorHandler { +public class FailFastErrorHandlerImpl implements CompensationErrorHandler { @Override public CompensationErrorResult handle(String sagaName, String stepId, Throwable error, int attempt) { diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/LogAndContinueErrorHandler.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/LogAndContinueErrorHandlerImpl.java similarity index 94% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/LogAndContinueErrorHandler.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/LogAndContinueErrorHandlerImpl.java index 8a88410cc..b8d4c4055 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/LogAndContinueErrorHandler.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/LogAndContinueErrorHandlerImpl.java @@ -23,7 +23,7 @@ * Use this when compensation errors should be recorded but not block further compensation. */ @Slf4j -public class LogAndContinueErrorHandler implements CompensationErrorHandler { +public class LogAndContinueErrorHandlerImpl implements CompensationErrorHandler { @Override public CompensationErrorResult handle(String sagaName, String stepId, Throwable error, int attempt) { diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/RetryWithBackoffErrorHandler.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/RetryWithBackoffErrorHandlerImpl.java similarity index 89% rename from modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/RetryWithBackoffErrorHandler.java rename to modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/RetryWithBackoffErrorHandlerImpl.java index afb44ad72..d3a25212b 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/RetryWithBackoffErrorHandler.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/RetryWithBackoffErrorHandlerImpl.java @@ -25,17 +25,17 @@ * maximum. Optionally filters which exception types are retryable. */ @Slf4j -public class RetryWithBackoffErrorHandler implements CompensationErrorHandler { +public class RetryWithBackoffErrorHandlerImpl implements CompensationErrorHandler { private final int maxRetries; private final Set> retryableTypes; - public RetryWithBackoffErrorHandler(int maxRetries, Set> retryableTypes) { + public RetryWithBackoffErrorHandlerImpl(int maxRetries, Set> retryableTypes) { this.maxRetries = maxRetries; this.retryableTypes = retryableTypes != null ? retryableTypes : Set.of(); } - public RetryWithBackoffErrorHandler(int maxRetries) { + public RetryWithBackoffErrorHandlerImpl(int maxRetries) { this(maxRetries, Set.of()); } diff --git a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/SagaCompensator.java b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/SagaCompensator.java index a0324f4ea..9fbe96474 100644 --- a/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/SagaCompensator.java +++ b/modules/orchestration/src/main/java/org/fireflyframework/orchestration/saga/compensation/SagaCompensator.java @@ -65,7 +65,7 @@ public SagaCompensator(OrchestrationEvents events, CompensationPolicy policy, this.events = events; this.policy = policy != null ? policy : CompensationPolicy.STRICT_SEQUENTIAL; this.invoker = invoker; - this.errorHandler = errorHandler != null ? errorHandler : new DefaultCompensationErrorHandler(); + this.errorHandler = errorHandler != null ? errorHandler : new DefaultCompensationErrorHandlerImpl(); } public Mono compensate(String sagaName, SagaDefinition saga, diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/CompositeEventsWiringTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/CompositeEventsWiringTest.java index fe40289f3..e3a0f883c 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/CompositeEventsWiringTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/CompositeEventsWiringTest.java @@ -18,9 +18,9 @@ import org.fireflyframework.orchestration.core.context.TccPhase; import org.fireflyframework.orchestration.core.model.ExecutionPattern; -import org.fireflyframework.orchestration.core.observability.CompositeOrchestrationEvents; +import org.fireflyframework.orchestration.core.observability.CompositeOrchestrationEventsImpl; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.observability.OrchestrationLoggerEvents; +import org.fireflyframework.orchestration.core.observability.OrchestrationLoggerEventsImpl; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; import org.springframework.boot.test.context.runner.ApplicationContextRunner; @@ -51,8 +51,8 @@ void singleImplementation_returnedDirectlyWithoutComposite() { contextRunner.run(context -> { // The "orchestrationEvents" bean should be the logger directly (not wrapped) OrchestrationEvents events = context.getBean("orchestrationEvents", OrchestrationEvents.class); - assertThat(events).isInstanceOf(OrchestrationLoggerEvents.class); - assertThat(events).isNotInstanceOf(CompositeOrchestrationEvents.class); + assertThat(events).isInstanceOf(OrchestrationLoggerEventsImpl.class); + assertThat(events).isNotInstanceOf(CompositeOrchestrationEventsImpl.class); }); } @@ -64,10 +64,10 @@ void multipleImplementations_composedIntoComposite() { .withUserConfiguration(ExtraEventsConfig.class) .run(context -> { OrchestrationEvents events = context.getBean("orchestrationEvents", OrchestrationEvents.class); - assertThat(events).isInstanceOf(CompositeOrchestrationEvents.class); + assertThat(events).isInstanceOf(CompositeOrchestrationEventsImpl.class); // Also verify that the individual beans exist - assertThat(context.getBean(OrchestrationLoggerEvents.class)).isNotNull(); + assertThat(context.getBean(OrchestrationLoggerEventsImpl.class)).isNotNull(); assertThat(context.getBean(StubMetricsEvents.class)).isNotNull(); }); } @@ -80,7 +80,7 @@ void multipleImplementations_allDelegatesReceiveEvents() { .withUserConfiguration(TrackingEventsConfig.class) .run(context -> { OrchestrationEvents events = context.getBean("orchestrationEvents", OrchestrationEvents.class); - assertThat(events).isInstanceOf(CompositeOrchestrationEvents.class); + assertThat(events).isInstanceOf(CompositeOrchestrationEventsImpl.class); // Fire an event through the composite events.onStart("test-saga", "corr-1", ExecutionPattern.SAGA); @@ -104,14 +104,14 @@ void threeImplementations_allThreeComposed() { .withUserConfiguration(TrackingEventsConfig.class) .run(context -> { OrchestrationEvents events = context.getBean("orchestrationEvents", OrchestrationEvents.class); - assertThat(events).isInstanceOf(CompositeOrchestrationEvents.class); + assertThat(events).isInstanceOf(CompositeOrchestrationEventsImpl.class); // Verify all 3 OrchestrationEvents beans exist (logger + trackingA + trackingB) String[] eventBeanNames = context.getBeanNamesForType(OrchestrationEvents.class); // Exclude the composite itself; remaining beans are the 3 delegates long delegateCount = java.util.Arrays.stream(eventBeanNames) .map(n -> context.getBean(n, OrchestrationEvents.class)) - .filter(e -> !(e instanceof CompositeOrchestrationEvents)) + .filter(e -> !(e instanceof CompositeOrchestrationEventsImpl)) .count(); assertThat(delegateCount).as("Expected 3 delegates: logger + trackingA + trackingB").isEqualTo(3); @@ -138,7 +138,7 @@ void compositeEvents_compositionMethodsDelegatedToAllTrackers() { .withUserConfiguration(FullTrackingEventsConfig.class) .run(context -> { OrchestrationEvents events = context.getBean("orchestrationEvents", OrchestrationEvents.class); - assertThat(events).isInstanceOf(CompositeOrchestrationEvents.class); + assertThat(events).isInstanceOf(CompositeOrchestrationEventsImpl.class); // Composition events events.onCompositionStarted("order-saga-comp", "corr-10"); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/OrchestrationOptionalEdaTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/OrchestrationOptionalEdaTest.java index 0146f09c5..680be7951 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/OrchestrationOptionalEdaTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/OrchestrationOptionalEdaTest.java @@ -19,8 +19,8 @@ import org.fireflyframework.eda.properties.EdaProperties; import org.fireflyframework.eda.publisher.EventPublisherFactory; import org.fireflyframework.eda.resilience.ResilientEventPublisherFactory; -import org.fireflyframework.orchestration.core.event.EdaOrchestrationEventPublisher; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.EdaOrchestrationEventPublisherImpl; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.event.OrchestrationEventPublisher; import org.fireflyframework.orchestration.saga.engine.SagaEngine; import org.fireflyframework.orchestration.tcc.engine.TccEngine; @@ -68,7 +68,7 @@ protected Class loadClass(String name, boolean resolve) throws ClassNotFoundE assertThat(context).hasNotFailed(); assertThat(context).hasSingleBean(SagaEngine.class).hasSingleBean(TccEngine.class) .hasSingleBean(WorkflowEngine.class); - assertThat(context.getBean(OrchestrationEventPublisher.class)).isInstanceOf(NoOpEventPublisher.class); + assertThat(context.getBean(OrchestrationEventPublisher.class)).isInstanceOf(NoOpEventPublisherImpl.class); }); } } @@ -85,7 +85,7 @@ void enablesTheEdaBridgeWhenTheFactoryAndOptInArePresent() { .run(context -> { assertThat(context).hasNotFailed().hasSingleBean(OrchestrationEventPublisher.class); assertThat(context.getBean(OrchestrationEventPublisher.class)) - .isInstanceOf(EdaOrchestrationEventPublisher.class); + .isInstanceOf(EdaOrchestrationEventPublisherImpl.class); }); } } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/TccPersistenceModeBootTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/TccPersistenceModeBootTest.java index 84c306294..6a6273468 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/TccPersistenceModeBootTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/TccPersistenceModeBootTest.java @@ -17,12 +17,12 @@ package org.fireflyframework.orchestration.config; import org.fireflyframework.orchestration.core.argument.ArgumentResolver; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.exception.TccPersistenceException; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.tcc.builder.TccBuilder; import org.fireflyframework.orchestration.tcc.engine.TccEngine; @@ -115,7 +115,7 @@ void defaultBootPropertyUsesBestEffortAndCanReturnConfirmedWithoutFinalAcknowled void requiredBootPropertyRejectsCustomBestEffortOrchestrator() { var provider = new RetainingProvider(false); var custom = new TccExecutionOrchestrator(new StepInvoker(new ArgumentResolver()), - new OrchestrationEvents() {}, new NoOpEventPublisher(), provider); + new OrchestrationEvents() {}, new NoOpEventPublisherImpl(), provider); assertThatThrownBy(() -> application(provider).initializers(context -> context.getBeanFactory().registerSingleton("customTccOrchestrator", custom)) .properties("firefly.orchestration.tcc.persistence-mode=REQUIRED").run()) @@ -153,7 +153,7 @@ static class Counts { final AtomicInteger cancels = new AtomicInteger(); } - static class RetainingProvider extends InMemoryPersistenceProvider { + static class RetainingProvider extends InMemoryPersistenceProviderImpl { final List attempted = new ArrayList<>(); final List accepted = new ArrayList<>(); final IllegalStateException cause = new IllegalStateException("private-provider-detail"); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/TccPersistenceModeConfigurationTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/TccPersistenceModeConfigurationTest.java index f5acaf2f4..876a7c468 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/TccPersistenceModeConfigurationTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/TccPersistenceModeConfigurationTest.java @@ -18,7 +18,7 @@ import org.fireflyframework.orchestration.core.persistence.ExecutionPersistenceProvider; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.tcc.builder.TccBuilder; import org.fireflyframework.orchestration.tcc.engine.TccEngine; import org.fireflyframework.orchestration.tcc.engine.TccInputs; @@ -42,7 +42,7 @@ class TccPersistenceModeConfigurationTest { void requiredPropertyStopsBeforeAnyParticipantWhenInitialSaveFails() { var calls = new AtomicInteger(); var cause = new IllegalStateException("private-provider-detail"); - var provider = new InMemoryPersistenceProvider() { + var provider = new InMemoryPersistenceProviderImpl() { @Override public Mono save(ExecutionState state) { return Mono.error(cause); } }; runner.withBean(ExecutionPersistenceProvider.class, () -> provider) @@ -66,7 +66,7 @@ void requiredPropertyStopsBeforeAnyParticipantWhenInitialSaveFails() { @Test void omittedPropertyRetainsBestEffortWithUnavailableProvider() { - runner.withBean(ExecutionPersistenceProvider.class, () -> new InMemoryPersistenceProvider() { + runner.withBean(ExecutionPersistenceProvider.class, () -> new InMemoryPersistenceProviderImpl() { @Override public Mono save(ExecutionState state) { return Mono.error(new IllegalStateException("unavailable")); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/WorkflowRestSwitchTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/WorkflowRestSwitchTest.java index 9c7608c47..2efb1c96a 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/WorkflowRestSwitchTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/config/WorkflowRestSwitchTest.java @@ -3,11 +3,11 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.observability.OrchestrationLoggerEvents; +import org.fireflyframework.orchestration.core.observability.OrchestrationLoggerEventsImpl; import org.fireflyframework.orchestration.core.event.OrchestrationEventPublisher; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.persistence.ExecutionPersistenceProvider; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.registry.WorkflowRegistry; import org.fireflyframework.orchestration.workflow.rest.WorkflowController; @@ -24,9 +24,9 @@ class WorkflowRestSwitchTest { static class Dependencies { @Bean StepInvoker stepInvoker() { return new StepInvoker(new ArgumentResolver()); } - @Bean OrchestrationEvents events() { return new OrchestrationLoggerEvents(); } - @Bean ExecutionPersistenceProvider persistence() { return new InMemoryPersistenceProvider(); } - @Bean OrchestrationEventPublisher publisher() { return new NoOpEventPublisher(); } + @Bean OrchestrationEvents events() { return new OrchestrationLoggerEventsImpl(); } + @Bean ExecutionPersistenceProvider persistence() { return new InMemoryPersistenceProviderImpl(); } + @Bean OrchestrationEventPublisher publisher() { return new NoOpEventPublisherImpl(); } } private ReactiveWebApplicationContextRunner runner() { diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisherLoggingTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisherLoggingTest.java index c609de714..2421d1f82 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisherLoggingTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/core/event/EdaOrchestrationEventPublisherLoggingTest.java @@ -36,7 +36,7 @@ class EdaOrchestrationEventPublisherLoggingTest { private ListAppender capture; @BeforeEach void capture() { - logger = (Logger) LoggerFactory.getLogger(EdaOrchestrationEventPublisher.class); + logger = (Logger) LoggerFactory.getLogger(EdaOrchestrationEventPublisherImpl.class); level = logger.getLevel(); additive = logger.isAdditive(); logger.setLevel(Level.TRACE); logger.setAdditive(false); capture = new ListAppender<>(); capture.setContext(logger.getLoggerContext()); @@ -90,16 +90,16 @@ private DynamicTest checked(String name, Runnable assertion) { private Stream scenarios(String actual, String expected) { return Stream.of( checked("missing destination", () -> { - new EdaOrchestrationEventPublisher(null, null).publish(event(actual, null)).block(); + new EdaOrchestrationEventPublisherImpl(null, null).publish(event(actual, null)).block(); logged(Level.WARN, expected, expected, expected); }), checked("missing publisher", () -> { - new EdaOrchestrationEventPublisher(factory(null), "fallback").publish(event(actual, actual)).block(); + new EdaOrchestrationEventPublisherImpl(factory(null), "fallback").publish(event(actual, actual)).block(); logged(Level.WARN, expected, actual == null ? "fallback" : expected); }), checked("successful publication preserves raw transport", () -> { var publisher = new RecordingPublisher(); var event = event(actual, actual); - new EdaOrchestrationEventPublisher(factory(publisher), "fallback").publish(event).block(); + new EdaOrchestrationEventPublisherImpl(factory(publisher), "fallback").publish(event).block(); assertEquals(1, publisher.calls); assertSame(event, publisher.event); assertEquals(actual == null ? "fallback" : actual, publisher.destination); if (actual != null) { @@ -113,7 +113,7 @@ private Stream scenarios(String actual, String expected) { checked("failed publication preserves error", () -> { var publisher = new RecordingPublisher(); publisher.failure = new IllegalStateException(actual); var event = event(actual, actual); - Mono result = new EdaOrchestrationEventPublisher(factory(publisher), "fallback").publish(event); + Mono result = new EdaOrchestrationEventPublisherImpl(factory(publisher), "fallback").publish(event); assertSame(publisher.failure, assertThrows(IllegalStateException.class, result::block)); assertEquals(1, publisher.calls); assertSame(event, publisher.event); logged(Level.ERROR, expected, actual == null ? "fallback" : expected, expected); @@ -125,7 +125,7 @@ private Stream scenarios(String actual, String expected) { @TestFactory Stream preservesOrdinaryFields() { return scenarios("ordinary", "ordinary"); } @TestFactory Stream preservesNullFields() { return scenarios(null, null); } @Test void nullEventProducesNoLogOrFactoryCall() { - assertNull(new EdaOrchestrationEventPublisher(null, null).publish(null).block()); + assertNull(new EdaOrchestrationEventPublisherImpl(null, null).publish(null).block()); assertTrue(capture.list.isEmpty()); } } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEventsLoggingTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEventsLoggingTest.java index 37ada04c5..649db1877 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEventsLoggingTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/core/observability/OrchestrationLoggerEventsLoggingTest.java @@ -36,7 +36,7 @@ class OrchestrationLoggerEventsLoggingTest { private static final String BREAKS="\r\n\u000b\f\u0085\u2028\u2029"; private static final String VISIBLE="\\r\\n\\u000b\\f\\u0085\\u2028\\u2029"; - private final OrchestrationLoggerEvents events=new OrchestrationLoggerEvents(); + private final OrchestrationLoggerEventsImpl events=new OrchestrationLoggerEventsImpl(); private Logger logger; private Level previousLevel; private boolean previousAdditive; @@ -51,7 +51,7 @@ private record Sample(String name,String correlation,String step,ExecutionPatter static Sample ordinary() { return new Sample("checkout","corr-1","step-1",ExecutionPattern.SAGA,TccPhase.CONFIRM,"business refusal",new Failure("business refusal")); } static Sample text(String suffix) { return new Sample("name"+suffix,"correlation"+suffix,"step"+suffix,ExecutionPattern.SAGA,TccPhase.CONFIRM,"failure"+suffix,new Failure("failure"+suffix)); } } - private record Callback(String name,Level level,String template,boolean usesFailure,BiConsumer invoke,Function arguments,String ordinaryMessage) { } + private record Callback(String name,Level level,String template,boolean usesFailure,BiConsumer invoke,Function arguments,String ordinaryMessage) { } private static final List CALLBACKS=List.of( new Callback("start",Level.INFO,"[orchestration] started name={} correlationId={} pattern={}",false, (e,s)->e.onStart(s.name(),s.correlation(),s.pattern()),s->new Object[]{s.name(),s.correlation(),s.pattern()}, @@ -91,7 +91,7 @@ private record Callback(String name,Level level,String template,boolean usesFail "[orchestration] dead-lettered name=checkout correlationId=corr-1 stepId=step-1 error=business refusal") ); @BeforeEach void captureEvents() { - logger=(Logger)LoggerFactory.getLogger(OrchestrationLoggerEvents.class); + logger=(Logger)LoggerFactory.getLogger(OrchestrationLoggerEventsImpl.class); previousLevel=logger.getLevel();previousAdditive=logger.isAdditive();logger.setLevel(Level.TRACE);logger.setAdditive(false); capture=new ListAppender<>();capture.setContext(logger.getLoggerContext());capture.start();logger.addAppender(capture); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/CrossPatternTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/CrossPatternTest.java index ad650db8b..c7e1d4137 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/CrossPatternTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/CrossPatternTest.java @@ -19,11 +19,11 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.builder.OrchestrationBuilder; import org.fireflyframework.orchestration.core.dlq.DeadLetterService; -import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStore; +import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStoreImpl; import org.fireflyframework.orchestration.core.model.CompensationPolicy; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionPersistenceProvider; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.saga.compensation.SagaCompensator; import org.fireflyframework.orchestration.saga.engine.SagaEngine; @@ -51,19 +51,19 @@ class CrossPatternTest { private SagaEngine sagaEngine; private TccEngine tccEngine; - private InMemoryPersistenceProvider sharedPersistence; - private InMemoryDeadLetterStore sharedDlqStore; + private InMemoryPersistenceProviderImpl sharedPersistence; + private InMemoryDeadLetterStoreImpl sharedDlqStore; private DeadLetterService sharedDlq; @BeforeEach void setUp() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - sharedPersistence = new InMemoryPersistenceProvider(); - sharedDlqStore = new InMemoryDeadLetterStore(); + sharedPersistence = new InMemoryPersistenceProviderImpl(); + sharedDlqStore = new InMemoryDeadLetterStoreImpl(); sharedDlq = new DeadLetterService(sharedDlqStore, events); - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); // Saga engine var sagaOrchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/EventWiringIntegrationTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/EventWiringIntegrationTest.java index 7f347725f..ffc2ca2aa 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/EventWiringIntegrationTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/EventWiringIntegrationTest.java @@ -23,7 +23,7 @@ import org.fireflyframework.orchestration.core.event.OrchestrationEventPublisher; import org.fireflyframework.orchestration.core.model.*; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepHandler; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.saga.builder.SagaBuilder; @@ -232,7 +232,7 @@ void tcc_endToEnd_publishesTccEvents() { @Test void workflow_endToEnd_lifecycleCallbacksFire() throws Exception { var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, publisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var registry = new WorkflowRegistry(); var engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, publisher); @@ -274,7 +274,7 @@ void workflow_endToEnd_lifecycleCallbacksFire() throws Exception { @Test void workflow_endToEnd_conditionSkipsStep() throws Exception { var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, publisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var registry = new WorkflowRegistry(); var engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, publisher); @@ -356,7 +356,7 @@ void saga_endToEnd_compensationErrorHandlerCalled() { @Test void workflow_publishEvents_false_doesNotPublishStepEvents() throws Exception { var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, publisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var registry = new WorkflowRegistry(); var engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, publisher); @@ -397,7 +397,7 @@ void workflow_publishEvents_false_doesNotPublishStepEvents() throws Exception { @Test void workflow_publishEvents_true_publishesStepEvents() throws Exception { var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, publisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var registry = new WorkflowRegistry(); var engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, publisher); @@ -492,7 +492,7 @@ void workflowBuilder_outputEventTypeAndCondition_wireThrough() throws Exception @Test void workflowBuilder_publishEventsTrue_endToEnd_publishesStepEvents() throws Exception { var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, publisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var registry = new WorkflowRegistry(); var engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, publisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/SagaIntegrationTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/SagaIntegrationTest.java index 8de53c84c..7105d1e59 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/SagaIntegrationTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/SagaIntegrationTest.java @@ -19,10 +19,10 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.builder.OrchestrationBuilder; import org.fireflyframework.orchestration.core.dlq.DeadLetterService; -import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStore; +import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStoreImpl; import org.fireflyframework.orchestration.core.model.CompensationPolicy; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.saga.compensation.SagaCompensator; import org.fireflyframework.orchestration.saga.engine.SagaEngine; @@ -50,11 +50,11 @@ class SagaIntegrationTest { void setUp() { events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); var orchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var compensator = new SagaCompensator(events, CompensationPolicy.STRICT_SEQUENTIAL, stepInvoker); - var dlqStore = new InMemoryDeadLetterStore(); + var dlqStore = new InMemoryDeadLetterStoreImpl(); dlqService = new DeadLetterService(dlqStore, events); engine = new SagaEngine(null, events, orchestrator, persistence, dlqService, compensator, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/TccIntegrationTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/TccIntegrationTest.java index 75fab759f..c7334c00a 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/TccIntegrationTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/TccIntegrationTest.java @@ -19,9 +19,9 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.builder.OrchestrationBuilder; import org.fireflyframework.orchestration.core.dlq.DeadLetterService; -import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStore; +import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStoreImpl; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.tcc.engine.TccEngine; import org.fireflyframework.orchestration.tcc.engine.TccExecutionOrchestrator; @@ -47,10 +47,10 @@ class TccIntegrationTest { void setUp() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); var orchestrator = new TccExecutionOrchestrator(stepInvoker, events, noOpPublisher); - var persistence = new InMemoryPersistenceProvider(); - var dlqStore = new InMemoryDeadLetterStore(); + var persistence = new InMemoryPersistenceProviderImpl(); + var dlqStore = new InMemoryDeadLetterStoreImpl(); dlqService = new DeadLetterService(dlqStore, events); engine = new TccEngine(null, events, orchestrator, persistence, dlqService, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/WorkflowIntegrationTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/WorkflowIntegrationTest.java index a56a49b08..82160b07a 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/WorkflowIntegrationTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/integration/WorkflowIntegrationTest.java @@ -20,7 +20,7 @@ import org.fireflyframework.orchestration.core.builder.OrchestrationBuilder; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; import org.fireflyframework.orchestration.workflow.registry.WorkflowDefinition; @@ -40,14 +40,14 @@ class WorkflowIntegrationTest { private WorkflowEngine engine; private WorkflowRegistry registry; - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; @BeforeEach void setUp() { OrchestrationEvents events = new OrchestrationEvents() {}; - persistence = new InMemoryPersistenceProvider(); + persistence = new InMemoryPersistenceProviderImpl(); registry = new WorkflowRegistry(); - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/logging/OrchestrationRuntimeLogSafetyTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/logging/OrchestrationRuntimeLogSafetyTest.java index 7ee42681a..8f4eb6770 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/logging/OrchestrationRuntimeLogSafetyTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/logging/OrchestrationRuntimeLogSafetyTest.java @@ -23,12 +23,12 @@ import org.fireflyframework.orchestration.core.context.ExecutionContext; import org.fireflyframework.orchestration.core.dlq.DeadLetterEntry; import org.fireflyframework.orchestration.core.dlq.DeadLetterService; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.*; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.*; import org.fireflyframework.orchestration.core.step.StepInvoker; -import org.fireflyframework.orchestration.persistence.redis.RedisPersistenceProvider; +import org.fireflyframework.orchestration.persistence.redis.RedisPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.child.ChildWorkflowService; import org.fireflyframework.orchestration.workflow.engine.*; import org.fireflyframework.orchestration.workflow.registry.*; @@ -55,7 +55,7 @@ class OrchestrationRuntimeLogSafetyTest { private static final String VISIBLE = "\\r\\n\\u000b\\f\\u0085\\u2028\\u2029"; private static final Duration LIMIT = Duration.ofSeconds(3); private static final List> TYPES = List.of(SignalService.class, TimerService.class, - ChildWorkflowService.class, WorkflowExecutor.class, WorkflowEngine.class, RedisPersistenceProvider.class); + ChildWorkflowService.class, WorkflowExecutor.class, WorkflowEngine.class, RedisPersistenceProviderImpl.class); private final List captured = new CopyOnWriteArrayList<>(); private final Map oldLevels = new LinkedHashMap<>(); private final Map oldAdditive = new LinkedHashMap<>(); @@ -123,18 +123,18 @@ private Object invoke(Object target, String method, Class[] signature, Object } private void missingSignal(String suffix) { String id = "missing" + suffix; - var result = new SignalService(new InMemoryPersistenceProvider(), new OrchestrationEvents() {}).signal(id, "sig", null).block(LIMIT); + var result = new SignalService(new InMemoryPersistenceProviderImpl(), new OrchestrationEvents() {}).signal(id, "sig", null).block(LIMIT); assertNotNull(result); assertFalse(result.delivered()); assertEquals(id, result.correlationId()); event("[signal] No workflow instance found: {}", Level.WARN, null, id); } private void terminalSignal(String suffix) { - String id = "terminal" + suffix; var p = new InMemoryPersistenceProvider(); p.save(state(id, ExecutionStatus.COMPLETED)).block(LIMIT); + String id = "terminal" + suffix; var p = new InMemoryPersistenceProviderImpl(); p.save(state(id, ExecutionStatus.COMPLETED)).block(LIMIT); assertFalse(new SignalService(p, new OrchestrationEvents() {}).signal(id, "sig", null).block(LIMIT).delivered()); event("[signal] Cannot signal terminal instance: {} (status={})", Level.WARN, null, id, ExecutionStatus.COMPLETED); } private void deliveredSignal(String suffix, boolean waiting) { String id = "instance" + suffix, name = "approval" + suffix; Payload payload = new Payload(); - var p = new InMemoryPersistenceProvider(); p.save(state(id, ExecutionStatus.RUNNING)).block(LIMIT); + var p = new InMemoryPersistenceProviderImpl(); p.save(state(id, ExecutionStatus.RUNNING)).block(LIMIT); var events = mock(OrchestrationEvents.class); var service = new SignalService(p, events); Mono waiter = waiting ? service.waitForSignal(id, name) : null; var result = service.signal(id, name, payload).block(LIMIT); @@ -174,7 +174,7 @@ private void childCancel(String suffix) { @SuppressWarnings("unchecked") private void checkpoint(String suffix) { String id = "checkpoint" + suffix; var failure = new IllegalStateException("write failed"); var p = mock(ExecutionPersistenceProvider.class); when(p.save(any())).thenReturn(Mono.error(failure)); var ctx = ExecutionContext.forWorkflow(id, "workflow", false); - var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), new OrchestrationEvents() {}, new NoOpEventPublisher(), null, null, p); + var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), new OrchestrationEvents() {}, new NoOpEventPublisherImpl(), null, null, p); ((Mono) invoke(executor, "saveCheckpoint", new Class[]{String.class, ExecutionContext.class}, "workflow", ctx)).block(LIMIT); var saved = org.mockito.ArgumentCaptor.forClass(ExecutionState.class); verify(p).save(saved.capture()); assertEquals(id, saved.getValue().correlationId()); event("[orchestration] Failed to save workflow checkpoint: {}", Level.WARN, failure, id); @@ -182,7 +182,7 @@ private void childCancel(String suffix) { @SuppressWarnings("unchecked") private void deadLetter(String suffix) { String id = "dlq" + suffix; var failure = new IllegalStateException("queue unavailable"); var dlq = mock(DeadLetterService.class); when(dlq.deadLetter(any())).thenReturn(Mono.error(failure)); var ctx = ExecutionContext.forWorkflow(id, "workflow", false); - var engine = new WorkflowEngine(new WorkflowRegistry(), null, null, new InMemoryPersistenceProvider(), new OrchestrationEvents() {}, new NoOpEventPublisher(), dlq); + var engine = new WorkflowEngine(new WorkflowRegistry(), null, null, new InMemoryPersistenceProviderImpl(), new OrchestrationEvents() {}, new NoOpEventPublisherImpl(), dlq); ((Mono) invoke(engine, "saveToDlq", new Class[]{String.class, ExecutionContext.class, Throwable.class, Map.class}, "workflow", ctx, failure, Map.of())).block(LIMIT); var entry = org.mockito.ArgumentCaptor.forClass(DeadLetterEntry.class); verify(dlq).deadLetter(entry.capture()); assertEquals(id, entry.getValue().correlationId()); event("[workflow] Failed to save to DLQ: {}", Level.WARN, failure, id); @@ -192,14 +192,14 @@ private void asyncWorkflow(String suffix, boolean failed) { when(executor.execute(any(), any())).thenAnswer(inv -> Mono.just(inv.getArgument(1, ExecutionContext.class))); var p = mock(ExecutionPersistenceProvider.class); var failure = new IllegalStateException("persistence unavailable"); when(p.save(any())).thenReturn(Mono.empty()); if (failed) when(p.save(any())).thenReturn(Mono.empty(), Mono.error(failure)); - var engine = new WorkflowEngine(registry, executor, null, p, new OrchestrationEvents() {}, new NoOpEventPublisher()); + var engine = new WorkflowEngine(registry, executor, null, p, new OrchestrationEvents() {}, new NoOpEventPublisherImpl()); assertEquals(id, engine.startWorkflow(id, Map.of(), "raw-correlation", "api", false).block(LIMIT).executionName()); event(failed ? "[workflow] Async workflow '{}' failed unexpectedly" : "[workflow] Async workflow '{}' completed with status {}", failed ? Level.ERROR : Level.INFO, failed ? failure : null, failed ? new Object[]{id} : new Object[]{id, ExecutionStatus.COMPLETED}); var saved = org.mockito.ArgumentCaptor.forClass(ExecutionState.class); verify(p, atLeastOnce()).save(saved.capture()); assertTrue(saved.getAllValues().stream().allMatch(s -> s.executionName().equals(id))); } - private RedisPersistenceProvider redis(ReactiveRedisTemplate template, String prefix) { - return new RedisPersistenceProvider(template, new ObjectMapper().registerModule(new Jdk8Module()).registerModule(new JavaTimeModule()), prefix, null); + private RedisPersistenceProviderImpl redis(ReactiveRedisTemplate template, String prefix) { + return new RedisPersistenceProviderImpl(template, new ObjectMapper().registerModule(new Jdk8Module()).registerModule(new JavaTimeModule()), prefix, null); } private void redisPrefix(String suffix) { String prefix = "tenant:" + suffix; redis(null, prefix); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/logging/PersistenceProviderLogSafetyTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/logging/PersistenceProviderLogSafetyTest.java index c5536831b..d4f977b44 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/logging/PersistenceProviderLogSafetyTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/logging/PersistenceProviderLogSafetyTest.java @@ -14,8 +14,8 @@ import org.fireflyframework.eventsourcing.store.EventStore; import org.fireflyframework.orchestration.core.model.*; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.persistence.cache.CachePersistenceProvider; -import org.fireflyframework.orchestration.persistence.eventsourced.EventSourcedPersistenceProvider; +import org.fireflyframework.orchestration.persistence.cache.CachePersistenceProviderImpl; +import org.fireflyframework.orchestration.persistence.eventsourced.EventSourcedPersistenceProviderImpl; import org.junit.jupiter.api.*; import org.slf4j.LoggerFactory; import org.slf4j.MDC; @@ -39,7 +39,7 @@ class PersistenceProviderLogSafetyTest { }; @BeforeEach void attach() { appender.setContext((ch.qos.logback.classic.LoggerContext) LoggerFactory.getILoggerFactory());appender.start(); - for (Class type : List.of(CachePersistenceProvider.class, EventSourcedPersistenceProvider.class)) { + for (Class type : List.of(CachePersistenceProviderImpl.class, EventSourcedPersistenceProviderImpl.class)) { Logger logger = (Logger) LoggerFactory.getLogger(type);levels.put(logger, logger.getLevel());additive.put(logger, logger.isAdditive()); logger.setLevel(Level.DEBUG);logger.setAdditive(false);logger.addAppender(appender); } @@ -67,18 +67,18 @@ private void save(boolean eventSourced, boolean failure, String id, boolean disa events.clear(); if (disabled) levels.keySet().forEach(logger -> logger.setLevel(Level.OFF)); var state = state(id);var error = new IllegalStateException("ordinary provider failure");Mono work; - CacheAdapter cache = null;EventStore store = null;EventSourcedPersistenceProvider eventProvider = null; + CacheAdapter cache = null;EventStore store = null;EventSourcedPersistenceProviderImpl eventProvider = null; if (eventSourced) { store = mock(EventStore.class); when(store.getAggregateVersion(any(), eq("orchestration-execution"))).thenReturn(Mono.just(0L)); when(store.appendEvents(any(), eq("orchestration-execution"), anyList(), eq(0L), eq(Map.of()))) .thenReturn(failure ? Mono.error(error) : Mono.empty()); - eventProvider = new EventSourcedPersistenceProvider(store, new ObjectMapper().registerModule(new JavaTimeModule()).registerModule(new Jdk8Module())); + eventProvider = new EventSourcedPersistenceProviderImpl(store, new ObjectMapper().registerModule(new JavaTimeModule()).registerModule(new Jdk8Module())); work = eventProvider.save(state); } else { cache = mock(CacheAdapter.class); when(cache.put(any(), any(), any(Duration.class))).thenReturn(failure ? Mono.error(error) : Mono.empty()); - work = new CachePersistenceProvider(cache, Duration.ofMinutes(5)).save(state); + work = new CachePersistenceProviderImpl(cache, Duration.ofMinutes(5)).save(state); } if (failure) assertSame(error, assertThrows(IllegalStateException.class, () -> work.block(LIMIT))); else assertNull(work.block(LIMIT)); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureStrategyTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureStrategyTest.java index 94b38f095..1b9684187 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureStrategyTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureStrategyTest.java @@ -16,7 +16,7 @@ package org.fireflyframework.orchestration.unit.core; -import org.fireflyframework.orchestration.core.backpressure.AdaptiveBackpressureStrategy; +import org.fireflyframework.orchestration.core.backpressure.AdaptiveBackpressureStrategyImpl; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -29,7 +29,7 @@ class BackpressureStrategyTest { @Test void adaptive_processesAllItems() { - var strategy = new AdaptiveBackpressureStrategy(2, 8, 1, 0.1); + var strategy = new AdaptiveBackpressureStrategyImpl(2, 8, 1, 0.1); List items = List.of(1, 2, 3, 4, 5); StepVerifier.create(strategy.applyBackpressure(items, item -> Mono.just(item * 2))) @@ -39,13 +39,13 @@ void adaptive_processesAllItems() { @Test void adaptive_defaultConcurrency() { - var strategy = new AdaptiveBackpressureStrategy(); + var strategy = new AdaptiveBackpressureStrategyImpl(); assertThat(strategy.getCurrentConcurrency()).isEqualTo(4); } @Test void adaptive_handlesErrors() { - var strategy = new AdaptiveBackpressureStrategy(2, 8, 1, 0.5); + var strategy = new AdaptiveBackpressureStrategyImpl(2, 8, 1, 0.5); List items = List.of(1, 2, 3); StepVerifier.create(strategy.applyBackpressure(items, item -> { @@ -58,7 +58,7 @@ void adaptive_handlesErrors() { @Test void adaptive_reset() { - var strategy = new AdaptiveBackpressureStrategy(4, 16, 1, 0.1); + var strategy = new AdaptiveBackpressureStrategyImpl(4, 16, 1, 0.1); // Process some items to change state strategy.applyBackpressure(List.of(1, 2, 3), Mono::just).collectList().block(); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureStrategyVarietyTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureStrategyVarietyTest.java index e5b18129a..710ff8e50 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureStrategyVarietyTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureStrategyVarietyTest.java @@ -16,14 +16,14 @@ package org.fireflyframework.orchestration.unit.core; -import org.fireflyframework.orchestration.core.backpressure.AdaptiveBackpressureStrategy; +import org.fireflyframework.orchestration.core.backpressure.AdaptiveBackpressureStrategyImpl; import org.fireflyframework.orchestration.core.backpressure.BackpressureConfig; import org.fireflyframework.orchestration.core.backpressure.BackpressureStrategy; import org.fireflyframework.orchestration.core.backpressure.BackpressureStrategyFactory; -import org.fireflyframework.orchestration.core.backpressure.BatchedBackpressureStrategy; -import org.fireflyframework.orchestration.core.backpressure.CircuitBreakerBackpressureStrategy; -import org.fireflyframework.orchestration.core.backpressure.CircuitBreakerBackpressureStrategy.CircuitBreakerOpenException; -import org.fireflyframework.orchestration.core.backpressure.CircuitBreakerBackpressureStrategy.State; +import org.fireflyframework.orchestration.core.backpressure.BatchedBackpressureStrategyImpl; +import org.fireflyframework.orchestration.core.backpressure.CircuitBreakerBackpressureStrategyImpl; +import org.fireflyframework.orchestration.core.backpressure.CircuitBreakerBackpressureStrategyImpl.CircuitBreakerOpenException; +import org.fireflyframework.orchestration.core.backpressure.CircuitBreakerBackpressureStrategyImpl.State; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -46,7 +46,7 @@ void setUp() { @Test void batchedStrategy_processesInBatches() { - var strategy = new BatchedBackpressureStrategy(3); + var strategy = new BatchedBackpressureStrategyImpl(3); List items = List.of(1, 2, 3, 4, 5, 6, 7); // Track the order of processing to verify batching behavior @@ -66,7 +66,7 @@ void batchedStrategy_processesInBatches() { @Test void circuitBreaker_opensOnFailureThreshold() { - var strategy = new CircuitBreakerBackpressureStrategy(3, Duration.ofSeconds(60), 2); + var strategy = new CircuitBreakerBackpressureStrategyImpl(3, Duration.ofSeconds(60), 2); // All items will fail, so the circuit breaker should open after 3 failures List items = List.of(1, 2, 3, 4, 5); @@ -83,7 +83,7 @@ void circuitBreaker_opensOnFailureThreshold() { void circuitBreaker_halfOpenAllowsLimitedCalls() { int halfOpenMax = 2; // Use a very short recovery timeout so we can transition to HALF_OPEN quickly - var strategy = new CircuitBreakerBackpressureStrategy( + var strategy = new CircuitBreakerBackpressureStrategyImpl( 2, Duration.ofMillis(50), halfOpenMax); // Trip the breaker: 2 failures in CLOSED state @@ -120,7 +120,7 @@ void circuitBreaker_halfOpenAllowsLimitedCalls() { @Test void circuitBreaker_closesOnRecovery() { - var strategy = new CircuitBreakerBackpressureStrategy( + var strategy = new CircuitBreakerBackpressureStrategyImpl( 2, Duration.ofMillis(50), 2); // Trip the breaker @@ -152,37 +152,37 @@ void factory_returnsRegisteredStrategies() { assertThat(BackpressureStrategyFactory.getStrategy("adaptive")) .isPresent() .get() - .isInstanceOf(AdaptiveBackpressureStrategy.class); + .isInstanceOf(AdaptiveBackpressureStrategyImpl.class); assertThat(BackpressureStrategyFactory.getStrategy("batched")) .isPresent() .get() - .isInstanceOf(BatchedBackpressureStrategy.class); + .isInstanceOf(BatchedBackpressureStrategyImpl.class); assertThat(BackpressureStrategyFactory.getStrategy("circuit-breaker")) .isPresent() .get() - .isInstanceOf(CircuitBreakerBackpressureStrategy.class); + .isInstanceOf(CircuitBreakerBackpressureStrategyImpl.class); assertThat(BackpressureStrategyFactory.getStrategy("circuit-breaker-aggressive")) .isPresent() .get() - .isInstanceOf(CircuitBreakerBackpressureStrategy.class); + .isInstanceOf(CircuitBreakerBackpressureStrategyImpl.class); assertThat(BackpressureStrategyFactory.getStrategy("circuit-breaker-conservative")) .isPresent() .get() - .isInstanceOf(CircuitBreakerBackpressureStrategy.class); + .isInstanceOf(CircuitBreakerBackpressureStrategyImpl.class); assertThat(BackpressureStrategyFactory.getStrategy("nonexistent")) .isEmpty(); // Verify custom registration with supplier - BackpressureStrategyFactory.registerStrategy("custom", () -> new BatchedBackpressureStrategy(5)); + BackpressureStrategyFactory.registerStrategy("custom", () -> new BatchedBackpressureStrategyImpl(5)); assertThat(BackpressureStrategyFactory.getStrategy("custom")) .isPresent() .get() - .isInstanceOf(BatchedBackpressureStrategy.class); + .isInstanceOf(BatchedBackpressureStrategyImpl.class); } @Test @@ -198,22 +198,22 @@ void factory_fromConfig_createsCorrectStrategy() { BackpressureConfig adaptiveConfig = new BackpressureConfig( "adaptive", 10, 5, Duration.ofSeconds(30), 3, 8, 32, 2, 0.2); BackpressureStrategy adaptive = BackpressureStrategyFactory.fromConfig(adaptiveConfig); - assertThat(adaptive).isInstanceOf(AdaptiveBackpressureStrategy.class); + assertThat(adaptive).isInstanceOf(AdaptiveBackpressureStrategyImpl.class); BackpressureConfig batchedConfig = new BackpressureConfig( "batched", 5, 5, Duration.ofSeconds(30), 3, 4, 16, 1, 0.1); BackpressureStrategy batched = BackpressureStrategyFactory.fromConfig(batchedConfig); - assertThat(batched).isInstanceOf(BatchedBackpressureStrategy.class); + assertThat(batched).isInstanceOf(BatchedBackpressureStrategyImpl.class); BackpressureConfig cbConfig = new BackpressureConfig( "circuit-breaker", 10, 3, Duration.ofSeconds(10), 2, 4, 16, 1, 0.1); BackpressureStrategy cb = BackpressureStrategyFactory.fromConfig(cbConfig); - assertThat(cb).isInstanceOf(CircuitBreakerBackpressureStrategy.class); + assertThat(cb).isInstanceOf(CircuitBreakerBackpressureStrategyImpl.class); // Verify defaults() produces a valid config BackpressureConfig defaults = BackpressureConfig.defaults(); BackpressureStrategy fromDefaults = BackpressureStrategyFactory.fromConfig(defaults); - assertThat(fromDefaults).isInstanceOf(AdaptiveBackpressureStrategy.class); + assertThat(fromDefaults).isInstanceOf(AdaptiveBackpressureStrategyImpl.class); // Verify unknown strategy throws BackpressureConfig unknownConfig = new BackpressureConfig( diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureWiringTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureWiringTest.java index 0598dabd8..43e0e8478 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureWiringTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/BackpressureWiringTest.java @@ -17,10 +17,10 @@ package org.fireflyframework.orchestration.unit.core; import org.fireflyframework.orchestration.core.argument.ArgumentResolver; -import org.fireflyframework.orchestration.core.backpressure.AdaptiveBackpressureStrategy; +import org.fireflyframework.orchestration.core.backpressure.AdaptiveBackpressureStrategyImpl; import org.fireflyframework.orchestration.core.backpressure.BackpressureStrategy; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.CompensationPolicy; import org.fireflyframework.orchestration.core.model.StepStatus; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; @@ -71,7 +71,7 @@ class BackpressureWiringTest { private OrchestrationEvents events; private StepInvoker stepInvoker; - private NoOpEventPublisher noOpPublisher; + private NoOpEventPublisherImpl noOpPublisher; @Mock private TccEngine tccEngine; @@ -83,13 +83,13 @@ class BackpressureWiringTest { void setUp() { events = new OrchestrationEvents() {}; stepInvoker = new StepInvoker(new ArgumentResolver()); - noOpPublisher = new NoOpEventPublisher(); + noOpPublisher = new NoOpEventPublisherImpl(); } @Test void sagaOrchestrator_withBackpressure_appliesStrategy() { // Create a spy backpressure strategy to verify it is called - var realStrategy = new AdaptiveBackpressureStrategy(2, 8, 1, 0.1); + var realStrategy = new AdaptiveBackpressureStrategyImpl(2, 8, 1, 0.1); var strategyUsed = new AtomicBoolean(false); BackpressureStrategy spyStrategy = new BackpressureStrategy() { @@ -156,7 +156,7 @@ void sagaOrchestrator_withoutBackpressure_usesDefault() { @Test void tccCompositor_withBackpressure_appliesStrategy() { var strategyUsed = new AtomicBoolean(false); - var realStrategy = new AdaptiveBackpressureStrategy(2, 8, 1, 0.1); + var realStrategy = new AdaptiveBackpressureStrategyImpl(2, 8, 1, 0.1); BackpressureStrategy spyStrategy = new BackpressureStrategy() { @Override @@ -199,7 +199,7 @@ public Flux applyBackpressure(List items, ItemProcessor proce @Test void compositionOrchestrator_withBackpressure_appliesStrategy() { var strategyUsed = new AtomicBoolean(false); - var realStrategy = new AdaptiveBackpressureStrategy(2, 8, 1, 0.1); + var realStrategy = new AdaptiveBackpressureStrategyImpl(2, 8, 1, 0.1); BackpressureStrategy spyStrategy = new BackpressureStrategy() { @Override diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DeadLetterServiceTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DeadLetterServiceTest.java index a631bb3d8..b0b64beb1 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DeadLetterServiceTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DeadLetterServiceTest.java @@ -30,12 +30,12 @@ class DeadLetterServiceTest { - private InMemoryDeadLetterStore store; + private InMemoryDeadLetterStoreImpl store; private DeadLetterService service; @BeforeEach void setUp() { - store = new InMemoryDeadLetterStore(); + store = new InMemoryDeadLetterStoreImpl(); service = new DeadLetterService(store, new OrchestrationEvents() {}); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DeadMetadataWiringTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DeadMetadataWiringTest.java index 2ff57d509..d65210799 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DeadMetadataWiringTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DeadMetadataWiringTest.java @@ -20,7 +20,7 @@ import org.fireflyframework.orchestration.core.argument.CorrelationId; import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.StepStatus; import org.fireflyframework.orchestration.core.model.TriggerMode; @@ -68,7 +68,7 @@ void workflowRetryFallsBackToDefinitionPolicy() throws Exception { false, 0); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); var ctx = ExecutionContext.forWorkflow("corr-1", "retry-wf"); @@ -101,7 +101,7 @@ void workflowRetryUsesStepPolicyWhenPresent() throws Exception { false, 0); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); var ctx = ExecutionContext.forWorkflow("corr-2", "retry-wf2"); @@ -130,7 +130,7 @@ void dryRunSkipsExecution() throws Exception { false, 0); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); // Create context with dryRun=true diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DlqInputCaptureTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DlqInputCaptureTest.java index 082063e96..549fe6040 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DlqInputCaptureTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/DlqInputCaptureTest.java @@ -19,12 +19,12 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.dlq.DeadLetterEntry; import org.fireflyframework.orchestration.core.dlq.DeadLetterService; -import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStore; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStoreImpl; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.CompensationPolicy; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepHandler; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.saga.builder.SagaBuilder; @@ -53,17 +53,17 @@ class DlqInputCaptureTest { private OrchestrationEvents events; - private InMemoryDeadLetterStore dlqStore; + private InMemoryDeadLetterStoreImpl dlqStore; private DeadLetterService dlqService; - private NoOpEventPublisher noOpPublisher; + private NoOpEventPublisherImpl noOpPublisher; private StepInvoker stepInvoker; @BeforeEach void setUp() { events = new OrchestrationEvents() {}; - dlqStore = new InMemoryDeadLetterStore(); + dlqStore = new InMemoryDeadLetterStoreImpl(); dlqService = new DeadLetterService(dlqStore, events); - noOpPublisher = new NoOpEventPublisher(); + noOpPublisher = new NoOpEventPublisherImpl(); stepInvoker = new StepInvoker(new ArgumentResolver()); } @@ -218,7 +218,7 @@ void saga_multiStepFailure_savesAllToDlq() { @Test void saga_stepLatenciesArePersisted() { - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var orchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher, persistence); var compensator = new SagaCompensator(events, CompensationPolicy.STRICT_SEQUENTIAL, stepInvoker); var engine = new SagaEngine(null, events, orchestrator, persistence, null, compensator, noOpPublisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/EventPublishingTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/EventPublishingTest.java index 0268e40fe..67b96b00c 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/EventPublishingTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/EventPublishingTest.java @@ -25,7 +25,7 @@ import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepHandler; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.saga.builder.SagaBuilder; @@ -334,7 +334,7 @@ public Mono failStep(Map input) { @Test void workflow_executionStartedAndCompleted_publishesLifecycleEvents() throws Exception { var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, publisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var registry = new WorkflowRegistry(); var engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, publisher); @@ -364,7 +364,7 @@ void workflow_executionStartedAndCompleted_publishesLifecycleEvents() throws Exc @Test void workflow_stepWithOutputEventType_publishesStepEvent() throws Exception { var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, publisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var registry = new WorkflowRegistry(); var engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, publisher); @@ -400,7 +400,7 @@ void workflow_stepWithOutputEventType_publishesStepEvent() throws Exception { @Test void workflow_stepWithBlankOutputEventType_doesNotPublishStepEvent() throws Exception { var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, publisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var registry = new WorkflowRegistry(); var engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, publisher); @@ -430,7 +430,7 @@ void workflow_stepWithBlankOutputEventType_doesNotPublishStepEvent() throws Exce @Test void workflow_failedExecution_publishesCompletedWithFailedStatus() throws Exception { var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, publisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var registry = new WorkflowRegistry(); var engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, publisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/ExecutionReportWiringTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/ExecutionReportWiringTest.java index f657bc3f7..5412da6b4 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/ExecutionReportWiringTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/ExecutionReportWiringTest.java @@ -18,13 +18,13 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.CompensationPolicy; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.report.ExecutionReport; import org.fireflyframework.orchestration.core.step.StepHandler; import org.fireflyframework.orchestration.core.step.StepInvoker; @@ -62,13 +62,13 @@ class ExecutionReportWiringTest { private OrchestrationEvents events; private StepInvoker stepInvoker; - private NoOpEventPublisher noOpPublisher; + private NoOpEventPublisherImpl noOpPublisher; @BeforeEach void setUp() { events = new OrchestrationEvents() {}; stepInvoker = new StepInvoker(new ArgumentResolver()); - noOpPublisher = new NoOpEventPublisher(); + noOpPublisher = new NoOpEventPublisherImpl(); } // ── Saga ──────────────────────────────────────────────────────────────── @@ -202,7 +202,7 @@ public Mono failStep(@Input Map input) { void workflowEngine_completed_attachesReport() throws Exception { var executor = new WorkflowExecutor(stepInvoker, events, noOpPublisher, null, null); var registry = new WorkflowRegistry(); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var engine = new WorkflowEngine(registry, executor, stepInvoker, persistence, events, noOpPublisher); var testSteps = new WfTestSteps(); @@ -233,7 +233,7 @@ void workflowEngine_completed_attachesReport() throws Exception { void workflowEngine_failed_attachesReport() throws Exception { var executor = new WorkflowExecutor(stepInvoker, events, noOpPublisher, null, null); var registry = new WorkflowRegistry(); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var engine = new WorkflowEngine(registry, executor, stepInvoker, persistence, events, noOpPublisher); var testSteps = new WfTestSteps(); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/InMemoryPersistenceProviderTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/InMemoryPersistenceProviderTest.java index 3e1d19b01..439d79eb9 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/InMemoryPersistenceProviderTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/InMemoryPersistenceProviderTest.java @@ -19,7 +19,7 @@ import org.fireflyframework.orchestration.core.model.ExecutionPattern; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import reactor.test.StepVerifier; @@ -32,10 +32,10 @@ class InMemoryPersistenceProviderTest { - private InMemoryPersistenceProvider provider; + private InMemoryPersistenceProviderImpl provider; @BeforeEach - void setUp() { provider = new InMemoryPersistenceProvider(); } + void setUp() { provider = new InMemoryPersistenceProviderImpl(); } private ExecutionState createState(String id, ExecutionPattern pattern, ExecutionStatus status) { return new ExecutionState(id, "test-" + id, pattern, status, diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/LifecycleCallbackAdvancedTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/LifecycleCallbackAdvancedTest.java index cb2281c24..94cf65caa 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/LifecycleCallbackAdvancedTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/LifecycleCallbackAdvancedTest.java @@ -18,7 +18,7 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.CompensationPolicy; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.step.StepHandler; @@ -231,7 +231,7 @@ class PriorityTccBean { private SagaEngine createSagaEngine() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var orchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher); var compensator = new SagaCompensator(events, CompensationPolicy.STRICT_SEQUENTIAL, stepInvoker); return new SagaEngine(null, events, orchestrator, null, null, compensator, noOpPublisher); @@ -240,7 +240,7 @@ private SagaEngine createSagaEngine() { private TccEngine createTccEngine() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var orchestrator = new TccExecutionOrchestrator(stepInvoker, events, noOpPublisher); return new TccEngine(null, events, orchestrator, null, null, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/MetricsEndpointTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/MetricsEndpointTest.java index 8c2ff3aa7..68123972c 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/MetricsEndpointTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/MetricsEndpointTest.java @@ -18,7 +18,7 @@ import io.micrometer.core.instrument.simple.SimpleMeterRegistry; import org.fireflyframework.orchestration.core.model.ExecutionPattern; -import org.fireflyframework.orchestration.core.observability.OrchestrationMetrics; +import org.fireflyframework.orchestration.core.observability.OrchestrationMetricsImpl; import org.fireflyframework.orchestration.core.observability.OrchestrationMetricsEndpoint; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -30,13 +30,13 @@ class MetricsEndpointTest { private SimpleMeterRegistry registry; - private OrchestrationMetrics metrics; + private OrchestrationMetricsImpl metrics; private OrchestrationMetricsEndpoint endpoint; @BeforeEach void setUp() { registry = new SimpleMeterRegistry(); - metrics = new OrchestrationMetrics(registry); + metrics = new OrchestrationMetricsImpl(registry); endpoint = new OrchestrationMetricsEndpoint(registry); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/RecoveryServiceTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/RecoveryServiceTest.java index d590295f8..2bc242385 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/RecoveryServiceTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/RecoveryServiceTest.java @@ -21,7 +21,7 @@ import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.recovery.RecoveryService; import org.fireflyframework.orchestration.core.scheduling.OrchestrationScheduler; import org.junit.jupiter.api.AfterEach; @@ -40,13 +40,13 @@ class RecoveryServiceTest { - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; private RecoveryService recoveryService; private OrchestrationScheduler scheduler; @BeforeEach void setUp() { - persistence = new InMemoryPersistenceProvider(); + persistence = new InMemoryPersistenceProviderImpl(); var events = new OrchestrationEvents() {}; recoveryService = new RecoveryService(persistence, events, Duration.ofMinutes(30)); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SchedulingAlignmentTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SchedulingAlignmentTest.java index f01750fea..5650d81cb 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SchedulingAlignmentTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SchedulingAlignmentTest.java @@ -17,7 +17,7 @@ package org.fireflyframework.orchestration.unit.core; import org.fireflyframework.orchestration.core.scheduling.OrchestrationScheduler; -import org.fireflyframework.orchestration.core.scheduling.SchedulingPostProcessor; +import org.fireflyframework.orchestration.core.scheduling.SchedulingPostProcessorImpl; import org.fireflyframework.orchestration.saga.annotation.Saga; import org.fireflyframework.orchestration.saga.annotation.ScheduledSaga; import org.fireflyframework.orchestration.saga.engine.SagaEngine; @@ -85,7 +85,7 @@ void scheduledSaga_enabledFalse_skipsRegistration() { when(applicationContext.getBeansWithAnnotation(Saga.class)) .thenReturn(Map.of("disabledSaga", bean)); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, sagaEngine, null, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, sagaEngine, null, null); processor.afterSingletonsInstantiated(); verify(spyScheduler, never()).scheduleAtFixedRate(any(), any(), anyLong(), anyLong()); @@ -106,7 +106,7 @@ void scheduledTcc_enabledFalse_skipsRegistration() { when(applicationContext.getBeansWithAnnotation(Tcc.class)) .thenReturn(Map.of("disabledTcc", bean)); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, tccEngine, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, tccEngine, null); processor.afterSingletonsInstantiated(); verify(spyScheduler, never()).scheduleAtFixedRate(any(), any(), anyLong(), anyLong()); @@ -129,7 +129,7 @@ void scheduledSaga_zoneAttribute_passedThroughToScheduler() { lenient().when(sagaEngine.execute(eq("zoned-saga"), any(StepInputs.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, sagaEngine, null, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, sagaEngine, null, null); processor.afterSingletonsInstantiated(); // The 4-arg scheduleWithCron is called when zone is provided @@ -153,7 +153,7 @@ void scheduledSaga_initialDelay_passedToScheduler() { lenient().when(sagaEngine.execute(eq("delayed-saga"), any(StepInputs.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, sagaEngine, null, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, sagaEngine, null, null); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleAtFixedRate( @@ -176,7 +176,7 @@ void scheduledSaga_inputAttribute_parsedAndPassedToEngine() { lenient().when(sagaEngine.execute(eq("input-saga"), any(StepInputs.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, sagaEngine, null, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, sagaEngine, null, null); processor.afterSingletonsInstantiated(); // Verify that the schedule was registered (the input parsing happens inside the Runnable) @@ -200,7 +200,7 @@ void scheduledTcc_initialDelay_passedToScheduler() { lenient().when(tccEngine.execute(eq("delayed-tcc"), any(TccInputs.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, tccEngine, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, tccEngine, null); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleAtFixedRate( @@ -223,7 +223,7 @@ void scheduledTcc_zoneAttribute_passedThroughToScheduler() { lenient().when(tccEngine.execute(eq("zoned-tcc"), any(TccInputs.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, tccEngine, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, tccEngine, null); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleWithCron( diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SchedulingTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SchedulingTest.java index aedcb6048..63881969b 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SchedulingTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SchedulingTest.java @@ -17,7 +17,7 @@ package org.fireflyframework.orchestration.unit.core; import org.fireflyframework.orchestration.core.scheduling.OrchestrationScheduler; -import org.fireflyframework.orchestration.core.scheduling.SchedulingPostProcessor; +import org.fireflyframework.orchestration.core.scheduling.SchedulingPostProcessorImpl; import org.fireflyframework.orchestration.saga.annotation.Saga; import org.fireflyframework.orchestration.saga.annotation.ScheduledSaga; import org.fireflyframework.orchestration.saga.engine.SagaEngine; @@ -142,7 +142,7 @@ void scheduledSaga_registersFixedRate() { lenient().when(sagaEngine.execute(eq("scheduled-saga"), any(StepInputs.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, sagaEngine, null, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, sagaEngine, null, null); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleAtFixedRate( @@ -159,7 +159,7 @@ void scheduledSaga_registersCron() { lenient().when(sagaEngine.execute(eq("cron-saga"), any(StepInputs.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, sagaEngine, null, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, sagaEngine, null, null); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleWithCron( @@ -176,7 +176,7 @@ void scheduledSaga_multipleAnnotations_registersBoth() { lenient().when(sagaEngine.execute(eq("multi-saga"), any(StepInputs.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, sagaEngine, null, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, sagaEngine, null, null); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleAtFixedRate( @@ -193,7 +193,7 @@ void plainSaga_noScheduledAnnotation_doesNotRegister() { when(applicationContext.getBeansWithAnnotation(Saga.class)) .thenReturn(Map.of("plainSaga", bean)); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, sagaEngine, null, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, sagaEngine, null, null); processor.afterSingletonsInstantiated(); verify(spyScheduler, never()).scheduleAtFixedRate(any(), any(), anyLong(), anyLong()); @@ -210,7 +210,7 @@ void scheduledTcc_registersFixedRate() { lenient().when(tccEngine.execute(eq("scheduled-tcc"), any(TccInputs.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, tccEngine, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, tccEngine, null); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleAtFixedRate( @@ -227,7 +227,7 @@ void scheduledTcc_registersCron() { lenient().when(tccEngine.execute(eq("cron-tcc"), any(TccInputs.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, tccEngine, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, tccEngine, null); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleWithCron( @@ -244,7 +244,7 @@ void scheduledWorkflow_registersFixedRate() { lenient().when(workflowEngine.startWorkflow(eq("scheduled-wf"), any(Map.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, null, workflowEngine); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, null, workflowEngine); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleAtFixedRate( @@ -261,7 +261,7 @@ void scheduledWorkflow_registersCron() { lenient().when(workflowEngine.startWorkflow(eq("cron-wf"), any(Map.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, null, workflowEngine); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, null, workflowEngine); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleWithCron( @@ -278,7 +278,7 @@ void scheduledWorkflow_registersFixedDelay() { lenient().when(workflowEngine.startWorkflow(eq("delay-wf"), any(Map.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, null, workflowEngine); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, null, workflowEngine); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleWithFixedDelay( @@ -289,7 +289,7 @@ void scheduledWorkflow_registersFixedDelay() { void nullEngines_handledGracefully() { var spyScheduler = spy(scheduler); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, null, null); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, null, null); processor.afterSingletonsInstantiated(); verify(spyScheduler, never()).scheduleAtFixedRate(any(), any(), anyLong(), anyLong()); @@ -388,7 +388,7 @@ void scheduledWorkflow_enabledFalse_doesNotRegister() { when(applicationContext.getBeansWithAnnotation(Workflow.class)) .thenReturn(Map.of("disabledWf", bean)); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, null, workflowEngine); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, null, workflowEngine); processor.afterSingletonsInstantiated(); verify(spyScheduler, never()).scheduleAtFixedRate(any(), any(), anyLong(), anyLong()); @@ -406,7 +406,7 @@ void scheduledWorkflow_zonePassedToCronScheduler() { lenient().when(workflowEngine.startWorkflow(eq("zone-wf"), any(Map.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, null, workflowEngine); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, null, workflowEngine); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleWithCron( @@ -423,7 +423,7 @@ void scheduledWorkflow_initialDelayPassedThrough() { lenient().when(workflowEngine.startWorkflow(eq("initial-delay-wf"), any(Map.class))) .thenReturn(Mono.empty()); - var processor = new SchedulingPostProcessor(applicationContext, spyScheduler, null, null, workflowEngine); + var processor = new SchedulingPostProcessorImpl(applicationContext, spyScheduler, null, null, workflowEngine); processor.afterSingletonsInstantiated(); verify(spyScheduler).scheduleAtFixedRate( diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SuppressErrorAlignmentTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SuppressErrorAlignmentTest.java index 3b49b9834..d77844e0d 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SuppressErrorAlignmentTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/SuppressErrorAlignmentTest.java @@ -18,7 +18,7 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.CompensationPolicy; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.step.StepHandler; @@ -59,7 +59,7 @@ class SuppressErrorAlignmentTest { private SagaEngine createSagaEngine() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var orchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher); var compensator = new SagaCompensator(events, CompensationPolicy.STRICT_SEQUENTIAL, stepInvoker); return new SagaEngine(null, events, orchestrator, null, null, compensator, noOpPublisher); @@ -70,7 +70,7 @@ private SagaEngine createSagaEngine() { private TccEngine createTccEngine() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var orchestrator = new TccExecutionOrchestrator(stepInvoker, events, noOpPublisher); return new TccEngine(null, events, orchestrator, null, null, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/TracerWiringTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/TracerWiringTest.java index 5f8bdf21b..bc914be62 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/TracerWiringTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/TracerWiringTest.java @@ -18,7 +18,7 @@ import io.micrometer.observation.ObservationRegistry; import org.fireflyframework.orchestration.core.argument.ArgumentResolver; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.CompensationPolicy; import org.fireflyframework.orchestration.core.model.StepStatus; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; @@ -39,7 +39,7 @@ import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; import org.fireflyframework.orchestration.workflow.registry.WorkflowDefinition; @@ -61,13 +61,13 @@ class TracerWiringTest { private OrchestrationEvents events; private StepInvoker stepInvoker; - private NoOpEventPublisher noOpPublisher; + private NoOpEventPublisherImpl noOpPublisher; @BeforeEach void setUp() { events = new OrchestrationEvents() {}; stepInvoker = new StepInvoker(new ArgumentResolver()); - noOpPublisher = new NoOpEventPublisher(); + noOpPublisher = new NoOpEventPublisherImpl(); } @SuppressWarnings("unused") @@ -171,7 +171,7 @@ void workflowEngine_withoutTracer_executesNormally() throws Exception { registry.register(def); var engine = new WorkflowEngine(registry, executor, stepInvoker, - new InMemoryPersistenceProvider(), events, noOpPublisher); + new InMemoryPersistenceProviderImpl(), events, noOpPublisher); StepVerifier.create(engine.startWorkflow("no-tracer-wf", Map.of())) .assertNext(state -> assertThat(state.status().isTerminal()).isTrue()) @@ -195,7 +195,7 @@ void workflowEngine_withTracer_executesWithObservation() throws Exception { registry.register(def); var engine = new WorkflowEngine(registry, executor, stepInvoker, - new InMemoryPersistenceProvider(), events, noOpPublisher, null, tracer); + new InMemoryPersistenceProviderImpl(), events, noOpPublisher, null, tracer); StepVerifier.create(engine.startWorkflow("traced-wf", Map.of())) .assertNext(state -> assertThat(state.status().isTerminal()).isTrue()) diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/event/EdaOrchestrationEventPublisherTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/event/EdaOrchestrationEventPublisherTest.java index 5c08f9b90..a42714992 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/event/EdaOrchestrationEventPublisherTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/core/event/EdaOrchestrationEventPublisherTest.java @@ -18,7 +18,7 @@ import org.fireflyframework.eda.publisher.EventPublisher; import org.fireflyframework.eda.publisher.EventPublisherFactory; -import org.fireflyframework.orchestration.core.event.EdaOrchestrationEventPublisher; +import org.fireflyframework.orchestration.core.event.EdaOrchestrationEventPublisherImpl; import org.fireflyframework.orchestration.core.event.OrchestrationEvent; import org.fireflyframework.orchestration.core.model.ExecutionPattern; import org.fireflyframework.orchestration.core.model.ExecutionStatus; @@ -77,8 +77,8 @@ void publish_delegatesToEventPublisher_withEventTopicAndAllHeaders() { "tenant.created", "key-abc" ); - EdaOrchestrationEventPublisher bridge = - new EdaOrchestrationEventPublisher(factory, "fallback.topic"); + EdaOrchestrationEventPublisherImpl bridge = + new EdaOrchestrationEventPublisherImpl(factory, "fallback.topic"); // When publishing StepVerifier.create(bridge.publish(event)).verifyComplete(); @@ -107,8 +107,8 @@ void publish_delegatesToEventPublisher_withEventTopicAndAllHeaders() { void publish_fallsBackToDefaultTopic_whenEventTopicIsBlank() { OrchestrationEvent event = OrchestrationEvent.executionStarted( "OnboardTenantSaga", "corr-1", ExecutionPattern.SAGA); - EdaOrchestrationEventPublisher bridge = - new EdaOrchestrationEventPublisher(factory, "idp.admin-identity.events"); + EdaOrchestrationEventPublisherImpl bridge = + new EdaOrchestrationEventPublisherImpl(factory, "idp.admin-identity.events"); StepVerifier.create(bridge.publish(event)).verifyComplete(); @@ -125,8 +125,8 @@ void publish_fallsBackToDefaultTopic_whenEventTopicIsNull() { null, // topic = null null, null ); - EdaOrchestrationEventPublisher bridge = - new EdaOrchestrationEventPublisher(factory, "default.topic"); + EdaOrchestrationEventPublisherImpl bridge = + new EdaOrchestrationEventPublisherImpl(factory, "default.topic"); StepVerifier.create(bridge.publish(event)).verifyComplete(); @@ -143,8 +143,8 @@ void publish_returnsEmpty_whenBothTopicsBlankAndDoesNotInvokePublisher() { "", // topic blank null, null ); - EdaOrchestrationEventPublisher bridge = - new EdaOrchestrationEventPublisher(factory, " "); + EdaOrchestrationEventPublisherImpl bridge = + new EdaOrchestrationEventPublisherImpl(factory, " "); StepVerifier.create(bridge.publish(event)).verifyComplete(); @@ -160,8 +160,8 @@ void publish_returnsEmpty_whenBothTopicsNull() { null, null, null ); - EdaOrchestrationEventPublisher bridge = - new EdaOrchestrationEventPublisher(factory, null); + EdaOrchestrationEventPublisherImpl bridge = + new EdaOrchestrationEventPublisherImpl(factory, null); StepVerifier.create(bridge.publish(event)).verifyComplete(); @@ -183,8 +183,8 @@ void publish_routingKeyFallsBackToExecutionNameAndCorrelationId() { "step.event", null // key null → fallback expected ); - EdaOrchestrationEventPublisher bridge = - new EdaOrchestrationEventPublisher(factory, "idp.orchestration.events"); + EdaOrchestrationEventPublisherImpl bridge = + new EdaOrchestrationEventPublisherImpl(factory, "idp.orchestration.events"); StepVerifier.create(bridge.publish(event)).verifyComplete(); @@ -210,8 +210,8 @@ void publish_routingKeyFallsBackEvenWhenKeyIsBlank() { null, " " // key blank → fallback expected ); - EdaOrchestrationEventPublisher bridge = - new EdaOrchestrationEventPublisher(factory, null); + EdaOrchestrationEventPublisherImpl bridge = + new EdaOrchestrationEventPublisherImpl(factory, null); StepVerifier.create(bridge.publish(event)).verifyComplete(); @@ -227,8 +227,8 @@ void publish_returnsEmpty_whenFactoryReturnsNullPublisher() { when(factory.getDefaultPublisher()).thenReturn(null); OrchestrationEvent event = OrchestrationEvent.executionStarted( "S", "c", ExecutionPattern.SAGA); - EdaOrchestrationEventPublisher bridge = - new EdaOrchestrationEventPublisher(factory, "default.topic"); + EdaOrchestrationEventPublisherImpl bridge = + new EdaOrchestrationEventPublisherImpl(factory, "default.topic"); StepVerifier.create(bridge.publish(event)).verifyComplete(); @@ -241,8 +241,8 @@ void publish_propagatesErrorFromUnderlyingPublisher() { .thenReturn(Mono.error(new RuntimeException("kafka down"))); OrchestrationEvent event = OrchestrationEvent.stepCompleted( "S", "c", ExecutionPattern.SAGA, "step1", "result"); - EdaOrchestrationEventPublisher bridge = - new EdaOrchestrationEventPublisher(factory, "default.topic"); + EdaOrchestrationEventPublisherImpl bridge = + new EdaOrchestrationEventPublisherImpl(factory, "default.topic"); StepVerifier.create(bridge.publish(event)) .expectErrorMatches(t -> t instanceof RuntimeException @@ -252,8 +252,8 @@ void publish_propagatesErrorFromUnderlyingPublisher() { @Test void publish_handlesNullEvent_returnsEmpty() { - EdaOrchestrationEventPublisher bridge = - new EdaOrchestrationEventPublisher(factory, "default.topic"); + EdaOrchestrationEventPublisherImpl bridge = + new EdaOrchestrationEventPublisherImpl(factory, "default.topic"); StepVerifier.create(bridge.publish(null)).verifyComplete(); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerTest.java index f10d452b9..a95d786fe 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerTest.java @@ -17,7 +17,7 @@ package org.fireflyframework.orchestration.unit.saga; import org.fireflyframework.orchestration.saga.compensation.CompensationErrorHandler.CompensationErrorResult; -import org.fireflyframework.orchestration.saga.compensation.RetryWithBackoffErrorHandler; +import org.fireflyframework.orchestration.saga.compensation.RetryWithBackoffErrorHandlerImpl; import org.junit.jupiter.api.Test; import java.io.IOException; @@ -29,7 +29,7 @@ class CompensationErrorHandlerTest { @Test void retryHandler_retriesWithinLimit() { - var handler = new RetryWithBackoffErrorHandler(3); + var handler = new RetryWithBackoffErrorHandlerImpl(3); assertThat(handler.handle("saga", "step1", new RuntimeException(), 0)) .isEqualTo(CompensationErrorResult.RETRY); assertThat(handler.handle("saga", "step1", new RuntimeException(), 1)) @@ -40,14 +40,14 @@ void retryHandler_retriesWithinLimit() { @Test void retryHandler_failsAfterMaxRetries() { - var handler = new RetryWithBackoffErrorHandler(2); + var handler = new RetryWithBackoffErrorHandlerImpl(2); assertThat(handler.handle("saga", "step1", new RuntimeException(), 2)) .isEqualTo(CompensationErrorResult.FAIL_SAGA); } @Test void retryHandler_filtersRetryableExceptions() { - var handler = new RetryWithBackoffErrorHandler(3, Set.of(IOException.class)); + var handler = new RetryWithBackoffErrorHandlerImpl(3, Set.of(IOException.class)); // IOException is retryable assertThat(handler.handle("saga", "s1", new IOException(), 0)) @@ -60,7 +60,7 @@ void retryHandler_filtersRetryableExceptions() { @Test void retryHandler_emptyRetryableTypesRetriesAll() { - var handler = new RetryWithBackoffErrorHandler(3, Set.of()); + var handler = new RetryWithBackoffErrorHandlerImpl(3, Set.of()); assertThat(handler.handle("saga", "s1", new RuntimeException(), 0)) .isEqualTo(CompensationErrorResult.RETRY); assertThat(handler.handle("saga", "s1", new IOException(), 0)) diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerVarietyTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerVarietyTest.java index 801ef9fc3..ab065a3fe 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerVarietyTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerVarietyTest.java @@ -19,11 +19,11 @@ import org.fireflyframework.orchestration.saga.compensation.CompensationErrorHandler; import org.fireflyframework.orchestration.saga.compensation.CompensationErrorHandler.CompensationErrorResult; import org.fireflyframework.orchestration.saga.compensation.CompensationErrorHandlerFactory; -import org.fireflyframework.orchestration.saga.compensation.CompositeCompensationErrorHandler; -import org.fireflyframework.orchestration.saga.compensation.DefaultCompensationErrorHandler; -import org.fireflyframework.orchestration.saga.compensation.FailFastErrorHandler; -import org.fireflyframework.orchestration.saga.compensation.LogAndContinueErrorHandler; -import org.fireflyframework.orchestration.saga.compensation.RetryWithBackoffErrorHandler; +import org.fireflyframework.orchestration.saga.compensation.CompositeCompensationErrorHandlerImpl; +import org.fireflyframework.orchestration.saga.compensation.DefaultCompensationErrorHandlerImpl; +import org.fireflyframework.orchestration.saga.compensation.FailFastErrorHandlerImpl; +import org.fireflyframework.orchestration.saga.compensation.LogAndContinueErrorHandlerImpl; +import org.fireflyframework.orchestration.saga.compensation.RetryWithBackoffErrorHandlerImpl; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -44,7 +44,7 @@ void setUp() { @Test void failFast_alwaysReturnsFail() { - var handler = new FailFastErrorHandler(); + var handler = new FailFastErrorHandlerImpl(); assertThat(handler.handle("saga1", "step1", new RuntimeException("err"), 0)) .isEqualTo(CompensationErrorResult.FAIL_SAGA); @@ -56,7 +56,7 @@ void failFast_alwaysReturnsFail() { @Test void logAndContinue_alwaysReturnsContinue() { - var handler = new LogAndContinueErrorHandler(); + var handler = new LogAndContinueErrorHandlerImpl(); assertThat(handler.handle("saga1", "step1", new RuntimeException("err"), 0)) .isEqualTo(CompensationErrorResult.CONTINUE); @@ -69,9 +69,9 @@ void logAndContinue_alwaysReturnsContinue() { @Test void composite_delegatesToFirstNonContinue() { // First handler continues, second handler fails the saga - var composite = new CompositeCompensationErrorHandler(List.of( - new LogAndContinueErrorHandler(), - new FailFastErrorHandler() + var composite = new CompositeCompensationErrorHandlerImpl(List.of( + new LogAndContinueErrorHandlerImpl(), + new FailFastErrorHandlerImpl() )); assertThat(composite.handle("saga1", "step1", new RuntimeException("err"), 0)) @@ -80,10 +80,10 @@ void composite_delegatesToFirstNonContinue() { @Test void composite_returnsContinueIfAllContinue() { - var composite = new CompositeCompensationErrorHandler(List.of( - new LogAndContinueErrorHandler(), - new DefaultCompensationErrorHandler(), - new LogAndContinueErrorHandler() + var composite = new CompositeCompensationErrorHandlerImpl(List.of( + new LogAndContinueErrorHandlerImpl(), + new DefaultCompensationErrorHandlerImpl(), + new LogAndContinueErrorHandlerImpl() )); assertThat(composite.handle("saga1", "step1", new RuntimeException("err"), 0)) @@ -94,23 +94,23 @@ void composite_returnsContinueIfAllContinue() { void factory_returnsRegisteredHandlers() { assertThat(CompensationErrorHandlerFactory.getHandler("default")) .isPresent() - .get().isInstanceOf(DefaultCompensationErrorHandler.class); + .get().isInstanceOf(DefaultCompensationErrorHandlerImpl.class); assertThat(CompensationErrorHandlerFactory.getHandler("fail-fast")) .isPresent() - .get().isInstanceOf(FailFastErrorHandler.class); + .get().isInstanceOf(FailFastErrorHandlerImpl.class); assertThat(CompensationErrorHandlerFactory.getHandler("log-and-continue")) .isPresent() - .get().isInstanceOf(LogAndContinueErrorHandler.class); + .get().isInstanceOf(LogAndContinueErrorHandlerImpl.class); assertThat(CompensationErrorHandlerFactory.getHandler("retry")) .isPresent() - .get().isInstanceOf(RetryWithBackoffErrorHandler.class); + .get().isInstanceOf(RetryWithBackoffErrorHandlerImpl.class); assertThat(CompensationErrorHandlerFactory.getHandler("robust")) .isPresent() - .get().isInstanceOf(CompositeCompensationErrorHandler.class); + .get().isInstanceOf(CompositeCompensationErrorHandlerImpl.class); assertThat(CompensationErrorHandlerFactory.getHandler("nonexistent")) .isEmpty(); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerWiringTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerWiringTest.java index af7d325b1..492af60fc 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerWiringTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/CompensationErrorHandlerWiringTest.java @@ -26,7 +26,7 @@ import org.fireflyframework.orchestration.saga.builder.SagaBuilder; import org.fireflyframework.orchestration.saga.compensation.CompensationErrorHandler; import org.fireflyframework.orchestration.saga.compensation.CompensationErrorHandler.CompensationErrorResult; -import org.fireflyframework.orchestration.saga.compensation.DefaultCompensationErrorHandler; +import org.fireflyframework.orchestration.saga.compensation.DefaultCompensationErrorHandlerImpl; import org.fireflyframework.orchestration.saga.compensation.SagaCompensator; import org.fireflyframework.orchestration.saga.engine.SagaEngine; import org.fireflyframework.orchestration.saga.engine.SagaExecutionOrchestrator; @@ -52,7 +52,7 @@ class CompensationErrorHandlerWiringTest { private SagaEngine createEngine(CompensationPolicy policy, CompensationErrorHandler handler) { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); var orchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher); var compensator = new SagaCompensator(events, policy, stepInvoker, handler); return new SagaEngine(null, events, orchestrator, null, null, compensator, noOpPublisher); @@ -337,7 +337,7 @@ public Mono compensate(String result, ExecutionContext ctx) { @Test void compensator_defaultHandler_returnsContinue() { // Verify the default handler returns CONTINUE - DefaultCompensationErrorHandler defaultHandler = new DefaultCompensationErrorHandler(); + DefaultCompensationErrorHandlerImpl defaultHandler = new DefaultCompensationErrorHandlerImpl(); assertThat(defaultHandler.handle("test", "step1", new RuntimeException("err"), 0)) .isEqualTo(CompensationErrorResult.CONTINUE); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/ExpandEachTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/ExpandEachTest.java index 5a48edda2..b0ef828a0 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/ExpandEachTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/ExpandEachTest.java @@ -50,7 +50,7 @@ class ExpandEachTest { void setUp() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); var orchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher); var compensator = new SagaCompensator(events, CompensationPolicy.STRICT_SEQUENTIAL, stepInvoker); engine = new SagaEngine(null, events, orchestrator, null, null, compensator, noOpPublisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/LayerConcurrencyTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/LayerConcurrencyTest.java index d3b482132..16f007b7d 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/LayerConcurrencyTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/LayerConcurrencyTest.java @@ -17,7 +17,7 @@ package org.fireflyframework.orchestration.unit.saga; import org.fireflyframework.orchestration.core.argument.ArgumentResolver; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.CompensationPolicy; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.step.StepHandler; @@ -54,7 +54,7 @@ class LayerConcurrencyTest { void setUp() { OrchestrationEvents events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var orchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher); var compensator = new SagaCompensator(events, CompensationPolicy.STRICT_SEQUENTIAL, stepInvoker); engine = new SagaEngine(null, events, orchestrator, null, null, compensator, noOpPublisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaCheckpointTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaCheckpointTest.java index 6f15d0c98..a682a2e00 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaCheckpointTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaCheckpointTest.java @@ -22,7 +22,7 @@ import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionPersistenceProvider; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepHandler; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.saga.builder.SagaBuilder; @@ -46,18 +46,18 @@ class SagaCheckpointTest { private OrchestrationEvents events; private StepInvoker stepInvoker; - private org.fireflyframework.orchestration.core.event.NoOpEventPublisher noOpPublisher; + private org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl noOpPublisher; @BeforeEach void setUp() { events = new OrchestrationEvents() {}; stepInvoker = new StepInvoker(new ArgumentResolver()); - noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); } @Test void checkpoint_savedAfterEachStepSuccess() { - InMemoryPersistenceProvider persistence = new InMemoryPersistenceProvider(); + InMemoryPersistenceProviderImpl persistence = new InMemoryPersistenceProviderImpl(); // Track how many times save is called AtomicInteger saveCount = new AtomicInteger(0); @@ -131,7 +131,7 @@ public Mono isHealthy() { @Test void checkpoint_containsCurrentStepResults() { List savedStates = new ArrayList<>(); - InMemoryPersistenceProvider persistence = new InMemoryPersistenceProvider(); + InMemoryPersistenceProviderImpl persistence = new InMemoryPersistenceProviderImpl(); ExecutionPersistenceProvider capturingPersistence = new ExecutionPersistenceProvider() { @Override diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaCompensationPolicyTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaCompensationPolicyTest.java index aedf04dea..be572a7c3 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaCompensationPolicyTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaCompensationPolicyTest.java @@ -48,7 +48,7 @@ class SagaCompensationPolicyTest { private SagaEngine createEngine(CompensationPolicy policy) { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); var orchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher); var compensator = new SagaCompensator(events, policy, stepInvoker); return new SagaEngine(null, events, orchestrator, null, null, compensator, noOpPublisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaEngineTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaEngineTest.java index e3e45023c..c3fd71b90 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaEngineTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaEngineTest.java @@ -49,7 +49,7 @@ class SagaEngineTest { void setUp() { events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); var orchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher); var compensator = new SagaCompensator(events, CompensationPolicy.STRICT_SEQUENTIAL, stepInvoker); engine = new SagaEngine(null, events, orchestrator, null, null, compensator, noOpPublisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaLifecycleCallbackTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaLifecycleCallbackTest.java index 0591ac3f5..24eb823ef 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaLifecycleCallbackTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaLifecycleCallbackTest.java @@ -18,7 +18,7 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.CompensationPolicy; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.step.StepHandler; @@ -46,7 +46,7 @@ class SagaLifecycleCallbackTest { private SagaEngine createEngine() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var orchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher); var compensator = new SagaCompensator(events, CompensationPolicy.STRICT_SEQUENTIAL, stepInvoker); return new SagaEngine(null, events, orchestrator, null, null, compensator, noOpPublisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaLifecycleResultInjectionTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaLifecycleResultInjectionTest.java index b78263d20..36d469690 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaLifecycleResultInjectionTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/saga/SagaLifecycleResultInjectionTest.java @@ -18,7 +18,7 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.CompensationPolicy; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.step.StepHandler; @@ -49,7 +49,7 @@ class SagaLifecycleResultInjectionTest { private SagaEngine createEngine() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var orchestrator = new SagaExecutionOrchestrator(stepInvoker, events, noOpPublisher); var compensator = new SagaCompensator(events, CompensationPolicy.STRICT_SEQUENTIAL, stepInvoker); return new SagaEngine(null, events, orchestrator, null, null, compensator, noOpPublisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccAdvancedTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccAdvancedTest.java index a57c6196a..9bb123602 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccAdvancedTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccAdvancedTest.java @@ -19,9 +19,9 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.context.TccPhase; import org.fireflyframework.orchestration.core.dlq.DeadLetterService; -import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStore; +import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStoreImpl; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.tcc.builder.TccBuilder; import org.fireflyframework.orchestration.tcc.engine.TccEngine; @@ -46,20 +46,20 @@ class TccAdvancedTest { private TccEngine engine; private TccEngine engineWithDlq; - private InMemoryDeadLetterStore dlqStore; + private InMemoryDeadLetterStoreImpl dlqStore; private OrchestrationEvents events; @BeforeEach void setUp() { events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); var orchestrator = new TccExecutionOrchestrator(stepInvoker, events, noOpPublisher); engine = new TccEngine(null, events, orchestrator, null, null, noOpPublisher); // Engine with DLQ and persistence - var persistence = new InMemoryPersistenceProvider(); - dlqStore = new InMemoryDeadLetterStore(); + var persistence = new InMemoryPersistenceProviderImpl(); + dlqStore = new InMemoryDeadLetterStoreImpl(); var dlqService = new DeadLetterService(dlqStore, events); engineWithDlq = new TccEngine(null, events, orchestrator, persistence, dlqService, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccCheckpointTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccCheckpointTest.java index a27966999..e01c38604 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccCheckpointTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccCheckpointTest.java @@ -21,7 +21,7 @@ import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionPersistenceProvider; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.tcc.builder.TccBuilder; import org.fireflyframework.orchestration.tcc.engine.TccEngine; @@ -42,17 +42,17 @@ class TccCheckpointTest { private OrchestrationEvents events; private StepInvoker stepInvoker; - private org.fireflyframework.orchestration.core.event.NoOpEventPublisher noOpPublisher; + private org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl noOpPublisher; @BeforeEach void setUp() { events = new OrchestrationEvents() {}; stepInvoker = new StepInvoker(new ArgumentResolver()); - noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); } private ExecutionPersistenceProvider capturingPersistence(List captured, - InMemoryPersistenceProvider delegate) { + InMemoryPersistenceProviderImpl delegate) { return new ExecutionPersistenceProvider() { @Override public Mono save(ExecutionState state) { @@ -97,7 +97,7 @@ public Mono isHealthy() { @Test void checkpoint_savedAfterTryPhase() { List savedStates = new ArrayList<>(); - InMemoryPersistenceProvider delegate = new InMemoryPersistenceProvider(); + InMemoryPersistenceProviderImpl delegate = new InMemoryPersistenceProviderImpl(); ExecutionPersistenceProvider persistence = capturingPersistence(savedStates, delegate); var orchestrator = new TccExecutionOrchestrator(stepInvoker, events, noOpPublisher, persistence); @@ -143,7 +143,7 @@ void checkpoint_savedAfterTryPhase() { @Test void checkpoint_savedAfterConfirmPhase() { List savedStates = new ArrayList<>(); - InMemoryPersistenceProvider delegate = new InMemoryPersistenceProvider(); + InMemoryPersistenceProviderImpl delegate = new InMemoryPersistenceProviderImpl(); ExecutionPersistenceProvider persistence = capturingPersistence(savedStates, delegate); var orchestrator = new TccExecutionOrchestrator(stepInvoker, events, noOpPublisher, persistence); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccEngineTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccEngineTest.java index 6448cd895..e200da47d 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccEngineTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccEngineTest.java @@ -45,7 +45,7 @@ class TccEngineTest { void setUp() { events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); var orchestrator = new TccExecutionOrchestrator(stepInvoker, events, noOpPublisher); // Use a null registry — we pass TccDefinition directly to engine engine = new TccEngine(null, events, orchestrator, null, null, noOpPublisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccJitterAndCheckpointTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccJitterAndCheckpointTest.java index a2064db26..4cb8096c3 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccJitterAndCheckpointTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccJitterAndCheckpointTest.java @@ -17,12 +17,12 @@ package org.fireflyframework.orchestration.unit.tcc; import org.fireflyframework.orchestration.core.argument.ArgumentResolver; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionPersistenceProvider; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.tcc.builder.TccBuilder; import org.fireflyframework.orchestration.tcc.engine.TccEngine; @@ -45,13 +45,13 @@ class TccJitterAndCheckpointTest { private OrchestrationEvents events; private StepInvoker stepInvoker; - private NoOpEventPublisher noOpPublisher; + private NoOpEventPublisherImpl noOpPublisher; @BeforeEach void setUp() { events = new OrchestrationEvents() {}; stepInvoker = new StepInvoker(new ArgumentResolver()); - noOpPublisher = new NoOpEventPublisher(); + noOpPublisher = new NoOpEventPublisherImpl(); } // --- Jitter field tests --- @@ -111,7 +111,7 @@ void builderSupportsJitterConfiguration() { // --- CANCELING checkpoint test --- private ExecutionPersistenceProvider capturingPersistence(List captured, - InMemoryPersistenceProvider delegate) { + InMemoryPersistenceProviderImpl delegate) { return new ExecutionPersistenceProvider() { @Override public Mono save(ExecutionState state) { @@ -157,7 +157,7 @@ public Mono isHealthy() { @Test void cancelPhaseWritesCancelingCheckpoint() { List savedStates = new ArrayList<>(); - InMemoryPersistenceProvider delegate = new InMemoryPersistenceProvider(); + InMemoryPersistenceProviderImpl delegate = new InMemoryPersistenceProviderImpl(); ExecutionPersistenceProvider persistence = capturingPersistence(savedStates, delegate); var orchestrator = new TccExecutionOrchestrator(stepInvoker, events, noOpPublisher, persistence); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccLifecycleCallbackTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccLifecycleCallbackTest.java index 29819f93b..da3a9094b 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccLifecycleCallbackTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccLifecycleCallbackTest.java @@ -18,7 +18,7 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.tcc.annotation.OnTccComplete; @@ -43,7 +43,7 @@ class TccLifecycleCallbackTest { private TccEngine createEngine() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var orchestrator = new TccExecutionOrchestrator(stepInvoker, events, noOpPublisher); return new TccEngine(null, events, orchestrator, null, null, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccLifecycleResultInjectionTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccLifecycleResultInjectionTest.java index 7ac8275ef..b61398b44 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccLifecycleResultInjectionTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccLifecycleResultInjectionTest.java @@ -18,7 +18,7 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.tcc.annotation.OnTccComplete; @@ -46,7 +46,7 @@ class TccLifecycleResultInjectionTest { private TccEngine createEngine() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var orchestrator = new TccExecutionOrchestrator(stepInvoker, events, noOpPublisher); return new TccEngine(null, events, orchestrator, null, null, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccRequiredPersistenceTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccRequiredPersistenceTest.java index b6445c6c0..25b5f1454 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccRequiredPersistenceTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccRequiredPersistenceTest.java @@ -18,7 +18,7 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.event.OrchestrationEvent; import org.fireflyframework.orchestration.core.event.OrchestrationEventPublisher; import org.fireflyframework.orchestration.core.exception.TccPersistenceException; @@ -26,7 +26,7 @@ import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.tcc.annotation.OnTccComplete; import org.fireflyframework.orchestration.tcc.annotation.OnTccError; @@ -287,14 +287,14 @@ void requiredNeedsProviderAndMatchingManualEngineOrchestratorPolicies() { assertThatIllegalArgumentException().isThrownBy(() -> new TccEngine(null, events, required, null, null, publisher, null, TccPersistenceMode.REQUIRED)); assertThatIllegalArgumentException().isThrownBy(() -> new TccEngine(null, events, required, - new InMemoryPersistenceProvider(), null, publisher, null, TccPersistenceMode.REQUIRED)); + new InMemoryPersistenceProviderImpl(), null, publisher, null, TccPersistenceMode.REQUIRED)); } @Test void existingConstructorsRemainBestEffortAndPermitAbsentCheckpointProvider() { var counts = new Counts(); var provider = new FailingProvider(1, false); - var oldOrchestrator = new TccExecutionOrchestrator(invoker, events, new NoOpEventPublisher()); + var oldOrchestrator = new TccExecutionOrchestrator(invoker, events, new NoOpEventPublisherImpl()); var oldEngine = new TccEngine(null, events, oldOrchestrator, provider, null, publisher); StepVerifier.create(oldEngine.execute(definition(counts, new Callbacks(), false, false), TccInputs.empty())) .assertNext(result -> assertThat(result.isConfirmed()).isTrue()).verifyComplete(); @@ -347,7 +347,7 @@ static class Callbacks { @OnTccError(suppressError = true) public void error() { error.incrementAndGet(); } } - static class FailingProvider extends InMemoryPersistenceProvider { + static class FailingProvider extends InMemoryPersistenceProviderImpl { final List attempted = new ArrayList<>(); final List accepted = new ArrayList<>(); final IllegalStateException cause = new IllegalStateException("private-provider-detail"); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccRetryEndToEndTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccRetryEndToEndTest.java index bf330c935..760847156 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccRetryEndToEndTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/tcc/TccRetryEndToEndTest.java @@ -17,7 +17,7 @@ package org.fireflyframework.orchestration.unit.tcc; import org.fireflyframework.orchestration.core.argument.ArgumentResolver; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.tcc.builder.TccBuilder; @@ -43,7 +43,7 @@ class TccRetryEndToEndTest { void setUp() { var events = new OrchestrationEvents() {}; var stepInvoker = new StepInvoker(new ArgumentResolver()); - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var orchestrator = new TccExecutionOrchestrator(stepInvoker, events, noOpPublisher); engine = new TccEngine(null, events, orchestrator, null, null, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/AsyncTriggerModeTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/AsyncTriggerModeTest.java index 756ffcfcd..4c7b16476 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/AsyncTriggerModeTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/AsyncTriggerModeTest.java @@ -19,12 +19,12 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.step.StepInvoker; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; import org.fireflyframework.orchestration.workflow.registry.WorkflowDefinition; @@ -48,15 +48,15 @@ class AsyncTriggerModeTest { private WorkflowEngine engine; private WorkflowRegistry registry; - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; @BeforeEach void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); - persistence = new InMemoryPersistenceProvider(); + persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/ChildWorkflowAnnotationTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/ChildWorkflowAnnotationTest.java index 6affc77f8..fc1ac353d 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/ChildWorkflowAnnotationTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/ChildWorkflowAnnotationTest.java @@ -19,7 +19,7 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionPattern; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; @@ -27,7 +27,7 @@ import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.workflow.child.ChildWorkflowResult; import org.fireflyframework.orchestration.workflow.child.ChildWorkflowService; @@ -53,14 +53,14 @@ class ChildWorkflowAnnotationTest { private OrchestrationEvents events; - private NoOpEventPublisher noOpPublisher; - private InMemoryPersistenceProvider persistence; + private NoOpEventPublisherImpl noOpPublisher; + private InMemoryPersistenceProviderImpl persistence; @BeforeEach void setUp() { events = new OrchestrationEvents() {}; - noOpPublisher = new NoOpEventPublisher(); - persistence = new InMemoryPersistenceProvider(); + noOpPublisher = new NoOpEventPublisherImpl(); + persistence = new InMemoryPersistenceProviderImpl(); } @SuppressWarnings("unused") diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/CompensationStepAnnotationTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/CompensationStepAnnotationTest.java index f0ab7b886..4671bbf95 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/CompensationStepAnnotationTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/CompensationStepAnnotationTest.java @@ -18,12 +18,12 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.workflow.annotation.CompensationStep; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; @@ -58,10 +58,10 @@ class CompensationStepAnnotationTest { void setUp() { registry = new WorkflowRegistry(); events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/NamedTimerWiringTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/NamedTimerWiringTest.java index effe5b719..b00a2ea3d 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/NamedTimerWiringTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/NamedTimerWiringTest.java @@ -19,12 +19,12 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; @@ -59,11 +59,11 @@ public Mono step1(@Input Map input) { void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); timerService = new TimerService(events); var stepInvoker = new StepInvoker(new ArgumentResolver()); var executor = new WorkflowExecutor(stepInvoker, events, noOpPublisher, null, timerService); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, stepInvoker, persistence, events, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/SignalServiceTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/SignalServiceTest.java index 67d7ea02e..6f48cdcb3 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/SignalServiceTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/SignalServiceTest.java @@ -20,7 +20,7 @@ import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.signal.SignalService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -34,11 +34,11 @@ class SignalServiceTest { private SignalService signalService; - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; @BeforeEach void setUp() { - persistence = new InMemoryPersistenceProvider(); + persistence = new InMemoryPersistenceProviderImpl(); signalService = new SignalService(persistence, new OrchestrationEvents() {}); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/SuppressErrorLogicTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/SuppressErrorLogicTest.java index 1eae5210e..5029bfc94 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/SuppressErrorLogicTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/SuppressErrorLogicTest.java @@ -19,12 +19,12 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.step.StepInvoker; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.annotation.OnWorkflowError; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; @@ -46,15 +46,15 @@ class SuppressErrorLogicTest { private WorkflowEngine engine; private WorkflowRegistry registry; - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; @BeforeEach void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); - persistence = new InMemoryPersistenceProvider(); + persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WaitForAllTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WaitForAllTest.java index d755323f7..9ff76835f 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WaitForAllTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WaitForAllTest.java @@ -18,12 +18,12 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.workflow.annotation.WaitForSignal; import org.fireflyframework.orchestration.workflow.annotation.WaitForTimer; @@ -55,7 +55,7 @@ class WaitForAllTest { private WorkflowEngine engine; private WorkflowRegistry registry; - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; private SignalService signalService; private TimerService timerService; private OrchestrationEvents events; @@ -64,8 +64,8 @@ class WaitForAllTest { void setUp() { registry = new WorkflowRegistry(); events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); - persistence = new InMemoryPersistenceProvider(); + var noOpPublisher = new NoOpEventPublisherImpl(); + persistence = new InMemoryPersistenceProviderImpl(); signalService = new SignalService(persistence, events); timerService = new TimerService(events); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WaitForAnyTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WaitForAnyTest.java index 13fbe3f05..0282cb704 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WaitForAnyTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WaitForAnyTest.java @@ -18,12 +18,12 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.workflow.annotation.WaitForSignal; import org.fireflyframework.orchestration.workflow.annotation.WaitForTimer; @@ -55,7 +55,7 @@ class WaitForAnyTest { private WorkflowEngine engine; private WorkflowRegistry registry; - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; private SignalService signalService; private TimerService timerService; private OrchestrationEvents events; @@ -64,8 +64,8 @@ class WaitForAnyTest { void setUp() { registry = new WorkflowRegistry(); events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); - persistence = new InMemoryPersistenceProvider(); + var noOpPublisher = new NoOpEventPublisherImpl(); + persistence = new InMemoryPersistenceProviderImpl(); signalService = new SignalService(persistence, events); timerService = new TimerService(events); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowCheckpointTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowCheckpointTest.java index 01d715873..68e02080b 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowCheckpointTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowCheckpointTest.java @@ -19,7 +19,7 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionPattern; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; @@ -28,7 +28,7 @@ import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionPersistenceProvider; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; @@ -70,10 +70,10 @@ public Mono step2(@Input Map input) { void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var stepInvoker = new StepInvoker(new ArgumentResolver()); - mockPersistence = spy(new InMemoryPersistenceProvider()); + mockPersistence = spy(new InMemoryPersistenceProviderImpl()); var executor = new WorkflowExecutor(stepInvoker, events, noOpPublisher, null, null, mockPersistence); engine = new WorkflowEngine(registry, executor, stepInvoker, mockPersistence, events, noOpPublisher); @@ -116,12 +116,12 @@ void checkpoint_savedAfterEachStep() throws Exception { void checkpoint_nullPersistence_noError() throws Exception { // Create executor without persistence (null) — should still work var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var stepInvoker = new StepInvoker(new ArgumentResolver()); var noPersistenceExecutor = new WorkflowExecutor(stepInvoker, events, noOpPublisher, null, null); var noPersistenceRegistry = new WorkflowRegistry(); - var inMemoryPersistence = new InMemoryPersistenceProvider(); + var inMemoryPersistence = new InMemoryPersistenceProviderImpl(); var noPersistenceEngine = new WorkflowEngine(noPersistenceRegistry, noPersistenceExecutor, stepInvoker, inMemoryPersistence, events, noOpPublisher); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowCompensationTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowCompensationTest.java index 52a38dbee..1205b417b 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowCompensationTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowCompensationTest.java @@ -19,12 +19,12 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.step.StepInvoker; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; import org.fireflyframework.orchestration.workflow.registry.WorkflowDefinition; @@ -52,9 +52,9 @@ class WorkflowCompensationTest { void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher); } @@ -315,10 +315,10 @@ void compensationEmitsObservabilityEvents() throws Exception { } }; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), trackingEvents, noOpPublisher, null, null); var localRegistry = new WorkflowRegistry(); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var localEngine = new WorkflowEngine(localRegistry, executor, new StepInvoker(new ArgumentResolver()), persistence, trackingEvents, noOpPublisher); var bean = new CompensatableStepsBean(); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowConditionAsyncTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowConditionAsyncTest.java index 571f39c22..2b39c6c48 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowConditionAsyncTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowConditionAsyncTest.java @@ -20,13 +20,13 @@ import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.StepStatus; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; import org.fireflyframework.orchestration.workflow.registry.WorkflowDefinition; @@ -54,9 +54,9 @@ class WorkflowConditionAsyncTest { void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowDlqTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowDlqTest.java index ad41521cd..e37e78d90 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowDlqTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowDlqTest.java @@ -19,14 +19,14 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.dlq.DeadLetterService; -import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStore; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.dlq.InMemoryDeadLetterStoreImpl; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionPattern; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; @@ -47,16 +47,16 @@ class WorkflowDlqTest { private WorkflowEngine engine; private WorkflowRegistry registry; - private InMemoryDeadLetterStore dlqStore; + private InMemoryDeadLetterStoreImpl dlqStore; @BeforeEach void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); - var persistence = new InMemoryPersistenceProvider(); - dlqStore = new InMemoryDeadLetterStore(); + var persistence = new InMemoryPersistenceProviderImpl(); + dlqStore = new InMemoryDeadLetterStoreImpl(); var dlqService = new DeadLetterService(dlqStore, events); engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher, dlqService); } @@ -102,9 +102,9 @@ void failedWorkflowIsSavedToDlq() throws Exception { void failedWorkflowWithNoDlqServiceDoesNotFail() throws Exception { // Create engine WITHOUT DLQ service var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var noDlqEngine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher); var testSteps = new FailingSteps(); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowDryRunEndToEndTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowDryRunEndToEndTest.java index 5687614e1..87c0b3b25 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowDryRunEndToEndTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowDryRunEndToEndTest.java @@ -18,13 +18,13 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.StepStatus; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; @@ -70,10 +70,10 @@ void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var stepInvoker = new StepInvoker(new ArgumentResolver()); var executor = new WorkflowExecutor(stepInvoker, events, noOpPublisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, stepInvoker, persistence, events, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowEngineTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowEngineTest.java index 404fed4a2..79a2fb1f0 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowEngineTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowEngineTest.java @@ -23,7 +23,7 @@ import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; import org.fireflyframework.orchestration.workflow.registry.WorkflowDefinition; @@ -43,15 +43,15 @@ class WorkflowEngineTest { private WorkflowEngine engine; private WorkflowRegistry registry; - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; @BeforeEach void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); - persistence = new InMemoryPersistenceProvider(); + persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowLayerConcurrencyTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowLayerConcurrencyTest.java index 2bb641eac..a07601641 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowLayerConcurrencyTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowLayerConcurrencyTest.java @@ -18,10 +18,10 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.*; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; @@ -58,9 +58,9 @@ public Mono step(@Input Map input) { void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowLifecycleCallbackTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowLifecycleCallbackTest.java index 98b0a720c..6a2c10443 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowLifecycleCallbackTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowLifecycleCallbackTest.java @@ -19,12 +19,12 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.step.StepInvoker; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.annotation.OnStepComplete; import org.fireflyframework.orchestration.workflow.annotation.OnWorkflowComplete; import org.fireflyframework.orchestration.workflow.annotation.OnWorkflowError; @@ -56,15 +56,15 @@ class WorkflowLifecycleCallbackTest { private WorkflowEngine engine; private WorkflowRegistry registry; - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; @BeforeEach void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); - persistence = new InMemoryPersistenceProvider(); + persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowOrderTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowOrderTest.java index 5702780dd..c2f70837e 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowOrderTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowOrderTest.java @@ -19,12 +19,12 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.context.ExecutionContext; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; @@ -57,10 +57,10 @@ public Mono step(@Input Map input) { void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); + var noOpPublisher = new NoOpEventPublisherImpl(); var stepInvoker = new StepInvoker(new ArgumentResolver()); var executor = new WorkflowExecutor(stepInvoker, events, noOpPublisher, null, null); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, stepInvoker, persistence, events, noOpPublisher); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowQueryAnnotationTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowQueryAnnotationTest.java index 4d829aec1..825390db0 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowQueryAnnotationTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowQueryAnnotationTest.java @@ -23,7 +23,7 @@ import org.fireflyframework.orchestration.core.model.StepStatus; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.annotation.WorkflowQuery; import org.fireflyframework.orchestration.workflow.query.WorkflowQueryService; import org.fireflyframework.orchestration.workflow.registry.WorkflowDefinition; @@ -45,13 +45,13 @@ */ class WorkflowQueryAnnotationTest { - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; private WorkflowRegistry registry; private WorkflowQueryService queryService; @BeforeEach void setUp() { - persistence = new InMemoryPersistenceProvider(); + persistence = new InMemoryPersistenceProviderImpl(); registry = new WorkflowRegistry(); } diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowQueryServiceTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowQueryServiceTest.java index 474f9ddfe..e90d85694 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowQueryServiceTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowQueryServiceTest.java @@ -20,7 +20,7 @@ import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.StepStatus; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.query.WorkflowQueryService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -34,11 +34,11 @@ class WorkflowQueryServiceTest { private WorkflowQueryService queryService; - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; @BeforeEach void setUp() { - persistence = new InMemoryPersistenceProvider(); + persistence = new InMemoryPersistenceProviderImpl(); queryService = new WorkflowQueryService(persistence); var state = new ExecutionState("wf-1", "order-wf", ExecutionPattern.WORKFLOW, diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowSignalTimerTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowSignalTimerTest.java index 2ea39bf73..b265e409b 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowSignalTimerTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowSignalTimerTest.java @@ -19,13 +19,13 @@ import org.fireflyframework.orchestration.core.argument.ArgumentResolver; import org.fireflyframework.orchestration.core.argument.Input; import org.fireflyframework.orchestration.core.step.StepInvoker; -import org.fireflyframework.orchestration.core.event.NoOpEventPublisher; +import org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl; import org.fireflyframework.orchestration.core.model.ExecutionStatus; import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; import org.fireflyframework.orchestration.workflow.registry.WorkflowDefinition; @@ -54,7 +54,7 @@ class WorkflowSignalTimerTest { private WorkflowEngine engine; private WorkflowRegistry registry; - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; private SignalService signalService; private TimerService timerService; private OrchestrationEvents events; @@ -63,8 +63,8 @@ class WorkflowSignalTimerTest { void setUp() { registry = new WorkflowRegistry(); events = new OrchestrationEvents() {}; - var noOpPublisher = new NoOpEventPublisher(); - persistence = new InMemoryPersistenceProvider(); + var noOpPublisher = new NoOpEventPublisherImpl(); + persistence = new InMemoryPersistenceProviderImpl(); signalService = new SignalService(persistence, events); timerService = new TimerService(events); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowStepFailureEventTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowStepFailureEventTest.java index 2f3f3e56d..fbcf680ee 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowStepFailureEventTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowStepFailureEventTest.java @@ -24,7 +24,7 @@ import org.fireflyframework.orchestration.core.model.RetryPolicy; import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.core.step.StepInvoker; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; @@ -61,7 +61,7 @@ void stepFailurePublishesEventViaPublisher() throws Exception { var events = new OrchestrationEvents() {}; var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, trackingPublisher, null, null); var registry = new WorkflowRegistry(); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, trackingPublisher); var bean = new FailingBean(); @@ -102,7 +102,7 @@ void stepFailureDoesNotPublishWhenPublishEventsDisabled() throws Exception { var events = new OrchestrationEvents() {}; var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, trackingPublisher, null, null); var registry = new WorkflowRegistry(); - var persistence = new InMemoryPersistenceProvider(); + var persistence = new InMemoryPersistenceProviderImpl(); var engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, trackingPublisher); var bean = new FailingBean(); diff --git a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowSuspendResumeTest.java b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowSuspendResumeTest.java index c27e776eb..79fb98016 100644 --- a/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowSuspendResumeTest.java +++ b/modules/orchestration/src/test/java/org/fireflyframework/orchestration/unit/workflow/WorkflowSuspendResumeTest.java @@ -25,7 +25,7 @@ import org.fireflyframework.orchestration.core.model.TriggerMode; import org.fireflyframework.orchestration.core.observability.OrchestrationEvents; import org.fireflyframework.orchestration.core.persistence.ExecutionState; -import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProvider; +import org.fireflyframework.orchestration.core.persistence.InMemoryPersistenceProviderImpl; import org.fireflyframework.orchestration.workflow.engine.WorkflowEngine; import org.fireflyframework.orchestration.workflow.engine.WorkflowExecutor; import org.fireflyframework.orchestration.workflow.registry.WorkflowDefinition; @@ -51,7 +51,7 @@ class WorkflowSuspendResumeTest { private WorkflowEngine engine; private WorkflowRegistry registry; - private InMemoryPersistenceProvider persistence; + private InMemoryPersistenceProviderImpl persistence; @SuppressWarnings("unused") public static class TestSteps { @@ -67,9 +67,9 @@ public Mono step2(@Input Map input) { void setUp() { registry = new WorkflowRegistry(); var events = new OrchestrationEvents() {}; - var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisher(); + var noOpPublisher = new org.fireflyframework.orchestration.core.event.NoOpEventPublisherImpl(); var executor = new WorkflowExecutor(new StepInvoker(new ArgumentResolver()), events, noOpPublisher, null, null); - persistence = new InMemoryPersistenceProvider(); + persistence = new InMemoryPersistenceProviderImpl(); engine = new WorkflowEngine(registry, executor, new StepInvoker(new ArgumentResolver()), persistence, events, noOpPublisher); } diff --git a/modules/plugins/README.md b/modules/plugins/README.md index 8eb6d9dec..36151cdda 100644 --- a/modules/plugins/README.md +++ b/modules/plugins/README.md @@ -96,9 +96,9 @@ public class StripePlugin implements org.fireflyframework.plugin.api.Plugin { ```java import org.fireflyframework.plugin.api.ExtensionRegistry; import org.fireflyframework.plugin.api.PluginManager; -import org.fireflyframework.plugin.core.DefaultPluginManager; +import org.fireflyframework.plugin.core.DefaultPluginManagerImpl; -PluginManager manager = new DefaultPluginManager(); +PluginManager manager = new DefaultPluginManagerImpl(); manager.initialize(); ExtensionRegistry registry = manager.getExtensionRegistry(); diff --git a/modules/plugins/VERIFICATION.md b/modules/plugins/VERIFICATION.md index e82146b3a..97415a479 100644 --- a/modules/plugins/VERIFICATION.md +++ b/modules/plugins/VERIFICATION.md @@ -32,8 +32,8 @@ This retained report records verification of the earlier plugin build and artifa #### Plugin Core Module (`plugin-core`) - ✅ **Implementations** (3): - - `DefaultPluginManager` - Full plugin lifecycle management - - `DefaultExtensionRegistry` - Thread-safe extension registry + - `DefaultPluginManagerImpl` - Full plugin lifecycle management + - `DefaultExtensionRegistryImpl` - Thread-safe extension registry - `PluginDependencyResolver` - Topological sort-based dependency resolution --- diff --git a/modules/plugins/plugin-core/README.md b/modules/plugins/plugin-core/README.md index 8be9ee6fb..645dac85e 100644 --- a/modules/plugins/plugin-core/README.md +++ b/modules/plugins/plugin-core/README.md @@ -4,7 +4,7 @@ Load plugins, resolve dependencies, and manage extension registration in a host process. -Create DefaultPluginManager for the host and use the plugin-api contracts for lifecycle operations. Inspect dependency-resolution and lifecycle tests before changing load/start order or unloading extensions still used by the host. +Create DefaultPluginManagerImpl for the host and use the plugin-api contracts for lifecycle operations. Inspect dependency-resolution and lifecycle tests before changing load/start order or unloading extensions still used by the host. [Module guide](../../../docs/site/modules/plugin-core.md) · [Jafly README](../../../README.md) · [Module catalog](../../../docs/site/modules/index.md) @@ -31,7 +31,7 @@ The Java examples in this section are API fragments for application code. Use th The host can use the concrete implementation with the API lifecycle operations: ```java -PluginManager manager = new DefaultPluginManager(); +PluginManager manager = new DefaultPluginManagerImpl(); manager.initialize(); PluginDescriptor descriptor = manager.loadPlugin(MyPlugin.class); manager.startPlugin(descriptor.getId()); @@ -39,7 +39,7 @@ manager.startPlugin(descriptor.getId()); manager.shutdown(); ``` -Import `DefaultPluginManager` from `org.fireflyframework.plugin.core` and the API/model types from `plugin-api`. `MyPlugin` is an application implementation with a no-argument constructor, as required by the loader. The default manager owns an extension registry and dependency resolver; an alternate `ExtensionRegistry` can be supplied through its constructor. +Import `DefaultPluginManagerImpl` from `org.fireflyframework.plugin.core` and the API/model types from `plugin-api`. `MyPlugin` is an application implementation with a no-argument constructor, as required by the loader. The default manager owns an extension registry and dependency resolver; an alternate `ExtensionRegistry` can be supplied through its constructor. ## Configuration @@ -49,8 +49,8 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`DefaultPluginManager`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManager.java) | Default implementation of PluginManager. | -| [`DefaultExtensionRegistry`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistry.java) | Thread-safe implementation of ExtensionRegistry. | +| [`DefaultPluginManagerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManagerImpl.java) | Default implementation of PluginManager. | +| [`DefaultExtensionRegistryImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistryImpl.java) | Thread-safe implementation of ExtensionRegistry. | | [`PluginDependencyResolver`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/PluginDependencyResolver.java) | Resolves plugin dependencies and determines the correct loading order. | ## Continue the application diff --git a/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistry.java b/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistryImpl.java similarity index 98% rename from modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistry.java rename to modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistryImpl.java index 0113d32af..7cb299f26 100644 --- a/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistry.java +++ b/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultExtensionRegistryImpl.java @@ -28,9 +28,9 @@ * Thread-safe implementation of ExtensionRegistry. * Uses concurrent data structures for safe concurrent access. */ -public class DefaultExtensionRegistry implements ExtensionRegistry { +public class DefaultExtensionRegistryImpl implements ExtensionRegistry { - private static final Logger log = LoggerFactory.getLogger(DefaultExtensionRegistry.class); + private static final Logger log = LoggerFactory.getLogger(DefaultExtensionRegistryImpl.class); private final Map> extensionPoints = new ConcurrentHashMap<>(); private final Map>> extensions = new ConcurrentHashMap<>(); diff --git a/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManager.java b/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManagerImpl.java similarity index 97% rename from modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManager.java rename to modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManagerImpl.java index c7b3a71e4..d03a08fbf 100644 --- a/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManager.java +++ b/modules/plugins/plugin-core/src/main/java/org/fireflyframework/plugin/core/DefaultPluginManagerImpl.java @@ -33,9 +33,9 @@ * Default implementation of PluginManager. * Manages the complete lifecycle of plugins including loading, starting, stopping, and unloading. */ -public class DefaultPluginManager implements PluginManager { +public class DefaultPluginManagerImpl implements PluginManager { - private static final Logger log = LoggerFactory.getLogger(DefaultPluginManager.class); + private static final Logger log = LoggerFactory.getLogger(DefaultPluginManagerImpl.class); private final Map plugins = new ConcurrentHashMap<>(); private final Map descriptors = new ConcurrentHashMap<>(); @@ -44,12 +44,12 @@ public class DefaultPluginManager implements PluginManager { private boolean initialized = false; - public DefaultPluginManager() { - this.extensionRegistry = new DefaultExtensionRegistry(); + public DefaultPluginManagerImpl() { + this.extensionRegistry = new DefaultExtensionRegistryImpl(); this.dependencyResolver = new PluginDependencyResolver(); } - public DefaultPluginManager(ExtensionRegistry extensionRegistry) { + public DefaultPluginManagerImpl(ExtensionRegistry extensionRegistry) { this.extensionRegistry = extensionRegistry; this.dependencyResolver = new PluginDependencyResolver(); } diff --git a/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/core/DefaultExtensionRegistryTest.java b/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/core/DefaultExtensionRegistryTest.java index f75d06089..fae0495ec 100644 --- a/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/core/DefaultExtensionRegistryTest.java +++ b/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/core/DefaultExtensionRegistryTest.java @@ -10,7 +10,7 @@ class DefaultExtensionRegistryTest { - private DefaultExtensionRegistry registry; + private DefaultExtensionRegistryImpl registry; // Test extension point interface interface TestExtensionPoint { @@ -41,7 +41,7 @@ public String process() { @BeforeEach void setUp() { - registry = new DefaultExtensionRegistry(); + registry = new DefaultExtensionRegistryImpl(); } @Test diff --git a/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/core/DefaultPluginManagerTest.java b/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/core/DefaultPluginManagerTest.java index 27295d003..05757018e 100644 --- a/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/core/DefaultPluginManagerTest.java +++ b/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/core/DefaultPluginManagerTest.java @@ -17,7 +17,7 @@ class DefaultPluginManagerTest { - private DefaultPluginManager pluginManager; + private DefaultPluginManagerImpl pluginManager; // Test extension point interface TestExtensionPoint { @@ -178,7 +178,7 @@ public void destroy() {} @BeforeEach void setUp() throws PluginException { - pluginManager = new DefaultPluginManager(); + pluginManager = new DefaultPluginManagerImpl(); pluginManager.initialize(); } diff --git a/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/integration/PluginSystemIntegrationTest.java b/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/integration/PluginSystemIntegrationTest.java index ab36e74c1..3a79aa139 100644 --- a/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/integration/PluginSystemIntegrationTest.java +++ b/modules/plugins/plugin-core/src/test/java/org/fireflyframework/plugin/integration/PluginSystemIntegrationTest.java @@ -5,7 +5,7 @@ import org.fireflyframework.plugin.api.Plugin; import org.fireflyframework.plugin.api.PluginException; import org.fireflyframework.plugin.api.PluginManager; -import org.fireflyframework.plugin.core.DefaultPluginManager; +import org.fireflyframework.plugin.core.DefaultPluginManagerImpl; import org.fireflyframework.plugin.model.PluginDescriptor; import org.fireflyframework.plugin.model.PluginMetadata; import org.fireflyframework.plugin.model.PluginState; @@ -185,7 +185,7 @@ public int getPriority() { @BeforeEach void setUp() throws PluginException { - pluginManager = new DefaultPluginManager(); + pluginManager = new DefaultPluginManagerImpl(); pluginManager.initialize(); } diff --git a/modules/r2dbc/README.md b/modules/r2dbc/README.md index f446f254c..313ff35cf 100644 --- a/modules/r2dbc/README.md +++ b/modules/r2dbc/README.md @@ -44,13 +44,13 @@ spring: ### Optional UTC auditing -For `LocalDateTime`, `OffsetDateTime`, and `Instant` audit fields, expose `new org.fireflyframework.core.auditing.UtcOffsetDateTimeProvider(Clock.systemUTC())` as a `DateTimeProvider` bean and select its name with `@EnableR2dbcAuditing(dateTimeProviderRef = "yourBeanName")`. The injected clock is normalized to UTC. Spring Data retains create/update, immutable entity, and auditing flag behavior. This helper is opt-in; it does not enable auditing or register a bean automatically. Legacy `Date` and `Long` audit fields are unsupported by this provider. +For `LocalDateTime`, `OffsetDateTime`, and `Instant` audit fields, expose `new org.fireflyframework.core.auditing.UtcOffsetDateTimeProviderImpl(Clock.systemUTC())` as a `DateTimeProvider` bean and select its name with `@EnableR2dbcAuditing(dateTimeProviderRef = "yourBeanName")`. The injected clock is normalized to UTC. Spring Data retains create/update, immutable entity, and auditing flag behavior. This helper is opt-in; it does not enable auditing or register a bean automatically. Legacy `Date` and `Long` audit fields are unsupported by this provider. ### Opt-in bounded root transactions -The source tree provides `BoundedRootTransaction` and `impl.DefaultBoundedRootTransaction` for an application-owned R2DBC transaction with a finite operation budget. Use a source build containing these classes until the corresponding release is published. This API does not register beans or change the default transaction manager. +The source tree provides `BoundedRootTransaction` and `impl.DefaultBoundedRootTransactionImpl` for an application-owned R2DBC transaction with a finite operation budget. Use a source build containing these classes until the corresponding release is published. This API does not register beans or change the default transaction manager. -Build one `OwnedLeaseConnectionFactory` around the application connection factory, then construct the actual `DatabaseClient`, customized `R2dbcEntityTemplate`, Spring Data repositories, and `R2dbcTransactionManager` with that same wrapper. `BoundedR2dbcResources.verify` checks the factory/client/template/manager identities; preserve the host converter, callbacks, and repository configuration. The helper refuses an ambient transaction rather than joining another owner's work. It owns individual acquired leases and never closes the application pool. +Build one `OwnedLeaseConnectionFactoryImpl` around the application connection factory, then construct the actual `DatabaseClient`, customized `R2dbcEntityTemplate`, Spring Data repositories, and `R2dbcTransactionManager` with that same wrapper. `BoundedR2dbcResources.verify` checks the factory/client/template/manager identities; preserve the host converter, callbacks, and repository configuration. The helper refuses an ambient transaction rather than joining another owner's work. It owns individual acquired leases and never closes the application pool. Capture the monotonic anchor before obtaining an original observation. Pass its original observation time, absolute expiration, explicit maximum duration, clock, and the same monotonic supplier to `R2dbcOperationBudget.observed`. Execute with a `PROPAGATION_REQUIRED` transaction definition and return one result; other propagation modes are refused. Compose an already observed dependency limit with `original.intersect(inherited)` before passing the budget to `execute`, so connection acquisition and transaction begin use the earlier bound. Use `RootTransactionScope.narrow` when a later native observation or dependency imposes an earlier bound. Original and narrowed budgets must share the identical `Clock` object and monotonic supplier. Budget checks include acquisition, transaction completion, and final cleanup; an expired budget does not grant a fresh timeout. Configure rollback and close limits separately with `CleanupPolicy`. diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataCompletedAuditAppendService.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataCompletedAuditAppendServiceImpl.java similarity index 94% rename from modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataCompletedAuditAppendService.java rename to modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataCompletedAuditAppendServiceImpl.java index db67168bf..7aacb674c 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataCompletedAuditAppendService.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataCompletedAuditAppendServiceImpl.java @@ -17,13 +17,13 @@ import reactor.core.publisher.Mono; /** Read-only mapped verification on the retained graph, with no automatic bean or repository fallback. */ -public final class SpringDataCompletedAuditAppendService implements CompletedAuditAppendService { +public final class SpringDataCompletedAuditAppendServiceImpl implements CompletedAuditAppendService { private final BoundedR2dbcResources original; private final BoundedR2dbcResources resources; private final AuditCompletedAppendRepository repository; private final Clock clock; private final LongSupplier nanos; - public SpringDataCompletedAuditAppendService(BoundedR2dbcResources original,DatabaseClient client, + public SpringDataCompletedAuditAppendServiceImpl(BoundedR2dbcResources original,DatabaseClient client, R2dbcEntityTemplate template,R2dbcTransactionManager manager,Clock clock,LongSupplier nanos) { this.original=Objects.requireNonNull(original); this.resources=BoundedR2dbcResources.verify(original.factory(),client,template,manager); diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataLocalAuditRepository.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataLocalAuditRepositoryImpl.java similarity index 92% rename from modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataLocalAuditRepository.java rename to modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataLocalAuditRepositoryImpl.java index e537b1c6f..acf92719b 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataLocalAuditRepository.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataLocalAuditRepositoryImpl.java @@ -28,10 +28,10 @@ import reactor.core.publisher.Mono; /** Actual mapped statements/counts. Failures propagate; never continue on an aborted duplicate. */ -public final class SpringDataLocalAuditRepository implements LocalAuditRepository { +public final class SpringDataLocalAuditRepositoryImpl implements LocalAuditRepository { private final R2dbcEntityTemplate template; private final BoundedR2dbcResources resources; - public SpringDataLocalAuditRepository(BoundedR2dbcResources resources,DatabaseClient client,R2dbcEntityTemplate template,R2dbcTransactionManager manager){this.resources=BoundedR2dbcResources.verify(Objects.requireNonNull(resources).factory(),client,template,manager);this.template=template;} + public SpringDataLocalAuditRepositoryImpl(BoundedR2dbcResources resources,DatabaseClient client,R2dbcEntityTemplate template,R2dbcTransactionManager manager){this.resources=BoundedR2dbcResources.verify(Objects.requireNonNull(resources).factory(),client,template,manager);this.template=template;} @Override public Mono head(RootTransactionScope owner,AuditStream stream){return transaction(owner,()->template.select(AuditRows.Head.class).matching(Query.query(scope(stream))).one().map(AuditRows.Head::checkpoint).defaultIfEmpty(AuditCheckpoint.genesis(stream)));} @Override public Mono find(RootTransactionScope owner,UUID tenant,UUID event){return transaction(owner,()->{ var query=Query.query(Criteria.where("resourceTenantId").is(tenant).and("eventId").is(event)); diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataTransactionalAuditAppender.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataTransactionalAuditAppenderImpl.java similarity index 91% rename from modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataTransactionalAuditAppender.java rename to modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataTransactionalAuditAppenderImpl.java index 06cdf5655..9adba5cb1 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataTransactionalAuditAppender.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/audit/impl/SpringDataTransactionalAuditAppenderImpl.java @@ -28,16 +28,16 @@ import reactor.core.publisher.Mono; /** Opt-in real mapped append/native clock; never creates an inner root or treats claims as grants. */ -public final class SpringDataTransactionalAuditAppender implements TransactionalAuditAppender { +public final class SpringDataTransactionalAuditAppenderImpl implements TransactionalAuditAppender { private final BoundedR2dbcResources resources; private final LocalAuditRepository repository; private final AuditNativeContextRepository nativeContext; private final AuditAppendAuthority authority; private final Clock clock;private final LongSupplier nanos;private final Supplier nonces; - public SpringDataTransactionalAuditAppender(BoundedR2dbcResources resources,DatabaseClient client,R2dbcEntityTemplate template,R2dbcTransactionManager manager,AuditAppendAuthority authority,Clock clock,LongSupplier nanos,Supplier nonces){ + public SpringDataTransactionalAuditAppenderImpl(BoundedR2dbcResources resources,DatabaseClient client,R2dbcEntityTemplate template,R2dbcTransactionManager manager,AuditAppendAuthority authority,Clock clock,LongSupplier nanos,Supplier nonces){ this.resources=BoundedR2dbcResources.verify(Objects.requireNonNull(resources).factory(),client,template,manager); this.authority=Objects.requireNonNull(authority);this.clock=Objects.requireNonNull(clock);this.nanos=Objects.requireNonNull(nanos);this.nonces=Objects.requireNonNull(nonces); - repository=new SpringDataLocalAuditRepository(this.resources,client,template,manager);nativeContext=new R2dbcRepositoryFactory(template).getRepository(AuditNativeContextRepository.class); + repository=new SpringDataLocalAuditRepositoryImpl(this.resources,client,template,manager);nativeContext=new R2dbcRepositoryFactory(template).getRepository(AuditNativeContextRepository.class); } @Override public Mono append(RootTransactionScope scope,AuditEvent event){return Mono.defer(()->resources.factory().requireBoundScope(resources,scope).then(Mono.defer(()->{ Objects.requireNonNull(event);scope.remaining(); diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProvider.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProviderImpl.java similarity index 83% rename from modules/r2dbc/src/main/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProvider.java rename to modules/r2dbc/src/main/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProviderImpl.java index f87294327..491106812 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProvider.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProviderImpl.java @@ -12,10 +12,10 @@ * Opt-in UTC time source for Spring Data auditing of LocalDateTime, * OffsetDateTime, and Instant fields. Date and Long fields are unsupported. */ -public final class UtcOffsetDateTimeProvider implements DateTimeProvider { +public final class UtcOffsetDateTimeProviderImpl implements DateTimeProvider { private final Clock clock; - public UtcOffsetDateTimeProvider(Clock clock) { + public UtcOffsetDateTimeProviderImpl(Clock clock) { this.clock = Objects.requireNonNull(clock, "clock").withZone(ZoneOffset.UTC); } diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/config/SwaggerAutoConfiguration.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/config/SwaggerAutoConfiguration.java index f84655758..dadc49eac 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/config/SwaggerAutoConfiguration.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/config/SwaggerAutoConfiguration.java @@ -1,6 +1,6 @@ package org.fireflyframework.core.config; -import org.fireflyframework.core.filters.FilterParameterCustomizer; +import org.fireflyframework.core.filters.FilterParameterCustomizerImpl; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -9,7 +9,7 @@ public class SwaggerAutoConfiguration { @ConditionalOnMissingBean @Bean - public FilterParameterCustomizer filterParameterCustomizer() { - return new FilterParameterCustomizer(); + public FilterParameterCustomizerImpl filterParameterCustomizer() { + return new FilterParameterCustomizerImpl(); } } \ No newline at end of file diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/filters/FilterParameterCustomizer.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/filters/FilterParameterCustomizerImpl.java similarity index 99% rename from modules/r2dbc/src/main/java/org/fireflyframework/core/filters/FilterParameterCustomizer.java rename to modules/r2dbc/src/main/java/org/fireflyframework/core/filters/FilterParameterCustomizerImpl.java index 771f9d141..9ef0a6be1 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/filters/FilterParameterCustomizer.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/filters/FilterParameterCustomizerImpl.java @@ -62,14 +62,14 @@ *
  • Collection/Array filtering: Fields of type Collection or array will be filtered using the IN operator
  • * */ -@Component -public class FilterParameterCustomizer implements OperationCustomizer { +@Component("filterParameterCustomizer") +public class FilterParameterCustomizerImpl implements OperationCustomizer { /** * Default constructor. *

    Avoids Javadoc warnings about missing comments.

    */ - public FilterParameterCustomizer() { + public FilterParameterCustomizerImpl() { // Default constructor intentionally left blank } diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcHealthIndicator.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcHealthIndicatorImpl.java similarity index 94% rename from modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcHealthIndicator.java rename to modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcHealthIndicatorImpl.java index 9cb4059c3..61cdaab1b 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcHealthIndicator.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcHealthIndicatorImpl.java @@ -30,14 +30,14 @@ *

    * Marks the database as DOWN when the probe times out or fails. */ -public class R2dbcHealthIndicator extends FireflyHealthIndicator { +public class R2dbcHealthIndicatorImpl extends FireflyHealthIndicator { private static final Duration PROBE_TIMEOUT = Duration.ofSeconds(2); private static final Duration LATENCY_THRESHOLD = Duration.ofMillis(500); private final ConnectionFactory connectionFactory; - public R2dbcHealthIndicator(ConnectionFactory connectionFactory) { + public R2dbcHealthIndicatorImpl(ConnectionFactory connectionFactory) { super("r2dbc"); this.connectionFactory = connectionFactory; } diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcMetrics.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcMetricsImpl.java similarity index 95% rename from modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcMetrics.java rename to modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcMetricsImpl.java index 49a489d76..6e94ea4d6 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcMetrics.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcMetricsImpl.java @@ -35,11 +35,11 @@ * instrument repository methods. When the {@link MeterRegistry} is unavailable, all methods * become no-ops with zero overhead. */ -public class R2dbcMetrics extends FireflyMetricsSupport { +public class R2dbcMetricsImpl extends FireflyMetricsSupport { private static final String TAG_OPERATION = "operation"; - public R2dbcMetrics(MeterRegistry meterRegistry) { + public R2dbcMetricsImpl(MeterRegistry meterRegistry) { super(meterRegistry, "r2dbc"); } diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcObservabilityAutoConfiguration.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcObservabilityAutoConfiguration.java index 263cc6e87..4889d14d0 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcObservabilityAutoConfiguration.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/observability/R2dbcObservabilityAutoConfiguration.java @@ -41,8 +41,8 @@ public class R2dbcObservabilityAutoConfiguration { @ConditionalOnBean(MeterRegistry.class) @ConditionalOnProperty(prefix = "firefly.observability.metrics", name = "enabled", havingValue = "true", matchIfMissing = true) - R2dbcMetrics r2dbcMetrics(MeterRegistry meterRegistry) { - return new R2dbcMetrics(meterRegistry); + R2dbcMetricsImpl r2dbcMetrics(MeterRegistry meterRegistry) { + return new R2dbcMetricsImpl(meterRegistry); } @Bean @@ -51,6 +51,6 @@ R2dbcMetrics r2dbcMetrics(MeterRegistry meterRegistry) { @ConditionalOnProperty(prefix = "firefly.observability.health", name = "enabled", havingValue = "true", matchIfMissing = true) HealthIndicator fireflyR2dbcHealthIndicator(ConnectionFactory connectionFactory) { - return new R2dbcHealthIndicator(connectionFactory); + return new R2dbcHealthIndicatorImpl(connectionFactory); } } diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/BoundedR2dbcResources.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/BoundedR2dbcResources.java index 105266b20..a1435eaf1 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/BoundedR2dbcResources.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/BoundedR2dbcResources.java @@ -10,12 +10,12 @@ import org.springframework.r2dbc.core.DatabaseClient; /** Verifies caller-built resources without cloning or changing the caller's client or template. */ public final class BoundedR2dbcResources { - private final OwnedLeaseConnectionFactory factory; + private final OwnedLeaseConnectionFactoryImpl factory; private final R2dbcTransactionManager manager; private final DatabaseClient client; private final R2dbcEntityTemplate template; - private BoundedR2dbcResources(OwnedLeaseConnectionFactory factory,DatabaseClient client,R2dbcEntityTemplate template,R2dbcTransactionManager manager){this.factory=factory;this.client=client;this.template=template;this.manager=manager;} - public static BoundedR2dbcResources verify(OwnedLeaseConnectionFactory factory,DatabaseClient client, + private BoundedR2dbcResources(OwnedLeaseConnectionFactoryImpl factory,DatabaseClient client,R2dbcEntityTemplate template,R2dbcTransactionManager manager){this.factory=factory;this.client=client;this.template=template;this.manager=manager;} + public static BoundedR2dbcResources verify(OwnedLeaseConnectionFactoryImpl factory,DatabaseClient client, R2dbcEntityTemplate template,R2dbcTransactionManager manager){ Objects.requireNonNull(factory);Objects.requireNonNull(client);Objects.requireNonNull(template);Objects.requireNonNull(manager); if(client.getConnectionFactory()!=factory||template.getDatabaseClient()!=client||manager.getConnectionFactory()!=factory)throw new IllegalArgumentException("One qualified factory/client/template/manager graph required"); @@ -23,6 +23,6 @@ public static BoundedR2dbcResources verify(OwnedLeaseConnectionFactory factory,D } boolean current(){return client.getConnectionFactory()==factory&&template.getDatabaseClient()==client&&manager.getConnectionFactory()==factory;} boolean sameGraph(BoundedR2dbcResources other){return other!=null&&factory==other.factory&&client==other.client&&template==other.template&&manager==other.manager;} - public OwnedLeaseConnectionFactory factory(){return factory;} + public OwnedLeaseConnectionFactoryImpl factory(){return factory;} public R2dbcTransactionManager manager(){return manager;} } diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/OwnedLeaseConnectionFactory.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/OwnedLeaseConnectionFactoryImpl.java similarity index 88% rename from modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/OwnedLeaseConnectionFactory.java rename to modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/OwnedLeaseConnectionFactoryImpl.java index 54dafb142..4f4ffc0ed 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/OwnedLeaseConnectionFactory.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/OwnedLeaseConnectionFactoryImpl.java @@ -19,12 +19,12 @@ import reactor.core.publisher.*; /** Stable qualified identity with exact invocation-created lease ownership; never closes a pool. */ -public final class OwnedLeaseConnectionFactory extends DelegatingConnectionFactory { +public final class OwnedLeaseConnectionFactoryImpl extends DelegatingConnectionFactory { private static final Object INVOCATION=new Object(); - public OwnedLeaseConnectionFactory(ConnectionFactory delegate){super(Objects.requireNonNull(delegate));} + public OwnedLeaseConnectionFactoryImpl(ConnectionFactory delegate){super(Objects.requireNonNull(delegate));} @Override public Mono create(){return Mono.deferContextual(context->{ var value=context.getOrDefault(INVOCATION,null); - if(!(value instanceof Invocation scope)||scope.factory!=this)return Mono.error(new IllegalStateException("Exact bounded invocation required")); + if(!(value instanceof InvocationImpl scope)||scope.factory!=this)return Mono.error(new IllegalStateException("Exact bounded invocation required")); scope.remaining();scope.stage.set(RootTransactionException.Stage.ACQUIRE);scope.nativeAttempted.set(true); return Mono.from(super.create()).map(scope::own); });} @@ -33,7 +33,7 @@ public final class OwnedLeaseConnectionFactory extends DelegatingConnectionFacto public Mono requireBoundScope(BoundedR2dbcResources resources,RootTransactionScope expected){ return Mono.deferContextual(context->{ Object active=context.getOrDefault(INVOCATION,null); - if(!(active instanceof Invocation scope)||active!=expected||scope.factory!=this||resources==null + if(!(active instanceof InvocationImpl scope)||active!=expected||scope.factory!=this||resources==null ||!resources.sameGraph(scope.resources)||!resources.current()||!scope.resources.current() ||scope.transaction.get()==null||scope.transaction.get().isCompleted()) return Mono.error(new IllegalStateException("Exact active bounded audit transaction required")); @@ -49,7 +49,7 @@ public Mono requireBoundScope(BoundedR2dbcResources resources,RootTransact /** Mandatory append failure cannot be converted into a committing business result by error recovery. */ public Mono markBoundScopeRollbackOnly(BoundedR2dbcResources resources,RootTransactionScope expected){ return requireBoundScope(resources,expected).then(Mono.deferContextual(context->{ - ((Invocation)context.get(INVOCATION)).transaction.get().setRollbackOnly();return Mono.empty(); + ((InvocationImpl)context.get(INVOCATION)).transaction.get().setRollbackOnly();return Mono.empty(); })); } @@ -61,8 +61,8 @@ public Mono> executeBounded(BoundedR2dbcResources resource if(resources.factory()!=this||!resources.current()||context.hasKey(INVOCATION)||definition.getPropagationBehavior()!=TransactionDefinition.PROPAGATION_REQUIRED)return Mono.error(gateFailure()); return TransactionSynchronizationManager.forCurrentTransaction().hasElement().onErrorResume(NoTransactionException.class,e->Mono.just(false)).flatMap(active->{ if(active)return Mono.error(gateFailure()); - final Invocation scope; - try {original.remaining();scope=new Invocation(this,resources,original,cleanup);}catch(RuntimeException expired){return Mono.error(gateFailure());} + final InvocationImpl scope; + try {original.remaining();scope=new InvocationImpl(this,resources,original,cleanup);}catch(RuntimeException expired){return Mono.error(gateFailure());} Mono bounded=Mono.usingWhen(Mono.just(scope),owned->{ Mono transaction=TransactionalOperator.create(owned.manager(),new DefaultTransactionDefinition(definition)) .execute(status->TransactionSynchronizationManager.forCurrentTransaction().flatMap(sync->{ @@ -76,7 +76,7 @@ public Mono> executeBounded(BoundedR2dbcResources resource }).flux()).collectList().doOnSuccess(values->owned.boundaryCompleted.set(true)).flatMap(values-> values.size()==1?Mono.just(values.getFirst()):Mono.error(new IllegalStateException("One bounded root result required"))); return transaction.timeout(owned.deadline()).doOnError(owned::captureFailure); - },Invocation::cleanup,(owned,error)->owned.cleanup(),Invocation::cleanup); + },InvocationImpl::cleanup,(owned,error)->owned.cleanup(),InvocationImpl::cleanup); return bounded.flatMap(value->{ scope.stage.set(RootTransactionException.Stage.FINAL_BUDGET); scope.remaining(); @@ -87,13 +87,13 @@ public Mono> executeBounded(BoundedR2dbcResources resource } private static RootTransactionException gateFailure(){return new RootTransactionException(new TransactionFacts(false,false,false,false),CleanupFact.COMPLETE,RootTransactionException.Stage.GATE);} - private static final class Invocation implements RootTransactionScope { - final OwnedLeaseConnectionFactory factory; + private static final class InvocationImpl implements RootTransactionScope { + final OwnedLeaseConnectionFactoryImpl factory; final BoundedR2dbcResources resources; final R2dbcOperationBudget original; final AtomicReference cap; final CleanupPolicy policy; - final List leases=Collections.synchronizedList(new ArrayList<>()); + final List leases=Collections.synchronizedList(new ArrayList<>()); final AtomicBoolean nativeAttempted=new AtomicBoolean(),commitAcknowledged=new AtomicBoolean(),boundaryCompleted=new AtomicBoolean(),rollbackAcknowledged=new AtomicBoolean(); final AtomicReference stage=new AtomicReference<>(RootTransactionException.Stage.GATE),failureStage=new AtomicReference<>(); final AtomicReference transaction=new AtomicReference<>(); @@ -104,7 +104,7 @@ private static final class Invocation implements RootTransactionScope { final AtomicReference registeredRejection=new AtomicReference<>(),workRejection=new AtomicReference<>(),terminalRejection=new AtomicReference<>(); final Sinks.Many narrowed=Sinks.many().replay().latest(); reactor.util.context.Context transactionContext; - Invocation(OwnedLeaseConnectionFactory factory,BoundedR2dbcResources resources,R2dbcOperationBudget original,CleanupPolicy policy){this.factory=factory;this.resources=resources;this.original=original;this.cap=new AtomicReference<>(original);this.policy=policy;} + InvocationImpl(OwnedLeaseConnectionFactoryImpl factory,BoundedR2dbcResources resources,R2dbcOperationBudget original,CleanupPolicy policy){this.factory=factory;this.resources=resources;this.original=original;this.cap=new AtomicReference<>(original);this.policy=policy;} @Override public Duration remaining(){var a=original.remaining();var b=cap.get().remaining();return a.compareTo(b)<0?a:b;} @Override public void narrow(R2dbcOperationBudget observedCap){cap.updateAndGet(current->current.intersect(observedCap));remaining();if(narrowed.tryEmitNext(true).isFailure())throw new IllegalStateException("Bounded deadline observation unavailable");} @Override public Mono reject(RootWorkRejectionKey key){ @@ -118,7 +118,7 @@ private static final class Invocation implements RootTransactionScope { })); } Mono deadline(){return narrowed.asFlux().startWith(false).switchMap(signal->Mono.defer(()->Mono.delay(remaining()))).next();} - Connection own(Connection raw){var lease=new Lease(raw,this);leases.add(lease);return lease;} + Connection own(Connection raw){var lease=new LeaseImpl(raw,this);leases.add(lease);return lease;} void captureFailure(){failureStage.compareAndSet(null,stage.get());} void observeWorkRejection(Throwable error){ var expected=registeredRejection.get(); @@ -158,8 +158,8 @@ Mono cleanup(){return Mono.defer(()->{ var incomplete=incompleteCleanup;var status=transaction.get(); Mono rolled=status!=null&&!status.isCompleted()&&!commitAcknowledged.get()?rollbackOnce(status):Mono.empty(); return rolled.onErrorResume(error->{incomplete.set(true);return Mono.empty();}).then(Mono.defer(()->{ - stage.set(RootTransactionException.Stage.CLOSE);List owned;synchronized(leases){owned=List.copyOf(leases);} - return Mono.whenDelayError(owned.stream().map(Lease::close).toList()).timeout(policy.close()); + stage.set(RootTransactionException.Stage.CLOSE);List owned;synchronized(leases){owned=List.copyOf(leases);} + return Mono.whenDelayError(owned.stream().map(LeaseImpl::close).toList()).timeout(policy.close()); })).doOnSuccess(ignored->cleanupFact.set(incomplete.get()?CleanupFact.INCOMPLETE:CleanupFact.COMPLETE)) .onErrorResume(error->{cleanupFact.set(CleanupFact.INCOMPLETE);captureFailure();return Mono.error(failure());}) .then(Mono.defer(()->incomplete.get()?Mono.error(failure()):Mono.empty())); @@ -171,9 +171,9 @@ private static final class WorkRejectionSignal extends RuntimeException { final transient Object owner;final transient RootWorkRejectionKey key; WorkRejectionSignal(Object owner,RootWorkRejectionKey key){super("BOUNDED_ROOT_WORK_REJECTED",null,false,false);this.owner=owner;this.key=key;} } - private static final class Lease implements Connection { - final Connection raw;final Invocation scope;final Mono close; - Lease(Connection raw,Invocation scope){this.raw=Objects.requireNonNull(raw);this.scope=scope;close=Mono.defer(()->Mono.from(raw.close())).timeout(scope.policy.close()).cache();} + private static final class LeaseImpl implements Connection { + final Connection raw;final InvocationImpl scope;final Mono close; + LeaseImpl(Connection raw,InvocationImpl scope){this.raw=Objects.requireNonNull(raw);this.scope=scope;close=Mono.defer(()->Mono.from(raw.close())).timeout(scope.policy.close()).cache();} public Publisher beginTransaction(){return Mono.defer(()->{scope.stage.set(RootTransactionException.Stage.BEGIN);var limit=scope.remaining();return Mono.from(raw.beginTransaction()).timeout(limit);});} public Publisher beginTransaction(io.r2dbc.spi.TransactionDefinition d){return Mono.defer(()->{scope.stage.set(RootTransactionException.Stage.BEGIN);var limit=scope.remaining();return Mono.from(raw.beginTransaction(d)).timeout(limit);});} public Publisher commitTransaction(){return Mono.defer(()->{scope.stage.set(RootTransactionException.Stage.COMMIT);var limit=scope.remaining();return Mono.from(raw.commitTransaction()).timeout(limit);});} diff --git a/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/impl/DefaultBoundedRootTransaction.java b/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/impl/DefaultBoundedRootTransactionImpl.java similarity index 75% rename from modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/impl/DefaultBoundedRootTransaction.java rename to modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/impl/DefaultBoundedRootTransactionImpl.java index 4894b92ed..19ea43883 100644 --- a/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/impl/DefaultBoundedRootTransaction.java +++ b/modules/r2dbc/src/main/java/org/fireflyframework/core/transaction/impl/DefaultBoundedRootTransactionImpl.java @@ -10,10 +10,10 @@ import org.springframework.transaction.TransactionDefinition; import reactor.core.publisher.Mono; /** Explicit opt-in service; existing transaction auto-configuration is unchanged. */ -public final class DefaultBoundedRootTransaction implements BoundedRootTransaction { +public final class DefaultBoundedRootTransactionImpl implements BoundedRootTransaction { private final BoundedR2dbcResources resources; private final CleanupPolicy cleanup; - public DefaultBoundedRootTransaction(BoundedR2dbcResources resources,CleanupPolicy cleanup){this.resources=Objects.requireNonNull(resources);this.cleanup=Objects.requireNonNull(cleanup);} + public DefaultBoundedRootTransactionImpl(BoundedR2dbcResources resources,CleanupPolicy cleanup){this.resources=Objects.requireNonNull(resources);this.cleanup=Objects.requireNonNull(cleanup);} @Override public Mono> execute(R2dbcOperationBudget original,TransactionDefinition definition, Function> work){return resources.factory().executeBounded(resources,original,definition,cleanup,work);} } diff --git a/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/AuditTestFixture.java b/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/AuditTestFixture.java index b10283b08..7b9fe85b4 100644 --- a/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/AuditTestFixture.java +++ b/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/AuditTestFixture.java @@ -22,7 +22,7 @@ import java.util.function.*; import java.util.regex.*; import org.fireflyframework.core.transaction.*; -import org.fireflyframework.core.transaction.impl.DefaultBoundedRootTransaction; +import org.fireflyframework.core.transaction.impl.DefaultBoundedRootTransactionImpl; import org.reactivestreams.Publisher; import org.springframework.data.r2dbc.core.R2dbcEntityTemplate; import org.springframework.data.r2dbc.dialect.PostgresDialect; @@ -36,7 +36,7 @@ final class AuditTestFixture { Throwable workFailure;final Clock clock;final LongSupplier nanos; AuditTestFixture(){this(Clock.systemUTC(),System::nanoTime);} AuditTestFixture(Clock clock,LongSupplier nanos){this.clock=clock;this.nanos=nanos;} - final Driver driver=new Driver();final OwnedLeaseConnectionFactory factory=new OwnedLeaseConnectionFactory(driver);final DatabaseClient client=DatabaseClient.create(factory);final R2dbcEntityTemplate template=new R2dbcEntityTemplate(client,PostgresDialect.INSTANCE);final R2dbcTransactionManager manager=new R2dbcTransactionManager(factory);final BoundedR2dbcResources resources=BoundedR2dbcResources.verify(factory,client,template,manager);final BoundedRootTransaction root=new DefaultBoundedRootTransaction(resources,new CleanupPolicy(Duration.ofSeconds(1),Duration.ofSeconds(1))); + final Driver driver=new Driver();final OwnedLeaseConnectionFactoryImpl factory=new OwnedLeaseConnectionFactoryImpl(driver);final DatabaseClient client=DatabaseClient.create(factory);final R2dbcEntityTemplate template=new R2dbcEntityTemplate(client,PostgresDialect.INSTANCE);final R2dbcTransactionManager manager=new R2dbcTransactionManager(factory);final BoundedR2dbcResources resources=BoundedR2dbcResources.verify(factory,client,template,manager);final BoundedRootTransaction root=new DefaultBoundedRootTransactionImpl(resources,new CleanupPolicy(Duration.ofSeconds(1),Duration.ofSeconds(1))); Mono> execute(Function> work){var now=clock.instant();return root.execute(R2dbcOperationBudget.observed(now,now.plusSeconds(5),nanos.getAsLong(),Duration.ofSeconds(5),clock,nanos),new DefaultTransactionDefinition(),scope->work.apply(scope).doOnError(error->workFailure=error));} static final class Driver implements ConnectionFactory { Map>> tables=new HashMap<>(),snapshot;Runnable beforeRead=()->{};Throwable readFailure;final List sql=new ArrayList<>();final List> bindings=new ArrayList<>();int creates,writes,selects,affectedObservations,commits,rollbacks,closes,failWrite,nativeEnters,nativeCompletions,countAtWrite;long writeCount=1;boolean emptyCount;boolean autoCommit=true; diff --git a/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/CompletedAuditAppendServiceTest.java b/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/CompletedAuditAppendServiceTest.java index b7592122e..d2213ff5d 100644 --- a/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/CompletedAuditAppendServiceTest.java +++ b/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/CompletedAuditAppendServiceTest.java @@ -4,7 +4,7 @@ import java.lang.reflect.InvocationTargetException; import java.time.Instant; import java.util.*; -import org.fireflyframework.core.audit.impl.SpringDataLocalAuditRepository; +import org.fireflyframework.core.audit.impl.SpringDataLocalAuditRepositoryImpl; import org.fireflyframework.core.transaction.*; import org.fireflyframework.kernel.audit.*; import org.junit.jupiter.api.Test; @@ -34,13 +34,13 @@ static Mono read(AuditTestFixture f,RootTransactionScope scope,UUID if(!row.containsKey("until_millis"))row.put("until_millis",f.clock.instant().plusSeconds(5).toEpochMilli()); if(!row.containsKey("replay"))row.put("replay",expected.replay()); } - var type=Class.forName("org.fireflyframework.core.audit.impl.SpringDataCompletedAuditAppendService"); + var type=Class.forName("org.fireflyframework.core.audit.impl.SpringDataCompletedAuditAppendServiceImpl"); var service=type.getConstructor(BoundedR2dbcResources.class,org.springframework.r2dbc.core.DatabaseClient.class, org.springframework.data.r2dbc.core.R2dbcEntityTemplate.class,org.springframework.r2dbc.connection.R2dbcTransactionManager.class,java.time.Clock.class,java.util.function.LongSupplier.class) .newInstance(f.resources,f.client,f.template,f.manager,f.clock,f.nanos); return (Mono)type.getMethod("requireCompleted",RootTransactionScope.class,UUID.class,TransactionalAuditAppender.ProvisionalAppend.class).invoke(service,scope,nonce,expected); }catch(ClassNotFoundException predecessor){ - return new SpringDataLocalAuditRepository(f.resources,f.client,f.template,f.manager).find(scope,expected.record().event().stream().resourceTenantId(),expected.record().event().eventId()); + return new SpringDataLocalAuditRepositoryImpl(f.resources,f.client,f.template,f.manager).find(scope,expected.record().event().stream().resourceTenantId(),expected.record().event().eventId()); }catch(InvocationTargetException error){return Mono.error(error.getCause());} catch(Exception error){return Mono.error(error);} } @@ -118,7 +118,7 @@ static final class Time extends java.time.Clock { } @Test void aDifferentTimeSupplierCannotSubstituteForTheOriginalBudget()throws Exception { var f=fixture();f.driver.tables.put(FUNCTION,new ArrayList<>(List.of(row(AuditRows.Event.from(LocalAuditRepositoryTest.record()))))); - var type=Class.forName("org.fireflyframework.core.audit.impl.SpringDataCompletedAuditAppendService"); + var type=Class.forName("org.fireflyframework.core.audit.impl.SpringDataCompletedAuditAppendServiceImpl"); var service=type.getConstructor(BoundedR2dbcResources.class,org.springframework.r2dbc.core.DatabaseClient.class,org.springframework.data.r2dbc.core.R2dbcEntityTemplate.class,org.springframework.r2dbc.connection.R2dbcTransactionManager.class,java.time.Clock.class,java.util.function.LongSupplier.class) .newInstance(f.resources,f.client,f.template,f.manager,f.clock,(java.util.function.LongSupplier)()->f.nanos.getAsLong()); var done=f.execute(scope->{var row=f.driver.tables.get(FUNCTION).getFirst();row.put("context_nonce",NONCE);row.put("replay",false);row.put("db_now_millis",f.clock.instant().toEpochMilli());row.put("until_millis",f.clock.instant().plusSeconds(5).toEpochMilli()); @@ -127,7 +127,7 @@ static final class Time extends java.time.Clock { } @Test void anotherTemplateOnTheSameFactoryCannotReplaceTheRetainedRootGraph()throws Exception { var f=fixture();var client=org.springframework.r2dbc.core.DatabaseClient.create(f.factory);var template=new org.springframework.data.r2dbc.core.R2dbcEntityTemplate(client,org.springframework.data.r2dbc.dialect.PostgresDialect.INSTANCE); - var type=Class.forName("org.fireflyframework.core.audit.impl.SpringDataCompletedAuditAppendService");var service=type.getConstructor(BoundedR2dbcResources.class,org.springframework.r2dbc.core.DatabaseClient.class,org.springframework.data.r2dbc.core.R2dbcEntityTemplate.class,org.springframework.r2dbc.connection.R2dbcTransactionManager.class,java.time.Clock.class,java.util.function.LongSupplier.class).newInstance(f.resources,client,template,f.manager,f.clock,f.nanos); + var type=Class.forName("org.fireflyframework.core.audit.impl.SpringDataCompletedAuditAppendServiceImpl");var service=type.getConstructor(BoundedR2dbcResources.class,org.springframework.r2dbc.core.DatabaseClient.class,org.springframework.data.r2dbc.core.R2dbcEntityTemplate.class,org.springframework.r2dbc.connection.R2dbcTransactionManager.class,java.time.Clock.class,java.util.function.LongSupplier.class).newInstance(f.resources,client,template,f.manager,f.clock,f.nanos); assertThrows(RuntimeException.class,()->f.execute(scope->{try{@SuppressWarnings("unchecked")var result=(Mono)type.getMethod("requireCompleted",RootTransactionScope.class,UUID.class,TransactionalAuditAppender.ProvisionalAppend.class).invoke(service,scope,NONCE,expected());return result;}catch(Exception error){return Mono.error(error);}}).block());assertTrue(f.driver.sql.isEmpty()); } public static final class HashingDelay extends java.security.MessageDigestSpi { diff --git a/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/LocalAuditRepositoryTest.java b/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/LocalAuditRepositoryTest.java index d231f2c56..9856b9be2 100644 --- a/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/LocalAuditRepositoryTest.java +++ b/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/LocalAuditRepositoryTest.java @@ -18,7 +18,7 @@ import static org.junit.jupiter.api.Assertions.*; import java.time.*; import java.util.*; -import org.fireflyframework.core.audit.impl.SpringDataLocalAuditRepository; +import org.fireflyframework.core.audit.impl.SpringDataLocalAuditRepositoryImpl; import org.fireflyframework.kernel.audit.*; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -29,27 +29,27 @@ class LocalAuditRepositoryTest { static AuditRecord record(){return AuditRecordHasher.record(AuditCheckpoint.genesis(event().stream()),event(),Instant.ofEpochMilli(123456789));} @Test void fullKernelEventAndNanosecondFieldsRoundTripThroughMappedRows(){var row=AuditRows.Event.from(record());assertEquals(record(),row.record());assertEquals(987654321,row.occurredNanos());} @Test void firstAppendUsesExactlyThreeAffectedRowCountsAndReadback(){ - var f=new AuditTestFixture();var store=new SpringDataLocalAuditRepository(f.resources,f.client,f.template,f.manager);var r=record(); + var f=new AuditTestFixture();var store=new SpringDataLocalAuditRepositoryImpl(f.resources,f.client,f.template,f.manager);var r=record(); var done=f.execute(scope->store.append(scope,AuditCheckpoint.genesis(r.event().stream()),r)).block();assertEquals(r,done.value());assertEquals(3,f.driver.writes);assertEquals(3,f.driver.affectedObservations);assertEquals(1,f.driver.commits); assertEquals(1,f.driver.tables.get("audit_event").size());assertEquals(1,f.driver.tables.get("audit_outbox").size()); } @Test void secondAppendUsesOriginalHeadVersionAndHashForCas(){ - var f=new AuditTestFixture();var store=new SpringDataLocalAuditRepository(f.resources,f.client,f.template,f.manager);var first=record();var next=new AuditEvent(id(9),event().stream(),event().actor(),event().action(),event().outcome(),event().processId(),event().correlationId(),null,event().occurredAt(),event().evidenceDigest(),event().policyRevision());var prior=new AuditCheckpoint(event().stream(),1,first.recordHash());var second=AuditRecordHasher.record(prior,next,first.recordedAt().plusMillis(1)); + var f=new AuditTestFixture();var store=new SpringDataLocalAuditRepositoryImpl(f.resources,f.client,f.template,f.manager);var first=record();var next=new AuditEvent(id(9),event().stream(),event().actor(),event().action(),event().outcome(),event().processId(),event().correlationId(),null,event().occurredAt(),event().evidenceDigest(),event().policyRevision());var prior=new AuditCheckpoint(event().stream(),1,first.recordHash());var second=AuditRecordHasher.record(prior,next,first.recordedAt().plusMillis(1)); assertDoesNotThrow(()->f.execute(scope->store.append(scope,AuditCheckpoint.genesis(event().stream()),first).then(store.append(scope,prior,second))).block(),()->String.valueOf(f.workFailure)+f.driver.sql);assertEquals(6,f.driver.writes);int update=java.util.stream.IntStream.range(0,f.driver.sql.size()).filter(i->f.driver.sql.get(i).startsWith("UPDATE")).findFirst().orElseThrow();assertEquals(List.of(2L,second.recordHash(),event().stream().resourceTenantId(),"payments","transfer",event().stream().resourceId(),1L,first.recordHash()),new ArrayList<>(f.driver.bindings.get(update).values()));assertEquals(2,f.execute(scope->store.head(scope,event().stream())).block().value().lastSequence()); } @Test void fullEventAndPermanentOutboxAreRequiredForReplayRead(){ - var f=new AuditTestFixture();var store=new SpringDataLocalAuditRepository(f.resources,f.client,f.template,f.manager);f.execute(scope->store.append(scope,AuditCheckpoint.genesis(event().stream()),record())).block();assertEquals(record(),f.execute(scope->store.find(scope,event().stream().resourceTenantId(),event().eventId())).block().value()); + var f=new AuditTestFixture();var store=new SpringDataLocalAuditRepositoryImpl(f.resources,f.client,f.template,f.manager);f.execute(scope->store.append(scope,AuditCheckpoint.genesis(event().stream()),record())).block();assertEquals(record(),f.execute(scope->store.find(scope,event().stream().resourceTenantId(),event().eventId())).block().value()); f.driver.tables.get("audit_outbox").clear();assertThrows(RuntimeException.class,()->f.execute(scope->store.find(scope,event().stream().resourceTenantId(),event().eventId())).block()); } @Test void zeroAndTwoAffectedRowsAbortBeforeLaterWrites(){ - for(long count:new long[]{0,2})for(int position:new int[]{1,2,3}){var f=new AuditTestFixture();f.driver.writeCount=count;f.driver.countAtWrite=position;var store=new SpringDataLocalAuditRepository(f.resources,f.client,f.template,f.manager);assertThrows(RuntimeException.class,()->f.execute(scope->store.append(scope,AuditCheckpoint.genesis(event().stream()),record())).block());assertEquals(position,f.driver.writes);assertEquals(0,f.driver.commits);assertEquals(1,f.driver.rollbacks);} + for(long count:new long[]{0,2})for(int position:new int[]{1,2,3}){var f=new AuditTestFixture();f.driver.writeCount=count;f.driver.countAtWrite=position;var store=new SpringDataLocalAuditRepositoryImpl(f.resources,f.client,f.template,f.manager);assertThrows(RuntimeException.class,()->f.execute(scope->store.append(scope,AuditCheckpoint.genesis(event().stream()),record())).block());assertEquals(position,f.driver.writes);assertEquals(0,f.driver.commits);assertEquals(1,f.driver.rollbacks);} } - @Test void missingAffectedRowObservationIsNeverSuccess(){for(int position:new int[]{1,2,3}){var f=new AuditTestFixture();f.driver.emptyCount=true;f.driver.countAtWrite=position;var store=new SpringDataLocalAuditRepository(f.resources,f.client,f.template,f.manager);assertThrows(RuntimeException.class,()->f.execute(scope->store.append(scope,AuditCheckpoint.genesis(event().stream()),record())).block());assertEquals(position,f.driver.writes);assertEquals(1,f.driver.rollbacks);}} - @Test void duplicateFailureHasNoLaterReadOrOutboxWrite(){var f=new AuditTestFixture();f.driver.failWrite=2;var store=new SpringDataLocalAuditRepository(f.resources,f.client,f.template,f.manager);assertThrows(RuntimeException.class,()->f.execute(scope->store.append(scope,AuditCheckpoint.genesis(event().stream()),record())).block());assertEquals(2,f.driver.writes);assertEquals(0,f.driver.selects);assertEquals(1,f.driver.rollbacks);assertTrue(f.driver.tables.isEmpty());} - @Test void zeroOrTwoHeadCasRowsAbortWithoutTheNextEventOrOutbox(){for(long count:new long[]{0,2}){var f=new AuditTestFixture();f.driver.countAtWrite=4;f.driver.writeCount=count;var store=new SpringDataLocalAuditRepository(f.resources,f.client,f.template,f.manager);var first=record();var prior=new AuditCheckpoint(event().stream(),1,first.recordHash());var e=event();var next=new AuditEvent(id(9),e.stream(),e.actor(),e.action(),e.outcome(),e.processId(),e.correlationId(),null,e.occurredAt(),e.evidenceDigest(),e.policyRevision());var second=AuditRecordHasher.record(prior,next,first.recordedAt().plusMillis(1));assertThrows(RuntimeException.class,()->f.execute(scope->store.append(scope,AuditCheckpoint.genesis(e.stream()),first).then(store.append(scope,prior,second))).block());assertEquals(4,f.driver.writes);assertEquals(1,f.driver.rollbacks);assertTrue(f.driver.tables.isEmpty());}} - @Test void lowLevelRepositoryCannotUseAnUnqualifiedOrdinaryAmbientTransaction(){var f=new AuditTestFixture();var driver=new AuditTestFixture.Driver();var client=org.springframework.r2dbc.core.DatabaseClient.create(driver);var template=new org.springframework.data.r2dbc.core.R2dbcEntityTemplate(client,org.springframework.data.r2dbc.dialect.PostgresDialect.INSTANCE);assertThrows(IllegalArgumentException.class,()->new SpringDataLocalAuditRepository(f.resources,client,template,new org.springframework.r2dbc.connection.R2dbcTransactionManager(driver)));assertEquals(0,driver.writes);assertEquals(0,driver.creates);} - @Test void noAmbientTransactionRefusesAllPublicStoreOperationsBeforeMappedStatements(){var f=new AuditTestFixture();var store=new SpringDataLocalAuditRepository(f.resources,f.client,f.template,f.manager);for(var operation:List.of(store.head(null,event().stream()),store.find(null,event().stream().resourceTenantId(),event().eventId()),store.append(null,AuditCheckpoint.genesis(event().stream()),record())))assertThrows(RuntimeException.class,operation::block);assertEquals(0,f.driver.creates);assertTrue(f.driver.sql.isEmpty());} - @Test void allPublicStoreOperationsRefuseAForeignRealScopeBeforeSql(){var owner=new AuditTestFixture();var foreign=new AuditTestFixture();var store=new SpringDataLocalAuditRepository(foreign.resources,foreign.client,foreign.template,foreign.manager);for(int operation:new int[]{0,1,2})assertThrows(RuntimeException.class,()->owner.execute(scope->operation==0?store.head(scope,event().stream()).map(Object.class::cast):operation==1?store.find(scope,event().stream().resourceTenantId(),event().eventId()).map(Object.class::cast):store.append(scope,AuditCheckpoint.genesis(event().stream()),record()).map(Object.class::cast)).block());assertTrue(foreign.driver.sql.isEmpty());assertEquals(0,foreign.driver.creates);} - @Test void allPublicStoreOperationsRefuseACompletedOriginalScopeBeforeSql(){var f=new AuditTestFixture();var retained=new java.util.concurrent.atomic.AtomicReference();f.execute(scope->{retained.set(scope);return Mono.just("closed");}).block();var store=new SpringDataLocalAuditRepository(f.resources,f.client,f.template,f.manager);for(var operation:List.of(store.head(retained.get(),event().stream()),store.find(retained.get(),event().stream().resourceTenantId(),event().eventId()),store.append(retained.get(),AuditCheckpoint.genesis(event().stream()),record())))assertThrows(RuntimeException.class,operation::block);assertEquals(1,f.driver.creates);assertTrue(f.driver.sql.isEmpty());} + @Test void missingAffectedRowObservationIsNeverSuccess(){for(int position:new int[]{1,2,3}){var f=new AuditTestFixture();f.driver.emptyCount=true;f.driver.countAtWrite=position;var store=new SpringDataLocalAuditRepositoryImpl(f.resources,f.client,f.template,f.manager);assertThrows(RuntimeException.class,()->f.execute(scope->store.append(scope,AuditCheckpoint.genesis(event().stream()),record())).block());assertEquals(position,f.driver.writes);assertEquals(1,f.driver.rollbacks);}} + @Test void duplicateFailureHasNoLaterReadOrOutboxWrite(){var f=new AuditTestFixture();f.driver.failWrite=2;var store=new SpringDataLocalAuditRepositoryImpl(f.resources,f.client,f.template,f.manager);assertThrows(RuntimeException.class,()->f.execute(scope->store.append(scope,AuditCheckpoint.genesis(event().stream()),record())).block());assertEquals(2,f.driver.writes);assertEquals(0,f.driver.selects);assertEquals(1,f.driver.rollbacks);assertTrue(f.driver.tables.isEmpty());} + @Test void zeroOrTwoHeadCasRowsAbortWithoutTheNextEventOrOutbox(){for(long count:new long[]{0,2}){var f=new AuditTestFixture();f.driver.countAtWrite=4;f.driver.writeCount=count;var store=new SpringDataLocalAuditRepositoryImpl(f.resources,f.client,f.template,f.manager);var first=record();var prior=new AuditCheckpoint(event().stream(),1,first.recordHash());var e=event();var next=new AuditEvent(id(9),e.stream(),e.actor(),e.action(),e.outcome(),e.processId(),e.correlationId(),null,e.occurredAt(),e.evidenceDigest(),e.policyRevision());var second=AuditRecordHasher.record(prior,next,first.recordedAt().plusMillis(1));assertThrows(RuntimeException.class,()->f.execute(scope->store.append(scope,AuditCheckpoint.genesis(e.stream()),first).then(store.append(scope,prior,second))).block());assertEquals(4,f.driver.writes);assertEquals(1,f.driver.rollbacks);assertTrue(f.driver.tables.isEmpty());}} + @Test void lowLevelRepositoryCannotUseAnUnqualifiedOrdinaryAmbientTransaction(){var f=new AuditTestFixture();var driver=new AuditTestFixture.Driver();var client=org.springframework.r2dbc.core.DatabaseClient.create(driver);var template=new org.springframework.data.r2dbc.core.R2dbcEntityTemplate(client,org.springframework.data.r2dbc.dialect.PostgresDialect.INSTANCE);assertThrows(IllegalArgumentException.class,()->new SpringDataLocalAuditRepositoryImpl(f.resources,client,template,new org.springframework.r2dbc.connection.R2dbcTransactionManager(driver)));assertEquals(0,driver.writes);assertEquals(0,driver.creates);} + @Test void noAmbientTransactionRefusesAllPublicStoreOperationsBeforeMappedStatements(){var f=new AuditTestFixture();var store=new SpringDataLocalAuditRepositoryImpl(f.resources,f.client,f.template,f.manager);for(var operation:List.of(store.head(null,event().stream()),store.find(null,event().stream().resourceTenantId(),event().eventId()),store.append(null,AuditCheckpoint.genesis(event().stream()),record())))assertThrows(RuntimeException.class,operation::block);assertEquals(0,f.driver.creates);assertTrue(f.driver.sql.isEmpty());} + @Test void allPublicStoreOperationsRefuseAForeignRealScopeBeforeSql(){var owner=new AuditTestFixture();var foreign=new AuditTestFixture();var store=new SpringDataLocalAuditRepositoryImpl(foreign.resources,foreign.client,foreign.template,foreign.manager);for(int operation:new int[]{0,1,2})assertThrows(RuntimeException.class,()->owner.execute(scope->operation==0?store.head(scope,event().stream()).map(Object.class::cast):operation==1?store.find(scope,event().stream().resourceTenantId(),event().eventId()).map(Object.class::cast):store.append(scope,AuditCheckpoint.genesis(event().stream()),record()).map(Object.class::cast)).block());assertTrue(foreign.driver.sql.isEmpty());assertEquals(0,foreign.driver.creates);} + @Test void allPublicStoreOperationsRefuseACompletedOriginalScopeBeforeSql(){var f=new AuditTestFixture();var retained=new java.util.concurrent.atomic.AtomicReference();f.execute(scope->{retained.set(scope);return Mono.just("closed");}).block();var store=new SpringDataLocalAuditRepositoryImpl(f.resources,f.client,f.template,f.manager);for(var operation:List.of(store.head(retained.get(),event().stream()),store.find(retained.get(),event().stream().resourceTenantId(),event().eventId()),store.append(retained.get(),AuditCheckpoint.genesis(event().stream()),record())))assertThrows(RuntimeException.class,operation::block);assertEquals(1,f.driver.creates);assertTrue(f.driver.sql.isEmpty());} } diff --git a/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/TransactionalAuditAppenderTest.java b/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/TransactionalAuditAppenderTest.java index 74f0db6b2..fca349cbf 100644 --- a/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/TransactionalAuditAppenderTest.java +++ b/modules/r2dbc/src/test/java/org/fireflyframework/core/audit/TransactionalAuditAppenderTest.java @@ -19,7 +19,7 @@ import java.time.*; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; -import org.fireflyframework.core.audit.impl.SpringDataTransactionalAuditAppender; +import org.fireflyframework.core.audit.impl.SpringDataTransactionalAuditAppenderImpl; import org.fireflyframework.kernel.audit.*; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -27,7 +27,7 @@ class TransactionalAuditAppenderTest { AuditEvent event(){return LocalAuditRepositoryTest.event();} AuditAppendAuthority authority(AtomicInteger calls){return e->{calls.incrementAndGet();return Mono.just(new AuditAppendAuthority.Permit(e.stream(),e.actor(),Instant.now().plusSeconds(60)));};} - SpringDataTransactionalAuditAppender appender(AuditTestFixture f,AuditAppendAuthority authority){return new SpringDataTransactionalAuditAppender(f.resources,f.client,f.template,f.manager,authority,f.clock,f.nanos,UUID::randomUUID);} + SpringDataTransactionalAuditAppenderImpl appender(AuditTestFixture f,AuditAppendAuthority authority){return new SpringDataTransactionalAuditAppenderImpl(f.resources,f.client,f.template,f.manager,authority,f.clock,f.nanos,UUID::randomUUID);} @org.springframework.data.relational.core.mapping.Table("audit_test_business") record Business(@org.springframework.data.annotation.Id UUID id,long version) { } @Test void mappedBusinessAndAuditOutboxCommitOnTheSameExistingLease(){var f=new AuditTestFixture();var service=appender(f,authority(new AtomicInteger()));var done=f.execute(scope->f.template.insert(new Business(UUID.randomUUID(),1)).then(service.append(scope,event()))).block();assertTrue(done.transactionFacts().commitAcknowledged());assertEquals(1,f.driver.creates);for(String table:List.of("audit_test_business","audit_event","audit_outbox"))assertEquals(1,f.driver.tables.get(table).size());} @Test void caughtZeroTwoOrMissingMappedCountStillCannotCommitBusinessEffect(){ @@ -58,6 +58,6 @@ class TransactionalAuditAppenderTest { } } @Test void originalExpiredDeadlineRefusesBeforeAuditStatements(){var f=new AuditTestFixture();var service=appender(f,authority(new AtomicInteger()));assertThrows(RuntimeException.class,()->f.execute(scope->{scope.narrow(org.fireflyframework.core.transaction.R2dbcOperationBudget.observed(Instant.now().minusSeconds(2),Instant.now().minusSeconds(1),System.nanoTime(),Duration.ofSeconds(1),Clock.systemUTC(),System::nanoTime));return service.append(scope,event());}).block());assertEquals(0,f.driver.writes);assertEquals(0,f.driver.nativeEnters);} - @Test void aDifferentMonotonicSupplierCannotReplaceTheOriginalBudgetPair(){var f=new AuditTestFixture();var service=new SpringDataTransactionalAuditAppender(f.resources,f.client,f.template,f.manager,authority(new AtomicInteger()),f.clock,System::nanoTime,UUID::randomUUID);assertThrows(RuntimeException.class,()->f.execute(scope->service.append(scope,event())).block());assertEquals(0,f.driver.writes);assertEquals(1,f.driver.rollbacks);} + @Test void aDifferentMonotonicSupplierCannotReplaceTheOriginalBudgetPair(){var f=new AuditTestFixture();var service=new SpringDataTransactionalAuditAppenderImpl(f.resources,f.client,f.template,f.manager,authority(new AtomicInteger()),f.clock,System::nanoTime,UUID::randomUUID);assertThrows(RuntimeException.class,()->f.execute(scope->service.append(scope,event())).block());assertEquals(0,f.driver.writes);assertEquals(1,f.driver.rollbacks);} @Test void missingScopeOutsideOwnerRootRefusesBeforeCurrentAuthorityOrAcquisition(){var f=new AuditTestFixture();var calls=new AtomicInteger();var service=appender(f,authority(calls));assertThrows(RuntimeException.class,()->service.append(null,event()).block());assertEquals(0,calls.get());assertEquals(0,f.driver.creates);} } diff --git a/modules/r2dbc/src/test/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProviderTest.java b/modules/r2dbc/src/test/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProviderTest.java index 51ee47b31..d2a0f8f66 100644 --- a/modules/r2dbc/src/test/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProviderTest.java +++ b/modules/r2dbc/src/test/java/org/fireflyframework/core/auditing/UtcOffsetDateTimeProviderTest.java @@ -25,7 +25,7 @@ record ImmutableAudit(@Id String id,@Version Long version,@CreatedDate OffsetDat static ReactiveIsNewAwareAuditingHandler handler() { var context=new R2dbcMappingContext();context.setSimpleTypeHolder(R2dbcSimpleTypeHolder.HOLDER); for(var type:new Class[]{InheritedAudit.class,LocalAudit.class,InstantAudit.class,DateAudit.class,LongAudit.class,ImmutableAudit.class})context.getRequiredPersistentEntity(type); - var result=new ReactiveIsNewAwareAuditingHandler(PersistentEntities.of(context));result.setDateTimeProvider(new UtcOffsetDateTimeProvider(Clock.fixed(NOW,ZoneId.of("Asia/Tokyo"))));return result; + var result=new ReactiveIsNewAwareAuditingHandler(PersistentEntities.of(context));result.setDateTimeProvider(new UtcOffsetDateTimeProviderImpl(Clock.fixed(NOW,ZoneId.of("Asia/Tokyo"))));return result; } @Test void ordinaryInfrastructureDoesNotAutoRegisterOrEnableProvider() { new org.springframework.boot.test.context.runner.ApplicationContextRunner() @@ -34,16 +34,16 @@ static ReactiveIsNewAwareAuditingHandler handler() { .run(app->{assertNull(app.getStartupFailure());assertTrue(app.getBeansOfType(org.springframework.data.auditing.DateTimeProvider.class).isEmpty());assertTrue(app.getBeansOfType(org.springframework.data.auditing.ReactiveAuditingHandler.class).isEmpty());}); } @Test void injectedClockIsNormalizedToUtcAndNullIsRejected() { - var provider=new UtcOffsetDateTimeProvider(Clock.fixed(NOW,ZoneId.of("Asia/Tokyo"))); - assertEquals(OffsetDateTime.ofInstant(NOW,ZoneOffset.UTC),provider.getNow().orElseThrow());assertThrows(NullPointerException.class,()->new UtcOffsetDateTimeProvider(null)); + var provider=new UtcOffsetDateTimeProviderImpl(Clock.fixed(NOW,ZoneId.of("Asia/Tokyo"))); + assertEquals(OffsetDateTime.ofInstant(NOW,ZoneOffset.UTC),provider.getNow().orElseThrow());assertThrows(NullPointerException.class,()->new UtcOffsetDateTimeProviderImpl(null)); } @Test void inheritedFieldsUseStandardCreateAndUpdateAndIsNewDetection() { var handler=handler();var entity=new InheritedAudit();var created=(InheritedAudit)handler.markAudited(entity).block();assertSame(entity,created);assertEquals(NOW,created.created.toInstant());assertEquals(created.created,created.modified); - entity.version=3L;handler.setDateTimeProvider(new UtcOffsetDateTimeProvider(Clock.fixed(NOW.plusSeconds(5),ZoneOffset.UTC)));var updated=(InheritedAudit)handler.markAudited(entity).block();assertEquals(NOW,updated.created.toInstant());assertEquals(NOW.plusSeconds(5),updated.modified.toInstant()); + entity.version=3L;handler.setDateTimeProvider(new UtcOffsetDateTimeProviderImpl(Clock.fixed(NOW.plusSeconds(5),ZoneOffset.UTC)));var updated=(InheritedAudit)handler.markAudited(entity).block();assertEquals(NOW,updated.created.toInstant());assertEquals(NOW.plusSeconds(5),updated.modified.toInstant()); } @Test void standardMappingPreservesImmutableCreateAndUpdateCopies() { var handler=handler();var original=new ImmutableAudit(null,null,null,null);var created=(ImmutableAudit)handler.markAudited(original).block();assertNotSame(original,created);assertNull(original.created());assertEquals(NOW,created.created().toInstant()); - handler.setDateTimeProvider(new UtcOffsetDateTimeProvider(Clock.fixed(NOW.plusSeconds(5),ZoneOffset.UTC)));var updated=(ImmutableAudit)handler.markAudited(new ImmutableAudit("present",1L,created.created(),created.modified())).block();assertEquals(created.created(),updated.created());assertEquals(NOW.plusSeconds(5),updated.modified().toInstant()); + handler.setDateTimeProvider(new UtcOffsetDateTimeProviderImpl(Clock.fixed(NOW.plusSeconds(5),ZoneOffset.UTC)));var updated=(ImmutableAudit)handler.markAudited(new ImmutableAudit("present",1L,created.created(),created.modified())).block();assertEquals(created.created(),updated.created());assertEquals(NOW.plusSeconds(5),updated.modified().toInstant()); } @Test void localOffsetAndInstantFieldsRemainUtcInNonUtcJvm() { var previous=TimeZone.getDefault();try {TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));var handler=handler();var local=(LocalAudit)handler.markAudited(new LocalAudit()).block();var offset=(InheritedAudit)handler.markAudited(new InheritedAudit()).block();var instant=(InstantAudit)handler.markAudited(new InstantAudit()).block();assertEquals(LocalDateTime.ofInstant(NOW,ZoneOffset.UTC),local.created);assertEquals(ZoneOffset.UTC,offset.created.getOffset());assertEquals(NOW,offset.created.toInstant());assertEquals(NOW,instant.created);}finally{TimeZone.setDefault(previous);} diff --git a/modules/r2dbc/src/test/java/org/fireflyframework/core/filters/FilterParameterCustomizerTest.java b/modules/r2dbc/src/test/java/org/fireflyframework/core/filters/FilterParameterCustomizerTest.java index 1024868b2..e0945894a 100644 --- a/modules/r2dbc/src/test/java/org/fireflyframework/core/filters/FilterParameterCustomizerTest.java +++ b/modules/r2dbc/src/test/java/org/fireflyframework/core/filters/FilterParameterCustomizerTest.java @@ -30,7 +30,7 @@ */ class FilterParameterCustomizerTest { - private FilterParameterCustomizer customizer; + private FilterParameterCustomizerImpl customizer; @Mock private HandlerMethod handlerMethod; @@ -38,7 +38,7 @@ class FilterParameterCustomizerTest { @BeforeEach void setUp() { MockitoAnnotations.openMocks(this); - customizer = new FilterParameterCustomizer(); + customizer = new FilterParameterCustomizerImpl(); } @Test diff --git a/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedR2dbcResourcesTest.java b/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedR2dbcResourcesTest.java index eb0f01424..126bb089f 100644 --- a/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedR2dbcResourcesTest.java +++ b/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedR2dbcResourcesTest.java @@ -3,7 +3,7 @@ import java.time.*; import java.util.*; import java.util.concurrent.atomic.AtomicInteger; -import org.fireflyframework.core.transaction.impl.DefaultBoundedRootTransaction; +import org.fireflyframework.core.transaction.impl.DefaultBoundedRootTransactionImpl; import org.junit.jupiter.api.Test; import org.springframework.context.annotation.AnnotationConfigApplicationContext; import org.springframework.core.Ordered; @@ -33,7 +33,7 @@ static final class Probe implements BeforeConvertCallback,Ordered { public Mono onBeforeConvert(AuditProbe value,SqlIdentifier table){assertEquals(RECORDED,value.createdAt());assertEquals("source-auditor",value.createdBy());calls++;return Mono.error(stop);} } @Test void callerManagedTemplatePreservesStrategyConverterAuditingAndRepositoryCallbacks(){ - var driver=new BoundedTransactionBoundaryTest.Driver();var original=new R2dbcEntityTemplate(driver);var owned=new OwnedLeaseConnectionFactory(driver);var client=DatabaseClient.create(owned);var template=new R2dbcEntityTemplate(client,original.getDataAccessStrategy());var probe=new Probe(); + var driver=new BoundedTransactionBoundaryTest.Driver();var original=new R2dbcEntityTemplate(driver);var owned=new OwnedLeaseConnectionFactoryImpl(driver);var client=DatabaseClient.create(owned);var template=new R2dbcEntityTemplate(client,original.getDataAccessStrategy());var probe=new Probe(); var handler=new ReactiveIsNewAwareAuditingHandler(PersistentEntities.of(original.getConverter().getMappingContext()));handler.setAuditorAware(()->Mono.just("source-auditor"));handler.setDateTimeProvider(()->Optional.of(RECORDED)); try(var context=new AnnotationConfigApplicationContext()){ context.registerBean("callerTemplate",R2dbcEntityTemplate.class,()->template);context.registerBean("auditing",ReactiveAuditingEntityCallback.class,()->new ReactiveAuditingEntityCallback(()->handler));context.registerBean("probe",Probe.class,()->probe);context.refresh(); @@ -49,26 +49,26 @@ static final class Probe implements BeforeConvertCallback,Ordered { StepVerifier.withVirtualTime(()->{ var f=new BoundedTransactionBoundaryTest.Fixture();fixture.set(f); var client=DatabaseClient.builder().connectionFactory(f.factory).executeFunction(statement->{calls.incrementAndGet();return statement.execute();}).build();var template=new R2dbcEntityTemplate(client,f.template.getDataAccessStrategy()); - var service=new DefaultBoundedRootTransaction(BoundedR2dbcResources.verify(f.factory,client,template,f.manager),new CleanupPolicy(Duration.ofSeconds(2),Duration.ofSeconds(2))); + var service=new DefaultBoundedRootTransactionImpl(BoundedR2dbcResources.verify(f.factory,client,template,f.manager),new CleanupPolicy(Duration.ofSeconds(2),Duration.ofSeconds(2))); return service.execute(f.original,new DefaultTransactionDefinition(),scope->client.sql("source statement").filter((statement,next)->{filters.incrementAndGet();return next.execute(statement);}).fetch().rowsUpdated()); }).assertNext(value->assertEquals(1L,value.value())).verifyComplete();assertEquals(1,calls.get());assertEquals(1,filters.get());assertEquals(1,fixture.get().driver.creates);assertEquals(1,fixture.get().driver.closes); } @Test void mismatchedFactoryClientTemplateAndManagerRefuseBeforeAcquisition(){ - var own=new BoundedTransactionBoundaryTest.Driver();var foreign=new BoundedTransactionBoundaryTest.Driver();var a=new OwnedLeaseConnectionFactory(own);var b=new OwnedLeaseConnectionFactory(foreign);var client=DatabaseClient.create(a);var template=new R2dbcEntityTemplate(client,org.springframework.data.r2dbc.dialect.PostgresDialect.INSTANCE); + var own=new BoundedTransactionBoundaryTest.Driver();var foreign=new BoundedTransactionBoundaryTest.Driver();var a=new OwnedLeaseConnectionFactoryImpl(own);var b=new OwnedLeaseConnectionFactoryImpl(foreign);var client=DatabaseClient.create(a);var template=new R2dbcEntityTemplate(client,org.springframework.data.r2dbc.dialect.PostgresDialect.INSTANCE); assertThrows(IllegalArgumentException.class,()->BoundedR2dbcResources.verify(a,client,template,new R2dbcTransactionManager(b))); var other=DatabaseClient.create(a);assertThrows(IllegalArgumentException.class,()->BoundedR2dbcResources.verify(a,other,template,new R2dbcTransactionManager(a))); assertThrows(IllegalArgumentException.class,()->BoundedR2dbcResources.verify(b,client,template,new R2dbcTransactionManager(b)));assertEquals(0,own.creates);assertEquals(0,foreign.creates); } @Test void managerFactoryChangedAfterBindingMustRefuseBeforeAnyNewAcquisition(){ - var own=new BoundedTransactionBoundaryTest.Driver();var foreign=new BoundedTransactionBoundaryTest.Driver();var factory=new OwnedLeaseConnectionFactory(own);var client=DatabaseClient.create(factory);var template=new R2dbcEntityTemplate(client,org.springframework.data.r2dbc.dialect.PostgresDialect.INSTANCE);var manager=new R2dbcTransactionManager(factory); + var own=new BoundedTransactionBoundaryTest.Driver();var foreign=new BoundedTransactionBoundaryTest.Driver();var factory=new OwnedLeaseConnectionFactoryImpl(own);var client=DatabaseClient.create(factory);var template=new R2dbcEntityTemplate(client,org.springframework.data.r2dbc.dialect.PostgresDialect.INSTANCE);var manager=new R2dbcTransactionManager(factory); var resources=BoundedR2dbcResources.verify(factory,client,template,manager);manager.setConnectionFactory(foreign); - var service=new DefaultBoundedRootTransaction(resources,new CleanupPolicy(Duration.ofSeconds(2),Duration.ofSeconds(2)));var now=Instant.now();var budget=R2dbcOperationBudget.observed(now,now.plusSeconds(1),System.nanoTime(),Duration.ofSeconds(1),Clock.systemUTC(),System::nanoTime); + var service=new DefaultBoundedRootTransactionImpl(resources,new CleanupPolicy(Duration.ofSeconds(2),Duration.ofSeconds(2)));var now=Instant.now();var budget=R2dbcOperationBudget.observed(now,now.plusSeconds(1),System.nanoTime(),Duration.ofSeconds(1),Clock.systemUTC(),System::nanoTime); StepVerifier.create(service.execute(budget,new DefaultTransactionDefinition(),scope->Mono.just("protected-value"))).expectError(RootTransactionException.class).verify(Duration.ofSeconds(2));assertEquals(0,own.creates);assertEquals(0,foreign.creates);assertEquals(0,foreign.closes); } @Test void unusedApiHasNoAutomaticBeansWrappingOrAcquisition(){ var driver=new BoundedTransactionBoundaryTest.Driver();var client=DatabaseClient.create(driver); try(var context=new AnnotationConfigApplicationContext()){ - context.registerBean("callerClient",DatabaseClient.class,()->client);context.refresh();assertTrue(context.getBeansOfType(BoundedRootTransaction.class).isEmpty());assertTrue(context.getBeansOfType(OwnedLeaseConnectionFactory.class).isEmpty());assertSame(driver,client.getConnectionFactory());assertEquals(0,driver.creates); + context.registerBean("callerClient",DatabaseClient.class,()->client);context.refresh();assertTrue(context.getBeansOfType(BoundedRootTransaction.class).isEmpty());assertTrue(context.getBeansOfType(OwnedLeaseConnectionFactoryImpl.class).isEmpty());assertSame(driver,client.getConnectionFactory());assertEquals(0,driver.creates); } } } diff --git a/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedRootTransactionTest.java b/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedRootTransactionTest.java index 15ee04795..428473d6b 100644 --- a/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedRootTransactionTest.java +++ b/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedRootTransactionTest.java @@ -40,11 +40,11 @@ static final class Driver implements ConnectionFactory { assertEquals(1,d.beginCancelled);assertEquals(0,d.closes);assertEquals(0,d.commits); } static Mono proposedOrOriginal(Driver d) { - var factory=new OwnedLeaseConnectionFactory(d);var client=org.springframework.r2dbc.core.DatabaseClient.create(factory); + var factory=new OwnedLeaseConnectionFactoryImpl(d);var client=org.springframework.r2dbc.core.DatabaseClient.create(factory); var template=new org.springframework.data.r2dbc.core.R2dbcEntityTemplate(client,org.springframework.data.r2dbc.dialect.PostgresDialect.INSTANCE); var resources=BoundedR2dbcResources.verify(factory,client,template,new R2dbcTransactionManager(factory)); var now=Instant.now();var budget=R2dbcOperationBudget.observed(now,now.plusSeconds(5),System.nanoTime(),Duration.ofSeconds(5),Clock.systemUTC(),System::nanoTime); - return new org.fireflyframework.core.transaction.impl.DefaultBoundedRootTransaction(resources,new CleanupPolicy(Duration.ofSeconds(2),Duration.ofSeconds(2))) + return new org.fireflyframework.core.transaction.impl.DefaultBoundedRootTransactionImpl(resources,new CleanupPolicy(Duration.ofSeconds(2),Duration.ofSeconds(2))) .execute(budget,new org.springframework.transaction.support.DefaultTransactionDefinition(),scope->Mono.just("source-value")); } } diff --git a/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedTransactionBoundaryTest.java b/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedTransactionBoundaryTest.java index ec4f42a0c..90ba86693 100644 --- a/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedTransactionBoundaryTest.java +++ b/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/BoundedTransactionBoundaryTest.java @@ -6,7 +6,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.*; import java.util.function.*; -import org.fireflyframework.core.transaction.impl.DefaultBoundedRootTransaction; +import org.fireflyframework.core.transaction.impl.DefaultBoundedRootTransactionImpl; import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import org.springframework.data.r2dbc.core.R2dbcEntityTemplate; @@ -53,11 +53,11 @@ static final class Driver implements ConnectionFactory { } static final class Fixture { final Time time=new Time();final Driver driver=new Driver(); - final OwnedLeaseConnectionFactory factory=new OwnedLeaseConnectionFactory(driver); + final OwnedLeaseConnectionFactoryImpl factory=new OwnedLeaseConnectionFactoryImpl(driver); final DatabaseClient client=DatabaseClient.create(factory); final R2dbcEntityTemplate template=new R2dbcEntityTemplate(client,PostgresDialect.INSTANCE); final R2dbcTransactionManager manager=new R2dbcTransactionManager(factory); - final BoundedRootTransaction service=new DefaultBoundedRootTransaction(BoundedR2dbcResources.verify(factory,client,template,manager),new CleanupPolicy(Duration.ofSeconds(2),Duration.ofSeconds(2))); + final BoundedRootTransaction service=new DefaultBoundedRootTransactionImpl(BoundedR2dbcResources.verify(factory,client,template,manager),new CleanupPolicy(Duration.ofSeconds(2),Duration.ofSeconds(2))); final R2dbcOperationBudget original=time.budget(5000); Mono> execute(Function> work){return service.execute(original,new DefaultTransactionDefinition(),work);} } @@ -107,9 +107,9 @@ static Failed fails(Consumer configure,BiFunction{},(f,s)->{s.narrow(f.time.budget(10000));return Mono.never();},8);assertEquals(0,r.fixture.driver.commits);assertEquals(1,r.fixture.driver.closes); } @Test void foreignFactoryCannotBorrowAnotherInvocationOrBeClosed(){ - var foreign=new Driver();var other=new OwnedLeaseConnectionFactory(foreign);var r=fails(f->{},(f,s)->Mono.from(other.create()).thenReturn("protected-value"),1);assertEquals(0,foreign.creates);assertEquals(0,foreign.closes);assertEquals(1,r.fixture.driver.closes); + var foreign=new Driver();var other=new OwnedLeaseConnectionFactoryImpl(foreign);var r=fails(f->{},(f,s)->Mono.from(other.create()).thenReturn("protected-value"),1);assertEquals(0,foreign.creates);assertEquals(0,foreign.closes);assertEquals(1,r.fixture.driver.closes); } - @Test void wrapperWithoutPrivateInvocationCannotAcquire(){var d=new Driver();StepVerifier.create(Mono.from(new OwnedLeaseConnectionFactory(d).create())).expectError(IllegalStateException.class).verify();assertEquals(0,d.creates);} + @Test void wrapperWithoutPrivateInvocationCannotAcquire(){var d=new Driver();StepVerifier.create(Mono.from(new OwnedLeaseConnectionFactoryImpl(d).create())).expectError(IllegalStateException.class).verify();assertEquals(0,d.creates);} @Test void callerCancellationStillClosesItsOwnBeginLeaseOnce(){ var ref=new AtomicReference();StepVerifier.withVirtualTime(()->{var f=new Fixture();ref.set(f);f.driver.stallBegin=true;return f.execute(s->Mono.just("protected-value"));}).thenAwait(Duration.ofMillis(10)).thenCancel().verify(Duration.ofSeconds(1));assertEquals(1,ref.get().driver.beginCancelled);assertEquals(1,ref.get().driver.closes); } diff --git a/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/RootWorkRejectionTest.java b/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/RootWorkRejectionTest.java index 5689c2e6a..b1f7ab63f 100644 --- a/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/RootWorkRejectionTest.java +++ b/modules/r2dbc/src/test/java/org/fireflyframework/core/transaction/RootWorkRejectionTest.java @@ -6,7 +6,7 @@ import java.util.*; import java.util.concurrent.atomic.*; import java.util.function.*; -import org.fireflyframework.core.transaction.impl.DefaultBoundedRootTransaction; +import org.fireflyframework.core.transaction.impl.DefaultBoundedRootTransactionImpl; import org.junit.jupiter.api.Test; import org.reactivestreams.Publisher; import org.springframework.data.r2dbc.core.R2dbcEntityTemplate; @@ -39,10 +39,10 @@ static final class Driver implements ConnectionFactory { } static final class Fixture { final BoundedTransactionBoundaryTest.Time time=new BoundedTransactionBoundaryTest.Time();final Driver driver=new Driver(); - final OwnedLeaseConnectionFactory factory=new OwnedLeaseConnectionFactory(driver); + final OwnedLeaseConnectionFactoryImpl factory=new OwnedLeaseConnectionFactoryImpl(driver); final DatabaseClient client=DatabaseClient.create(factory);final R2dbcEntityTemplate template=new R2dbcEntityTemplate(client,PostgresDialect.INSTANCE); final R2dbcTransactionManager manager=new R2dbcTransactionManager(factory); - final BoundedRootTransaction root=new DefaultBoundedRootTransaction(BoundedR2dbcResources.verify(factory,client,template,manager),new CleanupPolicy(Duration.ofSeconds(2),Duration.ofSeconds(2))); + final BoundedRootTransaction root=new DefaultBoundedRootTransactionImpl(BoundedR2dbcResources.verify(factory,client,template,manager),new CleanupPolicy(Duration.ofSeconds(2),Duration.ofSeconds(2))); final R2dbcOperationBudget budget=time.budget(5000); Mono> execute(Function> work){return root.execute(budget,new DefaultTransactionDefinition(),work);} } diff --git a/modules/rule-engine/docs/architecture.md b/modules/rule-engine/docs/architecture.md index 27e6811de..27e429aca 100644 --- a/modules/rule-engine/docs/architecture.md +++ b/modules/rule-engine/docs/architecture.md @@ -156,9 +156,9 @@ Key Components: - AST Parser: `ASTRulesDSLParser` - Converts YAML to structured AST nodes - AST Validation: `YamlDslValidator` - Comprehensive DSL validation using AST - AST Visitors: - - `ExpressionEvaluator` - Evaluates expressions using visitor pattern - - `ActionExecutor` - Executes actions using visitor pattern - - `ValidationVisitor` - Validates AST nodes for semantic correctness + - `ExpressionEvaluatorImpl` - Evaluates expressions using visitor pattern + - `ActionExecutorImpl` - Executes actions using visitor pattern + - `ValidationVisitorImpl` - Validates AST nodes for semantic correctness - `VariableReferenceCollector` - Extracts variable references for constant loading - AST Model: Complete hierarchy of AST node classes - Services: `RuleDefinitionService`, `RulesEvaluationService`, `ConstantService`, `AuditTrailService` - Business logic services @@ -240,21 +240,21 @@ The system uses a comprehensive AST node hierarchy: ``` ASTNode (abstract base) ├── Expression -│ ├── LiteralExpression (numbers, strings, booleans) -│ ├── VariableExpression (variable references) -│ ├── BinaryExpression (arithmetic operations) -│ ├── FunctionCallExpression (function calls) +│ ├── LiteralExpressionImpl (numbers, strings, booleans) +│ ├── VariableExpressionImpl (variable references) +│ ├── BinaryExpressionImpl (arithmetic operations) +│ ├── FunctionCallExpressionImpl (function calls) │ └── ListExpression (array literals) ├── Condition -│ ├── ComparisonCondition (>, <, ==, etc.) -│ ├── LogicalCondition (AND, OR, NOT) +│ ├── ComparisonConditionImpl (>, <, ==, etc.) +│ ├── LogicalConditionImpl (AND, OR, NOT) │ ├── ListCondition (in, not_in) │ └── ValidationCondition (is_null, is_empty, etc.) └── Action - ├── SetAction (variable assignment) - ├── CalculateAction (arithmetic calculations) - ├── FunctionCallAction (function execution) - └── CircuitBreakerAction (execution control) + ├── SetActionImpl (variable assignment) + ├── CalculateActionImpl (arithmetic calculations) + ├── FunctionCallActionImpl (function execution) + └── CircuitBreakerActionImpl (execution control) ``` ## Data Flow @@ -289,14 +289,14 @@ sequenceDiagram ASTEngine->>Database: loadSystemConstants() Database-->>Context: setSystemConstants() - ASTEngine->>Visitors: ExpressionEvaluator.visit(conditions) + ASTEngine->>Visitors: ExpressionEvaluatorImpl.visit(conditions) Visitors->>Context: getValue(variableName) Context-->>Visitors: resolved value alt Conditions Met - ASTEngine->>Visitors: ActionExecutor.visit(thenActions) + ASTEngine->>Visitors: ActionExecutorImpl.visit(thenActions) else Conditions Not Met - ASTEngine->>Visitors: ActionExecutor.visit(elseActions) + ASTEngine->>Visitors: ActionExecutorImpl.visit(elseActions) end Visitors->>Context: setComputedVariable() @@ -332,8 +332,8 @@ sequenceDiagram ASTEngine->>Database: loadSystemConstants() Database-->>Context: setSystemConstants() - ASTEngine->>Visitors: ExpressionEvaluator.visit(conditions) - ASTEngine->>Visitors: ActionExecutor.visit(actions) + ASTEngine->>Visitors: ExpressionEvaluatorImpl.visit(conditions) + ASTEngine->>Visitors: ActionExecutorImpl.visit(actions) ASTEngine-->>RuleService: ASTRulesEvaluationResult RuleService-->>Controller: ASTRulesEvaluationResult else Rule Not Found or Inactive @@ -351,7 +351,7 @@ sequenceDiagram participant RuleService participant YamlValidator participant ASTParser - participant ValidationVisitor + participant ValidationVisitorImpl participant Database Client->>Controller: POST /api/v1/rules/definitions @@ -362,8 +362,8 @@ sequenceDiagram YamlValidator->>ASTParser: parseRules(yamlContent) ASTParser-->>YamlValidator: ASTRulesDSL object YamlValidator->>YamlValidator: performDSLReferenceValidation() - YamlValidator->>ValidationVisitor: visit(astNodes) - ValidationVisitor-->>YamlValidator: List + YamlValidator->>ValidationVisitorImpl: visit(astNodes) + ValidationVisitorImpl-->>YamlValidator: List YamlValidator->>YamlValidator: performNamingValidation() YamlValidator->>YamlValidator: performOperatorValidation() @@ -511,7 +511,7 @@ RulesEvaluationResult result = RulesEvaluationResult.builder() ``` ### 3. Template Method Pattern -Used in `ActionExecutor` for different action types: +Used in `ActionExecutorImpl` for different action types: ```java public void execute(ActionBlock actionBlock, EvaluationContext context) { @@ -533,7 +533,7 @@ public Object resolveValue(Object value, EvaluationContext context) { ``` ### 5. Registry Pattern -Used in both `ConditionEvaluator` and `ActionExecutor` for function registries: +Used in both `ConditionEvaluator` and `ActionExecutorImpl` for function registries: ```java // ConditionEvaluator function registry @@ -544,7 +544,7 @@ switch (functionName.toLowerCase()) { // ... more financial validation functions } -// ActionExecutor function registry +// ActionExecutorImpl function registry switch (functionName.toLowerCase()) { case "calculate_loan_payment": return calculateLoanPayment(parameters); case "calculate_compound_interest": return calculateCompoundInterest(parameters); @@ -570,13 +570,13 @@ Core Features: The system uses the visitor pattern for all AST operations: -#### 1. ExpressionEvaluator Visitor +#### 1. ExpressionEvaluatorImpl Visitor Evaluates expressions to their values using structured AST traversal: ```java -public class ExpressionEvaluator implements ASTVisitor { +public class ExpressionEvaluatorImpl implements ASTVisitor { @Override - public Object visitBinaryExpression(BinaryExpression node) { + public Object visitBinaryExpression(BinaryExpressionImpl node) { // Short-circuit AND/OR before eager evaluation if (node.getOperator() == BinaryOperator.AND) { return toBoolean(node.getLeft().accept(this)) && toBoolean(node.getRight().accept(this)); @@ -590,26 +590,26 @@ public class ExpressionEvaluator implements ASTVisitor { } @Override - public Object visitVariableExpression(VariableExpression node) { + public Object visitVariableExpression(VariableExpressionImpl node) { return context.getValue(node.getVariableName()); } } ``` -#### 2. ActionExecutor Visitor +#### 2. ActionExecutorImpl Visitor Executes actions using structured AST traversal: ```java -public class ActionExecutor implements ASTVisitor { +public class ActionExecutorImpl implements ASTVisitor { @Override - public Void visitSetAction(SetAction node) { + public Void visitSetAction(SetActionImpl node) { Object value = node.getValue().accept(expressionEvaluator); context.setComputedVariable(node.getVariableName(), value); return null; } @Override - public Void visitCalculateAction(CalculateAction node) { + public Void visitCalculateAction(CalculateActionImpl node) { Object result = node.getExpression().accept(expressionEvaluator); context.setComputedVariable(node.getVariableName(), result); return null; @@ -617,13 +617,13 @@ public class ActionExecutor implements ASTVisitor { } ``` -#### 3. ValidationVisitor +#### 3. ValidationVisitorImpl Validates AST nodes for semantic correctness: ```java -public class ValidationVisitor implements ASTVisitor> { +public class ValidationVisitorImpl implements ASTVisitor> { @Override - public List visitVariableExpression(VariableExpression node) { + public List visitVariableExpression(VariableExpressionImpl node) { List errors = new ArrayList<>(); if (!availableVariables.contains(node.getVariableName())) { errors.add(new ValidationError("Undefined variable: " + node.getVariableName())); @@ -652,7 +652,7 @@ The AST engine implements circuit breaker functionality through dedicated action ```java @Override -public Void visitCircuitBreakerAction(CircuitBreakerAction node) { +public Void visitCircuitBreakerAction(CircuitBreakerActionImpl node) { context.setCircuitBreakerTriggered(true); context.setCircuitBreakerMessage(node.getMessage()); return null; // Stop execution @@ -698,7 +698,7 @@ graph TD - Data Types: Validates correct data types for each section #### 2. AST-Based Semantic Validation -- Variable References: Validates all variable references using `ValidationVisitor` +- Variable References: Validates all variable references using `ValidationVisitorImpl` - Type Compatibility: Ensures type compatibility in expressions and conditions - Function Calls: Validates function names and parameter counts - Circular Dependencies: Detects circular references in variable calculations @@ -1151,8 +1151,8 @@ The `RestCallServiceImpl` includes comprehensive URL validation before executing - Host validation: URLs without a valid host are rejected ### 3. Safe Code Evaluation -- No unsafe reflection: `ExpressionEvaluator.getPropertyValue()` uses public getter methods only (`getX` / `isX`); `field.setAccessible(true)` is never called. A missing getter throws `IllegalArgumentException` with the class + property name rather than silently returning null. -- Division/modulo by zero: `ExpressionEvaluator` and `ActionExecutor` throw `ArithmeticException` rather than returning null or silently failing. +- No unsafe reflection: `ExpressionEvaluatorImpl.getPropertyValue()` uses public getter methods only (`getX` / `isX`); `field.setAccessible(true)` is never called. A missing getter throws `IllegalArgumentException` with the class + property name rather than silently returning null. +- Division/modulo by zero: `ExpressionEvaluatorImpl` and `ActionExecutorImpl` throw `ArithmeticException` rather than returning null or silently failing. - Short-circuit evaluation: AND/OR operators use lazy evaluation to prevent unnecessary side effects. ### 4. Error Handling (Fail-Loud Contract) diff --git a/modules/rule-engine/docs/developer-guide.md b/modules/rule-engine/docs/developer-guide.md index 883d1b379..a2d51eccc 100644 --- a/modules/rule-engine/docs/developer-guide.md +++ b/modules/rule-engine/docs/developer-guide.md @@ -84,9 +84,9 @@ The AST system follows a multi-layered architecture that separates concerns and │ Parsing Layer │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │ │ │ YAML Parser │ │ DSL Parser │ │ Specialized Parsers │ │ -│ │ │ │ (Main) │ │ • ExpressionParser │ │ -│ │ │ │ │ │ • ConditionParser │ │ -│ │ │ │ │ │ • ActionParser │ │ +│ │ │ │ (Main) │ │ • ExpressionParserImpl │ │ +│ │ │ │ │ │ • ConditionParserImpl │ │ +│ │ │ │ │ │ • ActionParserImpl │ │ │ └─────────────┘ └─────────────┘ └─────────────────────────┘ │ └─────────────────────────────────────────────────────────────────┘ │ @@ -95,11 +95,11 @@ The AST system follows a multi-layered architecture that separates concerns and │ AST Model Layer │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │ │ │ Expression │ │ Condition │ │ Action Nodes │ │ -│ │ Nodes │ │ Nodes │ │ • SetAction │ │ -│ │ • Binary │ │ • Comparison│ │ • CalculateAction │ │ -│ │ • Unary │ │ • Logical │ │ • FunctionCallAction │ │ -│ │ • Literal │ │ • Expression│ │ • ConditionalAction │ │ -│ │ • Variable │ │ │ │ • CircuitBreakerAction │ │ +│ │ Nodes │ │ Nodes │ │ • SetActionImpl │ │ +│ │ • Binary │ │ • Comparison│ │ • CalculateActionImpl │ │ +│ │ • Unary │ │ • Logical │ │ • FunctionCallActionImpl │ │ +│ │ • Literal │ │ • Expression│ │ • ConditionalActionImpl │ │ +│ │ • Variable │ │ │ │ • CircuitBreakerActionImpl │ │ │ │ • Function │ │ │ │ │ │ │ └─────────────┘ └─────────────┘ └─────────────────────────┘ │ └─────────────────────────────────────────────────────────────────┘ @@ -109,7 +109,7 @@ The AST system follows a multi-layered architecture that separates concerns and │ Visitor Pattern Layer │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────────┐ │ │ │ Expression │ │ Action │ │ Validation & Analysis │ │ -│ │ Evaluator │ │ Executor │ │ • ValidationVisitor │ │ +│ │ Evaluator │ │ Executor │ │ • ValidationVisitorImpl │ │ │ │ │ │ │ │ • VariableCollector │ │ │ │ │ │ │ │ • TypeChecker │ │ │ └─────────────┘ └─────────────┘ └─────────────────────────┘ │ @@ -158,10 +158,10 @@ Why Tokenization Matters: This step converts raw text into meaningful symbols th Tokens are assembled into AST nodes using recursive descent parsing: ``` -ComparisonCondition -├── left: VariableExpression("creditScore") +ComparisonConditionImpl +├── left: VariableExpressionImpl("creditScore") ├── operator: GREATER_THAN -└── right: VariableExpression("MIN_CREDIT_SCORE") +└── right: VariableExpressionImpl("MIN_CREDIT_SCORE") ``` Recursive Descent Parsing: This is a top-down parsing technique where each grammar rule is implemented as a method. The parser starts with high-level constructs and recursively breaks them down into smaller components. @@ -200,48 +200,48 @@ org.fireflyframework.rules.core.dsl.ast/ │ └── LexerException.java # Lexer-specific exceptions ├── parser/ # Parsing components │ ├── DSLParser.java # Main DSL parser coordinator -│ ├── ExpressionParser.java # Expression parsing (arithmetic, logical) -│ ├── ConditionParser.java # Condition parsing (comparisons, validations) -│ ├── ActionParser.java # Action parsing (assignments, calculations) +│ ├── ExpressionParserImpl.java # Expression parsing (arithmetic, logical) +│ ├── ConditionParserImpl.java # Condition parsing (comparisons, validations) +│ ├── ActionParserImpl.java # Action parsing (assignments, calculations) │ ├── ASTRulesDSLParser.java # YAML to AST converter │ └── BaseParser.java # Common parsing utilities ├── expression/ # Expression AST nodes │ ├── Expression.java # Base expression class -│ ├── BinaryExpression.java # Binary operations (+, -, *, /, %, **, comparisons) -│ ├── UnaryExpression.java # Unary operations (-, !, validation ops) -│ ├── LiteralExpression.java # Literal values (numbers, strings, booleans, arrays) -│ ├── VariableExpression.java # Variable references with property/index access -│ ├── FunctionCallExpression.java # Function calls with parameters +│ ├── BinaryExpressionImpl.java # Binary operations (+, -, *, /, %, **, comparisons) +│ ├── UnaryExpressionImpl.java # Unary operations (-, !, validation ops) +│ ├── LiteralExpressionImpl.java # Literal values (numbers, strings, booleans, arrays) +│ ├── VariableExpressionImpl.java # Variable references with property/index access +│ ├── FunctionCallExpressionImpl.java # Function calls with parameters │ ├── BinaryOperator.java # Binary operator enumeration │ ├── UnaryOperator.java # Unary operator enumeration │ └── ExpressionType.java # Expression type enumeration ├── condition/ # Condition AST nodes │ ├── Condition.java # Base condition class -│ ├── ComparisonCondition.java # Comparison operations (>, <, ==, between, in_list, etc.) -│ ├── LogicalCondition.java # Logical operations (AND, OR, NOT) -│ ├── ExpressionCondition.java # Expression-based conditions +│ ├── ComparisonConditionImpl.java # Comparison operations (>, <, ==, between, in_list, etc.) +│ ├── LogicalConditionImpl.java # Logical operations (AND, OR, NOT) +│ ├── ExpressionConditionImpl.java # Expression-based conditions │ └── ComparisonOperator.java # Comparison operator enumeration ├── action/ # Action AST nodes │ ├── Action.java # Base action class -│ ├── SetAction.java # Variable assignment (`set var to value`) -│ ├── CalculateAction.java # Pure-math arithmetic (`calculate var as expr`) -│ ├── RunAction.java # Function-call assignment (`run var as fn(...)`) -│ ├── FunctionCallAction.java # Standalone function execution (`call fn with [...]`) -│ ├── ConditionalAction.java # Inline if-then-else as an action -│ ├── ArithmeticAction.java # `add`/`subtract`/`multiply`/`divide` X to/from/by var -│ ├── ListAction.java # List operations (append, prepend, remove) -│ ├── CircuitBreakerAction.java # Early termination with a structured message -│ ├── ForEachAction.java # `forEach item in items: ...` -│ ├── WhileAction.java # `while condition: ...` -│ └── DoWhileAction.java # `do: ... while condition` +│ ├── SetActionImpl.java # Variable assignment (`set var to value`) +│ ├── CalculateActionImpl.java # Pure-math arithmetic (`calculate var as expr`) +│ ├── RunActionImpl.java # Function-call assignment (`run var as fn(...)`) +│ ├── FunctionCallActionImpl.java # Standalone function execution (`call fn with [...]`) +│ ├── ConditionalActionImpl.java # Inline if-then-else as an action +│ ├── ArithmeticActionImpl.java # `add`/`subtract`/`multiply`/`divide` X to/from/by var +│ ├── ListActionImpl.java # List operations (append, prepend, remove) +│ ├── CircuitBreakerActionImpl.java # Early termination with a structured message +│ ├── ForEachActionImpl.java # `forEach item in items: ...` +│ ├── WhileActionImpl.java # `while condition: ...` +│ └── DoWhileActionImpl.java # `do: ... while condition` ├── function/ # Extension point for user-defined functions │ ├── RuleFunction.java # Functional interface: `Object apply(Object[] args)` │ └── CustomFunctionRegistry.java # @Component holding registered functions ├── visitor/ # Visitor pattern implementations │ ├── EvaluationContext.java # Execution context and state -│ ├── ExpressionEvaluator.java # Expression evaluation visitor -│ ├── ActionExecutor.java # Action execution visitor -│ ├── ValidationVisitor.java # AST validation visitor +│ ├── ExpressionEvaluatorImpl.java # Expression evaluation visitor +│ ├── ActionExecutorImpl.java # Action execution visitor +│ ├── ValidationVisitorImpl.java # AST validation visitor │ ├── VariableReferenceCollector.java # Variable extraction visitor │ └── ValidationError.java # Validation error representation ├── model/ # AST model classes @@ -665,27 +665,27 @@ Key Design Decisions: ``` ASTNode (abstract base) ├── Expression (abstract) -│ ├── LiteralExpression # numbers, strings, booleans, null, array literals -│ ├── VariableExpression # variable refs with optional property path / index access -│ ├── BinaryExpression # +, -, *, /, %, **, comparisons, and/or, contains, starts_with, etc. -│ ├── UnaryExpression # -, +, NOT, EXISTS, IS_NULL, IS_EMAIL, IS_POSITIVE, etc. -│ └── FunctionCallExpression # math, string, date, list, financial, validation, REST, JSON funcs +│ ├── LiteralExpressionImpl # numbers, strings, booleans, null, array literals +│ ├── VariableExpressionImpl # variable refs with optional property path / index access +│ ├── BinaryExpressionImpl # +, -, *, /, %, **, comparisons, and/or, contains, starts_with, etc. +│ ├── UnaryExpressionImpl # -, +, NOT, EXISTS, IS_NULL, IS_EMAIL, IS_POSITIVE, etc. +│ └── FunctionCallExpressionImpl # math, string, date, list, financial, validation, REST, JSON funcs ├── Condition (abstract) -│ ├── ComparisonCondition # `>=`, `at_least`, `between ... and ...`, `in_list [...]`, `is_email`, etc. -│ ├── LogicalCondition # AND / OR / NOT composition -│ └── ExpressionCondition # wraps any boolean-valued Expression +│ ├── ComparisonConditionImpl # `>=`, `at_least`, `between ... and ...`, `in_list [...]`, `is_email`, etc. +│ ├── LogicalConditionImpl # AND / OR / NOT composition +│ └── ExpressionConditionImpl # wraps any boolean-valued Expression └── Action (abstract) - ├── SetAction # `set var to value` - ├── CalculateAction # `calculate var as ` - ├── RunAction # `run var as ` - ├── FunctionCallAction # `call fn with [args]` - ├── ConditionalAction # `if cond then actions [else actions]` - ├── ArithmeticAction # `add X to var`, `subtract X from var`, `multiply var by X`, `divide var by X` - ├── ListAction # `append X to list`, `prepend X to list`, `remove X from list` - ├── ForEachAction # `forEach item[, index] in items: actions` - ├── WhileAction # `while cond: actions` - ├── DoWhileAction # `do: actions while cond` - └── CircuitBreakerAction # `circuit_breaker "MESSAGE"` -- early termination + ├── SetActionImpl # `set var to value` + ├── CalculateActionImpl # `calculate var as ` + ├── RunActionImpl # `run var as ` + ├── FunctionCallActionImpl # `call fn with [args]` + ├── ConditionalActionImpl # `if cond then actions [else actions]` + ├── ArithmeticActionImpl # `add X to var`, `subtract X from var`, `multiply var by X`, `divide var by X` + ├── ListActionImpl # `append X to list`, `prepend X to list`, `remove X from list` + ├── ForEachActionImpl # `forEach item[, index] in items: actions` + ├── WhileActionImpl # `while cond: actions` + ├── DoWhileActionImpl # `do: actions while cond` + └── CircuitBreakerActionImpl # `circuit_breaker "MESSAGE"` -- early termination ``` > Note: The DSL was simplified in 2026-05 to remove orphan AST classes that were never produced by the parser. The compound-assignment family (`+=`, `-=`, etc.) and the multi-operand `ArithmeticExpression` n-ary form are no longer present. Use `add`/`subtract`/`multiply`/`divide` arithmetic actions or `calculate`/`run` with `+`/`-`/`*`/`/` for the same outcomes. @@ -773,7 +773,7 @@ Examples: Binary Expression Design: ```java -public class BinaryExpression extends Expression { +public class BinaryExpressionImpl extends Expression { private final Expression left; // Left operand (can be any expression) private final BinaryOperator operator; // The operation to perform private final Expression right; // Right operand (can be any expression) @@ -815,13 +815,13 @@ Example AST Structure: For the expression `(income + bonus) > threshold`: ``` -BinaryExpression (>) -├── left: BinaryExpression (+) -│ ├── left: VariableExpression("income") +BinaryExpressionImpl (>) +├── left: BinaryExpressionImpl (+) +│ ├── left: VariableExpressionImpl("income") │ ├── operator: ADD -│ └── right: VariableExpression("bonus") +│ └── right: VariableExpressionImpl("bonus") ├── operator: GREATER_THAN -└── right: VariableExpression("threshold") +└── right: VariableExpressionImpl("threshold") ``` #### Binary Operators: The Heart of Expression Evaluation @@ -898,7 +898,7 @@ Unary expressions handle operations on a single operand, including validation op ````java @Data @EqualsAndHashCode(callSuper = true) -public class UnaryExpression extends Expression { +public class UnaryExpressionImpl extends Expression { private final UnaryOperator operator; private final Expression operand; @@ -988,7 +988,7 @@ Handle comparisons between expressions using various operators: ````java @Data @EqualsAndHashCode(callSuper = true) -public class ComparisonCondition extends Condition { +public class ComparisonConditionImpl extends Condition { private final Expression left; private final ComparisonOperator operator; private final Expression right; // Optional for unary operators @@ -1077,7 +1077,7 @@ The most common action type for variable assignment: ````java @Data @EqualsAndHashCode(callSuper = true) -public class SetAction extends Action { +public class SetActionImpl extends Action { private final String variableName; private final Expression value; @@ -1105,7 +1105,7 @@ For arithmetic calculations with result assignment: ````java @Data @EqualsAndHashCode(callSuper = true) -public class CalculateAction extends Action { +public class CalculateActionImpl extends Action { private final String resultVariable; private final Expression expression; @@ -1116,7 +1116,7 @@ public class CalculateAction extends Action { @Override public String toDebugString() { - return String.format("CalculateAction(result=%s, expr=%s)", + return String.format("CalculateActionImpl(result=%s, expr=%s)", resultVariable, expression.toDebugString()); } } @@ -1132,9 +1132,9 @@ The parsing system uses a recursive descent parser architecture with separate pa ``` DSLParser (Main Coordinator) -├── ExpressionParser (Arithmetic, logical, function calls) -├── ConditionParser (Comparisons, validations, logical conditions) -├── ActionParser (Assignments, calculations, function calls) +├── ExpressionParserImpl (Arithmetic, logical, function calls) +├── ConditionParserImpl (Comparisons, validations, logical conditions) +├── ActionParserImpl (Assignments, calculations, function calls) └── BaseParser (Common parsing utilities) ``` @@ -1152,19 +1152,19 @@ public class DSLParser extends BaseParser { } List tokens = lexer.tokenize(expressionStr); - ExpressionParser parser = new ExpressionParser(tokens); + ExpressionParserImpl parser = new ExpressionParserImpl(tokens); return parser.parseExpression(); } public Condition parseCondition(String conditionStr) { List tokens = lexer.tokenize(conditionStr); - ConditionParser parser = new ConditionParser(tokens); + ConditionParserImpl parser = new ConditionParserImpl(tokens); return parser.parseCondition(); } public Action parseAction(String actionStr) { List tokens = lexer.tokenize(actionStr); - ActionParser parser = new ActionParser(tokens); + ActionParserImpl parser = new ActionParserImpl(tokens); return parser.parseAction(); } } @@ -1172,10 +1172,10 @@ public class DSLParser extends BaseParser { ### 📊 Expression Parser -The `ExpressionParser` handles arithmetic, logical, and function call expressions using operator precedence parsing: +The `ExpressionParserImpl` handles arithmetic, logical, and function call expressions using operator precedence parsing: ````java -public class ExpressionParser extends BaseParser { +public class ExpressionParserImpl extends BaseParser { public Expression parseExpression() { return logicalOr(); @@ -1187,7 +1187,7 @@ public class ExpressionParser extends BaseParser { while (match(TokenType.OR)) { BinaryOperator operator = BinaryOperator.OR; Expression right = logicalAnd(); - expr = new BinaryExpression(null, expr, operator, right); + expr = new BinaryExpressionImpl(null, expr, operator, right); } return expr; @@ -1199,7 +1199,7 @@ public class ExpressionParser extends BaseParser { while (match(TokenType.AND)) { BinaryOperator operator = BinaryOperator.AND; Expression right = equality(); - expr = new BinaryExpression(null, expr, operator, right); + expr = new BinaryExpressionImpl(null, expr, operator, right); } return expr; @@ -1211,7 +1211,7 @@ public class ExpressionParser extends BaseParser { while (matchAny(TokenType.EQUALS, TokenType.NOT_EQUALS)) { BinaryOperator operator = mapTokenToBinaryOperator(previous().getType()); Expression right = comparison(); - expr = new BinaryExpression(null, expr, operator, right); + expr = new BinaryExpressionImpl(null, expr, operator, right); } return expr; @@ -1221,10 +1221,10 @@ public class ExpressionParser extends BaseParser { ### 🔍 Condition Parser -The `ConditionParser` specializes in parsing comparison and logical conditions: +The `ConditionParserImpl` specializes in parsing comparison and logical conditions: ````java -public class ConditionParser extends BaseParser { +public class ConditionParserImpl extends BaseParser { public Condition parseCondition() { return logicalOr(); @@ -1235,7 +1235,7 @@ public class ConditionParser extends BaseParser { while (match(TokenType.OR)) { Condition right = logicalAnd(); - condition = new LogicalCondition(null, condition, LogicalOperator.OR, right); + condition = new LogicalConditionImpl(null, condition, LogicalOperator.OR, right); } return condition; @@ -1246,14 +1246,14 @@ public class ConditionParser extends BaseParser { if (matchValidationOperator()) { ComparisonOperator operator = mapTokenToComparisonOperator(previous().getType()); - return new ComparisonCondition(null, left, operator, null, null); + return new ComparisonConditionImpl(null, left, operator, null, null); } if (match(TokenType.BETWEEN)) { Expression min = expressionParser.parseExpressionWithoutLogical(); consume(TokenType.AND, "Expected 'and' in between expression"); Expression max = expressionParser.parseExpressionWithoutLogical(); - return new ComparisonCondition(null, left, ComparisonOperator.BETWEEN, min, max); + return new ComparisonConditionImpl(null, left, ComparisonOperator.BETWEEN, min, max); } // Handle other comparison operators... @@ -1263,10 +1263,10 @@ public class ConditionParser extends BaseParser { ### ⚡ Action Parser -The `ActionParser` handles all action types including assignments and function calls: +The `ActionParserImpl` handles all action types including assignments and function calls: ````java -public class ActionParser extends BaseParser { +public class ActionParserImpl extends BaseParser { public Action parseAction() { if (match(TokenType.SET)) { @@ -1292,11 +1292,11 @@ public class ActionParser extends BaseParser { throw error("Expected action statement"); } - private SetAction parseSetAction() { + private SetActionImpl parseSetAction() { String variableName = consume(TokenType.IDENTIFIER, "Expected variable name").getLexeme(); consume(TokenType.TO, "Expected 'to' after variable name"); Expression value = expressionParser.parseExpression(); - return new SetAction(null, variableName, value); + return new SetActionImpl(null, variableName, value); } } ```` @@ -1311,7 +1311,7 @@ The Visitor Pattern is a behavioral design pattern that allows you to define new The Problem It Solves: -Imagine you have an AST with many node types (BinaryExpression, VariableExpression, SetAction, etc.). You want to perform different operations on these nodes: +Imagine you have an AST with many node types (BinaryExpressionImpl, VariableExpressionImpl, SetActionImpl, etc.). You want to perform different operations on these nodes: - Evaluate expressions - Validate syntax - Optimize the AST @@ -1347,8 +1347,8 @@ public abstract class ASTNode { // Operations are separate visitor classes public interface ASTVisitor { - T visitBinaryExpression(BinaryExpression node); - T visitVariableExpression(VariableExpression node); + T visitBinaryExpression(BinaryExpressionImpl node); + T visitVariableExpression(VariableExpressionImpl node); // ... one method for each node type } ``` @@ -1367,29 +1367,29 @@ The `ASTVisitor` interface is the heart of the visitor pattern implementation: public interface ASTVisitor { // Expression visitors - handle value computation - T visitBinaryExpression(BinaryExpression node); // a + b, a > b, a and b, etc. - T visitUnaryExpression(UnaryExpression node); // -a, !a, is_positive(a) - T visitVariableExpression(VariableExpression node); // creditScore, user.profile.name - T visitLiteralExpression(LiteralExpression node); // 42, "hello", true, [1,2,3] - T visitFunctionCallExpression(FunctionCallExpression node); // max(a, b), if_else(...), coalesce(...), rest_get(...), json_get(...) + T visitBinaryExpression(BinaryExpressionImpl node); // a + b, a > b, a and b, etc. + T visitUnaryExpression(UnaryExpressionImpl node); // -a, !a, is_positive(a) + T visitVariableExpression(VariableExpressionImpl node); // creditScore, user.profile.name + T visitLiteralExpression(LiteralExpressionImpl node); // 42, "hello", true, [1,2,3] + T visitFunctionCallExpression(FunctionCallExpressionImpl node); // max(a, b), if_else(...), coalesce(...), rest_get(...), json_get(...) // Condition visitors - handle boolean logic - T visitComparisonCondition(ComparisonCondition node); // a > b, a between x and y, etc. - T visitLogicalCondition(LogicalCondition node); // a AND b, a OR b, NOT a - T visitExpressionCondition(ExpressionCondition node); // any Expression as a condition + T visitComparisonCondition(ComparisonConditionImpl node); // a > b, a between x and y, etc. + T visitLogicalCondition(LogicalConditionImpl node); // a AND b, a OR b, NOT a + T visitExpressionCondition(ExpressionConditionImpl node); // any Expression as a condition // Action visitors - handle state changes - T visitSetAction(SetAction node); // set var to value - T visitCalculateAction(CalculateAction node); // calculate var as expr (pure-math only) - T visitRunAction(RunAction node); // run var as fn(...) / json_get(...) / rest_*(...) - T visitFunctionCallAction(FunctionCallAction node); // call fn with [args] - T visitConditionalAction(ConditionalAction node); // if cond then ... else ... - T visitArithmeticAction(ArithmeticAction node); // add/subtract/multiply/divide ... to/from/by var - T visitListAction(ListAction node); // append/prepend/remove ... to/from list - T visitCircuitBreakerAction(CircuitBreakerAction node); // circuit_breaker "MESSAGE" - T visitForEachAction(ForEachAction node); // forEach item[, index] in items: actions - T visitWhileAction(WhileAction node); // while cond: actions - T visitDoWhileAction(DoWhileAction node); // do: actions while cond + T visitSetAction(SetActionImpl node); // set var to value + T visitCalculateAction(CalculateActionImpl node); // calculate var as expr (pure-math only) + T visitRunAction(RunActionImpl node); // run var as fn(...) / json_get(...) / rest_*(...) + T visitFunctionCallAction(FunctionCallActionImpl node); // call fn with [args] + T visitConditionalAction(ConditionalActionImpl node); // if cond then ... else ... + T visitArithmeticAction(ArithmeticActionImpl node); // add/subtract/multiply/divide ... to/from/by var + T visitListAction(ListActionImpl node); // append/prepend/remove ... to/from list + T visitCircuitBreakerAction(CircuitBreakerActionImpl node); // circuit_breaker "MESSAGE" + T visitForEachAction(ForEachActionImpl node); // forEach item[, index] in items: actions + T visitWhileAction(WhileActionImpl node); // while cond: actions + T visitDoWhileAction(DoWhileActionImpl node); // do: actions while cond } ``` @@ -1404,19 +1404,19 @@ Key Design Decisions: What is the Expression Evaluator? -The `ExpressionEvaluator` is a concrete implementation of the `ASTVisitor` interface that traverses an AST and computes the actual values of expressions. It's the component that transforms the abstract syntax tree into concrete results. +The `ExpressionEvaluatorImpl` is a concrete implementation of the `ASTVisitor` interface that traverses an AST and computes the actual values of expressions. It's the component that transforms the abstract syntax tree into concrete results. How the Visitor Pattern Works in Practice: ```java -public class ExpressionEvaluator implements ASTVisitor { +public class ExpressionEvaluatorImpl implements ASTVisitor { private final EvaluationContext context; // Contains variables and state private final RestCallService restCallService; // For REST API calls private final JsonPathService jsonPathService; // For JSON path queries @Override - public Object visitBinaryExpression(BinaryExpression node) { + public Object visitBinaryExpression(BinaryExpressionImpl node) { // Step 1: Recursively evaluate left operand Object leftValue = node.getLeft().accept(this); @@ -1428,7 +1428,7 @@ public class ExpressionEvaluator implements ASTVisitor { } @Override - public Object visitUnaryExpression(UnaryExpression node) { + public Object visitUnaryExpression(UnaryExpressionImpl node) { // Step 1: Recursively evaluate the operand Object operandValue = node.getOperand().accept(this); @@ -1445,19 +1445,19 @@ public class ExpressionEvaluator implements ASTVisitor { } @Override - public Object visitVariableExpression(VariableExpression node) { + public Object visitVariableExpression(VariableExpressionImpl node) { // Look up variable value in the evaluation context return context.getVariable(node.getVariableName()); } @Override - public Object visitLiteralExpression(LiteralExpression node) { + public Object visitLiteralExpression(LiteralExpressionImpl node) { // Literals evaluate to themselves return node.getValue(); } @Override - public Object visitFunctionCallExpression(FunctionCallExpression node) { + public Object visitFunctionCallExpression(FunctionCallExpressionImpl node) { // Step 1: Evaluate all arguments Object[] args = node.hasArguments() ? node.getArguments().stream().map(arg -> arg.accept(this)).toArray() : @@ -1502,7 +1502,7 @@ Why This Design is Powerful: What is the Action Executor? -The `ActionExecutor` is another concrete visitor that executes actions - operations that modify the system state rather than just computing values. While expressions are "pure" (they don't change anything), actions have "side effects" (they modify variables, call external services, etc.). +The `ActionExecutorImpl` is another concrete visitor that executes actions - operations that modify the system state rather than just computing values. While expressions are "pure" (they don't change anything), actions have "side effects" (they modify variables, call external services, etc.). Key Difference from Expression Evaluator: @@ -1512,13 +1512,13 @@ Key Difference from Expression Evaluator: Action Executor Design: ```java -public class ActionExecutor implements ASTVisitor { +public class ActionExecutorImpl implements ASTVisitor { private final EvaluationContext context; // State to modify - private final ExpressionEvaluator expressionEvaluator; // For evaluating expressions within actions + private final ExpressionEvaluatorImpl expressionEvaluator; // For evaluating expressions within actions @Override - public Void visitSetAction(SetAction node) { + public Void visitSetAction(SetActionImpl node) { // Step 1: Evaluate the value expression Object value = node.getValue().accept(expressionEvaluator); @@ -1533,7 +1533,7 @@ public class ActionExecutor implements ASTVisitor { } @Override - public Void visitCalculateAction(CalculateAction node) { + public Void visitCalculateAction(CalculateActionImpl node) { // Step 1: Evaluate the calculation expression Object result = node.getExpression().accept(expressionEvaluator); @@ -1545,7 +1545,7 @@ public class ActionExecutor implements ASTVisitor { } @Override - public Void visitArithmeticAction(ArithmeticAction node) { + public Void visitArithmeticAction(ArithmeticActionImpl node) { // Equivalent of an "in-place" compound assignment, expressed via dedicated keywords // in the DSL (`add X to var`, `subtract X from var`, etc.). Both operands must be // numeric; non-numeric operands raise IllegalArgumentException so authoring bugs @@ -1576,7 +1576,7 @@ public class ActionExecutor implements ASTVisitor { } @Override - public Void visitConditionalAction(ConditionalAction node) { + public Void visitConditionalAction(ConditionalActionImpl node) { // Step 1: Evaluate the condition boolean conditionResult = (Boolean) node.getCondition().accept( new ConditionEvaluator(context, expressionEvaluator) @@ -1815,9 +1815,9 @@ public class ASTRulesEvaluationEngine { // PHASE 4: VISITOR CREATION // Create the visitors that will traverse the AST - ExpressionEvaluator expressionEvaluator = new ExpressionEvaluator( + ExpressionEvaluatorImpl expressionEvaluator = new ExpressionEvaluatorImpl( context, restCallService, jsonPathService); - ActionExecutor actionExecutor = new ActionExecutor( + ActionExecutorImpl actionExecutor = new ActionExecutorImpl( context, restCallService, jsonPathService); // PHASE 5: CONDITION EVALUATION @@ -1890,8 +1890,8 @@ Why it's optimized: #### Phase 4: Visitor Creation ```java -ExpressionEvaluator expressionEvaluator = new ExpressionEvaluator(context, ...); -ActionExecutor actionExecutor = new ActionExecutor(context, ...); +ExpressionEvaluatorImpl expressionEvaluator = new ExpressionEvaluatorImpl(context, ...); +ActionExecutorImpl actionExecutor = new ActionExecutorImpl(context, ...); ``` What happens: @@ -1903,7 +1903,7 @@ What happens: ```java boolean conditionResult = evaluateConditions(rulesDSL.getConditions(), expressionEvaluator); -private boolean evaluateConditions(List conditions, ExpressionEvaluator evaluator) { +private boolean evaluateConditions(List conditions, ExpressionEvaluatorImpl evaluator) { if (conditions.isEmpty()) { return true; // No conditions means rule always applies } @@ -1984,7 +1984,7 @@ public class YamlDslValidator implements ASTVisitor> { ASTRulesDSL astModel = astParser.parseRules(yamlContent); // 4. Validate AST semantics - ValidationVisitor astValidator = new ValidationVisitor(); + ValidationVisitorImpl astValidator = new ValidationVisitorImpl(); List astErrors = astModel.accept(astValidator); allErrors.addAll(astErrors); @@ -2018,16 +2018,16 @@ public class YamlDslValidator implements ASTVisitor> { ### 🎯 Validation Visitor -The `ValidationVisitor` performs semantic validation of AST nodes: +The `ValidationVisitorImpl` performs semantic validation of AST nodes: ````java -public class ValidationVisitor implements ASTVisitor> { +public class ValidationVisitorImpl implements ASTVisitor> { private final Set declaredVariables = new HashSet<>(); private final Set referencedVariables = new HashSet<>(); @Override - public List visitBinaryExpression(BinaryExpression node) { + public List visitBinaryExpression(BinaryExpressionImpl node) { List errors = new ArrayList<>(); // Validate operands @@ -2051,7 +2051,7 @@ public class ValidationVisitor implements ASTVisitor> { } @Override - public List visitUnaryExpression(UnaryExpression node) { + public List visitUnaryExpression(UnaryExpressionImpl node) { List errors = new ArrayList<>(); // Validate operand @@ -2073,7 +2073,7 @@ public class ValidationVisitor implements ASTVisitor> { } @Override - public List visitVariableExpression(VariableExpression node) { + public List visitVariableExpression(VariableExpressionImpl node) { referencedVariables.add(node.getVariableName()); // Variable existence will be validated later @@ -2081,7 +2081,7 @@ public class ValidationVisitor implements ASTVisitor> { } @Override - public List visitSetAction(SetAction node) { + public List visitSetAction(SetActionImpl node) { List errors = new ArrayList<>(); // Validate value expression @@ -2318,7 +2318,7 @@ Functions are complex operations that may have side effects, variable parameters - Purpose: Complex operations, calculations, and external integrations - Syntax: Function call notation (`rest_get(url, headers, timeout)`) -- Implementation: Handled in the ExpressionEvaluator visitor +- Implementation: Handled in the ExpressionEvaluatorImpl visitor - Characteristics: - Variable arity (0 to many parameters) - May have side effects (REST calls, logging, database access) @@ -2359,7 +2359,7 @@ public enum TokenType { // Functions: Handled in expression evaluator @Override -public Object visitFunctionCallExpression(FunctionCallExpression node) { +public Object visitFunctionCallExpression(FunctionCallExpressionImpl node) { return switch (node.getFunctionName()) { case "rest_get" -> restGet(node.getArguments()); case "json_get" -> jsonGet(node.getArguments()); @@ -2399,7 +2399,7 @@ Functions support variable parameters: Functions can access injected Spring services: ```java @Component -public class ExpressionEvaluator implements ASTVisitor { +public class ExpressionEvaluatorImpl implements ASTVisitor { @Autowired private RestCallService restCallService; @@ -2436,11 +2436,11 @@ Let's walk through creating a new function called `calculate_credit_risk` that c #### Step 1: Define the Function Logic -Add the function to the `ExpressionEvaluator` class: +Add the function to the `ExpressionEvaluatorImpl` class: ```java @Override -public Object visitFunctionCallExpression(FunctionCallExpression node) { +public Object visitFunctionCallExpression(FunctionCallExpressionImpl node) { String functionName = node.getFunctionName(); Object[] args = evaluateArguments(node.getArguments()); @@ -2780,8 +2780,8 @@ private Condition comparison() { if (match(TokenType.CREDIT_SCORE_RANGE)) { String range = consume(TokenType.STRING, "Expected credit score range").getLexeme(); - return new ComparisonCondition(null, left, ComparisonOperator.CREDIT_SCORE_RANGE, - new LiteralExpression(null, range), null); + return new ComparisonConditionImpl(null, left, ComparisonOperator.CREDIT_SCORE_RANGE, + new LiteralExpressionImpl(null, range), null); } // ... handle other operators ... @@ -2794,7 +2794,7 @@ Add the evaluation logic to the condition evaluator: ```java @Override -public Object visitComparisonCondition(ComparisonCondition node) { +public Object visitComparisonCondition(ComparisonConditionImpl node) { Object leftValue = node.getLeft().accept(this); return switch (node.getOperator()) { @@ -3071,10 +3071,10 @@ static { #### Step 4: Implement Evaluation Logic -Add evaluation logic to `ExpressionEvaluator.java`: +Add evaluation logic to `ExpressionEvaluatorImpl.java`: ```java -// In ExpressionEvaluator.java +// In ExpressionEvaluatorImpl.java private Object evaluateOperation(String operator, Object left, Object right) { return switch (operator.toLowerCase()) { // ... existing operators @@ -3100,7 +3100,7 @@ private Object evaluateCustomOperator(Object left, Object right) { #### Step 5: Add Validation -Update validation logic in `ValidationVisitor.java`: +Update validation logic in `ValidationVisitorImpl.java`: ```java private boolean isOperatorCompatible(BinaryOperator operator, ExpressionType left, ExpressionType right) { @@ -3151,11 +3151,11 @@ void testCustomOperator() { #### Step 1: Implement Function Logic -Add your function to `ExpressionEvaluator.java`: +Add your function to `ExpressionEvaluatorImpl.java`: ```java @Override -public Object visitFunctionCallExpression(FunctionCallExpression node) { +public Object visitFunctionCallExpression(FunctionCallExpressionImpl node) { String functionName = node.getFunctionName(); Object[] args = node.hasArguments() ? node.getArguments().stream().map(arg -> arg.accept(this)).toArray() : @@ -3196,9 +3196,9 @@ private Object customFunction(Object[] args) { If your function can be used in actions: ```java -// In ActionExecutor.java +// In ActionExecutorImpl.java @Override -public Void visitFunctionCallAction(FunctionCallAction node) { +public Void visitFunctionCallAction(FunctionCallActionImpl node) { String functionName = node.getFunctionName(); Object[] args = evaluateArguments(node.getArguments()); @@ -3222,7 +3222,7 @@ public Void visitFunctionCallAction(FunctionCallAction node) { Update validation to recognize your function: ```java -// In ValidationVisitor.java +// In ValidationVisitorImpl.java private static final Set KNOWN_FUNCTIONS = Set.of( "abs", "round", "ceil", "floor", "max", "min", "length", "substring", "upper", "lower", @@ -3230,7 +3230,7 @@ private static final Set KNOWN_FUNCTIONS = Set.of( ); @Override -public List visitFunctionCallExpression(FunctionCallExpression node) { +public List visitFunctionCallExpression(FunctionCallExpressionImpl node) { List errors = new ArrayList<>(); // Validate function exists @@ -3323,7 +3323,7 @@ public interface ASTVisitor { #### Step 3: Implement Visitor Methods ```java -// In ExpressionEvaluator.java +// In ExpressionEvaluatorImpl.java @Override public Object visitCustomExpression(CustomExpression node) { // Evaluate inner expression and parameters diff --git a/modules/rule-engine/docs/yaml-dsl-reference.md b/modules/rule-engine/docs/yaml-dsl-reference.md index e63bdde3e..ba5c2d321 100644 --- a/modules/rule-engine/docs/yaml-dsl-reference.md +++ b/modules/rule-engine/docs/yaml-dsl-reference.md @@ -1278,7 +1278,7 @@ conditions: ## Built-in Functions -*All functions listed below are actually implemented in the codebase and verified against ExpressionEvaluator.java* +*All functions listed below are actually implemented in the codebase and verified against ExpressionEvaluatorImpl.java* ### Mathematical Functions @@ -2071,8 +2071,8 @@ output: ### Recent Parser Enhancements (v2.1.0+) - Validation Operators in Expressions: Validation operators like `is_positive`, `is_email`, `is_phone`, etc. can now be used in complex expressions, not just simple conditions - Complex Boolean Expressions: Multi-line boolean expressions with AND/OR operators and parentheses are fully supported in both conditions and expressions -- Enhanced ExpressionParser: The ExpressionParser now supports validation operators as unary operations, enabling natural syntax like `(email is_email AND phone is_phone)` -- Unified Operator Support: Both ConditionParser and ExpressionParser now support the same set of validation operators for consistent syntax across the DSL +- Enhanced ExpressionParserImpl: The ExpressionParserImpl now supports validation operators as unary operations, enabling natural syntax like `(email is_email AND phone is_phone)` +- Unified Operator Support: Both ConditionParserImpl and ExpressionParserImpl now support the same set of validation operators for consistent syntax across the DSL - BETWEEN Operator Improvements: Fixed parsing issues with `BETWEEN` operator to properly handle `value between min and max` syntax - Age Operators in Expressions: `age_at_least` and `age_less_than` operators now work correctly in both conditions and expressions @@ -2095,8 +2095,8 @@ output: ### Version 2.1.0 - Enhanced Expression Support - Validation Operators in Expressions: All validation operators (`is_positive`, `is_email`, `is_phone`, `is_credit_score`, etc.) can now be used in complex expressions - Multi-line Boolean Expressions: Support for complex boolean expressions with AND/OR operators and parentheses in both conditions and expressions -- Enhanced Parser Architecture: ExpressionParser now supports validation operators as unary operations for consistent syntax -- BETWEEN Operator Fixes: Resolved parsing conflicts where ExpressionParser was consuming AND tokens needed by BETWEEN operator +- Enhanced Parser Architecture: ExpressionParserImpl now supports validation operators as unary operations for consistent syntax +- BETWEEN Operator Fixes: Resolved parsing conflicts where ExpressionParserImpl was consuming AND tokens needed by BETWEEN operator - Age Operator Support: Added proper support for `age_at_least` and `age_less_than` operators in both expression and condition contexts - Real-world Testing: Validated with comprehensive B2B credit scoring scenarios including multi-stage evaluation workflows diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/config/RuleEngineCacheAutoConfiguration.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/config/RuleEngineCacheAutoConfiguration.java index d68f802f4..cd01f0e37 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/config/RuleEngineCacheAutoConfiguration.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/config/RuleEngineCacheAutoConfiguration.java @@ -19,7 +19,7 @@ import org.fireflyframework.cache.config.CacheAutoConfiguration; 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 lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; @@ -45,7 +45,7 @@ */ @AutoConfiguration @AutoConfigureAfter(CacheAutoConfiguration.class) -@ConditionalOnClass({FireflyCacheManager.class, CacheManagerFactory.class}) +@ConditionalOnClass({FireflyCacheManagerImpl.class, CacheManagerFactory.class}) @Slf4j public class RuleEngineCacheAutoConfiguration { @@ -68,7 +68,7 @@ public RuleEngineCacheAutoConfiguration() { @Bean("ruleEngineCacheManager") @ConditionalOnBean(CacheManagerFactory.class) @ConditionalOnMissingBean(name = "ruleEngineCacheManager") - public FireflyCacheManager ruleEngineCacheManager(CacheManagerFactory factory) { + public FireflyCacheManagerImpl ruleEngineCacheManager(CacheManagerFactory factory) { String description = String.format( "Rule Engine Cache - Stores rule definitions, AST models, constants, and validation results (TTL: %d hours)", RULE_CACHE_TTL.toHours() diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/ASTVisitor.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/ASTVisitor.java index 199f08329..0b7a774aa 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/ASTVisitor.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/ASTVisitor.java @@ -17,12 +17,12 @@ package org.fireflyframework.rules.core.dsl; import org.fireflyframework.rules.core.dsl.action.*; -import org.fireflyframework.rules.core.dsl.condition.ComparisonCondition; -import org.fireflyframework.rules.core.dsl.condition.ExpressionCondition; -import org.fireflyframework.rules.core.dsl.condition.LogicalCondition; +import org.fireflyframework.rules.core.dsl.condition.ComparisonConditionImpl; +import org.fireflyframework.rules.core.dsl.condition.ExpressionConditionImpl; +import org.fireflyframework.rules.core.dsl.condition.LogicalConditionImpl; import org.fireflyframework.rules.core.dsl.expression.*; -import org.fireflyframework.rules.core.dsl.action.WhileAction; -import org.fireflyframework.rules.core.dsl.action.DoWhileAction; +import org.fireflyframework.rules.core.dsl.action.WhileActionImpl; +import org.fireflyframework.rules.core.dsl.action.DoWhileActionImpl; /** * Visitor interface for traversing and operating on AST nodes. @@ -34,29 +34,29 @@ public interface ASTVisitor { // Expression visitors - T visitBinaryExpression(BinaryExpression node); - T visitUnaryExpression(UnaryExpression node); - T visitVariableExpression(VariableExpression node); - T visitLiteralExpression(LiteralExpression node); - T visitFunctionCallExpression(FunctionCallExpression node); + T visitBinaryExpression(BinaryExpressionImpl node); + T visitUnaryExpression(UnaryExpressionImpl node); + T visitVariableExpression(VariableExpressionImpl node); + T visitLiteralExpression(LiteralExpressionImpl node); + T visitFunctionCallExpression(FunctionCallExpressionImpl node); // Condition visitors - T visitComparisonCondition(ComparisonCondition node); - T visitLogicalCondition(LogicalCondition node); - T visitExpressionCondition(ExpressionCondition node); + T visitComparisonCondition(ComparisonConditionImpl node); + T visitLogicalCondition(LogicalConditionImpl node); + T visitExpressionCondition(ExpressionConditionImpl node); // Action visitors - T visitFunctionCallAction(FunctionCallAction node); - T visitConditionalAction(ConditionalAction node); - T visitCalculateAction(CalculateAction node); - T visitRunAction(RunAction node); - T visitSetAction(SetAction node); - T visitArithmeticAction(ArithmeticAction node); - T visitListAction(ListAction node); - T visitCircuitBreakerAction(CircuitBreakerAction node); - T visitForEachAction(ForEachAction node); - T visitWhileAction(WhileAction node); - T visitDoWhileAction(DoWhileAction node); + T visitFunctionCallAction(FunctionCallActionImpl node); + T visitConditionalAction(ConditionalActionImpl node); + T visitCalculateAction(CalculateActionImpl node); + T visitRunAction(RunActionImpl node); + T visitSetAction(SetActionImpl node); + T visitArithmeticAction(ArithmeticActionImpl node); + T visitListAction(ListActionImpl node); + T visitCircuitBreakerAction(CircuitBreakerActionImpl node); + T visitForEachAction(ForEachActionImpl node); + T visitWhileAction(WhileActionImpl node); + T visitDoWhileAction(DoWhileActionImpl node); // Default implementation for unknown nodes default T visitUnknown(ASTNode node) { diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ArithmeticAction.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ArithmeticActionImpl.java similarity index 92% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ArithmeticAction.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ArithmeticActionImpl.java index 8cd680d53..611c5622d 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ArithmeticAction.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ArithmeticActionImpl.java @@ -28,7 +28,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class ArithmeticAction extends Action { +public class ArithmeticActionImpl extends Action { /** * The arithmetic operation to perform @@ -45,7 +45,7 @@ public class ArithmeticAction extends Action { */ private Expression value; - public ArithmeticAction(SourceLocation location, ArithmeticOperationType operation, String variableName, Expression value) { + public ArithmeticActionImpl(SourceLocation location, ArithmeticOperationType operation, String variableName, Expression value) { super(location); this.operation = operation; this.variableName = variableName; @@ -108,4 +108,9 @@ public static ArithmeticOperationType fromKeyword(String keyword) { throw new IllegalArgumentException("Unknown arithmetic operation: " + keyword); } } + + @Override + public String getNodeType() { + return "ArithmeticAction"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CalculateAction.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CalculateActionImpl.java similarity index 88% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CalculateAction.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CalculateActionImpl.java index 63cb013bb..b2e9daad6 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CalculateAction.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CalculateActionImpl.java @@ -29,7 +29,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class CalculateAction extends Action { +public class CalculateActionImpl extends Action { /** * Name of the variable to store the calculated result @@ -41,7 +41,7 @@ public class CalculateAction extends Action { */ private Expression expression; - public CalculateAction(SourceLocation location, String resultVariable, Expression expression) { + public CalculateActionImpl(SourceLocation location, String resultVariable, Expression expression) { super(location); this.resultVariable = resultVariable; this.expression = expression; @@ -61,4 +61,9 @@ public boolean hasVariableReferences() { public String toDebugString() { return String.format("calculate %s as %s", resultVariable, expression.toDebugString()); } + + @Override + public String getNodeType() { + return "CalculateAction"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CircuitBreakerAction.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CircuitBreakerActionImpl.java similarity index 86% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CircuitBreakerAction.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CircuitBreakerActionImpl.java index 1b38c62f8..1193175db 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CircuitBreakerAction.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/CircuitBreakerActionImpl.java @@ -27,7 +27,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class CircuitBreakerAction extends Action { +public class CircuitBreakerActionImpl extends Action { /** * Message to include with the circuit breaker @@ -39,12 +39,12 @@ public class CircuitBreakerAction extends Action { */ private String errorCode; - public CircuitBreakerAction(SourceLocation location, String message) { + public CircuitBreakerActionImpl(SourceLocation location, String message) { super(location); this.message = message; } - public CircuitBreakerAction(SourceLocation location, String message, String errorCode) { + public CircuitBreakerActionImpl(SourceLocation location, String message, String errorCode) { super(location); this.message = message; this.errorCode = errorCode; @@ -75,4 +75,9 @@ public String toDebugString() { return String.format("CircuitBreakerAction{message='%s', errorCode='%s'}", message, errorCode); } + + @Override + public String getNodeType() { + return "CircuitBreakerAction"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ConditionalAction.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ConditionalActionImpl.java similarity index 91% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ConditionalAction.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ConditionalActionImpl.java index a1a5b4baa..06986eca0 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ConditionalAction.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ConditionalActionImpl.java @@ -31,7 +31,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class ConditionalAction extends Action { +public class ConditionalActionImpl extends Action { /** * Condition to evaluate @@ -48,13 +48,13 @@ public class ConditionalAction extends Action { */ private List elseActions; - public ConditionalAction(SourceLocation location, Condition condition, List thenActions) { + public ConditionalActionImpl(SourceLocation location, Condition condition, List thenActions) { super(location); this.condition = condition; this.thenActions = thenActions; } - public ConditionalAction(SourceLocation location, Condition condition, List thenActions, List elseActions) { + public ConditionalActionImpl(SourceLocation location, Condition condition, List thenActions, List elseActions) { super(location); this.condition = condition; this.thenActions = thenActions; @@ -132,4 +132,9 @@ public int getThenActionCount() { public int getElseActionCount() { return elseActions != null ? elseActions.size() : 0; } + + @Override + public String getNodeType() { + return "ConditionalAction"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/DoWhileAction.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/DoWhileActionImpl.java similarity index 90% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/DoWhileAction.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/DoWhileActionImpl.java index c02fa919a..411b4e4c1 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/DoWhileAction.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/DoWhileActionImpl.java @@ -34,7 +34,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class DoWhileAction extends Action { +public class DoWhileActionImpl extends Action { /** * The actions to execute in each iteration @@ -51,13 +51,13 @@ public class DoWhileAction extends Action { */ private int maxIterations = 1000; - public DoWhileAction(SourceLocation location, List bodyActions, Condition condition) { + public DoWhileActionImpl(SourceLocation location, List bodyActions, Condition condition) { super(location); this.bodyActions = bodyActions; this.condition = condition; } - public DoWhileAction(SourceLocation location, List bodyActions, Condition condition, int maxIterations) { + public DoWhileActionImpl(SourceLocation location, List bodyActions, Condition condition, int maxIterations) { super(location); this.bodyActions = bodyActions; this.condition = condition; @@ -108,5 +108,10 @@ public String toDebugString() { condition != null ? condition.toDebugString() : "null", maxIterations); } + + @Override + public String getNodeType() { + return "DoWhileAction"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ForEachAction.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ForEachActionImpl.java similarity index 90% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ForEachAction.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ForEachActionImpl.java index 85325ac09..b077b910d 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ForEachAction.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ForEachActionImpl.java @@ -44,7 +44,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class ForEachAction extends Action { +public class ForEachActionImpl extends Action { /** * Name of the iteration variable (e.g., "item" in "forEach item in items") @@ -66,7 +66,7 @@ public class ForEachAction extends Action { */ private List bodyActions; - public ForEachAction(SourceLocation location, String iterationVariable, Expression listExpression, List bodyActions) { + public ForEachActionImpl(SourceLocation location, String iterationVariable, Expression listExpression, List bodyActions) { super(location); this.iterationVariable = iterationVariable; this.listExpression = listExpression; @@ -74,7 +74,7 @@ public ForEachAction(SourceLocation location, String iterationVariable, Expressi this.indexVariable = null; } - public ForEachAction(SourceLocation location, String iterationVariable, String indexVariable, Expression listExpression, List bodyActions) { + public ForEachActionImpl(SourceLocation location, String iterationVariable, String indexVariable, Expression listExpression, List bodyActions) { super(location); this.iterationVariable = iterationVariable; this.indexVariable = indexVariable; @@ -135,5 +135,10 @@ public String toDebugString() { public boolean hasIndexVariable() { return indexVariable != null && !indexVariable.isEmpty(); } + + @Override + public String getNodeType() { + return "ForEachAction"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/FunctionCallAction.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/FunctionCallActionImpl.java similarity index 90% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/FunctionCallAction.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/FunctionCallActionImpl.java index 1f51871d8..be5d223e9 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/FunctionCallAction.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/FunctionCallActionImpl.java @@ -32,7 +32,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class FunctionCallAction extends Action { +public class FunctionCallActionImpl extends Action { /** * Name of the function to call @@ -49,13 +49,13 @@ public class FunctionCallAction extends Action { */ private String resultVariable; - public FunctionCallAction(SourceLocation location, String functionName, List arguments) { + public FunctionCallActionImpl(SourceLocation location, String functionName, List arguments) { super(location); this.functionName = functionName; this.arguments = arguments; } - public FunctionCallAction(SourceLocation location, String functionName, List arguments, String resultVariable) { + public FunctionCallActionImpl(SourceLocation location, String functionName, List arguments, String resultVariable) { super(location); this.functionName = functionName; this.arguments = arguments; @@ -121,4 +121,9 @@ public boolean hasArguments() { public boolean hasResultVariable() { return resultVariable != null && !resultVariable.trim().isEmpty(); } + + @Override + public String getNodeType() { + return "FunctionCallAction"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ListAction.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ListActionImpl.java similarity index 92% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ListAction.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ListActionImpl.java index 7ac1b2e31..8d73e0bf9 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ListAction.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/ListActionImpl.java @@ -28,7 +28,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class ListAction extends Action { +public class ListActionImpl extends Action { /** * The list operation to perform @@ -45,7 +45,7 @@ public class ListAction extends Action { */ private String listVariable; - public ListAction(SourceLocation location, ListOperationType operation, Expression value, String listVariable) { + public ListActionImpl(SourceLocation location, ListOperationType operation, Expression value, String listVariable) { super(location); this.operation = operation; this.value = value; @@ -107,4 +107,9 @@ public static ListOperationType fromKeyword(String keyword) { throw new IllegalArgumentException("Unknown list operation: " + keyword); } } + + @Override + public String getNodeType() { + return "ListAction"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/RunAction.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/RunActionImpl.java similarity index 90% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/RunAction.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/RunActionImpl.java index 5a0041138..7f7122d4e 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/RunAction.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/RunActionImpl.java @@ -35,7 +35,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class RunAction extends Action { +public class RunActionImpl extends Action { /** * Name of the variable to store the result @@ -47,7 +47,7 @@ public class RunAction extends Action { */ private Expression expression; - public RunAction(SourceLocation location, String resultVariable, Expression expression) { + public RunActionImpl(SourceLocation location, String resultVariable, Expression expression) { super(location); this.resultVariable = resultVariable; this.expression = expression; @@ -67,5 +67,10 @@ public boolean hasVariableReferences() { public String toDebugString() { return String.format("run %s as %s", resultVariable, expression.toDebugString()); } + + @Override + public String getNodeType() { + return "RunAction"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/SetAction.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/SetActionImpl.java similarity index 88% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/SetAction.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/SetActionImpl.java index b61e21646..aba509773 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/SetAction.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/SetActionImpl.java @@ -28,7 +28,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class SetAction extends Action { +public class SetActionImpl extends Action { /** * Name of the variable to set @@ -40,7 +40,7 @@ public class SetAction extends Action { */ private Expression value; - public SetAction(SourceLocation location, String variableName, Expression value) { + public SetActionImpl(SourceLocation location, String variableName, Expression value) { super(location); this.variableName = variableName; this.value = value; @@ -60,4 +60,9 @@ public boolean hasVariableReferences() { public String toDebugString() { return String.format("set %s to %s", variableName, value.toDebugString()); } + + @Override + public String getNodeType() { + return "SetAction"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/WhileAction.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/WhileActionImpl.java similarity index 90% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/WhileAction.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/WhileActionImpl.java index e5cafcd3f..747452ff2 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/WhileAction.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/action/WhileActionImpl.java @@ -33,7 +33,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class WhileAction extends Action { +public class WhileActionImpl extends Action { /** * The condition to evaluate before each iteration @@ -50,13 +50,13 @@ public class WhileAction extends Action { */ private int maxIterations = 1000; - public WhileAction(SourceLocation location, Condition condition, List bodyActions) { + public WhileActionImpl(SourceLocation location, Condition condition, List bodyActions) { super(location); this.condition = condition; this.bodyActions = bodyActions; } - public WhileAction(SourceLocation location, Condition condition, List bodyActions, int maxIterations) { + public WhileActionImpl(SourceLocation location, Condition condition, List bodyActions, int maxIterations) { super(location); this.condition = condition; this.bodyActions = bodyActions; @@ -107,5 +107,10 @@ public String toDebugString() { bodyActions != null ? bodyActions.size() : 0, maxIterations); } + + @Override + public String getNodeType() { + return "WhileAction"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ComparisonCondition.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ComparisonConditionImpl.java similarity index 90% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ComparisonCondition.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ComparisonConditionImpl.java index 95854957b..fc252a090 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ComparisonCondition.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ComparisonConditionImpl.java @@ -28,7 +28,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class ComparisonCondition extends Condition { +public class ComparisonConditionImpl extends Condition { /** * Left side of the comparison @@ -50,14 +50,14 @@ public class ComparisonCondition extends Condition { */ private Expression rangeEnd; - public ComparisonCondition(SourceLocation location, Expression left, ComparisonOperator operator, Expression right) { + public ComparisonConditionImpl(SourceLocation location, Expression left, ComparisonOperator operator, Expression right) { super(location); this.left = left; this.operator = operator; this.right = right; } - public ComparisonCondition(SourceLocation location, Expression left, ComparisonOperator operator, Expression right, Expression rangeEnd) { + public ComparisonConditionImpl(SourceLocation location, Expression left, ComparisonOperator operator, Expression right, Expression rangeEnd) { super(location); this.left = left; this.operator = operator; @@ -123,6 +123,11 @@ public void validate() { throw new IllegalStateException("Non-range comparison should not have rangeEnd operand: " + operator); } } + + @Override + public String getNodeType() { + return "ComparisonCondition"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ExpressionCondition.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ExpressionConditionImpl.java similarity index 88% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ExpressionCondition.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ExpressionConditionImpl.java index 5d1a150a0..da29bf170 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ExpressionCondition.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/ExpressionConditionImpl.java @@ -28,14 +28,14 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class ExpressionCondition extends Condition { +public class ExpressionConditionImpl extends Condition { /** * The expression that should evaluate to a boolean value */ private Expression expression; - public ExpressionCondition(SourceLocation location, Expression expression) { + public ExpressionConditionImpl(SourceLocation location, Expression expression) { super(location); this.expression = expression; } @@ -59,4 +59,9 @@ public boolean hasVariableReferences() { public String toDebugString() { return expression.toDebugString(); } + + @Override + public String getNodeType() { + return "ExpressionCondition"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/LogicalCondition.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/LogicalConditionImpl.java similarity index 93% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/LogicalCondition.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/LogicalConditionImpl.java index 14dad9ce9..5cf5c068e 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/LogicalCondition.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/condition/LogicalConditionImpl.java @@ -30,7 +30,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class LogicalCondition extends Condition { +public class LogicalConditionImpl extends Condition { /** * Logical operator @@ -42,7 +42,7 @@ public class LogicalCondition extends Condition { */ private List operands; - public LogicalCondition(SourceLocation location, LogicalOperator operator, List operands) { + public LogicalConditionImpl(SourceLocation location, LogicalOperator operator, List operands) { super(location); this.operator = operator; this.operands = operands; @@ -124,6 +124,11 @@ public void validate() { break; } } + + @Override + public String getNodeType() { + return "LogicalCondition"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/evaluation/ASTRulesEvaluationEngine.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/evaluation/ASTRulesEvaluationEngine.java index 4ac0fed1b..7a7789ea1 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/evaluation/ASTRulesEvaluationEngine.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/evaluation/ASTRulesEvaluationEngine.java @@ -18,18 +18,18 @@ import org.fireflyframework.rules.core.dsl.ASTVisitor; import org.fireflyframework.rules.core.dsl.action.*; -import org.fireflyframework.rules.core.dsl.condition.ComparisonCondition; +import org.fireflyframework.rules.core.dsl.condition.ComparisonConditionImpl; import org.fireflyframework.rules.core.dsl.condition.Condition; -import org.fireflyframework.rules.core.dsl.condition.ExpressionCondition; -import org.fireflyframework.rules.core.dsl.condition.LogicalCondition; +import org.fireflyframework.rules.core.dsl.condition.ExpressionConditionImpl; +import org.fireflyframework.rules.core.dsl.condition.LogicalConditionImpl; import org.fireflyframework.rules.core.dsl.expression.*; import org.fireflyframework.rules.core.dsl.function.CustomFunctionRegistry; import org.fireflyframework.rules.core.dsl.model.ASTRulesDSL; import org.fireflyframework.rules.core.dsl.parser.ASTRulesDSLParser; -import org.fireflyframework.rules.core.dsl.visitor.ActionExecutor; +import org.fireflyframework.rules.core.dsl.visitor.ActionExecutorImpl; import org.fireflyframework.rules.core.dsl.visitor.EvaluationContext; -import org.fireflyframework.rules.core.dsl.visitor.ExpressionEvaluator; -import org.fireflyframework.rules.core.observability.RuleEngineMetrics; +import org.fireflyframework.rules.core.dsl.visitor.ExpressionEvaluatorImpl; +import org.fireflyframework.rules.core.observability.RuleEngineMetricsImpl; import org.fireflyframework.rules.core.services.ConstantService; import org.fireflyframework.rules.core.services.JsonPathService; import org.fireflyframework.rules.core.services.RestCallService; @@ -59,7 +59,7 @@ public class ASTRulesEvaluationEngine { private final RestCallService restCallService; private final JsonPathService jsonPathService; private final CustomFunctionRegistry customFunctions; - private final RuleEngineMetrics metrics; + private final RuleEngineMetricsImpl metrics; private final org.fireflyframework.rules.core.dsl.function.RuleInvoker ruleInvoker; /** @@ -76,7 +76,7 @@ public ASTRulesEvaluationEngine(ASTRulesDSLParser parser, @Autowired(required = false) RestCallService restCallService, @Autowired(required = false) JsonPathService jsonPathService, @Autowired(required = false) CustomFunctionRegistry customFunctions, - @Autowired(required = false) RuleEngineMetrics metrics, + @Autowired(required = false) RuleEngineMetricsImpl metrics, @Autowired(required = false) org.fireflyframework.rules.core.dsl.function.RuleInvoker ruleInvoker) { this.parser = Objects.requireNonNull(parser, "ASTRulesDSLParser cannot be null"); this.constantService = Objects.requireNonNull(constantService, "ConstantService cannot be null"); @@ -132,7 +132,7 @@ public ASTRulesEvaluationEngine(ASTRulesDSLParser parser, RestCallService restCallService, JsonPathService jsonPathService, CustomFunctionRegistry customFunctions, - RuleEngineMetrics metrics) { + RuleEngineMetricsImpl metrics) { this(parser, constantService, restCallService, jsonPathService, customFunctions, metrics, null); } @@ -345,7 +345,7 @@ private boolean evaluateConditions(List conditions, EvaluationContext for (int i = 0; i < conditions.size(); i++) { Condition condition = conditions.get(i); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context, restCallService, jsonPathService, customFunctions, ruleInvoker); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context, restCallService, jsonPathService, customFunctions, ruleInvoker); Object result; try { result = condition.accept(evaluator); @@ -388,7 +388,7 @@ private void executeActions(List actions, EvaluationContext context) { JsonLogger.info(log, context.getOperationId(), String.format("Executing action %d: %s", i + 1, action.toDebugString())); - ActionExecutor executor = new ActionExecutor(context, restCallService, jsonPathService, customFunctions, ruleInvoker); + ActionExecutorImpl executor = new ActionExecutorImpl(context, restCallService, jsonPathService, customFunctions, ruleInvoker); action.accept(executor); JsonLogger.info(log, context.getOperationId(), @@ -432,7 +432,7 @@ private boolean evaluateDecisionTable(ASTRulesDSL.ASTDecisionTable table, Evalua if (matches.isEmpty()) return false; ASTRulesDSL.HitPolicy policy = table.getHitPolicy() != null ? table.getHitPolicy() : ASTRulesDSL.HitPolicy.FIRST; - ExpressionEvaluator evaluator = new ExpressionEvaluator(context, restCallService, jsonPathService, customFunctions, ruleInvoker); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context, restCallService, jsonPathService, customFunctions, ruleInvoker); switch (policy) { case FIRST, ANY -> applyDecisionRow(matches.get(0), evaluator, context); case UNIQUE -> { @@ -457,14 +457,14 @@ private boolean evaluateDecisionTable(ASTRulesDSL.ASTDecisionTable table, Evalua return true; } - private void applyDecisionRow(ASTRulesDSL.ASTDecisionRow row, ExpressionEvaluator evaluator, EvaluationContext context) { + private void applyDecisionRow(ASTRulesDSL.ASTDecisionRow row, ExpressionEvaluatorImpl evaluator, EvaluationContext context) { if (row.getOutputs() == null) return; for (var e : row.getOutputs().entrySet()) { context.setComputedVariable(e.getKey(), evaluateOutputCell(e.getValue(), evaluator)); } } - private Object evaluateOutputCell(Object raw, ExpressionEvaluator evaluator) { + private Object evaluateOutputCell(Object raw, ExpressionEvaluatorImpl evaluator) { // Numbers, booleans, lists, maps pass through unchanged. // Strings default to literals (DMN-style); prefix with '=' to mark an expression // that should be parsed and evaluated against the current context. @@ -540,7 +540,7 @@ private boolean evaluateConditionalBlock(ASTRulesDSL.ASTConditionalBlock conditi return false; } - ExpressionEvaluator evaluator = new ExpressionEvaluator(context, restCallService, jsonPathService, customFunctions, ruleInvoker); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context, restCallService, jsonPathService, customFunctions, ruleInvoker); Object result; try { result = conditionalBlock.getIfCondition().accept(evaluator); @@ -696,7 +696,7 @@ private Mono> loadSystemConstants(ASTRulesDSL rulesDSL) { * Extract constant references from the AST by scanning for UPPER_CASE variable names */ private Set extractConstantReferences(ASTRulesDSL rulesDSL) { - VariableReferenceCollector collector = new VariableReferenceCollector(); + VariableReferenceCollectorImpl collector = new VariableReferenceCollectorImpl(); // Collect from simple syntax conditions if (rulesDSL.getWhenConditions() != null) { @@ -750,7 +750,7 @@ private Set extractConstantReferences(ASTRulesDSL rulesDSL) { /** * Collect variable references from a conditional block */ - private void collectFromConditionalBlock(ASTRulesDSL.ASTConditionalBlock conditionalBlock, VariableReferenceCollector collector) { + private void collectFromConditionalBlock(ASTRulesDSL.ASTConditionalBlock conditionalBlock, VariableReferenceCollectorImpl collector) { if (conditionalBlock.getIfCondition() != null) { conditionalBlock.getIfCondition().accept(collector); } @@ -816,7 +816,7 @@ private Map generateOutput(ASTRulesDSL rulesDSL, EvaluationConte /** * Visitor class to collect all variable references from AST nodes */ - private static class VariableReferenceCollector implements ASTVisitor { + private static class VariableReferenceCollectorImpl implements ASTVisitor { private final Set variableReferences = new HashSet<>(); public Set getVariableReferences() { @@ -824,13 +824,13 @@ public Set getVariableReferences() { } @Override - public Void visitVariableExpression(VariableExpression node) { + public Void visitVariableExpression(VariableExpressionImpl node) { variableReferences.add(node.getVariableName()); return null; } @Override - public Void visitComparisonCondition(ComparisonCondition node) { + public Void visitComparisonCondition(ComparisonConditionImpl node) { node.getLeft().accept(this); if (node.getRight() != null) { node.getRight().accept(this); @@ -842,7 +842,7 @@ public Void visitComparisonCondition(ComparisonCondition node) { } @Override - public Void visitLogicalCondition(LogicalCondition node) { + public Void visitLogicalCondition(LogicalConditionImpl node) { if (node.getOperands() != null) { node.getOperands().forEach(operand -> operand.accept(this)); } @@ -850,31 +850,31 @@ public Void visitLogicalCondition(LogicalCondition node) { } @Override - public Void visitExpressionCondition(ExpressionCondition node) { + public Void visitExpressionCondition(ExpressionConditionImpl node) { node.getExpression().accept(this); return null; } @Override - public Void visitCalculateAction(CalculateAction node) { + public Void visitCalculateAction(CalculateActionImpl node) { node.getExpression().accept(this); return null; } @Override - public Void visitRunAction(RunAction node) { + public Void visitRunAction(RunActionImpl node) { node.getExpression().accept(this); return null; } @Override - public Void visitSetAction(SetAction node) { + public Void visitSetAction(SetActionImpl node) { node.getValue().accept(this); return null; } @Override - public Void visitFunctionCallAction(FunctionCallAction node) { + public Void visitFunctionCallAction(FunctionCallActionImpl node) { if (node.getArguments() != null) { node.getArguments().forEach(arg -> arg.accept(this)); } @@ -882,7 +882,7 @@ public Void visitFunctionCallAction(FunctionCallAction node) { } @Override - public Void visitConditionalAction(ConditionalAction node) { + public Void visitConditionalAction(ConditionalActionImpl node) { node.getCondition().accept(this); if (node.getThenActions() != null) { node.getThenActions().forEach(action -> action.accept(this)); @@ -894,26 +894,26 @@ public Void visitConditionalAction(ConditionalAction node) { } @Override - public Void visitBinaryExpression(BinaryExpression node) { + public Void visitBinaryExpression(BinaryExpressionImpl node) { node.getLeft().accept(this); node.getRight().accept(this); return null; } @Override - public Void visitUnaryExpression(UnaryExpression node) { + public Void visitUnaryExpression(UnaryExpressionImpl node) { node.getOperand().accept(this); return null; } @Override - public Void visitLiteralExpression(LiteralExpression node) { + public Void visitLiteralExpression(LiteralExpressionImpl node) { // Literals don't contain variable references return null; } @Override - public Void visitFunctionCallExpression(FunctionCallExpression node) { + public Void visitFunctionCallExpression(FunctionCallExpressionImpl node) { if (node.getArguments() != null) { node.getArguments().forEach(arg -> arg.accept(this)); } @@ -921,7 +921,7 @@ public Void visitFunctionCallExpression(FunctionCallExpression node) { } @Override - public Void visitArithmeticAction(ArithmeticAction node) { + public Void visitArithmeticAction(ArithmeticActionImpl node) { if (node.getValue() != null) { node.getValue().accept(this); } @@ -929,7 +929,7 @@ public Void visitArithmeticAction(ArithmeticAction node) { } @Override - public Void visitListAction(ListAction node) { + public Void visitListAction(ListActionImpl node) { if (node.getValue() != null) { node.getValue().accept(this); } @@ -937,13 +937,13 @@ public Void visitListAction(ListAction node) { } @Override - public Void visitCircuitBreakerAction(CircuitBreakerAction node) { + public Void visitCircuitBreakerAction(CircuitBreakerActionImpl node) { // Circuit breaker actions don't contain variable references return null; } @Override - public Void visitForEachAction(ForEachAction node) { + public Void visitForEachAction(ForEachActionImpl node) { // Collect variable references from list expression if (node.getListExpression() != null) { node.getListExpression().accept(this); @@ -960,7 +960,7 @@ public Void visitForEachAction(ForEachAction node) { } @Override - public Void visitWhileAction(WhileAction node) { + public Void visitWhileAction(WhileActionImpl node) { // Collect variable references from condition if (node.getCondition() != null) { node.getCondition().accept(this); @@ -977,7 +977,7 @@ public Void visitWhileAction(WhileAction node) { } @Override - public Void visitDoWhileAction(DoWhileAction node) { + public Void visitDoWhileAction(DoWhileActionImpl node) { // Collect variable references from body actions if (node.getBodyActions() != null) { for (Action bodyAction : node.getBodyActions()) { diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/BinaryExpression.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/BinaryExpressionImpl.java similarity index 88% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/BinaryExpression.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/BinaryExpressionImpl.java index fb8291ce2..4b6c5a81e 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/BinaryExpression.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/BinaryExpressionImpl.java @@ -27,7 +27,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class BinaryExpression extends Expression { +public class BinaryExpressionImpl extends Expression { /** * Left operand of the binary expression @@ -44,7 +44,7 @@ public class BinaryExpression extends Expression { */ private Expression right; - public BinaryExpression(SourceLocation location, Expression left, BinaryOperator operator, Expression right) { + public BinaryExpressionImpl(SourceLocation location, Expression left, BinaryOperator operator, Expression right) { super(location); this.left = left; this.operator = operator; @@ -78,6 +78,11 @@ public String toDebugString() { operator.getSymbol(), right.toDebugString()); } + + @Override + public String getNodeType() { + return "BinaryExpression"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/FunctionCallExpression.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/FunctionCallExpressionImpl.java similarity index 92% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/FunctionCallExpression.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/FunctionCallExpressionImpl.java index 0ce0950a6..7d757b0a5 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/FunctionCallExpression.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/FunctionCallExpressionImpl.java @@ -31,7 +31,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class FunctionCallExpression extends Expression { +public class FunctionCallExpressionImpl extends Expression { /** * Name of the function to call @@ -43,7 +43,7 @@ public class FunctionCallExpression extends Expression { */ private List arguments; - public FunctionCallExpression(SourceLocation location, String functionName, List arguments) { + public FunctionCallExpressionImpl(SourceLocation location, String functionName, List arguments) { super(location); this.functionName = functionName; this.arguments = arguments != null ? arguments : new ArrayList<>(); @@ -109,4 +109,9 @@ public Expression getArgument(int index) { public boolean hasArguments() { return arguments != null && !arguments.isEmpty(); } + + @Override + public String getNodeType() { + return "FunctionCallExpression"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/LiteralExpression.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/LiteralExpressionImpl.java similarity index 85% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/LiteralExpression.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/LiteralExpressionImpl.java index fd234b06a..4a541b484 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/LiteralExpression.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/LiteralExpressionImpl.java @@ -29,7 +29,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class LiteralExpression extends Expression { +public class LiteralExpressionImpl extends Expression { /** * The literal value @@ -41,13 +41,13 @@ public class LiteralExpression extends Expression { */ private LiteralType literalType; - public LiteralExpression(SourceLocation location, Object value) { + public LiteralExpressionImpl(SourceLocation location, Object value) { super(location); this.value = value; this.literalType = determineLiteralType(value); } - public LiteralExpression(Object value, LiteralType literalType) { + public LiteralExpressionImpl(Object value, LiteralType literalType) { super(null); this.value = value; this.literalType = literalType; @@ -163,29 +163,34 @@ public boolean isNull() { /** * Create a string literal */ - public static LiteralExpression string(String value) { - return new LiteralExpression(null, value); + public static LiteralExpressionImpl string(String value) { + return new LiteralExpressionImpl(null, value); } /** * Create a number literal */ - public static LiteralExpression number(Number value) { - return new LiteralExpression(null, value); + public static LiteralExpressionImpl number(Number value) { + return new LiteralExpressionImpl(null, value); } /** * Create a boolean literal */ - public static LiteralExpression bool(Boolean value) { - return new LiteralExpression(null, value); + public static LiteralExpressionImpl bool(Boolean value) { + return new LiteralExpressionImpl(null, value); } /** * Create a null literal */ - public static LiteralExpression nullValue() { - return new LiteralExpression((SourceLocation) null, (Object) null); + public static LiteralExpressionImpl nullValue() { + return new LiteralExpressionImpl((SourceLocation) null, (Object) null); + } + + @Override + public String getNodeType() { + return "LiteralExpression"; } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/UnaryExpression.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/UnaryExpressionImpl.java similarity index 88% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/UnaryExpression.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/UnaryExpressionImpl.java index e36320d00..b4e684fe5 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/UnaryExpression.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/UnaryExpressionImpl.java @@ -27,7 +27,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class UnaryExpression extends Expression { +public class UnaryExpressionImpl extends Expression { /** * Unary operator @@ -39,7 +39,7 @@ public class UnaryExpression extends Expression { */ private Expression operand; - public UnaryExpression(SourceLocation location, UnaryOperator operator, Expression operand) { + public UnaryExpressionImpl(SourceLocation location, UnaryOperator operator, Expression operand) { super(location); this.operator = operator; this.operand = operand; @@ -69,6 +69,11 @@ public boolean hasVariableReferences() { public String toDebugString() { return String.format("(%s %s)", operator.getSymbol(), operand.toDebugString()); } + + @Override + public String getNodeType() { + return "UnaryExpression"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/VariableExpression.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/VariableExpressionImpl.java similarity index 91% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/VariableExpression.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/VariableExpressionImpl.java index 6ef766b92..39c301da8 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/VariableExpression.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/expression/VariableExpressionImpl.java @@ -30,7 +30,7 @@ */ @Data @EqualsAndHashCode(callSuper = true) -public class VariableExpression extends Expression { +public class VariableExpressionImpl extends Expression { /** * The variable name or path @@ -47,14 +47,14 @@ public class VariableExpression extends Expression { */ private Expression indexExpression; - public VariableExpression(SourceLocation location, String variableName, List propertyPath) { + public VariableExpressionImpl(SourceLocation location, String variableName, List propertyPath) { super(location); this.variableName = variableName; this.propertyPath = propertyPath != null ? propertyPath : new ArrayList<>(); this.indexExpression = null; } - public VariableExpression(SourceLocation location, String variableName) { + public VariableExpressionImpl(SourceLocation location, String variableName) { super(location); this.variableName = variableName; } @@ -132,4 +132,9 @@ public boolean hasPropertyAccess() { public boolean hasIndexAccess() { return indexExpression != null; } + + @Override + public String getNodeType() { + return "VariableExpression"; + } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ActionParser.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ActionParserImpl.java similarity index 88% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ActionParser.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ActionParserImpl.java index 659dcd589..c1c0cc0da 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ActionParser.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ActionParserImpl.java @@ -19,7 +19,7 @@ import org.fireflyframework.rules.core.dsl.action.*; import org.fireflyframework.rules.core.dsl.condition.Condition; import org.fireflyframework.rules.core.dsl.expression.Expression; -import org.fireflyframework.rules.core.dsl.expression.VariableExpression; +import org.fireflyframework.rules.core.dsl.expression.VariableExpressionImpl; import org.fireflyframework.rules.core.dsl.lexer.Token; import org.fireflyframework.rules.core.dsl.lexer.TokenType; import lombok.extern.slf4j.Slf4j; @@ -32,15 +32,15 @@ * Handles various action types like assignments, function calls, and conditional actions. */ @Slf4j -public class ActionParser extends BaseParser { +public class ActionParserImpl extends BaseParser { - private final ExpressionParser expressionParser; - private final ConditionParser conditionParser; + private final ExpressionParserImpl expressionParser; + private final ConditionParserImpl conditionParser; - public ActionParser(List tokens) { + public ActionParserImpl(List tokens) { super(tokens); - this.expressionParser = new ExpressionParser(tokens); - this.conditionParser = new ConditionParser(tokens); + this.expressionParser = new ExpressionParserImpl(tokens); + this.conditionParser = new ConditionParserImpl(tokens); } /** @@ -79,11 +79,11 @@ public Action parseAction() { // Arithmetic actions if (match(TokenType.ADD)) { - return parseArithmeticAction(ArithmeticAction.ArithmeticOperationType.ADD); + return parseArithmeticAction(ArithmeticActionImpl.ArithmeticOperationType.ADD); } if (match(TokenType.SUBTRACT)) { - return parseArithmeticAction(ArithmeticAction.ArithmeticOperationType.SUBTRACT); + return parseArithmeticAction(ArithmeticActionImpl.ArithmeticOperationType.SUBTRACT); } // Check for multiply/divide keywords using identifier matching @@ -91,25 +91,25 @@ public Action parseAction() { String keyword = peek().getLexeme(); if ("multiply".equals(keyword)) { advance(); - return parseArithmeticAction(ArithmeticAction.ArithmeticOperationType.MULTIPLY); + return parseArithmeticAction(ArithmeticActionImpl.ArithmeticOperationType.MULTIPLY); } if ("divide".equals(keyword)) { advance(); - return parseArithmeticAction(ArithmeticAction.ArithmeticOperationType.DIVIDE); + return parseArithmeticAction(ArithmeticActionImpl.ArithmeticOperationType.DIVIDE); } } // List actions if (match(TokenType.APPEND)) { - return parseListAction(ListAction.ListOperationType.APPEND); + return parseListAction(ListActionImpl.ListOperationType.APPEND); } if (match(TokenType.PREPEND)) { - return parseListAction(ListAction.ListOperationType.PREPEND); + return parseListAction(ListActionImpl.ListOperationType.PREPEND); } if (match(TokenType.REMOVE)) { - return parseListAction(ListAction.ListOperationType.REMOVE); + return parseListAction(ListActionImpl.ListOperationType.REMOVE); } // Circuit breaker action @@ -175,7 +175,7 @@ private Action parseSetAction() { Expression value = this.expressionParser.parseExpression(); this.current = this.expressionParser.getCurrentPosition(); - return new SetAction(setToken.getLocation(), variable.getLexeme(), value); + return new SetActionImpl(setToken.getLocation(), variable.getLexeme(), value); } /** @@ -201,7 +201,7 @@ private Action parseCalculateAction() { Expression expression = this.expressionParser.parseExpression(); this.current = this.expressionParser.getCurrentPosition(); - return new CalculateAction(calculateToken.getLocation(), variable.getLexeme(), expression); + return new CalculateActionImpl(calculateToken.getLocation(), variable.getLexeme(), expression); } /** @@ -227,7 +227,7 @@ private Action parseRunAction() { Expression expression = this.expressionParser.parseExpression(); this.current = this.expressionParser.getCurrentPosition(); - return new RunAction(runToken.getLocation(), variable.getLexeme(), expression); + return new RunActionImpl(runToken.getLocation(), variable.getLexeme(), expression); } /** @@ -261,7 +261,7 @@ private Action parseCallAction() { consume(TokenType.RBRACKET, "Expected ']' after function arguments"); - return new FunctionCallAction(callToken.getLocation(), functionName.getLexeme(), arguments); + return new FunctionCallActionImpl(callToken.getLocation(), functionName.getLexeme(), arguments); } /** @@ -286,7 +286,7 @@ private Action parseConditionalAction() { elseActions = parseActionList(); } - return new ConditionalAction(ifToken.getLocation(), condition, thenActions, elseActions); + return new ConditionalActionImpl(ifToken.getLocation(), condition, thenActions, elseActions); } /** @@ -303,7 +303,7 @@ private Action parseConditionalAction() { *
    multiply risk_factor by 1.5   -- target then value (English-natural)
    * Both produce the same {@code ArithmeticAction(MULTIPLY, "risk_factor", LiteralExpression(1.5))}. */ - private Action parseArithmeticAction(ArithmeticAction.ArithmeticOperationType operation) { + private Action parseArithmeticAction(ArithmeticActionImpl.ArithmeticOperationType operation) { Token operationToken = previous(); // Parse the first expression after the action keyword. @@ -329,17 +329,17 @@ private Action parseArithmeticAction(ArithmeticAction.ArithmeticOperationType op // fall into pattern 2. if (check(TokenType.IDENTIFIER)) { Token variable = advance(); - return new ArithmeticAction(operationToken.getLocation(), operation, variable.getLexeme(), first); + return new ArithmeticActionImpl(operationToken.getLocation(), operation, variable.getLexeme(), first); } - boolean swappedAllowed = operation == ArithmeticAction.ArithmeticOperationType.MULTIPLY - || operation == ArithmeticAction.ArithmeticOperationType.DIVIDE; - if (swappedAllowed && first instanceof VariableExpression firstVar && firstVar.isSimpleVariable()) { + boolean swappedAllowed = operation == ArithmeticActionImpl.ArithmeticOperationType.MULTIPLY + || operation == ArithmeticActionImpl.ArithmeticOperationType.DIVIDE; + if (swappedAllowed && first instanceof VariableExpressionImpl firstVar && firstVar.isSimpleVariable()) { // Pattern 2: first was the target, what follows the preposition is the value expression. this.expressionParser.setCurrentPosition(this.current); Expression valueExpr = this.expressionParser.parseExpression(); this.current = this.expressionParser.getCurrentPosition(); - return new ArithmeticAction(operationToken.getLocation(), operation, firstVar.getVariableName(), valueExpr); + return new ArithmeticActionImpl(operationToken.getLocation(), operation, firstVar.getVariableName(), valueExpr); } throw error( @@ -352,7 +352,7 @@ private Action parseArithmeticAction(ArithmeticAction.ArithmeticOperationType op /** * Parse list action: "append value to list", "prepend value to list", "remove value from list" */ - private Action parseListAction(ListAction.ListOperationType operation) { + private Action parseListAction(ListActionImpl.ListOperationType operation) { Token operationToken = previous(); // Parse the value expression @@ -382,7 +382,7 @@ private Action parseListAction(ListAction.ListOperationType operation) { Token listVariable = advance(); - return new ListAction(operationToken.getLocation(), operation, value, listVariable.getLexeme()); + return new ListActionImpl(operationToken.getLocation(), operation, value, listVariable.getLexeme()); } /** @@ -407,7 +407,7 @@ private Action parseCircuitBreakerAction() { message = message.substring(1, message.length() - 1); } - return new CircuitBreakerAction(circuitBreakerToken.getLocation(), message); + return new CircuitBreakerActionImpl(circuitBreakerToken.getLocation(), message); } /** @@ -512,9 +512,9 @@ private Action parseForEachAction() { } if (indexVariable != null) { - return new ForEachAction(forEachToken.getLocation(), iterationVariable, indexVariable, listExpression, bodyActions); + return new ForEachActionImpl(forEachToken.getLocation(), iterationVariable, indexVariable, listExpression, bodyActions); } else { - return new ForEachAction(forEachToken.getLocation(), iterationVariable, listExpression, bodyActions); + return new ForEachActionImpl(forEachToken.getLocation(), iterationVariable, listExpression, bodyActions); } } @@ -568,7 +568,7 @@ private Action parseWhileAction() { ); } - return new WhileAction(whileToken.getLocation(), condition, bodyActions); + return new WhileActionImpl(whileToken.getLocation(), condition, bodyActions); } /** @@ -633,6 +633,6 @@ private Action parseDoWhileAction() { Condition condition = conditionParser.parseCondition(); this.current = this.conditionParser.getCurrentPosition(); - return new DoWhileAction(doToken.getLocation(), bodyActions, condition); + return new DoWhileActionImpl(doToken.getLocation(), bodyActions, condition); } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ComplexConditionsParser.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ComplexConditionsParser.java index 34156170b..b8bea56ca 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ComplexConditionsParser.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ComplexConditionsParser.java @@ -19,8 +19,8 @@ import org.fireflyframework.rules.core.dsl.SourceLocation; import org.fireflyframework.rules.core.dsl.condition.*; import org.fireflyframework.rules.core.dsl.expression.Expression; -import org.fireflyframework.rules.core.dsl.expression.LiteralExpression; -import org.fireflyframework.rules.core.dsl.expression.VariableExpression; +import org.fireflyframework.rules.core.dsl.expression.LiteralExpressionImpl; +import org.fireflyframework.rules.core.dsl.expression.VariableExpressionImpl; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -91,13 +91,13 @@ private Condition parseLogicalCondition(LogicalOperator operator, Object operand .map(this::parseComplexCondition) .collect(Collectors.toList()); - return new LogicalCondition(location, operator, operands); + return new LogicalConditionImpl(location, operator, operands); } if (operandsObj instanceof Map || operandsObj instanceof String) { // Single operand (for NOT operator or single-item lists) Condition operand = parseComplexCondition(operandsObj); - return new LogicalCondition(location, operator, List.of(operand)); + return new LogicalConditionImpl(location, operator, List.of(operand)); } throw new ParseException("Invalid operands for logical operator " + operator + ": " + operandsObj, @@ -133,11 +133,11 @@ private Condition parseComparisonCondition(Map compareMap) { Object rangeEndObj = compareMap.get("rangeEnd"); if (rangeEndObj != null) { Expression rangeEnd = parseExpression(rangeEndObj); - return new ComparisonCondition(location, left, operator, right, rangeEnd); + return new ComparisonConditionImpl(location, left, operator, right, rangeEnd); } } - return new ComparisonCondition(location, left, operator, right); + return new ComparisonConditionImpl(location, left, operator, right); } /** @@ -150,24 +150,24 @@ private Expression parseExpression(Object obj) { String str = (String) obj; // Check if it's a variable name or a string literal if (isVariableName(str)) { - return new VariableExpression(location, str, null); + return new VariableExpressionImpl(location, str, null); } else { // Explicitly use the constructor with SourceLocation first - LiteralExpression expr = new LiteralExpression(location, (Object) str); + LiteralExpressionImpl expr = new LiteralExpressionImpl(location, (Object) str); return expr; } } if (obj instanceof Number) { - return new LiteralExpression(location, obj); + return new LiteralExpressionImpl(location, obj); } if (obj instanceof Boolean) { - return new LiteralExpression(location, obj); + return new LiteralExpressionImpl(location, obj); } if (obj == null) { - return new LiteralExpression(location, (Object) null); + return new LiteralExpressionImpl(location, (Object) null); } throw new ParseException("Cannot parse expression from object: " + obj, diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ConditionParser.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ConditionParserImpl.java similarity index 92% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ConditionParser.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ConditionParserImpl.java index 9d882000c..14e9823e3 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ConditionParser.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ConditionParserImpl.java @@ -30,13 +30,13 @@ * Handles logical operations and comparisons. */ @Slf4j -public class ConditionParser extends BaseParser { +public class ConditionParserImpl extends BaseParser { - private final ExpressionParser expressionParser; + private final ExpressionParserImpl expressionParser; - public ConditionParser(List tokens) { + public ConditionParserImpl(List tokens) { super(tokens); - this.expressionParser = new ExpressionParser(tokens); + this.expressionParser = new ExpressionParserImpl(tokens); // Sync the expression parser's position with this parser this.expressionParser.setCurrentPosition(this.current); } @@ -77,7 +77,7 @@ private Condition logicalOr() { operands.add(logicalAnd()); } while (match(TokenType.OR)); - return new LogicalCondition(condition.getLocation(), LogicalOperator.OR, operands); + return new LogicalConditionImpl(condition.getLocation(), LogicalOperator.OR, operands); } return condition; @@ -97,7 +97,7 @@ private Condition logicalAnd() { operands.add(logicalNot()); } while (match(TokenType.AND)); - return new LogicalCondition(condition.getLocation(), LogicalOperator.AND, operands); + return new LogicalConditionImpl(condition.getLocation(), LogicalOperator.AND, operands); } return condition; @@ -111,7 +111,7 @@ private Condition logicalNot() { Token notToken = previous(); Condition operand = logicalNot(); - return new LogicalCondition(notToken.getLocation(), LogicalOperator.NOT, List.of(operand)); + return new LogicalConditionImpl(notToken.getLocation(), LogicalOperator.NOT, List.of(operand)); } return primary(); @@ -164,7 +164,7 @@ private Condition comparison() { // Handle unary operators (no right operand needed) if (isUnaryOperator(op)) { - return new ComparisonCondition(left.getLocation(), left, op, null); + return new ComparisonConditionImpl(left.getLocation(), left, op, null); } // Parse right operand @@ -186,14 +186,14 @@ private Condition comparison() { Expression rangeEnd = this.expressionParser.parseExpressionWithoutLogical(); this.current = this.expressionParser.getCurrentPosition(); - return new ComparisonCondition(left.getLocation(), left, op, right, rangeEnd); + return new ComparisonConditionImpl(left.getLocation(), left, op, right, rangeEnd); } - return new ComparisonCondition(left.getLocation(), left, op, right); + return new ComparisonConditionImpl(left.getLocation(), left, op, right); } // If no comparison operator, treat as expression condition - return new ExpressionCondition(left.getLocation(), left); + return new ExpressionConditionImpl(left.getLocation(), left); } /** diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/DSLParser.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/DSLParser.java index bdbbab722..0d2020eaa 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/DSLParser.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/DSLParser.java @@ -44,7 +44,7 @@ public Condition parseCondition(String source) { try { List tokens = tokenize(source); - ConditionParser parser = new ConditionParser(tokens); + ConditionParserImpl parser = new ConditionParserImpl(tokens); Condition condition = parser.parseCondition(); log.debug("Successfully parsed condition"); @@ -78,7 +78,7 @@ public Expression parseExpression(String source) { try { List tokens = tokenize(source); - ExpressionParser parser = new ExpressionParser(tokens); + ExpressionParserImpl parser = new ExpressionParserImpl(tokens); Expression expression = parser.parseExpression(); log.debug("Successfully parsed expression"); @@ -112,7 +112,7 @@ public Action parseAction(String source) { try { List tokens = tokenize(source); - ActionParser parser = new ActionParser(tokens); + ActionParserImpl parser = new ActionParserImpl(tokens); Action action = parser.parseAction(); log.debug("Successfully parsed action"); @@ -146,7 +146,7 @@ public List parseActionList(String source) { try { List tokens = tokenize(source); - ActionParser parser = new ActionParser(tokens); + ActionParserImpl parser = new ActionParserImpl(tokens); List actions = parser.parseActionList(); log.debug("Successfully parsed {} actions", actions.size()); diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ExpressionParser.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ExpressionParserImpl.java similarity index 89% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ExpressionParser.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ExpressionParserImpl.java index 5aaf92a96..bd6ef84a3 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ExpressionParser.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/parser/ExpressionParserImpl.java @@ -30,9 +30,9 @@ * Handles operator precedence and associativity correctly. */ @Slf4j -public class ExpressionParser extends BaseParser { +public class ExpressionParserImpl extends BaseParser { - public ExpressionParser(List tokens) { + public ExpressionParserImpl(List tokens) { super(tokens); } @@ -74,7 +74,7 @@ private Expression logicalOr() { while (match(TokenType.OR)) { BinaryOperator operator = BinaryOperator.OR; Expression right = logicalAnd(); - expr = new BinaryExpression(expr.getLocation(), expr, operator, right); + expr = new BinaryExpressionImpl(expr.getLocation(), expr, operator, right); } return expr; @@ -89,7 +89,7 @@ private Expression logicalAnd() { while (match(TokenType.AND)) { BinaryOperator operator = BinaryOperator.AND; Expression right = equality(); - expr = new BinaryExpression(expr.getLocation(), expr, operator, right); + expr = new BinaryExpressionImpl(expr.getLocation(), expr, operator, right); } return expr; @@ -109,7 +109,7 @@ private Expression equality() { default -> throw new ParseException("Unexpected operator: " + operator.getLexeme(), operator); }; Expression right = comparison(); - expr = new BinaryExpression(expr.getLocation(), expr, op, right); + expr = new BinaryExpressionImpl(expr.getLocation(), expr, op, right); } return expr; @@ -141,12 +141,12 @@ private Expression comparison() { // Check if it's a validation operator first (unary) if (isValidationOperator(operator.getType())) { // For validation operators, create a unary expression - return new UnaryExpression(expr.getLocation(), UnaryOperator.fromToken(operator.getType()), expr); + return new UnaryExpressionImpl(expr.getLocation(), UnaryOperator.fromToken(operator.getType()), expr); } else { // For binary operators, parse the right operand BinaryOperator op = mapTokenToBinaryOperator(operator); Expression right = term(); - expr = new BinaryExpression(expr.getLocation(), expr, op, right); + expr = new BinaryExpressionImpl(expr.getLocation(), expr, op, right); } } @@ -183,7 +183,7 @@ private Expression term() { default -> throw new ParseException("Unexpected operator: " + operator.getLexeme(), operator); }; Expression right = factor(); - expr = new BinaryExpression(expr.getLocation(), expr, op, right); + expr = new BinaryExpressionImpl(expr.getLocation(), expr, op, right); } return expr; @@ -204,7 +204,7 @@ private Expression factor() { default -> throw new ParseException("Unexpected operator: " + operator.getLexeme(), operator); }; Expression right = unary(); - expr = new BinaryExpression(expr.getLocation(), expr, op, right); + expr = new BinaryExpressionImpl(expr.getLocation(), expr, op, right); } return expr; @@ -220,7 +220,7 @@ private Expression unary() { Token operator = previous(); UnaryOperator op = mapTokenToUnaryOperator(operator); Expression right = unary(); - return new UnaryExpression(operator.getLocation(), op, right); + return new UnaryExpressionImpl(operator.getLocation(), op, right); } return power(); @@ -235,7 +235,7 @@ private Expression power() { if (match(TokenType.POWER)) { BinaryOperator operator = BinaryOperator.POWER; Expression right = unary(); // Right-associative - expr = new BinaryExpression(expr.getLocation(), expr, operator, right); + expr = new BinaryExpressionImpl(expr.getLocation(), expr, operator, right); } return expr; @@ -247,21 +247,21 @@ private Expression power() { private Expression primary() { if (match(TokenType.BOOLEAN)) { Token token = previous(); - return new LiteralExpression(token.getLocation(), token.getLiteral()); + return new LiteralExpressionImpl(token.getLocation(), token.getLiteral()); } if (match(TokenType.NULL)) { - return new LiteralExpression(previous().getLocation(), (Object) null); + return new LiteralExpressionImpl(previous().getLocation(), (Object) null); } if (match(TokenType.NUMBER)) { Token token = previous(); - return new LiteralExpression(token.getLocation(), token.getLiteral()); + return new LiteralExpressionImpl(token.getLocation(), token.getLiteral()); } if (match(TokenType.STRING)) { Token token = previous(); - return new LiteralExpression(token.getLocation(), token.getLiteral()); + return new LiteralExpressionImpl(token.getLocation(), token.getLiteral()); } if (match(TokenType.IDENTIFIER)) { @@ -292,7 +292,7 @@ private Expression primary() { consume(TokenType.RBRACKET, "Expected ']' after array index"); } - VariableExpression variable = new VariableExpression( + VariableExpressionImpl variable = new VariableExpressionImpl( identifier.getLocation(), identifier.getLexeme(), propertyPath.isEmpty() ? null : propertyPath); @@ -330,15 +330,15 @@ private Expression parseArrayLiteral() { // Handle empty array if (check(TokenType.RBRACKET)) { advance(); // consume ] - return new LiteralExpression(location, elements); + return new LiteralExpressionImpl(location, elements); } // Parse array elements do { Expression element = parseExpression(); // Evaluate constant expressions to get the literal value - if (element instanceof LiteralExpression) { - elements.add(((LiteralExpression) element).getValue()); + if (element instanceof LiteralExpressionImpl) { + elements.add(((LiteralExpressionImpl) element).getValue()); } else { // For non-literal expressions, store the expression itself // This will be evaluated at runtime @@ -347,7 +347,7 @@ private Expression parseArrayLiteral() { } while (match(TokenType.COMMA)); consume(TokenType.RBRACKET, "Expected ']' after array elements"); - return new LiteralExpression(location, elements); + return new LiteralExpressionImpl(location, elements); } /** @@ -365,7 +365,7 @@ private Expression functionCall(Token identifier) { consume(TokenType.RPAREN, "Expected ')' after function arguments"); - return new FunctionCallExpression(identifier.getLocation(), identifier.getLexeme(), arguments); + return new FunctionCallExpressionImpl(identifier.getLocation(), identifier.getLexeme(), arguments); } /** diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ActionExecutor.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ActionExecutorImpl.java similarity index 89% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ActionExecutor.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ActionExecutorImpl.java index 1018beca1..1d4517494 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ActionExecutor.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ActionExecutorImpl.java @@ -18,9 +18,9 @@ import org.fireflyframework.rules.core.dsl.ASTVisitor; import org.fireflyframework.rules.core.dsl.action.*; -import org.fireflyframework.rules.core.dsl.condition.ComparisonCondition; -import org.fireflyframework.rules.core.dsl.condition.ExpressionCondition; -import org.fireflyframework.rules.core.dsl.condition.LogicalCondition; +import org.fireflyframework.rules.core.dsl.condition.ComparisonConditionImpl; +import org.fireflyframework.rules.core.dsl.condition.ExpressionConditionImpl; +import org.fireflyframework.rules.core.dsl.condition.LogicalConditionImpl; import org.fireflyframework.rules.core.dsl.expression.*; import org.fireflyframework.rules.core.dsl.function.CustomFunctionRegistry; import org.fireflyframework.rules.core.services.JsonPathService; @@ -32,39 +32,39 @@ * Replaces the string-based action execution with structured AST traversal. */ @Slf4j -public class ActionExecutor implements ASTVisitor { +public class ActionExecutorImpl implements ASTVisitor { private final EvaluationContext context; - private final ExpressionEvaluator expressionEvaluator; + private final ExpressionEvaluatorImpl expressionEvaluator; - public ActionExecutor(EvaluationContext context) { + public ActionExecutorImpl(EvaluationContext context) { this(context, null, null, null, null); } - public ActionExecutor(EvaluationContext context, RestCallService restCallService, JsonPathService jsonPathService) { + public ActionExecutorImpl(EvaluationContext context, RestCallService restCallService, JsonPathService jsonPathService) { this(context, restCallService, jsonPathService, null, null); } - public ActionExecutor(EvaluationContext context, + public ActionExecutorImpl(EvaluationContext context, RestCallService restCallService, JsonPathService jsonPathService, CustomFunctionRegistry customFunctions) { this(context, restCallService, jsonPathService, customFunctions, null); } - public ActionExecutor(EvaluationContext context, + public ActionExecutorImpl(EvaluationContext context, RestCallService restCallService, JsonPathService jsonPathService, CustomFunctionRegistry customFunctions, org.fireflyframework.rules.core.dsl.function.RuleInvoker ruleInvoker) { this.context = context; - this.expressionEvaluator = new ExpressionEvaluator(context, restCallService, jsonPathService, customFunctions, ruleInvoker); + this.expressionEvaluator = new ExpressionEvaluatorImpl(context, restCallService, jsonPathService, customFunctions, ruleInvoker); } // Action visitors @Override - public Void visitFunctionCallAction(FunctionCallAction node) { + public Void visitFunctionCallAction(FunctionCallActionImpl node) { // Evaluate arguments Object[] args = node.getArguments().stream() .map(arg -> arg.accept(expressionEvaluator)) @@ -84,7 +84,7 @@ public Void visitFunctionCallAction(FunctionCallAction node) { } @Override - public Void visitConditionalAction(ConditionalAction node) { + public Void visitConditionalAction(ConditionalActionImpl node) { // Evaluate condition Object conditionResult = node.getCondition().accept(expressionEvaluator); boolean conditionMet = toBoolean(conditionResult); @@ -111,7 +111,7 @@ public Void visitConditionalAction(ConditionalAction node) { } @Override - public Void visitCalculateAction(CalculateAction node) { + public Void visitCalculateAction(CalculateActionImpl node) { // Validate that calculate only uses mathematical expressions (no function calls) if (containsNonMathematicalOperation(node.getExpression())) { throw new IllegalArgumentException( @@ -132,14 +132,14 @@ public Void visitCalculateAction(CalculateAction node) { * Check if an expression contains non-mathematical operations (function calls, REST calls, JSON operations) */ private boolean containsNonMathematicalOperation(Expression expression) { - if (expression instanceof FunctionCallExpression) { + if (expression instanceof FunctionCallExpressionImpl) { return true; } - if (expression instanceof BinaryExpression binaryExpr) { + if (expression instanceof BinaryExpressionImpl binaryExpr) { return containsNonMathematicalOperation(binaryExpr.getLeft()) || containsNonMathematicalOperation(binaryExpr.getRight()); } - if (expression instanceof UnaryExpression unaryExpr) { + if (expression instanceof UnaryExpressionImpl unaryExpr) { return containsNonMathematicalOperation(unaryExpr.getOperand()); } // LiteralExpression and VariableExpression are allowed @@ -147,7 +147,7 @@ private boolean containsNonMathematicalOperation(Expression expression) { } @Override - public Void visitRunAction(RunAction node) { + public Void visitRunAction(RunActionImpl node) { Object result = node.getExpression().accept(expressionEvaluator); context.setComputedVariable(node.getResultVariable(), result); @@ -156,7 +156,7 @@ public Void visitRunAction(RunAction node) { } @Override - public Void visitSetAction(SetAction node) { + public Void visitSetAction(SetActionImpl node) { Object value = node.getValue().accept(expressionEvaluator); context.setComputedVariable(node.getVariableName(), value); @@ -167,44 +167,44 @@ public Void visitSetAction(SetAction node) { // Expression visitors (not used in action execution) @Override - public Void visitBinaryExpression(BinaryExpression node) { + public Void visitBinaryExpression(BinaryExpressionImpl node) { throw new UnsupportedOperationException("Expressions cannot be executed as actions"); } @Override - public Void visitUnaryExpression(UnaryExpression node) { + public Void visitUnaryExpression(UnaryExpressionImpl node) { throw new UnsupportedOperationException("Expressions cannot be executed as actions"); } @Override - public Void visitVariableExpression(VariableExpression node) { + public Void visitVariableExpression(VariableExpressionImpl node) { throw new UnsupportedOperationException("Expressions cannot be executed as actions"); } @Override - public Void visitLiteralExpression(LiteralExpression node) { + public Void visitLiteralExpression(LiteralExpressionImpl node) { throw new UnsupportedOperationException("Expressions cannot be executed as actions"); } @Override - public Void visitFunctionCallExpression(FunctionCallExpression node) { + public Void visitFunctionCallExpression(FunctionCallExpressionImpl node) { throw new UnsupportedOperationException("Expressions cannot be executed as actions"); } // Condition visitors (not used in action execution) @Override - public Void visitComparisonCondition(ComparisonCondition node) { + public Void visitComparisonCondition(ComparisonConditionImpl node) { throw new UnsupportedOperationException("Conditions cannot be executed as actions"); } @Override - public Void visitLogicalCondition(LogicalCondition node) { + public Void visitLogicalCondition(LogicalConditionImpl node) { throw new UnsupportedOperationException("Conditions cannot be executed as actions"); } @Override - public Void visitExpressionCondition(ExpressionCondition node) { + public Void visitExpressionCondition(ExpressionConditionImpl node) { throw new UnsupportedOperationException("Conditions cannot be executed as actions"); } @@ -288,10 +288,10 @@ private Object executeFunction(String functionName, Object[] args) { "time_hour", "is_valid", "in_range" -> { // These functions are handled by the expression evaluator yield expressionEvaluator.visitFunctionCallExpression( - new FunctionCallExpression( + new FunctionCallExpressionImpl( null, functionName, java.util.Arrays.stream(args) - .map(arg -> new LiteralExpression(null, arg)) + .map(arg -> new LiteralExpressionImpl(null, arg)) .collect(java.util.stream.Collectors.toList()) ) ); @@ -300,17 +300,17 @@ private Object executeFunction(String functionName, Object[] args) { // to the expression evaluator, which checks the custom registry first and throws // IllegalArgumentException with the registry-aware diagnostic if still unknown. default -> expressionEvaluator.visitFunctionCallExpression( - new FunctionCallExpression( + new FunctionCallExpressionImpl( null, functionName, java.util.Arrays.stream(args) - .map(arg -> new LiteralExpression(null, arg)) + .map(arg -> new LiteralExpressionImpl(null, arg)) .collect(java.util.stream.Collectors.toList()) )); }; } @Override - public Void visitArithmeticAction(ArithmeticAction node) { + public Void visitArithmeticAction(ArithmeticActionImpl node) { log.debug("Executing arithmetic action: {} {} {} {}", node.getOperation().getKeyword(), node.getValue(), node.getOperation().getPreposition(), node.getVariableName()); @@ -349,7 +349,7 @@ private static String describeType(Object o) { } @Override - public Void visitListAction(ListAction node) { + public Void visitListAction(ListActionImpl node) { log.debug("Executing list action: {} {} {} {}", node.getOperation().getKeyword(), node.getValue(), node.getOperation().getPreposition(), node.getListVariable()); @@ -378,7 +378,7 @@ public Void visitListAction(ListAction node) { } @Override - public Void visitCircuitBreakerAction(CircuitBreakerAction node) { + public Void visitCircuitBreakerAction(CircuitBreakerActionImpl node) { log.info("Circuit breaker triggered: {}", node.getMessage()); // Trigger circuit breaker in context @@ -392,7 +392,7 @@ public Void visitCircuitBreakerAction(CircuitBreakerAction node) { } @Override - public Void visitForEachAction(ForEachAction node) { + public Void visitForEachAction(ForEachActionImpl node) { log.debug("Executing forEach action: {} in {}", node.getIterationVariable(), node.getListExpression()); // Evaluate the list expression @@ -439,7 +439,7 @@ public Void visitForEachAction(ForEachAction node) { } @Override - public Void visitWhileAction(WhileAction node) { + public Void visitWhileAction(WhileActionImpl node) { log.debug("Executing while loop"); int iterations = 0; @@ -477,7 +477,7 @@ public Void visitWhileAction(WhileAction node) { } @Override - public Void visitDoWhileAction(DoWhileAction node) { + public Void visitDoWhileAction(DoWhileActionImpl node) { log.debug("Executing do-while loop"); int iterations = 0; diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ExpressionEvaluator.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ExpressionEvaluatorImpl.java similarity index 98% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ExpressionEvaluator.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ExpressionEvaluatorImpl.java index 98dc00e07..77db70297 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ExpressionEvaluator.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ExpressionEvaluatorImpl.java @@ -18,9 +18,9 @@ import org.fireflyframework.rules.core.dsl.ASTVisitor; import org.fireflyframework.rules.core.dsl.action.*; -import org.fireflyframework.rules.core.dsl.condition.ComparisonCondition; -import org.fireflyframework.rules.core.dsl.condition.ExpressionCondition; -import org.fireflyframework.rules.core.dsl.condition.LogicalCondition; +import org.fireflyframework.rules.core.dsl.condition.ComparisonConditionImpl; +import org.fireflyframework.rules.core.dsl.condition.ExpressionConditionImpl; +import org.fireflyframework.rules.core.dsl.condition.LogicalConditionImpl; import org.fireflyframework.rules.core.dsl.expression.*; import org.fireflyframework.rules.core.dsl.function.CustomFunctionRegistry; import org.fireflyframework.rules.core.dsl.function.RuleFunction; @@ -41,7 +41,7 @@ * Replaces the string-based expression evaluation with structured AST traversal. */ @Slf4j -public class ExpressionEvaluator implements ASTVisitor { +public class ExpressionEvaluatorImpl implements ASTVisitor { private final EvaluationContext context; private final RestCallService restCallService; @@ -58,22 +58,22 @@ protected boolean removeEldestEntry(Map.Entry eldest) { } }; - public ExpressionEvaluator(EvaluationContext context) { + public ExpressionEvaluatorImpl(EvaluationContext context) { this(context, null, null, null, null); } - public ExpressionEvaluator(EvaluationContext context, RestCallService restCallService, JsonPathService jsonPathService) { + public ExpressionEvaluatorImpl(EvaluationContext context, RestCallService restCallService, JsonPathService jsonPathService) { this(context, restCallService, jsonPathService, null, null); } - public ExpressionEvaluator(EvaluationContext context, + public ExpressionEvaluatorImpl(EvaluationContext context, RestCallService restCallService, JsonPathService jsonPathService, CustomFunctionRegistry customFunctions) { this(context, restCallService, jsonPathService, customFunctions, null); } - public ExpressionEvaluator(EvaluationContext context, + public ExpressionEvaluatorImpl(EvaluationContext context, RestCallService restCallService, JsonPathService jsonPathService, CustomFunctionRegistry customFunctions, @@ -88,7 +88,7 @@ public ExpressionEvaluator(EvaluationContext context, // Expression visitors @Override - public Object visitBinaryExpression(BinaryExpression node) { + public Object visitBinaryExpression(BinaryExpressionImpl node) { // Short-circuit AND/OR: evaluate right side only when needed if (node.getOperator() == BinaryOperator.AND) { return toBoolean(node.getLeft().accept(this)) && toBoolean(node.getRight().accept(this)); @@ -134,7 +134,7 @@ public Object visitBinaryExpression(BinaryExpression node) { } @Override - public Object visitUnaryExpression(UnaryExpression node) { + public Object visitUnaryExpression(UnaryExpressionImpl node) { Object operandValue = node.getOperand().accept(this); return switch (node.getOperator()) { @@ -180,7 +180,7 @@ public Object visitUnaryExpression(UnaryExpression node) { } @Override - public Object visitVariableExpression(VariableExpression node) { + public Object visitVariableExpression(VariableExpressionImpl node) { Object value = context.getVariable(node.getVariableName()); // Handle property access @@ -205,12 +205,12 @@ public Object visitVariableExpression(VariableExpression node) { } @Override - public Object visitLiteralExpression(LiteralExpression node) { + public Object visitLiteralExpression(LiteralExpressionImpl node) { return node.getValue(); } @Override - public Object visitFunctionCallExpression(FunctionCallExpression node) { + public Object visitFunctionCallExpression(FunctionCallExpressionImpl node) { String functionName = node.getFunctionName(); Object[] args = node.hasArguments() ? node.getArguments().stream().map(arg -> arg.accept(this)).toArray() : @@ -378,7 +378,7 @@ public Object visitFunctionCallExpression(FunctionCallExpression node) { // Condition visitors (return Boolean) @Override - public Object visitComparisonCondition(ComparisonCondition node) { + public Object visitComparisonCondition(ComparisonConditionImpl node) { Object leftValue = node.getLeft().accept(this); Object rightValue = node.getRight() != null ? node.getRight().accept(this) : null; Object rangeEndValue = node.getRangeEnd() != null ? node.getRangeEnd().accept(this) : null; @@ -448,7 +448,7 @@ public Object visitComparisonCondition(ComparisonCondition node) { } @Override - public Object visitLogicalCondition(LogicalCondition node) { + public Object visitLogicalCondition(LogicalConditionImpl node) { return switch (node.getOperator()) { case AND -> node.getOperands().stream() .allMatch(operand -> toBoolean(operand.accept(this))); @@ -459,64 +459,64 @@ public Object visitLogicalCondition(LogicalCondition node) { } @Override - public Object visitExpressionCondition(ExpressionCondition node) { + public Object visitExpressionCondition(ExpressionConditionImpl node) { return toBoolean(node.getExpression().accept(this)); } // Action visitors (not used in expression evaluation) @Override - public Object visitFunctionCallAction(FunctionCallAction node) { + public Object visitFunctionCallAction(FunctionCallActionImpl node) { throw new UnsupportedOperationException("Actions cannot be evaluated as expressions"); } @Override - public Object visitConditionalAction(ConditionalAction node) { + public Object visitConditionalAction(ConditionalActionImpl node) { throw new UnsupportedOperationException("Actions cannot be evaluated as expressions"); } @Override - public Object visitCalculateAction(CalculateAction node) { + public Object visitCalculateAction(CalculateActionImpl node) { throw new UnsupportedOperationException("Actions cannot be evaluated as expressions"); } @Override - public Object visitRunAction(RunAction node) { + public Object visitRunAction(RunActionImpl node) { throw new UnsupportedOperationException("Actions cannot be evaluated as expressions"); } @Override - public Object visitSetAction(SetAction node) { + public Object visitSetAction(SetActionImpl node) { throw new UnsupportedOperationException("Actions cannot be evaluated as expressions"); } @Override - public Object visitArithmeticAction(ArithmeticAction node) { + public Object visitArithmeticAction(ArithmeticActionImpl node) { throw new UnsupportedOperationException("Actions cannot be evaluated as expressions"); } @Override - public Object visitListAction(ListAction node) { + public Object visitListAction(ListActionImpl node) { throw new UnsupportedOperationException("Actions cannot be evaluated as expressions"); } @Override - public Object visitCircuitBreakerAction(CircuitBreakerAction node) { + public Object visitCircuitBreakerAction(CircuitBreakerActionImpl node) { throw new UnsupportedOperationException("Actions cannot be evaluated as expressions"); } @Override - public Object visitForEachAction(ForEachAction node) { + public Object visitForEachAction(ForEachActionImpl node) { throw new UnsupportedOperationException("Actions cannot be evaluated as expressions"); } @Override - public Object visitWhileAction(WhileAction node) { + public Object visitWhileAction(WhileActionImpl node) { throw new UnsupportedOperationException("Actions cannot be evaluated as expressions"); } @Override - public Object visitDoWhileAction(DoWhileAction node) { + public Object visitDoWhileAction(DoWhileActionImpl node) { throw new UnsupportedOperationException("Actions cannot be evaluated as expressions"); } @@ -1207,8 +1207,8 @@ private Object evaluateDatePart(Object[] args, String fnName, java.util.function private Object callFunctionByName(String name, Object[] args) { java.util.List argExprs = new java.util.ArrayList<>(args.length); - for (Object a : args) argExprs.add(new LiteralExpression(null, a)); - FunctionCallExpression call = new FunctionCallExpression(null, name, argExprs); + for (Object a : args) argExprs.add(new LiteralExpressionImpl(null, a)); + FunctionCallExpressionImpl call = new FunctionCallExpressionImpl(null, name, argExprs); return visitFunctionCallExpression(call); } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ValidationVisitor.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ValidationVisitorImpl.java similarity index 95% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ValidationVisitor.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ValidationVisitorImpl.java index c84fb72d5..bb7242205 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ValidationVisitor.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/dsl/visitor/ValidationVisitorImpl.java @@ -18,10 +18,10 @@ import org.fireflyframework.rules.core.dsl.ASTVisitor; import org.fireflyframework.rules.core.dsl.action.*; -import org.fireflyframework.rules.core.dsl.condition.ComparisonCondition; +import org.fireflyframework.rules.core.dsl.condition.ComparisonConditionImpl; import org.fireflyframework.rules.core.dsl.condition.Condition; -import org.fireflyframework.rules.core.dsl.condition.ExpressionCondition; -import org.fireflyframework.rules.core.dsl.condition.LogicalCondition; +import org.fireflyframework.rules.core.dsl.condition.ExpressionConditionImpl; +import org.fireflyframework.rules.core.dsl.condition.LogicalConditionImpl; import org.fireflyframework.rules.core.dsl.expression.*; import lombok.extern.slf4j.Slf4j; @@ -34,12 +34,12 @@ * Checks for type compatibility, variable references, and other semantic rules. */ @Slf4j -public class ValidationVisitor implements ASTVisitor> { +public class ValidationVisitorImpl implements ASTVisitor> { private final Set availableVariables; private final Set availableFunctions; - public ValidationVisitor(Set availableVariables, Set availableFunctions) { + public ValidationVisitorImpl(Set availableVariables, Set availableFunctions) { this.availableVariables = availableVariables; this.availableFunctions = availableFunctions; } @@ -47,7 +47,7 @@ public ValidationVisitor(Set availableVariables, Set availableFu // Expression visitors @Override - public List visitBinaryExpression(BinaryExpression node) { + public List visitBinaryExpression(BinaryExpressionImpl node) { List errors = new ArrayList<>(); // Validate operands @@ -96,7 +96,7 @@ public List visitBinaryExpression(BinaryExpression node) { } @Override - public List visitUnaryExpression(UnaryExpression node) { + public List visitUnaryExpression(UnaryExpressionImpl node) { List errors = new ArrayList<>(); // Validate operand @@ -130,7 +130,7 @@ public List visitUnaryExpression(UnaryExpression node) { } @Override - public List visitVariableExpression(VariableExpression node) { + public List visitVariableExpression(VariableExpressionImpl node) { List errors = new ArrayList<>(); // Check if variable exists @@ -160,13 +160,13 @@ public List visitVariableExpression(VariableExpression node) { } @Override - public List visitLiteralExpression(LiteralExpression node) { + public List visitLiteralExpression(LiteralExpressionImpl node) { // Literals are always valid return new ArrayList<>(); } @Override - public List visitFunctionCallExpression(FunctionCallExpression node) { + public List visitFunctionCallExpression(FunctionCallExpressionImpl node) { List errors = new ArrayList<>(); // Check if function exists @@ -191,7 +191,7 @@ public List visitFunctionCallExpression(FunctionCallExpression // Condition visitors @Override - public List visitComparisonCondition(ComparisonCondition node) { + public List visitComparisonCondition(ComparisonConditionImpl node) { List errors = new ArrayList<>(); // Validate operands @@ -218,7 +218,7 @@ public List visitComparisonCondition(ComparisonCondition node) } @Override - public List visitLogicalCondition(LogicalCondition node) { + public List visitLogicalCondition(LogicalConditionImpl node) { List errors = new ArrayList<>(); // Validate operands @@ -253,14 +253,14 @@ public List visitLogicalCondition(LogicalCondition node) { } @Override - public List visitExpressionCondition(ExpressionCondition node) { + public List visitExpressionCondition(ExpressionConditionImpl node) { return node.getExpression().accept(this); } // Action visitors @Override - public List visitFunctionCallAction(FunctionCallAction node) { + public List visitFunctionCallAction(FunctionCallActionImpl node) { List errors = new ArrayList<>(); // Check if function exists @@ -283,7 +283,7 @@ public List visitFunctionCallAction(FunctionCallAction node) { } @Override - public List visitConditionalAction(ConditionalAction node) { + public List visitConditionalAction(ConditionalActionImpl node) { List errors = new ArrayList<>(); // Validate condition @@ -307,7 +307,7 @@ public List visitConditionalAction(ConditionalAction node) { } @Override - public List visitCalculateAction(CalculateAction node) { + public List visitCalculateAction(CalculateActionImpl node) { List errors = new ArrayList<>(); // Validate that calculate only uses mathematical expressions (no function calls) @@ -339,14 +339,14 @@ public List visitCalculateAction(CalculateAction node) { * Check if an expression contains non-mathematical operations (function calls, REST calls, JSON operations) */ private boolean containsNonMathematicalOperation(Expression expression) { - if (expression instanceof FunctionCallExpression) { + if (expression instanceof FunctionCallExpressionImpl) { return true; } - if (expression instanceof BinaryExpression binaryExpr) { + if (expression instanceof BinaryExpressionImpl binaryExpr) { return containsNonMathematicalOperation(binaryExpr.getLeft()) || containsNonMathematicalOperation(binaryExpr.getRight()); } - if (expression instanceof UnaryExpression unaryExpr) { + if (expression instanceof UnaryExpressionImpl unaryExpr) { return containsNonMathematicalOperation(unaryExpr.getOperand()); } // LiteralExpression and VariableExpression are allowed @@ -354,7 +354,7 @@ private boolean containsNonMathematicalOperation(Expression expression) { } @Override - public List visitRunAction(RunAction node) { + public List visitRunAction(RunActionImpl node) { List errors = new ArrayList<>(); // Validate expression @@ -373,7 +373,7 @@ public List visitRunAction(RunAction node) { } @Override - public List visitSetAction(SetAction node) { + public List visitSetAction(SetActionImpl node) { List errors = new ArrayList<>(); // Validate value expression @@ -422,7 +422,7 @@ private boolean isDefinitelyNonList(ExpressionType type) { } @Override - public List visitArithmeticAction(ArithmeticAction node) { + public List visitArithmeticAction(ArithmeticActionImpl node) { List errors = new ArrayList<>(); // Validate value expression @@ -442,7 +442,7 @@ public List visitArithmeticAction(ArithmeticAction node) { } @Override - public List visitListAction(ListAction node) { + public List visitListAction(ListActionImpl node) { List errors = new ArrayList<>(); // Validate value expression @@ -462,7 +462,7 @@ public List visitListAction(ListAction node) { } @Override - public List visitCircuitBreakerAction(CircuitBreakerAction node) { + public List visitCircuitBreakerAction(CircuitBreakerActionImpl node) { List errors = new ArrayList<>(); // Validate message @@ -474,7 +474,7 @@ public List visitCircuitBreakerAction(CircuitBreakerAction node } @Override - public List visitForEachAction(ForEachAction node) { + public List visitForEachAction(ForEachActionImpl node) { List errors = new ArrayList<>(); // Validate iteration variable name @@ -524,7 +524,7 @@ public List visitForEachAction(ForEachAction node) { } @Override - public List visitWhileAction(WhileAction node) { + public List visitWhileAction(WhileActionImpl node) { List errors = new ArrayList<>(); // Validate condition @@ -565,7 +565,7 @@ public List visitWhileAction(WhileAction node) { } @Override - public List visitDoWhileAction(DoWhileAction node) { + public List visitDoWhileAction(DoWhileActionImpl node) { List errors = new ArrayList<>(); // Validate body actions diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineMetrics.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineMetricsImpl.java similarity index 95% rename from modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineMetrics.java rename to modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineMetricsImpl.java index 89855c0dc..78df8bdf8 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineMetrics.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineMetricsImpl.java @@ -37,13 +37,13 @@ * tagged by {@code rule.id}, {@code error.type} * */ -public class RuleEngineMetrics extends FireflyMetricsSupport { +public class RuleEngineMetricsImpl extends FireflyMetricsSupport { private static final String TAG_RULE_ID = "rule.id"; private static final String TAG_CONDITION_ID = "condition.id"; private static final String TAG_RESULT = "result"; - public RuleEngineMetrics(MeterRegistry meterRegistry) { + public RuleEngineMetricsImpl(MeterRegistry meterRegistry) { super(meterRegistry, "ruleengine"); } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineObservabilityAutoConfiguration.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineObservabilityAutoConfiguration.java index e2c18f154..cc542b11a 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineObservabilityAutoConfiguration.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/observability/RuleEngineObservabilityAutoConfiguration.java @@ -36,7 +36,7 @@ public class RuleEngineObservabilityAutoConfiguration { @Bean @ConditionalOnMissingBean @ConditionalOnBean(MeterRegistry.class) - RuleEngineMetrics ruleEngineMetrics(MeterRegistry meterRegistry) { - return new RuleEngineMetrics(meterRegistry); + RuleEngineMetricsImpl ruleEngineMetrics(MeterRegistry meterRegistry) { + return new RuleEngineMetricsImpl(meterRegistry); } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/services/impl/CacheServiceImpl.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/services/impl/CacheServiceImpl.java index 4ea548f3f..2d5eca76b 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/services/impl/CacheServiceImpl.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/services/impl/CacheServiceImpl.java @@ -17,7 +17,7 @@ package org.fireflyframework.rules.core.services.impl; import org.fireflyframework.cache.CacheProviderType; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.springframework.beans.factory.annotation.Qualifier; import org.fireflyframework.rules.core.dsl.model.ASTRulesDSL; import org.fireflyframework.rules.core.services.CacheService; @@ -49,7 +49,7 @@ @Slf4j public class CacheServiceImpl implements CacheService { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private final ConstantService constantService; /** @@ -59,7 +59,7 @@ public class CacheServiceImpl implements CacheService { * @param constantService service for managing constants */ public CacheServiceImpl( - @Qualifier("ruleEngineCacheManager") FireflyCacheManager cacheManager, + @Qualifier("ruleEngineCacheManager") FireflyCacheManagerImpl cacheManager, ConstantService constantService) { this.cacheManager = cacheManager; this.constantService = constantService; diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/validation/YamlDslValidator.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/validation/YamlDslValidator.java index 0e4231bb0..001dde49d 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/validation/YamlDslValidator.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/main/java/org/fireflyframework/rules/core/validation/YamlDslValidator.java @@ -19,15 +19,15 @@ import org.fireflyframework.rules.core.dsl.ASTVisitor; import org.fireflyframework.rules.core.dsl.SourceLocation; import org.fireflyframework.rules.core.dsl.action.*; -import org.fireflyframework.rules.core.dsl.condition.ComparisonCondition; +import org.fireflyframework.rules.core.dsl.condition.ComparisonConditionImpl; import org.fireflyframework.rules.core.dsl.condition.Condition; -import org.fireflyframework.rules.core.dsl.condition.ExpressionCondition; -import org.fireflyframework.rules.core.dsl.condition.LogicalCondition; +import org.fireflyframework.rules.core.dsl.condition.ExpressionConditionImpl; +import org.fireflyframework.rules.core.dsl.condition.LogicalConditionImpl; import org.fireflyframework.rules.core.dsl.expression.*; import org.fireflyframework.rules.core.dsl.model.ASTRulesDSL; import org.fireflyframework.rules.core.dsl.parser.ASTRulesDSLParser; import org.fireflyframework.rules.core.dsl.visitor.ValidationError; -import org.fireflyframework.rules.core.dsl.visitor.ValidationVisitor; +import org.fireflyframework.rules.core.dsl.visitor.ValidationVisitorImpl; import org.fireflyframework.rules.interfaces.dtos.validation.ValidationResult; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -126,7 +126,7 @@ private List performSemanticValidation(ASTRule Set availableFunctions = getBuiltInFunctions(); // Create validation visitor - ValidationVisitor validator = new ValidationVisitor(availableVariables, availableFunctions); + ValidationVisitorImpl validator = new ValidationVisitorImpl(availableVariables, availableFunctions); // Validate all conditions if (rulesDSL.getWhenConditions() != null) { @@ -253,7 +253,7 @@ private List performBestPracticesValidation(AS * Validate complex conditions block */ private List validateComplexConditionsBlock( - ASTRulesDSL.ASTConditionalBlock conditionsBlock, ValidationVisitor validator) { + ASTRulesDSL.ASTConditionalBlock conditionsBlock, ValidationVisitorImpl validator) { List issues = new ArrayList<>(); try { @@ -295,7 +295,7 @@ private List validateComplexConditionsBlock( * Validate action block (used in complex conditions) */ private List validateActionBlock( - ASTRulesDSL.ASTActionBlock actionBlock, ValidationVisitor validator, String location) { + ASTRulesDSL.ASTActionBlock actionBlock, ValidationVisitorImpl validator, String location) { List issues = new ArrayList<>(); // Validate actions @@ -324,7 +324,7 @@ private List validateActionBlock( * Validate sub-rule (used in multiple rules syntax) */ private List validateSubRule( - ASTRulesDSL.ASTSubRule subRule, ValidationVisitor validator, int ruleIndex) { + ASTRulesDSL.ASTSubRule subRule, ValidationVisitorImpl validator, int ruleIndex) { List issues = new ArrayList<>(); String ruleLocation = "rules[" + ruleIndex + "]"; @@ -463,20 +463,20 @@ private Set extractVariablesFromActions(List actions) { Set variables = new HashSet<>(); for (Action action : actions) { - if (action instanceof SetAction setAction) { + if (action instanceof SetActionImpl setAction) { variables.add(setAction.getVariableName()); - } else if (action instanceof CalculateAction calculateAction) { + } else if (action instanceof CalculateActionImpl calculateAction) { variables.add(calculateAction.getResultVariable()); - } else if (action instanceof RunAction runAction) { + } else if (action instanceof RunActionImpl runAction) { // Run actions create computed variables (for function calls, REST calls, JSON operations) variables.add(runAction.getResultVariable()); - } else if (action instanceof ListAction listAction) { + } else if (action instanceof ListActionImpl listAction) { // List actions like append, prepend, remove also create/modify variables variables.add(listAction.getListVariable()); - } else if (action instanceof ArithmeticAction arithmeticAction) { + } else if (action instanceof ArithmeticActionImpl arithmeticAction) { // Arithmetic actions modify existing variables variables.add(arithmeticAction.getVariableName()); - } else if (action instanceof FunctionCallAction functionCallAction) { + } else if (action instanceof FunctionCallActionImpl functionCallAction) { // Function calls can optionally store results in variables if (functionCallAction.getResultVariable() != null) { variables.add(functionCallAction.getResultVariable()); @@ -510,7 +510,7 @@ private Set extractVariablesFromComplexConditions(ASTRulesDSL.ASTConditi */ private Set extractConstantReferences(ASTRulesDSL rulesDSL) { // Use a visitor to collect all variable references - ValidationVariableCollector collector = new ValidationVariableCollector(); + ValidationVariableCollectorImpl collector = new ValidationVariableCollectorImpl(); // Collect from simple syntax (when/then/else) if (rulesDSL.getWhenConditions() != null) { @@ -581,7 +581,7 @@ private Set extractConstantReferences(ASTRulesDSL rulesDSL) { /** * Collect variable references from complex conditions blocks */ - private void collectFromComplexConditions(ASTRulesDSL.ASTConditionalBlock conditions, ValidationVariableCollector collector) { + private void collectFromComplexConditions(ASTRulesDSL.ASTConditionalBlock conditions, ValidationVariableCollectorImpl collector) { if (conditions.getIfCondition() != null) { conditions.getIfCondition().accept(collector); } @@ -618,7 +618,7 @@ private boolean isConstantReference(String variableName) { * Simple visitor class to collect all variable references from AST nodes * This is used for validation purposes to detect database constants */ - private static class ValidationVariableCollector implements ASTVisitor { + private static class ValidationVariableCollectorImpl implements ASTVisitor { private final Set variableReferences = new HashSet<>(); public Set getVariableReferences() { @@ -626,32 +626,32 @@ public Set getVariableReferences() { } @Override - public Void visitVariableExpression(VariableExpression node) { + public Void visitVariableExpression(VariableExpressionImpl node) { variableReferences.add(node.getVariableName()); return null; } // Default implementations for all other visitor methods @Override - public Void visitBinaryExpression(BinaryExpression node) { + public Void visitBinaryExpression(BinaryExpressionImpl node) { if (node.getLeft() != null) node.getLeft().accept(this); if (node.getRight() != null) node.getRight().accept(this); return null; } @Override - public Void visitUnaryExpression(UnaryExpression node) { + public Void visitUnaryExpression(UnaryExpressionImpl node) { if (node.getOperand() != null) node.getOperand().accept(this); return null; } @Override - public Void visitLiteralExpression(LiteralExpression node) { + public Void visitLiteralExpression(LiteralExpressionImpl node) { return null; // Literals don't contain variable references } @Override - public Void visitFunctionCallExpression(FunctionCallExpression node) { + public Void visitFunctionCallExpression(FunctionCallExpressionImpl node) { if (node.getArguments() != null) { node.getArguments().forEach(arg -> arg.accept(this)); } @@ -659,14 +659,14 @@ public Void visitFunctionCallExpression(FunctionCallExpression node) { } @Override - public Void visitComparisonCondition(ComparisonCondition node) { + public Void visitComparisonCondition(ComparisonConditionImpl node) { if (node.getLeft() != null) node.getLeft().accept(this); if (node.getRight() != null) node.getRight().accept(this); return null; } @Override - public Void visitLogicalCondition(LogicalCondition node) { + public Void visitLogicalCondition(LogicalConditionImpl node) { if (node.getOperands() != null) { node.getOperands().forEach(operand -> operand.accept(this)); } @@ -674,13 +674,13 @@ public Void visitLogicalCondition(LogicalCondition node) { } @Override - public Void visitExpressionCondition(ExpressionCondition node) { + public Void visitExpressionCondition(ExpressionConditionImpl node) { if (node.getExpression() != null) node.getExpression().accept(this); return null; } @Override - public Void visitFunctionCallAction(FunctionCallAction node) { + public Void visitFunctionCallAction(FunctionCallActionImpl node) { if (node.getArguments() != null) { node.getArguments().forEach(arg -> arg.accept(this)); } @@ -688,7 +688,7 @@ public Void visitFunctionCallAction(FunctionCallAction node) { } @Override - public Void visitConditionalAction(ConditionalAction node) { + public Void visitConditionalAction(ConditionalActionImpl node) { if (node.getCondition() != null) node.getCondition().accept(this); if (node.getThenActions() != null) { node.getThenActions().forEach(action -> action.accept(this)); @@ -700,31 +700,31 @@ public Void visitConditionalAction(ConditionalAction node) { } @Override - public Void visitCalculateAction(CalculateAction node) { + public Void visitCalculateAction(CalculateActionImpl node) { if (node.getExpression() != null) node.getExpression().accept(this); return null; } @Override - public Void visitRunAction(RunAction node) { + public Void visitRunAction(RunActionImpl node) { if (node.getExpression() != null) node.getExpression().accept(this); return null; } @Override - public Void visitSetAction(SetAction node) { + public Void visitSetAction(SetActionImpl node) { if (node.getValue() != null) node.getValue().accept(this); return null; } @Override - public Void visitArithmeticAction(ArithmeticAction node) { + public Void visitArithmeticAction(ArithmeticActionImpl node) { if (node.getValue() != null) node.getValue().accept(this); return null; } @Override - public Void visitListAction(ListAction node) { + public Void visitListAction(ListActionImpl node) { if (node.getValue() != null) { node.getValue().accept(this); } @@ -732,13 +732,13 @@ public Void visitListAction(ListAction node) { } @Override - public Void visitCircuitBreakerAction(CircuitBreakerAction node) { + public Void visitCircuitBreakerAction(CircuitBreakerActionImpl node) { // Circuit breaker actions don't contain variable references return null; } @Override - public Void visitForEachAction(ForEachAction node) { + public Void visitForEachAction(ForEachActionImpl node) { // Collect variable references from list expression if (node.getListExpression() != null) { node.getListExpression().accept(this); @@ -755,7 +755,7 @@ public Void visitForEachAction(ForEachAction node) { } @Override - public Void visitWhileAction(WhileAction node) { + public Void visitWhileAction(WhileActionImpl node) { // Collect variable references from condition if (node.getCondition() != null) { node.getCondition().accept(this); @@ -772,7 +772,7 @@ public Void visitWhileAction(WhileAction node) { } @Override - public Void visitDoWhileAction(DoWhileAction node) { + public Void visitDoWhileAction(DoWhileActionImpl node) { // Collect variable references from body actions if (node.getBodyActions() != null) { for (Action bodyAction : node.getBodyActions()) { diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/cache/CacheIntegrationTest.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/cache/CacheIntegrationTest.java index 5753c993d..3220eb9b2 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/cache/CacheIntegrationTest.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/cache/CacheIntegrationTest.java @@ -16,9 +16,9 @@ package org.fireflyframework.rules.core.cache; -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.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -38,7 +38,7 @@ @Slf4j class CacheIntegrationTest { - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; private static final String RULE_ENGINE_PREFIX = ":rule-engine:"; private static final String AST_PREFIX = RULE_ENGINE_PREFIX + "ast:"; @@ -52,8 +52,8 @@ void setUp() { .recordStats(true) .build(); - CaffeineCacheAdapter cacheAdapter = new CaffeineCacheAdapter("default", config); - cacheManager = new FireflyCacheManager(cacheAdapter, null); + CaffeineCacheAdapterImpl cacheAdapter = new CaffeineCacheAdapterImpl("default", config); + cacheManager = new FireflyCacheManagerImpl(cacheAdapter, null); // Clear cache before each test cacheManager.clear().block(); diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/ASTParserIntegrationTest.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/ASTParserIntegrationTest.java index 049b49c00..95d1e08d9 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/ASTParserIntegrationTest.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/ASTParserIntegrationTest.java @@ -21,9 +21,9 @@ import org.fireflyframework.rules.core.dsl.exception.ASTException; import org.fireflyframework.rules.core.dsl.expression.Expression; import org.fireflyframework.rules.core.dsl.parser.DSLParser; -import org.fireflyframework.rules.core.dsl.visitor.ActionExecutor; +import org.fireflyframework.rules.core.dsl.visitor.ActionExecutorImpl; import org.fireflyframework.rules.core.dsl.visitor.EvaluationContext; -import org.fireflyframework.rules.core.dsl.visitor.ExpressionEvaluator; +import org.fireflyframework.rules.core.dsl.visitor.ExpressionEvaluatorImpl; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; @@ -67,7 +67,7 @@ class ExpressionTests { @DisplayName("Should parse and evaluate simple arithmetic expressions") void testSimpleArithmetic() { Expression expr = dslParser.parseExpression("age + 5"); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); Object result = expr.accept(evaluator); assertThat(result.toString()).isEqualTo("30.0"); @@ -77,7 +77,7 @@ void testSimpleArithmetic() { @DisplayName("Should parse and evaluate complex arithmetic expressions") void testComplexArithmetic() { Expression expr = dslParser.parseExpression("(income * 0.1) + (age * 100)"); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); Object result = expr.accept(evaluator); assertThat(result.toString()).isEqualTo("7500.00"); @@ -87,7 +87,7 @@ void testComplexArithmetic() { @DisplayName("Should parse and evaluate string operations") void testStringOperations() { Expression expr = dslParser.parseExpression("name + \" is \" + status"); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); Object result = expr.accept(evaluator); assertThat(result).isEqualTo("John Doe is ACTIVE"); @@ -99,7 +99,7 @@ void testFunctionCalls() { // Note: Function calls will need to be implemented assertThatCode(() -> { Expression expr = dslParser.parseExpression("max(age, MIN_AGE)"); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); expr.accept(evaluator); }).doesNotThrowAnyException(); } @@ -115,7 +115,7 @@ void testVariablePropertyAccess() { assertThatCode(() -> { Expression expr = dslParser.parseExpression("person.firstName"); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); expr.accept(evaluator); }).doesNotThrowAnyException(); } @@ -129,7 +129,7 @@ class ConditionTests { @DisplayName("Should parse and evaluate simple comparison conditions") void testSimpleComparison() { Condition condition = dslParser.parseCondition("age >= MIN_AGE"); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); Object result = condition.accept(evaluator); assertThat(result).isEqualTo(true); @@ -139,7 +139,7 @@ void testSimpleComparison() { @DisplayName("Should parse and evaluate logical AND conditions") void testLogicalAnd() { Condition condition = dslParser.parseCondition("age >= MIN_AGE and income > 30000"); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); Object result = condition.accept(evaluator); assertThat(result).isEqualTo(true); @@ -149,7 +149,7 @@ void testLogicalAnd() { @DisplayName("Should parse and evaluate logical OR conditions") void testLogicalOr() { Condition condition = dslParser.parseCondition("age < MIN_AGE or income > 40000"); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); Object result = condition.accept(evaluator); assertThat(result).isEqualTo(true); @@ -159,7 +159,7 @@ void testLogicalOr() { @DisplayName("Should parse and evaluate logical NOT conditions") void testLogicalNot() { Condition condition = dslParser.parseCondition("not (age < MIN_AGE)"); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); Object result = condition.accept(evaluator); assertThat(result).isEqualTo(true); @@ -169,7 +169,7 @@ void testLogicalNot() { @DisplayName("Should parse and evaluate string comparison conditions") void testStringComparison() { Condition condition = dslParser.parseCondition("status equals \"ACTIVE\""); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); Object result = condition.accept(evaluator); assertThat(result).isEqualTo(true); @@ -179,7 +179,7 @@ void testStringComparison() { @DisplayName("Should parse and evaluate range conditions") void testRangeCondition() { Condition condition = dslParser.parseCondition("score >= 700 and score <= MAX_SCORE"); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); Object result = condition.accept(evaluator); assertThat(result).isEqualTo(true); @@ -191,7 +191,7 @@ void testComplexNestedConditions() { Condition condition = dslParser.parseCondition( "(age >= MIN_AGE and income > 30000) or (score > 700 and status equals \"ACTIVE\")" ); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); Object result = condition.accept(evaluator); assertThat(result).isEqualTo(true); @@ -206,7 +206,7 @@ class ActionTests { @DisplayName("Should parse and execute SET actions") void testSetAction() { Action action = dslParser.parseAction("set result to \"approved\""); - ActionExecutor executor = new ActionExecutor(context); + ActionExecutorImpl executor = new ActionExecutorImpl(context); action.accept(executor); @@ -217,7 +217,7 @@ void testSetAction() { @DisplayName("Should parse and execute CALCULATE actions") void testCalculateAction() { Action action = dslParser.parseAction("calculate totalScore as score + age"); - ActionExecutor executor = new ActionExecutor(context); + ActionExecutorImpl executor = new ActionExecutorImpl(context); action.accept(executor); @@ -230,7 +230,7 @@ void testConditionalAction() { Action action = dslParser.parseAction( "if score > 700 then set category to \"premium\" else set category to \"standard\"" ); - ActionExecutor executor = new ActionExecutor(context); + ActionExecutorImpl executor = new ActionExecutorImpl(context); action.accept(executor); @@ -245,7 +245,7 @@ void testCallActionWithBuiltin() { // now throws -- intentional behaviour to surface typos. assertThatCode(() -> { Action action = dslParser.parseAction("call log with [\"score check\", \"INFO\"]"); - ActionExecutor executor = new ActionExecutor(context); + ActionExecutorImpl executor = new ActionExecutorImpl(context); action.accept(executor); }).doesNotThrowAnyException(); } @@ -254,7 +254,7 @@ void testCallActionWithBuiltin() { @DisplayName("CALL action with unknown function name surfaces a typed error") void testCallActionUnknownFunctionThrows() { Action action = dslParser.parseAction("call validateCredit with [score, income]"); - ActionExecutor executor = new ActionExecutor(context); + ActionExecutorImpl executor = new ActionExecutorImpl(context); assertThatThrownBy(() -> action.accept(executor)) .isInstanceOf(IllegalArgumentException.class) .hasMessageContaining("validateCredit"); @@ -294,7 +294,7 @@ void testInvalidActionError() { void testUndefinedVariable() { assertThatCode(() -> { Expression expr = dslParser.parseExpression("undefinedVar + 5"); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); Object result = expr.accept(evaluator); // Should return a default value or handle gracefully }).doesNotThrowAnyException(); @@ -312,7 +312,7 @@ void testDeeplyNestedExpressions() { assertThatCode(() -> { Expression expr = dslParser.parseExpression(deepExpression); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); expr.accept(evaluator); }).doesNotThrowAnyException(); } @@ -328,7 +328,7 @@ void testManyConditions() { assertThatCode(() -> { Condition condition = dslParser.parseCondition(conditionBuilder.toString()); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); condition.accept(evaluator); }).doesNotThrowAnyException(); } @@ -341,7 +341,7 @@ void testParsingPerformance() { long startTime = System.nanoTime(); for (int i = 0; i < 1000; i++) { Expression expr = dslParser.parseExpression(expression); - ExpressionEvaluator evaluator = new ExpressionEvaluator(context); + ExpressionEvaluatorImpl evaluator = new ExpressionEvaluatorImpl(context); expr.accept(evaluator); } long endTime = System.nanoTime(); diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/AccountNumberGenerationTest.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/AccountNumberGenerationTest.java index a55383c65..afa19e849 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/AccountNumberGenerationTest.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/AccountNumberGenerationTest.java @@ -1,8 +1,8 @@ package org.fireflyframework.rules.core.dsl; -import org.fireflyframework.rules.core.dsl.expression.FunctionCallExpression; +import org.fireflyframework.rules.core.dsl.expression.FunctionCallExpressionImpl; import org.fireflyframework.rules.core.dsl.visitor.EvaluationContext; -import org.fireflyframework.rules.core.dsl.visitor.ExpressionEvaluator; +import org.fireflyframework.rules.core.dsl.visitor.ExpressionEvaluatorImpl; import org.junit.jupiter.api.Test; import java.security.SecureRandom; @@ -36,7 +36,7 @@ void realGeneratorRetainsTheTwelveDigitStringContract() { } private static Object accountNumber() { - var evaluator = new ExpressionEvaluator(new EvaluationContext()); - return new FunctionCallExpression(null, "generate_account_number", List.of()).accept(evaluator); + var evaluator = new ExpressionEvaluatorImpl(new EvaluationContext()); + return new FunctionCallExpressionImpl(null, "generate_account_number", List.of()).accept(evaluator); } } diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/ForEachSimpleTest.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/ForEachSimpleTest.java index 0c3556399..9054129a6 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/ForEachSimpleTest.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/ForEachSimpleTest.java @@ -1,7 +1,7 @@ package org.fireflyframework.rules.core.dsl; import org.fireflyframework.rules.core.dsl.action.Action; -import org.fireflyframework.rules.core.dsl.action.ForEachAction; +import org.fireflyframework.rules.core.dsl.action.ForEachActionImpl; import org.fireflyframework.rules.core.dsl.evaluation.ASTRulesEvaluationEngine; import org.fireflyframework.rules.core.dsl.evaluation.ASTRulesEvaluationResult; import org.fireflyframework.rules.core.dsl.parser.ASTRulesDSLParser; diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/LogicalOperatorDebugTest.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/LogicalOperatorDebugTest.java index 47786592e..82496e821 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/LogicalOperatorDebugTest.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/LogicalOperatorDebugTest.java @@ -8,7 +8,7 @@ import org.fireflyframework.rules.core.dsl.parser.ASTRulesDSLParser; import org.fireflyframework.rules.core.dsl.parser.DSLParser; import org.fireflyframework.rules.core.dsl.visitor.EvaluationContext; -import org.fireflyframework.rules.core.dsl.visitor.ExpressionEvaluator; +import org.fireflyframework.rules.core.dsl.visitor.ExpressionEvaluatorImpl; import org.fireflyframework.rules.core.services.ConstantService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; @@ -106,8 +106,8 @@ void testDebugConditionParsing() { testContext.setVariable("a", 0); testContext.setVariable("b", 2); - ExpressionEvaluator evaluator = - new ExpressionEvaluator(testContext); + ExpressionEvaluatorImpl evaluator = + new ExpressionEvaluatorImpl(testContext); Object result = condition.accept(evaluator); System.out.println("Condition evaluation result: " + result); diff --git a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/parser/ASTCacheIntegrationTest.java b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/parser/ASTCacheIntegrationTest.java index 4622c078b..160f7c81a 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/parser/ASTCacheIntegrationTest.java +++ b/modules/rule-engine/fireflyframework-rule-engine-core/src/test/java/org/fireflyframework/rules/core/dsl/parser/ASTCacheIntegrationTest.java @@ -16,9 +16,9 @@ package org.fireflyframework.rules.core.dsl.parser; -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.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.fireflyframework.rules.core.dsl.model.ASTRulesDSL; import org.fireflyframework.rules.core.services.impl.CacheServiceImpl; import lombok.extern.slf4j.Slf4j; @@ -39,7 +39,7 @@ class ASTCacheIntegrationTest { private ASTRulesDSLParser parser; private CacheServiceImpl cacheService; - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @BeforeEach void setUp() throws Exception { @@ -51,8 +51,8 @@ void setUp() throws Exception { .recordStats(true) .build(); - CaffeineCacheAdapter cacheAdapter = new CaffeineCacheAdapter("default", config); - cacheManager = new FireflyCacheManager(cacheAdapter, null); + CaffeineCacheAdapterImpl cacheAdapter = new CaffeineCacheAdapterImpl("default", config); + cacheManager = new FireflyCacheManagerImpl(cacheAdapter, null); // Create cache service with mock constant service cacheService = new CacheServiceImpl(cacheManager, Mockito.mock(org.fireflyframework.rules.core.services.ConstantService.class)); diff --git a/modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNames.java b/modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNames.java index 7d31b1aae..369600b39 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNames.java +++ b/modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNames.java @@ -33,7 +33,7 @@ * Invalid examples: CREDIT_SCORE, credit_score, CreditScore */ @Documented -@Constraint(validatedBy = ValidInputVariableNamesValidator.class) +@Constraint(validatedBy = ValidInputVariableNamesValidatorImpl.class) @Target({ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidInputVariableNames { diff --git a/modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNamesValidator.java b/modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNamesValidatorImpl.java similarity index 96% rename from modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNamesValidator.java rename to modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNamesValidatorImpl.java index f62380d5f..1a7dfc570 100644 --- a/modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNamesValidator.java +++ b/modules/rule-engine/fireflyframework-rule-engine-interfaces/src/main/java/org/fireflyframework/rules/interfaces/validation/ValidInputVariableNamesValidatorImpl.java @@ -30,7 +30,7 @@ * - Can contain letters and numbers * - No underscores or special characters */ -public class ValidInputVariableNamesValidator implements ConstraintValidator> { +public class ValidInputVariableNamesValidatorImpl implements ConstraintValidator> { private static final Pattern CAMEL_CASE_PATTERN = Pattern.compile("^[a-z][a-zA-Z0-9]*$"); diff --git a/modules/security-adapter-cerbos/README.md b/modules/security-adapter-cerbos/README.md index a56b7899d..69947f125 100644 --- a/modules/security-adapter-cerbos/README.md +++ b/modules/security-adapter-cerbos/README.md @@ -4,7 +4,7 @@ Delegate PolicyDecisionPort decisions to the Cerbos CheckResources API. -Construct CerbosPolicyDecisionAdapter with a WebClient pointing to Cerbos. Resources are interpreted as kind:id; principal authorities become roles and context becomes resource attributes. Only EFFECT_ALLOW permits; transport failure returns an indeterminate decision. +Construct CerbosPolicyDecisionAdapterImpl with a WebClient pointing to Cerbos. Resources are interpreted as kind:id; principal authorities become roles and context becomes resource attributes. Only EFFECT_ALLOW permits; transport failure returns an indeterminate decision. [Module guide](../../docs/site/modules/security-adapter-cerbos.md) · [Jafly README](../../README.md) · [Module catalog](../../docs/site/modules/index.md) @@ -36,11 +36,11 @@ PolicyDecisionPort policyDecisionPort() { WebClient client = WebClient.builder() .baseUrl(System.getenv("CERBOS_URL")) .build(); - return new CerbosPolicyDecisionAdapter(client); + return new CerbosPolicyDecisionAdapterImpl(client); } ``` -With a framework `SecurityPrincipal`, call `policyDecisionPort.authorize(principal, "read", "document:budget", Map.of())`. The resource becomes kind `document`, id `budget`; authorities become Cerbos roles, and the context map becomes resource attributes. The adapter calls `/api/check/resources`; only `EFFECT_ALLOW` yields `Decision.permit()`. Other effects deny, and transport errors yield `Decision.indeterminate(...)`. Imports: `org.fireflyframework.security.spi.PolicyDecisionPort`, `org.fireflyframework.security.adapter.cerbos.CerbosPolicyDecisionAdapter`, Spring `Bean`, and WebFlux `WebClient`. +With a framework `SecurityPrincipal`, call `policyDecisionPort.authorize(principal, "read", "document:budget", Map.of())`. The resource becomes kind `document`, id `budget`; authorities become Cerbos roles, and the context map becomes resource attributes. The adapter calls `/api/check/resources`; only `EFFECT_ALLOW` yields `Decision.permit()`. Other effects deny, and transport errors yield `Decision.indeterminate(...)`. Imports: `org.fireflyframework.security.spi.PolicyDecisionPort`, `org.fireflyframework.security.adapter.cerbos.CerbosPolicyDecisionAdapterImpl`, Spring `Bean`, and WebFlux `WebClient`. ## Configuration @@ -50,7 +50,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`CerbosPolicyDecisionAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapter.java) | Maps principals, actions, resources, and context to Cerbos CheckResources decisions; non-allow effects deny. | +| [`CerbosPolicyDecisionAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapterImpl.java) | Maps principals, actions, resources, and context to Cerbos CheckResources decisions; non-allow effects deny. | ## Continue the application diff --git a/modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapter.java b/modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapterImpl.java similarity index 95% rename from modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapter.java rename to modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapterImpl.java index 83573456a..cc4da3ce4 100644 --- a/modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapter.java +++ b/modules/security-adapter-cerbos/src/main/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapterImpl.java @@ -34,14 +34,14 @@ * effect. The {@code resource} argument is parsed as {@code "kind:id"}. Fail-closed: * a transport error is indeterminate (denied), and anything other than {@code EFFECT_ALLOW} denies. */ -public class CerbosPolicyDecisionAdapter implements PolicyDecisionPort { +public class CerbosPolicyDecisionAdapterImpl implements PolicyDecisionPort { - private static final Logger log = LoggerFactory.getLogger(CerbosPolicyDecisionAdapter.class); + private static final Logger log = LoggerFactory.getLogger(CerbosPolicyDecisionAdapterImpl.class); private static final String POLICY_VERSION = "default"; private final WebClient webClient; - public CerbosPolicyDecisionAdapter(WebClient webClient) { + public CerbosPolicyDecisionAdapterImpl(WebClient webClient) { this.webClient = webClient; } diff --git a/modules/security-adapter-cerbos/src/test/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapterIntegrationTest.java b/modules/security-adapter-cerbos/src/test/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapterIntegrationTest.java index bb4fcecf5..22f030008 100644 --- a/modules/security-adapter-cerbos/src/test/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapterIntegrationTest.java +++ b/modules/security-adapter-cerbos/src/test/java/org/fireflyframework/security/adapter/cerbos/CerbosPolicyDecisionAdapterIntegrationTest.java @@ -45,9 +45,9 @@ class CerbosPolicyDecisionAdapterIntegrationTest { .withCommand("server", "--config=/conf/.cerbos.yaml") .waitingFor(Wait.forHttp("/_cerbos/health").forPort(3592).forStatusCode(200)); - private CerbosPolicyDecisionAdapter adapter() { + private CerbosPolicyDecisionAdapterImpl adapter() { String baseUrl = "http://" + CERBOS.getHost() + ":" + CERBOS.getMappedPort(3592); - return new CerbosPolicyDecisionAdapter(WebClient.create(baseUrl)); + return new CerbosPolicyDecisionAdapterImpl(WebClient.create(baseUrl)); } private SecurityPrincipal principal(Set roles) { diff --git a/modules/security-adapter-opa/README.md b/modules/security-adapter-opa/README.md index 39b1c7ce4..8e708d43f 100644 --- a/modules/security-adapter-opa/README.md +++ b/modules/security-adapter-opa/README.md @@ -28,10 +28,10 @@ Delegate an onboarding authorization decision to a configured OPA policy through The Java examples in this section are API fragments for application code. Use the stated imports and supply the application-owned collaborators described alongside them. -Contribute an `OpaPolicyDecisionAdapter` as your `PolicyDecisionPort`. Because `security-webflux` selects whatever `PolicyDecisionPort` bean is present, this single bean replaces the in-process `EmbeddedPolicyDecisionAdapter` for every non-permitted exchange. No other wiring required: +Contribute an `OpaPolicyDecisionAdapterImpl` as your `PolicyDecisionPort`. Because `security-webflux` selects whatever `PolicyDecisionPort` bean is present, this single bean replaces the in-process `EmbeddedPolicyDecisionAdapterImpl` for every non-permitted exchange. No other wiring required: ```java -import org.fireflyframework.security.adapter.opa.OpaPolicyDecisionAdapter; +import org.fireflyframework.security.adapter.opa.OpaPolicyDecisionAdapterImpl; import org.fireflyframework.security.spi.PolicyDecisionPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -43,7 +43,7 @@ class OpaPolicyConfiguration { @Bean PolicyDecisionPort policyDecisionPort() { WebClient opa = WebClient.create("http://opa:8181"); - return new OpaPolicyDecisionAdapter(opa, "firefly/allow"); + return new OpaPolicyDecisionAdapterImpl(opa, "firefly/allow"); } } ``` @@ -63,7 +63,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`OpaPolicyDecisionAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapter.java) | `PolicyDecisionPort` backed by Open Policy Agent. | +| [`OpaPolicyDecisionAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterImpl.java) | `PolicyDecisionPort` backed by Open Policy Agent. | ## Continue the application diff --git a/modules/security-adapter-opa/VERSIONED_EVALUATION.md b/modules/security-adapter-opa/VERSIONED_EVALUATION.md index 8955a869a..c6241a40c 100644 --- a/modules/security-adapter-opa/VERSIONED_EVALUATION.md +++ b/modules/security-adapter-opa/VERSIONED_EVALUATION.md @@ -1,6 +1,6 @@ # Optional versioned policy evaluation -`PolicyDecisionPort`, `Decision`, and the existing boolean OPA adapter retain their existing contracts. The separate `PolicyEvaluationPort` and explicitly constructed `OpaPolicyEvaluationAdapter` support consumers that require a decision and server-reported provenance from one response. Nothing activates this capability automatically. +`PolicyDecisionPort`, `Decision`, and the existing boolean OPA adapter retain their existing contracts. The separate `PolicyEvaluationPort` and explicitly constructed `OpaPolicyEvaluationAdapterImpl` support consumers that require a decision and server-reported provenance from one response. Nothing activates this capability automatically. The configured OPA data document must return an object containing exactly a literal boolean `allow` and a `policy_revision` string, while OPA decision logging must supply the response-level `decision_id`. Additional result fields, including obligations and constraints, are unsupported and make the evaluation indeterminate with empty provenance. They are never silently dropped or treated as fulfilled. Legitimate response-level OPA metadata, such as metrics, explanations and provenance, remains accepted and does not replace the required result revision. For example, the response shape is: diff --git a/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapter.java b/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterImpl.java similarity index 94% rename from modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapter.java rename to modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterImpl.java index 37b85eb3e..6dcd1097e 100644 --- a/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapter.java +++ b/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterImpl.java @@ -34,9 +34,9 @@ * result to a {@link Decision}. Fail-closed: a transport error, a missing result, * or {@code false} all deny. */ -public class OpaPolicyDecisionAdapter implements PolicyDecisionPort { +public class OpaPolicyDecisionAdapterImpl implements PolicyDecisionPort { - private static final Logger log = LoggerFactory.getLogger(OpaPolicyDecisionAdapter.class); + private static final Logger log = LoggerFactory.getLogger(OpaPolicyDecisionAdapterImpl.class); private final WebClient webClient; private final String decisionPath; @@ -45,7 +45,7 @@ public class OpaPolicyDecisionAdapter implements PolicyDecisionPort { * @param webClient a WebClient whose base URL points at the OPA server * @param decisionPath the OPA data path of the boolean allow rule, e.g. {@code "firefly/allow"} */ - public OpaPolicyDecisionAdapter(WebClient webClient, String decisionPath) { + public OpaPolicyDecisionAdapterImpl(WebClient webClient, String decisionPath) { this.webClient = webClient; this.decisionPath = decisionPath.startsWith("/") ? decisionPath.substring(1) : decisionPath; } diff --git a/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapter.java b/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapterImpl.java similarity index 96% rename from modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapter.java rename to modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapterImpl.java index f1f8ca68a..1009c3f37 100644 --- a/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapter.java +++ b/modules/security-adapter-opa/src/main/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapterImpl.java @@ -31,7 +31,7 @@ * in one response. The rule must report the actual policy revision, and OPA decision * logging must provide the decision identifier. No client-generated replacement is used. */ -public final class OpaPolicyEvaluationAdapter implements PolicyEvaluationPort { +public final class OpaPolicyEvaluationAdapterImpl implements PolicyEvaluationPort { private static final int MAXIMUM_RESPONSE_BYTES = 16 * 1024; private static final ObjectMapper MAPPER = new ObjectMapper(JsonFactory.builder() .enable(StreamReadFeature.STRICT_DUPLICATE_DETECTION).build()) @@ -40,7 +40,7 @@ public final class OpaPolicyEvaluationAdapter implements PolicyEvaluationPort { private final WebClient webClient; private final String decisionPath; - public OpaPolicyEvaluationAdapter(WebClient webClient, String decisionPath) { + public OpaPolicyEvaluationAdapterImpl(WebClient webClient, String decisionPath) { this.webClient = Objects.requireNonNull(webClient, "webClient"); this.decisionPath = Objects.requireNonNull(decisionPath, "decisionPath").startsWith("/") ? decisionPath.substring(1) : decisionPath; @@ -70,7 +70,7 @@ public Mono evaluate(SecurityPrincipal principal, String actio } }); })) - .switchIfEmpty(Mono.fromSupplier(OpaPolicyEvaluationAdapter::unavailable)) + .switchIfEmpty(Mono.fromSupplier(OpaPolicyEvaluationAdapterImpl::unavailable)) .onErrorResume(error -> Mono.just(unavailable())); } diff --git a/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterIntegrationTest.java b/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterIntegrationTest.java index 6aa05c568..063aa16d7 100644 --- a/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterIntegrationTest.java +++ b/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterIntegrationTest.java @@ -78,7 +78,7 @@ private SecurityPrincipal principal(Set authorities) { @Test void permitsAllowedActionForAnySubject() { - OpaPolicyDecisionAdapter adapter = new OpaPolicyDecisionAdapter(webClient, "firefly/allow"); + OpaPolicyDecisionAdapterImpl adapter = new OpaPolicyDecisionAdapterImpl(webClient, "firefly/allow"); StepVerifier.create(adapter.authorize(principal(Set.of("teller")), "read", "doc:1", Map.of())) .expectNextMatches(d -> d.granted()) .verifyComplete(); @@ -86,7 +86,7 @@ void permitsAllowedActionForAnySubject() { @Test void permitsAdminForAnyAction() { - OpaPolicyDecisionAdapter adapter = new OpaPolicyDecisionAdapter(webClient, "firefly/allow"); + OpaPolicyDecisionAdapterImpl adapter = new OpaPolicyDecisionAdapterImpl(webClient, "firefly/allow"); StepVerifier.create(adapter.authorize(principal(Set.of("admin")), "write", "doc:1", Map.of())) .expectNextMatches(d -> d.granted()) .verifyComplete(); @@ -94,7 +94,7 @@ void permitsAdminForAnyAction() { @Test void deniesDisallowedActionForNonAdmin() { - OpaPolicyDecisionAdapter adapter = new OpaPolicyDecisionAdapter(webClient, "firefly/allow"); + OpaPolicyDecisionAdapterImpl adapter = new OpaPolicyDecisionAdapterImpl(webClient, "firefly/allow"); StepVerifier.create(adapter.authorize(principal(Set.of("teller")), "write", "doc:1", Map.of())) .expectNextMatches(d -> !d.granted()) .verifyComplete(); @@ -102,7 +102,7 @@ void deniesDisallowedActionForNonAdmin() { @Test void failsClosedForUndefinedDecisionPath() { - OpaPolicyDecisionAdapter adapter = new OpaPolicyDecisionAdapter(webClient, "firefly/does_not_exist"); + OpaPolicyDecisionAdapterImpl adapter = new OpaPolicyDecisionAdapterImpl(webClient, "firefly/does_not_exist"); StepVerifier.create(adapter.authorize(principal(Set.of("admin")), "read", "doc:1", Map.of())) .expectNextMatches(d -> !d.granted()) .verifyComplete(); diff --git a/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterIssuerTest.java b/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterIssuerTest.java index 51daa7f61..2d2ba1dd9 100644 --- a/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterIssuerTest.java +++ b/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterIssuerTest.java @@ -46,7 +46,7 @@ private JsonNode authorize(String issuer, Map context) { .header("Content-Type", "application/json").body("{\"result\":true}").build(); })); }).build(); - var decision = new OpaPolicyDecisionAdapter(web, "firefly/allow") + var decision = new OpaPolicyDecisionAdapterImpl(web, "firefly/allow") .authorize(principal, "read", "resource", context).block(Duration.ofSeconds(3)); assertNotNull(decision); assertTrue(decision.granted()); diff --git a/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterProtocolTest.java b/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterProtocolTest.java index 4d7b68bc8..2baf90b3e 100644 --- a/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterProtocolTest.java +++ b/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyDecisionAdapterProtocolTest.java @@ -25,8 +25,8 @@ class OpaPolicyDecisionAdapterProtocolTest { private static final Duration WAIT = Duration.ofSeconds(3); private final SecurityPrincipal principal = SecurityPrincipal.builder().subject("protocol-subject").build(); - private OpaPolicyDecisionAdapter adapter(String body) { - return new OpaPolicyDecisionAdapter(WebClient.builder().baseUrl("https://policy.example.test") + private OpaPolicyDecisionAdapterImpl adapter(String body) { + return new OpaPolicyDecisionAdapterImpl(WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> Mono.just(ClientResponse.create(HttpStatus.OK) .header("Content-Type", "application/json").body(body).build())).build(), "firefly/allow"); } @@ -51,7 +51,7 @@ void nonBooleanTrueAndMalformedResponsesDeny(String response) { void unavailableTransportDenies() { var client = WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> Mono.error(new IOException("Owned protocol transport unavailable"))).build(); - var decision = new OpaPolicyDecisionAdapter(client, "firefly/allow") + var decision = new OpaPolicyDecisionAdapterImpl(client, "firefly/allow") .authorize(principal, "read", "resource", Map.of()).block(WAIT); assertNotNull(decision); assertFalse(decision.granted()); diff --git a/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapterTest.java b/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapterTest.java index d0aa4872d..2a44b71e2 100644 --- a/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapterTest.java +++ b/modules/security-adapter-opa/src/test/java/org/fireflyframework/security/adapter/opa/OpaPolicyEvaluationAdapterTest.java @@ -43,8 +43,8 @@ class OpaPolicyEvaluationAdapterTest { .authorities(Set.of("READER")).scopes(Set.of("read")) .claims(Map.of("private-claim", "excluded")).attributes(Map.of("private-attribute", "excluded")).build(); - private OpaPolicyEvaluationAdapter adapter(String body) { - return new OpaPolicyEvaluationAdapter(WebClient.builder().baseUrl("https://policy.example.test") + private OpaPolicyEvaluationAdapterImpl adapter(String body) { + return new OpaPolicyEvaluationAdapterImpl(WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> Mono.just(ClientResponse.create(HttpStatus.OK) .header("Content-Type", "application/json").body(body).build())).build(), "/firefly/versioned"); } @@ -150,7 +150,7 @@ void chunkedResponseCannotExceedBound() { factory.wrap(new byte[16384]))).build(); var client = WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> Mono.just(response)).build(); - assertRefused(new OpaPolicyEvaluationAdapter(client, "firefly/versioned") + assertRefused(new OpaPolicyEvaluationAdapterImpl(client, "firefly/versioned") .evaluate(principal, "read", "resource", Map.of()).block(WAIT)); } @@ -163,12 +163,12 @@ void emptyResponseIsIndeterminate() { void transportAndHttpFailuresNeverExposeRawDetailsOrMetadata() { var bad = WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> Mono.error(new IOException("private token/body/URL"))).build(); - assertRefused(new OpaPolicyEvaluationAdapter(bad, "firefly/versioned") + assertRefused(new OpaPolicyEvaluationAdapterImpl(bad, "firefly/versioned") .evaluate(principal, "read", "resource", Map.of()).block(WAIT)); var failed = WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> Mono.just(ClientResponse.create(HttpStatus.SERVICE_UNAVAILABLE) .header("Content-Type", "application/json").body(PERMIT).build())).build(); - assertRefused(new OpaPolicyEvaluationAdapter(failed, "firefly/versioned") + assertRefused(new OpaPolicyEvaluationAdapterImpl(failed, "firefly/versioned") .evaluate(principal, "read", "resource", Map.of()).block(WAIT)); } @@ -186,7 +186,7 @@ void requestUsesAuthenticatedIssuerAndOpaqueTenantWithoutClaimsOrAttributes() { return ClientResponse.create(HttpStatus.OK).header("Content-Type", "application/json").body(PERMIT).build(); })); }).build(); - var result = new OpaPolicyEvaluationAdapter(web, "firefly/versioned") + var result = new OpaPolicyEvaluationAdapterImpl(web, "firefly/versioned") .evaluate(principal, "read", "resource", Map.of("issuer", "context-cannot-replace-principal")).block(WAIT); assertNotNull(result); assertTrue(result.decision().granted()); @@ -204,7 +204,7 @@ void concurrentResponsesKeepTheirOwnProvenance() { var count = new AtomicInteger(); var client = WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> count.getAndIncrement() == 0 ? first.asMono() : second.asMono()).build(); - var adapter = new OpaPolicyEvaluationAdapter(client, "firefly/versioned"); + var adapter = new OpaPolicyEvaluationAdapterImpl(client, "firefly/versioned"); var one = new AtomicReference(); var two = new AtomicReference(); adapter.evaluate(principal, "one", "resource", Map.of()).subscribe(one::set); @@ -225,7 +225,7 @@ void partialBodyErrorReleasesPooledBufferAndRefusesMetadata() { Mono.error(new IOException("private partial response")))).build(); var client = WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> Mono.just(response)).build(); - assertRefused(new OpaPolicyEvaluationAdapter(client, "firefly/versioned") + assertRefused(new OpaPolicyEvaluationAdapterImpl(client, "firefly/versioned") .evaluate(principal, "read", "resource", Map.of()).block(WAIT)); assertEquals(0, buffer.getNativeBuffer().refCnt()); } @@ -242,7 +242,7 @@ void cancellationDuringPartialBodyReleasesPooledBufferAndEmitsNothing() { Mono.just(buffer).doOnNext(value -> seen.incrementAndGet()), Mono.never())).build(); var client = WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> Mono.just(response)).build(); - StepVerifier.create(new OpaPolicyEvaluationAdapter(client, "firefly/versioned") + StepVerifier.create(new OpaPolicyEvaluationAdapterImpl(client, "firefly/versioned") .evaluate(principal, "read", "resource", Map.of()).doOnNext(value -> emitted.incrementAndGet())) .then(() -> assertEquals(1, seen.get())).thenCancel().verify(WAIT); assertEquals(0, emitted.get()); @@ -255,7 +255,7 @@ void cancellationDoesNotEmitAnEvaluationOrProvenance() { var emitted = new AtomicInteger(); var client = WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> Mono.never().doOnCancel(cancelled::incrementAndGet)).build(); - StepVerifier.create(new OpaPolicyEvaluationAdapter(client, "firefly/versioned") + StepVerifier.create(new OpaPolicyEvaluationAdapterImpl(client, "firefly/versioned") .evaluate(principal, "read", "resource", Map.of()).doOnNext(value -> emitted.incrementAndGet())) .thenCancel().verify(WAIT); assertEquals(0, emitted.get()); diff --git a/modules/security-adapter-openfga/README.md b/modules/security-adapter-openfga/README.md index 72efe977e..e19bbd291 100644 --- a/modules/security-adapter-openfga/README.md +++ b/modules/security-adapter-openfga/README.md @@ -4,7 +4,7 @@ Check relationship authorization through an OpenFGA store. -Construct OpenFgaRelationshipAdapter with a WebClient and store ID, then call check(subject, relation, object). The adapter posts tuple_key to the store check route and returns false for transport errors. Provision the authorization model and tuples in OpenFGA separately. +Construct OpenFgaRelationshipAdapterImpl with a WebClient and store ID, then call check(subject, relation, object). The adapter posts tuple_key to the store check route and returns false for transport errors. Provision the authorization model and tuples in OpenFGA separately. [Module guide](../../docs/site/modules/security-adapter-openfga.md) · [Jafly README](../../README.md) · [Module catalog](../../docs/site/modules/index.md) @@ -36,12 +36,12 @@ RelationshipPort relationshipPort() { WebClient client = WebClient.builder() .baseUrl(System.getenv("OPENFGA_URL")) .build(); - return new OpenFgaRelationshipAdapter( + return new OpenFgaRelationshipAdapterImpl( client, System.getenv("OPENFGA_STORE_ID")); } ``` -Call `relationshipPort.check("user:alice", "viewer", "document:budget")` to obtain `Mono`. The adapter sends these values as `tuple_key.user`, `tuple_key.relation`, and `tuple_key.object` to `/stores/{storeId}/check`. It returns `false` on transport errors. Add any deployment authentication headers to the host-owned `WebClient`. Imports: `org.fireflyframework.security.spi.RelationshipPort`, `org.fireflyframework.security.adapter.openfga.OpenFgaRelationshipAdapter`, Spring `Bean`, and WebFlux `WebClient`. +Call `relationshipPort.check("user:alice", "viewer", "document:budget")` to obtain `Mono`. The adapter sends these values as `tuple_key.user`, `tuple_key.relation`, and `tuple_key.object` to `/stores/{storeId}/check`. It returns `false` on transport errors. Add any deployment authentication headers to the host-owned `WebClient`. Imports: `org.fireflyframework.security.spi.RelationshipPort`, `org.fireflyframework.security.adapter.openfga.OpenFgaRelationshipAdapterImpl`, Spring `Bean`, and WebFlux `WebClient`. ## Configuration @@ -51,7 +51,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`OpenFgaRelationshipAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapter.java) | Maps subject/relation/object checks to an OpenFGA store; transport failures return false. | +| [`OpenFgaRelationshipAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterImpl.java) | Maps subject/relation/object checks to an OpenFGA store; transport failures return false. | ## Continue the application diff --git a/modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapter.java b/modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterImpl.java similarity index 92% rename from modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapter.java rename to modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterImpl.java index 7c4ff53ef..004af5575 100644 --- a/modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapter.java +++ b/modules/security-adapter-openfga/src/main/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterImpl.java @@ -30,9 +30,9 @@ * {@code check} against an OpenFGA store and maps the {@code allowed} flag to a boolean. * Fail-closed: any transport error denies. */ -public class OpenFgaRelationshipAdapter implements RelationshipPort { +public class OpenFgaRelationshipAdapterImpl implements RelationshipPort { - private static final Logger log = LoggerFactory.getLogger(OpenFgaRelationshipAdapter.class); + private static final Logger log = LoggerFactory.getLogger(OpenFgaRelationshipAdapterImpl.class); private final WebClient webClient; private final String storeId; @@ -41,7 +41,7 @@ public class OpenFgaRelationshipAdapter implements RelationshipPort { * @param webClient a WebClient whose base URL points at the OpenFGA HTTP API * @param storeId the OpenFGA store id to query */ - public OpenFgaRelationshipAdapter(WebClient webClient, String storeId) { + public OpenFgaRelationshipAdapterImpl(WebClient webClient, String storeId) { this.webClient = webClient; this.storeId = storeId; } diff --git a/modules/security-adapter-openfga/src/test/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterIntegrationTest.java b/modules/security-adapter-openfga/src/test/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterIntegrationTest.java index 3ebd67d19..251213df2 100644 --- a/modules/security-adapter-openfga/src/test/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterIntegrationTest.java +++ b/modules/security-adapter-openfga/src/test/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterIntegrationTest.java @@ -76,14 +76,14 @@ static void provisionStore() { @Test void allowsRelatedSubject() { - OpenFgaRelationshipAdapter adapter = new OpenFgaRelationshipAdapter(webClient, storeId); + OpenFgaRelationshipAdapterImpl adapter = new OpenFgaRelationshipAdapterImpl(webClient, storeId); StepVerifier.create(adapter.check("user:alice", "viewer", "document:budget")) .expectNext(true).verifyComplete(); } @Test void deniesUnrelatedSubject() { - OpenFgaRelationshipAdapter adapter = new OpenFgaRelationshipAdapter(webClient, storeId); + OpenFgaRelationshipAdapterImpl adapter = new OpenFgaRelationshipAdapterImpl(webClient, storeId); StepVerifier.create(adapter.check("user:bob", "viewer", "document:budget")) .expectNext(false).verifyComplete(); } diff --git a/modules/security-adapter-openfga/src/test/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterProtocolTest.java b/modules/security-adapter-openfga/src/test/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterProtocolTest.java index 65c977a21..0ce795009 100644 --- a/modules/security-adapter-openfga/src/test/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterProtocolTest.java +++ b/modules/security-adapter-openfga/src/test/java/org/fireflyframework/security/adapter/openfga/OpenFgaRelationshipAdapterProtocolTest.java @@ -20,8 +20,8 @@ class OpenFgaRelationshipAdapterProtocolTest { private static final Duration WAIT = Duration.ofSeconds(3); - private OpenFgaRelationshipAdapter adapter(String body) { - return new OpenFgaRelationshipAdapter(WebClient.builder().baseUrl("https://policy.example.test") + private OpenFgaRelationshipAdapterImpl adapter(String body) { + return new OpenFgaRelationshipAdapterImpl(WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> Mono.just(ClientResponse.create(HttpStatus.OK) .header("Content-Type", "application/json").body(body).build())).build(), "protocol-store"); } @@ -46,7 +46,7 @@ void nonBooleanTrueAndMalformedResponsesDeny(String response) { void unavailableTransportDenies() { var client = WebClient.builder().baseUrl("https://policy.example.test") .exchangeFunction(request -> Mono.error(new IOException("Owned protocol transport unavailable"))).build(); - var allowed = new OpenFgaRelationshipAdapter(client, "protocol-store") + var allowed = new OpenFgaRelationshipAdapterImpl(client, "protocol-store") .check("subject", "member", "resource").block(WAIT); assertNotNull(allowed); assertFalse(allowed); diff --git a/modules/security-adapter-r2dbc/README.md b/modules/security-adapter-r2dbc/README.md index dfb7ad9b5..b3ad0087c 100644 --- a/modules/security-adapter-r2dbc/README.md +++ b/modules/security-adapter-r2dbc/README.md @@ -4,7 +4,7 @@ Persist token revocation records through a relational R2DBC adapter. -Provide DatabaseClient, apply the documented schema, and wire R2dbcRevocationAdapter into the security engine. Verify expiry and revocation queries against the same database dialect and clock behavior used in production. +Provide DatabaseClient, apply the documented schema, and wire R2dbcRevocationAdapterImpl into the security engine. Verify expiry and revocation queries against the same database dialect and clock behavior used in production. [Module guide](../../docs/site/modules/security-adapter-r2dbc.md) · [Jafly README](../../README.md) · [Module catalog](../../docs/site/modules/index.md) @@ -28,12 +28,12 @@ Store revoked token IDs when the application uses PostgreSQL for that security s The Java examples in this section are API fragments for application code. Use the stated imports and supply the application-owned collaborators described alongside them. -`R2dbcRevocationAdapter` implements `RevocationPort` only. It does not implement `TokenIntrospectionCachePort`, and the default resource-server JWT decoder does not consult it automatically. Connect the port explicitly to the application's token-validation policy before relying on revocation. +`R2dbcRevocationAdapterImpl` implements `RevocationPort` only. It does not implement `TokenIntrospectionCachePort`, and the default resource-server JWT decoder does not consult it automatically. Connect the port explicitly to the application's token-validation policy before relying on revocation. Provide the adapter as the application's `RevocationPort` bean, wired from a Spring R2DBC `DatabaseClient`: ```java -import org.fireflyframework.security.adapter.r2dbc.R2dbcRevocationAdapter; +import org.fireflyframework.security.adapter.r2dbc.R2dbcRevocationAdapterImpl; import org.fireflyframework.security.spi.RevocationPort; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -44,7 +44,7 @@ class SecurityRevocationConfig { @Bean RevocationPort revocationPort(DatabaseClient databaseClient) { - return new R2dbcRevocationAdapter(databaseClient); + return new R2dbcRevocationAdapterImpl(databaseClient); } } ``` @@ -70,7 +70,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`R2dbcRevocationAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapter.java) | Relational-database `RevocationPort` backed by R2DBC. | +| [`R2dbcRevocationAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapterImpl.java) | Relational-database `RevocationPort` backed by R2DBC. | ## Continue the application diff --git a/modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapter.java b/modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapterImpl.java similarity index 95% rename from modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapter.java rename to modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapterImpl.java index 03f0ad0c6..4257cf28c 100644 --- a/modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapter.java +++ b/modules/security-adapter-r2dbc/src/main/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapterImpl.java @@ -35,7 +35,7 @@ * CREATE TABLE security_revoked_token (token_id VARCHAR(512) PRIMARY KEY, expires_at TIMESTAMPTZ); * } */ -public class R2dbcRevocationAdapter implements RevocationPort { +public class R2dbcRevocationAdapterImpl implements RevocationPort { private static final String UPSERT = """ INSERT INTO security_revoked_token (token_id, expires_at) VALUES (:id, :exp) @@ -49,7 +49,7 @@ ON CONFLICT (token_id) DO UPDATE SET expires_at = EXCLUDED.expires_at private final DatabaseClient databaseClient; - public R2dbcRevocationAdapter(DatabaseClient databaseClient) { + public R2dbcRevocationAdapterImpl(DatabaseClient databaseClient) { this.databaseClient = databaseClient; } diff --git a/modules/security-adapter-r2dbc/src/test/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapterIntegrationTest.java b/modules/security-adapter-r2dbc/src/test/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapterIntegrationTest.java index 1dae82518..b093311d5 100644 --- a/modules/security-adapter-r2dbc/src/test/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapterIntegrationTest.java +++ b/modules/security-adapter-r2dbc/src/test/java/org/fireflyframework/security/adapter/r2dbc/R2dbcRevocationAdapterIntegrationTest.java @@ -85,7 +85,7 @@ void revokeIsIdempotentUpsert() { static class TestApp { @Bean RevocationPort revocationPort(DatabaseClient databaseClient) { - return new R2dbcRevocationAdapter(databaseClient); + return new R2dbcRevocationAdapterImpl(databaseClient); } } } diff --git a/modules/security-adapter-vault/README.md b/modules/security-adapter-vault/README.md index a6b62982b..1d8b90f13 100644 --- a/modules/security-adapter-vault/README.md +++ b/modules/security-adapter-vault/README.md @@ -4,7 +4,7 @@ Read a configured field from HashiCorp Vault KV v2 through SecretsPort. -Construct VaultSecretsAdapter with a Vault WebClient carrying X-Vault-Token, the KV mount, and value field name. GetSecret reads /v1/{mount}/data/{name}; a missing field or transport failure produces an error signal. Supply tokens through the runtime environment, not committed YAML. +Construct VaultSecretsAdapterImpl with a Vault WebClient carrying X-Vault-Token, the KV mount, and value field name. GetSecret reads /v1/{mount}/data/{name}; a missing field or transport failure produces an error signal. Supply tokens through the runtime environment, not committed YAML. [Module guide](../../docs/site/modules/security-adapter-vault.md) · [Jafly README](../../README.md) · [Module catalog](../../docs/site/modules/index.md) @@ -37,11 +37,11 @@ SecretsPort secretsPort() { .baseUrl(System.getenv("VAULT_ADDR")) .defaultHeader("X-Vault-Token", System.getenv("VAULT_TOKEN")) .build(); - return new VaultSecretsAdapter(client, "secret", "value"); + return new VaultSecretsAdapterImpl(client, "secret", "value"); } ``` -Inject `SecretsPort` and call `getSecret("payments-api")` as part of a reactive flow. The returned `Mono` contains the configured field; missing secrets/fields and HTTP failures propagate as `IllegalStateException`. Imports: `org.fireflyframework.security.spi.SecretsPort`, `org.fireflyframework.security.adapter.vault.VaultSecretsAdapter`, Spring's `Bean`, and WebFlux `WebClient`. This module provides explicit adapter construction, not a `firefly.vault.*` auto-configuration namespace. +Inject `SecretsPort` and call `getSecret("payments-api")` as part of a reactive flow. The returned `Mono` contains the configured field; missing secrets/fields and HTTP failures propagate as `IllegalStateException`. Imports: `org.fireflyframework.security.spi.SecretsPort`, `org.fireflyframework.security.adapter.vault.VaultSecretsAdapterImpl`, Spring's `Bean`, and WebFlux `WebClient`. This module provides explicit adapter construction, not a `firefly.vault.*` auto-configuration namespace. ## Configuration @@ -51,7 +51,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`VaultSecretsAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapter.java) | Reads one configured field from Vault KV v2 through SecretsPort; missing fields and HTTP failures propagate as errors. | +| [`VaultSecretsAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapterImpl.java) | Reads one configured field from Vault KV v2 through SecretsPort; missing fields and HTTP failures propagate as errors. | ## Continue the application diff --git a/modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapter.java b/modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapterImpl.java similarity index 95% rename from modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapter.java rename to modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapterImpl.java index 1a439db92..a6ec90b65 100644 --- a/modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapter.java +++ b/modules/security-adapter-vault/src/main/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapterImpl.java @@ -29,7 +29,7 @@ * the configured field of the secret. Fail-closed: a missing secret/field or a * transport error yields an error signal so callers can fail fast at startup. */ -public class VaultSecretsAdapter implements SecretsPort { +public class VaultSecretsAdapterImpl implements SecretsPort { private final WebClient webClient; private final String kvMount; @@ -40,7 +40,7 @@ public class VaultSecretsAdapter implements SecretsPort { * @param kvMount the KV v2 mount path (e.g. {@code "secret"}) * @param valueKey which field within the secret to return (e.g. {@code "value"}) */ - public VaultSecretsAdapter(WebClient webClient, String kvMount, String valueKey) { + public VaultSecretsAdapterImpl(WebClient webClient, String kvMount, String valueKey) { this.webClient = webClient; this.kvMount = kvMount; this.valueKey = valueKey; diff --git a/modules/security-adapter-vault/src/test/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapterIntegrationTest.java b/modules/security-adapter-vault/src/test/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapterIntegrationTest.java index 9d480807e..64c30d70d 100644 --- a/modules/security-adapter-vault/src/test/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapterIntegrationTest.java +++ b/modules/security-adapter-vault/src/test/java/org/fireflyframework/security/adapter/vault/VaultSecretsAdapterIntegrationTest.java @@ -58,8 +58,8 @@ static void writeSecret() { .retrieve().toBodilessEntity().block(); } - private VaultSecretsAdapter adapter(String field) { - return new VaultSecretsAdapter(webClient, "secret", field); + private VaultSecretsAdapterImpl adapter(String field) { + return new VaultSecretsAdapterImpl(webClient, "secret", field); } @Test diff --git a/modules/security-authorization-server/src/main/java/org/fireflyframework/security/authz/AuthorizationServerConfiguration.java b/modules/security-authorization-server/src/main/java/org/fireflyframework/security/authz/AuthorizationServerConfiguration.java index f758852d3..975284c82 100644 --- a/modules/security-authorization-server/src/main/java/org/fireflyframework/security/authz/AuthorizationServerConfiguration.java +++ b/modules/security-authorization-server/src/main/java/org/fireflyframework/security/authz/AuthorizationServerConfiguration.java @@ -23,7 +23,7 @@ import com.nimbusds.jose.jwk.source.JWKSource; import com.nimbusds.jose.proc.SecurityContext; import org.fireflyframework.security.api.domain.SigningKey; -import org.fireflyframework.security.core.key.InMemoryKeyManagementAdapter; +import org.fireflyframework.security.core.key.InMemoryKeyManagementAdapterImpl; import org.fireflyframework.security.spi.KeyManagementPort; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -87,7 +87,7 @@ public SecurityFilterChain defaultSecurityFilterChain(HttpSecurity http) throws @Bean @ConditionalOnMissingBean public KeyManagementPort authorizationServerKeyManagementPort() { - return new InMemoryKeyManagementAdapter(); + return new InMemoryKeyManagementAdapterImpl(); } @Bean diff --git a/modules/security-bff/README.md b/modules/security-bff/README.md index d5ff08038..5c8c9e9ef 100644 --- a/modules/security-bff/README.md +++ b/modules/security-bff/README.md @@ -86,9 +86,9 @@ The `firefly.security.bff` namespace is bound by [BffSecurityProperties.java](ht | --- | --- | | [`BffLoginHook`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffLoginHook.java) | Opt-in extension point invoked once per successful login , in the oauth2Login success handler, before the post-login redirect. | | [`BffSecurityProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffSecurityProperties.java) | Configuration for the token-handler BFF security chain (`BffSecurityAutoConfiguration`). | -| [`BffRefreshTokenFailureWebFilter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilter.java) | Turns a dead-session token failure into a clean, actionable response. | +| [`BffRefreshTokenFailureWebFilterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilterImpl.java) | Turns a dead-session token failure into a clean, actionable response. | | [`BffSecurityAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffSecurityAutoConfiguration.java) | Defines `bffSecurityWebFilterChain`, `NegatedServerWebExchangeMatcher`, `bffAuthorizedClientManager`, `DefaultReactiveOAuth2AuthorizedClientManager` operations. | -| [`CsrfCookieWebFilter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilter.java) | Materializes the CSRF token so the `XSRF-TOKEN` cookie is actually delivered to the browser. | +| [`CsrfCookieWebFilterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilterImpl.java) | Materializes the CSRF token so the `XSRF-TOKEN` cookie is actually delivered to the browser. | ## Continue the application diff --git a/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilter.java b/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilterImpl.java similarity index 97% rename from modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilter.java rename to modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilterImpl.java index 9100f8ca4..50a1f4889 100644 --- a/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilter.java +++ b/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilterImpl.java @@ -61,7 +61,7 @@ * failure (it surfaces as an {@code AuthenticationException} and is consumed inside the security chain * before reaching here, but the guard keeps this filter honest).

    */ -public final class BffRefreshTokenFailureWebFilter implements WebFilter, Ordered { +public final class BffRefreshTokenFailureWebFilterImpl implements WebFilter, Ordered { /** Just outside Security's {@code WebFilterChainProxy} (-100) so it wraps the whole chain. */ static final int ORDER = -101; @@ -74,7 +74,7 @@ public final class BffRefreshTokenFailureWebFilter implements WebFilter, Ordered private final String callbackPrefix; private final MediaTypeServerWebExchangeMatcher htmlMatcher; - public BffRefreshTokenFailureWebFilter(BffSecurityProperties properties) { + public BffRefreshTokenFailureWebFilterImpl(BffSecurityProperties properties) { String registrationId = properties.getRegistrationId(); this.loginPath = "/oauth2/authorization/" + registrationId; this.authorizationPrefix = "/oauth2/authorization/"; diff --git a/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffSecurityAutoConfiguration.java b/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffSecurityAutoConfiguration.java index cb435927c..9598dce13 100644 --- a/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffSecurityAutoConfiguration.java +++ b/modules/security-bff/src/main/java/org/fireflyframework/security/bff/BffSecurityAutoConfiguration.java @@ -124,7 +124,7 @@ public SecurityWebFilterChain bffSecurityWebFilterChain( .csrf(csrf -> { csrf.csrfTokenRepository(CookieServerCsrfTokenRepository.withHttpOnlyFalse()); if (properties.isCsrfCookie()) { - csrf.csrfTokenRequestHandler(new SpaServerCsrfTokenRequestHandler()); + csrf.csrfTokenRequestHandler(new SpaServerCsrfTokenRequestHandlerImpl()); } // Exempt server-to-server callbacks (e.g. OIDC back-channel logout) that carry their // own signed proof, not a browser cookie: require CSRF for the default unsafe methods @@ -248,7 +248,7 @@ private ServerLogoutSuccessHandler logoutSuccessHandler( ObjectMapper objectMapper) { ServerLogoutSuccessHandler oidc = oidcLogoutSuccessHandler(clientRegistrations, properties); return properties.isXhrAwareLogout() - ? new XhrAwareLogoutSuccessHandler(oidc, objectMapper) + ? new XhrAwareLogoutSuccessHandlerImpl(oidc, objectMapper) : oidc; } @@ -267,8 +267,8 @@ private ServerLogoutSuccessHandler oidcLogoutSuccessHandler( @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "firefly.security.bff", name = "refresh-failure-401", havingValue = "true") - public BffRefreshTokenFailureWebFilter bffRefreshTokenFailureWebFilter(BffSecurityProperties properties) { - return new BffRefreshTokenFailureWebFilter(properties); + public BffRefreshTokenFailureWebFilterImpl bffRefreshTokenFailureWebFilter(BffSecurityProperties properties) { + return new BffRefreshTokenFailureWebFilterImpl(properties); } /** @@ -278,8 +278,8 @@ public BffRefreshTokenFailureWebFilter bffRefreshTokenFailureWebFilter(BffSecuri @Bean @ConditionalOnMissingBean @ConditionalOnProperty(prefix = "firefly.security.bff", name = "csrf-cookie", havingValue = "true") - public CsrfCookieWebFilter csrfCookieWebFilter() { - return new CsrfCookieWebFilter(); + public CsrfCookieWebFilterImpl csrfCookieWebFilter() { + return new CsrfCookieWebFilterImpl(); } private ServerAuthenticationEntryPoint browserAwareEntryPoint(BffSecurityProperties properties) { diff --git a/modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilter.java b/modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilterImpl.java similarity index 97% rename from modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilter.java rename to modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilterImpl.java index 73ab23aa6..e098edc66 100644 --- a/modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilter.java +++ b/modules/security-bff/src/main/java/org/fireflyframework/security/bff/CsrfCookieWebFilterImpl.java @@ -36,7 +36,7 @@ * an exchange attribute (this bean carries the default lowest precedence, i.e. closest to the handler), * and is a no-op when CSRF is disabled (no attribute present).

    */ -public final class CsrfCookieWebFilter implements WebFilter { +public final class CsrfCookieWebFilterImpl implements WebFilter { @Override public Mono filter(ServerWebExchange exchange, WebFilterChain chain) { diff --git a/modules/security-bff/src/main/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandler.java b/modules/security-bff/src/main/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandlerImpl.java similarity index 96% rename from modules/security-bff/src/main/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandler.java rename to modules/security-bff/src/main/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandlerImpl.java index d239b95b8..9bc58d094 100644 --- a/modules/security-bff/src/main/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandler.java +++ b/modules/security-bff/src/main/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandlerImpl.java @@ -34,7 +34,7 @@ * (raw, un-masked); otherwise (e.g. a form {@code _csrf} parameter) it falls back to the XOR handler. * Without this, the default XOR handler tries to un-mask the raw cookie value and rejects it (403).

    */ -public final class SpaServerCsrfTokenRequestHandler implements ServerCsrfTokenRequestHandler { +public final class SpaServerCsrfTokenRequestHandlerImpl implements ServerCsrfTokenRequestHandler { private final ServerCsrfTokenRequestHandler xor = new XorServerCsrfTokenRequestAttributeHandler(); private final ServerCsrfTokenRequestHandler plain = new ServerCsrfTokenRequestAttributeHandler(); diff --git a/modules/security-bff/src/main/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandler.java b/modules/security-bff/src/main/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandlerImpl.java similarity index 96% rename from modules/security-bff/src/main/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandler.java rename to modules/security-bff/src/main/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandlerImpl.java index 44affc929..10ad6c169 100644 --- a/modules/security-bff/src/main/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandler.java +++ b/modules/security-bff/src/main/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandlerImpl.java @@ -46,13 +46,13 @@ * not committed): the response is still mutable, so rewriting it to a {@code 200} JSON body for the XHR * branch is safe and needs no response decorator.

    */ -final class XhrAwareLogoutSuccessHandler implements ServerLogoutSuccessHandler { +final class XhrAwareLogoutSuccessHandlerImpl implements ServerLogoutSuccessHandler { private final ServerLogoutSuccessHandler delegate; private final MediaTypeServerWebExchangeMatcher htmlMatcher; private final ObjectMapper objectMapper; - XhrAwareLogoutSuccessHandler(ServerLogoutSuccessHandler delegate, ObjectMapper objectMapper) { + XhrAwareLogoutSuccessHandlerImpl(ServerLogoutSuccessHandler delegate, ObjectMapper objectMapper) { this.delegate = delegate; this.objectMapper = objectMapper; // Same browser-vs-XHR criterion as BffSecurityAutoConfiguration#browserAwareEntryPoint: diff --git a/modules/security-bff/src/test/java/org/fireflyframework/security/bff/BffRefreshFilterWiringTest.java b/modules/security-bff/src/test/java/org/fireflyframework/security/bff/BffRefreshFilterWiringTest.java index 745fee11d..f6976e054 100644 --- a/modules/security-bff/src/test/java/org/fireflyframework/security/bff/BffRefreshFilterWiringTest.java +++ b/modules/security-bff/src/test/java/org/fireflyframework/security/bff/BffRefreshFilterWiringTest.java @@ -36,11 +36,11 @@ class BffRefreshFilterWiringTest { @TestPropertySource(properties = "firefly.security.bff.refresh-failure-401=true") class Enabled { @Autowired - ObjectProvider filter; + ObjectProvider filter; @Test void beanIsRegisteredAndOrderedOutsideSecurityChain() { - BffRefreshTokenFailureWebFilter bean = filter.getIfAvailable(); + BffRefreshTokenFailureWebFilterImpl bean = filter.getIfAvailable(); assertThat(bean).isNotNull(); assertThat(bean.getOrder()).isEqualTo(-101); } @@ -50,7 +50,7 @@ void beanIsRegisteredAndOrderedOutsideSecurityChain() { @SpringBootTest(classes = TestApp.class) class DisabledByDefault { @Autowired - ObjectProvider filter; + ObjectProvider filter; @Test void beanIsAbsentWhenPropertyNotSet() { diff --git a/modules/security-bff/src/test/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilterTest.java b/modules/security-bff/src/test/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilterTest.java index 959788bda..5f64459a7 100644 --- a/modules/security-bff/src/test/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilterTest.java +++ b/modules/security-bff/src/test/java/org/fireflyframework/security/bff/BffRefreshTokenFailureWebFilterTest.java @@ -42,8 +42,8 @@ class BffRefreshTokenFailureWebFilterTest { private static final String LOGIN = "/oauth2/authorization/idp"; - private final BffRefreshTokenFailureWebFilter filter = - new BffRefreshTokenFailureWebFilter(new BffSecurityProperties()); // registration-id = "idp" + private final BffRefreshTokenFailureWebFilterImpl filter = + new BffRefreshTokenFailureWebFilterImpl(new BffSecurityProperties()); // registration-id = "idp" private static WebFilterChain failing(Throwable error) { return exchange -> Mono.error(error); diff --git a/modules/security-bff/src/test/java/org/fireflyframework/security/bff/CsrfCookieWebFilterTest.java b/modules/security-bff/src/test/java/org/fireflyframework/security/bff/CsrfCookieWebFilterTest.java index 9bba0e9f0..9196bbab3 100644 --- a/modules/security-bff/src/test/java/org/fireflyframework/security/bff/CsrfCookieWebFilterTest.java +++ b/modules/security-bff/src/test/java/org/fireflyframework/security/bff/CsrfCookieWebFilterTest.java @@ -32,7 +32,7 @@ /** Unit tests for {@link CsrfCookieWebFilter}. */ class CsrfCookieWebFilterTest { - private final CsrfCookieWebFilter filter = new CsrfCookieWebFilter(); + private final CsrfCookieWebFilterImpl filter = new CsrfCookieWebFilterImpl(); @Test void subscribesDeferredTokenThenProceeds() { diff --git a/modules/security-bff/src/test/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandlerTest.java b/modules/security-bff/src/test/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandlerTest.java index 8c2b51fd9..83ebadb81 100644 --- a/modules/security-bff/src/test/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandlerTest.java +++ b/modules/security-bff/src/test/java/org/fireflyframework/security/bff/SpaServerCsrfTokenRequestHandlerTest.java @@ -27,7 +27,7 @@ /** Unit tests for {@link SpaServerCsrfTokenRequestHandler}. */ class SpaServerCsrfTokenRequestHandlerTest { - private final SpaServerCsrfTokenRequestHandler handler = new SpaServerCsrfTokenRequestHandler(); + private final SpaServerCsrfTokenRequestHandlerImpl handler = new SpaServerCsrfTokenRequestHandlerImpl(); private final CsrfToken token = new DefaultCsrfToken("X-XSRF-TOKEN", "_csrf", "raw-cookie-value"); @Test diff --git a/modules/security-bff/src/test/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandlerTest.java b/modules/security-bff/src/test/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandlerTest.java index a965c350c..961233102 100644 --- a/modules/security-bff/src/test/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandlerTest.java +++ b/modules/security-bff/src/test/java/org/fireflyframework/security/bff/XhrAwareLogoutSuccessHandlerTest.java @@ -52,8 +52,8 @@ class XhrAwareLogoutSuccessHandlerTest { r.getHeaders().setLocation(URI.create(END_SESSION)); }); - private final XhrAwareLogoutSuccessHandler handler = - new XhrAwareLogoutSuccessHandler(delegate, new ObjectMapper()); + private final XhrAwareLogoutSuccessHandlerImpl handler = + new XhrAwareLogoutSuccessHandlerImpl(delegate, new ObjectMapper()); private WebFilterExchange exchangeFor(MockServerWebExchange exchange) { WebFilterChain noop = e -> Mono.empty(); diff --git a/modules/security-core/README.md b/modules/security-core/README.md index b71e9a3f7..e8f3d321b 100644 --- a/modules/security-core/README.md +++ b/modules/security-core/README.md @@ -33,7 +33,7 @@ The core is normally wired by `security-autoconfigure`, but every component is a ```java import org.fireflyframework.security.api.domain.Decision; import org.fireflyframework.security.api.domain.SecurityPrincipal; -import org.fireflyframework.security.core.authority.ConfigurableAuthorityMapper; +import org.fireflyframework.security.core.authority.ConfigurableAuthorityMapperImpl; import org.fireflyframework.security.core.authz.SecureAuthorizationEvaluator; import org.fireflyframework.security.core.authz.SecureRequirement; import org.fireflyframework.security.core.context.PrincipalFactory; @@ -42,7 +42,7 @@ import java.util.List; import java.util.Map; // 1. Project validated claims into a generic principal, normalizing authorities/scopes. -var authorityMapper = new ConfigurableAuthorityMapper(null); // null -> sensible defaults +var authorityMapper = new ConfigurableAuthorityMapperImpl(null); // null -> sensible defaults var principalFactory = new PrincipalFactory(authorityMapper); Map claims = Map.of( @@ -75,10 +75,10 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | | [`SecureAuthorizationEvaluator`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/authz/SecureAuthorizationEvaluator.java) | Evaluates a `SecureRequirement` against a `SecurityPrincipal`. | -| [`EmbeddedPolicyDecisionAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapter.java) | Zero-dependency, in-process default `PolicyDecisionPort`. | -| [`AuthorityMappingProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/authority/AuthorityMappingProperties.java) | Configuration for `ConfigurableAuthorityMapper`: which claim paths carry roles/groups and scopes, and an optional authority prefix. | -| [`PolicyRule`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/PolicyRule.java) | A single in-process ABAC rule for the `EmbeddedPolicyDecisionAdapter`. | -| [`LoggingAuditEventAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapter.java) | Default `AuditEventPort`: emits structured audit lines to a dedicated logger. | +| [`EmbeddedPolicyDecisionAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapterImpl.java) | Zero-dependency, in-process default `PolicyDecisionPort`. | +| [`AuthorityMappingProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/authority/AuthorityMappingProperties.java) | Configuration for `ConfigurableAuthorityMapperImpl`: which claim paths carry roles/groups and scopes, and an optional authority prefix. | +| [`PolicyRule`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/PolicyRule.java) | A single in-process ABAC rule for the `EmbeddedPolicyDecisionAdapterImpl`. | +| [`LoggingAuditEventAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapterImpl.java) | Default `AuditEventPort`: emits structured audit lines to a dedicated logger. | ## Continue the application diff --git a/modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapter.java b/modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapterImpl.java similarity index 95% rename from modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapter.java rename to modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapterImpl.java index dcb3201f3..b3a0933cf 100644 --- a/modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapter.java +++ b/modules/security-core/src/main/java/org/fireflyframework/security/core/audit/LoggingAuditEventAdapterImpl.java @@ -26,7 +26,7 @@ * Default {@link AuditEventPort}: emits structured audit lines to a dedicated logger. Never throws * and never blocks the request path. Production deployments swap in JDBC/Kafka/SIEM adapters. */ -public class LoggingAuditEventAdapter implements AuditEventPort { +public class LoggingAuditEventAdapterImpl implements AuditEventPort { private static final Logger log = LoggerFactory.getLogger("org.fireflyframework.security.audit"); diff --git a/modules/security-core/src/main/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapper.java b/modules/security-core/src/main/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapperImpl.java similarity index 94% rename from modules/security-core/src/main/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapper.java rename to modules/security-core/src/main/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapperImpl.java index f95a5fba9..6b4bf3459 100644 --- a/modules/security-core/src/main/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapper.java +++ b/modules/security-core/src/main/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapperImpl.java @@ -27,11 +27,11 @@ * paths and normalizes them into framework authorities. Replaces the duplicated, dead * {@code JwtClaimsRoleExtractor} traversal that previously lived in the starter. */ -public class ConfigurableAuthorityMapper implements AuthorityMappingPort { +public class ConfigurableAuthorityMapperImpl implements AuthorityMappingPort { private final AuthorityMappingProperties properties; - public ConfigurableAuthorityMapper(AuthorityMappingProperties properties) { + public ConfigurableAuthorityMapperImpl(AuthorityMappingProperties properties) { this.properties = properties == null ? AuthorityMappingProperties.defaults() : properties; } diff --git a/modules/security-core/src/main/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCache.java b/modules/security-core/src/main/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCacheImpl.java similarity index 95% rename from modules/security-core/src/main/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCache.java rename to modules/security-core/src/main/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCacheImpl.java index 3597c9cb0..550e280fe 100644 --- a/modules/security-core/src/main/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCache.java +++ b/modules/security-core/src/main/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCacheImpl.java @@ -29,14 +29,14 @@ * Default in-memory {@link TokenIntrospectionCachePort} backed by Caffeine with per-entry TTL, * so a high-traffic resource server caches opaque introspection results up to each token's expiry. */ -public class CaffeineIntrospectionCache implements TokenIntrospectionCachePort { +public class CaffeineIntrospectionCacheImpl implements TokenIntrospectionCachePort { private record Entry(SecurityPrincipal principal, long ttlNanos) { } private final Cache cache; - public CaffeineIntrospectionCache(long maximumSize) { + public CaffeineIntrospectionCacheImpl(long maximumSize) { this.cache = Caffeine.newBuilder() .maximumSize(maximumSize) .expireAfter(new Expiry() { diff --git a/modules/security-core/src/main/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapter.java b/modules/security-core/src/main/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapterImpl.java similarity index 95% rename from modules/security-core/src/main/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapter.java rename to modules/security-core/src/main/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapterImpl.java index 69fcdaa49..f8933827f 100644 --- a/modules/security-core/src/main/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapter.java +++ b/modules/security-core/src/main/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapterImpl.java @@ -38,14 +38,14 @@ * remain verifiable. Not for production — production deployments bind a Vault or * cloud-KMS adapter; the autoconfigure layer fails closed if no key source resolves under prod profiles. */ -public class InMemoryKeyManagementAdapter implements KeyManagementPort { +public class InMemoryKeyManagementAdapterImpl implements KeyManagementPort { private static final String ALGORITHM = "RS256"; private static final int OVERLAP_KEYS = 2; private final List keys = new CopyOnWriteArrayList<>(); - public InMemoryKeyManagementAdapter() { + public InMemoryKeyManagementAdapterImpl() { keys.add(generate()); } @@ -62,7 +62,7 @@ public Flux verificationKeys() { @Override public Mono jwkSetJson() { return Mono.fromSupplier(() -> keys.stream() - .map(InMemoryKeyManagementAdapter::toJwkJson) + .map(InMemoryKeyManagementAdapterImpl::toJwkJson) .collect(Collectors.joining(",", "{\"keys\":[", "]}"))); } diff --git a/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapter.java b/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapterImpl.java similarity index 94% rename from modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapter.java rename to modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapterImpl.java index 4ce1d0505..6c545da20 100644 --- a/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapter.java +++ b/modules/security-core/src/main/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapterImpl.java @@ -43,19 +43,19 @@ * and retains permit obligations for the enforcing caller. The original constructor preserves * the legacy no-rules deferral to a separate RBAC gate. */ -public class EmbeddedPolicyDecisionAdapter implements PolicyDecisionPort { +public class EmbeddedPolicyDecisionAdapterImpl implements PolicyDecisionPort { - private static final Logger log = LoggerFactory.getLogger(EmbeddedPolicyDecisionAdapter.class); + private static final Logger log = LoggerFactory.getLogger(EmbeddedPolicyDecisionAdapterImpl.class); private final List rules; private final boolean strict; - public EmbeddedPolicyDecisionAdapter(List rules) { + public EmbeddedPolicyDecisionAdapterImpl(List rules) { this(rules, false); } /** Requires an explicit policy result and retains obligations for the enforcing caller. */ - public EmbeddedPolicyDecisionAdapter(List rules, boolean strict) { + public EmbeddedPolicyDecisionAdapterImpl(List rules, boolean strict) { this.rules = rules == null ? List.of() : List.copyOf(rules); this.strict = strict; } diff --git a/modules/security-core/src/main/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolver.java b/modules/security-core/src/main/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolverImpl.java similarity index 95% rename from modules/security-core/src/main/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolver.java rename to modules/security-core/src/main/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolverImpl.java index 7f29459ca..d8221dace 100644 --- a/modules/security-core/src/main/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolver.java +++ b/modules/security-core/src/main/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolverImpl.java @@ -38,11 +38,11 @@ * (active tenant chosen from the request and validated against the set) is a change to the caller, * not to this single-valued port.

    */ -public class ConfigurableTenantResolver implements TenantResolverPort { +public class ConfigurableTenantResolverImpl implements TenantResolverPort { private final List claimPaths; - public ConfigurableTenantResolver(List claimPaths) { + public ConfigurableTenantResolverImpl(List claimPaths) { this.claimPaths = List.copyOf(claimPaths); } diff --git a/modules/security-core/src/test/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapperTest.java b/modules/security-core/src/test/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapperTest.java index 0cfc5221a..ca5ad4881 100644 --- a/modules/security-core/src/test/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapperTest.java +++ b/modules/security-core/src/test/java/org/fireflyframework/security/core/authority/ConfigurableAuthorityMapperTest.java @@ -25,8 +25,8 @@ class ConfigurableAuthorityMapperTest { - private final ConfigurableAuthorityMapper mapper = - new ConfigurableAuthorityMapper(AuthorityMappingProperties.defaults()); + private final ConfigurableAuthorityMapperImpl mapper = + new ConfigurableAuthorityMapperImpl(AuthorityMappingProperties.defaults()); @Test void mapsTopLevelRolesArray() { @@ -54,7 +54,7 @@ void mapsSpaceDelimitedScopeString() { @Test void appliesAuthorityPrefixWithoutDoublePrefixing() { - ConfigurableAuthorityMapper prefixed = new ConfigurableAuthorityMapper( + ConfigurableAuthorityMapperImpl prefixed = new ConfigurableAuthorityMapperImpl( new AuthorityMappingProperties(List.of("roles"), List.of("scp"), "ROLE_")); Map claims = Map.of("roles", List.of("admin", "ROLE_existing")); assertThat(prefixed.mapAuthorities(claims)).containsExactlyInAnyOrder("ROLE_admin", "ROLE_existing"); diff --git a/modules/security-core/src/test/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCacheTest.java b/modules/security-core/src/test/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCacheTest.java index 9e5da2a9e..5efa1063e 100644 --- a/modules/security-core/src/test/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCacheTest.java +++ b/modules/security-core/src/test/java/org/fireflyframework/security/core/cache/CaffeineIntrospectionCacheTest.java @@ -24,7 +24,7 @@ class CaffeineIntrospectionCacheTest { - private final CaffeineIntrospectionCache cache = new CaffeineIntrospectionCache(100); + private final CaffeineIntrospectionCacheImpl cache = new CaffeineIntrospectionCacheImpl(100); private final SecurityPrincipal principal = SecurityPrincipal.builder().subject("u1").build(); @Test diff --git a/modules/security-core/src/test/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapterTest.java b/modules/security-core/src/test/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapterTest.java index a2308eebe..0f293210b 100644 --- a/modules/security-core/src/test/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapterTest.java +++ b/modules/security-core/src/test/java/org/fireflyframework/security/core/key/InMemoryKeyManagementAdapterTest.java @@ -23,7 +23,7 @@ class InMemoryKeyManagementAdapterTest { - private final InMemoryKeyManagementAdapter keys = new InMemoryKeyManagementAdapter(); + private final InMemoryKeyManagementAdapterImpl keys = new InMemoryKeyManagementAdapterImpl(); @Test void activeKeyCanSignAndHasKid() { diff --git a/modules/security-core/src/test/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapterTest.java b/modules/security-core/src/test/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapterTest.java index 601582b74..b537ac0a8 100644 --- a/modules/security-core/src/test/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapterTest.java +++ b/modules/security-core/src/test/java/org/fireflyframework/security/core/policy/EmbeddedPolicyDecisionAdapterTest.java @@ -29,7 +29,7 @@ class EmbeddedPolicyDecisionAdapterTest { private final SecurityPrincipal p = SecurityPrincipal.builder().subject("u1").build(); - private void assertGranted(EmbeddedPolicyDecisionAdapter pdp, boolean expected) { + private void assertGranted(EmbeddedPolicyDecisionAdapterImpl pdp, boolean expected) { StepVerifier.create(pdp.authorize(p, "read", "doc:1", Map.of())) .expectNextMatches(d -> d.granted() == expected) .verifyComplete(); @@ -37,12 +37,12 @@ private void assertGranted(EmbeddedPolicyDecisionAdapter pdp, boolean expected) @Test void noRulesPermitsToDeferToRbac() { - assertGranted(new EmbeddedPolicyDecisionAdapter(List.of()), true); + assertGranted(new EmbeddedPolicyDecisionAdapterImpl(List.of()), true); } @Test void denyOverridesPermit() { - EmbeddedPolicyDecisionAdapter pdp = new EmbeddedPolicyDecisionAdapter(List.of( + EmbeddedPolicyDecisionAdapterImpl pdp = new EmbeddedPolicyDecisionAdapterImpl(List.of( (pr, a, r, c) -> Mono.just(Decision.permit()), (pr, a, r, c) -> Mono.just(Decision.deny("blocked")))); assertGranted(pdp, false); @@ -50,7 +50,7 @@ void denyOverridesPermit() { @Test void permitsWhenARulePermitsAndNoneDeny() { - EmbeddedPolicyDecisionAdapter pdp = new EmbeddedPolicyDecisionAdapter(List.of( + EmbeddedPolicyDecisionAdapterImpl pdp = new EmbeddedPolicyDecisionAdapterImpl(List.of( (pr, a, r, c) -> Mono.just(Decision.indeterminate("n/a")), (pr, a, r, c) -> Mono.just(Decision.permit()))); assertGranted(pdp, true); @@ -58,14 +58,14 @@ void permitsWhenARulePermitsAndNoneDeny() { @Test void allAbstainDeniesFailClosed() { - EmbeddedPolicyDecisionAdapter pdp = new EmbeddedPolicyDecisionAdapter(List.of( + EmbeddedPolicyDecisionAdapterImpl pdp = new EmbeddedPolicyDecisionAdapterImpl(List.of( (pr, a, r, c) -> Mono.just(Decision.indeterminate("n/a")))); assertGranted(pdp, false); } @Test void ruleErrorIsTreatedAsDenyNotPermit() { - EmbeddedPolicyDecisionAdapter pdp = new EmbeddedPolicyDecisionAdapter(List.of( + EmbeddedPolicyDecisionAdapterImpl pdp = new EmbeddedPolicyDecisionAdapterImpl(List.of( (pr, a, r, c) -> Mono.error(new IllegalStateException("boom")))); assertGranted(pdp, false); } diff --git a/modules/security-core/src/test/java/org/fireflyframework/security/core/policy/StrictEmbeddedPolicyDecisionAdapterTest.java b/modules/security-core/src/test/java/org/fireflyframework/security/core/policy/StrictEmbeddedPolicyDecisionAdapterTest.java index 8c907bcbd..a0ffccab0 100644 --- a/modules/security-core/src/test/java/org/fireflyframework/security/core/policy/StrictEmbeddedPolicyDecisionAdapterTest.java +++ b/modules/security-core/src/test/java/org/fireflyframework/security/core/policy/StrictEmbeddedPolicyDecisionAdapterTest.java @@ -11,9 +11,9 @@ class StrictEmbeddedPolicyDecisionAdapterTest { private final SecurityPrincipal principal = SecurityPrincipal.builder().subject("synthetic-user").build(); - private EmbeddedPolicyDecisionAdapter adapter(List rules) { + private EmbeddedPolicyDecisionAdapterImpl adapter(List rules) { try { - return EmbeddedPolicyDecisionAdapter.class.getConstructor(List.class, boolean.class) + return EmbeddedPolicyDecisionAdapterImpl.class.getConstructor(List.class, boolean.class) .newInstance(rules, true); } catch (ReflectiveOperationException error) { return fail("Explicit strict policy mode must be available without changing the legacy constructor", error); diff --git a/modules/security-core/src/test/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolverTest.java b/modules/security-core/src/test/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolverTest.java index d0fe159a6..bb7040885 100644 --- a/modules/security-core/src/test/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolverTest.java +++ b/modules/security-core/src/test/java/org/fireflyframework/security/core/tenant/ConfigurableTenantResolverTest.java @@ -28,7 +28,7 @@ class ConfigurableTenantResolverTest { - private final ConfigurableTenantResolver resolver = new ConfigurableTenantResolver(List.of("tenant_ids")); + private final ConfigurableTenantResolverImpl resolver = new ConfigurableTenantResolverImpl(List.of("tenant_ids")); private static SecurityPrincipal principalWith(Object tenantClaim) { return SecurityPrincipal.builder() @@ -58,7 +58,7 @@ void emptyWhenMoreThanOneTenantFailClosed() { @Test void readsNestedClaimPath() { - ConfigurableTenantResolver nested = new ConfigurableTenantResolver(List.of("org.tenant")); + ConfigurableTenantResolverImpl nested = new ConfigurableTenantResolverImpl(List.of("org.tenant")); SecurityPrincipal principal = SecurityPrincipal.builder() .subject("user-1") .claims(Map.of("org", Map.of("tenant", "tenant-x"))) @@ -103,7 +103,7 @@ void mixedLegacyCollectionDoesNotSilentlyDiscardAnAmbiguousElement() { @Test void identicalOpaqueValuesAcrossClaimPathsCoalesceWithoutNormalization() { String tenant = "opaque tenant,α"; - var configured = new ConfigurableTenantResolver(List.of("first", "org.tenant")); + var configured = new ConfigurableTenantResolverImpl(List.of("first", "org.tenant")); var principal = SecurityPrincipal.builder().subject("user-1") .claims(Map.of("first", tenant, "org", Map.of("tenant", List.of(tenant)))).build(); StepVerifier.create(configured.resolveTenant(principal)).expectNext(tenant).verifyComplete(); diff --git a/modules/security-idp-aws-cognito/README.md b/modules/security-idp-aws-cognito/README.md index eba7388ee..029f9bca3 100644 --- a/modules/security-idp-aws-cognito/README.md +++ b/modules/security-idp-aws-cognito/README.md @@ -59,7 +59,7 @@ import reactor.core.publisher.Mono; @RequiredArgsConstructor public class AuthService { - private final IdpAdapter idp; // CognitoIdpAdapter wired by CognitoAutoConfiguration + private final IdpAdapter idp; // CognitoIdpAdapterImpl wired by CognitoAutoConfiguration @@ -90,7 +90,7 @@ The `firefly.security.idp.cognito` namespace is bound by [CognitoProperties.java | Type | Contract and responsibility | | --- | --- | -| [`CognitoIdpAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapter.java) | AWS Cognito implementation of the Firefly IDP Adapter. | +| [`CognitoIdpAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterImpl.java) | AWS Cognito implementation of the Firefly IDP Adapter. | | [`CognitoProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/properties/CognitoProperties.java) | Configuration properties for AWS Cognito Identity Provider. | | [`CognitoClientFactory`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/client/CognitoClientFactory.java) | Factory for creating and managing AWS Cognito Identity Provider clients. | | [`CognitoAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/config/CognitoAutoConfiguration.java) | Spring auto-configuration for AWS Cognito IDP Adapter. | diff --git a/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapter.java b/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterImpl.java similarity index 99% rename from modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapter.java rename to modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterImpl.java index fcb3de628..92a9e3d72 100644 --- a/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapter.java +++ b/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterImpl.java @@ -50,7 +50,7 @@ */ @RequiredArgsConstructor @Slf4j -public class CognitoIdpAdapter implements IdpAdapter { +public class CognitoIdpAdapterImpl implements IdpAdapter { private final CognitoUserService userService; private final CognitoAdminService adminService; diff --git a/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/config/CognitoAutoConfiguration.java b/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/config/CognitoAutoConfiguration.java index 8474c1c36..f674333f2 100644 --- a/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/config/CognitoAutoConfiguration.java +++ b/modules/security-idp-aws-cognito/src/main/java/org/fireflyframework/security/idp/cognito/config/CognitoAutoConfiguration.java @@ -17,7 +17,7 @@ package org.fireflyframework.security.idp.cognito.config; import org.fireflyframework.security.idp.adapter.IdpAdapter; -import org.fireflyframework.security.idp.cognito.adapter.CognitoIdpAdapter; +import org.fireflyframework.security.idp.cognito.adapter.CognitoIdpAdapterImpl; import org.fireflyframework.security.idp.cognito.client.CognitoClientFactory; import org.fireflyframework.security.idp.cognito.properties.CognitoProperties; import org.fireflyframework.security.idp.cognito.service.CognitoAdminService; @@ -86,6 +86,6 @@ public CognitoAdminService cognitoAdminService(CognitoClientFactory clientFactor @ConditionalOnMissingBean(IdpAdapter.class) public IdpAdapter cognitoIdpAdapter(CognitoUserService userService, CognitoAdminService adminService) { log.info("Configuring Cognito IDP Adapter"); - return new CognitoIdpAdapter(userService, adminService); + return new CognitoIdpAdapterImpl(userService, adminService); } } diff --git a/modules/security-idp-aws-cognito/src/test/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterLocalStackIT.java b/modules/security-idp-aws-cognito/src/test/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterLocalStackIT.java index 4d11d39a7..375b558da 100644 --- a/modules/security-idp-aws-cognito/src/test/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterLocalStackIT.java +++ b/modules/security-idp-aws-cognito/src/test/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterLocalStackIT.java @@ -98,7 +98,7 @@ class CognitoIdpAdapterLocalStackIT { .withEnv("EAGER_SERVICE_LOADING", "1"); // Load services eagerly private static CognitoIdentityProviderClient cognitoClient; - private static CognitoIdpAdapter adapter; + private static CognitoIdpAdapterImpl adapter; private static String userPoolId; private static String clientId; private static String testUserId; @@ -180,7 +180,7 @@ static void setUp() { CognitoUserService userService = new CognitoUserService(clientFactory, properties); CognitoAdminService adminService = new CognitoAdminService(clientFactory, properties); - adapter = new CognitoIdpAdapter(userService, adminService); + adapter = new CognitoIdpAdapterImpl(userService, adminService); } @AfterAll diff --git a/modules/security-idp-aws-cognito/src/test/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterTest.java b/modules/security-idp-aws-cognito/src/test/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterTest.java index 63c0728f4..de772a80c 100644 --- a/modules/security-idp-aws-cognito/src/test/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterTest.java +++ b/modules/security-idp-aws-cognito/src/test/java/org/fireflyframework/security/idp/cognito/adapter/CognitoIdpAdapterTest.java @@ -52,11 +52,11 @@ class CognitoIdpAdapterTest { @Mock private CognitoAdminService adminService; - private CognitoIdpAdapter adapter; + private CognitoIdpAdapterImpl adapter; @BeforeEach void setUp() { - adapter = new CognitoIdpAdapter(userService, adminService); + adapter = new CognitoIdpAdapterImpl(userService, adminService); } @Test diff --git a/modules/security-idp-azure-ad/README.md b/modules/security-idp-azure-ad/README.md index d843c984c..20df40030 100644 --- a/modules/security-idp-azure-ad/README.md +++ b/modules/security-idp-azure-ad/README.md @@ -98,7 +98,7 @@ The `firefly.security.idp.azure-ad` namespace is bound by [AzureAdProperties.jav | Type | Contract and responsibility | | --- | --- | -| [`AzureAdIdpAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapter.java) | Azure AD implementation of the Firefly IDP Adapter. | +| [`AzureAdIdpAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapterImpl.java) | Azure AD implementation of the Firefly IDP Adapter. | | [`AzureAdProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/config/AzureAdProperties.java) | Carries `mode`, `tenantId`, `clientId`, `clientSecret`, `b2c` data; field constraints and defaults are declared in the linked source. | | [`AzureAdAdminService`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/AzureAdAdminService.java) | Admin service interface for Azure AD user management operations. | | [`GraphClientFactory`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/client/GraphClientFactory.java) | Defines `createClient`, `destroy` operations. | diff --git a/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapter.java b/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapterImpl.java similarity index 99% rename from modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapter.java rename to modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapterImpl.java index 25504d4d1..3b4a6088b 100644 --- a/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapter.java +++ b/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapterImpl.java @@ -49,7 +49,7 @@ */ @RequiredArgsConstructor @Slf4j -public class AzureAdIdpAdapter implements IdpAdapter { +public class AzureAdIdpAdapterImpl implements IdpAdapter { private final AzureAdAuthService authService; private final AzureAdAdminService adminService; diff --git a/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/config/AzureAdAutoConfiguration.java b/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/config/AzureAdAutoConfiguration.java index cb8e685ce..085addb5e 100644 --- a/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/config/AzureAdAutoConfiguration.java +++ b/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/config/AzureAdAutoConfiguration.java @@ -17,13 +17,13 @@ import com.microsoft.aad.msal4j.ConfidentialClientApplication; import org.fireflyframework.security.idp.adapter.IdpAdapter; -import org.fireflyframework.security.idp.azuread.adapter.AzureAdIdpAdapter; +import org.fireflyframework.security.idp.azuread.adapter.AzureAdIdpAdapterImpl; import org.fireflyframework.security.idp.azuread.client.GraphClientFactory; import org.fireflyframework.security.idp.azuread.client.MsalClientFactory; import org.fireflyframework.security.idp.azuread.service.AzureAdAdminService; import org.fireflyframework.security.idp.azuread.service.AzureAdAuthService; -import org.fireflyframework.security.idp.azuread.service.B2CAdminService; -import org.fireflyframework.security.idp.azuread.service.EntraIdAdminService; +import org.fireflyframework.security.idp.azuread.service.B2CAdminServiceImpl; +import org.fireflyframework.security.idp.azuread.service.EntraIdAdminServiceImpl; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; @@ -82,7 +82,7 @@ public AzureAdAuthService azureAdAuthService(GraphClientFactory graphClientFacto public AzureAdAdminService entraIdAdminService(GraphClientFactory graphClientFactory, AzureAdProperties properties) { log.info("Configuring Entra ID Admin Service"); - return new EntraIdAdminService(graphClientFactory, properties); + return new EntraIdAdminServiceImpl(graphClientFactory, properties); } @Bean @@ -91,7 +91,7 @@ public AzureAdAdminService entraIdAdminService(GraphClientFactory graphClientFac public AzureAdAdminService b2cAdminService(GraphClientFactory graphClientFactory, AzureAdProperties properties) { log.info("Configuring B2C Admin Service"); - return new B2CAdminService(graphClientFactory, properties); + return new B2CAdminServiceImpl(graphClientFactory, properties); } @Bean @@ -99,6 +99,6 @@ public AzureAdAdminService b2cAdminService(GraphClientFactory graphClientFactory public IdpAdapter azureAdIdpAdapter(AzureAdAuthService authService, AzureAdAdminService adminService) { log.info("Configuring Azure AD IDP Adapter"); - return new AzureAdIdpAdapter(authService, adminService); + return new AzureAdIdpAdapterImpl(authService, adminService); } } diff --git a/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/B2CAdminService.java b/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/B2CAdminServiceImpl.java similarity index 97% rename from modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/B2CAdminService.java rename to modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/B2CAdminServiceImpl.java index 71ea6fd41..d48f1309e 100644 --- a/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/B2CAdminService.java +++ b/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/B2CAdminServiceImpl.java @@ -47,9 +47,9 @@ * */ @Slf4j -public class B2CAdminService extends EntraIdAdminService { +public class B2CAdminServiceImpl extends EntraIdAdminServiceImpl { - public B2CAdminService(GraphClientFactory graphClientFactory, AzureAdProperties properties) { + public B2CAdminServiceImpl(GraphClientFactory graphClientFactory, AzureAdProperties properties) { super(graphClientFactory, properties); } diff --git a/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/EntraIdAdminService.java b/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/EntraIdAdminServiceImpl.java similarity index 99% rename from modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/EntraIdAdminService.java rename to modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/EntraIdAdminServiceImpl.java index a6d6861ae..5cd5c9696 100644 --- a/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/EntraIdAdminService.java +++ b/modules/security-idp-azure-ad/src/main/java/org/fireflyframework/security/idp/azuread/service/EntraIdAdminServiceImpl.java @@ -65,7 +65,7 @@ */ @RequiredArgsConstructor @Slf4j -public class EntraIdAdminService implements AzureAdAdminService { +public class EntraIdAdminServiceImpl implements AzureAdAdminService { protected final GraphClientFactory graphClientFactory; protected final AzureAdProperties properties; diff --git a/modules/security-idp-azure-ad/src/test/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapterTest.java b/modules/security-idp-azure-ad/src/test/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapterTest.java index 15bd399e5..61bf2907e 100644 --- a/modules/security-idp-azure-ad/src/test/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapterTest.java +++ b/modules/security-idp-azure-ad/src/test/java/org/fireflyframework/security/idp/azuread/adapter/AzureAdIdpAdapterTest.java @@ -53,11 +53,11 @@ class AzureAdIdpAdapterTest { @Mock private AzureAdAdminService adminService; - private AzureAdIdpAdapter adapter; + private AzureAdIdpAdapterImpl adapter; @BeforeEach void setUp() { - adapter = new AzureAdIdpAdapter(authService, adminService); + adapter = new AzureAdIdpAdapterImpl(authService, adminService); } @Test diff --git a/modules/security-idp-internal-db/README.md b/modules/security-idp-internal-db/README.md index 2312da5ce..db9c09600 100644 --- a/modules/security-idp-internal-db/README.md +++ b/modules/security-idp-internal-db/README.md @@ -69,7 +69,7 @@ import reactor.core.publisher.Mono; @RequiredArgsConstructor public class AuthController { - private final IdpAdapter idp; // InternalDbIdpAdapter, wired by auto-configuration + private final IdpAdapter idp; // InternalDbIdpAdapterImpl, wired by auto-configuration @PostMapping("/auth/login") public Mono> login(@RequestBody LoginRequest request) { @@ -99,7 +99,7 @@ The `firefly.security.idp.internal-db` namespace is bound by [InternalDbProperti | Type | Contract and responsibility | | --- | --- | -| [`InternalDbIdpAdapter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapter.java) | Internal Database implementation of the Firefly IDP Adapter. | +| [`InternalDbIdpAdapterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapterImpl.java) | Internal Database implementation of the Firefly IDP Adapter. | | [`InternalDbProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/config/InternalDbProperties.java) | Configuration properties for Internal Database IDP implementation. | | [`PasswordResetTokenRepository`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/repository/PasswordResetTokenRepository.java) | Reactive repository for password reset token operations. | | [`RefreshTokenRepository`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/repository/RefreshTokenRepository.java) | Reactive repository for RefreshToken entity operations. | diff --git a/modules/security-idp-internal-db/docs/API.md b/modules/security-idp-internal-db/docs/API.md index 217ad6632..7eca8a6e7 100644 --- a/modules/security-idp-internal-db/docs/API.md +++ b/modules/security-idp-internal-db/docs/API.md @@ -1,6 +1,6 @@ # Internal database adapter API -`InternalDbIdpAdapter` implements the shared [`IdpAdapter`](../../security-idp/src/main/java/org/fireflyframework/security/idp/adapter/IdpAdapter.java) contract. Its methods return Reactor publishers. The [implementation](../src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapter.java) maps service results into the shared DTOs and, where specified, `ResponseEntity` values. +`InternalDbIdpAdapterImpl` implements the shared [`IdpAdapter`](../../security-idp/src/main/java/org/fireflyframework/security/idp/adapter/IdpAdapter.java) contract. Its methods return Reactor publishers. The [implementation](../src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapterImpl.java) maps service results into the shared DTOs and, where specified, `ResponseEntity` values. ## HTTP routes diff --git a/modules/security-idp-internal-db/docs/DTO_FIELD_MAPPING.md b/modules/security-idp-internal-db/docs/DTO_FIELD_MAPPING.md index 5bfc38166..dd19601d9 100644 --- a/modules/security-idp-internal-db/docs/DTO_FIELD_MAPPING.md +++ b/modules/security-idp-internal-db/docs/DTO_FIELD_MAPPING.md @@ -13,4 +13,4 @@ The adapter uses DTOs from `org.fireflyframework.security.idp.dtos`. Entity fiel | `CreateScopeRequest` | Uses `name` and `description`. The internal adapter stores the scope as a role. | | `CreateScopeResponse` | Uses `id`, `name`, and `createdAt`. | -See the [DTO definitions](../../security-idp/src/main/java/org/fireflyframework/security/idp/dtos), [adapter mapping code](../src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapter.java), and [user service](../src/main/java/org/fireflyframework/security/idp/internaldb/service/UserManagementService.java). +See the [DTO definitions](../../security-idp/src/main/java/org/fireflyframework/security/idp/dtos), [adapter mapping code](../src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapterImpl.java), and [user service](../src/main/java/org/fireflyframework/security/idp/internaldb/service/UserManagementService.java). diff --git a/modules/security-idp-internal-db/docs/technical-details.md b/modules/security-idp-internal-db/docs/technical-details.md index 7e1cb9081..3a6a15f35 100644 --- a/modules/security-idp-internal-db/docs/technical-details.md +++ b/modules/security-idp-internal-db/docs/technical-details.md @@ -6,7 +6,7 @@ The module implements `IdpAdapter` with PostgreSQL storage and reactive reposito ```mermaid flowchart TD - Web[Common /idp controller] --> Adapter[InternalDbIdpAdapter] + Web[Common /idp controller] --> Adapter[InternalDbIdpAdapterImpl] Adapter --> Auth[Authentication and token services] Adapter --> Users[User and role services] Adapter --> Recovery[Password reset and MFA services] diff --git a/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapter.java b/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapterImpl.java similarity index 99% rename from modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapter.java rename to modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapterImpl.java index d08b4ba38..f7d47663d 100644 --- a/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapter.java +++ b/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/adapter/InternalDbIdpAdapterImpl.java @@ -57,7 +57,7 @@ */ @RequiredArgsConstructor @Slf4j -public class InternalDbIdpAdapter implements IdpAdapter { +public class InternalDbIdpAdapterImpl implements IdpAdapter { private final AuthenticationService authenticationService; private final UserManagementService userManagementService; diff --git a/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/config/InternalDbIdpAutoConfiguration.java b/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/config/InternalDbIdpAutoConfiguration.java index 6ed6eaf03..3c59c3803 100644 --- a/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/config/InternalDbIdpAutoConfiguration.java +++ b/modules/security-idp-internal-db/src/main/java/org/fireflyframework/security/idp/internaldb/config/InternalDbIdpAutoConfiguration.java @@ -19,7 +19,7 @@ import io.r2dbc.spi.ConnectionFactory; import lombok.extern.slf4j.Slf4j; import org.fireflyframework.security.idp.adapter.IdpAdapter; -import org.fireflyframework.security.idp.internaldb.adapter.InternalDbIdpAdapter; +import org.fireflyframework.security.idp.internaldb.adapter.InternalDbIdpAdapterImpl; import org.fireflyframework.security.idp.internaldb.repository.*; import org.fireflyframework.security.idp.internaldb.service.*; import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -190,7 +190,7 @@ public IdpAdapter internalDbIdpAdapter(AuthenticationService authenticationServi JwtTokenService jwtTokenService, PasswordResetService passwordResetService, MfaService mfaService) { - return new InternalDbIdpAdapter(authenticationService, userManagementService, + return new InternalDbIdpAdapterImpl(authenticationService, userManagementService, roleService, sessionRepository, jwtTokenService, passwordResetService, mfaService); } } diff --git a/modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpMetrics.java b/modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpMetricsImpl.java similarity index 96% rename from modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpMetrics.java rename to modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpMetricsImpl.java index 0df45af5a..a1af478c8 100644 --- a/modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpMetrics.java +++ b/modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpMetricsImpl.java @@ -32,13 +32,13 @@ *
  • {@code firefly.security.idp.errors} — failed IDP operations, tagged by {@code operation}, {@code error.type}
  • * */ -public class IdpMetrics extends FireflyMetricsSupport { +public class IdpMetricsImpl extends FireflyMetricsSupport { private static final String TAG_PROVIDER = "provider"; private static final String TAG_OPERATION = "operation"; private static final String TAG_TOKEN_TYPE = "token.type"; - public IdpMetrics(MeterRegistry meterRegistry) { + public IdpMetricsImpl(MeterRegistry meterRegistry) { super(meterRegistry, "idp"); } diff --git a/modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpObservabilityAutoConfiguration.java b/modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpObservabilityAutoConfiguration.java index 07d684648..7cbea886c 100644 --- a/modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpObservabilityAutoConfiguration.java +++ b/modules/security-idp/src/main/java/org/fireflyframework/security/idp/observability/IdpObservabilityAutoConfiguration.java @@ -37,7 +37,7 @@ public class IdpObservabilityAutoConfiguration { @Bean @ConditionalOnMissingBean @ConditionalOnBean(MeterRegistry.class) - IdpMetrics idpMetrics(MeterRegistry meterRegistry) { - return new IdpMetrics(meterRegistry); + IdpMetricsImpl idpMetrics(MeterRegistry meterRegistry) { + return new IdpMetricsImpl(meterRegistry); } } diff --git a/modules/security-method-policy/README.md b/modules/security-method-policy/README.md index 647b98816..11e33c61f 100644 --- a/modules/security-method-policy/README.md +++ b/modules/security-method-policy/README.md @@ -72,7 +72,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | | [`MethodSecurityAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/MethodSecurityAutoConfiguration.java) | Enables reactive method security (`@PreAuthorize`/`@PostAuthorize`) and registers the `Secure` interceptor so `@Secure` works as ergonomic, fail-closed sugar on top of it. | -| [`SecureMethodAuthorizationManager`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManager.java) | Reactive `ReactiveAuthorizationManager` that enforces the `Secure` annotation on methods (or their declaring class) using the framework's `SecureAuthorizationEvaluator`. | +| [`SecureMethodAuthorizationManagerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManagerImpl.java) | Reactive `ReactiveAuthorizationManager` that enforces the `Secure` annotation on methods (or their declaring class) using the framework's `SecureAuthorizationEvaluator`. | ## Continue the application diff --git a/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/MethodSecurityAutoConfiguration.java b/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/MethodSecurityAutoConfiguration.java index 7b77f6d56..cf546ba38 100644 --- a/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/MethodSecurityAutoConfiguration.java +++ b/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/MethodSecurityAutoConfiguration.java @@ -42,6 +42,6 @@ public AuthorizationManagerBeforeReactiveMethodInterceptor fireflySecureMethodIn Pointcut pointcut = new ComposablePointcut(new AnnotationMatchingPointcut(null, Secure.class, true)) .union(new AnnotationMatchingPointcut(Secure.class, true)); return new AuthorizationManagerBeforeReactiveMethodInterceptor( - pointcut, new SecureMethodAuthorizationManager(environment::resolvePlaceholders)); + pointcut, new SecureMethodAuthorizationManagerImpl(environment::resolvePlaceholders)); } } diff --git a/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManager.java b/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManagerImpl.java similarity index 93% rename from modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManager.java rename to modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManagerImpl.java index 1d84b7c51..ca327df53 100644 --- a/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManager.java +++ b/modules/security-method-policy/src/main/java/org/fireflyframework/security/method/SecureMethodAuthorizationManagerImpl.java @@ -41,16 +41,16 @@ * placeholders when wired by the auto-config), so services can externalise per-product authority names, * e.g. {@code @Secure(roles = "${idp.security.admin-role:idp-admin}")}. Literal values are unaffected.

    */ -public class SecureMethodAuthorizationManager implements ReactiveAuthorizationManager { +public class SecureMethodAuthorizationManagerImpl implements ReactiveAuthorizationManager { private final SecureAuthorizationEvaluator evaluator = new SecureAuthorizationEvaluator(); private final UnaryOperator valueResolver; - public SecureMethodAuthorizationManager() { + public SecureMethodAuthorizationManagerImpl() { this(UnaryOperator.identity()); } - public SecureMethodAuthorizationManager(UnaryOperator valueResolver) { + public SecureMethodAuthorizationManagerImpl(UnaryOperator valueResolver) { this.valueResolver = valueResolver == null ? UnaryOperator.identity() : valueResolver; } diff --git a/modules/security-oauth2-client/src/test/java/org/fireflyframework/security/client/OAuth2ClientProductionRegistrationTest.java b/modules/security-oauth2-client/src/test/java/org/fireflyframework/security/client/OAuth2ClientProductionRegistrationTest.java index a82fa4c8f..7f0225cd7 100644 --- a/modules/security-oauth2-client/src/test/java/org/fireflyframework/security/client/OAuth2ClientProductionRegistrationTest.java +++ b/modules/security-oauth2-client/src/test/java/org/fireflyframework/security/client/OAuth2ClientProductionRegistrationTest.java @@ -24,7 +24,7 @@ import java.util.concurrent.atomic.AtomicInteger; import org.fireflyframework.security.api.domain.Decision; import org.fireflyframework.security.api.domain.SecurityPrincipal; -import org.fireflyframework.security.rs.JwtToFireflyPrincipalConverter; +import org.fireflyframework.security.rs.JwtToFireflyPrincipalConverterImpl; import org.fireflyframework.security.rs.ResourceServerAutoConfiguration; import org.fireflyframework.security.spi.PolicyDecisionPort; import org.fireflyframework.security.webflux.authentication.FireflyAuthenticationToken; @@ -116,7 +116,7 @@ void outboundClientLeavesResourceServerJwtChainAndAnonymousDefaultDenialInPlace( assertThat(context).hasNotFailed().hasSingleBean(SecurityWebFilterChain.class); assertThat(context).hasBean("fireflySecurityWebFilterChain"); assertThat(context.getBean(ReactiveJwtDecoder.class)).isInstanceOf(NimbusReactiveJwtDecoder.class); - assertThat(context).hasSingleBean(JwtToFireflyPrincipalConverter.class); + assertThat(context).hasSingleBean(JwtToFireflyPrincipalConverterImpl.class); var chain = context.getBean(SecurityWebFilterChain.class); var filters = chain.getWebFilters().collectList().block(WAIT); assertThat(filters).noneMatch(filter -> filter.getClass().getName().contains("OAuth2Login") diff --git a/modules/security-resource-server/README.md b/modules/security-resource-server/README.md index 52c4ccc7a..b5b27d46c 100644 --- a/modules/security-resource-server/README.md +++ b/modules/security-resource-server/README.md @@ -64,7 +64,7 @@ class MeController { } ``` -Add ABAC/ReBAC decisions by contributing one or more `PolicyRule` beans; they are collected by the default `EmbeddedPolicyDecisionAdapter` and consulted on every non-permitted exchange, fail-closed: +Add ABAC/ReBAC decisions by contributing one or more `PolicyRule` beans; they are collected by the default `EmbeddedPolicyDecisionAdapterImpl` and consulted on every non-permitted exchange, fail-closed: ```java @Bean @@ -109,7 +109,7 @@ Legacy non-String coercion remains for compatibility: for example, numeric `17` | --- | --- | | [`ResourceServerAutoConfiguration`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/ResourceServerAutoConfiguration.java) | Auto-configures a secure-by-default reactive OAuth2 resource server. | | [`ResourceServerProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/ResourceServerProperties.java) | Configuration for the secure-by-default resource server. | -| [`JwtToFireflyPrincipalConverter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverter.java) | Converts a signature-validated `Jwt` into a `FireflyAuthenticationToken` whose principal is a `SecurityPrincipal` with normalized authorities/scopes. | +| [`JwtToFireflyPrincipalConverterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverterImpl.java) | Converts a signature-validated `Jwt` into a `FireflyAuthenticationToken` whose principal is a `SecurityPrincipal` with normalized authorities/scopes. | ## Continue the application diff --git a/modules/security-resource-server/docs/live-active-state-admission.md b/modules/security-resource-server/docs/live-active-state-admission.md index b3b987138..50dcf56c5 100644 --- a/modules/security-resource-server/docs/live-active-state-admission.md +++ b/modules/security-resource-server/docs/live-active-state-admission.md @@ -34,7 +34,7 @@ The owned client uses an explicit HTTPS endpoint with ordinary platform trust/ho ## Custom security chains -The default Jafly chain wraps its injected decoder in LIVE mode. An application that completely replaces SecurityWebFilterChain must explicitly use `new LiveActiveJwtDecoder(localDecoder, livePort, properties)` in its own native Spring JWT DSL and qualify actual protected routes. A property or port bean alone cannot prove arbitrary custom-chain adoption. The retained direct five-argument default-chain factory supports LOCAL_JWT; it refuses a LIVE request without the explicit port. +The default Jafly chain wraps its injected decoder in LIVE mode. An application that completely replaces SecurityWebFilterChain must explicitly use `new LiveActiveJwtDecoderImpl(localDecoder, livePort, properties)` in its own native Spring JWT DSL and qualify actual protected routes. A property or port bean alone cannot prove arbitrary custom-chain adoption. The retained direct five-argument default-chain factory supports LOCAL_JWT; it refuses a LIVE request without the explicit port. ## Deployment verification diff --git a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverter.java b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverterImpl.java similarity index 92% rename from modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverter.java rename to modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverterImpl.java index e7bb56845..9d4d65672 100644 --- a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverter.java +++ b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/JwtToFireflyPrincipalConverterImpl.java @@ -34,17 +34,17 @@ * principal is a {@link SecurityPrincipal} with normalized authorities/scopes. This replaces * Spring's default {@code JwtAuthenticationToken} so application code gets the rich principal. */ -public class JwtToFireflyPrincipalConverter implements Converter> { +public class JwtToFireflyPrincipalConverterImpl implements Converter> { private final PrincipalFactory principalFactory; private final TenantResolverPort tenantResolver; private final boolean tenantRequired; - public JwtToFireflyPrincipalConverter(PrincipalFactory principalFactory) { + public JwtToFireflyPrincipalConverterImpl(PrincipalFactory principalFactory) { this(principalFactory, null, false); } - public JwtToFireflyPrincipalConverter(PrincipalFactory principalFactory, + public JwtToFireflyPrincipalConverterImpl(PrincipalFactory principalFactory, TenantResolverPort tenantResolver, boolean tenantRequired) { this.principalFactory = Objects.requireNonNull(principalFactory); if (tenantRequired && tenantResolver == null) { diff --git a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveActiveJwtDecoder.java b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveActiveJwtDecoderImpl.java similarity index 97% rename from modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveActiveJwtDecoder.java rename to modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveActiveJwtDecoderImpl.java index 7e0da935d..c55d02c66 100644 --- a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveActiveJwtDecoder.java +++ b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveActiveJwtDecoderImpl.java @@ -35,19 +35,19 @@ import java.util.function.LongSupplier; /** Adds uncached current-state admission to a locally verified JWT without replacing its claims. */ -public final class LiveActiveJwtDecoder implements ReactiveJwtDecoder { +public final class LiveActiveJwtDecoderImpl implements ReactiveJwtDecoder { private final ReactiveJwtDecoder local; private final TokenValidationPort live; private final Settings settings; private final Clock clock; private final LongSupplier nanos; - public LiveActiveJwtDecoder(ReactiveJwtDecoder local, TokenValidationPort live, + public LiveActiveJwtDecoderImpl(ReactiveJwtDecoder local, TokenValidationPort live, ResourceServerProperties properties) { this(local, live, properties, Clock.systemUTC(), System::nanoTime); } - public LiveActiveJwtDecoder(ReactiveJwtDecoder local, TokenValidationPort live, + public LiveActiveJwtDecoderImpl(ReactiveJwtDecoder local, TokenValidationPort live, ResourceServerProperties properties, Clock clock, LongSupplier nanos) { this.local = Objects.requireNonNull(local); this.live = Objects.requireNonNull(live); diff --git a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuard.java b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuardImpl.java similarity index 96% rename from modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuard.java rename to modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuardImpl.java index b048b7190..7e6cdb2ce 100644 --- a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuard.java +++ b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuardImpl.java @@ -38,7 +38,7 @@ import java.util.HashSet; /** Validates bounded wire types before the native introspector performs claim coercion. */ -public final class LiveIntrospectionResponseGuard implements ExchangeFilterFunction { +public final class LiveIntrospectionResponseGuardImpl implements ExchangeFilterFunction { public static final int MAX_RESPONSE_BYTES = 16 * 1024; private final JsonMapper mapper = JsonMapper.builder(JsonFactory.builder() .enable(StreamReadFeature.STRICT_DUPLICATE_DETECTION) @@ -65,7 +65,7 @@ public Mono filter(ClientRequest request, ExchangeFunction next) if (response.statusCode().value() != 200) { throw refused(); } - MediaType type = response.headers().contentType().orElseThrow(LiveIntrospectionResponseGuard::refused); + MediaType type = response.headers().contentType().orElseThrow(LiveIntrospectionResponseGuardImpl::refused); if (!MediaType.APPLICATION_JSON.isCompatibleWith(type) || (type.getCharset() != null && !StandardCharsets.UTF_8.equals(type.getCharset()))) { throw refused(); @@ -126,7 +126,7 @@ private static String string(JsonNode node) { if (node == null || !node.isString()) { throw refused(); } - return LiveActiveJwtDecoder.text(node.stringValue()); + return LiveActiveJwtDecoderImpl.text(node.stringValue()); } private static void time(JsonNode node) { diff --git a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/ResourceServerAutoConfiguration.java b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/ResourceServerAutoConfiguration.java index b10ab3263..864ebb741 100644 --- a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/ResourceServerAutoConfiguration.java +++ b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/ResourceServerAutoConfiguration.java @@ -19,13 +19,13 @@ import org.fireflyframework.security.api.domain.SigningKey; import org.fireflyframework.security.api.domain.Decision; import org.fireflyframework.security.core.authority.AuthorityMappingProperties; -import org.fireflyframework.security.core.authority.ConfigurableAuthorityMapper; -import org.fireflyframework.security.core.audit.LoggingAuditEventAdapter; +import org.fireflyframework.security.core.authority.ConfigurableAuthorityMapperImpl; +import org.fireflyframework.security.core.audit.LoggingAuditEventAdapterImpl; import org.fireflyframework.security.core.context.PrincipalFactory; -import org.fireflyframework.security.core.key.InMemoryKeyManagementAdapter; -import org.fireflyframework.security.core.policy.EmbeddedPolicyDecisionAdapter; +import org.fireflyframework.security.core.key.InMemoryKeyManagementAdapterImpl; +import org.fireflyframework.security.core.policy.EmbeddedPolicyDecisionAdapterImpl; import org.fireflyframework.security.core.policy.PolicyRule; -import org.fireflyframework.security.core.tenant.ConfigurableTenantResolver; +import org.fireflyframework.security.core.tenant.ConfigurableTenantResolverImpl; import org.fireflyframework.security.spi.AuditEventPort; import org.fireflyframework.security.spi.AuthorityMappingPort; import org.fireflyframework.security.spi.KeyManagementPort; @@ -33,8 +33,8 @@ import org.fireflyframework.security.spi.SecurityContextPort; import org.fireflyframework.security.spi.TokenValidationPort; import org.fireflyframework.security.webflux.authentication.FireflyAuthenticationToken; -import org.fireflyframework.security.webflux.authz.PolicyAuthorizationManager; -import org.fireflyframework.security.webflux.context.ReactorSecurityContextAdapter; +import org.fireflyframework.security.webflux.authz.PolicyAuthorizationManagerImpl; +import org.fireflyframework.security.webflux.context.ReactorSecurityContextAdapterImpl; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -82,13 +82,13 @@ public class ResourceServerAutoConfiguration { @Bean @ConditionalOnMissingBean public KeyManagementPort fireflyKeyManagementPort() { - return new InMemoryKeyManagementAdapter(); + return new InMemoryKeyManagementAdapterImpl(); } @Bean @ConditionalOnMissingBean public AuthorityMappingPort fireflyAuthorityMappingPort(ResourceServerProperties properties) { - return new ConfigurableAuthorityMapper(new AuthorityMappingProperties( + return new ConfigurableAuthorityMapperImpl(new AuthorityMappingProperties( properties.getRoleClaimPaths(), properties.getScopeClaimPaths(), properties.getAuthorityPrefix())); } @@ -102,7 +102,7 @@ public PrincipalFactory fireflyPrincipalFactory(AuthorityMappingPort authorityMa @ConditionalOnMissingBean public PolicyDecisionPort fireflyPolicyDecisionPort(ObjectProvider rules, ResourceServerProperties properties) { - return new EmbeddedPolicyDecisionAdapter(rules.orderedStream().toList(), properties.isStrictPolicy()); + return new EmbeddedPolicyDecisionAdapterImpl(rules.orderedStream().toList(), properties.isStrictPolicy()); } /** Preserves direct factory callers that explicitly rely on the legacy RBAC deferral. */ @@ -113,13 +113,13 @@ public PolicyDecisionPort fireflyPolicyDecisionPort(ObjectProvider r @Bean @ConditionalOnMissingBean public AuditEventPort fireflyAuditEventPort() { - return new LoggingAuditEventAdapter(); + return new LoggingAuditEventAdapterImpl(); } @Bean @ConditionalOnMissingBean public SecurityContextPort fireflySecurityContextPort() { - return new ReactorSecurityContextAdapter(); + return new ReactorSecurityContextAdapterImpl(); } @Bean @@ -135,10 +135,10 @@ public Converter> fireflyJwtAuthenticatio if (properties.isTenantRequired()) { throw new IllegalArgumentException("Required tenant projection needs configured claim paths"); } - return new JwtToFireflyPrincipalConverter(principalFactory); + return new JwtToFireflyPrincipalConverterImpl(principalFactory); } - return new JwtToFireflyPrincipalConverter(principalFactory, - new ConfigurableTenantResolver(paths), properties.isTenantRequired()); + return new JwtToFireflyPrincipalConverterImpl(principalFactory, + new ConfigurableTenantResolverImpl(paths), properties.isTenantRequired()); } /** Preserves direct callers that use the unconfigured single-tenant projection. */ @@ -192,8 +192,8 @@ private static List> buildValidators(ResourceServerPro @Bean(destroyMethod = "close") @ConditionalOnMissingBean(TokenValidationPort.class) @ConditionalOnProperty(prefix = "firefly.security.resource-server", name = "admission-mode", havingValue = "LIVE") - public SpringLiveTokenValidationAdapter fireflyLiveTokenValidationPort(ResourceServerProperties properties) { - return SpringLiveTokenValidationAdapter.create(properties); + public SpringLiveTokenValidationAdapterImpl fireflyLiveTokenValidationPort(ResourceServerProperties properties) { + return SpringLiveTokenValidationAdapterImpl.create(properties); } /** Retains the direct LOCAL factory API; LIVE callers must supply the explicit port. */ @@ -221,7 +221,7 @@ public SecurityWebFilterChain fireflySecurityWebFilterChain( ReactiveJwtDecoder selected = jwtDecoder; if (properties.getAdmissionMode() == ResourceServerProperties.JwtAdmissionMode.LIVE) { TokenValidationPort live = livePorts.getObject(); - selected = new LiveActiveJwtDecoder(jwtDecoder, live, properties); + selected = new LiveActiveJwtDecoderImpl(jwtDecoder, live, properties); } else if (properties.getAdmissionMode() != ResourceServerProperties.JwtAdmissionMode.LOCAL_JWT) { throw new IllegalArgumentException("A valid JWT admission mode is required"); } @@ -242,7 +242,7 @@ private SecurityWebFilterChain buildSecurityWebFilterChain( .map(decision -> decision.obligations().isEmpty() ? decision : Decision.deny("URL enforcement cannot fulfill policy obligations")) : policyDecisionPort; - PolicyAuthorizationManager policyManager = new PolicyAuthorizationManager(urlPolicy); + PolicyAuthorizationManagerImpl policyManager = new PolicyAuthorizationManagerImpl(urlPolicy); http .securityContextRepository(NoOpServerSecurityContextRepository.getInstance()) diff --git a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapter.java b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapterImpl.java similarity index 84% rename from modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapter.java rename to modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapterImpl.java index 8bed1f5b2..ef399967d 100644 --- a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapter.java +++ b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapterImpl.java @@ -45,42 +45,42 @@ import java.util.concurrent.atomic.AtomicBoolean; /** An uncached native Spring introspection client. Provider revocation behavior needs separate acceptance. */ -public final class SpringLiveTokenValidationAdapter implements TokenValidationPort, AutoCloseable { +public final class SpringLiveTokenValidationAdapterImpl implements TokenValidationPort, AutoCloseable { private final ReactiveOpaqueTokenIntrospector introspector; - private final LiveActiveJwtDecoder.Settings settings; + private final LiveActiveJwtDecoderImpl.Settings settings; private final Clock clock; private final HttpClient ownedClient; private final AtomicBoolean closed = new AtomicBoolean(); /** The supplied introspector must perform an uncached current-state exchange for each call. */ - public SpringLiveTokenValidationAdapter(ReactiveOpaqueTokenIntrospector introspector, + public SpringLiveTokenValidationAdapterImpl(ReactiveOpaqueTokenIntrospector introspector, ResourceServerProperties properties) { this(introspector, properties, Clock.systemUTC()); } - public SpringLiveTokenValidationAdapter(ReactiveOpaqueTokenIntrospector introspector, + public SpringLiveTokenValidationAdapterImpl(ReactiveOpaqueTokenIntrospector introspector, ResourceServerProperties properties, Clock clock) { - this(introspector, LiveActiveJwtDecoder.Settings.from(properties), clock, null); + this(introspector, LiveActiveJwtDecoderImpl.Settings.from(properties), clock, null); } - private SpringLiveTokenValidationAdapter(ReactiveOpaqueTokenIntrospector introspector, - LiveActiveJwtDecoder.Settings settings, Clock clock, HttpClient ownedClient) { + private SpringLiveTokenValidationAdapterImpl(ReactiveOpaqueTokenIntrospector introspector, + LiveActiveJwtDecoderImpl.Settings settings, Clock clock, HttpClient ownedClient) { this.introspector = Objects.requireNonNull(introspector); this.settings = settings; this.clock = Objects.requireNonNull(clock); this.ownedClient = ownedClient; } - public static SpringLiveTokenValidationAdapter create(ResourceServerProperties properties) { - var settings = LiveActiveJwtDecoder.Settings.from(properties); + public static SpringLiveTokenValidationAdapterImpl create(ResourceServerProperties properties) { + var settings = LiveActiveJwtDecoderImpl.Settings.from(properties); var live = properties.getLiveState(); URI endpoint; String clientId; String secret; try { - endpoint = URI.create(LiveActiveJwtDecoder.text(live.getIntrospectionUri())); - clientId = LiveActiveJwtDecoder.text(live.getIntrospectionClientId()); - secret = LiveActiveJwtDecoder.text(live.getIntrospectionClientSecret()); + endpoint = URI.create(LiveActiveJwtDecoderImpl.text(live.getIntrospectionUri())); + clientId = LiveActiveJwtDecoderImpl.text(live.getIntrospectionClientId()); + secret = LiveActiveJwtDecoderImpl.text(live.getIntrospectionClientSecret()); if (!"https".equals(endpoint.getScheme()) || endpoint.getHost() == null || endpoint.getRawUserInfo() != null || endpoint.getRawQuery() != null || endpoint.getRawFragment() != null || endpoint.getPort() == 0 || endpoint.getPort() > 65535) { @@ -95,7 +95,7 @@ public static SpringLiveTokenValidationAdapter create(ResourceServerProperties p JdkClientHttpConnector connector = new JdkClientHttpConnector(client); connector.setReadTimeout(settings.timeout()); WebClient webClient = ownedWebClientBuilder(connector, clientId, secret).build(); - return new SpringLiveTokenValidationAdapter(new SpringReactiveOpaqueTokenIntrospector(endpoint.toASCIIString(), webClient), + return new SpringLiveTokenValidationAdapterImpl(new SpringReactiveOpaqueTokenIntrospector(endpoint.toASCIIString(), webClient), settings, Clock.systemUTC(), client); } catch (RuntimeException error) { client.shutdownNow(); @@ -132,10 +132,10 @@ public Mono validateLive(BearerToken token) { } // Copy and validate the allowed tuple; arbitrary provider attributes never become authentication claims. var principal = SecurityPrincipal.builder() - .issuer(LiveActiveJwtDecoder.text(claims.get("iss"))) - .subject(LiveActiveJwtDecoder.text(claims.get("sub"))) + .issuer(LiveActiveJwtDecoderImpl.text(claims.get("iss"))) + .subject(LiveActiveJwtDecoderImpl.text(claims.get("sub"))) .claims(claims).build(); - var binding = LiveActiveJwtDecoder.Binding.remote(principal, settings); + var binding = LiveActiveJwtDecoderImpl.Binding.remote(principal, settings); if (!clock.instant().isBefore(binding.expiration()) || closed.get()) { throw refused(); } @@ -161,14 +161,14 @@ public void close() { static WebClient.Builder ownedWebClientBuilder(ClientHttpConnector connector, String clientId, String secret) { return WebClient.builder().clientConnector(connector) .codecs(codecs -> { - codecs.defaultCodecs().maxInMemorySize(LiveIntrospectionResponseGuard.MAX_RESPONSE_BYTES); + codecs.defaultCodecs().maxInMemorySize(LiveIntrospectionResponseGuardImpl.MAX_RESPONSE_BYTES); codecs.defaultCodecs().enableLoggingRequestDetails(false); codecs.defaultCodecs().jacksonJsonDecoder(nativeJsonDecoder()); }) .defaultHeaders(headers -> headers.setBasicAuth( URLEncoder.encode(clientId, StandardCharsets.UTF_8), URLEncoder.encode(secret, StandardCharsets.UTF_8))) - .filter(new LiveIntrospectionResponseGuard()); + .filter(new LiveIntrospectionResponseGuardImpl()); } static JacksonJsonDecoder nativeJsonDecoder() { diff --git a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveActiveJwtDecoderTest.java b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveActiveJwtDecoderTest.java index b8a989f20..19b551331 100644 --- a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveActiveJwtDecoderTest.java +++ b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveActiveJwtDecoderTest.java @@ -26,7 +26,7 @@ class LiveActiveJwtDecoderTest { Jwt jwt(){return Jwt.withTokenValue("a.b.c").header("alg","RS256").issuer(ISSUER).subject("opaque:staff/subject").audience(List.of("resource")).issuedAt(NOW.minusSeconds(1)).expiresAt(NOW.plusSeconds(120)).claim("azp","workforce-client").claim("jti","opaque-token-id").build();} SecurityPrincipal live(Map changed){var c=new HashMap(Map.of("iss",ISSUER,"sub","opaque:staff/subject","aud",List.of("resource"),"exp",NOW.plusSeconds(120),"client_id","workforce-client","jti","opaque-token-id"));c.putAll(changed);return SecurityPrincipal.builder().issuer((String)c.get("iss")).subject((String)c.get("sub")).claims(c).authorities(Set.of()).scopes(Set.of()).attributes(Map.of()).build();} TokenValidationPort port(java.util.function.Function> answer){return new TokenValidationPort(){public Mono validate(BearerToken token){throw new AssertionError("Legacy validation is not LIVE");}public Mono validateLive(BearerToken token){liveCalls.incrementAndGet();assertEquals("a.b.c",token.value());return answer.apply(token);}};} - LiveActiveJwtDecoder decoder(ReactiveJwtDecoder local,TokenValidationPort port){return new LiveActiveJwtDecoder(local,port,properties(),Clock.fixed(NOW,ZoneOffset.UTC),nanos::get);} + LiveActiveJwtDecoderImpl decoder(ReactiveJwtDecoder local,TokenValidationPort port){return new LiveActiveJwtDecoderImpl(local,port,properties(),Clock.fixed(NOW,ZoneOffset.UTC),nanos::get);} @Test void returnsTheExactLocallyVerifiedJwtWithoutClaimOrRoleMerge(){var verified=jwt();var d=decoder(token->Mono.just(verified),port(token->Mono.just(live(Map.of()))));assertSame(verified,d.decode("a.b.c").block());assertFalse(verified.getClaims().containsKey("client_id"));assertEquals(1,liveCalls.get());} @Test void localFailureNeverInvokesTheLiveProvider(){var d=decoder(token->Mono.error(new BadJwtException("PRIVATE_LOCAL_FAILURE")),port(token->Mono.just(live(Map.of()))));StepVerifier.create(d.decode("a.b.c")).expectErrorSatisfies(e->{assertInstanceOf(BadJwtException.class,e);assertNull(e.getCause());assertFalse(e.toString().contains("PRIVATE"));}).verify();assertEquals(0,liveCalls.get());} @Test void emptyLocalOrLivePublisherCannotAuthenticate(){StepVerifier.create(decoder(token->Mono.empty(),port(token->Mono.just(live(Map.of())))).decode("a.b.c")).expectError(BadJwtException.class).verify();assertEquals(0,liveCalls.get());StepVerifier.create(decoder(token->Mono.just(jwt()),port(token->Mono.empty())).decode("a.b.c")).expectError(BadJwtException.class).verify();} @@ -34,22 +34,22 @@ class LiveActiveJwtDecoderTest { @Test void boundIssuerSubjectClientAudienceExpiryAndTokenIdMustMatch(){for(var changed:List.>of(Map.of("iss","https://other.invalid"),Map.of("sub","other-subject"),Map.of("client_id","other-client"),Map.of("aud",List.of("other-resource")),Map.of("exp",NOW.plusSeconds(121)),Map.of("jti","other-token"))){StepVerifier.create(decoder(token->Mono.just(jwt()),port(token->Mono.just(live(changed)))).decode("a.b.c")).expectError(BadJwtException.class).verify();}} @Test void originalMonotonicWindowCannotBeResetByLateLiveSuccess(){var d=decoder(token->Mono.just(jwt()),port(token->Mono.fromSupplier(()->{nanos.set(Duration.ofSeconds(6).toNanos());return live(Map.of());})));StepVerifier.create(d.decode("a.b.c")).expectError(BadJwtException.class).verify();} @Test void unsupportedLegacyPortCannotFallBackToTheLocalJwt(){TokenValidationPort legacy=token->Mono.just(live(Map.of()));StepVerifier.create(decoder(token->Mono.just(jwt()),legacy).decode("a.b.c")).expectError(BadJwtException.class).verify();} - @Test void missingOrOversizeLiveConfigurationRefuses(){var p=properties();p.getLiveState().setTimeout(Duration.ofSeconds(6));assertThrows(IllegalArgumentException.class,()->new LiveActiveJwtDecoder(token->Mono.just(jwt()),port(token->Mono.just(live(Map.of()))),p));} - @Test void propertiesAreSnapshottedInsteadOfChangingAnInflightAdmission(){var p=properties();var verified=jwt();var d=new LiveActiveJwtDecoder(token->Mono.just(verified),port(token->Mono.just(live(Map.of()))),p,Clock.fixed(NOW,ZoneOffset.UTC),nanos::get);p.getLiveState().setAllowedClients(List.of("other-client"));p.setIssuer("https://other.invalid");assertSame(verified,d.decode("a.b.c").block());} + @Test void missingOrOversizeLiveConfigurationRefuses(){var p=properties();p.getLiveState().setTimeout(Duration.ofSeconds(6));assertThrows(IllegalArgumentException.class,()->new LiveActiveJwtDecoderImpl(token->Mono.just(jwt()),port(token->Mono.just(live(Map.of()))),p));} + @Test void propertiesAreSnapshottedInsteadOfChangingAnInflightAdmission(){var p=properties();var verified=jwt();var d=new LiveActiveJwtDecoderImpl(token->Mono.just(verified),port(token->Mono.just(live(Map.of()))),p,Clock.fixed(NOW,ZoneOffset.UTC),nanos::get);p.getLiveState().setAllowedClients(List.of("other-client"));p.setIssuer("https://other.invalid");assertSame(verified,d.decode("a.b.c").block());} @Test void cancellationCannotPublishALateAuthentication(){var sink=reactor.core.publisher.Sinks.one();var subscribed=new AtomicBoolean();var cancelled=new AtomicBoolean();var authenticated=new AtomicInteger();var d=decoder(token->Mono.just(jwt()),port(token->sink.asMono().doOnSubscribe(ignored->subscribed.set(true)).doOnCancel(()->cancelled.set(true))));StepVerifier.create(d.decode("a.b.c").doOnNext(ignored->authenticated.incrementAndGet()),0).thenRequest(1).then(()->{assertTrue(subscribed.get());assertEquals(1,liveCalls.get());}).thenCancel().verify();assertTrue(cancelled.get());sink.tryEmitValue(live(Map.of()));assertEquals(0,authenticated.get());} @Test void originalVerifiedExpirationStillBoundsALateLiveReply(){ var clock=new AtomicReference<>(NOW);Clock advancing=new Clock(){public ZoneId getZone(){return ZoneOffset.UTC;}public Clock withZone(ZoneId zone){return this;}public Instant instant(){return clock.get();}}; - var d=new LiveActiveJwtDecoder(token->Mono.just(jwt()),port(token->Mono.fromSupplier(()->{clock.set(NOW.plusSeconds(121));return live(Map.of());})),properties(),advancing,nanos::get); + var d=new LiveActiveJwtDecoderImpl(token->Mono.just(jwt()),port(token->Mono.fromSupplier(()->{clock.set(NOW.plusSeconds(121));return live(Map.of());})),properties(),advancing,nanos::get); StepVerifier.create(d.decode("a.b.c")).expectError(BadJwtException.class).verify(); } @Test void wrongClaimAliasMissingIssuerAndMalformedOpaqueIdentityCannotBeInferred(){ - for(var change:List.>of(p->p.getLiveState().setTokenClientClaim("client_id"),p->p.setIssuer(null),p->p.getLiveState().setAllowedClients(List.of()))){var p=properties();change.accept(p);try{var d=new LiveActiveJwtDecoder(token->Mono.just(jwt()),port(token->Mono.just(live(Map.of()))),p,Clock.fixed(NOW,ZoneOffset.UTC),nanos::get);StepVerifier.create(d.decode("a.b.c")).expectError(BadJwtException.class).verify();}catch(IllegalArgumentException expected){assertNotNull(expected.getMessage());}} + for(var change:List.>of(p->p.getLiveState().setTokenClientClaim("client_id"),p->p.setIssuer(null),p->p.getLiveState().setAllowedClients(List.of()))){var p=properties();change.accept(p);try{var d=new LiveActiveJwtDecoderImpl(token->Mono.just(jwt()),port(token->Mono.just(live(Map.of()))),p,Clock.fixed(NOW,ZoneOffset.UTC),nanos::get);StepVerifier.create(d.decode("a.b.c")).expectError(BadJwtException.class).verify();}catch(IllegalArgumentException expected){assertNotNull(expected.getMessage());}} StepVerifier.create(decoder(token->Mono.just(jwt()),port(token->Mono.just(live(Map.of("sub","opaque\nsubject"))))).decode("a.b.c")).expectError(BadJwtException.class).verify(); } @Test void nonCompletingLivePublisherUsesTheOriginalTimeoutAndCancels(){ var fixture=properties();fixture.getLiveState().setTimeout(Duration.ofSeconds(1));var cancelled=new AtomicBoolean(); - StepVerifier.withVirtualTime(()->new LiveActiveJwtDecoder(token->Mono.just(jwt()),port(token->Mono.never().doOnCancel(()->cancelled.set(true))),fixture,Clock.fixed(NOW,ZoneOffset.UTC),nanos::get).decode("a.b.c")) + StepVerifier.withVirtualTime(()->new LiveActiveJwtDecoderImpl(token->Mono.just(jwt()),port(token->Mono.never().doOnCancel(()->cancelled.set(true))),fixture,Clock.fixed(NOW,ZoneOffset.UTC),nanos::get).decode("a.b.c")) .thenAwait(Duration.ofSeconds(2)).expectError(BadJwtException.class).verify();assertTrue(cancelled.get()); } diff --git a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveIntrospectionPrivacyTest.java b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveIntrospectionPrivacyTest.java index cf57bda73..ff6d9d057 100644 --- a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveIntrospectionPrivacyTest.java +++ b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveIntrospectionPrivacyTest.java @@ -28,7 +28,7 @@ class LiveIntrospectionPrivacyTest { var capture = new ListAppender(); capture.start(); var previous = logger.getLevel(); logger.setLevel(Level.TRACE); logger.addAppender(capture); try { - var codec = SpringLiveTokenValidationAdapter.nativeJsonDecoder(); + var codec = SpringLiveTokenValidationAdapterImpl.nativeJsonDecoder(); var type = ResolvableType.forClass(Map.class); var factory = DefaultDataBufferFactory.sharedInstance; byte[] bytes = "{\"private-key\":\"PRIVATE_PROVIDER_BODY\"}".getBytes(StandardCharsets.UTF_8); @@ -64,12 +64,12 @@ class LiveIntrospectionPrivacyTest { return (org.springframework.http.client.reactive.ClientHttpResponse)response; }); }; - WebClient.Builder builder = SpringLiveTokenValidationAdapter.ownedWebClientBuilder(connector, "PRIVATE_CLIENT", "PRIVATE_SECRET"); + WebClient.Builder builder = SpringLiveTokenValidationAdapterImpl.ownedWebClientBuilder(connector, "PRIVATE_CLIENT", "PRIVATE_SECRET"); builder.filter((request, next) -> next.exchange(request).doOnNext(response -> originalStrategies.set(response.strategies()))); builder.filters(filters -> filters.addFirst((request, next) -> next.exchange(request) .doOnNext(response -> assertSame(originalStrategies.get(), response.strategies())))); WebClient webClient = builder.build(); - var adapter = new SpringLiveTokenValidationAdapter(new SpringReactiveOpaqueTokenIntrospector("https://issuer.invalid/introspect", webClient), + var adapter = new SpringLiveTokenValidationAdapterImpl(new SpringReactiveOpaqueTokenIntrospector("https://issuer.invalid/introspect", webClient), new LiveActiveJwtDecoderTest().properties(), Clock.fixed(LiveActiveJwtDecoderTest.NOW, ZoneOffset.UTC)); try { var principal = adapter.validateLive(BearerToken.of("PRIVATE_RAW_TOKEN.x.y")).block(); diff --git a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuardTest.java b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuardTest.java index a70cdf7e7..207849a6e 100644 --- a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuardTest.java +++ b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveIntrospectionResponseGuardTest.java @@ -39,7 +39,7 @@ class LiveIntrospectionResponseGuardTest { static final String VALID = "{\"active\":true,\"iss\":\"https://issuer.invalid\",\"sub\":\"opaque:staff/subject\",\"aud\":[\"resource\"],\"client_id\":\"workforce-client\",\"exp\":1793448120,\"jti\":\"opaque-token-id\"}"; final NettyDataBufferFactory buffers = new NettyDataBufferFactory(PooledByteBufAllocator.DEFAULT); - final LiveIntrospectionResponseGuard guard = new LiveIntrospectionResponseGuard(); + final LiveIntrospectionResponseGuardImpl guard = new LiveIntrospectionResponseGuardImpl(); final ClientRequest request = ClientRequest.create(HttpMethod.POST, URI.create("https://issuer.invalid/introspect")).build(); Mono guard(byte[] bytes, HttpStatus status, List allocated) { @@ -138,7 +138,7 @@ void refused(String body) { .body(VALID.substring(0, VALID.length()-1) + ",\"scope\":\"admin\",\"PRIVATE_EXTRA\":\"PRIVATE_BODY\"}").build(); }); var p = new LiveActiveJwtDecoderTest().properties(); - var adapter = new SpringLiveTokenValidationAdapter(new SpringReactiveOpaqueTokenIntrospector("https://issuer.invalid/introspect", client), p, + var adapter = new SpringLiveTokenValidationAdapterImpl(new SpringReactiveOpaqueTokenIntrospector("https://issuer.invalid/introspect", client), p, Clock.fixed(LiveActiveJwtDecoderTest.NOW, ZoneOffset.UTC)); for (int i = 0; i < 2; i++) { var principal = adapter.validateLive(BearerToken.of("a.b.c")).block(); @@ -177,13 +177,13 @@ void refused(String body) { token -> Mono.empty(), token -> Mono.error(new IllegalStateException("PRIVATE_PROVIDER_ERROR")), token -> Mono.just(new org.springframework.security.oauth2.core.DefaultOAuth2AuthenticatedPrincipal(Map.of("active",false),List.of()))); for (var nativePort : cases) { - var adapter = new SpringLiveTokenValidationAdapter(nativePort,p,Clock.fixed(LiveActiveJwtDecoderTest.NOW,ZoneOffset.UTC)); + var adapter = new SpringLiveTokenValidationAdapterImpl(nativePort,p,Clock.fixed(LiveActiveJwtDecoderTest.NOW,ZoneOffset.UTC)); try { StepVerifier.create(adapter.validateLive(BearerToken.of("a.b.c"))).expectErrorSatisfies(error -> {assertNull(error.getCause());assertFalse(error.toString().contains("PRIVATE"));}).verify(); } finally { adapter.close(); } } } WebClient client(java.util.function.Supplier response) { - return WebClient.builder().codecs(codecs -> codecs.defaultCodecs().jacksonJsonDecoder(SpringLiveTokenValidationAdapter.nativeJsonDecoder())) + return WebClient.builder().codecs(codecs -> codecs.defaultCodecs().jacksonJsonDecoder(SpringLiveTokenValidationAdapterImpl.nativeJsonDecoder())) .exchangeFunction(unused -> Mono.fromSupplier(response)).filter(guard).build(); } } diff --git a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveJwtChainAdoptionTest.java b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveJwtChainAdoptionTest.java index 3550afd59..9f1aae526 100644 --- a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveJwtChainAdoptionTest.java +++ b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveJwtChainAdoptionTest.java @@ -81,7 +81,7 @@ class LiveJwtChainAdoptionTest { @Test void customChainsMustExplicitlyUseThePublicDecorator() { var fixture = new LiveActiveJwtDecoderTest(); var properties = fixture.properties(); TokenValidationPort legacyOnly = token -> Mono.just(fixture.live(Map.of())); - var live = new LiveActiveJwtDecoder(raw -> Mono.just(currentJwt()), legacyOnly, properties); + var live = new LiveActiveJwtDecoderImpl(raw -> Mono.just(currentJwt()), legacyOnly, properties); var chain = oldChain(new ResourceServerProperties(), live); request(chain).get().uri("/private").header(HttpHeaders.AUTHORIZATION, "Bearer a.b.c") .exchange().expectStatus().isUnauthorized(); @@ -97,10 +97,10 @@ class LiveJwtChainAdoptionTest { "firefly.security.resource-server.live-state.allowed-clients[0]=workforce-client", "firefly.security.resource-server.live-state.token-client-claim=azp") .run(context -> { assertThat(context).hasNotFailed().hasSingleBean(TokenValidationPort.class); - assertThat(context).doesNotHaveBean(SpringLiveTokenValidationAdapter.class); }); + assertThat(context).doesNotHaveBean(SpringLiveTokenValidationAdapterImpl.class); }); } @Test void missingNativeClientSettingsFailBeforeTransportAllocation() { - assertThrows(IllegalArgumentException.class, () -> SpringLiveTokenValidationAdapter.create(new LiveActiveJwtDecoderTest().properties())); + assertThrows(IllegalArgumentException.class, () -> SpringLiveTokenValidationAdapterImpl.create(new LiveActiveJwtDecoderTest().properties())); } static class ProjectPort { @Bean ReactiveJwtDecoder customDecoder() { return raw -> Mono.just(currentJwt()); } @@ -113,7 +113,7 @@ static Jwt currentJwt() { } static org.springframework.core.convert.converter.Converter> converter() { return new ResourceServerAutoConfiguration().fireflyJwtAuthenticationConverter(new PrincipalFactory( - new ConfigurableAuthorityMapper(new AuthorityMappingProperties(List.of(), List.of(), "")))); + new ConfigurableAuthorityMapperImpl(new AuthorityMappingProperties(List.of(), List.of(), "")))); } SecurityWebFilterChain oldChain(ResourceServerProperties p, ReactiveJwtDecoder decoder) { return new ResourceServerAutoConfiguration().fireflySecurityWebFilterChain(ServerHttpSecurity.http(), decoder, diff --git a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveJwtNativeVerificationTest.java b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveJwtNativeVerificationTest.java index 66b728bfd..5219501fa 100644 --- a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveJwtNativeVerificationTest.java +++ b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/LiveJwtNativeVerificationTest.java @@ -50,7 +50,7 @@ public Mono validateLive(org.fireflyframework.security.api.do "exp", jwt.getExpiresAt(), "client_id", "workforce-client", "jti", "opaque-token-id")).build()); } }; - var decoder = new LiveActiveJwtDecoder(raw -> local.decode(raw).doOnNext(received::set), live, properties); + var decoder = new LiveActiveJwtDecoderImpl(raw -> local.decode(raw).doOnNext(received::set), live, properties); String valid = sign(pair, LiveActiveJwtDecoderTest.ISSUER, Instant.now().plusSeconds(120)); assertSame(receivedValue(decoder, valid), received.get()); assertEquals(1, calls.get()); for (String invalid : List.of(sign(foreign, LiveActiveJwtDecoderTest.ISSUER, Instant.now().plusSeconds(120)), @@ -60,7 +60,7 @@ public Mono validateLive(org.fireflyframework.security.api.do } assertEquals(1, calls.get()); } - Jwt receivedValue(LiveActiveJwtDecoder decoder, String token) { return decoder.decode(token).block(); } + Jwt receivedValue(LiveActiveJwtDecoderImpl decoder, String token) { return decoder.decode(token).block(); } String sign(KeyPair key, String issuer, Instant expires) throws Exception { var claims = new JWTClaimsSet.Builder().issuer(issuer).subject("opaque:staff/subject").audience("resource") .expirationTime(Date.from(expires)).claim("azp", "workforce-client").jwtID("opaque-token-id").build(); diff --git a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/ResourceServerIntegrationTest.java b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/ResourceServerIntegrationTest.java index 86fb9bc52..ec547d38f 100644 --- a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/ResourceServerIntegrationTest.java +++ b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/ResourceServerIntegrationTest.java @@ -25,7 +25,7 @@ import org.fireflyframework.security.api.domain.Decision; import org.fireflyframework.security.api.domain.SecurityPrincipal; import org.fireflyframework.security.api.domain.SigningKey; -import org.fireflyframework.security.core.key.InMemoryKeyManagementAdapter; +import org.fireflyframework.security.core.key.InMemoryKeyManagementAdapterImpl; import org.fireflyframework.security.core.policy.PolicyRule; import org.fireflyframework.security.spi.KeyManagementPort; import org.junit.jupiter.api.BeforeEach; @@ -137,7 +137,7 @@ void expiredTokenIsUnauthorized() throws Exception { @Test void forgedTokenSignedByUnknownKeyIsUnauthorized() throws Exception { - SigningKey foreignKey = new InMemoryKeyManagementAdapter().activeSigningKey().block(); + SigningKey foreignKey = new InMemoryKeyManagementAdapterImpl().activeSigningKey().block(); String token = signWith(foreignKey, validClaims().build()); client.get().uri("/api/me").header("Authorization", "Bearer " + token) .exchange().expectStatus().isUnauthorized(); diff --git a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/TenantPrincipalProjectionTest.java b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/TenantPrincipalProjectionTest.java index 9751da8db..34ccaad34 100644 --- a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/TenantPrincipalProjectionTest.java +++ b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/TenantPrincipalProjectionTest.java @@ -3,7 +3,7 @@ import org.fireflyframework.security.api.domain.SecurityPrincipal; import org.fireflyframework.security.core.authority.*; import org.fireflyframework.security.core.context.PrincipalFactory; -import org.fireflyframework.security.core.tenant.ConfigurableTenantResolver; +import org.fireflyframework.security.core.tenant.ConfigurableTenantResolverImpl; import org.fireflyframework.security.webflux.authentication.FireflyAuthenticationToken; import org.junit.jupiter.api.Test; import org.springframework.security.oauth2.core.OAuth2AuthenticationException; @@ -14,32 +14,32 @@ import static org.assertj.core.api.Assertions.*; class TenantPrincipalProjectionTest { - private final PrincipalFactory factory=new PrincipalFactory(new ConfigurableAuthorityMapper(new AuthorityMappingProperties(List.of("roles"),List.of("scope"),""))); + private final PrincipalFactory factory=new PrincipalFactory(new ConfigurableAuthorityMapperImpl(new AuthorityMappingProperties(List.of("roles"),List.of("scope"),""))); private Jwt jwt(Map claims){return Jwt.withTokenValue("prevalidated-unit-value").header("alg","RS256").subject("verified-subject").issuer("https://issuer.test").issuedAt(Instant.now()).expiresAt(Instant.now().plusSeconds(120)).claims(value->value.putAll(claims)).build();} - private SecurityPrincipal principal(JwtToFireflyPrincipalConverter converter,Map claims){return ((FireflyAuthenticationToken)converter.convert(jwt(claims)).block()).securityPrincipal();} + private SecurityPrincipal principal(JwtToFireflyPrincipalConverterImpl converter,Map claims){return ((FireflyAuthenticationToken)converter.convert(jwt(claims)).block()).securityPrincipal();} @Test void legacyConstructorRetainsUnconfiguredTenantAndFactorySignature() { var props=new ResourceServerProperties();assertThat(props.getTenantClaimPaths()).isEmpty();assertThat(props.isTenantRequired()).isFalse(); - assertThat(principal(new JwtToFireflyPrincipalConverter(factory),Map.of("tenant_id","a")).tenantId()).isNull();assertThat(new ResourceServerAutoConfiguration().fireflyJwtAuthenticationConverter(factory)).isNotNull(); + assertThat(principal(new JwtToFireflyPrincipalConverterImpl(factory),Map.of("tenant_id","a")).tenantId()).isNull();assertThat(new ResourceServerAutoConfiguration().fireflyJwtAuthenticationConverter(factory)).isNotNull(); } @Test void explicitProjectionPreservesEveryOtherPrincipalField() { var claims=Map.of("org",Map.of("tenant",List.of("a")),"roles",List.of("operator"),"scope","read write","auth_time",Instant.now().minusSeconds(30).getEpochSecond(),"acr","reviewed","amr",List.of("pwd"),"principal_kind","MACHINE","client_id","real-client"); - var converter=new JwtToFireflyPrincipalConverter(factory,new ConfigurableTenantResolver(List.of("org.tenant")),true);var token=jwt(claims);var projected=((FireflyAuthenticationToken)converter.convert(token).block()).securityPrincipal();var original=factory.fromClaims(token.getSubject(),token.getIssuer().toString(),token.getClaims());assertThat(projected).isEqualTo(original.toBuilder().tenantId("a").build());assertThat(projected.claims()).doesNotContainKey("staff_actor_id"); + var converter=new JwtToFireflyPrincipalConverterImpl(factory,new ConfigurableTenantResolverImpl(List.of("org.tenant")),true);var token=jwt(claims);var projected=((FireflyAuthenticationToken)converter.convert(token).block()).securityPrincipal();var original=factory.fromClaims(token.getSubject(),token.getIssuer().toString(),token.getClaims());assertThat(projected).isEqualTo(original.toBuilder().tenantId("a").build());assertThat(projected.claims()).doesNotContainKey("staff_actor_id"); } @Test void optionalMissingOrAmbiguousProjectionClearsTenantWithoutCrossRequestState() { - var converter=new JwtToFireflyPrincipalConverter(factory,new ConfigurableTenantResolver(List.of("tenant_ids")),false); + var converter=new JwtToFireflyPrincipalConverterImpl(factory,new ConfigurableTenantResolverImpl(List.of("tenant_ids")),false); assertThat(principal(converter,Map.of("tenant_ids",List.of("first"))).tenantId()).isEqualTo("first");assertThat(principal(converter,Map.of()).tenantId()).isNull();assertThat(principal(converter,Map.of("tenant_ids",List.of("a","b"))).tenantId()).isNull();assertThat(principal(converter,Map.of("tenant_ids",List.of("last"))).tenantId()).isEqualTo("last"); } @Test void requiredMissingOrAmbiguousProjectionDeniesWithoutClaimDisclosure() { - var converter=new JwtToFireflyPrincipalConverter(factory,new ConfigurableTenantResolver(List.of("tenant_ids")),true); + var converter=new JwtToFireflyPrincipalConverterImpl(factory,new ConfigurableTenantResolverImpl(List.of("tenant_ids")),true); for(var claims:List.of(Map.of(),Map.of("tenant_ids",List.of("private-tenant-a","private-tenant-b"))))assertThatThrownBy(()->principal(converter,claims)).isInstanceOf(OAuth2AuthenticationException.class).hasMessageNotContaining("private-tenant"); } @Test void resolverErrorsDenyEvenOptionalProjectionWithoutCauseDisclosure() { - var converter=new JwtToFireflyPrincipalConverter(factory,p->Mono.error(new IllegalStateException("private-claim-value")),false); + var converter=new JwtToFireflyPrincipalConverterImpl(factory,p->Mono.error(new IllegalStateException("private-claim-value")),false); assertThatThrownBy(()->principal(converter,Map.of())).isInstanceOf(OAuth2AuthenticationException.class).hasMessageNotContaining("private-claim-value").hasNoCause(); } @Test void configuredProjectionPreservesOpaqueScalarAndAllOtherPrincipalFields() { - var converter=new JwtToFireflyPrincipalConverter(factory,new ConfigurableTenantResolver(List.of("tenant_id")),true); + var converter=new JwtToFireflyPrincipalConverterImpl(factory,new ConfigurableTenantResolverImpl(List.of("tenant_id")),true); for(String tenant:List.of("opaque:tenant/α β","opaque:tenant/a,b"," tenant-a ")) { var token=jwt(Map.of("tenant_id",tenant,"roles","operator auditor","scope","read,write")); var projected=((FireflyAuthenticationToken)converter.convert(token).block()).securityPrincipal(); @@ -52,21 +52,21 @@ class TenantPrincipalProjectionTest { @Test void requiredAndOptionalProjectionAgreeOnAnExactSingleCollectionElement() { String tenant="opaque tenant,α"; for(boolean required:List.of(true,false)) { - var converter=new JwtToFireflyPrincipalConverter(factory,new ConfigurableTenantResolver(List.of("tenant_id")),required); + var converter=new JwtToFireflyPrincipalConverterImpl(factory,new ConfigurableTenantResolverImpl(List.of("tenant_id")),required); assertThat(principal(converter,Map.of("tenant_id",List.of(tenant))).tenantId()).isEqualTo(tenant); assertThat(principal(converter,Map.of("tenant_id",tenant)).tenantId()).isEqualTo(tenant); } } @Test void distinctCollectionTenantsStillRejectRequiredAndClearOptionalProjection() { var claims=Map.of("tenant_id",List.of("opaque tenant","other,tenant")); - var required=new JwtToFireflyPrincipalConverter(factory,new ConfigurableTenantResolver(List.of("tenant_id")),true); - var optional=new JwtToFireflyPrincipalConverter(factory,new ConfigurableTenantResolver(List.of("tenant_id")),false); + var required=new JwtToFireflyPrincipalConverterImpl(factory,new ConfigurableTenantResolverImpl(List.of("tenant_id")),true); + var optional=new JwtToFireflyPrincipalConverterImpl(factory,new ConfigurableTenantResolverImpl(List.of("tenant_id")),false); assertThatThrownBy(()->principal(required,claims)).isInstanceOf(OAuth2AuthenticationException.class).hasMessageNotContaining("opaque tenant"); assertThat(principal(optional,claims).tenantId()).isNull(); } @Test void numericAndMixedCollectionLegacyProjectionKeepsItsPriorSemantics() { - var required=new JwtToFireflyPrincipalConverter(factory,new ConfigurableTenantResolver(List.of("tenant_id")),true); - var optional=new JwtToFireflyPrincipalConverter(factory,new ConfigurableTenantResolver(List.of("tenant_id")),false); + var required=new JwtToFireflyPrincipalConverterImpl(factory,new ConfigurableTenantResolverImpl(List.of("tenant_id")),true); + var optional=new JwtToFireflyPrincipalConverterImpl(factory,new ConfigurableTenantResolverImpl(List.of("tenant_id")),false); assertThat(principal(required,Map.of("tenant_id",17)).tenantId()).isEqualTo("17"); assertThat(principal(optional,Map.of("tenant_id",List.of(17))).tenantId()).isEqualTo("17"); var mixed=Map.of("tenant_id",List.of("tenant-a",17)); @@ -74,13 +74,13 @@ class TenantPrincipalProjectionTest { assertThat(principal(optional,mixed).tenantId()).isNull(); } @Test void legacyUnconfiguredConverterStillDoesNotInferAnOpaqueTenant() { - assertThat(principal(new JwtToFireflyPrincipalConverter(factory),Map.of("tenant_id","opaque tenant,α")).tenantId()).isNull(); + assertThat(principal(new JwtToFireflyPrincipalConverterImpl(factory),Map.of("tenant_id","opaque tenant,α")).tenantId()).isNull(); } @Test void malformedProjectionRejectsRequiredAndClearsOptionalWithoutSelectingAnotherTenant() { - var required=new JwtToFireflyPrincipalConverter(factory,new ConfigurableTenantResolver(List.of("tenant_id")),true); - var optional=new JwtToFireflyPrincipalConverter(factory,new ConfigurableTenantResolver(List.of("tenant_id")),false); + var required=new JwtToFireflyPrincipalConverterImpl(factory,new ConfigurableTenantResolverImpl(List.of("tenant_id")),true); + var optional=new JwtToFireflyPrincipalConverterImpl(factory,new ConfigurableTenantResolverImpl(List.of("tenant_id")),false); for(String malformed:List.of("tenant\nvalue","tenant"+(char)0+"value","tenant"+(char)0xD800,"tenant"+(char)0xDC00,"\t")) { for(Object value:List.of(malformed,List.of(malformed),List.of("tenant-a",malformed))) { var claims=Map.of("tenant_id",value); diff --git a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/TenantProjectionConfigurationTest.java b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/TenantProjectionConfigurationTest.java index 122e034a8..a2764539b 100644 --- a/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/TenantProjectionConfigurationTest.java +++ b/modules/security-resource-server/src/test/java/org/fireflyframework/security/rs/TenantProjectionConfigurationTest.java @@ -17,12 +17,12 @@ class TenantProjectionConfigurationTest { private final ReactiveWebApplicationContextRunner runner=new ReactiveWebApplicationContextRunner().withConfiguration(AutoConfigurations.of(ResourceServerAutoConfiguration.class)).withUserConfiguration(Decoder.class); @Test void configuredPropertiesBindToTheSingleNativeConverter() { runner.withPropertyValues("firefly.security.resource-server.tenant-claim-paths[0]=tenant_id","firefly.security.resource-server.tenant-required=true").run(context->{ - assertThat(context).hasNotFailed();assertThat(context.getBeansOfType(Converter.class).values().stream().filter(JwtToFireflyPrincipalConverter.class::isInstance)).hasSize(1);var props=context.getBean(ResourceServerProperties.class);assertThat(props.getTenantClaimPaths()).containsExactly("tenant_id");assertThat(props.isTenantRequired()).isTrue();var converter=context.getBean(JwtToFireflyPrincipalConverter.class);var jwt=Jwt.withTokenValue("prevalidated-unit-value").header("alg","RS256").subject("subject").claim("tenant_id","configured-tenant").build();assertThat(((FireflyAuthenticationToken)converter.convert(jwt).block()).securityPrincipal().tenantId()).isEqualTo("configured-tenant"); + assertThat(context).hasNotFailed();assertThat(context.getBeansOfType(Converter.class).values().stream().filter(JwtToFireflyPrincipalConverterImpl.class::isInstance)).hasSize(1);var props=context.getBean(ResourceServerProperties.class);assertThat(props.getTenantClaimPaths()).containsExactly("tenant_id");assertThat(props.isTenantRequired()).isTrue();var converter=context.getBean(JwtToFireflyPrincipalConverterImpl.class);var jwt=Jwt.withTokenValue("prevalidated-unit-value").header("alg","RS256").subject("subject").claim("tenant_id","configured-tenant").build();assertThat(((FireflyAuthenticationToken)converter.convert(jwt).block()).securityPrincipal().tenantId()).isEqualTo("configured-tenant"); }); } @Test void requiredTenantWithoutValidConfiguredPathsFailsStartup() { for(var paths:List.of(List.of(),List.of(" "),List.of("org..tenant"),List.of("org.tenant."))) { - var props=new ResourceServerProperties();props.setTenantRequired(true);props.setTenantClaimPaths(paths);assertThatThrownBy(()->new ResourceServerAutoConfiguration().fireflyJwtAuthenticationConverter(new PrincipalFactory(new org.fireflyframework.security.core.authority.ConfigurableAuthorityMapper(new org.fireflyframework.security.core.authority.AuthorityMappingProperties(List.of(),List.of(),""))),props)).isInstanceOf(IllegalArgumentException.class); + var props=new ResourceServerProperties();props.setTenantRequired(true);props.setTenantClaimPaths(paths);assertThatThrownBy(()->new ResourceServerAutoConfiguration().fireflyJwtAuthenticationConverter(new PrincipalFactory(new org.fireflyframework.security.core.authority.ConfigurableAuthorityMapperImpl(new org.fireflyframework.security.core.authority.AuthorityMappingProperties(List.of(),List.of(),""))),props)).isInstanceOf(IllegalArgumentException.class); } runner.withPropertyValues("firefly.security.resource-server.tenant-required=true").run(context->assertThat(context).hasFailed()); } diff --git a/modules/security-spi/README.md b/modules/security-spi/README.md index eb9a3c038..b2a32d839 100644 --- a/modules/security-spi/README.md +++ b/modules/security-spi/README.md @@ -46,7 +46,7 @@ import java.util.Map; @Component @RequiredArgsConstructor -public class OpaPolicyDecisionAdapter implements PolicyDecisionPort { +public class OpaPolicyDecisionAdapterImpl implements PolicyDecisionPort { private final OpaClient opa; // your engine binding diff --git a/modules/security-test/README.md b/modules/security-test/README.md index e9378f4a1..8f150f022 100644 --- a/modules/security-test/README.md +++ b/modules/security-test/README.md @@ -34,7 +34,7 @@ Add the module as a `test`-scoped dependency, then build identities and inject p ```java import org.fireflyframework.security.api.domain.Decision; import org.fireflyframework.security.api.domain.SecurityPrincipal; -import org.fireflyframework.security.test.FakePolicyDecisionPort; +import org.fireflyframework.security.test.FakePolicyDecisionPortImpl; import org.fireflyframework.security.test.TestPrincipals; import org.springframework.security.core.context.ReactiveSecurityContextHolder; import reactor.core.publisher.Mono; @@ -51,7 +51,7 @@ Mono underTest = handler.handle(request) .contextWrite(ReactiveSecurityContextHolder.withAuthentication(auth)); // Drive a PEP with a configurable PDP and assert what it asked -FakePolicyDecisionPort pdp = FakePolicyDecisionPort.denyAll("reports.read scope required"); +FakePolicyDecisionPortImpl pdp = FakePolicyDecisionPortImpl.denyAll("reports.read scope required"); StepVerifier.create(pep.check(alice, "read", "/api/reports", Map.of())) .expectNextMatches(Decision::granted) // ... or assert the deny path .verifyComplete(); @@ -60,7 +60,7 @@ assertThat(pdp.lastAction()).isEqualTo("read"); assertThat(pdp.lastResource()).isEqualTo("/api/reports"); ``` -`FakePolicyDecisionPort` is mutable and `volatile`-backed, so the same instance can be reconfigured between assertions with `returning(...)`. +`FakePolicyDecisionPortImpl` is mutable and `volatile`-backed, so the same instance can be reconfigured between assertions with `returning(...)`. ## Configuration @@ -70,7 +70,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | Type | Contract and responsibility | | --- | --- | -| [`FakePolicyDecisionPort`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPort.java) | A configurable `PolicyDecisionPort` test double that returns a predetermined decision and records the last request it received, so tests can assert PEP wiring without a real policy engine. | +| [`FakePolicyDecisionPortImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPortImpl.java) | A configurable `PolicyDecisionPort` test double that returns a predetermined decision and records the last request it received, so tests can assert PEP wiring without a real policy engine. | | [`TestPrincipals`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-test/src/main/java/org/fireflyframework/security/test/TestPrincipals.java) | Factory helpers for building `SecurityPrincipal`s and `FireflyAuthenticationToken`s in tests, so application test code does not hand-roll principals or wrestle with the security context. | ## Continue the application diff --git a/modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPort.java b/modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPortImpl.java similarity index 79% rename from modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPort.java rename to modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPortImpl.java index 76b49e4df..424eebeb6 100644 --- a/modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPort.java +++ b/modules/security-test/src/main/java/org/fireflyframework/security/test/FakePolicyDecisionPortImpl.java @@ -27,25 +27,25 @@ * A configurable {@link PolicyDecisionPort} test double that returns a predetermined decision and * records the last request it received, so tests can assert PEP wiring without a real policy engine. */ -public class FakePolicyDecisionPort implements PolicyDecisionPort { +public class FakePolicyDecisionPortImpl implements PolicyDecisionPort { private volatile Decision next; private volatile String lastAction; private volatile String lastResource; - public FakePolicyDecisionPort(Decision next) { + public FakePolicyDecisionPortImpl(Decision next) { this.next = next; } - public static FakePolicyDecisionPort permitAll() { - return new FakePolicyDecisionPort(Decision.permit()); + public static FakePolicyDecisionPortImpl permitAll() { + return new FakePolicyDecisionPortImpl(Decision.permit()); } - public static FakePolicyDecisionPort denyAll(String reason) { - return new FakePolicyDecisionPort(Decision.deny(reason)); + public static FakePolicyDecisionPortImpl denyAll(String reason) { + return new FakePolicyDecisionPortImpl(Decision.deny(reason)); } - public FakePolicyDecisionPort returning(Decision decision) { + public FakePolicyDecisionPortImpl returning(Decision decision) { this.next = decision; return this; } diff --git a/modules/security-test/src/test/java/org/fireflyframework/security/test/SecurityTestFixturesTest.java b/modules/security-test/src/test/java/org/fireflyframework/security/test/SecurityTestFixturesTest.java index 824b6bd7e..7e2404ac9 100644 --- a/modules/security-test/src/test/java/org/fireflyframework/security/test/SecurityTestFixturesTest.java +++ b/modules/security-test/src/test/java/org/fireflyframework/security/test/SecurityTestFixturesTest.java @@ -34,14 +34,14 @@ void buildsPrincipalsAndAuthentications() { @Test void fakePolicyDecisionPortReturnsConfiguredDecisionAndRecordsRequest() { - FakePolicyDecisionPort permit = FakePolicyDecisionPort.permitAll(); + FakePolicyDecisionPortImpl permit = FakePolicyDecisionPortImpl.permitAll(); StepVerifier.create(permit.authorize(TestPrincipals.user("u1"), "read", "doc:1", Map.of())) .expectNextMatches(d -> d.granted()) .verifyComplete(); assertThat(permit.lastAction()).isEqualTo("read"); assertThat(permit.lastResource()).isEqualTo("doc:1"); - FakePolicyDecisionPort deny = FakePolicyDecisionPort.denyAll("nope"); + FakePolicyDecisionPortImpl deny = FakePolicyDecisionPortImpl.denyAll("nope"); StepVerifier.create(deny.authorize(TestPrincipals.user("u1"), "write", "doc:1", Map.of())) .expectNextMatches(d -> !d.granted()) .verifyComplete(); diff --git a/modules/security-webflux/README.md b/modules/security-webflux/README.md index ff72ad32a..f2b0a7131 100644 --- a/modules/security-webflux/README.md +++ b/modules/security-webflux/README.md @@ -32,7 +32,7 @@ Wire the PEP into a `SecurityWebFilterChain` (normally done for you by `security ```java import org.fireflyframework.security.spi.PolicyDecisionPort; -import org.fireflyframework.security.webflux.authz.PolicyAuthorizationManager; +import org.fireflyframework.security.webflux.authz.PolicyAuthorizationManagerImpl; import org.springframework.context.annotation.Bean; import org.springframework.security.config.web.server.ServerHttpSecurity; import org.springframework.security.web.server.SecurityWebFilterChain; @@ -43,7 +43,7 @@ SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http, PolicyDec .authorizeExchange(ex -> ex .pathMatchers("/actuator/health").permitAll() // every other exchange goes through the policy decision point (fail-closed) - .anyExchange().access(new PolicyAuthorizationManager(pdp))) + .anyExchange().access(new PolicyAuthorizationManagerImpl(pdp))) .build(); } ``` @@ -62,7 +62,7 @@ public class GreetingService { private final SecurityContextPort securityContext; public GreetingService(SecurityContextPort securityContext) { - this.securityContext = securityContext; // ReactorSecurityContextAdapter at runtime + this.securityContext = securityContext; // ReactorSecurityContextAdapterImpl at runtime } public Mono greet() { @@ -103,8 +103,8 @@ The `firefly.security.webflux.header-bridge` namespace is bound by [PrincipalHea | [`PrincipalHeaderBridgeProperties`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeProperties.java) | Configuration for the principal→header bridge. | | [`FireflyAuthenticationToken`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authentication/FireflyAuthenticationToken.java) | Spring Security `org.springframework.security.core.Authentication` whose principal is the framework's `SecurityPrincipal`. | | [`PrincipalSupport`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authentication/PrincipalSupport.java) | Recovers a `SecurityPrincipal` from any Spring `Authentication`. | -| [`PolicyAuthorizationManager`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManager.java) | URL policy enforcement point. | -| [`PrincipalHeaderBridgeWebFilter`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilter.java) | Derives trusted internal request headers from the validated token , never from the client. | +| [`PolicyAuthorizationManagerImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManagerImpl.java) | URL policy enforcement point. | +| [`PrincipalHeaderBridgeWebFilterImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilterImpl.java) | Derives trusted internal request headers from the validated token , never from the client. | ## Continue the application diff --git a/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManager.java b/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManagerImpl.java similarity index 93% rename from modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManager.java rename to modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManagerImpl.java index 26e2a2f4e..03648dace 100644 --- a/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManager.java +++ b/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManagerImpl.java @@ -33,11 +33,11 @@ * authenticated requests, delegates the ABAC decision to the {@link PolicyDecisionPort} using the * HTTP method as the action and the request path as the resource. Fail-closed: any error denies. */ -public class PolicyAuthorizationManager implements ReactiveAuthorizationManager { +public class PolicyAuthorizationManagerImpl implements ReactiveAuthorizationManager { private final PolicyDecisionPort policyDecisionPort; - public PolicyAuthorizationManager(PolicyDecisionPort policyDecisionPort) { + public PolicyAuthorizationManagerImpl(PolicyDecisionPort policyDecisionPort) { this.policyDecisionPort = policyDecisionPort; } diff --git a/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilter.java b/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilterImpl.java similarity index 96% rename from modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilter.java rename to modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilterImpl.java index 7c67af045..f764ac9a5 100644 --- a/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilter.java +++ b/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilterImpl.java @@ -38,7 +38,7 @@ * (permit-all) requests pass through untouched. When a tenant is required but unresolved, the * request fails closed with 403.

    */ -public class PrincipalHeaderBridgeWebFilter implements WebFilter, Ordered { +public class PrincipalHeaderBridgeWebFilterImpl implements WebFilter, Ordered { /** After Spring Security's {@code WebFilterChainProxy} (-100), before the controller. */ public static final int ORDER = -90; @@ -47,7 +47,7 @@ public class PrincipalHeaderBridgeWebFilter implements WebFilter, Ordered { private final TenantResolverPort tenantResolver; private final PrincipalHeaderBridgeProperties properties; - public PrincipalHeaderBridgeWebFilter(SecurityContextPort securityContext, + public PrincipalHeaderBridgeWebFilterImpl(SecurityContextPort securityContext, TenantResolverPort tenantResolver, PrincipalHeaderBridgeProperties properties) { this.securityContext = securityContext; diff --git a/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/WebFluxBridgeAutoConfiguration.java b/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/WebFluxBridgeAutoConfiguration.java index 1f817ee08..695a4406c 100644 --- a/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/WebFluxBridgeAutoConfiguration.java +++ b/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/bridge/WebFluxBridgeAutoConfiguration.java @@ -16,7 +16,7 @@ package org.fireflyframework.security.webflux.bridge; -import org.fireflyframework.security.core.tenant.ConfigurableTenantResolver; +import org.fireflyframework.security.core.tenant.ConfigurableTenantResolverImpl; import org.fireflyframework.security.spi.SecurityContextPort; import org.fireflyframework.security.spi.TenantResolverPort; import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -42,15 +42,15 @@ public class WebFluxBridgeAutoConfiguration { @Bean @ConditionalOnMissingBean public TenantResolverPort fireflyTenantResolverPort(PrincipalHeaderBridgeProperties properties) { - return new ConfigurableTenantResolver(properties.getTenantClaimPaths()); + return new ConfigurableTenantResolverImpl(properties.getTenantClaimPaths()); } @Bean @ConditionalOnMissingBean - public PrincipalHeaderBridgeWebFilter fireflyPrincipalHeaderBridgeWebFilter( + public PrincipalHeaderBridgeWebFilterImpl fireflyPrincipalHeaderBridgeWebFilter( SecurityContextPort securityContext, TenantResolverPort tenantResolver, PrincipalHeaderBridgeProperties properties) { - return new PrincipalHeaderBridgeWebFilter(securityContext, tenantResolver, properties); + return new PrincipalHeaderBridgeWebFilterImpl(securityContext, tenantResolver, properties); } } diff --git a/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapter.java b/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapterImpl.java similarity index 95% rename from modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapter.java rename to modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapterImpl.java index 04de26886..e386ec6b9 100644 --- a/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapter.java +++ b/modules/security-webflux/src/main/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapterImpl.java @@ -27,7 +27,7 @@ * {@link SecurityContextPort} backed by Spring Security's {@link ReactiveSecurityContextHolder}. * Application code depends on the port, keeping it free of Spring Security imports. */ -public class ReactorSecurityContextAdapter implements SecurityContextPort { +public class ReactorSecurityContextAdapterImpl implements SecurityContextPort { @Override public Mono currentPrincipal() { diff --git a/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManagerTest.java b/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManagerTest.java index 51806521c..c8ec0d35f 100644 --- a/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManagerTest.java +++ b/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/authz/PolicyAuthorizationManagerTest.java @@ -18,7 +18,7 @@ import org.fireflyframework.security.api.domain.Decision; import org.fireflyframework.security.api.domain.SecurityPrincipal; -import org.fireflyframework.security.core.policy.EmbeddedPolicyDecisionAdapter; +import org.fireflyframework.security.core.policy.EmbeddedPolicyDecisionAdapterImpl; import org.fireflyframework.security.spi.PolicyDecisionPort; import org.fireflyframework.security.webflux.authentication.FireflyAuthenticationToken; import org.junit.jupiter.api.Test; @@ -43,7 +43,7 @@ private FireflyAuthenticationToken authenticated() { @Test void deniesUnauthenticatedRequests() { - PolicyAuthorizationManager manager = new PolicyAuthorizationManager(new EmbeddedPolicyDecisionAdapter(List.of())); + PolicyAuthorizationManagerImpl manager = new PolicyAuthorizationManagerImpl(new EmbeddedPolicyDecisionAdapterImpl(List.of())); StepVerifier.create(manager.authorize(Mono.empty(), getRequest("/api/x"))) .expectNextMatches(d -> !d.isGranted()) .verifyComplete(); @@ -51,7 +51,7 @@ void deniesUnauthenticatedRequests() { @Test void permitsAuthenticatedWhenPolicyAbstains() { - PolicyAuthorizationManager manager = new PolicyAuthorizationManager(new EmbeddedPolicyDecisionAdapter(List.of())); + PolicyAuthorizationManagerImpl manager = new PolicyAuthorizationManagerImpl(new EmbeddedPolicyDecisionAdapterImpl(List.of())); StepVerifier.create(manager.authorize(Mono.just(authenticated()), getRequest("/api/x"))) .expectNextMatches(AuthorizationResult::isGranted) .verifyComplete(); @@ -60,7 +60,7 @@ void permitsAuthenticatedWhenPolicyAbstains() { @Test void deniesAuthenticatedWhenPolicyDenies() { PolicyDecisionPort denyAll = (p, a, r, c) -> Mono.just(Decision.deny("blocked")); - PolicyAuthorizationManager manager = new PolicyAuthorizationManager(denyAll); + PolicyAuthorizationManagerImpl manager = new PolicyAuthorizationManagerImpl(denyAll); StepVerifier.create(manager.authorize(Mono.just(authenticated()), getRequest("/api/x"))) .expectNextMatches(d -> !d.isGranted()) .verifyComplete(); @@ -69,7 +69,7 @@ void deniesAuthenticatedWhenPolicyDenies() { @Test void failsClosedOnPolicyError() { PolicyDecisionPort boom = (p, a, r, c) -> Mono.error(new IllegalStateException("pdp down")); - PolicyAuthorizationManager manager = new PolicyAuthorizationManager(boom); + PolicyAuthorizationManagerImpl manager = new PolicyAuthorizationManagerImpl(boom); StepVerifier.create(manager.authorize(Mono.just(authenticated()), getRequest("/api/x"))) .expectNextMatches(d -> !d.isGranted()) .verifyComplete(); diff --git a/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilterTest.java b/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilterTest.java index 4bca94d5c..4cb739554 100644 --- a/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilterTest.java +++ b/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/bridge/PrincipalHeaderBridgeWebFilterTest.java @@ -17,7 +17,7 @@ package org.fireflyframework.security.webflux.bridge; import org.fireflyframework.security.api.domain.SecurityPrincipal; -import org.fireflyframework.security.core.tenant.ConfigurableTenantResolver; +import org.fireflyframework.security.core.tenant.ConfigurableTenantResolverImpl; import org.fireflyframework.security.spi.SecurityContextPort; import org.fireflyframework.security.spi.TenantResolverPort; import org.junit.jupiter.api.Test; @@ -41,7 +41,7 @@ class PrincipalHeaderBridgeWebFilterTest { private final PrincipalHeaderBridgeProperties properties = new PrincipalHeaderBridgeProperties(); - private final TenantResolverPort tenantResolver = new ConfigurableTenantResolver(List.of("tenant_ids")); + private final TenantResolverPort tenantResolver = new ConfigurableTenantResolverImpl(List.of("tenant_ids")); /** Records how many times it ran and the exchange it saw — to assert single execution + mutation. */ private static final class CapturingChain implements WebFilterChain { @@ -60,8 +60,8 @@ private static SecurityContextPort principalPort(SecurityPrincipal principal) { return () -> principal == null ? Mono.empty() : Mono.just(principal); } - private PrincipalHeaderBridgeWebFilter filter(SecurityContextPort port) { - return new PrincipalHeaderBridgeWebFilter(port, tenantResolver, properties); + private PrincipalHeaderBridgeWebFilterImpl filter(SecurityContextPort port) { + return new PrincipalHeaderBridgeWebFilterImpl(port, tenantResolver, properties); } @Test diff --git a/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapterTest.java b/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapterTest.java index 095d1e38f..f20f0febc 100644 --- a/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapterTest.java +++ b/modules/security-webflux/src/test/java/org/fireflyframework/security/webflux/context/ReactorSecurityContextAdapterTest.java @@ -26,7 +26,7 @@ class ReactorSecurityContextAdapterTest { - private final ReactorSecurityContextAdapter adapter = new ReactorSecurityContextAdapter(); + private final ReactorSecurityContextAdapterImpl adapter = new ReactorSecurityContextAdapterImpl(); @Test void returnsPrincipalFromReactiveSecurityContext() { diff --git a/modules/starter-application/docs/CACHE_ARCHITECTURE.md b/modules/starter-application/docs/CACHE_ARCHITECTURE.md index ce30db082..081842d50 100644 --- a/modules/starter-application/docs/CACHE_ARCHITECTURE.md +++ b/modules/starter-application/docs/CACHE_ARCHITECTURE.md @@ -39,7 +39,7 @@ This document validates that the caching implementation in `lib-common-applicati │ │ Uses │ ↓ │ ┌────────────────────────────────────────┐ -│ │ FireflyCacheManager │ ← Infrastructure +│ │ FireflyCacheManagerImpl │ ← Infrastructure │ │ (from lib-common-cache) │ │ └────────────┬───────────────────────────┘ │ │ @@ -53,7 +53,7 @@ This document validates that the caching implementation in `lib-common-applicati ### ✅ Proper Separation of Concerns - Business Logic: `AbstractConfigResolver` manages *what* to cache and *when* -- Cache Operations: `FireflyCacheManager` handles *how* to cache +- Cache Operations: `FireflyCacheManagerImpl` handles *how* to cache - Storage: Caffeine/Redis provides the actual storage mechanism --- @@ -153,10 +153,10 @@ protected Mono clearCacheForTenant(UUID tenantId) // ✅ Reactive ```java @Autowired(required = false) // ✅ Optional dependency -private FireflyCacheManager cacheManager; +private FireflyCacheManagerImpl cacheManager; if (cacheManager == null) { - log.debug("FireflyCacheManager not available, fetching config directly"); + log.debug("FireflyCacheManagerImpl not available, fetching config directly"); return fetchConfigFromPlatform(tenantId); } ``` @@ -200,7 +200,7 @@ GET /actuator/metrics/cache.size ### Single Responsibility Principle ✅ - `AbstractConfigResolver`: Manages config resolution logic -- `FireflyCacheManager`: Manages cache operations +- `FireflyCacheManagerImpl`: Manages cache operations - Separate concerns, single responsibility each ### Open/Closed Principle ✅ @@ -218,15 +218,15 @@ protected Duration getConfigTTL() { ### Interface Segregation Principle ✅ - `ConfigResolver`: Focused interface for config resolution -- `FireflyCacheManager`: Focused interface for caching +- `FireflyCacheManagerImpl`: Focused interface for caching - No god interfaces ### Dependency Inversion Principle ✅ ```java @Autowired(required = false) -private FireflyCacheManager cacheManager; // Depends on abstraction +private FireflyCacheManagerImpl cacheManager; // Depends on abstraction ``` -- Depends on `FireflyCacheManager` interface, not concrete implementation +- Depends on `FireflyCacheManagerImpl` interface, not concrete implementation --- diff --git a/modules/starter-application/docs/SECURITY_CENTER_INTEGRATION.md b/modules/starter-application/docs/SECURITY_CENTER_INTEGRATION.md index 0be10fa41..40e08a87f 100644 --- a/modules/starter-application/docs/SECURITY_CENTER_INTEGRATION.md +++ b/modules/starter-application/docs/SECURITY_CENTER_INTEGRATION.md @@ -43,7 +43,7 @@ The integration connects the Security Center's `FireflySessionManager` with the │ │ │ │ ↓ │ │ ┌────────────────────────────────────────────────────┐ │ -│ │ DefaultContextResolver │ │ +│ │ DefaultContextResolverImpl │ │ │ │ - Extracts partyId from X-Party-Id header │ │ │ │ - Calls FireflySessionManager.createOrGetSession │ │ │ │ - Uses SessionContextMapper to extract roles │ │ @@ -52,7 +52,7 @@ The integration connects the Security Center's `FireflySessionManager` with the │ │ │ │ ↓ │ │ ┌────────────────────────────────────────────────────┐ │ -│ │ DefaultSecurityAuthorizationService │ │ +│ │ DefaultSecurityAuthorizationServiceImpl │ │ │ │ - Validates product access via sessionManager │ │ │ │ - Checks roles and permissions │ │ │ └────────────────────────────────────────────────────┘ │ @@ -90,7 +90,7 @@ public Mono> getTransactions( } ``` -**2. DefaultContextResolver Resolves Context** +**2. DefaultContextResolverImpl Resolves Context** ```java // Extract partyId from Istio header UUID partyId = extractFromHeader(exchange, "X-Party-Id"); @@ -239,9 +239,9 @@ public static boolean hasPermission( --- -### 3. DefaultContextResolver Integration +### 3. DefaultContextResolverImpl Integration -**File:** `lib-common-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultContextResolver.java` +**File:** `lib-common-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultContextResolverImpl.java` **Changes:** @@ -293,9 +293,9 @@ protected Mono> resolvePermissions(AppContext context, ServerWebExch --- -### 4. DefaultSecurityAuthorizationService Integration +### 4. DefaultSecurityAuthorizationServiceImpl Integration -**File:** `lib-common-application/src/main/java/org/fireflyframework/common/application/security/DefaultSecurityAuthorizationService.java` +**File:** `lib-common-application/src/main/java/org/fireflyframework/common/application/security/DefaultSecurityAuthorizationServiceImpl.java` **Changes:** @@ -648,10 +648,10 @@ Security Center caches sessions with **30-minute TTL** by default: ``` First Request: - Controller → DefaultContextResolver → Security Center → (500ms) + Controller → DefaultContextResolverImpl → Security Center → (500ms) Subsequent Requests (within 30 min): - Controller → DefaultContextResolver → Cache → (5ms) + Controller → DefaultContextResolverImpl → Cache → (5ms) → 100x faster! 🚀 ``` diff --git a/modules/starter-application/docs/TESTING.md b/modules/starter-application/docs/TESTING.md index fd2100fb3..30aee4e4e 100644 --- a/modules/starter-application/docs/TESTING.md +++ b/modules/starter-application/docs/TESTING.md @@ -216,7 +216,7 @@ Business value: Ensures product-based controllers have consistent context resolu --- #### 13. ApplicationLayerHealthIndicatorTest (5 tests) -Tests for the `ApplicationLayerHealthIndicator` class - Spring Boot Actuator health indicator. +Tests for the `ApplicationLayerHealthIndicatorImpl` class - Spring Boot Actuator health indicator. What it validates: - ✅ Health check returns UP status when healthy @@ -229,7 +229,7 @@ Business value: Enables monitoring and observability of application layer compon --- #### 14. FireflyApplicationInfoContributorTest (6 tests) -Tests for the `FireflyApplicationInfoContributor` class - exposes metadata via /actuator/info. +Tests for the `FireflyApplicationInfoContributorImpl` class - exposes metadata via /actuator/info. What it validates: - ✅ Complete metadata contribution @@ -346,7 +346,7 @@ Business value: Ensures AOP-based security enforcement works correctly at runtim --- #### 21. ApplicationLayerBannerConfigTest (5 tests) -Tests for the `ApplicationLayerBannerConfig` class - startup banner configuration. +Tests for the `ApplicationLayerBannerConfigImpl` class - startup banner configuration. What it validates: - ✅ Banner mode set to CONSOLE diff --git a/modules/starter-application/src/main/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributor.java b/modules/starter-application/src/main/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributorImpl.java similarity index 97% rename from modules/starter-application/src/main/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributor.java rename to modules/starter-application/src/main/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributorImpl.java index f63e04416..56b89d463 100644 --- a/modules/starter-application/src/main/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributor.java +++ b/modules/starter-application/src/main/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributorImpl.java @@ -65,11 +65,11 @@ * @since 1.0.0 * @see AppMetadata */ -public class FireflyApplicationInfoContributor implements InfoContributor { +public class FireflyApplicationInfoContributorImpl implements InfoContributor { private final AppMetadata appMetadata; - public FireflyApplicationInfoContributor(AppMetadata appMetadata) { + public FireflyApplicationInfoContributorImpl(AppMetadata appMetadata) { this.appMetadata = appMetadata; } diff --git a/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerAutoConfiguration.java b/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerAutoConfiguration.java index d85e0bf47..dee7013cb 100644 --- a/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerAutoConfiguration.java +++ b/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerAutoConfiguration.java @@ -16,15 +16,15 @@ package org.fireflyframework.common.application.config; -import org.fireflyframework.common.application.actuator.FireflyApplicationInfoContributor; +import org.fireflyframework.common.application.actuator.FireflyApplicationInfoContributorImpl; import org.fireflyframework.common.application.aop.SecurityAspect; import org.fireflyframework.common.application.context.AppMetadata; -import org.fireflyframework.common.application.health.ApplicationLayerHealthIndicator; +import org.fireflyframework.common.application.health.ApplicationLayerHealthIndicatorImpl; import org.fireflyframework.common.application.resolver.ConfigResolver; import org.fireflyframework.common.application.resolver.ContextResolver; -import org.fireflyframework.common.application.resolver.DefaultConfigResolver; -import org.fireflyframework.common.application.resolver.DefaultContextResolver; -import org.fireflyframework.common.application.security.DefaultSecurityAuthorizationService; +import org.fireflyframework.common.application.resolver.DefaultConfigResolverImpl; +import org.fireflyframework.common.application.resolver.DefaultContextResolverImpl; +import org.fireflyframework.common.application.security.DefaultSecurityAuthorizationServiceImpl; import org.fireflyframework.common.application.security.EndpointSecurityRegistry; import org.fireflyframework.common.application.security.JwtClaimsRoleExtractor; import org.fireflyframework.common.application.security.SecurityAuthorizationService; @@ -121,9 +121,9 @@ public JwtClaimsRoleExtractor jwtClaimsRoleExtractor(ApplicationLayerProperties @ConditionalOnMissingBean @Bean @ConditionalOnProperty(name = "firefly.application.banner.enabled", matchIfMissing = true) - public ApplicationLayerBannerConfig applicationLayerBannerConfig() { + public ApplicationLayerBannerConfigImpl applicationLayerBannerConfig() { log.debug("Enabling Firefly Application Layer banner"); - return new ApplicationLayerBannerConfig(); + return new ApplicationLayerBannerConfigImpl(); } /** @@ -133,9 +133,9 @@ public ApplicationLayerBannerConfig applicationLayerBannerConfig() { */ @Bean @ConditionalOnMissingBean - public ApplicationLayerHealthIndicator applicationLayerHealthIndicator() { + public ApplicationLayerHealthIndicatorImpl applicationLayerHealthIndicator() { log.info("Creating ApplicationLayerHealthIndicator bean"); - return new ApplicationLayerHealthIndicator(); + return new ApplicationLayerHealthIndicatorImpl(); } /** @@ -167,9 +167,9 @@ public SecurityAspect securityAspect(SecurityAuthorizationService authorizationS @Bean @ConditionalOnBean(SecurityContextPort.class) @ConditionalOnMissingBean(ContextResolver.class) - public DefaultContextResolver defaultContextResolver(SecurityContextPort securityContextPort) { + public DefaultContextResolverImpl defaultContextResolver(SecurityContextPort securityContextPort) { log.info("Creating DefaultContextResolver bean (backed by SecurityContextPort)"); - return new DefaultContextResolver(securityContextPort); + return new DefaultContextResolverImpl(securityContextPort); } /** @@ -179,9 +179,9 @@ public DefaultContextResolver defaultContextResolver(SecurityContextPort securit */ @Bean @ConditionalOnMissingBean(ConfigResolver.class) - public DefaultConfigResolver defaultConfigResolver() { + public DefaultConfigResolverImpl defaultConfigResolver() { log.info("Creating DefaultConfigResolver bean"); - return new DefaultConfigResolver(); + return new DefaultConfigResolverImpl(); } /** @@ -194,9 +194,9 @@ public DefaultConfigResolver defaultConfigResolver() { */ @Bean @ConditionalOnMissingBean(SecurityAuthorizationService.class) - public DefaultSecurityAuthorizationService defaultSecurityAuthorizationService() { + public DefaultSecurityAuthorizationServiceImpl defaultSecurityAuthorizationService() { log.info("Creating DefaultSecurityAuthorizationService bean"); - return new DefaultSecurityAuthorizationService(); + return new DefaultSecurityAuthorizationServiceImpl(); } /** @@ -207,9 +207,9 @@ public DefaultSecurityAuthorizationService defaultSecurityAuthorizationService() */ @Bean @ConditionalOnMissingBean - public FireflyApplicationInfoContributor fireflyApplicationInfoContributor(AppMetadata appMetadata) { + public FireflyApplicationInfoContributorImpl fireflyApplicationInfoContributor(AppMetadata appMetadata) { log.info("Creating FireflyApplicationInfoContributor bean"); - return new FireflyApplicationInfoContributor(appMetadata); + return new FireflyApplicationInfoContributorImpl(appMetadata); } } diff --git a/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfig.java b/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfigImpl.java similarity index 95% rename from modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfig.java rename to modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfigImpl.java index ded5f7a2f..2ce4f1e54 100644 --- a/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfig.java +++ b/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfigImpl.java @@ -35,7 +35,7 @@ * @since 1.0.0 */ @Slf4j -public class ApplicationLayerBannerConfig implements ApplicationListener { +public class ApplicationLayerBannerConfigImpl implements ApplicationListener { @Override public void onApplicationEvent(ApplicationStartingEvent event) { diff --git a/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ConfigCacheAutoConfiguration.java b/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ConfigCacheAutoConfiguration.java index ee3b43e40..3b4b2af3e 100644 --- a/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ConfigCacheAutoConfiguration.java +++ b/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/ConfigCacheAutoConfiguration.java @@ -18,7 +18,7 @@ import org.fireflyframework.cache.config.CacheAutoConfiguration; import org.fireflyframework.cache.factory.CacheManagerFactory; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureAfter; @@ -43,7 +43,7 @@ */ @AutoConfiguration @AutoConfigureAfter(CacheAutoConfiguration.class) -@ConditionalOnClass({FireflyCacheManager.class, CacheManagerFactory.class}) +@ConditionalOnClass({FireflyCacheManagerImpl.class, CacheManagerFactory.class}) @Slf4j public class ConfigCacheAutoConfiguration { @@ -66,7 +66,7 @@ public ConfigCacheAutoConfiguration() { @Bean("configCacheManager") @ConditionalOnBean(CacheManagerFactory.class) @ConditionalOnMissingBean(name = "configCacheManager") - public FireflyCacheManager configCacheManager(CacheManagerFactory factory) { + public FireflyCacheManagerImpl configCacheManager(CacheManagerFactory factory) { String description = String.format( "Application Configuration Cache - Stores tenant/app configs (TTL: %d hour)", CONFIG_CACHE_TTL.toHours() diff --git a/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/StatelessApplicationEnvironmentPostProcessor.java b/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/StatelessApplicationEnvironmentPostProcessorImpl.java similarity index 93% rename from modules/starter-application/src/main/java/org/fireflyframework/common/application/config/StatelessApplicationEnvironmentPostProcessor.java rename to modules/starter-application/src/main/java/org/fireflyframework/common/application/config/StatelessApplicationEnvironmentPostProcessorImpl.java index 0d7c68abf..43d308e57 100644 --- a/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/StatelessApplicationEnvironmentPostProcessor.java +++ b/modules/starter-application/src/main/java/org/fireflyframework/common/application/config/StatelessApplicationEnvironmentPostProcessorImpl.java @@ -13,7 +13,7 @@ import java.util.Map; /** Keeps business persistence out of this stateless application role. */ -public final class StatelessApplicationEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered { +public final class StatelessApplicationEnvironmentPostProcessorImpl implements EnvironmentPostProcessor, Ordered { @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { var excludes = new LinkedHashSet<>(Binder.get(environment) diff --git a/modules/starter-application/src/main/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicator.java b/modules/starter-application/src/main/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicatorImpl.java similarity index 95% rename from modules/starter-application/src/main/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicator.java rename to modules/starter-application/src/main/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicatorImpl.java index 36fa02f88..f78c3f14d 100644 --- a/modules/starter-application/src/main/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicator.java +++ b/modules/starter-application/src/main/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicatorImpl.java @@ -32,9 +32,9 @@ * @since 1.0.0 */ @Slf4j -public class ApplicationLayerHealthIndicator extends FireflyHealthIndicator { +public class ApplicationLayerHealthIndicatorImpl extends FireflyHealthIndicator { - public ApplicationLayerHealthIndicator() { + public ApplicationLayerHealthIndicatorImpl() { super("application"); } diff --git a/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/AbstractConfigResolver.java b/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/AbstractConfigResolver.java index b6f8c6295..9b7af0993 100644 --- a/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/AbstractConfigResolver.java +++ b/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/AbstractConfigResolver.java @@ -17,7 +17,7 @@ package org.fireflyframework.common.application.resolver; import org.fireflyframework.common.application.context.AppConfig; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; @@ -44,7 +44,7 @@ public abstract class AbstractConfigResolver implements ConfigResolver { @Autowired(required = false) @Qualifier("configCacheManager") - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; @Override public Mono resolveConfig(UUID tenantId) { diff --git a/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultConfigResolver.java b/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultConfigResolverImpl.java similarity index 98% rename from modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultConfigResolver.java rename to modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultConfigResolverImpl.java index eecbdeb2d..1443c0152 100644 --- a/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultConfigResolver.java +++ b/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultConfigResolverImpl.java @@ -49,7 +49,7 @@ * @since 1.0.0 */ @Slf4j -public class DefaultConfigResolver extends AbstractConfigResolver { +public class DefaultConfigResolverImpl extends AbstractConfigResolver { // TODO: Inject platform SDK client when available // private final ConfigManagementClient configMgmtClient; diff --git a/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultContextResolver.java b/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultContextResolverImpl.java similarity index 97% rename from modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultContextResolver.java rename to modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultContextResolverImpl.java index 4fa8eb22b..0e5928bc3 100644 --- a/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultContextResolver.java +++ b/modules/starter-application/src/main/java/org/fireflyframework/common/application/resolver/DefaultContextResolverImpl.java @@ -34,7 +34,7 @@ */ @Slf4j @RequiredArgsConstructor -public class DefaultContextResolver extends AbstractContextResolver { +public class DefaultContextResolverImpl extends AbstractContextResolver { private final SecurityContextPort securityContextPort; diff --git a/modules/starter-application/src/main/java/org/fireflyframework/common/application/security/DefaultSecurityAuthorizationService.java b/modules/starter-application/src/main/java/org/fireflyframework/common/application/security/DefaultSecurityAuthorizationServiceImpl.java similarity index 96% rename from modules/starter-application/src/main/java/org/fireflyframework/common/application/security/DefaultSecurityAuthorizationService.java rename to modules/starter-application/src/main/java/org/fireflyframework/common/application/security/DefaultSecurityAuthorizationServiceImpl.java index b292bbddf..931ba14b2 100644 --- a/modules/starter-application/src/main/java/org/fireflyframework/common/application/security/DefaultSecurityAuthorizationService.java +++ b/modules/starter-application/src/main/java/org/fireflyframework/common/application/security/DefaultSecurityAuthorizationServiceImpl.java @@ -53,7 +53,7 @@ * @since 1.0.0 */ @Slf4j -public class DefaultSecurityAuthorizationService extends AbstractSecurityAuthorizationService { +public class DefaultSecurityAuthorizationServiceImpl extends AbstractSecurityAuthorizationService { // The parent AbstractSecurityAuthorizationService already provides everything needed: // - Role checking (checkRoles) diff --git a/modules/starter-application/src/main/resources/META-INF/spring.factories b/modules/starter-application/src/main/resources/META-INF/spring.factories index 92162d268..e38f667f3 100644 --- a/modules/starter-application/src/main/resources/META-INF/spring.factories +++ b/modules/starter-application/src/main/resources/META-INF/spring.factories @@ -1 +1 @@ -org.springframework.boot.EnvironmentPostProcessor=org.fireflyframework.common.application.config.StatelessApplicationEnvironmentPostProcessor +org.springframework.boot.EnvironmentPostProcessor=org.fireflyframework.common.application.config.StatelessApplicationEnvironmentPostProcessorImpl diff --git a/modules/starter-application/src/test/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributorTest.java b/modules/starter-application/src/test/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributorTest.java index e8c3fef20..0b813c17a 100644 --- a/modules/starter-application/src/test/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributorTest.java +++ b/modules/starter-application/src/test/java/org/fireflyframework/common/application/actuator/FireflyApplicationInfoContributorTest.java @@ -33,7 +33,7 @@ @DisplayName("FireflyApplicationInfoContributor Tests") class FireflyApplicationInfoContributorTest { - private FireflyApplicationInfoContributor infoContributor; + private FireflyApplicationInfoContributorImpl infoContributor; @Test @DisplayName("Should contribute complete application metadata") @@ -67,7 +67,7 @@ void shouldContributeCompleteMetadata() { .customProperties(new HashMap<>()) .build(); - infoContributor = new FireflyApplicationInfoContributor(metadata); + infoContributor = new FireflyApplicationInfoContributorImpl(metadata); Info.Builder builder = new Info.Builder(); // When @@ -116,7 +116,7 @@ void shouldContributeMinimalMetadata() { .customProperties(new HashMap<>()) .build(); - infoContributor = new FireflyApplicationInfoContributor(metadata); + infoContributor = new FireflyApplicationInfoContributorImpl(metadata); Info.Builder builder = new Info.Builder(); // When @@ -162,7 +162,7 @@ void shouldUseDisplayName() { .customProperties(new HashMap<>()) .build(); - infoContributor = new FireflyApplicationInfoContributor(metadata); + infoContributor = new FireflyApplicationInfoContributorImpl(metadata); Info.Builder builder = new Info.Builder(); // When @@ -195,7 +195,7 @@ void shouldIncludeDeprecationMessage() { .customProperties(new HashMap<>()) .build(); - infoContributor = new FireflyApplicationInfoContributor(metadata); + infoContributor = new FireflyApplicationInfoContributorImpl(metadata); Info.Builder builder = new Info.Builder(); // When @@ -232,7 +232,7 @@ void shouldNotIncludeEmptyCollections() { .customProperties(new HashMap<>()) .build(); - infoContributor = new FireflyApplicationInfoContributor(metadata); + infoContributor = new FireflyApplicationInfoContributorImpl(metadata); Info.Builder builder = new Info.Builder(); // When @@ -270,7 +270,7 @@ void shouldIncludeStartupTime() { .customProperties(new HashMap<>()) .build(); - infoContributor = new FireflyApplicationInfoContributor(metadata); + infoContributor = new FireflyApplicationInfoContributorImpl(metadata); Info.Builder builder = new Info.Builder(); // When diff --git a/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfigTest.java b/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfigTest.java index fd0b2fdfa..76f48c293 100644 --- a/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfigTest.java +++ b/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/ApplicationLayerBannerConfigTest.java @@ -33,13 +33,13 @@ @DisplayName("ApplicationLayerBannerConfig Tests") class ApplicationLayerBannerConfigTest { - private ApplicationLayerBannerConfig bannerConfig; + private ApplicationLayerBannerConfigImpl bannerConfig; private ApplicationStartingEvent event; private SpringApplication springApplication; @BeforeEach void setUp() { - bannerConfig = new ApplicationLayerBannerConfig(); + bannerConfig = new ApplicationLayerBannerConfigImpl(); springApplication = mock(SpringApplication.class); event = mock(ApplicationStartingEvent.class); when(event.getSpringApplication()).thenReturn(springApplication); diff --git a/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/ApplicationStartupTest.java b/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/ApplicationStartupTest.java index 593907b96..f2945df66 100644 --- a/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/ApplicationStartupTest.java +++ b/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/ApplicationStartupTest.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.common.application.metadata.ApplicationMetadataProvider; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -28,7 +28,7 @@ class ApplicationStartupTest { @Autowired CacheManager cacheManager; - @Autowired FireflyCacheManager fireflyCacheManager; + @Autowired FireflyCacheManagerImpl fireflyCacheManager; @Autowired ApplicationContext applicationContext; diff --git a/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/FeatureCacheServiceNamespaceTest.java b/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/FeatureCacheServiceNamespaceTest.java index 9d5b31809..4e16329df 100644 --- a/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/FeatureCacheServiceNamespaceTest.java +++ b/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/FeatureCacheServiceNamespaceTest.java @@ -13,7 +13,7 @@ import org.fireflyframework.cache.config.PostgresCacheAutoConfiguration; 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.cache.properties.CacheProperties; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -43,13 +43,13 @@ ConnectionFactory factory(AtomicReference namespaceBinding,AtomicInteger .withConfiguration(AutoConfigurations.of(CacheAutoConfiguration.class,PostgresCacheAutoConfiguration.class)) .withUserConfiguration(TechnicalStorage.class); - FireflyCacheManager feature(CacheManagerFactory factory) {return new ConfigCacheAutoConfiguration().configCacheManager(factory);} + FireflyCacheManagerImpl feature(CacheManagerFactory factory) {return new ConfigCacheAutoConfiguration().configCacheManager(factory);} String namespace(String service,boolean useFeature) { var captured=new AtomicReference(); context.withPropertyValues("spring.application.name="+service).run(application -> { assertThat(application).hasNotFailed(); var manager=useFeature?feature(application.getBean(CacheManagerFactory.class)) - :application.getBean("fireflyCacheManager",FireflyCacheManager.class); + :application.getBean("fireflyCacheManager",FireflyCacheManagerImpl.class); manager.clear().block(java.time.Duration.ofSeconds(2)); captured.set(application.getBean(AtomicReference.class).get().toString()); });return captured.get(); diff --git a/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/PostgresCacheArchitectureContextTest.java b/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/PostgresCacheArchitectureContextTest.java index 23efcfc34..57a064ab4 100644 --- a/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/PostgresCacheArchitectureContextTest.java +++ b/modules/starter-application/src/test/java/org/fireflyframework/common/application/config/PostgresCacheArchitectureContextTest.java @@ -60,7 +60,7 @@ ConnectionFactory technicalCacheFactory() { void statelessRole() { context.withInitializer(application -> { - String expected = "org.fireflyframework.common.application.config.StatelessApplicationEnvironmentPostProcessor"; + String expected = "org.fireflyframework.common.application.config.StatelessApplicationEnvironmentPostProcessorImpl"; boolean registered = false; try { var resources = getClass().getClassLoader().getResources("META-INF/spring.factories"); @@ -74,11 +74,11 @@ void statelessRole() { throw new IllegalStateException("Cannot read starter registration", error); } assertThat(registered).as("actual starter EnvironmentPostProcessor registration").isTrue(); - new StatelessApplicationEnvironmentPostProcessor().postProcessEnvironment(application.getEnvironment(), new SpringApplication()); + new StatelessApplicationEnvironmentPostProcessorImpl().postProcessEnvironment(application.getEnvironment(), new SpringApplication()); }).withPropertyValues("spring.autoconfigure.exclude=org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration") .run(application -> { assertThat(application).hasNotFailed(); - assertThat(application.getBean(org.fireflyframework.cache.manager.FireflyCacheManager.class).getCacheType()) + assertThat(application.getBean(org.fireflyframework.cache.manager.FireflyCacheManagerImpl.class).getCacheType()) .isEqualTo(org.fireflyframework.cache.core.CacheType.POSTGRES); assertThat(application).doesNotHaveBean("connectionFactory"); assertThat(application).doesNotHaveBean(R2dbcEntityTemplate.class); diff --git a/modules/starter-application/src/test/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicatorTest.java b/modules/starter-application/src/test/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicatorTest.java index 25a404caf..da46dd2fa 100644 --- a/modules/starter-application/src/test/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicatorTest.java +++ b/modules/starter-application/src/test/java/org/fireflyframework/common/application/health/ApplicationLayerHealthIndicatorTest.java @@ -30,11 +30,11 @@ @DisplayName("ApplicationLayerHealthIndicator Tests") class ApplicationLayerHealthIndicatorTest { - private ApplicationLayerHealthIndicator healthIndicator; + private ApplicationLayerHealthIndicatorImpl healthIndicator; @BeforeEach void setUp() { - healthIndicator = new ApplicationLayerHealthIndicator(); + healthIndicator = new ApplicationLayerHealthIndicatorImpl(); } @Test diff --git a/modules/starter-application/src/test/java/org/fireflyframework/common/application/integration/SecurityAuthorizationIntegrationTest.java b/modules/starter-application/src/test/java/org/fireflyframework/common/application/integration/SecurityAuthorizationIntegrationTest.java index 0b149c5cf..ce0001022 100644 --- a/modules/starter-application/src/test/java/org/fireflyframework/common/application/integration/SecurityAuthorizationIntegrationTest.java +++ b/modules/starter-application/src/test/java/org/fireflyframework/common/application/integration/SecurityAuthorizationIntegrationTest.java @@ -18,7 +18,7 @@ import org.fireflyframework.common.application.context.AppContext; import org.fireflyframework.common.application.context.AppSecurityContext; -import org.fireflyframework.common.application.security.DefaultSecurityAuthorizationService; +import org.fireflyframework.common.application.security.DefaultSecurityAuthorizationServiceImpl; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -44,14 +44,14 @@ @DisplayName("Security Authorization Integration Tests") class SecurityAuthorizationIntegrationTest { - private DefaultSecurityAuthorizationService authorizationService; + private DefaultSecurityAuthorizationServiceImpl authorizationService; private String testSubject; private UUID testTenantId; @BeforeEach void setUp() { - authorizationService = new DefaultSecurityAuthorizationService(); + authorizationService = new DefaultSecurityAuthorizationServiceImpl(); testSubject = "user-" + UUID.randomUUID(); testTenantId = UUID.randomUUID(); diff --git a/modules/starter-core/docs/API.md b/modules/starter-core/docs/API.md index 09e7ee94d..ebf3dc97e 100644 --- a/modules/starter-core/docs/API.md +++ b/modules/starter-core/docs/API.md @@ -9,7 +9,7 @@ The core starter configures shared HTTP-client infrastructure. In the onboarding | [WebClientTemplate](../src/main/java/org/fireflyframework/core/web/client/WebClientTemplate.java) | Reactive GET, GET stream, POST, PUT, and DELETE helpers with request exchange context. | | [WebClientProperties](../src/main/java/org/fireflyframework/core/config/WebClientProperties.java) | Bind firefly.webclient connection, TLS, proxy, pool, and codec settings. | | [HeaderPropagationProperties](../src/main/java/org/fireflyframework/core/config/HeaderPropagationProperties.java) | Bind the enabled flag and allowed headers under firefly.webclient.propagation. | -| [TransactionFilter](../src/main/java/org/fireflyframework/core/config/TransactionFilter.java) | Carry the X-Transaction-Id request correlation value. | +| [TransactionFilterImpl](../src/main/java/org/fireflyframework/core/config/TransactionFilterImpl.java) | Carry the X-Transaction-Id request correlation value. | | [WebClientAutoConfiguration](../src/main/java/org/fireflyframework/core/config/WebClientAutoConfiguration.java) | Create the configured WebClient infrastructure when its conditions match. | `WebClientTemplate.get(baseUrl, path, responseType, exchange)` returns a `Mono`; the overload accepting `ParameterizedTypeReference` handles generic response types. `getFlux` returns a `Flux`. Compose those publishers in the service operation rather than blocking a WebFlux request thread. diff --git a/modules/starter-core/docs/ARCHITECTURE.md b/modules/starter-core/docs/ARCHITECTURE.md index 596d8be82..e77c9a4ca 100644 --- a/modules/starter-core/docs/ARCHITECTURE.md +++ b/modules/starter-core/docs/ARCHITECTURE.md @@ -132,8 +132,8 @@ graph TB C --> D[EventPublisherFactory] D --> E{Publisher Selection} - E -->|Kafka| F[KafkaEventPublisher] - E -->|RabbitMQ| G[RabbitMqEventPublisher] + E -->|Kafka| F[KafkaEventPublisherImpl] + E -->|RabbitMQ| G[RabbitMqEventPublisherImpl] E -->|SQS| H[SqsEventPublisher] E -->|Pub/Sub| I[GooglePubSubEventPublisher] E -->|Service Bus| J[AzureServiceBusEventPublisher] @@ -142,7 +142,7 @@ graph TB E -->|Kinesis| M[KinesisEventPublisher] E -->|Spring Events| N[SpringEventPublisher] - F --> O[ResilientEventPublisher] + F --> O[ResilientEventPublisherImpl] G --> O H --> O I --> O @@ -211,8 +211,8 @@ public interface ConnectionAwarePublisher { | Publisher | Implementation Class | Key Features | |-----------|---------------------|--------------| -| **Kafka** | `KafkaEventPublisher` | Topic-based, high throughput, ordered delivery | -| **RabbitMQ** | `RabbitMqEventPublisher` | Exchange/routing key, flexible routing | +| **Kafka** | `KafkaEventPublisherImpl` | Topic-based, high throughput, ordered delivery | +| **RabbitMQ** | `RabbitMqEventPublisherImpl` | Exchange/routing key, flexible routing | | **AWS SQS** | `SqsEventPublisher` | Queue-based, managed service, FIFO support | | **Google Pub/Sub** | `GooglePubSubEventPublisher` | Topic-based, global distribution | | **Azure Service Bus** | `AzureServiceBusEventPublisher` | Topics/queues, enterprise features | @@ -457,7 +457,7 @@ public class EventPublisherFactory { if (publisher instanceof ConnectionAwarePublisher) { ((ConnectionAwarePublisher) publisher).setConnectionId(connectionId); } - return new ResilientEventPublisher(publisher, resilienceProperties); + return new ResilientEventPublisherImpl(publisher, resilienceProperties); } } ``` @@ -465,8 +465,8 @@ public class EventPublisherFactory { ### Decorator Pattern ```java -// ResilientEventPublisher wraps actual publishers with resilience -public class ResilientEventPublisher implements EventPublisher { +// ResilientEventPublisherImpl wraps actual publishers with resilience +public class ResilientEventPublisherImpl implements EventPublisher { private final EventPublisher delegate; private final CircuitBreaker circuitBreaker; diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/README.md b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/README.md index 824426a3e..dc0361287 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/README.md +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/README.md @@ -25,7 +25,7 @@ The Firefly Common Core actuator components extend Spring Boot Actuator with enh ### Current indicator contracts -Custom indicators implement Spring Boot's `org.springframework.boot.health.contributor.HealthIndicator` SPI. The starter's [LoggingHealthIndicator](health/LoggingHealthIndicator.java) is a current implementation; its [ActuatorProperties](config/ActuatorProperties.java) binds `firefly.actuator`. The former `AbstractMessagingHealthIndicator` example is not a shipped base class. +Custom indicators implement Spring Boot's `org.springframework.boot.health.contributor.HealthIndicator` SPI. The starter's [LoggingHealthIndicatorImpl](health/LoggingHealthIndicatorImpl.java) is a current implementation; its [ActuatorProperties](config/ActuatorProperties.java) binds `firefly.actuator`. The former `AbstractMessagingHealthIndicator` example is not a shipped base class. The custom examples below are application fragments. Their clients, probes, properties, and registration belong to the host service; they are not indicators automatically supplied for every messaging platform. diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/ActuatorDefaultPropertiesAutoConfiguration.java b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/ActuatorDefaultPropertiesAutoConfiguration.java index c247da6f9..30be9fdc8 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/ActuatorDefaultPropertiesAutoConfiguration.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/ActuatorDefaultPropertiesAutoConfiguration.java @@ -30,7 +30,7 @@ * for actuator endpoints, health checks, and metrics. */ @AutoConfiguration -@PropertySource(value = "classpath:application-actuator-default.yml", factory = YamlPropertySourceFactory.class) +@PropertySource(value = "classpath:application-actuator-default.yml", factory = YamlPropertySourceFactoryImpl.class) @ConfigurationPropertiesScan("org.fireflyframework.core.actuator.config") public class ActuatorDefaultPropertiesAutoConfiguration { // This class only loads the default properties diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/DefaultHealthAutoConfiguration.java b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/DefaultHealthAutoConfiguration.java index d42085ba1..abf693876 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/DefaultHealthAutoConfiguration.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/DefaultHealthAutoConfiguration.java @@ -17,7 +17,7 @@ package org.fireflyframework.core.actuator.config; -import org.fireflyframework.core.actuator.health.LoggingHealthIndicator; +import org.fireflyframework.core.actuator.health.LoggingHealthIndicatorImpl; import org.fireflyframework.core.logging.config.LoggingProperties; import org.springframework.boot.health.autoconfigure.contributor.HealthContributorAutoConfiguration; import org.springframework.boot.health.autoconfigure.actuate.endpoint.HealthEndpointAutoConfiguration; @@ -76,7 +76,7 @@ public DiskSpaceHealthIndicator diskSpaceHealthIndicator() { @Bean @ConditionalOnMissingBean @ConditionalOnBean(LoggingProperties.class) - public LoggingHealthIndicator loggingHealthIndicator(LoggingProperties loggingProperties) { - return new LoggingHealthIndicator(loggingProperties); + public LoggingHealthIndicatorImpl loggingHealthIndicator(LoggingProperties loggingProperties) { + return new LoggingHealthIndicatorImpl(loggingProperties); } } diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/TracingAutoConfiguration.java b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/TracingAutoConfiguration.java index c1e9d9d77..67f30e667 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/TracingAutoConfiguration.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/TracingAutoConfiguration.java @@ -32,7 +32,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.context.annotation.Bean; -import static org.fireflyframework.core.config.TransactionFilter.TRANSACTION_ID_HEADER; +import static org.fireflyframework.core.config.TransactionFilterImpl.TRANSACTION_ID_HEADER; /** * Configuration class for distributed tracing. diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/YamlPropertySourceFactory.java b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/YamlPropertySourceFactoryImpl.java similarity index 95% rename from modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/YamlPropertySourceFactory.java rename to modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/YamlPropertySourceFactoryImpl.java index c35abed52..7a0036657 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/YamlPropertySourceFactory.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/config/YamlPropertySourceFactoryImpl.java @@ -32,7 +32,7 @@ * This class allows loading YAML files as property sources in Spring, * which is used to load the default actuator configuration. */ -public class YamlPropertySourceFactory implements PropertySourceFactory { +public class YamlPropertySourceFactoryImpl implements PropertySourceFactory { @Override public PropertySource createPropertySource(String name, EncodedResource resource) throws IOException { diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/health/LoggingHealthIndicator.java b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/health/LoggingHealthIndicatorImpl.java similarity index 97% rename from modules/starter-core/src/main/java/org/fireflyframework/core/actuator/health/LoggingHealthIndicator.java rename to modules/starter-core/src/main/java/org/fireflyframework/core/actuator/health/LoggingHealthIndicatorImpl.java index 0cee0c36d..d3bee266b 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/health/LoggingHealthIndicator.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/actuator/health/LoggingHealthIndicatorImpl.java @@ -38,7 +38,7 @@ *
  • Overall system performance
  • * */ -public class LoggingHealthIndicator implements HealthIndicator { +public class LoggingHealthIndicatorImpl implements HealthIndicator { private final LoggingProperties loggingProperties; @@ -50,7 +50,7 @@ public class LoggingHealthIndicator implements HealthIndicator { private static final long RECURSION_LIMIT_WARNING_THRESHOLD = 10; private static final long RECURSION_LIMIT_ERROR_THRESHOLD = 100; - public LoggingHealthIndicator(LoggingProperties loggingProperties) { + public LoggingHealthIndicatorImpl(LoggingProperties loggingProperties) { this.loggingProperties = loggingProperties; } diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/config/FireflyBannerAutoConfiguration.java b/modules/starter-core/src/main/java/org/fireflyframework/core/config/FireflyBannerAutoConfiguration.java index c027a7ef3..f980ac3f7 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/config/FireflyBannerAutoConfiguration.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/config/FireflyBannerAutoConfiguration.java @@ -59,7 +59,7 @@ public class FireflyBannerAutoConfiguration implements ApplicationListener sourceClass, PrintStream out) { diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationExchangeFilter.java b/modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationExchangeFilterImpl.java similarity index 92% rename from modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationExchangeFilter.java rename to modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationExchangeFilterImpl.java index 97bb91b25..6fe1635e7 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationExchangeFilter.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationExchangeFilterImpl.java @@ -35,14 +35,14 @@ *

    Headers already present on the outgoing request are left untouched, so an explicit * per-call override always wins over the propagated value.

    */ -public class HeaderPropagationExchangeFilter implements ExchangeFilterFunction { +public class HeaderPropagationExchangeFilterImpl implements ExchangeFilterFunction { @Override @SuppressWarnings("unchecked") public Mono filter(ClientRequest request, ExchangeFunction next) { return Mono.deferContextual(ctx -> { Map headers = (Map) ctx.getOrDefault( - HeaderPropagationWebFilter.PROPAGATED_HEADERS_CONTEXT_KEY, Map.of()); + HeaderPropagationWebFilterImpl.PROPAGATED_HEADERS_CONTEXT_KEY, Map.of()); if (headers.isEmpty()) { return next.exchange(request); } diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationWebFilter.java b/modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationWebFilterImpl.java similarity index 95% rename from modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationWebFilter.java rename to modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationWebFilterImpl.java index f0358ff46..b2c2614a0 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationWebFilter.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/config/HeaderPropagationWebFilterImpl.java @@ -40,14 +40,14 @@ */ @Order(Ordered.HIGHEST_PRECEDENCE + 10) @Slf4j -public class HeaderPropagationWebFilter implements WebFilter { +public class HeaderPropagationWebFilterImpl implements WebFilter { /** Reactive-context key holding the captured {@code header-name -> value} snapshot. */ public static final String PROPAGATED_HEADERS_CONTEXT_KEY = "firefly.propagated-headers"; private final HeaderPropagationProperties properties; - public HeaderPropagationWebFilter(HeaderPropagationProperties properties) { + public HeaderPropagationWebFilterImpl(HeaderPropagationProperties properties) { this.properties = properties; } diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/config/TransactionFilter.java b/modules/starter-core/src/main/java/org/fireflyframework/core/config/TransactionFilterImpl.java similarity index 97% rename from modules/starter-core/src/main/java/org/fireflyframework/core/config/TransactionFilter.java rename to modules/starter-core/src/main/java/org/fireflyframework/core/config/TransactionFilterImpl.java index 9f525736a..c5d4bedd9 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/config/TransactionFilter.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/config/TransactionFilterImpl.java @@ -34,10 +34,10 @@ * A WebFilter that adds a unique X-Transaction-Id header to incoming requests * and outgoing responses, and propagates it in the reactive context. */ -@Component +@Component("transactionFilter") @Order(Ordered.HIGHEST_PRECEDENCE) @Slf4j -public class TransactionFilter implements WebFilter { +public class TransactionFilterImpl implements WebFilter { public static final String TRANSACTION_ID_HEADER = "X-Transaction-Id"; @Override diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/config/WebClientAutoConfiguration.java b/modules/starter-core/src/main/java/org/fireflyframework/core/config/WebClientAutoConfiguration.java index ff25ee0fa..34d577849 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/config/WebClientAutoConfiguration.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/config/WebClientAutoConfiguration.java @@ -42,7 +42,7 @@ import org.springframework.web.reactive.function.client.WebClient; import reactor.core.publisher.Mono; -import static org.fireflyframework.core.config.TransactionFilter.TRANSACTION_ID_HEADER; +import static org.fireflyframework.core.config.TransactionFilterImpl.TRANSACTION_ID_HEADER; /** * Configuration class for creating and customizing a {@link WebClient} bean. @@ -116,8 +116,8 @@ private WebClient.Builder observedBuilder() { */ @Bean @ConditionalOnMissingBean - HeaderPropagationWebFilter headerPropagationWebFilter(HeaderPropagationProperties properties) { - return new HeaderPropagationWebFilter(properties); + HeaderPropagationWebFilterImpl headerPropagationWebFilter(HeaderPropagationProperties properties) { + return new HeaderPropagationWebFilterImpl(properties); } /** @@ -126,8 +126,8 @@ HeaderPropagationWebFilter headerPropagationWebFilter(HeaderPropagationPropertie */ @Bean @ConditionalOnMissingBean - HeaderPropagationExchangeFilter headerPropagationExchangeFilter() { - return new HeaderPropagationExchangeFilter(); + HeaderPropagationExchangeFilterImpl headerPropagationExchangeFilter() { + return new HeaderPropagationExchangeFilterImpl(); } /** @@ -138,7 +138,7 @@ HeaderPropagationExchangeFilter headerPropagationExchangeFilter() { */ @Bean @ConditionalOnMissingBean - WebClient webClient(HeaderPropagationExchangeFilter headerPropagationExchangeFilter) { + WebClient webClient(HeaderPropagationExchangeFilterImpl headerPropagationExchangeFilter) { // Create a WebClient.Builder with transaction ID + allow-listed header propagation WebClient.Builder builder = observedBuilder() .filter((request, next) -> @@ -184,7 +184,7 @@ WebClient webClient(HeaderPropagationExchangeFilter headerPropagationExchangeFil */ @Bean @ConditionalOnMissingBean - WebClient.Builder webClientBuilder(HeaderPropagationExchangeFilter headerPropagationExchangeFilter) { + WebClient.Builder webClientBuilder(HeaderPropagationExchangeFilterImpl headerPropagationExchangeFilter) { // Create a WebClient.Builder with transaction ID + allow-listed header propagation WebClient.Builder builder = observedBuilder() .filter((request, next) -> diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/config/WebFilterAutoConfiguration.java b/modules/starter-core/src/main/java/org/fireflyframework/core/config/WebFilterAutoConfiguration.java index 8e99c869b..45070c170 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/config/WebFilterAutoConfiguration.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/config/WebFilterAutoConfiguration.java @@ -25,7 +25,7 @@ public class WebFilterAutoConfiguration { @Bean @ConditionalOnMissingBean - public TransactionFilter transactionFilter() { - return new TransactionFilter(); + public TransactionFilterImpl transactionFilter() { + return new TransactionFilterImpl(); } } diff --git a/modules/starter-core/src/main/java/org/fireflyframework/core/logging/examples/LoggingExampleRunner.java b/modules/starter-core/src/main/java/org/fireflyframework/core/logging/examples/LoggingExampleRunnerImpl.java similarity index 94% rename from modules/starter-core/src/main/java/org/fireflyframework/core/logging/examples/LoggingExampleRunner.java rename to modules/starter-core/src/main/java/org/fireflyframework/core/logging/examples/LoggingExampleRunnerImpl.java index 70f249aac..c0b5d4e41 100644 --- a/modules/starter-core/src/main/java/org/fireflyframework/core/logging/examples/LoggingExampleRunner.java +++ b/modules/starter-core/src/main/java/org/fireflyframework/core/logging/examples/LoggingExampleRunnerImpl.java @@ -35,14 +35,14 @@ * To enable this example, set the property: * {@code logging.example.enabled=true} */ -@Component +@Component("loggingExampleRunner") @Slf4j @ConditionalOnProperty(prefix = "logging.example", name = "enabled", havingValue = "true") -public class LoggingExampleRunner implements CommandLineRunner { +public class LoggingExampleRunnerImpl implements CommandLineRunner { private final LoggingExample loggingExample; - public LoggingExampleRunner(LoggingExample loggingExample) { + public LoggingExampleRunnerImpl(LoggingExample loggingExample) { this.loggingExample = loggingExample; } diff --git a/modules/starter-core/src/test/java/org/fireflyframework/core/logging/LoggingUtilsTest.java b/modules/starter-core/src/test/java/org/fireflyframework/core/logging/LoggingUtilsTest.java index dca573f9a..fbe9745c1 100644 --- a/modules/starter-core/src/test/java/org/fireflyframework/core/logging/LoggingUtilsTest.java +++ b/modules/starter-core/src/test/java/org/fireflyframework/core/logging/LoggingUtilsTest.java @@ -283,12 +283,12 @@ void structuredLogHandlesComplexNestedJson() { Map result = LoggingUtils.log("HTTP Request Logging") .with("responseData", complexJson) - .with("logger", "org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilter") + .with("logger", "org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilterImpl") .with("thread", "reactor-tcp-nio-5") .build(); assertEquals("HTTP Request Logging", result.get("message")); - assertEquals("org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilter", result.get("logger")); + assertEquals("org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilterImpl", result.get("logger")); assertEquals("reactor-tcp-nio-5", result.get("thread")); // Complex JSON should be parsed in the responseData field @@ -451,7 +451,7 @@ void structuredLogHandlesRealWorldMicroserviceExample() { String microserviceLogMessage = "{\"durationMs\":140,\"headers\":{\"Content-Length\":\"117\",\"Content-Type\":\"application/json\",\"Vary\":[\"Origin\",\"Access-Control-Request-Method\",\"Access-Control-Request-Headers\"],\"X-Transaction-Id\":\"03132499-e3be-461c-a2b7-633d3c98c37f\",\"transfer-encoding\":\"chunked\"},\"requestId\":\"67132534563458\",\"statusCode\":201,\"timestamp\":\"2025-08-23T09:30:25.443559Z\",\"type\":\"HTTP_RESPONSE\"}"; Map result = LoggingUtils.log(microserviceLogMessage) - .with("logger", "org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilter") + .with("logger", "org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilterImpl") .with("thread", "reactor-tcp-nio-5") .with("level", "INFO") .with("HOSTNAME", "Andress-MacBook-Pro.local") @@ -483,7 +483,7 @@ void structuredLogHandlesRealWorldMicroserviceExample() { assertEquals("Access-Control-Request-Headers", varyNode.get(2).asText()); // Other fields should remain as strings - assertEquals("org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilter", result.get("logger")); + assertEquals("org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilterImpl", result.get("logger")); assertEquals("reactor-tcp-nio-5", result.get("thread")); assertEquals("INFO", result.get("level")); } diff --git a/modules/starter-data/docs/README.md b/modules/starter-data/docs/README.md index 814ecccbf..7af75872e 100644 --- a/modules/starter-data/docs/README.md +++ b/modules/starter-data/docs/README.md @@ -128,7 +128,7 @@ Composable, reactive transformation chains for post-enrichment data processing. Key features: - Reactive `DataTransformer` interface with `TransformationChain` composition -- Built-in transformers: `FieldMappingTransformer`, `ComputedFieldTransformer` +- Built-in transformers: `FieldMappingTransformerImpl`, `ComputedFieldTransformerImpl` - Custom transformer support via functional interface --- diff --git a/modules/starter-data/docs/common/api-reference.md b/modules/starter-data/docs/common/api-reference.md index 513165450..c6332335e 100644 --- a/modules/starter-data/docs/common/api-reference.md +++ b/modules/starter-data/docs/common/api-reference.md @@ -1812,9 +1812,9 @@ Flux byOp = lineageTracker.getLineageByOperator("EquifaxCreditEnr // Build a transformation chain TransformationChain, Map> chain = TransformationChain.of( - new FieldMappingTransformer(Map.of("first_name", "firstName", "last_name", "lastName")) + new FieldMappingTransformerImpl(Map.of("first_name", "firstName", "last_name", "lastName")) ).then( - new ComputedFieldTransformer(Map.of( + new ComputedFieldTransformerImpl(Map.of( "fullName", data -> data.get("firstName") + " " + data.get("lastName") )) ); diff --git a/modules/starter-data/docs/common/architecture.md b/modules/starter-data/docs/common/architecture.md index ddabed061..9943a6826 100644 --- a/modules/starter-data/docs/common/architecture.md +++ b/modules/starter-data/docs/common/architecture.md @@ -289,9 +289,9 @@ quality/ ├── QualitySeverity # INFO, WARNING, CRITICAL ├── QualityStrategy # FAIL_FAST, COLLECT_ALL └── rules/ - ├── NotNullRule # Built-in: required field validation - ├── PatternRule # Built-in: regex pattern validation - └── RangeRule # Built-in: numeric range validation + ├── NotNullRuleImpl # Built-in: required field validation + ├── PatternRuleImpl # Built-in: regex pattern validation + └── RangeRuleImpl # Built-in: numeric range validation ``` ### 9. Data Lineage Layer @@ -302,7 +302,7 @@ Provenance tracking for data operations: lineage/ ├── LineageTracker # Port interface ├── LineageRecord # Immutable lineage entry -└── InMemoryLineageTracker # Default in-memory implementation +└── InMemoryLineageTrackerImpl # Default in-memory implementation ``` ### 10. Data Transformation Layer @@ -314,8 +314,8 @@ transform/ ├── DataTransformer # Functional interface ├── TransformationChain # Composable chain with then() ├── TransformContext # Request context carrier -├── FieldMappingTransformer # Rename map keys -└── ComputedFieldTransformer # Add derived fields +├── FieldMappingTransformerImpl # Rename map keys +└── ComputedFieldTransformerImpl # Add derived fields ``` ### 11. Enrichment Fallback Layer @@ -624,7 +624,7 @@ Purpose: Quality gate event publishing Implementation: - `DataQualityEngine` publishes `DataQualityEvent` on evaluation -- `InMemoryLineageTracker` publishes `LineageEvent` on record +- `InMemoryLineageTrackerImpl` publishes `LineageEvent` on record - Spring's `ApplicationEventPublisher` for decoupled notifications --- diff --git a/modules/starter-data/docs/common/configuration.md b/modules/starter-data/docs/common/configuration.md index 5f2549565..17ae141d3 100644 --- a/modules/starter-data/docs/common/configuration.md +++ b/modules/starter-data/docs/common/configuration.md @@ -374,7 +374,7 @@ firefly: |----------|------|---------|-------------| | `enabled` | boolean | `false` | Enable lineage tracking auto-configuration | -When enabled, an `InMemoryLineageTracker` bean is created. For production, provide your own `LineageTracker` implementation backed by a persistent store. +When enabled, an `InMemoryLineageTrackerImpl` bean is created. For production, provide your own `LineageTracker` implementation backed by a persistent store. --- diff --git a/modules/starter-data/docs/common/data-lineage.md b/modules/starter-data/docs/common/data-lineage.md index 5ae64d001..c814e55ec 100644 --- a/modules/starter-data/docs/common/data-lineage.md +++ b/modules/starter-data/docs/common/data-lineage.md @@ -14,7 +14,7 @@ This document provides a comprehensive guide to the data lineage tracking framew - [Architecture](#architecture) - [Configuration](#configuration) - [LineageRecord Fields](#lineagerecord-fields) -- [InMemoryLineageTracker](#inmemorylineagetracker) +- [InMemoryLineageTrackerImpl](#inmemorylineagetracker) - [Recording Lineage Programmatically](#recording-lineage-programmatically) - [Querying Lineage](#querying-lineage) - [Creating a Custom LineageTracker](#creating-a-custom-lineagetracker) @@ -70,7 +70,7 @@ Key classes: |---|---|---| | `LineageTracker` | `o.f.data.lineage` | Port interface for recording and querying lineage | | `LineageRecord` | `o.f.data.lineage` | Immutable record of a single provenance step | -| `InMemoryLineageTracker` | `o.f.data.lineage` | Default in-memory implementation | +| `InMemoryLineageTrackerImpl` | `o.f.data.lineage` | Default in-memory implementation | | `DataLineageAutoConfiguration` | `o.f.data.config` | Auto-configures the tracker from Spring properties | --- @@ -86,7 +86,7 @@ firefly: enabled: true # default: false (must be explicitly enabled) ``` -When enabled, `DataLineageAutoConfiguration` creates an `InMemoryLineageTracker` bean unless you provide your own `LineageTracker` bean (via `@ConditionalOnMissingBean`). +When enabled, `DataLineageAutoConfiguration` creates an `InMemoryLineageTrackerImpl` bean unless you provide your own `LineageTracker` bean (via `@ConditionalOnMissingBean`). To disable lineage tracking (the default): @@ -145,9 +145,9 @@ LineageRecord record = LineageRecord.builder() --- -## InMemoryLineageTracker +## InMemoryLineageTrackerImpl -The default `InMemoryLineageTracker` is a thread-safe implementation that stores lineage records in memory using a `ConcurrentHashMap>`, where each entity's records are backed by a `CopyOnWriteArrayList`. +The default `InMemoryLineageTrackerImpl` is a thread-safe implementation that stores lineage records in memory using a `ConcurrentHashMap>`, where each entity's records are backed by a `CopyOnWriteArrayList`. ### Characteristics @@ -359,7 +359,7 @@ public class R2dbcLineageTracker implements LineageTracker { } ``` -When you provide your own `LineageTracker` bean, the auto-configuration's `InMemoryLineageTracker` is automatically skipped due to `@ConditionalOnMissingBean`. +When you provide your own `LineageTracker` bean, the auto-configuration's `InMemoryLineageTrackerImpl` is automatically skipped due to `@ConditionalOnMissingBean`. --- @@ -408,7 +408,7 @@ public class LineageAwareEnricher { 1. Enable lineage explicitly. Lineage tracking is opt-in (`matchIfMissing = false`) because it adds overhead. Enable it only when you need auditability or governance. -2. Implement a persistent tracker for production. The `InMemoryLineageTracker` is suitable for development and testing. Production deployments should use a database-backed (relational, graph, or event log) implementation to ensure lineage survives restarts and is shared across replicas. +2. Implement a persistent tracker for production. The `InMemoryLineageTrackerImpl` is suitable for development and testing. Production deployments should use a database-backed (relational, graph, or event log) implementation to ensure lineage survives restarts and is shared across replicas. 3. Always set `entityId` and `operatorId`. These are the primary query dimensions. Consistent entity IDs enable reconstructing the full provenance chain; consistent operator IDs enable tracing all operations from a given enricher or job. diff --git a/modules/starter-data/docs/common/data-quality.md b/modules/starter-data/docs/common/data-quality.md index 09e41a044..6a51c8d25 100644 --- a/modules/starter-data/docs/common/data-quality.md +++ b/modules/starter-data/docs/common/data-quality.md @@ -56,10 +56,10 @@ The framework follows the hexagonal architecture pattern: rules are ports (abstr │ ┌──────────┴───────────────────────────────────┐ │ │ │ Built-in Adapters │ │ │ │ ┌──────────────┐ ┌──────────────┐ │ │ -│ │ │ NotNullRule │ │ PatternRule │ │ │ +│ │ │ NotNullRuleImpl │ │ PatternRuleImpl │ │ │ │ │ └──────────────┘ └──────────────┘ │ │ │ │ ┌──────────────┐ ┌──────────────┐ │ │ -│ │ │ RangeRule │ │ CustomRule │ │ │ +│ │ │ RangeRuleImpl │ │ CustomRule │ │ │ │ │ └──────────────┘ └──────────────┘ │ │ │ └──────────────────────────────────────────────┘ │ │ │ @@ -77,9 +77,9 @@ Key classes: | `QualityReport` | `o.f.data.quality` | Aggregated report with pass/fail statistics | | `QualitySeverity` | `o.f.data.quality` | Enum: `INFO`, `WARNING`, `CRITICAL` | | `QualityStrategy` | `o.f.data.quality` | Enum: `FAIL_FAST`, `COLLECT_ALL` | -| `NotNullRule` | `o.f.data.quality.rules` | Validates a field is not null | -| `PatternRule` | `o.f.data.quality.rules` | Validates a string field matches a regex | -| `RangeRule` | `o.f.data.quality.rules` | Validates a comparable field is within a range | +| `NotNullRuleImpl` | `o.f.data.quality.rules` | Validates a field is not null | +| `PatternRuleImpl` | `o.f.data.quality.rules` | Validates a string field matches a regex | +| `RangeRuleImpl` | `o.f.data.quality.rules` | Validates a comparable field is within a range | | `DataQualityAutoConfiguration` | `o.f.data.config` | Auto-configures the engine from Spring beans | | `DataQualityEvent` | `o.f.data.event` | Spring event published after each evaluation | @@ -167,19 +167,19 @@ engine.evaluate(data, QualityStrategy.COLLECT_ALL) The framework ships three built-in rule implementations in the `o.f.data.quality.rules` package. Each accepts a field name, an extractor function, and an optional severity override. -### NotNullRule +### NotNullRuleImpl Validates that a field extracted from the data object is not null. ```java // Default severity (WARNING) -DataQualityRule rule = new NotNullRule<>( +DataQualityRule rule = new NotNullRuleImpl<>( "email", Customer::getEmail ); // With CRITICAL severity -DataQualityRule criticalRule = new NotNullRule<>( +DataQualityRule criticalRule = new NotNullRuleImpl<>( "customerId", Customer::getId, QualitySeverity.CRITICAL @@ -190,7 +190,7 @@ Rule name format: `not-null:` (e.g., `not-null:email`) Failure message: `" must not be null"` -### PatternRule +### PatternRuleImpl Validates that a string field matches a compiled regular expression pattern. @@ -198,14 +198,14 @@ Validates that a string field matches a compiled regular expression pattern. import java.util.regex.Pattern; // Email format validation -DataQualityRule emailRule = new PatternRule<>( +DataQualityRule emailRule = new PatternRuleImpl<>( "email", Pattern.compile("^[\\w.+-]+@[\\w-]+\\.[a-zA-Z]{2,}$"), Customer::getEmail ); // Phone number with CRITICAL severity -DataQualityRule phoneRule = new PatternRule<>( +DataQualityRule phoneRule = new PatternRuleImpl<>( "phone", Pattern.compile("^\\+?[1-9]\\d{1,14}$"), Customer::getPhone, @@ -219,20 +219,20 @@ Failure message: `" does not match pattern: "` Note: If the extracted value is null, the rule fails (null does not match any pattern). -### RangeRule +### RangeRuleImpl Validates that a `Comparable` field falls within a minimum/maximum range (inclusive). Either bound can be `null` to make the range open-ended. ```java // Age between 0 and 150 -DataQualityRule ageRule = new RangeRule<>( +DataQualityRule ageRule = new RangeRuleImpl<>( "age", 0, 150, customer -> customer.getAge() ); // Score at least 0.0, no upper bound -DataQualityRule scoreRule = new RangeRule<>( +DataQualityRule scoreRule = new RangeRuleImpl<>( "score", 0.0, null, Metric::getScore, @@ -295,12 +295,12 @@ public class QualityRulesConfig { @Bean public DataQualityRule customerIdNotNull() { - return new NotNullRule<>("customerId", Customer::getId, QualitySeverity.CRITICAL); + return new NotNullRuleImpl<>("customerId", Customer::getId, QualitySeverity.CRITICAL); } @Bean public DataQualityRule emailNotNull() { - return new NotNullRule<>("email", Customer::getEmail); + return new NotNullRuleImpl<>("email", Customer::getEmail); } } ``` @@ -344,10 +344,10 @@ For standalone usage without Spring auto-configuration: ```java List> rules = List.of( - new NotNullRule<>("name", Customer::getName, QualitySeverity.CRITICAL), - new PatternRule<>("email", + new NotNullRuleImpl<>("name", Customer::getName, QualitySeverity.CRITICAL), + new PatternRuleImpl<>("email", Pattern.compile("^.+@.+\\..+$"), Customer::getEmail), - new RangeRule<>("age", 0, 150, c -> ((Customer) c).getAge()) + new RangeRuleImpl<>("age", 0, 150, c -> ((Customer) c).getAge()) ); DataQualityEngine engine = new DataQualityEngine(rules); @@ -521,12 +521,12 @@ public class EnrichmentQualityRules { @Bean public DataQualityRule enrichedNameNotNull() { - return new NotNullRule<>("name", Customer::getName, QualitySeverity.CRITICAL); + return new NotNullRuleImpl<>("name", Customer::getName, QualitySeverity.CRITICAL); } @Bean public DataQualityRule enrichedEmailFormat() { - return new PatternRule<>( + return new PatternRuleImpl<>( "email", Pattern.compile("^[\\w.+-]+@[\\w-]+\\.[a-zA-Z]{2,}$"), Customer::getEmail, @@ -536,7 +536,7 @@ public class EnrichmentQualityRules { @Bean public DataQualityRule enrichedScoreRange() { - return new RangeRule<>( + return new RangeRuleImpl<>( "enrichmentScore", 0.0, 1.0, customer -> customer.getEnrichmentScore(), diff --git a/modules/starter-data/docs/common/data-transformation.md b/modules/starter-data/docs/common/data-transformation.md index 9c384f8ac..4b4a9bd0f 100644 --- a/modules/starter-data/docs/common/data-transformation.md +++ b/modules/starter-data/docs/common/data-transformation.md @@ -63,8 +63,8 @@ Key classes: | `DataTransformer` | `o.f.data.transform` | Functional interface for a single transformation | | `TransformationChain` | `o.f.data.transform` | Composable chain of transformers | | `TransformContext` | `o.f.data.transform` | Request-scoped metadata passed to every step | -| `FieldMappingTransformer` | `o.f.data.transform.transformers` | Renames map fields according to a mapping | -| `ComputedFieldTransformer` | `o.f.data.transform.transformers` | Adds a computed field to a map | +| `FieldMappingTransformerImpl` | `o.f.data.transform.transformers` | Renames map fields according to a mapping | +| `ComputedFieldTransformerImpl` | `o.f.data.transform.transformers` | Adds a computed field to a map | --- @@ -157,8 +157,8 @@ The `TransformationChain` is a composable pipeline that applies `DataTrans ```java TransformationChain, Map> chain = TransformationChain., Map>create() - .then(new FieldMappingTransformer(Map.of("old_name", "newName"))) - .then(new ComputedFieldTransformer("fullName", + .then(new FieldMappingTransformerImpl(Map.of("old_name", "newName"))) + .then(new ComputedFieldTransformerImpl("fullName", m -> m.get("first") + " " + m.get("last"))); ``` @@ -195,7 +195,7 @@ empty.execute("hello", context) The framework ships two built-in transformers in the `o.f.data.transform.transformers` package. Both operate on `Map`, which is the common representation for loosely-typed enrichment data. -### FieldMappingTransformer +### FieldMappingTransformerImpl Renames fields in a map according to a source-to-target mapping. Fields not listed in the mapping are passed through unchanged. Fields listed in the mapping but absent from the source are ignored. @@ -206,7 +206,7 @@ Map mappings = Map.of( "e_mail", "email" ); -FieldMappingTransformer transformer = new FieldMappingTransformer(mappings); +FieldMappingTransformerImpl transformer = new FieldMappingTransformerImpl(mappings); ``` Example: @@ -227,12 +227,12 @@ Behavior details: - Renamed keys replace their source keys (the old key is removed) - Non-mapped keys are retained as-is -### ComputedFieldTransformer +### ComputedFieldTransformerImpl Adds a new field to the map by applying a computation function to the current map state. If the field already exists, it is overwritten. ```java -ComputedFieldTransformer transformer = new ComputedFieldTransformer( +ComputedFieldTransformerImpl transformer = new ComputedFieldTransformerImpl( "fullName", m -> m.get("firstName") + " " + m.get("lastName") ); @@ -343,14 +343,14 @@ public class NormalizationConfig { public TransformationChain, Map> normalizationChain() { return TransformationChain., Map>create() // Step 1: Rename provider-specific field names to canonical names - .then(new FieldMappingTransformer(Map.of( + .then(new FieldMappingTransformerImpl(Map.of( "cmp_name", "companyName", "cmp_domain", "domain", "emp_count", "employeeCount", "annual_rev", "annualRevenue" ))) // Step 2: Add computed fields - .then(new ComputedFieldTransformer("companySize", m -> { + .then(new ComputedFieldTransformerImpl("companySize", m -> { Object count = m.get("employeeCount"); if (count instanceof Number n) { int employees = n.intValue(); @@ -361,7 +361,7 @@ public class NormalizationConfig { return "UNKNOWN"; })) // Step 3: Add a computed revenue tier - .then(new ComputedFieldTransformer("revenueTier", m -> { + .then(new ComputedFieldTransformerImpl("revenueTier", m -> { Object rev = m.get("annualRevenue"); if (rev instanceof Number n) { double revenue = n.doubleValue(); diff --git a/modules/starter-data/docs/common/logging.md b/modules/starter-data/docs/common/logging.md index 5859e4d57..9fa99b065 100644 --- a/modules/starter-data/docs/common/logging.md +++ b/modules/starter-data/docs/common/logging.md @@ -26,7 +26,7 @@ The `AbstractResilientDataJobService` provides logging for all job operations: public class MyDataJobService extends AbstractResilientDataJobService { public MyDataJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher, JobAuditService auditService, diff --git a/modules/starter-data/docs/common/observability.md b/modules/starter-data/docs/common/observability.md index 530f7ba34..cb6703713 100644 --- a/modules/starter-data/docs/common/observability.md +++ b/modules/starter-data/docs/common/observability.md @@ -32,7 +32,7 @@ The library automatically creates traces for all job operations when using `Abst public class CustomerDataJobService extends AbstractResilientDataJobService { public CustomerDataJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher, JobAuditService auditService, @@ -271,13 +271,13 @@ Note: The `` is configurable via `firefly.data.orchestration.obse ### Custom Metrics -Record custom metrics using `JobMetricsService`: +Record custom metrics using `JobMetricsServiceImpl`: ```java @Service public class CustomService { - private final JobMetricsService metricsService; + private final JobMetricsServiceImpl metricsService; public void processData(String executionId) { metricsService.recordJobExecutionStart(executionId); @@ -335,7 +335,7 @@ Response example: @Service public class MonitoringService { - private final JobOrchestratorHealthIndicator healthIndicator; + private final JobOrchestratorHealthIndicatorImpl healthIndicator; public void checkHealth() { healthIndicator.health() @@ -485,7 +485,7 @@ public class CustomerDataJobService extends AbstractResilientDataJobService { private final CustomerRepository repository; public CustomerDataJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher, JobAuditService auditService, diff --git a/modules/starter-data/docs/common/resiliency.md b/modules/starter-data/docs/common/resiliency.md index 8192fccd4..0d38341c2 100644 --- a/modules/starter-data/docs/common/resiliency.md +++ b/modules/starter-data/docs/common/resiliency.md @@ -296,7 +296,7 @@ public class CustomerDataJobService extends AbstractResilientDataJobService { private final CustomerRepository repository; public CustomerDataJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher, JobAuditService auditService, diff --git a/modules/starter-data/docs/data-enrichers/guide.md b/modules/starter-data/docs/data-enrichers/guide.md index 62c71544f..88c0fe69a 100644 --- a/modules/starter-data/docs/data-enrichers/guide.md +++ b/modules/starter-data/docs/data-enrichers/guide.md @@ -695,7 +695,7 @@ public class EquifaxSpainCreditReportEnricher public EquifaxSpainCreditReportEnricher( JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, EnrichmentEventPublisher eventPublisher, EquifaxSpainClient equifaxClient) { @@ -1754,7 +1754,7 @@ package org.fireflyframework.creditbureaus.enricher; import org.fireflyframework.data.enrichment.EnricherMetadata; import org.fireflyframework.data.event.EnrichmentEventPublisher; import org.fireflyframework.data.model.EnrichmentRequest; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; import org.fireflyframework.data.service.DataEnricher; @@ -1779,7 +1779,7 @@ public class EquifaxSpainCreditReportEnricher public EquifaxSpainCreditReportEnricher( JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, EnrichmentEventPublisher eventPublisher, EquifaxSpainClient equifaxClient) { @@ -2437,7 +2437,7 @@ public class EquifaxSpainCreditReportEnricher public EquifaxSpainCreditReportEnricher( JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, EnrichmentEventPublisher eventPublisher, EquifaxSpainClient equifaxClient, @@ -2706,7 +2706,7 @@ package org.fireflyframework.creditbureaus.enricher; import org.fireflyframework.data.event.EnrichmentEventPublisher; import org.fireflyframework.data.model.EnrichmentRequest; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; import org.fireflyframework.creditbureaus.equifax.spain.client.EquifaxSpainClient; @@ -2733,7 +2733,7 @@ class EquifaxSpainCreditReportEnricherTest { private JobTracingService tracingService; @Mock - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; @Mock private ResiliencyDecoratorService resiliencyService; diff --git a/modules/starter-data/docs/data-jobs/guide.md b/modules/starter-data/docs/data-jobs/guide.md index 93741b8b4..2af243311 100644 --- a/modules/starter-data/docs/data-jobs/guide.md +++ b/modules/starter-data/docs/data-jobs/guide.md @@ -705,7 +705,7 @@ package com.example.jobs; import org.fireflyframework.data.event.JobEventPublisher; import org.fireflyframework.data.model.JobStageRequest; import org.fireflyframework.data.model.JobStageResponse; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.persistence.service.JobAuditService; import org.fireflyframework.data.persistence.service.JobExecutionResultService; @@ -720,7 +720,7 @@ import reactor.core.publisher.Mono; public class CustomerImportJobService extends AbstractResilientDataJobService { public CustomerImportJobService(JobTracingService tracing, - JobMetricsService metrics, + JobMetricsServiceImpl metrics, ResiliencyDecoratorService resiliency, JobEventPublisher events, JobAuditService audit, @@ -930,7 +930,7 @@ package com.example.jobs; import org.fireflyframework.data.event.JobEventPublisher; import org.fireflyframework.data.model.JobStageRequest; import org.fireflyframework.data.model.JobStageResponse; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.persistence.service.JobAuditService; import org.fireflyframework.data.persistence.service.JobExecutionResultService; @@ -945,7 +945,7 @@ import reactor.core.publisher.Mono; public class CustomerValidationJobService extends AbstractResilientSyncDataJobService { public CustomerValidationJobService(JobTracingService tracing, - JobMetricsService metrics, + JobMetricsServiceImpl metrics, ResiliencyDecoratorService resiliency, JobEventPublisher events, JobAuditService audit, @@ -1445,7 +1445,7 @@ firefly: ### Health Checks -The library automatically provides health checks for orchestrators via `JobOrchestratorHealthIndicator`. +The library automatically provides health checks for orchestrators via `JobOrchestratorHealthIndicatorImpl`. Endpoint: `GET /actuator/health/jobOrchestrator` @@ -1894,7 +1894,7 @@ class CustomerImportJobServiceTest { private JobTracingService tracing; @Mock - private JobMetricsService metrics; + private JobMetricsServiceImpl metrics; @Mock private ResiliencyDecoratorService resiliency; @@ -2258,7 +2258,7 @@ A: The cross-cutting concerns are applied by `AbstractResilientDataJobService`. Q: How do I add custom metrics? -A: Inject `JobMetricsService` and record custom metrics in your `doXxx` methods: +A: Inject `JobMetricsServiceImpl` and record custom metrics in your `doXxx` methods: ```java @Override protected Mono doStartJob(JobStageRequest request) { diff --git a/modules/starter-data/docs/plans/2026-02-22-starter-data-evolution.md b/modules/starter-data/docs/plans/2026-02-22-starter-data-evolution.md index 819226e07..d24df84d8 100644 --- a/modules/starter-data/docs/plans/2026-02-22-starter-data-evolution.md +++ b/modules/starter-data/docs/plans/2026-02-22-starter-data-evolution.md @@ -633,9 +633,9 @@ git commit -m "feat(resiliency): add per-provider resilience configuration via P - Create: `src/main/java/org/fireflyframework/data/quality/QualitySeverity.java` - Create: `src/main/java/org/fireflyframework/data/quality/QualityStrategy.java` - Create: `src/main/java/org/fireflyframework/data/quality/DataQualityEngine.java` -- Create: `src/main/java/org/fireflyframework/data/quality/rules/NotNullRule.java` -- Create: `src/main/java/org/fireflyframework/data/quality/rules/PatternRule.java` -- Create: `src/main/java/org/fireflyframework/data/quality/rules/RangeRule.java` +- Create: `src/main/java/org/fireflyframework/data/quality/rules/NotNullRuleImpl.java` +- Create: `src/main/java/org/fireflyframework/data/quality/rules/PatternRuleImpl.java` +- Create: `src/main/java/org/fireflyframework/data/quality/rules/RangeRuleImpl.java` - Create: `src/main/java/org/fireflyframework/data/event/DataQualityEvent.java` - Test: `src/test/java/org/fireflyframework/data/quality/DataQualityEngineTest.java` @@ -742,23 +742,23 @@ public class DataQualityEngine { **Step 3: Implement built-in rules** ```java -// NotNullRule.java -public class NotNullRule implements DataQualityRule { +// NotNullRuleImpl.java +public class NotNullRuleImpl implements DataQualityRule { private final String fieldName; private final Function fieldExtractor; // evaluate: return pass/fail based on null check } -// PatternRule.java -public class PatternRule implements DataQualityRule { +// PatternRuleImpl.java +public class PatternRuleImpl implements DataQualityRule { private final String fieldName; private final Pattern pattern; private final Function fieldExtractor; // evaluate: return pass/fail based on regex match } -// RangeRule.java -public class RangeRule implements DataQualityRule { +// RangeRuleImpl.java +public class RangeRuleImpl implements DataQualityRule { private final String fieldName; private final Comparable min; private final Comparable max; @@ -772,8 +772,8 @@ public class RangeRule implements DataQualityRule { ```java @Test void evaluate_collectAll_shouldRunAllRulesEvenOnFailure() { - DataQualityRule rule1 = new NotNullRule<>("name", TestDTO::getName); - DataQualityRule rule2 = new PatternRule<>("email", Pattern.compile("^[^@]+@[^@]+$"), TestDTO::getEmail); + DataQualityRule rule1 = new NotNullRuleImpl<>("name", TestDTO::getName); + DataQualityRule rule2 = new PatternRuleImpl<>("email", Pattern.compile("^[^@]+@[^@]+$"), TestDTO::getEmail); DataQualityEngine engine = new DataQualityEngine(List.of(rule1, rule2), null); TestDTO invalidDto = new TestDTO(null, "not-an-email"); @@ -816,7 +816,7 @@ git commit -m "feat(quality): add DataQualityEngine with rule-based validation, - Create: `src/main/java/org/fireflyframework/data/lineage/LineageRecord.java` - Create: `src/main/java/org/fireflyframework/data/lineage/LineageTracker.java` - Create: `src/main/java/org/fireflyframework/data/lineage/port/LineageRepository.java` -- Create: `src/main/java/org/fireflyframework/data/lineage/InMemoryLineageTracker.java` +- Create: `src/main/java/org/fireflyframework/data/lineage/InMemoryLineageTrackerImpl.java` - Create: `src/main/java/org/fireflyframework/data/event/LineageEvent.java` - Modify: `src/main/java/org/fireflyframework/data/service/DataEnricher.java` (add lineage recording) - Test: `src/test/java/org/fireflyframework/data/lineage/LineageTrackerTest.java` @@ -850,11 +850,11 @@ public interface LineageTracker { } ``` -**Step 3: Implement InMemoryLineageTracker** +**Step 3: Implement InMemoryLineageTrackerImpl** ```java @Slf4j -public class InMemoryLineageTracker implements LineageTracker { +public class InMemoryLineageTrackerImpl implements LineageTracker { private final Map> lineageByEntity = new ConcurrentHashMap<>(); @Override @@ -909,7 +909,7 @@ if (lineageTracker != null && response.isSuccess()) { ```java @Test void lineageTracker_shouldRecordEnrichmentLineage() { - InMemoryLineageTracker tracker = new InMemoryLineageTracker(); + InMemoryLineageTrackerImpl tracker = new InMemoryLineageTrackerImpl(); // Create enricher with tracker, enrich, verify lineage recorded StepVerifier.create(tracker.getLineage("entity-1")) @@ -930,7 +930,7 @@ Expected: PASS ```bash git add src/main/java/org/fireflyframework/data/lineage/ src/main/java/org/fireflyframework/data/event/LineageEvent.java src/test/ -git commit -m "feat(lineage): add data lineage tracking with InMemoryLineageTracker and DataEnricher integration" +git commit -m "feat(lineage): add data lineage tracking with InMemoryLineageTrackerImpl and DataEnricher integration" ``` --- @@ -1081,8 +1081,8 @@ git commit -m "feat(enrichment): add @EnricherFallback annotation and FallbackEn - Create: `src/main/java/org/fireflyframework/data/transform/DataTransformer.java` - Create: `src/main/java/org/fireflyframework/data/transform/TransformationChain.java` - Create: `src/main/java/org/fireflyframework/data/transform/TransformContext.java` -- Create: `src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformer.java` -- Create: `src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformer.java` +- Create: `src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformerImpl.java` +- Create: `src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformerImpl.java` - Test: `src/test/java/org/fireflyframework/data/transform/TransformationChainTest.java` **Step 1: Define the contracts** @@ -1143,8 +1143,8 @@ public class TransformationChain { **Step 3: Implement built-in transformers** ```java -// FieldMappingTransformer.java -public class FieldMappingTransformer implements DataTransformer, Map> { +// FieldMappingTransformerImpl.java +public class FieldMappingTransformerImpl implements DataTransformer, Map> { private final Map fieldMappings; // sourceField -> targetField @Override @@ -1161,8 +1161,8 @@ public class FieldMappingTransformer implements DataTransformer implements DataTransformer { +// ComputedFieldTransformerImpl.java +public class ComputedFieldTransformerImpl implements DataTransformer { private final String fieldName; private final Function computation; // Sets computed field on the DTO @@ -1175,7 +1175,7 @@ public class ComputedFieldTransformer implements DataTransformer { @Test void chain_shouldApplyTransformersInOrder() { TransformationChain, Map> chain = TransformationChain.of(Map.class) - .then(new FieldMappingTransformer(Map.of("old_name", "newName"))) + .then(new FieldMappingTransformerImpl(Map.of("old_name", "newName"))) .then((source, ctx) -> { source.put("computed", source.get("newName") + "-enriched"); return Mono.just(source); @@ -1414,7 +1414,7 @@ public class DataLineageAutoConfiguration { @Bean @ConditionalOnMissingBean public LineageTracker lineageTracker() { - return new InMemoryLineageTracker(); + return new InMemoryLineageTrackerImpl(); } } ``` diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/config/DataEnrichmentAutoConfiguration.java b/modules/starter-data/src/main/java/org/fireflyframework/data/config/DataEnrichmentAutoConfiguration.java index aa8be31be..3ca029787 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/config/DataEnrichmentAutoConfiguration.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/config/DataEnrichmentAutoConfiguration.java @@ -28,10 +28,10 @@ import org.fireflyframework.data.event.EnrichmentEventPublisher; import org.fireflyframework.data.event.JobEventPublisher; import org.fireflyframework.data.event.OperationEventPublisher; -import org.fireflyframework.data.health.JobOrchestratorHealthIndicator; +import org.fireflyframework.data.health.JobOrchestratorHealthIndicatorImpl; import org.fireflyframework.data.mapper.JobResultMapper; import org.fireflyframework.data.mapper.JobResultMapperRegistry; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.operation.schema.JsonSchemaGenerator; import org.fireflyframework.data.orchestration.port.JobOrchestrator; @@ -156,9 +156,9 @@ public EnrichmentCacheKeyGenerator enrichmentCacheKeyGenerator(ObjectMapper obje name = "cache-enabled", havingValue = "true" ) - @ConditionalOnBean(org.fireflyframework.cache.manager.FireflyCacheManager.class) + @ConditionalOnBean(org.fireflyframework.cache.manager.FireflyCacheManagerImpl.class) public EnrichmentCacheService enrichmentCacheService( - org.fireflyframework.cache.manager.FireflyCacheManager cacheManager, + org.fireflyframework.cache.manager.FireflyCacheManagerImpl cacheManager, EnrichmentCacheKeyGenerator keyGenerator, DataEnrichmentProperties properties) { log.info("Creating EnrichmentCacheService bean with cache type: {}", cacheManager.getCacheType()); @@ -184,9 +184,9 @@ public EnrichmentCacheService enrichmentCacheService( havingValue = "true", matchIfMissing = true ) - @ConditionalOnBean(org.fireflyframework.cache.manager.FireflyCacheManager.class) + @ConditionalOnBean(org.fireflyframework.cache.manager.FireflyCacheManagerImpl.class) public OperationCacheService operationCacheService( - org.fireflyframework.cache.manager.FireflyCacheManager cacheManager, + org.fireflyframework.cache.manager.FireflyCacheManagerImpl cacheManager, ObjectMapper objectMapper, DataEnrichmentProperties properties) { log.info("Creating OperationCacheService bean with cache type: {}", cacheManager.getCacheType()); @@ -200,10 +200,10 @@ public OperationCacheService operationCacheService( */ @Bean @ConditionalOnMissingBean - public JobMetricsService jobMetricsService(MeterRegistry meterRegistry, + public JobMetricsServiceImpl jobMetricsService(MeterRegistry meterRegistry, JobOrchestrationProperties properties) { log.info("Creating JobMetricsService bean"); - return new JobMetricsService(meterRegistry, properties); + return new JobMetricsServiceImpl(meterRegistry, properties); } /** @@ -315,11 +315,11 @@ public JobResultMapperRegistry jobResultMapperRegistry(List orchestrator, JobOrchestrationProperties properties) { log.info("Creating JobOrchestratorHealthIndicator bean"); - return new JobOrchestratorHealthIndicator(orchestrator, properties); + return new JobOrchestratorHealthIndicatorImpl(orchestrator, properties); } /** diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/config/DataLineageAutoConfiguration.java b/modules/starter-data/src/main/java/org/fireflyframework/data/config/DataLineageAutoConfiguration.java index 56e555d07..b0fc34656 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/config/DataLineageAutoConfiguration.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/config/DataLineageAutoConfiguration.java @@ -16,7 +16,7 @@ package org.fireflyframework.data.config; -import org.fireflyframework.data.lineage.InMemoryLineageTracker; +import org.fireflyframework.data.lineage.InMemoryLineageTrackerImpl; import org.fireflyframework.data.lineage.LineageTracker; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -68,6 +68,6 @@ public class DataLineageAutoConfiguration { @ConditionalOnMissingBean public LineageTracker lineageTracker() { log.info("Configuring in-memory lineage tracker (production: implement LineageTracker with persistent store)"); - return new InMemoryLineageTracker(); + return new InMemoryLineageTrackerImpl(); } } diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/config/JobOrchestrationAutoConfiguration.java b/modules/starter-data/src/main/java/org/fireflyframework/data/config/JobOrchestrationAutoConfiguration.java index 4f5923204..02f94fe2e 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/config/JobOrchestrationAutoConfiguration.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/config/JobOrchestrationAutoConfiguration.java @@ -16,9 +16,9 @@ package org.fireflyframework.data.config; -import org.fireflyframework.data.health.JobOrchestratorHealthIndicator; +import org.fireflyframework.data.health.JobOrchestratorHealthIndicatorImpl; import org.fireflyframework.data.mapper.JobResultMapperRegistry; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; import io.micrometer.core.instrument.MeterRegistry; @@ -62,10 +62,10 @@ public JobOrchestrationAutoConfiguration(JobOrchestrationProperties properties) @Bean @ConditionalOnMissingBean @ConditionalOnClass(MeterRegistry.class) - public JobMetricsService jobMetricsService(MeterRegistry meterRegistry, + public JobMetricsServiceImpl jobMetricsService(MeterRegistry meterRegistry, JobOrchestrationProperties properties) { log.debug("Creating JobMetricsService with prefix: {}", properties.getObservability().getMetricPrefix()); - return new JobMetricsService(meterRegistry, properties); + return new JobMetricsServiceImpl(meterRegistry, properties); } @Bean @@ -94,8 +94,8 @@ public JobResultMapperRegistry jobResultMapperRegistry() { @ConditionalOnMissingBean(name = "jobOrchestratorHealthIndicator") @ConditionalOnProperty(name = "firefly.data.orchestration.health-check.enabled", matchIfMissing = true) @ConditionalOnClass(name = "org.springframework.boot.health.contributor.HealthIndicator") - public JobOrchestratorHealthIndicator jobOrchestratorHealthIndicator(JobOrchestrationProperties properties) { + public JobOrchestratorHealthIndicatorImpl jobOrchestratorHealthIndicator(JobOrchestrationProperties properties) { log.debug("Creating JobOrchestratorHealthIndicator"); - return new JobOrchestratorHealthIndicator(properties); + return new JobOrchestratorHealthIndicatorImpl(properties); } } diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/config/ObservabilityAutoConfiguration.java b/modules/starter-data/src/main/java/org/fireflyframework/data/config/ObservabilityAutoConfiguration.java index 8b43c975a..08f906bea 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/config/ObservabilityAutoConfiguration.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/config/ObservabilityAutoConfiguration.java @@ -16,8 +16,8 @@ package org.fireflyframework.data.config; -import org.fireflyframework.data.health.JobOrchestratorHealthIndicator; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.health.JobOrchestratorHealthIndicatorImpl; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.orchestration.port.JobOrchestrator; import org.fireflyframework.data.util.TracingContextExtractor; @@ -70,27 +70,27 @@ public JobTracingService jobTracingService(ObservationRegistry observationRegist */ @Bean @ConditionalOnClass(MeterRegistry.class) - @ConditionalOnMissingBean(JobMetricsService.class) + @ConditionalOnMissingBean(JobMetricsServiceImpl.class) @ConditionalOnProperty(prefix = "firefly.data.orchestration.observability", name = "metrics-enabled", havingValue = "true", matchIfMissing = true) - public JobMetricsService jobMetricsService(MeterRegistry meterRegistry, + public JobMetricsServiceImpl jobMetricsService(MeterRegistry meterRegistry, JobOrchestrationProperties properties) { log.info("Configuring job metrics service with metric prefix: {}", properties.getObservability().getMetricPrefix()); - return new JobMetricsService(meterRegistry, properties); + return new JobMetricsServiceImpl(meterRegistry, properties); } /** * Creates the job orchestrator health indicator. */ @Bean - @ConditionalOnMissingBean(JobOrchestratorHealthIndicator.class) + @ConditionalOnMissingBean(JobOrchestratorHealthIndicatorImpl.class) @ConditionalOnEnabledHealthIndicator("jobOrchestrator") @ConditionalOnProperty(prefix = "firefly.data.orchestration.health-check", name = "enabled", havingValue = "true", matchIfMissing = true) - public JobOrchestratorHealthIndicator jobOrchestratorHealthIndicator( + public JobOrchestratorHealthIndicatorImpl jobOrchestratorHealthIndicator( Optional orchestrator, JobOrchestrationProperties properties) { log.info("Configuring job orchestrator health indicator"); - return new JobOrchestratorHealthIndicator(orchestrator, properties); + return new JobOrchestratorHealthIndicatorImpl(orchestrator, properties); } } diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicator.java b/modules/starter-data/src/main/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicatorImpl.java similarity index 96% rename from modules/starter-data/src/main/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicator.java rename to modules/starter-data/src/main/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicatorImpl.java index c563086a1..7f6becc9a 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicator.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicatorImpl.java @@ -33,14 +33,14 @@ * Health indicator for job orchestrator. */ @Slf4j -public class JobOrchestratorHealthIndicator implements ReactiveHealthIndicator { +public class JobOrchestratorHealthIndicatorImpl implements ReactiveHealthIndicator { private final Optional orchestrator; private final JobOrchestrationProperties properties; private volatile Instant lastCheckTime; private volatile Health lastHealth; - public JobOrchestratorHealthIndicator(Optional orchestrator, + public JobOrchestratorHealthIndicatorImpl(Optional orchestrator, JobOrchestrationProperties properties) { this.orchestrator = orchestrator; this.properties = properties; @@ -50,7 +50,7 @@ public JobOrchestratorHealthIndicator(Optional orchestrator, /** * Constructor without orchestrator for basic health checks. */ - public JobOrchestratorHealthIndicator(JobOrchestrationProperties properties) { + public JobOrchestratorHealthIndicatorImpl(JobOrchestrationProperties properties) { this(Optional.empty(), properties); } diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/lineage/InMemoryLineageTracker.java b/modules/starter-data/src/main/java/org/fireflyframework/data/lineage/InMemoryLineageTrackerImpl.java similarity index 96% rename from modules/starter-data/src/main/java/org/fireflyframework/data/lineage/InMemoryLineageTracker.java rename to modules/starter-data/src/main/java/org/fireflyframework/data/lineage/InMemoryLineageTrackerImpl.java index b3692f8d4..f02b7c60e 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/lineage/InMemoryLineageTracker.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/lineage/InMemoryLineageTrackerImpl.java @@ -32,9 +32,9 @@ * with each entry backed by a {@link CopyOnWriteArrayList} for safe concurrent reads. * This implementation is suitable for development, testing, and single-instance deployments.

    */ -public class InMemoryLineageTracker implements LineageTracker { +public class InMemoryLineageTrackerImpl implements LineageTracker { - private static final Logger log = LoggerFactory.getLogger(InMemoryLineageTracker.class); + private static final Logger log = LoggerFactory.getLogger(InMemoryLineageTrackerImpl.class); private final ConcurrentHashMap> lineageByEntity = new ConcurrentHashMap<>(); diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/observability/JobMetricsService.java b/modules/starter-data/src/main/java/org/fireflyframework/data/observability/JobMetricsServiceImpl.java similarity index 98% rename from modules/starter-data/src/main/java/org/fireflyframework/data/observability/JobMetricsService.java rename to modules/starter-data/src/main/java/org/fireflyframework/data/observability/JobMetricsServiceImpl.java index 7f6ef48e7..e4ca1ad2c 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/observability/JobMetricsService.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/observability/JobMetricsServiceImpl.java @@ -33,13 +33,13 @@ * Service for recording job metrics. */ @Slf4j -public class JobMetricsService extends FireflyMetricsSupport { +public class JobMetricsServiceImpl extends FireflyMetricsSupport { private final JobOrchestrationProperties properties; private final ConcurrentMap executionStartTimes = new ConcurrentHashMap<>(); private final AtomicInteger activeJobCount = new AtomicInteger(0); - public JobMetricsService(MeterRegistry meterRegistry, JobOrchestrationProperties properties) { + public JobMetricsServiceImpl(MeterRegistry meterRegistry, JobOrchestrationProperties properties) { super(meterRegistry, "data"); this.properties = properties; diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/operation/AbstractEnricherOperation.java b/modules/starter-data/src/main/java/org/fireflyframework/data/operation/AbstractEnricherOperation.java index 45bc57700..a8ce259fd 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/operation/AbstractEnricherOperation.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/operation/AbstractEnricherOperation.java @@ -5,7 +5,7 @@ import org.fireflyframework.data.cache.OperationCacheService; import org.fireflyframework.data.config.DataEnrichmentProperties; import org.fireflyframework.data.event.OperationEventPublisher; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.operation.schema.JsonSchemaGenerator; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; @@ -103,7 +103,7 @@ public abstract class AbstractEnricherOperation private JobTracingService tracingService; @Autowired(required = false) - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; @Autowired(required = false) private OperationEventPublisher eventPublisher; @@ -162,7 +162,7 @@ public void setTracingService(JobTracingService tracingService) { * Sets the metrics service (for testing purposes). * @param metricsService the metrics service */ - public void setMetricsService(JobMetricsService metricsService) { + public void setMetricsService(JobMetricsServiceImpl metricsService) { this.metricsService = metricsService; } diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/NotNullRule.java b/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/NotNullRuleImpl.java similarity index 89% rename from modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/NotNullRule.java rename to modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/NotNullRuleImpl.java index 9d8f629f7..ea9fd85a9 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/NotNullRule.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/NotNullRuleImpl.java @@ -27,17 +27,17 @@ * * @param the type of data being validated */ -public class NotNullRule implements DataQualityRule { +public class NotNullRuleImpl implements DataQualityRule { private final String fieldName; private final Function extractor; private final QualitySeverity severity; - public NotNullRule(String fieldName, Function extractor) { + public NotNullRuleImpl(String fieldName, Function extractor) { this(fieldName, extractor, QualitySeverity.WARNING); } - public NotNullRule(String fieldName, Function extractor, QualitySeverity severity) { + public NotNullRuleImpl(String fieldName, Function extractor, QualitySeverity severity) { this.fieldName = fieldName; this.extractor = extractor; this.severity = severity; diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/PatternRule.java b/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/PatternRuleImpl.java similarity index 89% rename from modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/PatternRule.java rename to modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/PatternRuleImpl.java index 7e31c4f69..d7da76edf 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/PatternRule.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/PatternRuleImpl.java @@ -28,18 +28,18 @@ * * @param the type of data being validated */ -public class PatternRule implements DataQualityRule { +public class PatternRuleImpl implements DataQualityRule { private final String fieldName; private final Pattern pattern; private final Function extractor; private final QualitySeverity severity; - public PatternRule(String fieldName, Pattern pattern, Function extractor) { + public PatternRuleImpl(String fieldName, Pattern pattern, Function extractor) { this(fieldName, pattern, extractor, QualitySeverity.WARNING); } - public PatternRule(String fieldName, Pattern pattern, Function extractor, + public PatternRuleImpl(String fieldName, Pattern pattern, Function extractor, QualitySeverity severity) { this.fieldName = fieldName; this.pattern = pattern; diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/RangeRule.java b/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/RangeRuleImpl.java similarity index 92% rename from modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/RangeRule.java rename to modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/RangeRuleImpl.java index 61c6d8412..c2309d1b1 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/RangeRule.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/RangeRuleImpl.java @@ -27,7 +27,7 @@ * * @param the type of data being validated */ -public class RangeRule implements DataQualityRule { +public class RangeRuleImpl implements DataQualityRule { private final String fieldName; private final Comparable min; @@ -35,12 +35,12 @@ public class RangeRule implements DataQualityRule { private final Function> extractor; private final QualitySeverity severity; - public RangeRule(String fieldName, Comparable min, Comparable max, + public RangeRuleImpl(String fieldName, Comparable min, Comparable max, Function> extractor) { this(fieldName, min, max, extractor, QualitySeverity.WARNING); } - public RangeRule(String fieldName, Comparable min, Comparable max, + public RangeRuleImpl(String fieldName, Comparable min, Comparable max, Function> extractor, QualitySeverity severity) { this.fieldName = fieldName; this.min = min; diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/service/AbstractResilientDataJobService.java b/modules/starter-data/src/main/java/org/fireflyframework/data/service/AbstractResilientDataJobService.java index 104f53074..c5fd08620 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/service/AbstractResilientDataJobService.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/service/AbstractResilientDataJobService.java @@ -21,7 +21,7 @@ import org.fireflyframework.data.model.JobStage; import org.fireflyframework.data.model.JobStageRequest; import org.fireflyframework.data.model.JobStageResponse; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.persistence.service.JobAuditService; import org.fireflyframework.data.persistence.service.JobExecutionResultService; @@ -50,14 +50,14 @@ public abstract class AbstractResilientDataJobService implements DataJobService { private final JobTracingService tracingService; - private final JobMetricsService metricsService; + private final JobMetricsServiceImpl metricsService; private final ResiliencyDecoratorService resiliencyService; private final JobEventPublisher eventPublisher; private final JobAuditService auditService; private final JobExecutionResultService resultService; protected AbstractResilientDataJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher, JobAuditService auditService, @@ -74,7 +74,7 @@ protected AbstractResilientDataJobService(JobTracingService tracingService, * Constructor without persistence services for backward compatibility. */ protected AbstractResilientDataJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher) { this(tracingService, metricsService, resiliencyService, eventPublisher, null, null); @@ -84,7 +84,7 @@ protected AbstractResilientDataJobService(JobTracingService tracingService, * Constructor without JobEventPublisher for backward compatibility. */ protected AbstractResilientDataJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService) { this(tracingService, metricsService, resiliencyService, null, null, null); } @@ -348,7 +348,7 @@ protected JobTracingService getTracingService() { /** * Gets the metrics service for custom metrics. */ - protected JobMetricsService getMetricsService() { + protected JobMetricsServiceImpl getMetricsService() { return metricsService; } diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/service/AbstractResilientSyncDataJobService.java b/modules/starter-data/src/main/java/org/fireflyframework/data/service/AbstractResilientSyncDataJobService.java index 8da87972a..6b468bc18 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/service/AbstractResilientSyncDataJobService.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/service/AbstractResilientSyncDataJobService.java @@ -20,7 +20,7 @@ import org.fireflyframework.data.model.JobStage; import org.fireflyframework.data.model.JobStageRequest; import org.fireflyframework.data.model.JobStageResponse; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.persistence.service.JobAuditService; import org.fireflyframework.data.persistence.service.JobExecutionResultService; @@ -113,7 +113,7 @@ public abstract class AbstractResilientSyncDataJobService implements SyncDataJobService { private final JobTracingService tracingService; - private final JobMetricsService metricsService; + private final JobMetricsServiceImpl metricsService; private final ResiliencyDecoratorService resiliencyService; private final JobEventPublisher eventPublisher; private final JobAuditService auditService; @@ -130,7 +130,7 @@ public abstract class AbstractResilientSyncDataJobService implements SyncDataJob * @param resultService service for execution result persistence */ protected AbstractResilientSyncDataJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher, JobAuditService auditService, @@ -147,7 +147,7 @@ protected AbstractResilientSyncDataJobService(JobTracingService tracingService, * Constructor without persistence services for backward compatibility. */ protected AbstractResilientSyncDataJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher) { this(tracingService, metricsService, resiliencyService, eventPublisher, null, null); @@ -157,7 +157,7 @@ protected AbstractResilientSyncDataJobService(JobTracingService tracingService, * Constructor without JobEventPublisher for backward compatibility. */ protected AbstractResilientSyncDataJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService) { this(tracingService, metricsService, resiliencyService, null, null, null); } @@ -330,7 +330,7 @@ protected JobTracingService getTracingService() { /** * Gets the metrics service for custom metrics. */ - protected JobMetricsService getMetricsService() { + protected JobMetricsServiceImpl getMetricsService() { return metricsService; } diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/service/DataEnricher.java b/modules/starter-data/src/main/java/org/fireflyframework/data/service/DataEnricher.java index f07b88860..162c92da5 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/service/DataEnricher.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/service/DataEnricher.java @@ -26,7 +26,7 @@ import org.fireflyframework.data.model.EnrichmentRequest; import org.fireflyframework.data.model.EnrichmentResponse; import org.fireflyframework.data.model.EnrichmentStrategy; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.operation.EnricherOperationInterface; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; @@ -118,7 +118,7 @@ public abstract class DataEnricher implements EndpointAware { private final JobTracingService tracingService; - private final JobMetricsService metricsService; + private final JobMetricsServiceImpl metricsService; private final ResiliencyDecoratorService resiliencyService; private final EnrichmentEventPublisher eventPublisher; private final EnrichmentCacheService cacheService; @@ -136,7 +136,7 @@ public abstract class DataEnricher implements Endpo * @param targetClass the target DTO class */ protected DataEnricher(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, EnrichmentEventPublisher eventPublisher, EnrichmentCacheService cacheService, @@ -153,7 +153,7 @@ protected DataEnricher(JobTracingService tracingService, * Constructor without cache for backward compatibility. */ protected DataEnricher(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, EnrichmentEventPublisher eventPublisher, Class targetClass) { @@ -164,7 +164,7 @@ protected DataEnricher(JobTracingService tracingService, * Constructor without event publisher for backward compatibility. */ protected DataEnricher(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, Class targetClass) { this(tracingService, metricsService, resiliencyService, null, null, targetClass); diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformer.java b/modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformerImpl.java similarity index 89% rename from modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformer.java rename to modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformerImpl.java index cc8f1cf04..bb561f0d4 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformer.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformerImpl.java @@ -32,7 +32,7 @@ * and the result is stored under the configured field name. If the * field already exists, it is overwritten.

    */ -public class ComputedFieldTransformer implements DataTransformer, Map> { +public class ComputedFieldTransformerImpl implements DataTransformer, Map> { private final String fieldName; private final Function, Object> computation; @@ -43,7 +43,7 @@ public class ComputedFieldTransformer implements DataTransformer, Object> computation) { + public ComputedFieldTransformerImpl(String fieldName, Function, Object> computation) { this.fieldName = fieldName; this.computation = computation; } diff --git a/modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformer.java b/modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformerImpl.java similarity index 90% rename from modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformer.java rename to modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformerImpl.java index bd66d092e..88019f451 100644 --- a/modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformer.java +++ b/modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformerImpl.java @@ -30,7 +30,7 @@ *

    Fields not present in the mapping are passed through unchanged. * Fields listed in the mapping but absent from the source are ignored.

    */ -public class FieldMappingTransformer implements DataTransformer, Map> { +public class FieldMappingTransformerImpl implements DataTransformer, Map> { private final Map fieldMappings; @@ -39,7 +39,7 @@ public class FieldMappingTransformer implements DataTransformer fieldMappings) { + public FieldMappingTransformerImpl(Map fieldMappings) { this.fieldMappings = fieldMappings; } diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/cache/EnrichmentCacheIntegrationTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/cache/EnrichmentCacheIntegrationTest.java index a5a5e815c..de5ec9b6b 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/cache/EnrichmentCacheIntegrationTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/cache/EnrichmentCacheIntegrationTest.java @@ -21,7 +21,7 @@ import org.fireflyframework.data.model.EnrichmentRequest; import org.fireflyframework.data.model.EnrichmentResponse; import org.fireflyframework.data.model.EnrichmentStrategy; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; import org.fireflyframework.data.service.DataEnricher; @@ -55,7 +55,7 @@ class EnrichmentCacheIntegrationTest { private JobTracingService tracingService; @Mock - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; @Mock private ResiliencyDecoratorService resiliencyService; @@ -235,7 +235,7 @@ static class TestCachedEnricher extends DataEnricher, Map>) (Class) Map.class); @@ -144,7 +144,7 @@ static class TestCompanyEnricher extends DataEnricher, Map>) (Class) Map.class); diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/controller/GlobalOperationsControllerTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/controller/GlobalOperationsControllerTest.java index 0cacf3f5b..f95a847ba 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/controller/GlobalOperationsControllerTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/controller/GlobalOperationsControllerTest.java @@ -20,7 +20,7 @@ import org.fireflyframework.data.enrichment.EnricherMetadata; import org.fireflyframework.data.event.EnrichmentEventPublisher; import org.fireflyframework.data.model.EnrichmentRequest; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.operation.AbstractEnricherOperation; import org.fireflyframework.data.operation.EnricherOperation; @@ -55,7 +55,7 @@ class GlobalOperationsControllerTest { private JobTracingService tracingService; @Mock - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; @Mock private ResiliencyDecoratorService resiliencyService; @@ -306,7 +306,7 @@ static class TestEnricherWithOperations extends DataEnricher { public TestEnricherWithoutOperations(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, EnrichmentEventPublisher eventPublisher) { super(tracingService, metricsService, resiliencyService, eventPublisher, Object.class); diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/demo/CompleteDeveloperExperienceDemoTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/demo/CompleteDeveloperExperienceDemoTest.java index 509759f60..8413bf86a 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/demo/CompleteDeveloperExperienceDemoTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/demo/CompleteDeveloperExperienceDemoTest.java @@ -21,7 +21,7 @@ import org.fireflyframework.data.model.EnrichmentRequest; import org.fireflyframework.data.model.EnrichmentResponse; import org.fireflyframework.data.model.EnrichmentStrategy; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.operation.AbstractEnricherOperation; import org.fireflyframework.data.operation.EnricherOperation; @@ -66,7 +66,7 @@ class CompleteDeveloperExperienceDemoTest { @Mock private JobTracingService tracingService; - @Mock private JobMetricsService metricsService; + @Mock private JobMetricsServiceImpl metricsService; @Mock private ResiliencyDecoratorService resiliencyService; @Mock private EnrichmentEventPublisher eventPublisher; @@ -274,7 +274,7 @@ static class SimpleCreditBureauEnricher extends DataEnricher, CompanyDTO> { public SimpleCreditBureauEnricher(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, EnrichmentEventPublisher eventPublisher) { super(tracingService, metricsService, resiliencyService, eventPublisher, CompanyDTO.class); diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/examples/DataEnrichmentExamplesTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/examples/DataEnrichmentExamplesTest.java index 5c27f5d75..ca3c898c2 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/examples/DataEnrichmentExamplesTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/examples/DataEnrichmentExamplesTest.java @@ -25,7 +25,7 @@ import org.fireflyframework.data.model.EnrichmentRequest; import org.fireflyframework.data.model.EnrichmentResponse; import org.fireflyframework.data.model.EnrichmentStrategy; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; import org.junit.jupiter.api.BeforeEach; @@ -55,7 +55,7 @@ class DataEnrichmentExamplesTest { private JobTracingService tracingService; @Mock - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; @Mock private ResiliencyDecoratorService resiliencyService; diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/examples/enricher/FinancialDataEnricher.java b/modules/starter-data/src/test/java/org/fireflyframework/data/examples/enricher/FinancialDataEnricher.java index 1f00617e2..04df868b7 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/examples/enricher/FinancialDataEnricher.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/examples/enricher/FinancialDataEnricher.java @@ -21,7 +21,7 @@ import org.fireflyframework.data.examples.dto.CompanyProfileDTO; import org.fireflyframework.data.examples.dto.FinancialDataResponse; import org.fireflyframework.data.model.EnrichmentRequest; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; import org.fireflyframework.data.service.DataEnricher; @@ -46,7 +46,7 @@ public class FinancialDataEnricher public FinancialDataEnricher( JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, EnrichmentEventPublisher eventPublisher) { super(tracingService, metricsService, resiliencyService, eventPublisher, CompanyProfileDTO.class); diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicatorTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicatorTest.java index 98aae043e..5a6851d29 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicatorTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/health/JobOrchestratorHealthIndicatorTest.java @@ -34,7 +34,7 @@ class JobOrchestratorHealthIndicatorTest { - private JobOrchestratorHealthIndicator healthIndicator; + private JobOrchestratorHealthIndicatorImpl healthIndicator; private JobOrchestrationProperties properties; private MockJobOrchestrator mockOrchestrator; @@ -53,7 +53,7 @@ void setUp() { @Test void shouldReturnUpWhenOrchestratorIsAvailable() { // Given - healthIndicator = new JobOrchestratorHealthIndicator(Optional.of(mockOrchestrator), properties); + healthIndicator = new JobOrchestratorHealthIndicatorImpl(Optional.of(mockOrchestrator), properties); // When Mono health = healthIndicator.health(); @@ -71,7 +71,7 @@ void shouldReturnUpWhenOrchestratorIsAvailable() { @Test void shouldReturnDownWhenOrchestratorIsNotConfigured() { // Given - healthIndicator = new JobOrchestratorHealthIndicator(Optional.empty(), properties); + healthIndicator = new JobOrchestratorHealthIndicatorImpl(Optional.empty(), properties); // When Mono health = healthIndicator.health(); @@ -90,7 +90,7 @@ void shouldReturnDownWhenOrchestratorIsNotConfigured() { void shouldReturnUpWhenHealthChecksDisabled() { // Given properties.getHealthCheck().setEnabled(false); - healthIndicator = new JobOrchestratorHealthIndicator(Optional.of(mockOrchestrator), properties); + healthIndicator = new JobOrchestratorHealthIndicatorImpl(Optional.of(mockOrchestrator), properties); // When Mono health = healthIndicator.health(); @@ -109,7 +109,7 @@ void shouldReturnUpWhenHealthChecksDisabled() { void shouldReturnUpWhenOrchestrationDisabled() { // Given properties.setEnabled(false); - healthIndicator = new JobOrchestratorHealthIndicator(Optional.of(mockOrchestrator), properties); + healthIndicator = new JobOrchestratorHealthIndicatorImpl(Optional.of(mockOrchestrator), properties); // When Mono health = healthIndicator.health(); @@ -128,7 +128,7 @@ void shouldReturnUpWhenOrchestrationDisabled() { void shouldIncludeDetailsWhenShowDetailsEnabled() { // Given properties.getHealthCheck().setShowDetails(true); - healthIndicator = new JobOrchestratorHealthIndicator(Optional.of(mockOrchestrator), properties); + healthIndicator = new JobOrchestratorHealthIndicatorImpl(Optional.of(mockOrchestrator), properties); // When Mono health = healthIndicator.health(); @@ -154,7 +154,7 @@ void shouldIncludeDetailsWhenShowDetailsEnabled() { void shouldNotCheckConnectivityWhenDisabled() { // Given properties.getHealthCheck().setCheckConnectivity(false); - healthIndicator = new JobOrchestratorHealthIndicator(Optional.of(mockOrchestrator), properties); + healthIndicator = new JobOrchestratorHealthIndicatorImpl(Optional.of(mockOrchestrator), properties); // When Mono health = healthIndicator.health(); diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AsyncJobOrchestratorE2ETest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AsyncJobOrchestratorE2ETest.java index 6902b5375..cd6af0e4e 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AsyncJobOrchestratorE2ETest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AsyncJobOrchestratorE2ETest.java @@ -20,7 +20,7 @@ import org.fireflyframework.data.model.JobStage; import org.fireflyframework.data.model.JobStageRequest; import org.fireflyframework.data.model.JobStageResponse; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.orchestration.model.JobExecutionStatus; import org.fireflyframework.data.persistence.service.JobAuditService; @@ -66,7 +66,7 @@ class AsyncJobOrchestratorE2ETest { private JobTracingService tracingService; @Mock - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; @Mock private ResiliencyDecoratorService resiliencyService; @@ -315,7 +315,7 @@ static class TestAsyncJobService extends AbstractResilientDataJobService { private boolean jobStopped = false; public TestAsyncJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher, JobAuditService auditService, diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AutoConfigurationIntegrationTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AutoConfigurationIntegrationTest.java index dfb3f555c..11d465ffb 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AutoConfigurationIntegrationTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AutoConfigurationIntegrationTest.java @@ -19,9 +19,9 @@ import org.fireflyframework.data.config.DataConfiguration; import org.fireflyframework.data.config.JobOrchestrationProperties; import org.fireflyframework.data.event.JobEventPublisher; -import org.fireflyframework.data.health.JobOrchestratorHealthIndicator; +import org.fireflyframework.data.health.JobOrchestratorHealthIndicatorImpl; import org.fireflyframework.data.mapper.JobResultMapperRegistry; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; import io.micrometer.core.instrument.MeterRegistry; @@ -105,8 +105,8 @@ public JobEventPublisher jobEventPublisher(ApplicationEventPublisher eventPublis } @Bean - public JobMetricsService jobMetricsService(MeterRegistry meterRegistry, JobOrchestrationProperties properties) { - return new JobMetricsService(meterRegistry, properties); + public JobMetricsServiceImpl jobMetricsService(MeterRegistry meterRegistry, JobOrchestrationProperties properties) { + return new JobMetricsServiceImpl(meterRegistry, properties); } @Bean @@ -125,8 +125,8 @@ public JobResultMapperRegistry jobResultMapperRegistry() { } @Bean - public JobOrchestratorHealthIndicator jobOrchestratorHealthIndicator(JobOrchestrationProperties properties) { - return new JobOrchestratorHealthIndicator(properties); + public JobOrchestratorHealthIndicatorImpl jobOrchestratorHealthIndicator(JobOrchestrationProperties properties) { + return new JobOrchestratorHealthIndicatorImpl(properties); } } @@ -198,7 +198,7 @@ void jobEventPublisher_ShouldBeCreated() { @Test void jobMetricsService_ShouldBeCreated() { assertTrue(applicationContext.containsBean("jobMetricsService")); - JobMetricsService jobMetricsService = applicationContext.getBean(JobMetricsService.class); + JobMetricsServiceImpl jobMetricsService = applicationContext.getBean(JobMetricsServiceImpl.class); assertNotNull(jobMetricsService); } @@ -226,7 +226,7 @@ void jobResultMapperRegistry_ShouldBeCreated() { @Test void jobOrchestratorHealthIndicator_ShouldBeCreated() { assertTrue(applicationContext.containsBean("jobOrchestratorHealthIndicator")); - JobOrchestratorHealthIndicator healthIndicator = applicationContext.getBean("jobOrchestratorHealthIndicator", JobOrchestratorHealthIndicator.class); + JobOrchestratorHealthIndicatorImpl healthIndicator = applicationContext.getBean("jobOrchestratorHealthIndicator", JobOrchestratorHealthIndicatorImpl.class); assertNotNull(healthIndicator); } diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AutomaticFeaturesE2ETest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AutomaticFeaturesE2ETest.java index 384e1c224..3c2a55012 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AutomaticFeaturesE2ETest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/AutomaticFeaturesE2ETest.java @@ -21,7 +21,7 @@ import org.fireflyframework.data.model.JobStage; import org.fireflyframework.data.model.JobStageRequest; import org.fireflyframework.data.model.JobStageResponse; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.persistence.service.JobAuditService; import org.fireflyframework.data.persistence.service.JobExecutionResultService; @@ -62,7 +62,7 @@ class AutomaticFeaturesE2ETest { private MeterRegistry meterRegistry; private ObservationRegistry observationRegistry; private JobTracingService tracingService; - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; private ResiliencyDecoratorService resiliencyService; private JobEventPublisher eventPublisher; private JobAuditService auditService; @@ -88,7 +88,7 @@ void setUp() { // Create REAL services with real dependencies tracingService = new JobTracingService(observationRegistry, properties); - metricsService = new JobMetricsService(meterRegistry, properties); + metricsService = new JobMetricsServiceImpl(meterRegistry, properties); resiliencyService = new ResiliencyDecoratorService(properties); // Mock only the persistence and event publishing (external dependencies) @@ -304,7 +304,7 @@ static class TestSyncJobService extends AbstractResilientSyncDataJobService { private java.util.function.Supplier> executionLogic; public TestSyncJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher, JobAuditService auditService, diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/ConcurrencyAndThreadSafetyE2ETest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/ConcurrencyAndThreadSafetyE2ETest.java index 441f6220f..52cb5645f 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/ConcurrencyAndThreadSafetyE2ETest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/ConcurrencyAndThreadSafetyE2ETest.java @@ -21,7 +21,7 @@ import org.fireflyframework.data.model.EnrichmentRequest; import org.fireflyframework.data.model.EnrichmentResponse; import org.fireflyframework.data.model.EnrichmentStrategy; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; import org.fireflyframework.data.service.DataEnricher; @@ -60,7 +60,7 @@ class ConcurrencyAndThreadSafetyE2ETest { private JobTracingService tracingService; @Mock - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; @Mock private ResiliencyDecoratorService resiliencyService; @@ -214,7 +214,7 @@ static class TestConcurrentEnricher extends DataEnricher requestCounts; public TestConcurrentEnricher(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, EnrichmentEventPublisher eventPublisher, AtomicInteger callCount, diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/DataEnricherE2ETest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/DataEnricherE2ETest.java index dc04a960f..2db46bb1d 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/DataEnricherE2ETest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/DataEnricherE2ETest.java @@ -20,7 +20,7 @@ import org.fireflyframework.data.model.EnrichmentRequest; import org.fireflyframework.data.model.EnrichmentResponse; import org.fireflyframework.data.model.EnrichmentStrategy; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; import org.fireflyframework.data.service.DataEnricher; @@ -59,7 +59,7 @@ class DataEnricherE2ETest { private JobTracingService tracingService; @Mock - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; @Mock private ResiliencyDecoratorService resiliencyService; @@ -274,7 +274,7 @@ static class CompanyDTO { static class TestCompanyEnricher extends DataEnricher, CompanyDTO> { public TestCompanyEnricher(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, EnrichmentEventPublisher eventPublisher) { super(tracingService, metricsService, resiliencyService, eventPublisher, CompanyDTO.class); diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/FullStackIntegrationTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/FullStackIntegrationTest.java index 0574b3a00..9e9285885 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/FullStackIntegrationTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/FullStackIntegrationTest.java @@ -19,7 +19,7 @@ import org.fireflyframework.data.enrichment.EnricherFallback; import org.fireflyframework.data.enrichment.FallbackEnrichmentExecutor; import org.fireflyframework.data.enrichment.FallbackStrategy; -import org.fireflyframework.data.lineage.InMemoryLineageTracker; +import org.fireflyframework.data.lineage.InMemoryLineageTrackerImpl; import org.fireflyframework.data.lineage.LineageRecord; import org.fireflyframework.data.model.EnrichmentRequest; import org.fireflyframework.data.model.EnrichmentResponse; @@ -28,14 +28,14 @@ import org.fireflyframework.data.quality.DataQualityRule; import org.fireflyframework.data.quality.QualitySeverity; import org.fireflyframework.data.quality.QualityStrategy; -import org.fireflyframework.data.quality.rules.NotNullRule; -import org.fireflyframework.data.quality.rules.PatternRule; +import org.fireflyframework.data.quality.rules.NotNullRuleImpl; +import org.fireflyframework.data.quality.rules.PatternRuleImpl; import org.fireflyframework.data.service.DataEnricher; import org.fireflyframework.data.service.DataEnricherRegistry; import org.fireflyframework.data.transform.TransformContext; import org.fireflyframework.data.transform.TransformationChain; -import org.fireflyframework.data.transform.transformers.ComputedFieldTransformer; -import org.fireflyframework.data.transform.transformers.FieldMappingTransformer; +import org.fireflyframework.data.transform.transformers.ComputedFieldTransformerImpl; +import org.fireflyframework.data.transform.transformers.FieldMappingTransformerImpl; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.junit.jupiter.MockitoExtension; @@ -121,14 +121,14 @@ void fullFlow_enrichWithFallback_qualityGate_transform_lineage() { // ---- Step 2: Quality gate with real rules ---- @SuppressWarnings("unchecked") - DataQualityRule> nameRule = new NotNullRule<>( + DataQualityRule> nameRule = new NotNullRuleImpl<>( "first_name", m -> m.get("first_name"), QualitySeverity.CRITICAL ); @SuppressWarnings("unchecked") - DataQualityRule> emailRule = new PatternRule<>( + DataQualityRule> emailRule = new PatternRuleImpl<>( "email_address", Pattern.compile(".+@.+\\..+"), m -> (String) m.get("email_address"), @@ -140,12 +140,12 @@ void fullFlow_enrichWithFallback_qualityGate_transform_lineage() { // ---- Step 3: Transformation chain ---- TransformationChain, Map> chain = TransformationChain., Map>create() - .then(new FieldMappingTransformer(Map.of( + .then(new FieldMappingTransformerImpl(Map.of( "first_name", "firstName", "last_name", "lastName", "email_address", "email" ))) - .then(new ComputedFieldTransformer("fullName", + .then(new ComputedFieldTransformerImpl("fullName", m -> m.get("firstName") + " " + m.get("lastName"))); TransformContext transformContext = TransformContext.builder() @@ -153,7 +153,7 @@ void fullFlow_enrichWithFallback_qualityGate_transform_lineage() { .build(); // ---- Step 4: Lineage tracker ---- - InMemoryLineageTracker lineageTracker = new InMemoryLineageTracker(); + InMemoryLineageTrackerImpl lineageTracker = new InMemoryLineageTrackerImpl(); // ---- Execute the full pipeline ---- StepVerifier.create( diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/QualityGateIntegrationTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/QualityGateIntegrationTest.java index a380424ae..1a4422c59 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/integration/QualityGateIntegrationTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/integration/QualityGateIntegrationTest.java @@ -20,8 +20,8 @@ import org.fireflyframework.data.quality.DataQualityRule; import org.fireflyframework.data.quality.QualitySeverity; import org.fireflyframework.data.quality.QualityStrategy; -import org.fireflyframework.data.quality.rules.NotNullRule; -import org.fireflyframework.data.quality.rules.PatternRule; +import org.fireflyframework.data.quality.rules.NotNullRuleImpl; +import org.fireflyframework.data.quality.rules.PatternRuleImpl; import org.junit.jupiter.api.Test; import reactor.test.StepVerifier; @@ -41,13 +41,13 @@ record CustomerRecord(String name, String email, String phone, String taxId) {} @Test void qualityGate_allRulesPass_reportsPassed() { // Given - valid data that satisfies all rules - DataQualityRule nameRule = new NotNullRule<>( + DataQualityRule nameRule = new NotNullRuleImpl<>( "name", CustomerRecord::name, QualitySeverity.CRITICAL); - DataQualityRule emailRule = new PatternRule<>( + DataQualityRule emailRule = new PatternRuleImpl<>( "email", Pattern.compile(".+@.+\\..+"), CustomerRecord::email, QualitySeverity.CRITICAL); - DataQualityRule phoneRule = new PatternRule<>( + DataQualityRule phoneRule = new PatternRuleImpl<>( "phone", Pattern.compile("\\+?\\d[\\d\\-]{7,14}"), CustomerRecord::phone, QualitySeverity.WARNING); - DataQualityRule taxIdRule = new NotNullRule<>( + DataQualityRule taxIdRule = new NotNullRuleImpl<>( "taxId", CustomerRecord::taxId, QualitySeverity.CRITICAL); DataQualityEngine engine = new DataQualityEngine(List.of(nameRule, emailRule, phoneRule, taxIdRule)); @@ -69,13 +69,13 @@ void qualityGate_allRulesPass_reportsPassed() { @Test void qualityGate_failFast_stopsOnFirstCritical() { // Given - first rule (CRITICAL) will fail, second rule (CRITICAL) should not be evaluated - DataQualityRule nameRule = new NotNullRule<>( + DataQualityRule nameRule = new NotNullRuleImpl<>( "name", CustomerRecord::name, QualitySeverity.CRITICAL); - DataQualityRule emailRule = new PatternRule<>( + DataQualityRule emailRule = new PatternRuleImpl<>( "email", Pattern.compile(".+@.+\\..+"), CustomerRecord::email, QualitySeverity.CRITICAL); - DataQualityRule phoneRule = new PatternRule<>( + DataQualityRule phoneRule = new PatternRuleImpl<>( "phone", Pattern.compile("\\+?\\d[\\d\\-]{7,14}"), CustomerRecord::phone, QualitySeverity.WARNING); - DataQualityRule taxIdRule = new NotNullRule<>( + DataQualityRule taxIdRule = new NotNullRuleImpl<>( "taxId", CustomerRecord::taxId, QualitySeverity.CRITICAL); DataQualityEngine engine = new DataQualityEngine(List.of(nameRule, emailRule, phoneRule, taxIdRule)); @@ -103,13 +103,13 @@ void qualityGate_failFast_stopsOnFirstCritical() { @Test void qualityGate_collectAll_reportsAllFailures() { // Given - multiple rules that will fail - DataQualityRule nameRule = new NotNullRule<>( + DataQualityRule nameRule = new NotNullRuleImpl<>( "name", CustomerRecord::name, QualitySeverity.CRITICAL); - DataQualityRule emailRule = new PatternRule<>( + DataQualityRule emailRule = new PatternRuleImpl<>( "email", Pattern.compile(".+@.+\\..+"), CustomerRecord::email, QualitySeverity.CRITICAL); - DataQualityRule phoneRule = new PatternRule<>( + DataQualityRule phoneRule = new PatternRuleImpl<>( "phone", Pattern.compile("\\+?\\d[\\d\\-]{7,14}"), CustomerRecord::phone, QualitySeverity.WARNING); - DataQualityRule taxIdRule = new NotNullRule<>( + DataQualityRule taxIdRule = new NotNullRuleImpl<>( "taxId", CustomerRecord::taxId, QualitySeverity.CRITICAL); DataQualityEngine engine = new DataQualityEngine(List.of(nameRule, emailRule, phoneRule, taxIdRule)); diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/lineage/LineageTrackerTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/lineage/LineageTrackerTest.java index 964657795..c9d094bf0 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/lineage/LineageTrackerTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/lineage/LineageTrackerTest.java @@ -31,11 +31,11 @@ */ class LineageTrackerTest { - private InMemoryLineageTracker tracker; + private InMemoryLineageTrackerImpl tracker; @BeforeEach void setUp() { - tracker = new InMemoryLineageTracker(); + tracker = new InMemoryLineageTrackerImpl(); } @Test diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/logging/RemainingDataLogSafetyTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/logging/RemainingDataLogSafetyTest.java index 4141f4308..32c92ce82 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/logging/RemainingDataLogSafetyTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/logging/RemainingDataLogSafetyTest.java @@ -15,7 +15,7 @@ import org.fireflyframework.data.controller.AbstractSyncDataJobController; import org.fireflyframework.data.event.*; import org.fireflyframework.data.model.*; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.orchestration.model.JobExecutionStatus; import org.fireflyframework.data.persistence.model.JobExecutionResult; import org.fireflyframework.data.persistence.port.JobExecutionResultRepository; @@ -42,8 +42,8 @@ class RemainingDataLogSafetyTest { @Test void enrichmentMetricDiagnosticsPreserveExactRawTags() { var properties = new JobOrchestrationProperties(); var registry = new SimpleMeterRegistry(); - try (var logs = new Capture(JobMetricsService.class)) { - var service = new JobMetricsService(registry, properties); + try (var logs = new Capture(JobMetricsServiceImpl.class)) { + var service = new JobMetricsServiceImpl(registry, properties); service.recordEnrichmentMetrics(FIELD, FIELD, true, 42, 3, 1.5); service.recordEnrichmentError(FIELD, FIELD, FIELD, 42); assertNotNull(registry.find("firefly.data.enrichment.duration").tags("type", FIELD, "provider", FIELD).timer()); @@ -55,8 +55,8 @@ class RemainingDataLogSafetyTest { @Test void ordinaryJobMetricsKeepRawExecutionKeysAndStatuses() { var properties = new JobOrchestrationProperties(); var registry = new SimpleMeterRegistry(); - try (var logs = new Capture(JobMetricsService.class)) { - var service = new JobMetricsService(registry, properties); + try (var logs = new Capture(JobMetricsServiceImpl.class)) { + var service = new JobMetricsServiceImpl(registry, properties); service.recordJobStageExecution(JobStage.START, FIELD, Duration.ofMillis(2)); service.incrementJobStageCounter(JobStage.CHECK, FIELD); service.recordJobExecutionStart(FIELD); diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/logging/StarterDataLogSafetyTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/logging/StarterDataLogSafetyTest.java index 786f8ba4d..2d7e91cf7 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/logging/StarterDataLogSafetyTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/logging/StarterDataLogSafetyTest.java @@ -25,7 +25,7 @@ import org.fireflyframework.data.config.JobOrchestrationProperties; import org.fireflyframework.data.controller.AbstractDataJobController; import org.fireflyframework.data.model.*; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; import org.fireflyframework.data.service.AbstractResilientDataJobService; @@ -275,7 +275,7 @@ Mono result(JobStageRequest value) { private static class ResilientJob extends AbstractResilientDataJobService { private final Mono outcome; JobStageRequest seen; ResilientJob(Mono outcome) { - super(tracing(), new JobMetricsService(new SimpleMeterRegistry(), new JobOrchestrationProperties()), + super(tracing(), new JobMetricsServiceImpl(new SimpleMeterRegistry(), new JobOrchestrationProperties()), new ResiliencyDecoratorService(new JobOrchestrationProperties())); this.outcome = outcome; } diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/observability/JobMetricsServiceTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/observability/JobMetricsServiceTest.java index 4f847e5b2..29ab1c227 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/observability/JobMetricsServiceTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/observability/JobMetricsServiceTest.java @@ -30,7 +30,7 @@ class JobMetricsServiceTest { - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; private MeterRegistry meterRegistry; private JobOrchestrationProperties properties; @@ -42,7 +42,7 @@ void setUp() { properties.getObservability().setMetricPrefix("firefly.data"); properties.setOrchestratorType("AWS_STEP_FUNCTIONS"); - metricsService = new JobMetricsService(meterRegistry, properties); + metricsService = new JobMetricsServiceImpl(meterRegistry, properties); } @Test diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/quality/DataQualityEngineTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/quality/DataQualityEngineTest.java index 144238075..e741b672f 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/quality/DataQualityEngineTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/quality/DataQualityEngineTest.java @@ -17,8 +17,8 @@ package org.fireflyframework.data.quality; import org.fireflyframework.data.event.DataQualityEvent; -import org.fireflyframework.data.quality.rules.NotNullRule; -import org.fireflyframework.data.quality.rules.PatternRule; +import org.fireflyframework.data.quality.rules.NotNullRuleImpl; +import org.fireflyframework.data.quality.rules.PatternRuleImpl; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; @@ -47,9 +47,9 @@ record TestDTO(String name, String email, int age) {} @Test void evaluate_collectAll_shouldRunAllRulesEvenOnFailure() { // Given - two rules that both fail - DataQualityRule nameRule = new NotNullRule<>( + DataQualityRule nameRule = new NotNullRuleImpl<>( "name", TestDTO::name, QualitySeverity.CRITICAL); - DataQualityRule emailRule = new NotNullRule<>( + DataQualityRule emailRule = new NotNullRuleImpl<>( "email", TestDTO::email, QualitySeverity.CRITICAL); DataQualityEngine engine = new DataQualityEngine(List.of(nameRule, emailRule)); @@ -69,9 +69,9 @@ void evaluate_collectAll_shouldRunAllRulesEvenOnFailure() { @Test void evaluate_failFast_shouldStopOnFirstCriticalFailure() { // Given - first rule is CRITICAL and fails, second should not execute - DataQualityRule nameRule = new NotNullRule<>( + DataQualityRule nameRule = new NotNullRuleImpl<>( "name", TestDTO::name, QualitySeverity.CRITICAL); - DataQualityRule emailRule = new NotNullRule<>( + DataQualityRule emailRule = new NotNullRuleImpl<>( "email", TestDTO::email, QualitySeverity.CRITICAL); DataQualityEngine engine = new DataQualityEngine(List.of(nameRule, emailRule)); @@ -90,9 +90,9 @@ void evaluate_failFast_shouldStopOnFirstCriticalFailure() { @Test void evaluate_shouldPassWhenAllRulesPass() { // Given - DataQualityRule nameRule = new NotNullRule<>( + DataQualityRule nameRule = new NotNullRuleImpl<>( "name", TestDTO::name, QualitySeverity.CRITICAL); - DataQualityRule emailRule = new PatternRule<>( + DataQualityRule emailRule = new PatternRuleImpl<>( "email", Pattern.compile(".+@.+\\..+"), TestDTO::email); DataQualityEngine engine = new DataQualityEngine(List.of(nameRule, emailRule)); @@ -113,7 +113,7 @@ void evaluate_shouldPassWhenAllRulesPass() { @Test void evaluate_shouldReportWarningsAsPassedButIncludeThem() { // Given - WARNING failure should not make report.passed false - DataQualityRule emailRule = new PatternRule<>( + DataQualityRule emailRule = new PatternRuleImpl<>( "email", Pattern.compile(".+@.+\\..+"), TestDTO::email, QualitySeverity.WARNING); DataQualityEngine engine = new DataQualityEngine(List.of(emailRule)); @@ -134,7 +134,7 @@ void evaluate_shouldReportWarningsAsPassedButIncludeThem() { @Test void evaluate_shouldPublishEvent() { // Given - DataQualityRule nameRule = new NotNullRule<>( + DataQualityRule nameRule = new NotNullRuleImpl<>( "name", TestDTO::name, QualitySeverity.CRITICAL); DataQualityEngine engine = new DataQualityEngine(List.of(nameRule), eventPublisher); diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/service/AbstractResilientDataJobServiceTimeoutTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/service/AbstractResilientDataJobServiceTimeoutTest.java index 6e37a9ea6..917fa1769 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/service/AbstractResilientDataJobServiceTimeoutTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/service/AbstractResilientDataJobServiceTimeoutTest.java @@ -20,7 +20,7 @@ import org.fireflyframework.data.model.JobStage; import org.fireflyframework.data.model.JobStageRequest; import org.fireflyframework.data.model.JobStageResponse; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.persistence.service.JobAuditService; import org.fireflyframework.data.persistence.service.JobExecutionResultService; @@ -50,7 +50,7 @@ class AbstractResilientDataJobServiceTimeoutTest { private JobTracingService tracingService; @Mock - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; @Mock private ResiliencyDecoratorService resiliencyService; @@ -179,7 +179,7 @@ static class TestDataJobServiceWithTimeout extends AbstractResilientDataJobServi private final Duration operationDelay; TestDataJobServiceWithTimeout(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher, JobAuditService auditService, diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/service/AbstractResilientSyncDataJobServiceTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/service/AbstractResilientSyncDataJobServiceTest.java index 621a7b534..4028f3417 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/service/AbstractResilientSyncDataJobServiceTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/service/AbstractResilientSyncDataJobServiceTest.java @@ -20,7 +20,7 @@ import org.fireflyframework.data.model.JobStage; import org.fireflyframework.data.model.JobStageRequest; import org.fireflyframework.data.model.JobStageResponse; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.persistence.service.JobAuditService; import org.fireflyframework.data.persistence.service.JobExecutionResultService; @@ -50,7 +50,7 @@ class AbstractResilientSyncDataJobServiceTest { private JobTracingService tracingService; @Mock - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; @Mock private ResiliencyDecoratorService resiliencyService; @@ -289,7 +289,7 @@ void getOrchestratorType_shouldReturnSync() { static class TestSyncDataJobService extends AbstractResilientSyncDataJobService { public TestSyncDataJobService(JobTracingService tracingService, - JobMetricsService metricsService, + JobMetricsServiceImpl metricsService, ResiliencyDecoratorService resiliencyService, JobEventPublisher eventPublisher, JobAuditService auditService, diff --git a/modules/starter-data/src/test/java/org/fireflyframework/data/service/DataEnricherTest.java b/modules/starter-data/src/test/java/org/fireflyframework/data/service/DataEnricherTest.java index d97ba8d07..3cfc4b6d7 100644 --- a/modules/starter-data/src/test/java/org/fireflyframework/data/service/DataEnricherTest.java +++ b/modules/starter-data/src/test/java/org/fireflyframework/data/service/DataEnricherTest.java @@ -20,7 +20,7 @@ import org.fireflyframework.data.model.EnrichmentRequest; import org.fireflyframework.data.model.EnrichmentResponse; import org.fireflyframework.data.model.EnrichmentStrategy; -import org.fireflyframework.data.observability.JobMetricsService; +import org.fireflyframework.data.observability.JobMetricsServiceImpl; import org.fireflyframework.data.observability.JobTracingService; import org.fireflyframework.data.resiliency.ResiliencyDecoratorService; import lombok.AllArgsConstructor; @@ -51,7 +51,7 @@ class DataEnricherTest { private JobTracingService tracingService; @Mock - private JobMetricsService metricsService; + private JobMetricsServiceImpl metricsService; @Mock private ResiliencyDecoratorService resiliencyService; @@ -255,7 +255,7 @@ static class TestTypedEnricher extends DataEnricher, Map> chain = TransformationChain., Map>create() - .then(new FieldMappingTransformer(Map.of("first_name", "firstName"))) - .then(new ComputedFieldTransformer("greeting", + .then(new FieldMappingTransformerImpl(Map.of("first_name", "firstName"))) + .then(new ComputedFieldTransformerImpl("greeting", m -> "Hello, " + m.get("firstName") + "!")); Map source = new HashMap<>(Map.of("first_name", "Alice", "age", 30)); @@ -95,8 +95,8 @@ void chain_shouldComposeMultipleTransformers() { TransformationChain, Map> chain = TransformationChain., Map>create() - .then(new FieldMappingTransformer(Map.of("old_key", "newKey"))) - .then(new ComputedFieldTransformer("status", m -> "processed")) + .then(new FieldMappingTransformerImpl(Map.of("old_key", "newKey"))) + .then(new ComputedFieldTransformerImpl("status", m -> "processed")) .then(filterNulls); Map source = new HashMap<>(); @@ -121,7 +121,7 @@ void chain_shouldComposeMultipleTransformers() { @Test void fieldMappingTransformer_shouldRenameFields() { // Given - FieldMappingTransformer transformer = new FieldMappingTransformer( + FieldMappingTransformerImpl transformer = new FieldMappingTransformerImpl( Map.of("first_name", "firstName", "last_name", "lastName")); Map source = new HashMap<>( @@ -142,7 +142,7 @@ void fieldMappingTransformer_shouldRenameFields() { @Test void computedFieldTransformer_shouldAddComputedField() { // Given - ComputedFieldTransformer transformer = new ComputedFieldTransformer( + ComputedFieldTransformerImpl transformer = new ComputedFieldTransformerImpl( "fullName", m -> m.get("first") + " " + m.get("last")); diff --git a/modules/starter-domain/src/test/java/org/fireflyframework/domain/config/PostgresCacheArchitectureContextTest.java b/modules/starter-domain/src/test/java/org/fireflyframework/domain/config/PostgresCacheArchitectureContextTest.java index 978531db0..0d55929e2 100644 --- a/modules/starter-domain/src/test/java/org/fireflyframework/domain/config/PostgresCacheArchitectureContextTest.java +++ b/modules/starter-domain/src/test/java/org/fireflyframework/domain/config/PostgresCacheArchitectureContextTest.java @@ -78,7 +78,7 @@ void statelessRole() { }).withPropertyValues("spring.autoconfigure.exclude=org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration") .run(application -> { assertThat(application).hasNotFailed(); - assertThat(application.getBean(org.fireflyframework.cache.manager.FireflyCacheManager.class).getCacheType()) + assertThat(application.getBean(org.fireflyframework.cache.manager.FireflyCacheManagerImpl.class).getCacheType()) .isEqualTo(org.fireflyframework.cache.core.CacheType.POSTGRES); assertThat(application).doesNotHaveBean("connectionFactory"); assertThat(application).doesNotHaveBean(R2dbcEntityTemplate.class); diff --git a/modules/utils/src/main/java/org/fireflyframework/utils/template/RestrictedHtmlTemplateRenderer.java b/modules/utils/src/main/java/org/fireflyframework/utils/template/RestrictedHtmlTemplateRenderer.java index 39ce380b5..fd49602ae 100644 --- a/modules/utils/src/main/java/org/fireflyframework/utils/template/RestrictedHtmlTemplateRenderer.java +++ b/modules/utils/src/main/java/org/fireflyframework/utils/template/RestrictedHtmlTemplateRenderer.java @@ -102,7 +102,7 @@ public RestrictedTemplateResult render(String source, Map model) { || source.getBytes(StandardCharsets.UTF_8).length > limits.templateBytes()) { return failure("UNSUPPORTED_TEMPLATE"); } - var budget = new Budget(); + var budget = new BudgetImpl(); Object copied = copy(model, 0, budget); if (!(copied instanceof Map)) return failure("UNSUPPORTED_MODEL"); var template = new Template("restricted-published-template", new StringReader(source), configuration); @@ -124,7 +124,7 @@ public RestrictedTemplateResult render(String source, Map model) { } } - private Object copy(Object value, int depth, Budget budget) { + private Object copy(Object value, int depth, BudgetImpl budget) { if (++budget.nodes > limits.modelNodes() || depth > limits.depth()) throw new UnsupportedModel(); budget.deadline(); if (value == null || value instanceof Boolean) return value; @@ -219,7 +219,7 @@ private static final class RenderLimit extends RuntimeException { } private static final class UnsupportedModel extends RuntimeException { } private static final class InvalidHtml extends RuntimeException { } - private final class Budget implements TemplateProcessingTracer { + private final class BudgetImpl implements TemplateProcessingTracer { private final long end = System.nanoTime() + limits.renderMillis() * 1_000_000; private int nodes, steps, depth; void deadline() { if (System.nanoTime() > end) throw new RenderLimit(); } diff --git a/modules/validators/README.md b/modules/validators/README.md index 13ddc7d9a..ecbb5273a 100644 --- a/modules/validators/README.md +++ b/modules/validators/README.md @@ -97,7 +97,7 @@ This module declares no `@ConfigurationProperties` class of its own. Use the con | [`ValidIban`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/annotations/ValidIban.java) | Defines `message`, `groups`, `payload` operations. | | [`ValidAmount`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAmount.java) | Defines `message`, `groups`, `payload`, `currency` operations. | | [`ValidPasswordStrength`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPasswordStrength.java) | Defines `message`, `groups`, `payload`, `minLength` operations. | -| [`IbanValidator`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/validators/IbanValidator.java) | Validator for International Bank Account Numbers (IBAN). | +| [`IbanValidatorImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/validators/IbanValidatorImpl.java) | Validator for International Bank Account Numbers (IBAN). | | [`ValidAccountNumber`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAccountNumber.java) | Defines `message`, `groups`, `payload`, `countryCode` operations. | ## Continue the application diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAccountNumber.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAccountNumber.java index a7467b228..a2892e8d3 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAccountNumber.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAccountNumber.java @@ -17,14 +17,14 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.AccountNumberValidator; +import org.fireflyframework.validators.AccountNumberValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; import java.lang.annotation.*; @Documented -@Constraint(validatedBy = AccountNumberValidator.class) +@Constraint(validatedBy = AccountNumberValidatorImpl.class) @Target({ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidAccountNumber { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAmount.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAmount.java index 0b5eb8c18..681e154be 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAmount.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidAmount.java @@ -17,7 +17,7 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.AmountValidator; +import org.fireflyframework.validators.AmountValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; @@ -33,7 +33,7 @@ * with the appropriate number of decimal places for the specified currency. */ @Documented -@Constraint(validatedBy = AmountValidator.class) +@Constraint(validatedBy = AmountValidatorImpl.class) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidAmount { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidBic.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidBic.java index b97774136..b77c4dca4 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidBic.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidBic.java @@ -17,14 +17,14 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.BicValidator; +import org.fireflyframework.validators.BicValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; import java.lang.annotation.*; @Documented -@Constraint(validatedBy = BicValidator.class) +@Constraint(validatedBy = BicValidatorImpl.class) @Target({ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidBic { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCVV.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCVV.java index a35ca2cbc..cca67c771 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCVV.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCVV.java @@ -17,7 +17,7 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.CVVValidator; +import org.fireflyframework.validators.CVVValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; @@ -32,7 +32,7 @@ * By default, validates that the CVV is 3 or 4 digits. */ @Documented -@Constraint(validatedBy = CVVValidator.class) +@Constraint(validatedBy = CVVValidatorImpl.class) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidCVV { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCreditCard.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCreditCard.java index a8f754118..80b64673f 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCreditCard.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCreditCard.java @@ -17,19 +17,19 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.CreditCardValidator; +import org.fireflyframework.validators.CreditCardValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; import java.lang.annotation.*; @Documented -@Constraint(validatedBy = CreditCardValidator.class) +@Constraint(validatedBy = CreditCardValidatorImpl.class) @Target({ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidCreditCard { String message() default "Número de tarjeta de crédito inválido"; Class[] groups() default {}; Class[] payload() default {}; - CreditCardValidator.CardType[] types() default {}; + CreditCardValidatorImpl.CardType[] types() default {}; } \ No newline at end of file diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCurrencyCode.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCurrencyCode.java index 3f6d8582f..13b6902b6 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCurrencyCode.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidCurrencyCode.java @@ -17,14 +17,14 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.CurrencyCodeValidator; +import org.fireflyframework.validators.CurrencyCodeValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; import java.lang.annotation.*; @Documented -@Constraint(validatedBy = CurrencyCodeValidator.class) +@Constraint(validatedBy = CurrencyCodeValidatorImpl.class) @Target({ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidCurrencyCode { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidDate.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidDate.java index 2a78ee616..6dcd93f42 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidDate.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidDate.java @@ -17,7 +17,7 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.DateValidator; +import org.fireflyframework.validators.DateValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; @@ -32,7 +32,7 @@ * By default, validates dates in ISO format (yyyy-MM-dd). */ @Documented -@Constraint(validatedBy = DateValidator.class) +@Constraint(validatedBy = DateValidatorImpl.class) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidDate { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidDateTime.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidDateTime.java index 2728e05d6..c4641ccc9 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidDateTime.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidDateTime.java @@ -17,7 +17,7 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.DateTimeValidator; +import org.fireflyframework.validators.DateTimeValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; @@ -32,7 +32,7 @@ * By default, validates date-times in ISO format (yyyy-MM-dd HH:mm:ss). */ @Documented -@Constraint(validatedBy = DateTimeValidator.class) +@Constraint(validatedBy = DateTimeValidatorImpl.class) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidDateTime { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidIban.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidIban.java index 4b11c7c89..d7aa920b1 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidIban.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidIban.java @@ -17,14 +17,14 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.IbanValidator; +import org.fireflyframework.validators.IbanValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; import java.lang.annotation.*; @Documented -@Constraint(validatedBy = IbanValidator.class) +@Constraint(validatedBy = IbanValidatorImpl.class) @Target({ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidIban { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidInterestRate.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidInterestRate.java index e0363a8ca..1d7c82f43 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidInterestRate.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidInterestRate.java @@ -17,7 +17,7 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.InterestRateValidator; +import org.fireflyframework.validators.InterestRateValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; @@ -32,7 +32,7 @@ * By default, validates that the interest rate is a percentage between 0 and 100. */ @Documented -@Constraint(validatedBy = InterestRateValidator.class) +@Constraint(validatedBy = InterestRateValidatorImpl.class) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidInterestRate { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidNationalId.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidNationalId.java index 6b7c04ef1..f7d47bca5 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidNationalId.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidNationalId.java @@ -17,7 +17,7 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.NationalIdValidator; +import org.fireflyframework.validators.NationalIdValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; @@ -37,7 +37,7 @@ * - And others depending on the country */ @Documented -@Constraint(validatedBy = NationalIdValidator.class) +@Constraint(validatedBy = NationalIdValidatorImpl.class) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidNationalId { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPIN.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPIN.java index c77bce9b3..1d828fb3f 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPIN.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPIN.java @@ -17,7 +17,7 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.PINValidator; +import org.fireflyframework.validators.PINValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; @@ -32,7 +32,7 @@ * By default, validates that the PIN is numeric and has 4-6 digits. */ @Documented -@Constraint(validatedBy = PINValidator.class) +@Constraint(validatedBy = PINValidatorImpl.class) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidPIN { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPasswordStrength.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPasswordStrength.java index 13903c739..85ba946a9 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPasswordStrength.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPasswordStrength.java @@ -17,7 +17,7 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.PasswordStrengthValidator; +import org.fireflyframework.validators.PasswordStrengthValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; @@ -34,7 +34,7 @@ * one digit, and one special character. */ @Documented -@Constraint(validatedBy = PasswordStrengthValidator.class) +@Constraint(validatedBy = PasswordStrengthValidatorImpl.class) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidPasswordStrength { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPhoneNumber.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPhoneNumber.java index d67f9e814..c7876d779 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPhoneNumber.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidPhoneNumber.java @@ -17,7 +17,7 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.PhoneNumberValidator; +import org.fireflyframework.validators.PhoneNumberValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; @@ -32,7 +32,7 @@ * By default, validates phone numbers in the international E.164 format. */ @Documented -@Constraint(validatedBy = PhoneNumberValidator.class) +@Constraint(validatedBy = PhoneNumberValidatorImpl.class) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidPhoneNumber { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidSortCode.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidSortCode.java index 2fc4754ce..31cf6c516 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidSortCode.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidSortCode.java @@ -17,14 +17,14 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.SortCodeValidator; +import org.fireflyframework.validators.SortCodeValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; import java.lang.annotation.*; @Documented -@Constraint(validatedBy = SortCodeValidator.class) +@Constraint(validatedBy = SortCodeValidatorImpl.class) @Target({ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidSortCode { diff --git a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidTaxId.java b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidTaxId.java index 50dac08a1..631bc8ddb 100644 --- a/modules/validators/src/main/java/org/fireflyframework/annotations/ValidTaxId.java +++ b/modules/validators/src/main/java/org/fireflyframework/annotations/ValidTaxId.java @@ -17,7 +17,7 @@ package org.fireflyframework.annotations; -import org.fireflyframework.validators.TaxIdValidator; +import org.fireflyframework.validators.TaxIdValidatorImpl; import jakarta.validation.Constraint; import jakarta.validation.Payload; @@ -37,7 +37,7 @@ * - And others depending on the country */ @Documented -@Constraint(validatedBy = TaxIdValidator.class) +@Constraint(validatedBy = TaxIdValidatorImpl.class) @Target({ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER}) @Retention(RetentionPolicy.RUNTIME) public @interface ValidTaxId { diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/AccountNumberValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/AccountNumberValidatorImpl.java similarity index 96% rename from modules/validators/src/main/java/org/fireflyframework/validators/AccountNumberValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/AccountNumberValidatorImpl.java index 108db099e..caed6a7c5 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/AccountNumberValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/AccountNumberValidatorImpl.java @@ -31,7 +31,7 @@ * This validator checks if an account number is valid according to various * country-specific formats, with a focus on European banking systems. */ -public class AccountNumberValidator implements ConstraintValidator { +public class AccountNumberValidatorImpl implements ConstraintValidator { private String countryCode; @@ -146,7 +146,7 @@ public String formatUkAccountNumber(String accountNumber) { * @return true if both the sort code and account number are valid, false otherwise */ public boolean isValidUkBankAccount(String sortCode, String accountNumber) { - SortCodeValidator sortCodeValidator = new SortCodeValidator(); + SortCodeValidatorImpl sortCodeValidator = new SortCodeValidatorImpl(); return sortCodeValidator.isValidSortCode(sortCode) && isValidUkAccountNumber(accountNumber); } @@ -163,7 +163,7 @@ public String formatUkBankAccount(String sortCode, String accountNumber) { return null; } - SortCodeValidator sortCodeValidator = new SortCodeValidator(); + SortCodeValidatorImpl sortCodeValidator = new SortCodeValidatorImpl(); String formattedSortCode = sortCodeValidator.format(sortCode); String normalizedAccountNumber = normalize(accountNumber); diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/AmountValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/AmountValidatorImpl.java similarity index 99% rename from modules/validators/src/main/java/org/fireflyframework/validators/AmountValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/AmountValidatorImpl.java index 119bfc6cf..86a19f354 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/AmountValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/AmountValidatorImpl.java @@ -34,7 +34,7 @@ * - Min/max constraints * - Currency-specific decimal place limits */ -public class AmountValidator implements ConstraintValidator { +public class AmountValidatorImpl implements ConstraintValidator { private String currencyCode; private double min; diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/BicValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/BicValidatorImpl.java similarity index 98% rename from modules/validators/src/main/java/org/fireflyframework/validators/BicValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/BicValidatorImpl.java index 1586f73fe..613d85a38 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/BicValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/BicValidatorImpl.java @@ -34,7 +34,7 @@ * - Location code (2 letters or digits) * - Optional branch code (3 letters or digits) */ -public class BicValidator implements ConstraintValidator { +public class BicValidatorImpl implements ConstraintValidator { @Override public void initialize(ValidBic constraintAnnotation) { diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/CVVValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/CVVValidatorImpl.java similarity index 98% rename from modules/validators/src/main/java/org/fireflyframework/validators/CVVValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/CVVValidatorImpl.java index 049cc1ae7..742ee78c5 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/CVVValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/CVVValidatorImpl.java @@ -30,7 +30,7 @@ * - Length constraints (3 digits for standard cards, 4 digits for American Express) * - Character constraints (numeric only) */ -public class CVVValidator implements ConstraintValidator { +public class CVVValidatorImpl implements ConstraintValidator { private ValidCVV.CardType cardType; diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/CreditCardValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/CreditCardValidatorImpl.java similarity index 98% rename from modules/validators/src/main/java/org/fireflyframework/validators/CreditCardValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/CreditCardValidatorImpl.java index b67d3b6d3..16305f824 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/CreditCardValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/CreditCardValidatorImpl.java @@ -31,7 +31,7 @@ * - Card type specific patterns (Visa, MasterCard, American Express, etc.) * - Luhn algorithm validation */ -public class CreditCardValidator implements ConstraintValidator { +public class CreditCardValidatorImpl implements ConstraintValidator { private CardType[] acceptedCardTypes; diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/CurrencyCodeValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/CurrencyCodeValidatorImpl.java similarity index 98% rename from modules/validators/src/main/java/org/fireflyframework/validators/CurrencyCodeValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/CurrencyCodeValidatorImpl.java index 913db3564..c00bb94b3 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/CurrencyCodeValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/CurrencyCodeValidatorImpl.java @@ -30,7 +30,7 @@ * This validator checks if a currency code is valid according to the ISO 4217 standard, * which defines three-letter codes for currencies used in international transactions. */ -public class CurrencyCodeValidator implements ConstraintValidator { +public class CurrencyCodeValidatorImpl implements ConstraintValidator { private boolean europeanOnly; private boolean euroOnly; diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/DateTimeValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/DateTimeValidatorImpl.java similarity index 99% rename from modules/validators/src/main/java/org/fireflyframework/validators/DateTimeValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/DateTimeValidatorImpl.java index d0802f00f..8bc6259b2 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/DateTimeValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/DateTimeValidatorImpl.java @@ -36,7 +36,7 @@ * - Min/max constraints * - Future/past constraints */ -public class DateTimeValidator implements ConstraintValidator { +public class DateTimeValidatorImpl implements ConstraintValidator { private String pattern; private String min; diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/DateValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/DateValidatorImpl.java similarity index 99% rename from modules/validators/src/main/java/org/fireflyframework/validators/DateValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/DateValidatorImpl.java index 85b35b620..bb59b82b0 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/DateValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/DateValidatorImpl.java @@ -38,7 +38,7 @@ * - Min/max constraints * - Future/past constraints */ -public class DateValidator implements ConstraintValidator { +public class DateValidatorImpl implements ConstraintValidator { private String pattern; private String min; diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/IbanValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/IbanValidatorImpl.java similarity index 99% rename from modules/validators/src/main/java/org/fireflyframework/validators/IbanValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/IbanValidatorImpl.java index 37ea2571d..9ca53ae6e 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/IbanValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/IbanValidatorImpl.java @@ -35,7 +35,7 @@ * - Length validation based on country * - Character set validation */ -public class IbanValidator implements ConstraintValidator { +public class IbanValidatorImpl implements ConstraintValidator { // Map of country codes to their respective IBAN lengths private static final Map COUNTRY_CODE_TO_LENGTH = new HashMap<>(); diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/InterestRateValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/InterestRateValidatorImpl.java similarity index 98% rename from modules/validators/src/main/java/org/fireflyframework/validators/InterestRateValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/InterestRateValidatorImpl.java index 857fb8cfa..94f9c0c4a 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/InterestRateValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/InterestRateValidatorImpl.java @@ -31,7 +31,7 @@ * - Decimal place constraints * - Zero allowance */ -public class InterestRateValidator implements ConstraintValidator { +public class InterestRateValidatorImpl implements ConstraintValidator { private double min; private double max; diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/NationalIdValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/NationalIdValidatorImpl.java similarity index 96% rename from modules/validators/src/main/java/org/fireflyframework/validators/NationalIdValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/NationalIdValidatorImpl.java index 67c78fc3e..9c59505f8 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/NationalIdValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/NationalIdValidatorImpl.java @@ -36,7 +36,7 @@ * - UK National Insurance Number * - And others depending on the country */ -public class NationalIdValidator implements ConstraintValidator { +public class NationalIdValidatorImpl implements ConstraintValidator { private String countryCode; @@ -58,17 +58,17 @@ public class NationalIdValidator implements ConstraintValidator> COUNTRY_VALIDATORS = new HashMap<>(); static { - COUNTRY_VALIDATORS.put("ES", NationalIdValidator::validateSpanishId); + COUNTRY_VALIDATORS.put("ES", NationalIdValidatorImpl::validateSpanishId); COUNTRY_VALIDATORS.put("US", id -> US_SSN_PATTERN.matcher(id).matches()); - COUNTRY_VALIDATORS.put("BR", NationalIdValidator::validateBrazilianCPF); + COUNTRY_VALIDATORS.put("BR", NationalIdValidatorImpl::validateBrazilianCPF); COUNTRY_VALIDATORS.put("GB", id -> UK_NINO_PATTERN.matcher(id).matches()); COUNTRY_VALIDATORS.put("MX", id -> MEXICO_RFC_PATTERN.matcher(id).matches()); COUNTRY_VALIDATORS.put("AR", id -> ARGENTINA_DNI_PATTERN.matcher(id).matches()); COUNTRY_VALIDATORS.put("CO", id -> COLOMBIA_CC_PATTERN.matcher(id).matches()); - COUNTRY_VALIDATORS.put("CL", NationalIdValidator::validateChileanRUT); + COUNTRY_VALIDATORS.put("CL", NationalIdValidatorImpl::validateChileanRUT); COUNTRY_VALIDATORS.put("FR", id -> FRANCE_INSEE_PATTERN.matcher(id).matches()); COUNTRY_VALIDATORS.put("DE", id -> GERMANY_PERSONALAUSWEIS_PATTERN.matcher(id).matches()); - COUNTRY_VALIDATORS.put("IT", NationalIdValidator::validateItalianCodiceFiscale); + COUNTRY_VALIDATORS.put("IT", NationalIdValidatorImpl::validateItalianCodiceFiscale); } @Override diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/PINValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/PINValidatorImpl.java similarity index 99% rename from modules/validators/src/main/java/org/fireflyframework/validators/PINValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/PINValidatorImpl.java index b07f78322..9981d0259 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/PINValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/PINValidatorImpl.java @@ -34,7 +34,7 @@ * - Character constraints (typically numeric only) * - Common/weak PIN detection */ -public class PINValidator implements ConstraintValidator { +public class PINValidatorImpl implements ConstraintValidator { private int minLength; private int maxLength; diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/PasswordStrengthValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/PasswordStrengthValidatorImpl.java similarity index 98% rename from modules/validators/src/main/java/org/fireflyframework/validators/PasswordStrengthValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/PasswordStrengthValidatorImpl.java index 467475ceb..244237b89 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/PasswordStrengthValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/PasswordStrengthValidatorImpl.java @@ -31,7 +31,7 @@ *

    * For password strength analysis and generation utilities, see {@link PasswordStrengthUtils}. */ -public class PasswordStrengthValidator implements ConstraintValidator { +public class PasswordStrengthValidatorImpl implements ConstraintValidator { private int minLength; private int maxLength; diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/PhoneNumberValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/PhoneNumberValidatorImpl.java similarity index 99% rename from modules/validators/src/main/java/org/fireflyframework/validators/PhoneNumberValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/PhoneNumberValidatorImpl.java index 16bddd3ce..1a8757a7e 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/PhoneNumberValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/PhoneNumberValidatorImpl.java @@ -31,7 +31,7 @@ * This validator checks if a phone number is valid according to the E.164 standard * and provides country-specific validation. */ -public class PhoneNumberValidator implements ConstraintValidator { +public class PhoneNumberValidatorImpl implements ConstraintValidator { private boolean e164Format; private String countryCode; diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/SortCodeValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/SortCodeValidatorImpl.java similarity index 97% rename from modules/validators/src/main/java/org/fireflyframework/validators/SortCodeValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/SortCodeValidatorImpl.java index 2846ea0f8..c9ad9e12e 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/SortCodeValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/SortCodeValidatorImpl.java @@ -30,7 +30,7 @@ * which defines sort codes as 6-digit numbers used to identify banks and branches. * Sort codes are typically formatted as "XX-XX-XX" where X is a digit. */ -public class SortCodeValidator implements ConstraintValidator { +public class SortCodeValidatorImpl implements ConstraintValidator { @Override public void initialize(ValidSortCode constraintAnnotation) { diff --git a/modules/validators/src/main/java/org/fireflyframework/validators/TaxIdValidator.java b/modules/validators/src/main/java/org/fireflyframework/validators/TaxIdValidatorImpl.java similarity index 97% rename from modules/validators/src/main/java/org/fireflyframework/validators/TaxIdValidator.java rename to modules/validators/src/main/java/org/fireflyframework/validators/TaxIdValidatorImpl.java index c8282c8e5..9de4dfaca 100644 --- a/modules/validators/src/main/java/org/fireflyframework/validators/TaxIdValidator.java +++ b/modules/validators/src/main/java/org/fireflyframework/validators/TaxIdValidatorImpl.java @@ -36,7 +36,7 @@ * - Spain NIF (Número de Identificación Fiscal) * - And others depending on the country */ -public class TaxIdValidator implements ConstraintValidator { +public class TaxIdValidatorImpl implements ConstraintValidator { private String countryCode; @@ -57,11 +57,11 @@ public class TaxIdValidator implements ConstraintValidator { private static final Map> COUNTRY_VALIDATORS = new HashMap<>(); static { - COUNTRY_VALIDATORS.put("US", TaxIdValidator::validateUSTaxId); + COUNTRY_VALIDATORS.put("US", TaxIdValidatorImpl::validateUSTaxId); COUNTRY_VALIDATORS.put("MX", id -> MEXICO_RFC_PATTERN.matcher(id).matches()); - COUNTRY_VALIDATORS.put("AR", TaxIdValidator::validateArgentinaCUIT); - COUNTRY_VALIDATORS.put("ES", TaxIdValidator::validateSpainNIF); - COUNTRY_VALIDATORS.put("BR", TaxIdValidator::validateBrazilCNPJ); + COUNTRY_VALIDATORS.put("AR", TaxIdValidatorImpl::validateArgentinaCUIT); + COUNTRY_VALIDATORS.put("ES", TaxIdValidatorImpl::validateSpainNIF); + COUNTRY_VALIDATORS.put("BR", TaxIdValidatorImpl::validateBrazilCNPJ); COUNTRY_VALIDATORS.put("GB", id -> UK_UTR_PATTERN.matcher(id).matches()); COUNTRY_VALIDATORS.put("FR", id -> FRANCE_SIRET_PATTERN.matcher(id).matches()); COUNTRY_VALIDATORS.put("DE", id -> GERMANY_STEUERNUMMER_PATTERN.matcher(id).matches()); diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/AccountNumberValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/AccountNumberValidatorTest.java index c72200592..a40704d77 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/AccountNumberValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/AccountNumberValidatorTest.java @@ -30,11 +30,11 @@ */ class AccountNumberValidatorTest { - private AccountNumberValidator validator; + private AccountNumberValidatorImpl validator; @BeforeEach void setUp() { - validator = new AccountNumberValidator(); + validator = new AccountNumberValidatorImpl(); } @Test diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/AmountValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/AmountValidatorTest.java index cea25a666..f330e00a4 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/AmountValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/AmountValidatorTest.java @@ -31,11 +31,11 @@ */ class AmountValidatorTest { - private AmountValidator validator; + private AmountValidatorImpl validator; @BeforeEach void setUp() { - validator = new AmountValidator(); + validator = new AmountValidatorImpl(); // Initialize with default values (EUR currency, min=0, max=Double.MAX_VALUE, allowZero=true) validator.initialize(new org.fireflyframework.annotations.ValidAmount() { @Override @@ -90,7 +90,7 @@ void shouldValidateAmountWithCurrencySpecificDecimalPlaces() { assertThat(validator.isValid(100.555, null)).isFalse(); // Too many decimal places // JPY allows 0 decimal places - AmountValidator jpyValidator = new AmountValidator(); + AmountValidatorImpl jpyValidator = new AmountValidatorImpl(); jpyValidator.initialize(new org.fireflyframework.annotations.ValidAmount() { @Override public Class[] groups() { return new Class[0]; } @@ -122,7 +122,7 @@ public Class[] payload() { @Test void shouldValidateMinMaxConstraints() { // Create validator with min=10, max=1000 - AmountValidator minMaxValidator = new AmountValidator(); + AmountValidatorImpl minMaxValidator = new AmountValidatorImpl(); minMaxValidator.initialize(new org.fireflyframework.annotations.ValidAmount() { @Override public Class[] groups() { return new Class[0]; } @@ -159,7 +159,7 @@ void shouldValidateZeroAmount() { assertThat(validator.isValid(0.0, null)).isTrue(); // Create validator that doesn't allow zero - AmountValidator noZeroValidator = new AmountValidator(); + AmountValidatorImpl noZeroValidator = new AmountValidatorImpl(); noZeroValidator.initialize(new org.fireflyframework.annotations.ValidAmount() { @Override public Class[] groups() { return new Class[0]; } diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/BicValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/BicValidatorTest.java index 19c019e3f..5cbc0349f 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/BicValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/BicValidatorTest.java @@ -29,11 +29,11 @@ */ class BicValidatorTest { - private BicValidator validator; + private BicValidatorImpl validator; @BeforeEach void setUp() { - validator = new BicValidator(); + validator = new BicValidatorImpl(); } @Test diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/CVVValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/CVVValidatorTest.java index e2b3e749a..6d602d762 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/CVVValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/CVVValidatorTest.java @@ -29,11 +29,11 @@ */ class CVVValidatorTest { - private CVVValidator validator; + private CVVValidatorImpl validator; @BeforeEach void setUp() { - validator = new CVVValidator(); + validator = new CVVValidatorImpl(); // Initialize with default values (cardType=ANY) validator.initialize(new org.fireflyframework.annotations.ValidCVV() { @Override @@ -89,7 +89,7 @@ void shouldReturnFalseForInvalidCVVs(String cvv) { @Test void shouldValidateStandardCardCVV() { // Create validator for standard cards (Visa, MasterCard, Discover) - CVVValidator standardValidator = new CVVValidator(); + CVVValidatorImpl standardValidator = new CVVValidatorImpl(); standardValidator.initialize(new org.fireflyframework.annotations.ValidCVV() { @Override public Class[] groups() { return new Class[0]; } @@ -116,7 +116,7 @@ public org.fireflyframework.annotations.ValidCVV.CardType cardType() { @Test void shouldValidateAmexCardCVV() { // Create validator for American Express cards - CVVValidator amexValidator = new CVVValidator(); + CVVValidatorImpl amexValidator = new CVVValidatorImpl(); amexValidator.initialize(new org.fireflyframework.annotations.ValidCVV() { @Override public Class[] groups() { return new Class[0]; } diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/CreditCardValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/CreditCardValidatorTest.java index be7dffcc7..33bca155a 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/CreditCardValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/CreditCardValidatorTest.java @@ -30,11 +30,11 @@ */ class CreditCardValidatorTest { - private CreditCardValidator validator; + private CreditCardValidatorImpl validator; @BeforeEach void setUp() { - validator = new CreditCardValidator(); + validator = new CreditCardValidatorImpl(); } @Test @@ -110,18 +110,18 @@ void shouldHandleCardNumberWithDashes() { "38520000023237, DINERS_CLUB", "1234567890123456, UNKNOWN" }) - void shouldIdentifyCorrectCardType(String cardNumber, CreditCardValidator.CardType expectedType) { + void shouldIdentifyCorrectCardType(String cardNumber, CreditCardValidatorImpl.CardType expectedType) { assertThat(validator.getCardType(cardNumber)).isEqualTo(expectedType); } @Test void shouldReturnUnknownCardTypeForNullInput() { - assertThat(validator.getCardType(null)).isEqualTo(CreditCardValidator.CardType.UNKNOWN); + assertThat(validator.getCardType(null)).isEqualTo(CreditCardValidatorImpl.CardType.UNKNOWN); } @Test void shouldReturnUnknownCardTypeForEmptyInput() { - assertThat(validator.getCardType("")).isEqualTo(CreditCardValidator.CardType.UNKNOWN); + assertThat(validator.getCardType("")).isEqualTo(CreditCardValidatorImpl.CardType.UNKNOWN); } @Test diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/CurrencyCodeValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/CurrencyCodeValidatorTest.java index 6a6e727f8..956dcc9be 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/CurrencyCodeValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/CurrencyCodeValidatorTest.java @@ -29,11 +29,11 @@ */ class CurrencyCodeValidatorTest { - private CurrencyCodeValidator validator; + private CurrencyCodeValidatorImpl validator; @BeforeEach void setUp() { - validator = new CurrencyCodeValidator(); + validator = new CurrencyCodeValidatorImpl(); } @Test diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/DateTimeValidatorClockProviderTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/DateTimeValidatorClockProviderTest.java index 7d60edce9..72e69caaf 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/DateTimeValidatorClockProviderTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/DateTimeValidatorClockProviderTest.java @@ -90,9 +90,9 @@ void preservesTheExistingStrictOneSecondTolerance() { @Test void retainsTheSystemClockFallbackForANullContext() throws Exception { - var noPast = new DateTimeValidator(); + var noPast = new DateTimeValidatorImpl(); noPast.initialize(NoPast.class.getDeclaredField("value").getAnnotation(ValidDateTime.class)); - var noFuture = new DateTimeValidator(); + var noFuture = new DateTimeValidatorImpl(); noFuture.initialize(NoFuture.class.getDeclaredField("value").getAnnotation(ValidDateTime.class)); Instant now = Instant.now(); String before = format(now.minusSeconds(86400)); diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/DateTimeValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/DateTimeValidatorTest.java index a604b67c6..ade84eaa1 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/DateTimeValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/DateTimeValidatorTest.java @@ -37,11 +37,11 @@ */ class DateTimeValidatorTest { - private DateTimeValidator validator; + private DateTimeValidatorImpl validator; @BeforeEach void setUp() { - validator = new DateTimeValidator(); + validator = new DateTimeValidatorImpl(); // Initialize with default values validator.initialize(new org.fireflyframework.annotations.ValidDateTime() { @Override @@ -95,7 +95,7 @@ void shouldValidateDateTimesWithDefaultPattern(String dateTimeStr, boolean expec @Test void shouldValidateDifferentDateTimeFormats() { // Create validator with different pattern - DateTimeValidator customValidator = new DateTimeValidator(); + DateTimeValidatorImpl customValidator = new DateTimeValidatorImpl(); customValidator.initialize(new org.fireflyframework.annotations.ValidDateTime() { @Override public Class[] groups() { return new Class[0]; } @@ -133,7 +133,7 @@ public Class[] payload() { @Test void shouldValidateMinMaxConstraints() { // Create validator with min=2023-01-01 00:00:00, max=2023-12-31 23:59:59 - DateTimeValidator minMaxValidator = new DateTimeValidator(); + DateTimeValidatorImpl minMaxValidator = new DateTimeValidatorImpl(); minMaxValidator.initialize(new org.fireflyframework.annotations.ValidDateTime() { @Override public Class[] groups() { return new Class[0]; } @@ -191,7 +191,7 @@ void shouldValidateFuturePastConstraints() throws Exception { assertThat(validator.isValid(futureDateTimeStr, context)).isTrue(); // Create validator that doesn't allow past date-times - DateTimeValidator noPastValidator = new DateTimeValidator(); + DateTimeValidatorImpl noPastValidator = new DateTimeValidatorImpl(); noPastValidator.initialize(new org.fireflyframework.annotations.ValidDateTime() { @Override public Class[] groups() { return new Class[0]; } @@ -222,7 +222,7 @@ public Class[] payload() { assertThat(noPastValidator.isValid(futureDateTimeStr, context)).isTrue(); // Create validator that doesn't allow future date-times - DateTimeValidator noFutureValidator = new DateTimeValidator(); + DateTimeValidatorImpl noFutureValidator = new DateTimeValidatorImpl(); noFutureValidator.initialize(new org.fireflyframework.annotations.ValidDateTime() { @Override public Class[] groups() { return new Class[0]; } diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/DateValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/DateValidatorTest.java index 36971e000..1d7553a37 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/DateValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/DateValidatorTest.java @@ -32,11 +32,11 @@ */ class DateValidatorTest { - private DateValidator validator; + private DateValidatorImpl validator; @BeforeEach void setUp() { - validator = new DateValidator(); + validator = new DateValidatorImpl(); // Initialize with default values (pattern="yyyy-MM-dd", min="", max="", allowFuture=true, allowPast=true) validator.initialize(new org.fireflyframework.annotations.ValidDate() { @Override @@ -93,7 +93,7 @@ void shouldValidateDatesWithDefaultPattern(String dateStr, boolean expected) { @Test void shouldValidateDifferentDateFormats() { // Create validator with dd/MM/yyyy pattern - DateValidator ddMMyyyyValidator = new DateValidator(); + DateValidatorImpl ddMMyyyyValidator = new DateValidatorImpl(); ddMMyyyyValidator.initialize(new org.fireflyframework.annotations.ValidDate() { @Override public Class[] groups() { return new Class[0]; } @@ -128,7 +128,7 @@ public Class[] payload() { @Test void shouldValidateMinMaxConstraints() { // Create validator with min and max constraints - DateValidator minMaxValidator = new DateValidator(); + DateValidatorImpl minMaxValidator = new DateValidatorImpl(); minMaxValidator.initialize(new org.fireflyframework.annotations.ValidDate() { @Override public Class[] groups() { return new Class[0]; } @@ -181,7 +181,7 @@ void shouldValidateFuturePastConstraints() throws Exception { assertThat(validator.isValid(futureDateStr, null)).isTrue(); // Create validator that doesn't allow future dates - DateValidator noPastValidator = new DateValidator(); + DateValidatorImpl noPastValidator = new DateValidatorImpl(); noPastValidator.initialize(new org.fireflyframework.annotations.ValidDate() { @Override public Class[] groups() { return new Class[0]; } @@ -212,7 +212,7 @@ public Class[] payload() { assertThat(noPastValidator.isValid(futureDateStr, null)).isTrue(); // Create validator that doesn't allow past dates - DateValidator noFutureValidator = new DateValidator(); + DateValidatorImpl noFutureValidator = new DateValidatorImpl(); noFutureValidator.initialize(new org.fireflyframework.annotations.ValidDate() { @Override public Class[] groups() { return new Class[0]; } diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/IbanValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/IbanValidatorTest.java index 0c8452b85..792f6881f 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/IbanValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/IbanValidatorTest.java @@ -29,11 +29,11 @@ */ class IbanValidatorTest { - private IbanValidator validator; + private IbanValidatorImpl validator; @BeforeEach void setUp() { - validator = new IbanValidator(); + validator = new IbanValidatorImpl(); } @Test diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/InterestRateValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/InterestRateValidatorTest.java index 5377a18d8..6cc3849b2 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/InterestRateValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/InterestRateValidatorTest.java @@ -31,11 +31,11 @@ */ class InterestRateValidatorTest { - private InterestRateValidator validator; + private InterestRateValidatorImpl validator; @BeforeEach void setUp() { - validator = new InterestRateValidator(); + validator = new InterestRateValidatorImpl(); // Initialize with default values (min=0, max=100, decimalPlaces=4, allowZero=true) validator.initialize(new org.fireflyframework.annotations.ValidInterestRate() { @Override @@ -93,7 +93,7 @@ void shouldValidateDecimalPlaces() { assertThat(validator.isValid(5.25001, null)).isFalse(); // Too many decimal places // Create validator with 2 decimal places - InterestRateValidator twoDecimalValidator = new InterestRateValidator(); + InterestRateValidatorImpl twoDecimalValidator = new InterestRateValidatorImpl(); twoDecimalValidator.initialize(new org.fireflyframework.annotations.ValidInterestRate() { @Override public Class[] groups() { return new Class[0]; } @@ -125,7 +125,7 @@ public Class[] payload() { @Test void shouldValidateMinMaxConstraints() { // Create validator with min=1, max=20 - InterestRateValidator minMaxValidator = new InterestRateValidator(); + InterestRateValidatorImpl minMaxValidator = new InterestRateValidatorImpl(); minMaxValidator.initialize(new org.fireflyframework.annotations.ValidInterestRate() { @Override public Class[] groups() { return new Class[0]; } @@ -162,7 +162,7 @@ void shouldValidateZeroRate() { assertThat(validator.isValid(0.0, null)).isTrue(); // Create validator that doesn't allow zero - InterestRateValidator noZeroValidator = new InterestRateValidator(); + InterestRateValidatorImpl noZeroValidator = new InterestRateValidatorImpl(); noZeroValidator.initialize(new org.fireflyframework.annotations.ValidInterestRate() { @Override public Class[] groups() { return new Class[0]; } @@ -207,7 +207,7 @@ void shouldRoundRate() { assertThat(roundedRate).isEqualTo(new BigDecimal("5.2568")); // Round to 2 decimal places - InterestRateValidator twoDecimalValidator = new InterestRateValidator(); + InterestRateValidatorImpl twoDecimalValidator = new InterestRateValidatorImpl(); twoDecimalValidator.initialize(new org.fireflyframework.annotations.ValidInterestRate() { @Override public Class[] groups() { return new Class[0]; } diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/NationalIdValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/NationalIdValidatorTest.java index b3d155633..fc6b78a0e 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/NationalIdValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/NationalIdValidatorTest.java @@ -29,11 +29,11 @@ */ class NationalIdValidatorTest { - private NationalIdValidator validator; + private NationalIdValidatorImpl validator; @BeforeEach void setUp() { - validator = new NationalIdValidator(); + validator = new NationalIdValidatorImpl(); } @Test diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/PINValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/PINValidatorTest.java index 46e9c1ffd..1a9121a2b 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/PINValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/PINValidatorTest.java @@ -29,11 +29,11 @@ */ class PINValidatorTest { - private PINValidator validator; + private PINValidatorImpl validator; @BeforeEach void setUp() { - validator = new PINValidator(); + validator = new PINValidatorImpl(); // Initialize with default values (minLength=4, maxLength=6, numericOnly=true, rejectCommonPINs=true) validator.initialize(new org.fireflyframework.annotations.ValidPIN() { @Override @@ -79,7 +79,7 @@ void shouldReturnFalseForEmptyInput() { void shouldReturnTrueForValidPINs(String pin) { // Note: These PINs are valid in terms of format but might be rejected as common PINs // We'll test common PIN rejection separately - PINValidator noRejectCommonValidator = new PINValidator(); + PINValidatorImpl noRejectCommonValidator = new PINValidatorImpl(); noRejectCommonValidator.initialize(new org.fireflyframework.annotations.ValidPIN() { @Override public Class[] groups() { return new Class[0]; } @@ -129,7 +129,7 @@ void shouldValidatePINLength() { assertThat(validator.isValid("1234567", null)).isFalse(); // Too long // Create validator with custom length constraints (6-8 digits) - PINValidator customLengthValidator = new PINValidator(); + PINValidatorImpl customLengthValidator = new PINValidatorImpl(); customLengthValidator.initialize(new org.fireflyframework.annotations.ValidPIN() { @Override public Class[] groups() { return new Class[0]; } @@ -168,7 +168,7 @@ void shouldValidateNumericOnly() { assertThat(validator.isValid("12AB", null)).isFalse(); // Contains letters // Create validator that allows non-numeric characters - PINValidator alphanumericValidator = new PINValidator(); + PINValidatorImpl alphanumericValidator = new PINValidatorImpl(); alphanumericValidator.initialize(new org.fireflyframework.annotations.ValidPIN() { @Override public Class[] groups() { return new Class[0]; } @@ -206,7 +206,7 @@ void shouldRejectCommonPINs() { assertThat(validator.isValid("1212", null)).isFalse(); // Repeated pattern // Create validator that doesn't reject common PINs - PINValidator noRejectCommonValidator = new PINValidator(); + PINValidatorImpl noRejectCommonValidator = new PINValidatorImpl(); noRejectCommonValidator.initialize(new org.fireflyframework.annotations.ValidPIN() { @Override public Class[] groups() { return new Class[0]; } diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/PasswordStrengthValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/PasswordStrengthValidatorTest.java index aa1525f57..75ca0bf80 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/PasswordStrengthValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/PasswordStrengthValidatorTest.java @@ -29,11 +29,11 @@ */ class PasswordStrengthValidatorTest { - private PasswordStrengthValidator validator; + private PasswordStrengthValidatorImpl validator; @BeforeEach void setUp() { - validator = new PasswordStrengthValidator(); + validator = new PasswordStrengthValidatorImpl(); // Initialize with default values (minLength=8, maxLength=128, requireUppercase=true, requireLowercase=true, // requireDigit=true, requireSpecialChar=true, minCharTypes=3, rejectCommonPasswords=true) validator.initialize(new org.fireflyframework.annotations.ValidPasswordStrength() { @@ -102,7 +102,7 @@ void shouldValidatePasswordLength() { assertThat(validator.isValid("Abcdef1!", null)).isTrue(); // Exactly 8 characters // Create validator with custom length constraints (12-16 characters) - PasswordStrengthValidator customLengthValidator = new PasswordStrengthValidator(); + PasswordStrengthValidatorImpl customLengthValidator = new PasswordStrengthValidatorImpl(); customLengthValidator.initialize(new org.fireflyframework.annotations.ValidPasswordStrength() { @Override public Class[] groups() { return new Class[0]; } @@ -150,7 +150,7 @@ void shouldValidateCharacterTypeRequirements() { assertThat(validator.isValid("Abcdefg1", null)).isFalse(); // Missing special character // Create validator with custom character type requirements (only require uppercase and digit) - PasswordStrengthValidator customCharTypesValidator = new PasswordStrengthValidator(); + PasswordStrengthValidatorImpl customCharTypesValidator = new PasswordStrengthValidatorImpl(); customCharTypesValidator.initialize(new org.fireflyframework.annotations.ValidPasswordStrength() { @Override public Class[] groups() { return new Class[0]; } @@ -190,7 +190,7 @@ public Class[] payload() { @Test void shouldValidateMinCharTypes() { // Create validator with custom min character types (require only 2 character types) - PasswordStrengthValidator minCharTypesValidator = new PasswordStrengthValidator(); + PasswordStrengthValidatorImpl minCharTypesValidator = new PasswordStrengthValidatorImpl(); minCharTypesValidator.initialize(new org.fireflyframework.annotations.ValidPasswordStrength() { @Override public Class[] groups() { return new Class[0]; } @@ -226,7 +226,7 @@ public Class[] payload() { assertThat(minCharTypesValidator.isValid("ABCDEFG1", null)).isTrue(); // 2 character types (uppercase, digit) // Create validator with custom min character types (require all 4 character types) - PasswordStrengthValidator allCharTypesValidator = new PasswordStrengthValidator(); + PasswordStrengthValidatorImpl allCharTypesValidator = new PasswordStrengthValidatorImpl(); allCharTypesValidator.initialize(new org.fireflyframework.annotations.ValidPasswordStrength() { @Override public Class[] groups() { return new Class[0]; } @@ -269,7 +269,7 @@ void shouldRejectCommonPasswords() { assertThat(validator.isValid("Password1!", null)).isTrue(); // Not a common password // Create validator that doesn't reject common passwords - PasswordStrengthValidator noRejectCommonValidator = new PasswordStrengthValidator(); + PasswordStrengthValidatorImpl noRejectCommonValidator = new PasswordStrengthValidatorImpl(); noRejectCommonValidator.initialize(new org.fireflyframework.annotations.ValidPasswordStrength() { @Override public Class[] groups() { return new Class[0]; } @@ -351,19 +351,19 @@ void shouldCalculateStrengthScore() { @Test void shouldCategorizePasswordStrength() { // Very weak passwords - assertThat(validator.getStrengthCategory("123456")).isEqualTo(PasswordStrengthValidator.PasswordStrength.VERY_WEAK); + assertThat(validator.getStrengthCategory("123456")).isEqualTo(PasswordStrengthValidatorImpl.PasswordStrength.VERY_WEAK); // Weak passwords - assertThat(validator.getStrengthCategory("password1")).isEqualTo(PasswordStrengthValidator.PasswordStrength.WEAK); + assertThat(validator.getStrengthCategory("password1")).isEqualTo(PasswordStrengthValidatorImpl.PasswordStrength.WEAK); // Medium strength passwords - assertThat(validator.getStrengthCategory("Password1")).isEqualTo(PasswordStrengthValidator.PasswordStrength.MEDIUM); + assertThat(validator.getStrengthCategory("Password1")).isEqualTo(PasswordStrengthValidatorImpl.PasswordStrength.MEDIUM); // Strong passwords - assertThat(validator.getStrengthCategory("Password1!")).isEqualTo(PasswordStrengthValidator.PasswordStrength.STRONG); + assertThat(validator.getStrengthCategory("Password1!")).isEqualTo(PasswordStrengthValidatorImpl.PasswordStrength.STRONG); // Very strong passwords - assertThat(validator.getStrengthCategory("Tr0ub4dor&3X9Z")).isEqualTo(PasswordStrengthValidator.PasswordStrength.VERY_STRONG); + assertThat(validator.getStrengthCategory("Tr0ub4dor&3X9Z")).isEqualTo(PasswordStrengthValidatorImpl.PasswordStrength.VERY_STRONG); // Invalid inputs assertThat(validator.getStrengthCategory(null)).isNull(); diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/PhoneNumberValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/PhoneNumberValidatorTest.java index 440e8fd54..d21796ab7 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/PhoneNumberValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/PhoneNumberValidatorTest.java @@ -29,11 +29,11 @@ */ class PhoneNumberValidatorTest { - private PhoneNumberValidator validator; + private PhoneNumberValidatorImpl validator; @BeforeEach void setUp() { - validator = new PhoneNumberValidator(); + validator = new PhoneNumberValidatorImpl(); } @Test diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/SortCodeValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/SortCodeValidatorTest.java index f1ab217c6..73bacd0c2 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/SortCodeValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/SortCodeValidatorTest.java @@ -29,11 +29,11 @@ */ class SortCodeValidatorTest { - private SortCodeValidator validator; + private SortCodeValidatorImpl validator; @BeforeEach void setUp() { - validator = new SortCodeValidator(); + validator = new SortCodeValidatorImpl(); } @Test diff --git a/modules/validators/src/test/java/org/fireflyframework/validators/TaxIdValidatorTest.java b/modules/validators/src/test/java/org/fireflyframework/validators/TaxIdValidatorTest.java index fbbf8f7ee..c7a75f989 100644 --- a/modules/validators/src/test/java/org/fireflyframework/validators/TaxIdValidatorTest.java +++ b/modules/validators/src/test/java/org/fireflyframework/validators/TaxIdValidatorTest.java @@ -29,11 +29,11 @@ */ class TaxIdValidatorTest { - private TaxIdValidator validator; + private TaxIdValidatorImpl validator; @BeforeEach void setUp() { - validator = new TaxIdValidator(); + validator = new TaxIdValidatorImpl(); } @Test diff --git a/modules/web/src/main/java/org/fireflyframework/web/conditions/config/ConditionsReportAutoConfiguration.java b/modules/web/src/main/java/org/fireflyframework/web/conditions/config/ConditionsReportAutoConfiguration.java index 9145be6e6..1c548bfbf 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/conditions/config/ConditionsReportAutoConfiguration.java +++ b/modules/web/src/main/java/org/fireflyframework/web/conditions/config/ConditionsReportAutoConfiguration.java @@ -16,7 +16,7 @@ package org.fireflyframework.web.conditions.config; -import org.fireflyframework.web.conditions.listener.ConditionsReportListener; +import org.fireflyframework.web.conditions.listener.ConditionsReportListenerImpl; import org.fireflyframework.web.conditions.service.ConditionsReportService; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; @@ -72,8 +72,8 @@ public ConditionsReportService conditionsReportService(ConditionsReportPropertie */ @Bean @ConditionalOnMissingBean - public ConditionsReportListener conditionsReportListener(ConditionsReportService reportService) { - return new ConditionsReportListener(reportService); + public ConditionsReportListenerImpl conditionsReportListener(ConditionsReportService reportService) { + return new ConditionsReportListenerImpl(reportService); } } diff --git a/modules/web/src/main/java/org/fireflyframework/web/conditions/listener/ConditionsReportListener.java b/modules/web/src/main/java/org/fireflyframework/web/conditions/listener/ConditionsReportListenerImpl.java similarity index 92% rename from modules/web/src/main/java/org/fireflyframework/web/conditions/listener/ConditionsReportListener.java rename to modules/web/src/main/java/org/fireflyframework/web/conditions/listener/ConditionsReportListenerImpl.java index 56f56e4cf..4fe9b3505 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/conditions/listener/ConditionsReportListener.java +++ b/modules/web/src/main/java/org/fireflyframework/web/conditions/listener/ConditionsReportListenerImpl.java @@ -33,11 +33,11 @@ * other application startup tasks have completed, providing a complete * view of all auto-configurations.

    */ -public class ConditionsReportListener implements ApplicationListener, Ordered { +public class ConditionsReportListenerImpl implements ApplicationListener, Ordered { private final ConditionsReportService reportService; - public ConditionsReportListener(ConditionsReportService reportService) { + public ConditionsReportListenerImpl(ConditionsReportService reportService) { this.reportService = reportService; } diff --git a/modules/web/src/main/java/org/fireflyframework/web/conditions/service/ConditionsReportService.java b/modules/web/src/main/java/org/fireflyframework/web/conditions/service/ConditionsReportService.java index 6207a503e..987241801 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/conditions/service/ConditionsReportService.java +++ b/modules/web/src/main/java/org/fireflyframework/web/conditions/service/ConditionsReportService.java @@ -222,7 +222,7 @@ private String getDescription(String className) { return "OpenAPI documentation for idempotency features"; } else if (className.contains("org.fireflyframework.web.logging.config.PiiMaskingAutoConfiguration")) { return "PII (Personally Identifiable Information) masking in logs"; - } else if (className.contains("org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilter")) { + } else if (className.contains("org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilterImpl")) { return "HTTP request/response logging filter"; } else if (className.contains("org.fireflyframework.web.conditions.config.ConditionsReportAutoConfiguration")) { return "Conditions evaluation report (this feature)"; diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/DataAccessExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/DataAccessExceptionConverterImpl.java similarity index 97% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/DataAccessExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/DataAccessExceptionConverterImpl.java index fcd6c308c..3c4cc4f3d 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/DataAccessExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/DataAccessExceptionConverterImpl.java @@ -35,14 +35,14 @@ * Converter for Spring's DataAccessException. * Converts various data access exceptions to the appropriate business exceptions. */ -@Component +@Component("dataAccessExceptionConverter") @ConditionalOnClass(DataAccessException.class) -public class DataAccessExceptionConverter implements ExceptionConverter { +public class DataAccessExceptionConverterImpl implements ExceptionConverter { /** * Creates a new DataAccessExceptionConverter. */ - public DataAccessExceptionConverter() { + public DataAccessExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverterImpl.java similarity index 98% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverterImpl.java index b8930fbe1..6d4ad3d69 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverterImpl.java @@ -38,14 +38,14 @@ * Converter for external service exceptions. * Converts exceptions related to external service calls to appropriate business exceptions. */ -@Component +@Component("externalServiceExceptionConverter") @ConditionalOnClass(Exception.class) -public class ExternalServiceExceptionConverter implements ExceptionConverter { +public class ExternalServiceExceptionConverterImpl implements ExceptionConverter { /** * Creates a new ExternalServiceExceptionConverter. */ - public ExternalServiceExceptionConverter() { + public ExternalServiceExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpClientErrorExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpClientErrorExceptionConverterImpl.java similarity index 94% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpClientErrorExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpClientErrorExceptionConverterImpl.java index d6a4b8c06..f9730effc 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpClientErrorExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpClientErrorExceptionConverterImpl.java @@ -27,14 +27,14 @@ * Converter for Spring's HttpClientErrorException. * Converts HTTP client error exceptions to the appropriate business exceptions. */ -@Component +@Component("httpClientErrorExceptionConverter") @ConditionalOnClass(HttpClientErrorException.class) -public class HttpClientErrorExceptionConverter implements ExceptionConverter { +public class HttpClientErrorExceptionConverterImpl implements ExceptionConverter { /** * Creates a new HttpClientErrorExceptionConverter. */ - public HttpClientErrorExceptionConverter() { + public HttpClientErrorExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpServerErrorExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpServerErrorExceptionConverterImpl.java similarity index 92% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpServerErrorExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpServerErrorExceptionConverterImpl.java index 64009b54d..51d1fa1dc 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpServerErrorExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/HttpServerErrorExceptionConverterImpl.java @@ -31,14 +31,14 @@ * Converter for Spring's HttpServerErrorException. * Converts HTTP server error exceptions to the appropriate business exceptions. */ -@Component +@Component("httpServerErrorExceptionConverter") @ConditionalOnClass(HttpServerErrorException.class) -public class HttpServerErrorExceptionConverter implements ExceptionConverter { +public class HttpServerErrorExceptionConverterImpl implements ExceptionConverter { /** * Creates a new HttpServerErrorExceptionConverter. */ - public HttpServerErrorExceptionConverter() { + public HttpServerErrorExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/JpaExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/JpaExceptionConverterImpl.java similarity index 95% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/JpaExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/JpaExceptionConverterImpl.java index b8ad57d0a..433c095e9 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/JpaExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/JpaExceptionConverterImpl.java @@ -34,14 +34,14 @@ * Converter for JPA exceptions. * Converts JPA exceptions to appropriate business exceptions. */ -@Component +@Component("jpaExceptionConverter") @ConditionalOnClass(Exception.class) -public class JpaExceptionConverter implements ExceptionConverter { +public class JpaExceptionConverterImpl implements ExceptionConverter { /** * Creates a new JpaExceptionConverter. */ - public JpaExceptionConverter() { + public JpaExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/JsonExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/JsonExceptionConverterImpl.java similarity index 95% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/JsonExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/JsonExceptionConverterImpl.java index 70dc08e3b..3c62bac5a 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/JsonExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/JsonExceptionConverterImpl.java @@ -32,14 +32,14 @@ * Converter for JSON processing exceptions. * Converts JSON exceptions to InvalidRequestException. */ -@Component +@Component("jsonExceptionConverter") @ConditionalOnClass(JsonProcessingException.class) -public class JsonExceptionConverter implements ExceptionConverter { +public class JsonExceptionConverterImpl implements ExceptionConverter { /** * Creates a new JsonExceptionConverter. */ - public JsonExceptionConverter() { + public JsonExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/NetworkExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/NetworkExceptionConverterImpl.java similarity index 93% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/NetworkExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/NetworkExceptionConverterImpl.java index 86e2ac561..1d3dba72c 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/NetworkExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/NetworkExceptionConverterImpl.java @@ -31,14 +31,14 @@ * Converter for network-related exceptions. * Converts network exceptions to appropriate business exceptions. */ -@Component +@Component("networkExceptionConverter") @ConditionalOnClass(Exception.class) -public class NetworkExceptionConverter implements ExceptionConverter { +public class NetworkExceptionConverterImpl implements ExceptionConverter { /** * Creates a new NetworkExceptionConverter. */ - public NetworkExceptionConverter() { + public NetworkExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/OptimisticLockingFailureExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/OptimisticLockingFailureExceptionConverterImpl.java similarity index 92% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/OptimisticLockingFailureExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/OptimisticLockingFailureExceptionConverterImpl.java index 8768e1941..76a348ad0 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/OptimisticLockingFailureExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/OptimisticLockingFailureExceptionConverterImpl.java @@ -27,14 +27,14 @@ * Converter for Spring's OptimisticLockingFailureException. * Converts optimistic locking failure exceptions to concurrency exceptions. */ -@Component +@Component("optimisticLockingFailureExceptionConverter") @ConditionalOnClass(OptimisticLockingFailureException.class) -public class OptimisticLockingFailureExceptionConverter implements ExceptionConverter { +public class OptimisticLockingFailureExceptionConverterImpl implements ExceptionConverter { /** * Creates a new OptimisticLockingFailureExceptionConverter. */ - public OptimisticLockingFailureExceptionConverter() { + public OptimisticLockingFailureExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverterImpl.java similarity index 98% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverterImpl.java index a857ee2df..47d7f85bf 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverterImpl.java @@ -30,14 +30,14 @@ * Converter for R2DBC exceptions. * Converts R2DBC exceptions to appropriate business exceptions. */ -@Component +@Component("R2dbcExceptionConverter") @ConditionalOnClass(Exception.class) -public class R2dbcExceptionConverter implements ExceptionConverter { +public class R2dbcExceptionConverterImpl implements ExceptionConverter { /** * Creates a new R2dbcExceptionConverter. */ - public R2dbcExceptionConverter() { + public R2dbcExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/Resilience4jExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/Resilience4jExceptionConverterImpl.java similarity index 98% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/Resilience4jExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/Resilience4jExceptionConverterImpl.java index e365d39ad..3c5e3616b 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/Resilience4jExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/Resilience4jExceptionConverterImpl.java @@ -40,14 +40,14 @@ *
  • TimeoutException - Operation timeout
  • * */ -@Component +@Component("resilience4jExceptionConverter") @ConditionalOnClass(name = "io.github.resilience4j.circuitbreaker.CallNotPermittedException") -public class Resilience4jExceptionConverter implements ExceptionConverter { +public class Resilience4jExceptionConverterImpl implements ExceptionConverter { /** * Creates a new Resilience4jExceptionConverter. */ - public Resilience4jExceptionConverter() { + public Resilience4jExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/SecurityExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/SecurityExceptionConverterImpl.java similarity index 95% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/SecurityExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/SecurityExceptionConverterImpl.java index 6ec12060f..efdb3e048 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/SecurityExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/SecurityExceptionConverterImpl.java @@ -35,14 +35,14 @@ * Converter for Spring Security exceptions. * Converts security exceptions to appropriate business exceptions. */ -@Component +@Component("securityExceptionConverter") @ConditionalOnClass(Exception.class) -public class SecurityExceptionConverter implements ExceptionConverter { +public class SecurityExceptionConverterImpl implements ExceptionConverter { /** * Creates a new SecurityExceptionConverter. */ - public SecurityExceptionConverter() { + public SecurityExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/ValidationExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/ValidationExceptionConverterImpl.java similarity index 94% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/ValidationExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/ValidationExceptionConverterImpl.java index 55d9c580b..4ca5c9c44 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/ValidationExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/ValidationExceptionConverterImpl.java @@ -31,14 +31,14 @@ * Converter for Spring's validation exceptions. * Converts validation exceptions to ValidationException. */ -@Component +@Component("validationExceptionConverter") @ConditionalOnClass(Exception.class) -public class ValidationExceptionConverter implements ExceptionConverter { +public class ValidationExceptionConverterImpl implements ExceptionConverter { /** * Creates a new ValidationExceptionConverter. */ - public ValidationExceptionConverter() { + public ValidationExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverter.java b/modules/web/src/main/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverterImpl.java similarity index 97% rename from modules/web/src/main/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverter.java rename to modules/web/src/main/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverterImpl.java index 9a4f822aa..58e04a00d 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverterImpl.java @@ -39,14 +39,14 @@ * Converter for Spring WebFlux exceptions. * Converts WebFlux exceptions to appropriate business exceptions. */ -@Component +@Component("webFluxExceptionConverter") @ConditionalOnClass(Exception.class) -public class WebFluxExceptionConverter implements ExceptionConverter { +public class WebFluxExceptionConverterImpl implements ExceptionConverter { /** * Creates a new WebFluxExceptionConverter. */ - public WebFluxExceptionConverter() { + public WebFluxExceptionConverterImpl() { // Default constructor } diff --git a/modules/web/src/main/java/org/fireflyframework/web/error/service/ErrorResponseCache.java b/modules/web/src/main/java/org/fireflyframework/web/error/service/ErrorResponseCache.java index 0efad21da..7fb987a68 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/error/service/ErrorResponseCache.java +++ b/modules/web/src/main/java/org/fireflyframework/web/error/service/ErrorResponseCache.java @@ -1,6 +1,6 @@ package org.fireflyframework.web.error.service; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.fireflyframework.web.error.config.ErrorHandlingProperties; import org.fireflyframework.web.error.models.ErrorResponse; import lombok.extern.slf4j.Slf4j; @@ -43,7 +43,7 @@ public class ErrorResponseCache { private static final String KEY_PREFIX = ":error:"; - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private final ErrorHandlingProperties properties; private final Duration ttl; @@ -57,7 +57,7 @@ public class ErrorResponseCache { * @param cacheManager the Firefly cache manager * @param properties the error handling properties */ - public ErrorResponseCache(FireflyCacheManager cacheManager, ErrorHandlingProperties properties) { + public ErrorResponseCache(FireflyCacheManagerImpl cacheManager, ErrorHandlingProperties properties) { this.cacheManager = cacheManager; this.properties = properties; this.ttl = Duration.ofSeconds(properties.getErrorCacheTtlSeconds()); diff --git a/modules/web/src/main/java/org/fireflyframework/web/idempotency/cache/FireflyCacheIdempotencyAdapter.java b/modules/web/src/main/java/org/fireflyframework/web/idempotency/cache/FireflyCacheIdempotencyAdapterImpl.java similarity index 91% rename from modules/web/src/main/java/org/fireflyframework/web/idempotency/cache/FireflyCacheIdempotencyAdapter.java rename to modules/web/src/main/java/org/fireflyframework/web/idempotency/cache/FireflyCacheIdempotencyAdapterImpl.java index b1307312b..cada54781 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/idempotency/cache/FireflyCacheIdempotencyAdapter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/idempotency/cache/FireflyCacheIdempotencyAdapterImpl.java @@ -16,7 +16,7 @@ package org.fireflyframework.web.idempotency.cache; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.fireflyframework.web.idempotency.config.IdempotencyProperties; import org.fireflyframework.web.idempotency.model.CachedResponse; import org.slf4j.Logger; @@ -37,12 +37,12 @@ *

    All cache keys are prefixed with ":idempotency:" which, combined with the cache's own * prefix (e.g., "firefly:cache:default:"), results in keys like "firefly:cache:default::idempotency:{key}".

    */ -public class FireflyCacheIdempotencyAdapter implements IdempotencyCache { +public class FireflyCacheIdempotencyAdapterImpl implements IdempotencyCache { - private static final Logger log = LoggerFactory.getLogger(FireflyCacheIdempotencyAdapter.class); + private static final Logger log = LoggerFactory.getLogger(FireflyCacheIdempotencyAdapterImpl.class); private static final String KEY_PREFIX = ":idempotency:"; - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; private final Duration ttl; /** @@ -51,7 +51,7 @@ public class FireflyCacheIdempotencyAdapter implements IdempotencyCache { * @param cacheManager the Firefly cache manager * @param properties the idempotency configuration properties */ - public FireflyCacheIdempotencyAdapter(FireflyCacheManager cacheManager, IdempotencyProperties properties) { + public FireflyCacheIdempotencyAdapterImpl(FireflyCacheManagerImpl cacheManager, IdempotencyProperties properties) { this.cacheManager = cacheManager; this.ttl = Duration.ofHours(properties.getCache().getTtlHours()); } diff --git a/modules/web/src/main/java/org/fireflyframework/web/idempotency/config/IdempotencyAutoConfiguration.java b/modules/web/src/main/java/org/fireflyframework/web/idempotency/config/IdempotencyAutoConfiguration.java index 744722d33..72cf16deb 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/idempotency/config/IdempotencyAutoConfiguration.java +++ b/modules/web/src/main/java/org/fireflyframework/web/idempotency/config/IdempotencyAutoConfiguration.java @@ -18,11 +18,11 @@ import org.fireflyframework.cache.config.CacheAutoConfiguration; import org.fireflyframework.cache.factory.CacheManagerFactory; -import org.fireflyframework.cache.manager.FireflyCacheManager; -import org.fireflyframework.web.idempotency.cache.FireflyCacheIdempotencyAdapter; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; +import org.fireflyframework.web.idempotency.cache.FireflyCacheIdempotencyAdapterImpl; import org.fireflyframework.web.idempotency.cache.IdempotencyCache; -import org.fireflyframework.web.idempotency.filter.IdempotencyWebFilter; -import org.fireflyframework.web.idempotency.scope.AuthenticatedIdempotencyScopeResolver; +import org.fireflyframework.web.idempotency.filter.IdempotencyWebFilterImpl; +import org.fireflyframework.web.idempotency.scope.AuthenticatedIdempotencyScopeResolverImpl; import org.fireflyframework.web.idempotency.scope.IdempotencyScopeResolver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -78,7 +78,7 @@ */ @AutoConfiguration(after = CacheAutoConfiguration.class) @EnableConfigurationProperties(IdempotencyProperties.class) -@ConditionalOnClass({FireflyCacheManager.class, CacheManagerFactory.class}) +@ConditionalOnClass({FireflyCacheManagerImpl.class, CacheManagerFactory.class}) @org.springframework.boot.autoconfigure.condition.ConditionalOnProperty(prefix = "firefly.web.idempotency", name = "enabled", havingValue = "true", matchIfMissing = true) public class IdempotencyAutoConfiguration { @@ -109,7 +109,7 @@ public class IdempotencyAutoConfiguration { */ @Bean("httpIdempotencyCacheManager") @ConditionalOnMissingBean(name = "httpIdempotencyCacheManager") - public FireflyCacheManager httpIdempotencyCacheManager( + public FireflyCacheManagerImpl httpIdempotencyCacheManager( CacheManagerFactory factory, IdempotencyProperties properties) { @@ -136,9 +136,9 @@ public FireflyCacheManager httpIdempotencyCacheManager( @ConditionalOnBean(name = "httpIdempotencyCacheManager") @ConditionalOnMissingBean(IdempotencyCache.class) public IdempotencyCache idempotencyCache( - @Qualifier("httpIdempotencyCacheManager") FireflyCacheManager cacheManager, + @Qualifier("httpIdempotencyCacheManager") FireflyCacheManagerImpl cacheManager, IdempotencyProperties properties) { - return new FireflyCacheIdempotencyAdapter(cacheManager, properties); + return new FireflyCacheIdempotencyAdapterImpl(cacheManager, properties); } /** Supplies a trusted identity resolver; applications may replace it for their authentication stack. */ @@ -146,14 +146,14 @@ public IdempotencyCache idempotencyCache( @ConditionalOnMissingBean(IdempotencyScopeResolver.class) public IdempotencyScopeResolver idempotencyScopeResolver( org.springframework.beans.factory.ObjectProvider tenantResolvers) { - return new AuthenticatedIdempotencyScopeResolver(tenantResolvers.getIfAvailable()); + return new AuthenticatedIdempotencyScopeResolverImpl(tenantResolvers.getIfAvailable()); } /** Creates a scoped mutation-response filter after authentication and before handler invocation. */ @Bean @ConditionalOnBean(IdempotencyCache.class) - @ConditionalOnMissingBean(IdempotencyWebFilter.class) - public IdempotencyWebFilter idempotencyWebFilter( + @ConditionalOnMissingBean(IdempotencyWebFilterImpl.class) + public IdempotencyWebFilterImpl idempotencyWebFilter( IdempotencyProperties properties, IdempotencyCache cache, IdempotencyScopeResolver scopeResolver, @@ -162,7 +162,7 @@ public IdempotencyWebFilter idempotencyWebFilter( if (properties.getNamespace() == null || properties.getNamespace().isBlank()) { properties.setNamespace(applicationName); } - return new IdempotencyWebFilter(properties, cache, scopeResolver, () -> mappings.orderedStream().toList()); + return new IdempotencyWebFilterImpl(properties, cache, scopeResolver, () -> mappings.orderedStream().toList()); } } diff --git a/modules/web/src/main/java/org/fireflyframework/web/idempotency/config/IdempotencyOpenAPIAutoConfiguration.java b/modules/web/src/main/java/org/fireflyframework/web/idempotency/config/IdempotencyOpenAPIAutoConfiguration.java index ef055148f..01da6ba8d 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/idempotency/config/IdempotencyOpenAPIAutoConfiguration.java +++ b/modules/web/src/main/java/org/fireflyframework/web/idempotency/config/IdempotencyOpenAPIAutoConfiguration.java @@ -16,8 +16,8 @@ package org.fireflyframework.web.idempotency.config; -import org.fireflyframework.web.openapi.IdempotencyOpenAPICustomizer; -import org.fireflyframework.web.openapi.IdempotencyOperationCustomizer; +import org.fireflyframework.web.openapi.IdempotencyOpenAPICustomizerImpl; +import org.fireflyframework.web.openapi.IdempotencyOperationCustomizerImpl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.AutoConfiguration; @@ -56,13 +56,13 @@ public class IdempotencyOpenAPIAutoConfiguration { * @return the OpenAPI customizer */ @Bean - @ConditionalOnMissingBean(IdempotencyOpenAPICustomizer.class) - public IdempotencyOpenAPICustomizer idempotencyOpenAPICustomizer( + @ConditionalOnMissingBean(IdempotencyOpenAPICustomizerImpl.class) + public IdempotencyOpenAPICustomizerImpl idempotencyOpenAPICustomizer( IdempotencyProperties properties) { log.info("Configuring idempotency OpenAPI customizer"); - return new IdempotencyOpenAPICustomizer(properties); + return new IdempotencyOpenAPICustomizerImpl(properties); } /** @@ -75,12 +75,12 @@ public IdempotencyOpenAPICustomizer idempotencyOpenAPICustomizer( * @return the operation customizer */ @Bean - @ConditionalOnMissingBean(IdempotencyOperationCustomizer.class) - public IdempotencyOperationCustomizer idempotencyOperationCustomizer() { + @ConditionalOnMissingBean(IdempotencyOperationCustomizerImpl.class) + public IdempotencyOperationCustomizerImpl idempotencyOperationCustomizer() { log.info("Configuring idempotency operation customizer"); - return new IdempotencyOperationCustomizer(); + return new IdempotencyOperationCustomizerImpl(); } } diff --git a/modules/web/src/main/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilter.java b/modules/web/src/main/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilterImpl.java similarity index 97% rename from modules/web/src/main/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilter.java rename to modules/web/src/main/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilterImpl.java index 0ce6e52f9..0cddda662 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilterImpl.java @@ -21,7 +21,7 @@ import org.fireflyframework.web.idempotency.cache.IdempotencyCache; import org.fireflyframework.web.idempotency.config.IdempotencyProperties; import org.fireflyframework.web.idempotency.model.CachedResponse; -import org.fireflyframework.web.idempotency.scope.AuthenticatedIdempotencyScopeResolver; +import org.fireflyframework.web.idempotency.scope.AuthenticatedIdempotencyScopeResolverImpl; import org.fireflyframework.web.idempotency.scope.IdempotencyScopeResolver; import org.reactivestreams.Publisher; import org.slf4j.Logger; @@ -62,8 +62,8 @@ * still enforce their own durable idempotency: cache retention and in-flight coordination are * not a cross-process transaction boundary. */ -public class IdempotencyWebFilter implements WebFilter, Ordered { - private static final Logger log = LoggerFactory.getLogger(IdempotencyWebFilter.class); +public class IdempotencyWebFilterImpl implements WebFilter, Ordered { + private static final Logger log = LoggerFactory.getLogger(IdempotencyWebFilterImpl.class); private static final List MUTATIONS = List.of(HttpMethod.POST, HttpMethod.PUT, HttpMethod.PATCH, HttpMethod.DELETE); private static final List FINGERPRINT_HEADERS = List.of("Content-Type", "Accept", "Content-Encoding", "Accept-Encoding", "Accept-Language", "If-Match", "If-None-Match"); @@ -75,15 +75,15 @@ public class IdempotencyWebFilter implements WebFilter, Ordered { private final java.util.function.Supplier> handlerMappings; private final Map inFlight = new ConcurrentHashMap<>(); - public IdempotencyWebFilter(IdempotencyProperties properties, IdempotencyCache cache) { - this(properties, cache, new AuthenticatedIdempotencyScopeResolver()); + public IdempotencyWebFilterImpl(IdempotencyProperties properties, IdempotencyCache cache) { + this(properties, cache, new AuthenticatedIdempotencyScopeResolverImpl()); } - public IdempotencyWebFilter(IdempotencyProperties properties, IdempotencyCache cache, IdempotencyScopeResolver scopeResolver) { + public IdempotencyWebFilterImpl(IdempotencyProperties properties, IdempotencyCache cache, IdempotencyScopeResolver scopeResolver) { this(properties, cache, scopeResolver, List::of); } - public IdempotencyWebFilter(IdempotencyProperties properties, IdempotencyCache cache, + public IdempotencyWebFilterImpl(IdempotencyProperties properties, IdempotencyCache cache, IdempotencyScopeResolver scopeResolver, java.util.function.Supplier> handlerMappings) { this.properties = properties; diff --git a/modules/web/src/main/java/org/fireflyframework/web/idempotency/scope/AuthenticatedIdempotencyScopeResolver.java b/modules/web/src/main/java/org/fireflyframework/web/idempotency/scope/AuthenticatedIdempotencyScopeResolverImpl.java similarity index 91% rename from modules/web/src/main/java/org/fireflyframework/web/idempotency/scope/AuthenticatedIdempotencyScopeResolver.java rename to modules/web/src/main/java/org/fireflyframework/web/idempotency/scope/AuthenticatedIdempotencyScopeResolverImpl.java index 2bbd9fe62..c5f27f1d5 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/idempotency/scope/AuthenticatedIdempotencyScopeResolver.java +++ b/modules/web/src/main/java/org/fireflyframework/web/idempotency/scope/AuthenticatedIdempotencyScopeResolverImpl.java @@ -27,15 +27,15 @@ import java.util.stream.Collectors; /** Uses validated Jafly authentication and tenant resolution, never caller-supplied identity headers. */ -public final class AuthenticatedIdempotencyScopeResolver implements IdempotencyScopeResolver { +public final class AuthenticatedIdempotencyScopeResolverImpl implements IdempotencyScopeResolver { private final TenantResolverPort tenantResolver; - public AuthenticatedIdempotencyScopeResolver() { + public AuthenticatedIdempotencyScopeResolverImpl() { this(null); } - public AuthenticatedIdempotencyScopeResolver(TenantResolverPort tenantResolver) { + public AuthenticatedIdempotencyScopeResolverImpl(TenantResolverPort tenantResolver) { this.tenantResolver = tenantResolver; } diff --git a/modules/web/src/main/java/org/fireflyframework/web/logging/appender/PiiMaskingAppender.java b/modules/web/src/main/java/org/fireflyframework/web/logging/appender/PiiMaskingAppenderImpl.java similarity index 98% rename from modules/web/src/main/java/org/fireflyframework/web/logging/appender/PiiMaskingAppender.java rename to modules/web/src/main/java/org/fireflyframework/web/logging/appender/PiiMaskingAppenderImpl.java index 71d0a77c1..2163a0686 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/logging/appender/PiiMaskingAppender.java +++ b/modules/web/src/main/java/org/fireflyframework/web/logging/appender/PiiMaskingAppenderImpl.java @@ -49,7 +49,7 @@ * * Configuration example in logback-spring.xml: *
    - * <appender name="PII_MASKING_CONSOLE" class="org.fireflyframework.web.logging.appender.PiiMaskingAppender">
    + * <appender name="PII_MASKING_CONSOLE" class="org.fireflyframework.web.logging.appender.PiiMaskingAppenderImpl">
      *   <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
      *     <encoder>
      *       <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    @@ -58,7 +58,7 @@
      * </appender>
      * 
    */ -public class PiiMaskingAppender extends AppenderBase implements AppenderAttachable { +public class PiiMaskingAppenderImpl extends AppenderBase implements AppenderAttachable { private final AppenderAttachableImpl appenderAttachableImpl = new AppenderAttachableImpl<>(); private volatile PiiMaskingService piiMaskingService; diff --git a/modules/web/src/main/java/org/fireflyframework/web/logging/config/PiiMaskingLoggingConfiguration.java b/modules/web/src/main/java/org/fireflyframework/web/logging/config/PiiMaskingLoggingConfiguration.java index ab1769623..fa29b832a 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/logging/config/PiiMaskingLoggingConfiguration.java +++ b/modules/web/src/main/java/org/fireflyframework/web/logging/config/PiiMaskingLoggingConfiguration.java @@ -21,7 +21,7 @@ import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.core.Appender; import ch.qos.logback.classic.spi.ILoggingEvent; -import org.fireflyframework.web.logging.appender.PiiMaskingAppender; +import org.fireflyframework.web.logging.appender.PiiMaskingAppenderImpl; import org.fireflyframework.web.logging.service.PiiMaskingService; import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -87,7 +87,7 @@ private void setupPiiMaskingForAllLoggers() { while (appenderIterator.hasNext()) { Appender appender = appenderIterator.next(); // Skip if it's already a PiiMaskingAppender to avoid double-wrapping - if (!(appender instanceof PiiMaskingAppender)) { + if (!(appender instanceof PiiMaskingAppenderImpl)) { existingAppenders.add(appender); } } @@ -95,7 +95,7 @@ private void setupPiiMaskingForAllLoggers() { // If we have existing appenders, wrap them with PII masking if (!existingAppenders.isEmpty()) { // Create a new PiiMaskingAppender that will wrap all existing appenders - PiiMaskingAppender piiMaskingAppender = new PiiMaskingAppender(); + PiiMaskingAppenderImpl piiMaskingAppender = new PiiMaskingAppenderImpl(); piiMaskingAppender.setName("PII_MASKING_WRAPPER"); piiMaskingAppender.setContext(loggerContext); piiMaskingAppender.setPiiMaskingService(piiMaskingService); diff --git a/modules/web/src/main/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilter.java b/modules/web/src/main/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilterImpl.java similarity index 99% rename from modules/web/src/main/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilter.java rename to modules/web/src/main/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilterImpl.java index 9057d6266..5037ea9fa 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilter.java +++ b/modules/web/src/main/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilterImpl.java @@ -65,9 +65,9 @@ * This filter intercepts all HTTP requests and logs them according to the configuration. */ @EnableConfigurationProperties(HttpRequestLoggingProperties.class) -public class HttpRequestLoggingWebFilter implements WebFilter { +public class HttpRequestLoggingWebFilterImpl implements WebFilter { - private static final Logger log = LoggerFactory.getLogger(HttpRequestLoggingWebFilter.class); + private static final Logger log = LoggerFactory.getLogger(HttpRequestLoggingWebFilterImpl.class); private static final String MASK_VALUE = "***MASKED***"; private final HttpRequestLoggingProperties properties; @@ -75,7 +75,7 @@ public class HttpRequestLoggingWebFilter implements WebFilter { private final AntPathMatcher pathMatcher = new AntPathMatcher(); private final ObjectMapper objectMapper; - public HttpRequestLoggingWebFilter(HttpRequestLoggingProperties properties, + public HttpRequestLoggingWebFilterImpl(HttpRequestLoggingProperties properties, Optional piiMaskingService) { this.properties = properties; this.piiMaskingService = piiMaskingService; diff --git a/modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizer.java b/modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizerImpl.java similarity index 95% rename from modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizer.java rename to modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizerImpl.java index 7dc30d7a8..180378681 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizer.java +++ b/modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizerImpl.java @@ -36,7 +36,7 @@ * when fireflyframework-cache is available on the classpath. It will not be created if the required * cache dependencies are not available, preventing application startup failures.

    */ -public class IdempotencyOpenAPICustomizer implements OpenApiCustomizer { +public class IdempotencyOpenAPICustomizerImpl implements OpenApiCustomizer { private final String headerName; @@ -45,7 +45,7 @@ public class IdempotencyOpenAPICustomizer implements OpenApiCustomizer { * * @param properties the idempotency configuration properties */ - public IdempotencyOpenAPICustomizer(IdempotencyProperties properties) { + public IdempotencyOpenAPICustomizerImpl(IdempotencyProperties properties) { this.headerName = properties.getHeaderName(); } @@ -101,7 +101,7 @@ private void processOperation(Operation operation) { private boolean hasDisableIdempotencyExtension(Operation operation) { // Check if the operation has the x-disable-idempotency extension Object extension = operation.getExtensions() != null ? - operation.getExtensions().get(IdempotencyOperationCustomizer.DISABLE_IDEMPOTENCY_EXTENSION) : null; + operation.getExtensions().get(IdempotencyOperationCustomizerImpl.DISABLE_IDEMPOTENCY_EXTENSION) : null; return Boolean.TRUE.equals(extension); } } diff --git a/modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOperationCustomizer.java b/modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOperationCustomizerImpl.java similarity index 95% rename from modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOperationCustomizer.java rename to modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOperationCustomizerImpl.java index 86569a564..05fb58603 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOperationCustomizer.java +++ b/modules/web/src/main/java/org/fireflyframework/web/openapi/IdempotencyOperationCustomizerImpl.java @@ -31,7 +31,7 @@ * when fireflyframework-cache is available on the classpath. It will not be created if the required * cache dependencies are not available, preventing application startup failures.

    */ -public class IdempotencyOperationCustomizer implements OperationCustomizer { +public class IdempotencyOperationCustomizerImpl implements OperationCustomizer { public static final String DISABLE_IDEMPOTENCY_EXTENSION = "x-disable-idempotency"; diff --git a/modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenAPIAutoConfiguration.java b/modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenAPIAutoConfiguration.java index 993086e3d..6cc97ada7 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenAPIAutoConfiguration.java +++ b/modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenAPIAutoConfiguration.java @@ -28,8 +28,8 @@ havingValue = "true") public class InstantScalarOpenAPIAutoConfiguration { @Bean - @ConditionalOnMissingBean(InstantScalarOpenApiCustomizer.class) - public InstantScalarOpenApiCustomizer fireflyInstantScalarOpenApiCustomizer() { - return new InstantScalarOpenApiCustomizer(); + @ConditionalOnMissingBean(InstantScalarOpenApiCustomizerImpl.class) + public InstantScalarOpenApiCustomizerImpl fireflyInstantScalarOpenApiCustomizer() { + return new InstantScalarOpenApiCustomizerImpl(); } } diff --git a/modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizer.java b/modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizerImpl.java similarity index 98% rename from modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizer.java rename to modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizerImpl.java index 44c87f7a3..97ee5cf8d 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizer.java +++ b/modules/web/src/main/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizerImpl.java @@ -34,7 +34,7 @@ import java.util.*; /** Registers the reserved RFC3339 scalar only when source schemas explicitly reference it. */ -public final class InstantScalarOpenApiCustomizer implements OpenApiCustomizer { +public final class InstantScalarOpenApiCustomizerImpl implements OpenApiCustomizer { public static final String SCHEMA_NAME = "FireflyInstant"; public static final String SCHEMA_REF = "#/components/schemas/" + SCHEMA_NAME; diff --git a/modules/web/src/test/java/org/fireflyframework/web/conditions/config/ConditionsReportAutoConfigurationTest.java b/modules/web/src/test/java/org/fireflyframework/web/conditions/config/ConditionsReportAutoConfigurationTest.java index 4ec925f43..ff7ccf8c8 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/conditions/config/ConditionsReportAutoConfigurationTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/conditions/config/ConditionsReportAutoConfigurationTest.java @@ -16,7 +16,7 @@ package org.fireflyframework.web.conditions.config; -import org.fireflyframework.web.conditions.listener.ConditionsReportListener; +import org.fireflyframework.web.conditions.listener.ConditionsReportListenerImpl; import org.fireflyframework.web.conditions.service.ConditionsReportService; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -41,7 +41,7 @@ void shouldNotLoadBeansWhenDisabled() { .withPropertyValues("firefly.web.conditions-report.enabled=false") .run(context -> { assertThat(context).doesNotHaveBean(ConditionsReportService.class); - assertThat(context).doesNotHaveBean(ConditionsReportListener.class); + assertThat(context).doesNotHaveBean(ConditionsReportListenerImpl.class); }); } @@ -50,7 +50,7 @@ void shouldNotLoadBeansByDefault() { contextRunner .run(context -> { assertThat(context).doesNotHaveBean(ConditionsReportService.class); - assertThat(context).doesNotHaveBean(ConditionsReportListener.class); + assertThat(context).doesNotHaveBean(ConditionsReportListenerImpl.class); }); } @@ -60,7 +60,7 @@ void shouldLoadBeansWhenEnabled() { .withPropertyValues("firefly.web.conditions-report.enabled=true") .run(context -> { assertThat(context).hasSingleBean(ConditionsReportService.class); - assertThat(context).hasSingleBean(ConditionsReportListener.class); + assertThat(context).hasSingleBean(ConditionsReportListenerImpl.class); assertThat(context).hasSingleBean(ConditionsReportProperties.class); }); } diff --git a/modules/web/src/test/java/org/fireflyframework/web/error/converter/ExceptionConverterServiceTest.java b/modules/web/src/test/java/org/fireflyframework/web/error/converter/ExceptionConverterServiceTest.java index 8e7ea9621..2f18a79ec 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/error/converter/ExceptionConverterServiceTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/error/converter/ExceptionConverterServiceTest.java @@ -44,10 +44,10 @@ class ExceptionConverterServiceTest { @BeforeEach void setUp() { converterService = new ExceptionConverterService(Arrays.asList( - new DataAccessExceptionConverter(), - new HttpClientErrorExceptionConverter(), - new HttpServerErrorExceptionConverter(), - new OptimisticLockingFailureExceptionConverter() + new DataAccessExceptionConverterImpl(), + new HttpClientErrorExceptionConverterImpl(), + new HttpServerErrorExceptionConverterImpl(), + new OptimisticLockingFailureExceptionConverterImpl() )); } diff --git a/modules/web/src/test/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverterTest.java b/modules/web/src/test/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverterTest.java index 3d1b0cdc2..95ea53b5a 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverterTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/error/converter/ExternalServiceExceptionConverterTest.java @@ -46,11 +46,11 @@ class ExternalServiceExceptionConverterTest { - private ExternalServiceExceptionConverter converter; + private ExternalServiceExceptionConverterImpl converter; @BeforeEach void setUp() { - converter = new ExternalServiceExceptionConverter(); + converter = new ExternalServiceExceptionConverterImpl(); } @Test diff --git a/modules/web/src/test/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverterTest.java b/modules/web/src/test/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverterTest.java index 002924743..db2621aec 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverterTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/error/converter/R2dbcExceptionConverterTest.java @@ -29,11 +29,11 @@ class R2dbcExceptionConverterTest { - private R2dbcExceptionConverter converter; + private R2dbcExceptionConverterImpl converter; @BeforeEach void setUp() { - converter = new R2dbcExceptionConverter(); + converter = new R2dbcExceptionConverterImpl(); } @Test diff --git a/modules/web/src/test/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverterTest.java b/modules/web/src/test/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverterTest.java index 3b6d801f7..a65a7a35f 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverterTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/error/converter/WebFluxExceptionConverterTest.java @@ -39,11 +39,11 @@ class WebFluxExceptionConverterTest { - private WebFluxExceptionConverter converter; + private WebFluxExceptionConverterImpl converter; @BeforeEach void setUp() { - converter = new WebFluxExceptionConverter(); + converter = new WebFluxExceptionConverterImpl(); } @Test diff --git a/modules/web/src/test/java/org/fireflyframework/web/error/handler/DataAccessResponsePrivacyTest.java b/modules/web/src/test/java/org/fireflyframework/web/error/handler/DataAccessResponsePrivacyTest.java index 88c98fea4..72db99bdb 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/error/handler/DataAccessResponsePrivacyTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/error/handler/DataAccessResponsePrivacyTest.java @@ -7,7 +7,7 @@ import java.util.Optional; import java.util.stream.Stream; import org.fireflyframework.web.error.config.ErrorHandlingProperties; -import org.fireflyframework.web.error.converter.DataAccessExceptionConverter; +import org.fireflyframework.web.error.converter.DataAccessExceptionConverterImpl; import org.fireflyframework.web.error.converter.ExceptionConverterService; import org.fireflyframework.web.error.service.ErrorResponseNegotiator; import org.junit.jupiter.params.ParameterizedTest; @@ -49,7 +49,7 @@ void genericDatabaseResponsesKeepTheirStatusAndCodeWithoutDriverDetails( properties.setIncludeExceptionCause(true); var environment = new MockEnvironment(); environment.setActiveProfiles(profile); - var converters = new ExceptionConverterService(List.of(new DataAccessExceptionConverter())); + var converters = new ExceptionConverterService(List.of(new DataAccessExceptionConverterImpl())); var handler = new GlobalExceptionHandler(converters, Optional.empty(), properties, Optional.empty(), Optional.empty(), environment, mapper, new ErrorResponseNegotiator(mapper), Optional.empty()); diff --git a/modules/web/src/test/java/org/fireflyframework/web/error/service/ErrorResponseCacheTest.java b/modules/web/src/test/java/org/fireflyframework/web/error/service/ErrorResponseCacheTest.java index 8b16a5cdb..364f0d487 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/error/service/ErrorResponseCacheTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/error/service/ErrorResponseCacheTest.java @@ -1,6 +1,6 @@ package org.fireflyframework.web.error.service; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.fireflyframework.web.error.config.ErrorHandlingProperties; import org.fireflyframework.web.error.models.ErrorResponse; import org.junit.jupiter.api.BeforeEach; @@ -26,7 +26,7 @@ class ErrorResponseCacheTest { @Mock - private FireflyCacheManager cacheManager; + private FireflyCacheManagerImpl cacheManager; private ErrorHandlingProperties properties; private ErrorResponseCache errorResponseCache; diff --git a/modules/web/src/test/java/org/fireflyframework/web/idempotency/config/HttpFeatureCacheServiceNamespaceTest.java b/modules/web/src/test/java/org/fireflyframework/web/idempotency/config/HttpFeatureCacheServiceNamespaceTest.java index f9b079461..60054d734 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/idempotency/config/HttpFeatureCacheServiceNamespaceTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/idempotency/config/HttpFeatureCacheServiceNamespaceTest.java @@ -13,7 +13,7 @@ import org.fireflyframework.cache.config.PostgresCacheAutoConfiguration; 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.cache.properties.CacheProperties; import org.junit.jupiter.api.Test; import org.springframework.boot.autoconfigure.AutoConfigurations; @@ -43,13 +43,13 @@ ConnectionFactory factory(AtomicReference namespaceBinding,AtomicInteger .withConfiguration(AutoConfigurations.of(CacheAutoConfiguration.class,PostgresCacheAutoConfiguration.class)) .withUserConfiguration(TechnicalStorage.class); - FireflyCacheManager feature(CacheManagerFactory factory) {return new IdempotencyAutoConfiguration().httpIdempotencyCacheManager(factory,new IdempotencyProperties());} + FireflyCacheManagerImpl feature(CacheManagerFactory factory) {return new IdempotencyAutoConfiguration().httpIdempotencyCacheManager(factory,new IdempotencyProperties());} String namespace(String service,boolean useFeature) { var captured=new AtomicReference(); context.withPropertyValues("spring.application.name="+service).run(application -> { assertThat(application).hasNotFailed(); var manager=useFeature?feature(application.getBean(CacheManagerFactory.class)) - :application.getBean("fireflyCacheManager",FireflyCacheManager.class); + :application.getBean("fireflyCacheManager",FireflyCacheManagerImpl.class); manager.clear().block(java.time.Duration.ofSeconds(2)); captured.set(application.getBean(AtomicReference.class).get().toString()); });return captured.get(); diff --git a/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyAutoConfigurationTest.java b/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyAutoConfigurationTest.java index 983df2bbe..f7f79d31d 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyAutoConfigurationTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyAutoConfigurationTest.java @@ -47,9 +47,9 @@ class IdempotencyAutoConfigurationTest { runner.withPropertyValues("spring.application.name=synthetic-auto-service") .withBean(IdempotencyScopeResolver.class, () -> exchange -> Mono.just("synthetic-trusted-caller-and-tenant")) .run(context -> { - assertThat(context).hasSingleBean(IdempotencyWebFilter.class); + assertThat(context).hasSingleBean(IdempotencyWebFilterImpl.class); assertThat(context.getBean(IdempotencyProperties.class).getNamespace()).isEqualTo("synthetic-auto-service"); - var filter = context.getBean(IdempotencyWebFilter.class); + var filter = context.getBean(IdempotencyWebFilterImpl.class); AtomicInteger effects = new AtomicInteger(); org.springframework.web.server.WebFilterChain handler = exchange -> { effects.incrementAndGet(); exchange.getResponse().setStatusCode(HttpStatus.NO_CONTENT); diff --git a/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyHttpIntegrationTest.java b/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyHttpIntegrationTest.java index 8d08b261a..6ba9b5713 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyHttpIntegrationTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyHttpIntegrationTest.java @@ -294,11 +294,11 @@ static class HttpFixture { var auth = new UsernamePasswordAuthenticationToken(principal, "", List.of()); return (exchange, chain) -> chain.filter(exchange.mutate().principal(Mono.just(auth)).build()); } - @Bean IdempotencyWebFilter idempotencyWebFilter(org.springframework.beans.factory.ObjectProvider mappings, + @Bean IdempotencyWebFilterImpl idempotencyWebFilter(org.springframework.beans.factory.ObjectProvider mappings, ObservedIdempotencyCache cache) { var properties = new IdempotencyProperties(); properties.setNamespace("synthetic-http-service"); - return new IdempotencyWebFilter(properties, cache, - new org.fireflyframework.web.idempotency.scope.AuthenticatedIdempotencyScopeResolver(), () -> mappings.orderedStream().toList()); + return new IdempotencyWebFilterImpl(properties, cache, + new org.fireflyframework.web.idempotency.scope.AuthenticatedIdempotencyScopeResolverImpl(), () -> mappings.orderedStream().toList()); } } diff --git a/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilterTest.java b/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilterTest.java index bce1b13c0..2d9c9ec61 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilterTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/IdempotencyWebFilterTest.java @@ -43,7 +43,7 @@ */ class IdempotencyWebFilterTest { - private IdempotencyWebFilter idempotencyWebFilter; + private IdempotencyWebFilterImpl idempotencyWebFilter; private IdempotencyProperties properties; private TestIdempotencyCache idempotencyCache; @@ -67,7 +67,7 @@ void setUp() { properties.setNamespace("unit-test"); // Create the filter - idempotencyWebFilter = new IdempotencyWebFilter(properties, idempotencyCache); + idempotencyWebFilter = new IdempotencyWebFilterImpl(properties, idempotencyCache); } @Test diff --git a/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/ScopedIdempotencyWebFilterTest.java b/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/ScopedIdempotencyWebFilterTest.java index 0b5ecc124..80af9c2bd 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/ScopedIdempotencyWebFilterTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/idempotency/filter/ScopedIdempotencyWebFilterTest.java @@ -39,7 +39,7 @@ class ScopedIdempotencyWebFilterTest { private final TestIdempotencyCache cache = new TestIdempotencyCache(); - private final IdempotencyWebFilter filter = new IdempotencyWebFilter(properties("service-a"), cache); + private final IdempotencyWebFilterImpl filter = new IdempotencyWebFilterImpl(properties("service-a"), cache); private final AtomicInteger effects = new AtomicInteger(); private final WebFilterChain writer = exchange -> { effects.incrementAndGet(); @@ -157,13 +157,13 @@ class ScopedIdempotencyWebFilterTest { @Test void separateApplicationsCannotReplayFromTheSameBackend() { run(request("POST", "/api/headers", "{}"), writer); - var other = new IdempotencyWebFilter(properties("service-b"), cache); + var other = new IdempotencyWebFilterImpl(properties("service-b"), cache); other.filter(request("POST", "/api/headers", "{}"), writer).block(Duration.ofSeconds(2)); assertThat(effects.get()).isEqualTo(2); } @Test void missingApplicationNamespaceBypassesReuse() { - var unresolved = new IdempotencyWebFilter(new IdempotencyProperties(), cache); + var unresolved = new IdempotencyWebFilterImpl(new IdempotencyProperties(), cache); unresolved.filter(request("POST", "/api/headers", "{}"), writer).block(Duration.ofSeconds(2)); unresolved.filter(request("POST", "/api/headers", "{}"), writer).block(Duration.ofSeconds(2)); assertThat(effects.get()).isEqualTo(2); @@ -213,7 +213,7 @@ class ScopedIdempotencyWebFilterTest { @Test void oversizedRequestCannotReachTheHandler() { var small = properties("small"); small.setMaxRequestBodyBytes(3); - var bounded = new IdempotencyWebFilter(small, cache); + var bounded = new IdempotencyWebFilterImpl(small, cache); org.assertj.core.api.Assertions.assertThatThrownBy(() -> bounded.filter(request("POST", "/api/headers", "four"), writer).block(Duration.ofSeconds(2))) .isInstanceOf(org.springframework.web.server.ResponseStatusException.class) .satisfies(error -> assertThat(((org.springframework.web.server.ResponseStatusException) error).getStatusCode()).isEqualTo(HttpStatus.PAYLOAD_TOO_LARGE)); @@ -239,9 +239,9 @@ class ScopedIdempotencyWebFilterTest { } @Test void trustedTenantResolverSupportsPrincipalsWhoseTenantLivesInValidatedClaims() { - var scope = new org.fireflyframework.web.idempotency.scope.AuthenticatedIdempotencyScopeResolver(principal -> + var scope = new org.fireflyframework.web.idempotency.scope.AuthenticatedIdempotencyScopeResolverImpl(principal -> Mono.justOrEmpty(principal.claim("validated-tenant", String.class))); - var resolved = new IdempotencyWebFilter(properties("service-a"), cache, scope); + var resolved = new IdempotencyWebFilterImpl(properties("service-a"), cache, scope); var actor = SecurityPrincipal.builder().issuer("issuer-a").subject("alice") .claims(java.util.Map.of("validated-tenant", "tenant-a")).build(); var auth = new UsernamePasswordAuthenticationToken(actor, "", List.of()); @@ -260,7 +260,7 @@ class ScopedIdempotencyWebFilterTest { @Test void anotherFilterInstanceReadsTheSameBackendEntry() { run(request("POST", "/api/headers", "{}"), writer); - var restarted = new IdempotencyWebFilter(properties("service-a"), cache); + var restarted = new IdempotencyWebFilterImpl(properties("service-a"), cache); var duplicate = request("POST", "/api/headers", "{}"); restarted.filter(duplicate, writer).block(Duration.ofSeconds(2)); assertThat(duplicate.getResponse().getBodyAsString().block()).isEqualTo("POST /api/headers"); @@ -275,7 +275,7 @@ public Mono put(String key, org.fireflyframework.web.idempotency.model.Cac return persist.asMono().then(Mono.defer(() -> cache.put(key, response))); } }; - var waiting = new IdempotencyWebFilter(properties("service-a"), delayedCache); + var waiting = new IdempotencyWebFilterImpl(properties("service-a"), delayedCache); var first = waiting.filter(request("POST", "/api/headers", "{}"), writer).toFuture(); var duplicate = waiting.filter(request("POST", "/api/headers", "{}"), writer).toFuture(); assertThat(first).isNotDone(); assertThat(duplicate).isNotDone(); @@ -288,7 +288,7 @@ public Mono put(String key, org.fireflyframework.web.idempotency.model.Cac @Test void oversizedResponseDoesNotLeaveAnInFlightClaim() { var small = properties("small-response"); small.setMaxResponseBodyBytes(3); - var bounded = new IdempotencyWebFilter(small, cache); + var bounded = new IdempotencyWebFilterImpl(small, cache); org.assertj.core.api.Assertions.assertThatThrownBy(() -> bounded.filter(request("POST", "/api/headers", "{}"), writer).block(Duration.ofSeconds(2))) .isInstanceOf(org.springframework.core.io.buffer.DataBufferLimitException.class); assertThat(effects.get()).isEqualTo(1); diff --git a/modules/web/src/test/java/org/fireflyframework/web/logging/JsonLogValidationTest.java b/modules/web/src/test/java/org/fireflyframework/web/logging/JsonLogValidationTest.java index afc311abb..6491dba91 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/logging/JsonLogValidationTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/logging/JsonLogValidationTest.java @@ -18,7 +18,7 @@ package org.fireflyframework.web.logging; import org.fireflyframework.web.logging.config.HttpRequestLoggingProperties; -import org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilter; +import org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilterImpl; import org.fireflyframework.web.logging.service.PiiMaskingService; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -46,14 +46,14 @@ class JsonLogValidationTest { private HttpRequestLoggingProperties properties; - private HttpRequestLoggingWebFilter filter; + private HttpRequestLoggingWebFilterImpl filter; private ObjectMapper objectMapper; @BeforeEach void setUp() { properties = new HttpRequestLoggingProperties(); properties.setEnabled(true); - filter = new HttpRequestLoggingWebFilter(properties, Optional.empty()); + filter = new HttpRequestLoggingWebFilterImpl(properties, Optional.empty()); objectMapper = new ObjectMapper(); } @@ -67,11 +67,11 @@ void testJsonLogStructureForRequest() throws Exception { .build(); // Use reflection to access private methods for testing - Method formatHeadersAsMapMethod = HttpRequestLoggingWebFilter.class + Method formatHeadersAsMapMethod = HttpRequestLoggingWebFilterImpl.class .getDeclaredMethod("formatHeadersAsMap", HttpHeaders.class); formatHeadersAsMapMethod.setAccessible(true); - Method formatQueryParamsAsMapMethod = HttpRequestLoggingWebFilter.class + Method formatQueryParamsAsMapMethod = HttpRequestLoggingWebFilterImpl.class .getDeclaredMethod("formatQueryParamsAsMap", org.springframework.util.MultiValueMap.class); formatQueryParamsAsMapMethod.setAccessible(true); @@ -132,7 +132,7 @@ void testJsonLogStructureForResponse() throws Exception { logData.put("durationMs", 250L); // Use reflection to test header formatting - Method formatHeadersAsMapMethod = HttpRequestLoggingWebFilter.class + Method formatHeadersAsMapMethod = HttpRequestLoggingWebFilterImpl.class .getDeclaredMethod("formatHeadersAsMap", HttpHeaders.class); formatHeadersAsMapMethod.setAccessible(true); @@ -186,7 +186,7 @@ void testSensitiveHeaderMasking() throws Exception { .header("Content-Type", "application/json") .build(); - Method formatHeadersAsMapMethod = HttpRequestLoggingWebFilter.class + Method formatHeadersAsMapMethod = HttpRequestLoggingWebFilterImpl.class .getDeclaredMethod("formatHeadersAsMap", HttpHeaders.class); formatHeadersAsMapMethod.setAccessible(true); diff --git a/modules/web/src/test/java/org/fireflyframework/web/logging/JsonValidityTest.java b/modules/web/src/test/java/org/fireflyframework/web/logging/JsonValidityTest.java index 6042b0b56..af415e67b 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/logging/JsonValidityTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/logging/JsonValidityTest.java @@ -18,7 +18,7 @@ package org.fireflyframework.web.logging; import org.fireflyframework.web.logging.config.HttpRequestLoggingProperties; -import org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilter; +import org.fireflyframework.web.logging.filter.HttpRequestLoggingWebFilterImpl; import org.fireflyframework.web.logging.service.PiiMaskingService; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; @@ -47,14 +47,14 @@ class JsonValidityTest { private HttpRequestLoggingProperties properties; - private HttpRequestLoggingWebFilter filter; + private HttpRequestLoggingWebFilterImpl filter; private ObjectMapper objectMapper; @BeforeEach void setUp() { properties = new HttpRequestLoggingProperties(); properties.setEnabled(true); - filter = new HttpRequestLoggingWebFilter(properties, Optional.empty()); + filter = new HttpRequestLoggingWebFilterImpl(properties, Optional.empty()); objectMapper = new ObjectMapper(); } @@ -165,7 +165,7 @@ void testJsonValidityWithHeadersContainingSpecialCharacters() throws Exception { .header("Authorization", "Bearer secret-token") .build(); - Method formatHeadersAsMapMethod = HttpRequestLoggingWebFilter.class + Method formatHeadersAsMapMethod = HttpRequestLoggingWebFilterImpl.class .getDeclaredMethod("formatHeadersAsMap", HttpHeaders.class); formatHeadersAsMapMethod.setAccessible(true); @@ -223,19 +223,19 @@ void testEmptyAndNullInputHandling() throws Exception { // Helper methods to invoke private methods for testing private String invokeSanitizeForJson(String input) throws Exception { - Method method = HttpRequestLoggingWebFilter.class.getDeclaredMethod("sanitizeForJson", String.class); + Method method = HttpRequestLoggingWebFilterImpl.class.getDeclaredMethod("sanitizeForJson", String.class); method.setAccessible(true); return (String) method.invoke(filter, input); } private String invokeSanitizeBodyForJson(byte[] body) throws Exception { - Method method = HttpRequestLoggingWebFilter.class.getDeclaredMethod("sanitizeBodyForJson", byte[].class); + Method method = HttpRequestLoggingWebFilterImpl.class.getDeclaredMethod("sanitizeBodyForJson", byte[].class); method.setAccessible(true); return (String) method.invoke(filter, body); } private String invokeSerializeToJsonSafely(Map logData, String logType) throws Exception { - Method method = HttpRequestLoggingWebFilter.class.getDeclaredMethod("serializeToJsonSafely", Map.class, String.class); + Method method = HttpRequestLoggingWebFilterImpl.class.getDeclaredMethod("serializeToJsonSafely", Map.class, String.class); method.setAccessible(true); return (String) method.invoke(filter, logData, logType); } diff --git a/modules/web/src/test/java/org/fireflyframework/web/logging/appender/PiiMaskingAppenderPrivacyTest.java b/modules/web/src/test/java/org/fireflyframework/web/logging/appender/PiiMaskingAppenderPrivacyTest.java index 28daedd89..698211652 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/logging/appender/PiiMaskingAppenderPrivacyTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/logging/appender/PiiMaskingAppenderPrivacyTest.java @@ -389,8 +389,8 @@ private Sink(String format, boolean globalContextDiagnostic) { output.start(); assertThat(output.isStarted()).isTrue(); } - private PiiMaskingAppender masker(PiiMaskingService service) { - var appender = new PiiMaskingAppender(); + private PiiMaskingAppenderImpl masker(PiiMaskingService service) { + var appender = new PiiMaskingAppenderImpl(); appender.setContext(context); appender.setPiiMaskingService(service); appender.addAppender(output); diff --git a/modules/web/src/test/java/org/fireflyframework/web/logging/config/PiiMaskingLoggingConfigurationTest.java b/modules/web/src/test/java/org/fireflyframework/web/logging/config/PiiMaskingLoggingConfigurationTest.java index 95252b090..75373e3ef 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/logging/config/PiiMaskingLoggingConfigurationTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/logging/config/PiiMaskingLoggingConfigurationTest.java @@ -21,7 +21,7 @@ import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.fireflyframework.web.logging.appender.PiiMaskingAppender; +import org.fireflyframework.web.logging.appender.PiiMaskingAppenderImpl; import org.fireflyframework.web.logging.service.PiiMaskingService; import org.fireflyframework.web.logging.service.StdoutMaskingService; import org.junit.jupiter.api.AfterEach; @@ -112,7 +112,7 @@ void testPiiMaskingConfigurationEnabled() { boolean hasPiiMaskingAppender = false; var appenderIterator = rootLogger.iteratorForAppenders(); while (appenderIterator.hasNext()) { - if (appenderIterator.next() instanceof PiiMaskingAppender) { + if (appenderIterator.next() instanceof PiiMaskingAppenderImpl) { hasPiiMaskingAppender = true; break; } @@ -132,7 +132,7 @@ void testPiiMaskingConfigurationDisabled() { boolean hasPiiMaskingAppender = false; var appenderIterator = rootLogger.iteratorForAppenders(); while (appenderIterator.hasNext()) { - if (appenderIterator.next() instanceof PiiMaskingAppender) { + if (appenderIterator.next() instanceof PiiMaskingAppenderImpl) { hasPiiMaskingAppender = true; break; } @@ -201,7 +201,7 @@ void testMaskingServiceDisabled() { boolean hasPiiMaskingAppender = false; var appenderIterator = rootLogger.iteratorForAppenders(); while (appenderIterator.hasNext()) { - if (appenderIterator.next() instanceof PiiMaskingAppender) { + if (appenderIterator.next() instanceof PiiMaskingAppenderImpl) { hasPiiMaskingAppender = true; break; } diff --git a/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingPrivacyDefaultsTest.java b/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingPrivacyDefaultsTest.java index ebb819dd5..f593ecc6b 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingPrivacyDefaultsTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingPrivacyDefaultsTest.java @@ -25,7 +25,7 @@ import static org.assertj.core.api.Assertions.assertThat; class HttpRequestLoggingPrivacyDefaultsTest { - private final Logger logger = (Logger) LoggerFactory.getLogger(HttpRequestLoggingWebFilter.class); + private final Logger logger = (Logger) LoggerFactory.getLogger(HttpRequestLoggingWebFilterImpl.class); private final ListAppender events = new ListAppender<>(); private Level priorLevel; private boolean priorAdditive; @@ -106,7 +106,7 @@ private void exchange(HttpRequestLoggingProperties properties, String query, Str .header("Authorization", "Bearer synthetic-secret-value").body(requestBody); var exchange = MockServerWebExchange.from(request); var received = new AtomicReference(); - var filter = new HttpRequestLoggingWebFilter(properties, Optional.empty()); + var filter = new HttpRequestLoggingWebFilterImpl(properties, Optional.empty()); filter.filter(exchange, actual -> DataBufferUtils.join(actual.getRequest().getBody()).flatMap(buffer -> { received.set(buffer.toString(StandardCharsets.UTF_8)); diff --git a/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingStreamingTest.java b/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingStreamingTest.java index fc7b0ac51..5ec5f57f8 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingStreamingTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingStreamingTest.java @@ -47,7 +47,7 @@ import static org.mockito.Mockito.spy; class HttpRequestLoggingStreamingTest { - private final Logger logger = (Logger) LoggerFactory.getLogger(HttpRequestLoggingWebFilter.class); + private final Logger logger = (Logger) LoggerFactory.getLogger(HttpRequestLoggingWebFilterImpl.class); private final ListAppender events = new ListAppender<>(); private final NettyDataBufferFactory buffers = new NettyDataBufferFactory(PooledByteBufAllocator.DEFAULT); private final List allocated = new ArrayList<>(); @@ -160,7 +160,7 @@ void subscriptionsHaveIndependentPrefixBudgetsAndNeverReplaceBuffers(boolean res var sink = new Drain(false); Flux body = Flux.defer(() -> Flux.just(pooled("!abc", 1), pooled("def"))); var properties = properties(true, true, 4); - var filter = new HttpRequestLoggingWebFilter(properties, Optional.empty()); + var filter = new HttpRequestLoggingWebFilterImpl(properties, Optional.empty()); ServerWebExchange exchange = exchange(response ? Flux.empty() : body, sink); Mono operation = filter.filter(exchange, actual -> response ? actual.getResponse().writeWith(body) : sink.consume(actual.getRequest().getBody())); @@ -244,7 +244,7 @@ void flushGroupsStaySeparateAndShareOneResponsePrefixBudget() { var sink = new Drain(false); var first = pooled("abc"); var second = pooled("def"); - var filter = new HttpRequestLoggingWebFilter(properties(false, true, 5), Optional.empty()); + var filter = new HttpRequestLoggingWebFilterImpl(properties(false, true, 5), Optional.empty()); filter.filter(exchange(Flux.empty(), sink), actual -> actual.getResponse().writeAndFlushWith( Flux.just(Flux.just(first), Flux.just(second)))).block(); @@ -262,7 +262,7 @@ void nonterminalFlushGroupDeliversFirstFrameAndPreservesCancellation() { var sink = new Drain(false); var buffer = pooled("event"); var cancelled = new AtomicBoolean(); - var filter = new HttpRequestLoggingWebFilter(properties(false, true, 5), Optional.empty()); + var filter = new HttpRequestLoggingWebFilterImpl(properties(false, true, 5), Optional.empty()); Disposable subscription = filter.filter(exchange(Flux.empty(), sink), actual -> actual.getResponse() .writeAndFlushWith(Flux.just(Flux.concat(Mono.just(buffer), Mono.never()) .doOnCancel(() -> cancelled.set(true))))).subscribe(); @@ -285,7 +285,7 @@ void flushFailurePreservesOriginalErrorWithoutLoggingAnIncompletePrefix() { var buffer = pooled("partial"); var failure = new IllegalStateException("flush-source-error"); var observed = new AtomicReference(); - var filter = new HttpRequestLoggingWebFilter(properties(false, true, 7), Optional.empty()); + var filter = new HttpRequestLoggingWebFilterImpl(properties(false, true, 7), Optional.empty()); filter.filter(exchange(Flux.empty(), sink), actual -> actual.getResponse().writeAndFlushWith( Flux.just(Flux.concat(Mono.just(buffer), Flux.error(failure))))) .onErrorResume(error -> { observed.set(error); return Mono.empty(); }).block(); @@ -303,7 +303,7 @@ void transportFailureAfterConsumingTheBodyDoesNotLogACompletedResponseBody() { sink.terminalFailure = new IllegalStateException("transport-failure"); var buffer = pooled("written-prefix"); var observed = new AtomicReference(); - var filter = new HttpRequestLoggingWebFilter(properties(false, true, 7), Optional.empty()); + var filter = new HttpRequestLoggingWebFilterImpl(properties(false, true, 7), Optional.empty()); filter.filter(exchange(Flux.empty(), sink), actual -> flush ? actual.getResponse().writeAndFlushWith(Flux.just(Flux.just(buffer))) : actual.getResponse().writeWith(Flux.just(buffer))) @@ -333,7 +333,7 @@ private Mono transfer(boolean response, boolean enabled, Flux private Mono transfer(boolean response, HttpRequestLoggingProperties properties, Flux body, Drain sink) { - var filter = new HttpRequestLoggingWebFilter(properties, Optional.empty()); + var filter = new HttpRequestLoggingWebFilterImpl(properties, Optional.empty()); return filter.filter(exchange(response ? Flux.empty() : body, sink), actual -> response ? actual.getResponse().writeWith(body) : sink.consume(actual.getRequest().getBody())); } diff --git a/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilterTest.java b/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilterTest.java index b70d7b4b2..a95ddf4f1 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilterTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/logging/filter/HttpRequestLoggingWebFilterTest.java @@ -49,13 +49,13 @@ class HttpRequestLoggingWebFilterTest { private WebFilterChain filterChain; private HttpRequestLoggingProperties properties; - private HttpRequestLoggingWebFilter filter; + private HttpRequestLoggingWebFilterImpl filter; @BeforeEach void setUp() { MockitoAnnotations.openMocks(this); properties = new HttpRequestLoggingProperties(); - filter = new HttpRequestLoggingWebFilter(properties, Optional.empty()); + filter = new HttpRequestLoggingWebFilterImpl(properties, Optional.empty()); } @Test diff --git a/modules/web/src/test/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizerTest.java b/modules/web/src/test/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizerTest.java index ff7cdc4ae..26e2d59ee 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizerTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/openapi/IdempotencyOpenAPICustomizerTest.java @@ -38,7 +38,7 @@ */ class IdempotencyOpenAPICustomizerTest { - private IdempotencyOpenAPICustomizer customizer; + private IdempotencyOpenAPICustomizerImpl customizer; private OpenAPI openAPI; private Paths paths; private PathItem pathItem; @@ -52,7 +52,7 @@ class IdempotencyOpenAPICustomizerTest { void setUp() { IdempotencyProperties properties = new IdempotencyProperties(); properties.setHeaderName("X-Idempotency-Key"); - customizer = new IdempotencyOpenAPICustomizer(properties); + customizer = new IdempotencyOpenAPICustomizerImpl(properties); // Set up OpenAPI structure openAPI = new OpenAPI(); @@ -111,7 +111,7 @@ void shouldAddIdempotencyKeyHeaderToAllOperations() { void shouldNotAddIdempotencyKeyHeaderToOperationsWithDisableIdempotencyExtension() { // Arrange Map extensions = new HashMap<>(); - extensions.put(IdempotencyOperationCustomizer.DISABLE_IDEMPOTENCY_EXTENSION, true); + extensions.put(IdempotencyOperationCustomizerImpl.DISABLE_IDEMPOTENCY_EXTENSION, true); postOperation.setExtensions(extensions); // Act diff --git a/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarOpenAPIAutoConfigurationTest.java b/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarOpenAPIAutoConfigurationTest.java index c4166b5ad..4c09f18e2 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarOpenAPIAutoConfigurationTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarOpenAPIAutoConfigurationTest.java @@ -18,7 +18,7 @@ void normalConfigurationRegistersOnlyOneStatelessCustomizerWithoutBusinessBeans( context -> assertThat(context) .hasNotFailed() - .hasSingleBean(InstantScalarOpenApiCustomizer.class) + .hasSingleBean(InstantScalarOpenApiCustomizerImpl.class) .doesNotHaveBean(io.swagger.v3.oas.models.OpenAPI.class)); } @@ -90,7 +90,7 @@ void defaultDoesNotTreatAnExistingDomainSchemaAsAnInstantOptIn() throws Exceptio .doesNotThrowAnyException(); assertThat(context) .hasNotFailed() - .doesNotHaveBean(InstantScalarOpenApiCustomizer.class); + .doesNotHaveBean(InstantScalarOpenApiCustomizerImpl.class); }); assertThat(io.swagger.v3.core.util.Json.pretty(api)).isEqualTo(before); } @@ -105,6 +105,6 @@ void explicitlyDisabledConfigurationDoesNotCreateARegistrar() { context -> assertThat(context) .hasNotFailed() - .doesNotHaveBean(InstantScalarOpenApiCustomizer.class)); + .doesNotHaveBean(InstantScalarOpenApiCustomizerImpl.class)); } } diff --git a/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizerTest.java b/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizerTest.java index 56070d54f..bd5016d3e 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizerTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarOpenApiCustomizerTest.java @@ -19,7 +19,7 @@ class InstantScalarOpenApiCustomizerTest { OpenApiCustomizer customizer() { try { return (OpenApiCustomizer) - Class.forName("org.fireflyframework.web.openapi.InstantScalarOpenApiCustomizer") + Class.forName("org.fireflyframework.web.openapi.InstantScalarOpenApiCustomizerImpl") .getConstructor() .newInstance(); } catch (ReflectiveOperationException error) { diff --git a/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarSchemaGraphTest.java b/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarSchemaGraphTest.java index 7d730c85e..a668c8912 100644 --- a/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarSchemaGraphTest.java +++ b/modules/web/src/test/java/org/fireflyframework/web/openapi/InstantScalarSchemaGraphTest.java @@ -20,7 +20,7 @@ import java.util.stream.Stream; class InstantScalarSchemaGraphTest { - static final String REF = InstantScalarOpenApiCustomizer.SCHEMA_REF; + static final String REF = InstantScalarOpenApiCustomizerImpl.SCHEMA_REF; record Site(String name, Function, OpenAPI> document) {} @@ -209,7 +209,7 @@ static PathItem pathResponseWithEncoding(Header header) { void everySupportedSchemaLocationRegistersThePrimitive( String name, Function, OpenAPI> site) { var api = site.apply(new Schema<>().$ref(REF)); - new InstantScalarOpenApiCustomizer().customise(api); + new InstantScalarOpenApiCustomizerImpl().customise(api); assertThat(api.getComponents()).as(name).isNotNull(); assertThat(api.getComponents().getSchemas()).as(name).containsKey("FireflyInstant"); } @@ -221,7 +221,7 @@ void everySupportedSchemaLocationEnforcesTheEnabledReservedContract( var api = site.apply(new Schema<>().$ref(REF)); if (api.getComponents() == null) api.setComponents(new Components()); api.getComponents().addSchemas("FireflyInstant", new ObjectSchema()); - assertThatThrownBy(() -> new InstantScalarOpenApiCustomizer().customise(api)) + assertThatThrownBy(() -> new InstantScalarOpenApiCustomizerImpl().customise(api)) .as(name) .isInstanceOf(IllegalStateException.class) .hasMessage("OPENAPI_INSTANT_SCHEMA_CONFLICT"); @@ -235,17 +235,17 @@ void schema31CyclesTerminateWithoutTreatingBackingMetadataAsSchemaLocations() { parent.setJsonSchema(Map.of("$ref", REF)); parent.setJsonSchemaImpl(Map.of("$ref", REF)); var api = schema(parent); - new InstantScalarOpenApiCustomizer().customise(api); + new InstantScalarOpenApiCustomizerImpl().customise(api); assertThat(api.getComponents().getSchemas()).doesNotContainKey("FireflyInstant"); parent.setPropertyNames(new Schema<>().$ref(REF)); - new InstantScalarOpenApiCustomizer().customise(api); + new InstantScalarOpenApiCustomizerImpl().customise(api); assertThat(api.getComponents().getSchemas()).containsKey("FireflyInstant"); } @Test void theScalarEmitsStringDateTimeUnderBothSwaggerSerializers() { var api = schema(new Schema<>().$ref(REF)); - new InstantScalarOpenApiCustomizer().customise(api); + new InstantScalarOpenApiCustomizerImpl().customise(api); var scalar = api.getComponents().getSchemas().get("FireflyInstant"); for (var mapper : List.of(Json.mapper(), Json31.mapper())) { com.fasterxml.jackson.databind.JsonNode tree = mapper.valueToTree(scalar); diff --git a/modules/webhooks/ARCHITECTURE.md b/modules/webhooks/ARCHITECTURE.md index 28726efe6..f0d598bcb 100644 --- a/modules/webhooks/ARCHITECTURE.md +++ b/modules/webhooks/ARCHITECTURE.md @@ -232,7 +232,7 @@ Benefits: │ - WebhookProcessor (Port) │ │ - AbstractWebhookEventListener (Adapter) │ │ - WebhookIdempotencyService (Port) │ -│ - CacheBasedWebhookIdempotencyService (Adapter) │ +│ - CacheBasedWebhookIdempotencyServiceImpl (Adapter) │ │ - WebhookSignatureValidator (Port) │ │ - WebhookProcessingContext │ │ - WebhookProcessingResult │ @@ -279,19 +279,19 @@ org.fireflyframework.webhooks.core/ ├── domain/events/ # Domain events │ └── WebhookReceivedEvent # Webhook received event ├── filter/ # Web filters -│ └── TracingWebFilter # Distributed tracing +│ └── TracingWebFilterImpl # Distributed tracing ├── health/ # Health indicators -│ └── WebhookCircuitBreakerHealthIndicator +│ └── WebhookCircuitBreakerHealthIndicatorImpl ├── idempotency/ # (Removed - now using lib-common-web) -│ # HTTP-level idempotency moved to lib-common-web IdempotencyWebFilter +│ # HTTP-level idempotency moved to lib-common-web IdempotencyWebFilterImpl ├── mappers/ # MapStruct mappers │ └── WebhookEventMapper # DTO ↔ Event mapping ├── metrics/ # Metrics services -│ └── WebhookMetricsService # Custom metrics +│ └── WebhookMetricsServiceImpl # Custom metrics ├── ratelimit/ # Rate limiting │ └── WebhookRateLimitService ├── resilience/ # Resilience patterns -│ └── ResilientWebhookProcessingService +│ └── ResilientWebhookProcessingServiceImpl ├── services/ # Business services │ ├── WebhookProcessingService │ └── impl/WebhookProcessingServiceImpl @@ -303,8 +303,8 @@ Key Features: - Resilience Patterns: Circuit breaker, rate limiter, timeout, bulkhead - Security: Payload validation, rate limiting, IP whitelisting - Observability: Custom metrics, distributed tracing, health indicators -- HTTP Idempotency: Handled by lib-common-web IdempotencyWebFilter (transparent) -- Event Idempotency: Worker-level via CacheBasedWebhookIdempotencyService (processor module) +- HTTP Idempotency: Handled by lib-common-web IdempotencyWebFilterImpl (transparent) +- Event Idempotency: Worker-level via CacheBasedWebhookIdempotencyServiceImpl (processor module) Dependencies: - `lib-common-eda` - Event publishing @@ -316,7 +316,7 @@ Dependencies: - Apache Commons Net - CIDR notation IP matching Design Decisions: -- Decorator Pattern: `ResilientWebhookProcessingService` decorates `WebhookProcessingServiceImpl` +- Decorator Pattern: `ResilientWebhookProcessingServiceImpl` decorates `WebhookProcessingServiceImpl` - Environment Variables: All properties support environment variable configuration - Reactive Programming: All services return Mono/Flux for non-blocking operations - Separation of Concerns: Each package has a single responsibility @@ -360,7 +360,7 @@ Key Classes: - Adapters (Implementations): - `AbstractWebhookEventListener` - Kafka consumer adapter - - `CacheBasedWebhookIdempotencyService` - Redis adapter + - `CacheBasedWebhookIdempotencyServiceImpl` - Redis adapter - Models: - `WebhookProcessingContext` - Context object @@ -927,7 +927,7 @@ Implementation: ```java @Service @Primary -public class ResilientWebhookProcessingService implements WebhookProcessingService { +public class ResilientWebhookProcessingServiceImpl implements WebhookProcessingService { private final WebhookProcessingService delegate; private final CircuitBreaker circuitBreaker; diff --git a/modules/webhooks/CONFIGURATION.md b/modules/webhooks/CONFIGURATION.md index 74431932d..a382cf006 100644 --- a/modules/webhooks/CONFIGURATION.md +++ b/modules/webhooks/CONFIGURATION.md @@ -338,7 +338,7 @@ firefly: ## HTTP Idempotency Configuration -HTTP-level idempotency is handled by `lib-common-web`'s `IdempotencyWebFilter`. This provides automatic duplicate request detection using the `X-Idempotency-Key` header. +HTTP-level idempotency is handled by `lib-common-web`'s `IdempotencyWebFilterImpl`. This provides automatic duplicate request detection using the `X-Idempotency-Key` header. ### Configuration @@ -359,7 +359,7 @@ idempotency: -d '{"type": "payment_intent.succeeded"}' ``` -2. IdempotencyWebFilter intercepts the request: +2. IdempotencyWebFilterImpl intercepts the request: - Checks cache for the idempotency key - If found: returns cached HTTP response (status, headers, body) - If not found: proceeds with request processing and caches the complete response @@ -406,7 +406,7 @@ The platform has two levels of idempotency: - Key: `X-Idempotency-Key` header - Cache prefix: `:idempotency:` -2. Event-level (CacheBasedWebhookIdempotencyService): Prevents duplicate event processing by workers +2. Event-level (CacheBasedWebhookIdempotencyServiceImpl): Prevents duplicate event processing by workers - Scope: Kafka consumer / Worker processing - Key: `eventId` (UUID) - Cache prefixes: `webhook:processing:`, `webhook:processed:`, `webhook:failures:` @@ -779,7 +779,7 @@ firefly: ## Troubleshooting Configuration Issues -### Issue: Application fails to start with "ClassNotFoundException: FireflyCacheManager" +### Issue: Application fails to start with "ClassNotFoundException: FireflyCacheManagerImpl" Cause: `lib-common-cache` dependency is missing or has wrong scope diff --git a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/filter/TracingWebFilter.java b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/filter/TracingWebFilterImpl.java similarity index 96% rename from modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/filter/TracingWebFilter.java rename to modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/filter/TracingWebFilterImpl.java index 7f7567c54..11a40a3ed 100644 --- a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/filter/TracingWebFilter.java +++ b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/filter/TracingWebFilterImpl.java @@ -36,10 +36,10 @@ * module's {@code Hooks.enableAutomaticContextPropagation()} and the Micrometer * tracing bridge -- no manual B3 header extraction or MDC management is needed.

    */ -@Component +@Component("tracingWebFilter") @Order(Ordered.HIGHEST_PRECEDENCE) @Slf4j -public class TracingWebFilter implements WebFilter { +public class TracingWebFilterImpl implements WebFilter { private static final String REQUEST_ID_HEADER = "X-Request-ID"; private static final String REQUEST_ID_KEY = "requestId"; diff --git a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/RedisConnectivityHealthIndicator.java b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/RedisConnectivityHealthIndicatorImpl.java similarity index 97% rename from modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/RedisConnectivityHealthIndicator.java rename to modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/RedisConnectivityHealthIndicatorImpl.java index 5a640e673..5baf5d211 100644 --- a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/RedisConnectivityHealthIndicator.java +++ b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/RedisConnectivityHealthIndicatorImpl.java @@ -39,7 +39,7 @@ @Slf4j @ConditionalOnBean(CacheManager.class) @ConditionalOnProperty(name = "firefly.cache.redis.enabled", havingValue = "true", matchIfMissing = false) -public class RedisConnectivityHealthIndicator implements HealthIndicator { +public class RedisConnectivityHealthIndicatorImpl implements HealthIndicator { private final CacheManager cacheManager; private static final String HEALTH_CHECK_CACHE = "health-check"; diff --git a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookCircuitBreakerHealthIndicator.java b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookCircuitBreakerHealthIndicatorImpl.java similarity index 90% rename from modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookCircuitBreakerHealthIndicator.java rename to modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookCircuitBreakerHealthIndicatorImpl.java index 52945bc23..6e85c17ad 100644 --- a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookCircuitBreakerHealthIndicator.java +++ b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookCircuitBreakerHealthIndicatorImpl.java @@ -16,7 +16,7 @@ package org.fireflyframework.webhooks.core.health; -import org.fireflyframework.webhooks.core.resilience.ResilientWebhookProcessingService; +import org.fireflyframework.webhooks.core.resilience.ResilientWebhookProcessingServiceImpl; import io.github.resilience4j.circuitbreaker.CircuitBreaker; import lombok.RequiredArgsConstructor; import org.springframework.boot.health.contributor.Health; @@ -27,11 +27,11 @@ * Health indicator for webhook circuit breaker. * Reports the state of the circuit breaker protecting Kafka publishing. */ -@Component +@Component("webhookCircuitBreakerHealthIndicator") @RequiredArgsConstructor -public class WebhookCircuitBreakerHealthIndicator implements HealthIndicator { +public class WebhookCircuitBreakerHealthIndicatorImpl implements HealthIndicator { - private final ResilientWebhookProcessingService resilientService; + private final ResilientWebhookProcessingServiceImpl resilientService; @Override public Health health() { diff --git a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformLivenessIndicator.java b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformLivenessIndicatorImpl.java similarity index 95% rename from modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformLivenessIndicator.java rename to modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformLivenessIndicatorImpl.java index c653771e5..755562871 100644 --- a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformLivenessIndicator.java +++ b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformLivenessIndicatorImpl.java @@ -37,7 +37,7 @@ * */ @Component("webhookLiveness") -public class WebhookPlatformLivenessIndicator implements HealthIndicator { +public class WebhookPlatformLivenessIndicatorImpl implements HealthIndicator { @Override public Health health() { diff --git a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformReadinessIndicator.java b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformReadinessIndicatorImpl.java similarity index 93% rename from modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformReadinessIndicator.java rename to modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformReadinessIndicatorImpl.java index 577b66c85..716841bb1 100644 --- a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformReadinessIndicator.java +++ b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/health/WebhookPlatformReadinessIndicatorImpl.java @@ -16,7 +16,7 @@ package org.fireflyframework.webhooks.core.health; -import org.fireflyframework.webhooks.core.resilience.ResilientWebhookProcessingService; +import org.fireflyframework.webhooks.core.resilience.ResilientWebhookProcessingServiceImpl; import io.github.resilience4j.circuitbreaker.CircuitBreaker; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -43,9 +43,9 @@ @Component("webhookReadiness") @RequiredArgsConstructor @Slf4j -public class WebhookPlatformReadinessIndicator implements HealthIndicator { +public class WebhookPlatformReadinessIndicatorImpl implements HealthIndicator { - private final ResilientWebhookProcessingService resilientService; + private final ResilientWebhookProcessingServiceImpl resilientService; @Override public Health health() { diff --git a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsService.java b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceImpl.java similarity index 94% rename from modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsService.java rename to modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceImpl.java index 5fed636f7..dc78daf9c 100644 --- a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsService.java +++ b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceImpl.java @@ -29,11 +29,11 @@ * Service for recording webhook metrics via {@link FireflyMetricsSupport}. * All metrics are prefixed with {@code firefly.webhooks.*}. */ -@Service +@Service("webhookMetricsService") @Slf4j -public class WebhookMetricsService extends FireflyMetricsSupport { +public class WebhookMetricsServiceImpl extends FireflyMetricsSupport { - public WebhookMetricsService(MeterRegistry meterRegistry) { + public WebhookMetricsServiceImpl(MeterRegistry meterRegistry) { super(meterRegistry, "webhooks"); } diff --git a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/resilience/ResilientWebhookProcessingService.java b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/resilience/ResilientWebhookProcessingServiceImpl.java similarity index 96% rename from modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/resilience/ResilientWebhookProcessingService.java rename to modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/resilience/ResilientWebhookProcessingServiceImpl.java index 9383aa06f..9e4b7949f 100644 --- a/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/resilience/ResilientWebhookProcessingService.java +++ b/modules/webhooks/fireflyframework-webhooks-core/src/main/java/org/fireflyframework/webhooks/core/resilience/ResilientWebhookProcessingServiceImpl.java @@ -48,10 +48,10 @@ * for message broker abstraction. The circuit breaker will fail fast when Kafka is unhealthy, * and the application should handle this gracefully (e.g., return 503 Service Unavailable). */ -@Service +@Service("resilientWebhookProcessingService") @Primary @Slf4j -public class ResilientWebhookProcessingService implements WebhookProcessingService { +public class ResilientWebhookProcessingServiceImpl implements WebhookProcessingService { private static final String CIRCUIT_BREAKER_NAME = "webhookKafkaPublisher"; private static final String TIME_LIMITER_NAME = "webhookKafkaPublisher"; @@ -60,7 +60,7 @@ public class ResilientWebhookProcessingService implements WebhookProcessingServi private final CircuitBreaker circuitBreaker; private final TimeLimiter timeLimiter; - public ResilientWebhookProcessingService( + public ResilientWebhookProcessingServiceImpl( @Qualifier("webhookProcessingServiceImpl") WebhookProcessingService delegate, CircuitBreakerRegistry circuitBreakerRegistry, TimeLimiterRegistry timeLimiterRegistry) { diff --git a/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/logging/WebhookGuardLoggingTest.java b/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/logging/WebhookGuardLoggingTest.java index 6936524ea..cdc95a3b2 100644 --- a/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/logging/WebhookGuardLoggingTest.java +++ b/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/logging/WebhookGuardLoggingTest.java @@ -20,7 +20,7 @@ import org.fireflyframework.kernel.logging.LogFields; import org.fireflyframework.webhooks.core.config.WebhookSecurityProperties; import org.fireflyframework.webhooks.core.ratelimit.WebhookRateLimitService; -import org.fireflyframework.webhooks.core.resilience.ResilientWebhookProcessingService; +import org.fireflyframework.webhooks.core.resilience.ResilientWebhookProcessingServiceImpl; import org.fireflyframework.webhooks.core.services.WebhookProcessingService; import org.fireflyframework.webhooks.core.validation.WebhookValidator; import org.fireflyframework.webhooks.interfaces.dto.WebhookEventDTO; @@ -53,7 +53,7 @@ class WebhookGuardLoggingTest { @BeforeEach void capture() { events.start(); - for (Class type : List.of(WebhookValidator.class, WebhookRateLimitService.class, ResilientWebhookProcessingService.class)) { + for (Class type : List.of(WebhookValidator.class, WebhookRateLimitService.class, ResilientWebhookProcessingServiceImpl.class)) { var logger = (Logger) LoggerFactory.getLogger(type); levels.put(logger, logger.getLevel()); additive.put(logger, logger.isAdditive()); logger.setLevel(Level.DEBUG); logger.setAdditive(false); logger.addAppender(events); @@ -205,8 +205,8 @@ private static ServerHttpRequest request(String name, String value) { private static RateLimiterRegistry rateRegistry() { return RateLimiterRegistry.of(RateLimiterConfig.custom().limitForPeriod(1).limitRefreshPeriod(Duration.ofHours(1)).timeoutDuration(Duration.ZERO).build()); } - private static ResilientWebhookProcessingService resilient(WebhookProcessingService delegate) { - return new ResilientWebhookProcessingService(delegate, CircuitBreakerRegistry.ofDefaults(), TimeLimiterRegistry.ofDefaults()); + private static ResilientWebhookProcessingServiceImpl resilient(WebhookProcessingService delegate) { + return new ResilientWebhookProcessingServiceImpl(delegate, CircuitBreakerRegistry.ofDefaults(), TimeLimiterRegistry.ofDefaults()); } private static WebhookEventDTO dto(String provider) { return WebhookEventDTO.builder().eventId(UUID.randomUUID()).providerName(provider).payload(JsonNodeFactory.instance.objectNode().put("kind", "sandbox")).build(); diff --git a/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceLoggingTest.java b/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceLoggingTest.java index 1f45d7c48..12d96979b 100644 --- a/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceLoggingTest.java +++ b/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceLoggingTest.java @@ -31,8 +31,8 @@ class WebhookMetricsServiceLoggingTest { private final SimpleMeterRegistry registry = new SimpleMeterRegistry(); - private final WebhookMetricsService service = new WebhookMetricsService(registry); - private final Logger logger = (Logger) LoggerFactory.getLogger(WebhookMetricsService.class); + private final WebhookMetricsServiceImpl service = new WebhookMetricsServiceImpl(registry); + private final Logger logger = (Logger) LoggerFactory.getLogger(WebhookMetricsServiceImpl.class); private final ListAppender events = new ListAppender<>(); private Level previousLevel; private boolean previousAdditivity; @@ -86,7 +86,7 @@ void errorAndRejectionDiagnosticsEscapeTheirContextLabels() { @Test void ordinaryAndNullLabelsRetainDiagnosticTextAndLevel() { service.recordWebhookReceived("sandbox"); - new WebhookMetricsService(null).recordWebhookFailed(null, null); + new WebhookMetricsServiceImpl(null).recordWebhookFailed(null, null); assertEquals("Recorded webhook received for provider: sandbox", events.list.get(0).getFormattedMessage()); assertEquals("Recorded webhook failure for provider: null, error: null", events.list.get(1).getFormattedMessage()); assertTrue(events.list.stream().allMatch(event -> event.getLevel() == Level.DEBUG)); diff --git a/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceTest.java b/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceTest.java index 0ee35ce24..b563a4c7e 100644 --- a/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceTest.java +++ b/modules/webhooks/fireflyframework-webhooks-core/src/test/java/org/fireflyframework/webhooks/core/metrics/WebhookMetricsServiceTest.java @@ -32,13 +32,13 @@ @DisplayName("WebhookMetricsService Tests") class WebhookMetricsServiceTest { - private WebhookMetricsService metricsService; + private WebhookMetricsServiceImpl metricsService; private MeterRegistry meterRegistry; @BeforeEach void setUp() { meterRegistry = new SimpleMeterRegistry(); - metricsService = new WebhookMetricsService(meterRegistry); + metricsService = new WebhookMetricsServiceImpl(meterRegistry); } // ======================================== diff --git a/modules/webhooks/fireflyframework-webhooks-processor/README.md b/modules/webhooks/fireflyframework-webhooks-processor/README.md index 4260e28d5..903ebef0f 100644 --- a/modules/webhooks/fireflyframework-webhooks-processor/README.md +++ b/modules/webhooks/fireflyframework-webhooks-processor/README.md @@ -117,7 +117,7 @@ The host configures EDA, cache selection, provider beans, and secrets. Supply th | [`WebhookProcessingResult`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/model/WebhookProcessingResult.java) | Supplies `success`, `failed`, `retry`, and `skipped` result factories, status checks, metadata, and duration. | | [`WebhookSignatureValidator`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/port/WebhookSignatureValidator.java) | Provider-owned reactive verification contract; required verification defaults to `true`. | | [`WebhookIdempotencyService`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/port/WebhookIdempotencyService.java) | Lock acquisition, processed-record lookup/write, lock release, and optional failure recording. | -| [`CacheBasedWebhookIdempotencyService`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyService.java) | Implements duplicate tracking through `FireflyCacheManager`. | +| [`CacheBasedWebhookIdempotencyServiceImpl`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyServiceImpl.java) | Implements duplicate tracking through `FireflyCacheManagerImpl`. | | [`TracingContextExtractor`](https://github.com/fireflyframework/fireflyframework-jafly/blob/main/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/tracing/TracingContextExtractor.java) | Extracts tracing/correlation context from the event payload and headers. | ## Continue the application diff --git a/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/config/WebhookIdempotencyAutoConfiguration.java b/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/config/WebhookIdempotencyAutoConfiguration.java index 655994719..0709596e6 100644 --- a/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/config/WebhookIdempotencyAutoConfiguration.java +++ b/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/config/WebhookIdempotencyAutoConfiguration.java @@ -19,8 +19,8 @@ import org.fireflyframework.cache.config.CacheAutoConfiguration; import org.fireflyframework.cache.core.CacheType; import org.fireflyframework.cache.factory.CacheManagerFactory; -import org.fireflyframework.cache.manager.FireflyCacheManager; -import org.fireflyframework.webhooks.processor.idempotency.CacheBasedWebhookIdempotencyService; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; +import org.fireflyframework.webhooks.processor.idempotency.CacheBasedWebhookIdempotencyServiceImpl; import org.fireflyframework.webhooks.processor.port.WebhookIdempotencyService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Qualifier; @@ -61,7 +61,7 @@ */ @AutoConfiguration @AutoConfigureAfter(CacheAutoConfiguration.class) -@ConditionalOnClass({FireflyCacheManager.class, CacheManagerFactory.class}) +@ConditionalOnClass({FireflyCacheManagerImpl.class, CacheManagerFactory.class}) @Slf4j public class WebhookIdempotencyAutoConfiguration { @@ -88,7 +88,7 @@ public class WebhookIdempotencyAutoConfiguration { */ @Bean("webhookIdempotencyCacheManager") @ConditionalOnMissingBean(name = "webhookIdempotencyCacheManager") - public FireflyCacheManager webhookIdempotencyCacheManager(CacheManagerFactory factory) { + public FireflyCacheManagerImpl webhookIdempotencyCacheManager(CacheManagerFactory factory) { return factory.createCacheManager( "webhook-idempotency", CacheType.AUTO, @@ -112,7 +112,7 @@ public FireflyCacheManager webhookIdempotencyCacheManager(CacheManagerFactory fa @ConditionalOnBean(name = "webhookIdempotencyCacheManager") @ConditionalOnMissingBean(WebhookIdempotencyService.class) public WebhookIdempotencyService webhookIdempotencyService( - @Qualifier("webhookIdempotencyCacheManager") FireflyCacheManager cacheManager) { - return new CacheBasedWebhookIdempotencyService(cacheManager); + @Qualifier("webhookIdempotencyCacheManager") FireflyCacheManagerImpl cacheManager) { + return new CacheBasedWebhookIdempotencyServiceImpl(cacheManager); } } diff --git a/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyService.java b/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyServiceImpl.java similarity index 96% rename from modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyService.java rename to modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyServiceImpl.java index 54834868d..65fef6969 100644 --- a/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyService.java +++ b/modules/webhooks/fireflyframework-webhooks-processor/src/main/java/org/fireflyframework/webhooks/processor/idempotency/CacheBasedWebhookIdempotencyServiceImpl.java @@ -16,7 +16,7 @@ package org.fireflyframework.webhooks.processor.idempotency; -import org.fireflyframework.cache.manager.FireflyCacheManager; +import org.fireflyframework.cache.manager.FireflyCacheManagerImpl; import org.fireflyframework.webhooks.processor.port.WebhookIdempotencyService; import lombok.extern.slf4j.Slf4j; import reactor.core.publisher.Mono; @@ -53,9 +53,9 @@ * */ @Slf4j -public class CacheBasedWebhookIdempotencyService implements WebhookIdempotencyService { +public class CacheBasedWebhookIdempotencyServiceImpl implements WebhookIdempotencyService { - private final FireflyCacheManager cacheManager; + private final FireflyCacheManagerImpl cacheManager; // Key prefixes for different purposes private static final String PROCESSING_LOCK_PREFIX = "webhook:processing:"; @@ -71,7 +71,7 @@ public class CacheBasedWebhookIdempotencyService implements WebhookIdempotencySe * * @param cacheManager the Firefly cache manager (Redis or Caffeine) */ - public CacheBasedWebhookIdempotencyService(FireflyCacheManager cacheManager) { + public CacheBasedWebhookIdempotencyServiceImpl(FireflyCacheManagerImpl cacheManager) { this.cacheManager = cacheManager; } diff --git a/modules/webhooks/fireflyframework-webhooks-web/src/main/java/org/fireflyframework/webhooks/web/controllers/WebhookController.java b/modules/webhooks/fireflyframework-webhooks-web/src/main/java/org/fireflyframework/webhooks/web/controllers/WebhookController.java index d7b395a15..aa883d19a 100644 --- a/modules/webhooks/fireflyframework-webhooks-web/src/main/java/org/fireflyframework/webhooks/web/controllers/WebhookController.java +++ b/modules/webhooks/fireflyframework-webhooks-web/src/main/java/org/fireflyframework/webhooks/web/controllers/WebhookController.java @@ -23,7 +23,7 @@ import org.fireflyframework.webhooks.core.services.WebhookProcessingService; import org.fireflyframework.webhooks.interfaces.dto.WebhookEventDTO; import org.fireflyframework.webhooks.interfaces.dto.WebhookResponseDTO; -import org.fireflyframework.webhooks.core.metrics.WebhookMetricsService; +import org.fireflyframework.webhooks.core.metrics.WebhookMetricsServiceImpl; import org.fireflyframework.webhooks.core.validation.WebhookValidator; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; @@ -73,7 +73,7 @@ public class WebhookController { private final WebhookProcessingService webhookProcessingService; private final WebhookValidator webhookValidator; - private final WebhookMetricsService metricsService; + private final WebhookMetricsServiceImpl metricsService; private final org.fireflyframework.webhooks.core.ratelimit.WebhookRateLimitService rateLimitService; private final WebhookMetadataEnrichmentService metadataEnrichmentService; diff --git a/modules/webhooks/fireflyframework-webhooks-web/src/test/java/org/fireflyframework/webhooks/integration/WebhookIntegrationTestConfiguration.java b/modules/webhooks/fireflyframework-webhooks-web/src/test/java/org/fireflyframework/webhooks/integration/WebhookIntegrationTestConfiguration.java index 70ccb7bca..1554c9305 100644 --- a/modules/webhooks/fireflyframework-webhooks-web/src/test/java/org/fireflyframework/webhooks/integration/WebhookIntegrationTestConfiguration.java +++ b/modules/webhooks/fireflyframework-webhooks-web/src/test/java/org/fireflyframework/webhooks/integration/WebhookIntegrationTestConfiguration.java @@ -17,8 +17,8 @@ package org.fireflyframework.webhooks.integration; import com.fasterxml.jackson.databind.ObjectMapper; -import org.fireflyframework.eda.consumer.kafka.KafkaEventConsumer; -import org.fireflyframework.eda.listener.EventListenerProcessor; +import org.fireflyframework.eda.consumer.kafka.KafkaEventConsumerImpl; +import org.fireflyframework.eda.listener.EventListenerProcessorImpl; import org.fireflyframework.webhooks.integration.support.StripeSignatureValidator; import org.fireflyframework.webhooks.integration.support.TestStripeWebhookListener; import org.fireflyframework.webhooks.integration.support.TestStripeWebhookProcessor; @@ -70,7 +70,7 @@ public Object postProcessAfterInitialization(Object bean, String beanName) throw } // When EventListenerProcessor is created, manually initialize it - if (bean instanceof EventListenerProcessor processor) { + if (bean instanceof EventListenerProcessorImpl processor) { log.info("🔧 Manually initializing EventListenerProcessor for test configuration"); processor.initializeEventListeners(); log.info("✅ EventListenerProcessor initialized with {} topics", @@ -78,7 +78,7 @@ public Object postProcessAfterInitialization(Object bean, String beanName) throw } // After EventListenerProcessor is initialized, refresh KafkaEventConsumer topics - if (initialized && bean instanceof KafkaEventConsumer consumer) { + if (initialized && bean instanceof KafkaEventConsumerImpl consumer) { log.info("🔄 Refreshing KafkaEventConsumer topics after EventListenerProcessor initialization"); consumer.refreshTopics(); } diff --git a/modules/webhooks/fireflyframework-webhooks-web/src/test/java/org/fireflyframework/webhooks/web/controllers/WebhookControllerLoggingTest.java b/modules/webhooks/fireflyframework-webhooks-web/src/test/java/org/fireflyframework/webhooks/web/controllers/WebhookControllerLoggingTest.java index ce60d41e2..0f22c3b10 100644 --- a/modules/webhooks/fireflyframework-webhooks-web/src/test/java/org/fireflyframework/webhooks/web/controllers/WebhookControllerLoggingTest.java +++ b/modules/webhooks/fireflyframework-webhooks-web/src/test/java/org/fireflyframework/webhooks/web/controllers/WebhookControllerLoggingTest.java @@ -11,7 +11,7 @@ import ch.qos.logback.classic.spi.ThrowableProxy; import ch.qos.logback.core.read.ListAppender; import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import org.fireflyframework.webhooks.core.metrics.WebhookMetricsService; +import org.fireflyframework.webhooks.core.metrics.WebhookMetricsServiceImpl; import org.fireflyframework.webhooks.core.ratelimit.WebhookRateLimitService; import org.fireflyframework.webhooks.core.services.WebhookMetadataEnrichmentService; import org.fireflyframework.webhooks.core.services.WebhookProcessingService; @@ -99,7 +99,7 @@ private void assertSingleLine() { private static final class Fixture { final WebhookProcessingService processing=mock(WebhookProcessingService.class); final WebhookValidator validator=mock(WebhookValidator.class); - final WebhookMetricsService metrics=mock(WebhookMetricsService.class); + final WebhookMetricsServiceImpl metrics=mock(WebhookMetricsServiceImpl.class); final WebhookRateLimitService limits=mock(WebhookRateLimitService.class); final WebhookMetadataEnrichmentService enrichment=mock(WebhookMetadataEnrichmentService.class); final WebhookController controller=new WebhookController(processing,validator,metrics,limits,enrichment); diff --git a/scripts/verify_migration.py b/scripts/verify_migration.py index 20d80c607..0ee111100 100644 --- a/scripts/verify_migration.py +++ b/scripts/verify_migration.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 """Prove exact source imports and continued preservation of original files and refs.""" import json +import re from pathlib import Path import subprocess @@ -11,6 +12,29 @@ def git(*args): return subprocess.check_output(['git', '-C', str(ROOT), *args]).decode().strip() + +def source_path_renames(): + manifest = ROOT / 'docs/migration/source-path-renames.json' + paths = json.loads(manifest.read_text())['paths'] + if not isinstance(paths, dict) or len(set(paths.values())) != len(paths): + raise ValueError('Source path renames must have unique targets') + for before, after in paths.items(): + if not isinstance(before, str) or not isinstance(after, str): + raise ValueError('Source path rename strings required') + original, target = Path(before), Path(after) + if (original.is_absolute() or target.is_absolute() or '..' in original.parts or '..' in target.parts + or original.parts[:1] != ('modules',) or original.suffix != '.java' + or original.parent != target.parent or target.name != original.stem + 'Impl.java'): + raise ValueError('Only explicit same-directory implementation renames are supported') + current = ROOT / target + if ((ROOT / original).exists() or (ROOT / original).is_symlink() + or not current.is_file() or current.is_symlink() + or not current.resolve().is_relative_to(ROOT.resolve())): + raise ValueError('Source rename target is missing, aliased or duplicated') + if re.search(r'\bclass\s+' + re.escape(target.stem) + r'\b', current.read_text()) is None: + raise ValueError('Source rename target declaration differs') + return paths + def verify(): sources = json.loads((ROOT / 'docs/migration/source-manifest.json').read_text())['sources'] if len(sources) != 63 or len({s['repository'] for s in sources}) != 63: @@ -19,6 +43,7 @@ def verify(): excluded = set(json.loads((ROOT / 'docs/migration/generated-output-exclusions.json').read_text())['paths']) if any('target' not in Path(p).parts for p in excluded): raise ValueError('Only original Maven build outputs can be excluded') + renames = source_path_renames() file_count = 0 for source in sources: imported = source['import_commit'] + ':' + source['destination'] @@ -37,8 +62,9 @@ def verify(): if not entry: continue metadata, name = entry.split(b'\t', 1) - path = ROOT / source['destination'] / name.decode() - if str(path.relative_to(ROOT)) in excluded: + relative = str(Path(source['destination']) / name.decode()) + path = ROOT / renames.get(relative, relative) + if relative in excluded: continue if not path.exists() and not path.is_symlink(): raise ValueError('Original source path is missing: ' + str(path.relative_to(ROOT))) diff --git a/tests/test_source_path_renames.py b/tests/test_source_path_renames.py new file mode 100644 index 000000000..351f1364f --- /dev/null +++ b/tests/test_source_path_renames.py @@ -0,0 +1,68 @@ +import importlib.util +import json +from pathlib import Path +import tempfile +import unittest +from unittest.mock import patch + +ROOT = Path(__file__).resolve().parents[1] +spec = importlib.util.spec_from_file_location("migration_path_verifier", ROOT / "scripts/verify_migration.py") +verifier = importlib.util.module_from_spec(spec) +spec.loader.exec_module(verifier) + + +class SourcePathRenameTest(unittest.TestCase): + def fixture(self, root, entries): + path = root / "docs/migration/source-path-renames.json" + path.parent.mkdir(parents=True) + path.write_text(json.dumps({"paths": entries})) + + def target(self, root, name="ServiceImpl"): + path = root / ("modules/test/src/main/java/example/" + name + ".java") + path.parent.mkdir(parents=True, exist_ok=True) + path.write_text("package example; public class " + name + " {}") + return path + + def test_explicit_same_directory_implementation_rename_is_preserved(self): + with tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + target = self.target(root) + old = "modules/test/src/main/java/example/Service.java" + self.fixture(root, {old: target.relative_to(root).as_posix()}) + with patch.object(verifier, "ROOT", root): + self.assertEqual({old: target.relative_to(root).as_posix()}, verifier.source_path_renames()) + + def test_external_or_wrong_name_target_cannot_replace_preserved_source(self): + for target in ["../ServiceImpl.java", "/tmp/ServiceImpl.java", "modules/test/src/main/java/example/Other.java"]: + with self.subTest(target=target), tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + self.target(root) + self.fixture(root, {"modules/test/src/main/java/example/Service.java": target}) + with patch.object(verifier, "ROOT", root), self.assertRaises(ValueError): + verifier.source_path_renames() + + def test_missing_or_symbolic_target_does_not_preserve_source(self): + for symlink in [False, True]: + with self.subTest(symlink=symlink), tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + target = root / "modules/test/src/main/java/example/ServiceImpl.java" + if symlink: + actual = self.target(root, "Actual") + target.symlink_to(actual) + self.fixture(root, {"modules/test/src/main/java/example/Service.java": target.relative_to(root).as_posix()}) + with patch.object(verifier, "ROOT", root), self.assertRaises(ValueError): + verifier.source_path_renames() + + def test_present_old_path_or_wrong_declaration_is_not_an_intentional_rename(self): + for present_old in [False, True]: + with self.subTest(present_old=present_old), tempfile.TemporaryDirectory() as tmp: + root = Path(tmp) + target = self.target(root) + old = target.with_name("Service.java") + if present_old: + old.write_text("package example; public class Service {}") + else: + target.write_text("package example; public class Different {}") + self.fixture(root, {old.relative_to(root).as_posix(): target.relative_to(root).as_posix()}) + with patch.object(verifier, "ROOT", root), self.assertRaises(ValueError): + verifier.source_path_renames() From eadf7d59f357d41a5300e1ea2162b2fdab2eb576 Mon Sep 17 00:00:00 2001 From: Andres Contreras Date: Sat, 31 Oct 2026 22:27:49 -0700 Subject: [PATCH 2/2] Preserve RabbitMQ wiring and complete implementation suffixes --- docs/migration/source-path-renames.json | 1 + .../client/ManagedDocuSignApiClientImpl.java | 6 +- .../rabbitmq/RabbitMqEventConsumerImpl.java | 2 +- .../rabbitmq/RabbitMqEventPublisherImpl.java | 2 +- .../eda/config/RabbitMqBeanNamingTest.java | 75 +++++++++++++++++++ .../serialization/avro/DeclaredAvroData.java | 12 +-- .../SpringLiveTokenValidationAdapterImpl.java | 4 +- ...ssDomainEnvironmentPostProcessorImpl.java} | 2 +- .../main/resources/META-INF/spring.factories | 2 +- .../PostgresCacheArchitectureContextTest.java | 4 +- .../RestrictedHtmlTemplateRenderer.java | 6 +- .../logging/service/StdoutMaskingService.java | 8 +- 12 files changed, 100 insertions(+), 24 deletions(-) create mode 100644 modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/config/RabbitMqBeanNamingTest.java rename modules/starter-domain/src/main/java/org/fireflyframework/domain/config/{StatelessDomainEnvironmentPostProcessor.java => StatelessDomainEnvironmentPostProcessorImpl.java} (93%) diff --git a/docs/migration/source-path-renames.json b/docs/migration/source-path-renames.json index 9bb2e5f93..a6cb74f0f 100644 --- a/docs/migration/source-path-renames.json +++ b/docs/migration/source-path-renames.json @@ -223,6 +223,7 @@ "modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/RangeRule.java": "modules/starter-data/src/main/java/org/fireflyframework/data/quality/rules/RangeRuleImpl.java", "modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformer.java": "modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/ComputedFieldTransformerImpl.java", "modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformer.java": "modules/starter-data/src/main/java/org/fireflyframework/data/transform/transformers/FieldMappingTransformerImpl.java", + "modules/starter-domain/src/main/java/org/fireflyframework/domain/config/StatelessDomainEnvironmentPostProcessor.java": "modules/starter-domain/src/main/java/org/fireflyframework/domain/config/StatelessDomainEnvironmentPostProcessorImpl.java", "modules/validators/src/main/java/org/fireflyframework/validators/AccountNumberValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/AccountNumberValidatorImpl.java", "modules/validators/src/main/java/org/fireflyframework/validators/AmountValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/AmountValidatorImpl.java", "modules/validators/src/main/java/org/fireflyframework/validators/BicValidator.java": "modules/validators/src/main/java/org/fireflyframework/validators/BicValidatorImpl.java", diff --git a/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClientImpl.java b/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClientImpl.java index 4658c958a..33e4ff239 100644 --- a/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClientImpl.java +++ b/modules/ecm-esignature-docusign/src/main/java/org/fireflyframework/ecm/adapter/docusign/client/ManagedDocuSignApiClientImpl.java @@ -73,7 +73,7 @@ public ManagedDocuSignApiClientImpl(DocuSignClientSettings settings, Clock clock settings.maxQueuedRequestsPerThread(), "firefly-docusign", 60, true); DocuSignAuthentication authentication = new JwtDocuSignAuthenticationImpl(this, settings, java.util.Objects.requireNonNull(clock), System::nanoTime); - addAuthorization("docusignAccessCode", new ManagedOAuth(authentication)); + addAuthorization("docusignAccessCode", new ManagedOAuthImpl(authentication)); } @Override protected Client buildHttpClient(boolean debugging) { @@ -319,9 +319,9 @@ synchronized void check() { synchronized void publish(Runnable publication) { check(); publication.run(); } } - private static final class ManagedOAuth extends OAuth { + private static final class ManagedOAuthImpl extends OAuth { private final DocuSignAuthentication authentication; - ManagedOAuth(DocuSignAuthentication authentication) { this.authentication = authentication; } + ManagedOAuthImpl(DocuSignAuthentication authentication) { this.authentication = authentication; } @Override public void applyToParams(List queryParams, Map headerParams) { // The SDK's default OAuth implementation swallows refresh failures; never delegate to it here. headerParams.put("Authorization", "Bearer " + authentication.accessToken()); diff --git a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumerImpl.java b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumerImpl.java index 8e88ae159..01894cb8b 100644 --- a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumerImpl.java +++ b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/consumer/rabbitmq/RabbitMqEventConsumerImpl.java @@ -67,7 +67,7 @@ *
  • Proper message acknowledgment
  • * */ -@Component +@Component("rabbitMqEventConsumer") @ConditionalOnClass({SimpleMessageListenerContainer.class, ConnectionFactory.class}) @org.springframework.boot.autoconfigure.condition.ConditionalOnBean(name = "fireflyEdaRabbitConsumerConnectionFactory") @org.springframework.boot.autoconfigure.condition.ConditionalOnProperty(prefix = "firefly.eda.consumer", name = "enabled", havingValue = "true") diff --git a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisherImpl.java b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisherImpl.java index 68b2bad71..cea52747a 100644 --- a/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisherImpl.java +++ b/modules/eda-rabbitmq/src/main/java/org/fireflyframework/eda/publisher/rabbitmq/RabbitMqEventPublisherImpl.java @@ -50,7 +50,7 @@ *
  • Exchange and routing key support
  • * */ -@Component +@Component("rabbitMqEventPublisher") @ConditionalOnClass({AmqpTemplate.class, ConnectionFactory.class}) @ConditionalOnBean(name = "fireflyEdaRabbitTemplate") @Slf4j diff --git a/modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/config/RabbitMqBeanNamingTest.java b/modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/config/RabbitMqBeanNamingTest.java new file mode 100644 index 000000000..22f45c714 --- /dev/null +++ b/modules/eda-rabbitmq/src/test/java/org/fireflyframework/eda/config/RabbitMqBeanNamingTest.java @@ -0,0 +1,75 @@ +/* + * Copyright 2024-2026 Firefly Software Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.fireflyframework.eda.config; + +import org.fireflyframework.eda.consumer.EventConsumer; +import org.fireflyframework.eda.consumer.rabbitmq.RabbitMqEventConsumerImpl; +import org.fireflyframework.eda.publisher.EventPublisher; +import org.fireflyframework.eda.publisher.rabbitmq.RabbitMqEventPublisherImpl; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.AnnotatedGenericBeanDefinition; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.support.RootBeanDefinition; +import org.springframework.context.annotation.AnnotationBeanNameGenerator; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; + +class RabbitMqBeanNamingTest { + private String name(Class type, AnnotationConfigApplicationContext context) { + return AnnotationBeanNameGenerator.INSTANCE.generateBeanName(new AnnotatedGenericBeanDefinition(type), context); + } + + @Test + void originalComponentNamesRemainStable() { + try (var context = new AnnotationConfigApplicationContext()) { + assertThat(name(RabbitMqEventConsumerImpl.class, context)).isEqualTo("rabbitMqEventConsumer"); + assertThat(name(RabbitMqEventPublisherImpl.class, context)).isEqualTo("rabbitMqEventPublisher"); + } + } + + @Test + void originalQualifiersResolveTheNamedComponentsWithoutBroker() { + try (var context = new AnnotationConfigApplicationContext()) { + var consumer = mock(RabbitMqEventConsumerImpl.class); + var publisher = mock(RabbitMqEventPublisherImpl.class); + // Supplied SPI instances isolate qualifier resolution from broker-dependent component conditions. + var consumerDefinition = new RootBeanDefinition(EventConsumer.class); + consumerDefinition.setInstanceSupplier(() -> consumer); + var publisherDefinition = new RootBeanDefinition(EventPublisher.class); + publisherDefinition.setInstanceSupplier(() -> publisher); + context.registerBeanDefinition(name(RabbitMqEventConsumerImpl.class, context), consumerDefinition); + context.registerBeanDefinition(name(RabbitMqEventPublisherImpl.class, context), publisherDefinition); + context.registerBean(RequiredEndpoints.class); + context.refresh(); + var endpoints = context.getBean(RequiredEndpoints.class); + assertThat(endpoints.consumer).isSameAs(consumer); + assertThat(endpoints.publisher).isSameAs(publisher); + } + } + + static final class RequiredEndpoints { + final EventConsumer consumer; + final EventPublisher publisher; + RequiredEndpoints(@Qualifier("rabbitMqEventConsumer") EventConsumer consumer, + @Qualifier("rabbitMqEventPublisher") EventPublisher publisher) { + this.consumer = consumer; + this.publisher = publisher; + } + } +} diff --git a/modules/eda/src/main/java/org/fireflyframework/eda/serialization/avro/DeclaredAvroData.java b/modules/eda/src/main/java/org/fireflyframework/eda/serialization/avro/DeclaredAvroData.java index 02d548f8e..75a67d4d5 100644 --- a/modules/eda/src/main/java/org/fireflyframework/eda/serialization/avro/DeclaredAvroData.java +++ b/modules/eda/src/main/java/org/fireflyframework/eda/serialization/avro/DeclaredAvroData.java @@ -29,13 +29,13 @@ public final class DeclaredAvroData { private DeclaredAvroData() { } - public static ReflectData reflection(DeclaredAvroTypes types) { return new Reflection(types); } - public static SpecificData specific(DeclaredAvroTypes types) { return new Specific(types); } + public static ReflectData reflection(DeclaredAvroTypes types) { return new ReflectionImpl(types); } + public static SpecificData specific(DeclaredAvroTypes types) { return new SpecificImpl(types); } - private static final class Reflection extends ReflectData { + private static final class ReflectionImpl extends ReflectData { private final DeclaredAvroTypes types; private final Map recursive = new HashMap<>(); - Reflection(DeclaredAvroTypes types) { + ReflectionImpl(DeclaredAvroTypes types) { this.types = types; addLogicalTypeConversions(this); setFastReaderEnabled(false); @@ -61,9 +61,9 @@ private static final class Reflection extends ReflectData { } } - private static final class Specific extends SpecificData { + private static final class SpecificImpl extends SpecificData { private final DeclaredAvroTypes types; - Specific(DeclaredAvroTypes types) { + SpecificImpl(DeclaredAvroTypes types) { this.types = types; addLogicalTypeConversions(this); setFastReaderEnabled(false); diff --git a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapterImpl.java b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapterImpl.java index ef399967d..cc425df98 100644 --- a/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapterImpl.java +++ b/modules/security-resource-server/src/main/java/org/fireflyframework/security/rs/SpringLiveTokenValidationAdapterImpl.java @@ -172,11 +172,11 @@ static WebClient.Builder ownedWebClientBuilder(ClientHttpConnector connector, St } static JacksonJsonDecoder nativeJsonDecoder() { - return new QuietJacksonJsonDecoder(); + return new QuietJacksonJsonDecoderImpl(); } /** The native codec honors this public hint before rendering decoded identity attributes. */ - private static final class QuietJacksonJsonDecoder extends JacksonJsonDecoder { + private static final class QuietJacksonJsonDecoderImpl extends JacksonJsonDecoder { @Override public Flux decode(Publisher input, ResolvableType type, MimeType mimeType, Map hints) { diff --git a/modules/starter-domain/src/main/java/org/fireflyframework/domain/config/StatelessDomainEnvironmentPostProcessor.java b/modules/starter-domain/src/main/java/org/fireflyframework/domain/config/StatelessDomainEnvironmentPostProcessorImpl.java similarity index 93% rename from modules/starter-domain/src/main/java/org/fireflyframework/domain/config/StatelessDomainEnvironmentPostProcessor.java rename to modules/starter-domain/src/main/java/org/fireflyframework/domain/config/StatelessDomainEnvironmentPostProcessorImpl.java index ec3b82c29..35d3a4d30 100644 --- a/modules/starter-domain/src/main/java/org/fireflyframework/domain/config/StatelessDomainEnvironmentPostProcessor.java +++ b/modules/starter-domain/src/main/java/org/fireflyframework/domain/config/StatelessDomainEnvironmentPostProcessorImpl.java @@ -13,7 +13,7 @@ import java.util.Map; /** Keeps business persistence out of this stateless application role. */ -public final class StatelessDomainEnvironmentPostProcessor implements EnvironmentPostProcessor, Ordered { +public final class StatelessDomainEnvironmentPostProcessorImpl implements EnvironmentPostProcessor, Ordered { @Override public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) { var excludes = new LinkedHashSet<>(Binder.get(environment) diff --git a/modules/starter-domain/src/main/resources/META-INF/spring.factories b/modules/starter-domain/src/main/resources/META-INF/spring.factories index 0fb9005ec..dc029932e 100644 --- a/modules/starter-domain/src/main/resources/META-INF/spring.factories +++ b/modules/starter-domain/src/main/resources/META-INF/spring.factories @@ -1 +1 @@ -org.springframework.boot.EnvironmentPostProcessor=org.fireflyframework.domain.config.StatelessDomainEnvironmentPostProcessor +org.springframework.boot.EnvironmentPostProcessor=org.fireflyframework.domain.config.StatelessDomainEnvironmentPostProcessorImpl diff --git a/modules/starter-domain/src/test/java/org/fireflyframework/domain/config/PostgresCacheArchitectureContextTest.java b/modules/starter-domain/src/test/java/org/fireflyframework/domain/config/PostgresCacheArchitectureContextTest.java index 0d55929e2..80ce85101 100644 --- a/modules/starter-domain/src/test/java/org/fireflyframework/domain/config/PostgresCacheArchitectureContextTest.java +++ b/modules/starter-domain/src/test/java/org/fireflyframework/domain/config/PostgresCacheArchitectureContextTest.java @@ -60,7 +60,7 @@ ConnectionFactory technicalCacheFactory() { void statelessRole() { context.withInitializer(application -> { - String expected = "org.fireflyframework.domain.config.StatelessDomainEnvironmentPostProcessor"; + String expected = "org.fireflyframework.domain.config.StatelessDomainEnvironmentPostProcessorImpl"; boolean registered = false; try { var resources = getClass().getClassLoader().getResources("META-INF/spring.factories"); @@ -74,7 +74,7 @@ void statelessRole() { throw new IllegalStateException("Cannot read starter registration", error); } assertThat(registered).as("actual starter EnvironmentPostProcessor registration").isTrue(); - new StatelessDomainEnvironmentPostProcessor().postProcessEnvironment(application.getEnvironment(), new SpringApplication()); + new StatelessDomainEnvironmentPostProcessorImpl().postProcessEnvironment(application.getEnvironment(), new SpringApplication()); }).withPropertyValues("spring.autoconfigure.exclude=org.springframework.boot.jdbc.autoconfigure.DataSourceAutoConfiguration") .run(application -> { assertThat(application).hasNotFailed(); diff --git a/modules/utils/src/main/java/org/fireflyframework/utils/template/RestrictedHtmlTemplateRenderer.java b/modules/utils/src/main/java/org/fireflyframework/utils/template/RestrictedHtmlTemplateRenderer.java index fd49602ae..e2194538f 100644 --- a/modules/utils/src/main/java/org/fireflyframework/utils/template/RestrictedHtmlTemplateRenderer.java +++ b/modules/utils/src/main/java/org/fireflyframework/utils/template/RestrictedHtmlTemplateRenderer.java @@ -106,7 +106,7 @@ public RestrictedTemplateResult render(String source, Map model) { Object copied = copy(model, 0, budget); if (!(copied instanceof Map)) return failure("UNSUPPORTED_MODEL"); var template = new Template("restricted-published-template", new StringReader(source), configuration); - var writer = new BoundedWriter(limits.outputBytes()); + var writer = new BoundedWriterImpl(limits.outputBytes()); Environment environment = template.createProcessingEnvironment(copied, writer); environment.setTemplateProcessingTracer(budget); environment.process(); @@ -230,12 +230,12 @@ public void enterElement(Environment environment, TracedElement element) { public void exitElement(Environment environment, TracedElement element) { depth--; } } - private static final class BoundedWriter extends Writer { + private static final class BoundedWriterImpl extends Writer { private final int limit; private final StringBuilder text = new StringBuilder(); private int bytes; private boolean high; - BoundedWriter(int limit) { this.limit = limit; } + BoundedWriterImpl(int limit) { this.limit = limit; } @Override public void write(char[] value, int offset, int length) { for (int i = offset; i < offset + length; i++) { char character = value[i]; diff --git a/modules/web/src/main/java/org/fireflyframework/web/logging/service/StdoutMaskingService.java b/modules/web/src/main/java/org/fireflyframework/web/logging/service/StdoutMaskingService.java index 8de3cf725..4b8cc4e48 100644 --- a/modules/web/src/main/java/org/fireflyframework/web/logging/service/StdoutMaskingService.java +++ b/modules/web/src/main/java/org/fireflyframework/web/logging/service/StdoutMaskingService.java @@ -33,7 +33,7 @@ public class StdoutMaskingService { private final PiiMaskingService piiMaskingService; private final PrintStream originalOut; private final AtomicBoolean maskingEnabled = new AtomicBoolean(true); - private MaskingPrintStream maskingPrintStream; + private MaskingPrintStreamImpl maskingPrintStream; public StdoutMaskingService(PiiMaskingService piiMaskingService) { this.piiMaskingService = piiMaskingService; @@ -45,7 +45,7 @@ public StdoutMaskingService(PiiMaskingService piiMaskingService) { */ public void enableStdoutMasking() { if (piiMaskingService != null && piiMaskingService.isReady()) { - maskingPrintStream = new MaskingPrintStream(originalOut, piiMaskingService, maskingEnabled); + maskingPrintStream = new MaskingPrintStreamImpl(originalOut, piiMaskingService, maskingEnabled); System.setOut(maskingPrintStream); } } @@ -85,12 +85,12 @@ public boolean isMaskingActive() { /** * A PrintStream wrapper that applies PII masking to output. */ - private static class MaskingPrintStream extends PrintStream { + private static class MaskingPrintStreamImpl extends PrintStream { private final PrintStream originalStream; private final PiiMaskingService piiMaskingService; private final AtomicBoolean maskingEnabled; - public MaskingPrintStream(PrintStream originalStream, PiiMaskingService piiMaskingService, + public MaskingPrintStreamImpl(PrintStream originalStream, PiiMaskingService piiMaskingService, AtomicBoolean maskingEnabled) { super(originalStream, true); this.originalStream = originalStream;