From 605523ec302565b3e5839d36d8119f52c643f168 Mon Sep 17 00:00:00 2001
From: Pavel Vetokhin
Date: Sat, 21 Oct 2023 16:15:39 +0300
Subject: [PATCH] Message config models
---
.../smecalculus/bezmen/construction/App.java | 6 ++--
.../bezmen/core/SepulkaServiceImpl.java | 8 ++---
.../bezmen/messaging/SepulkaClientImpl.java | 4 +--
.../springmvc/SepulkaController.java | 4 +--
.../bezmen/storage/SepulkaDao.java | 9 +++---
.../bezmen/storage/SepulkaDaoMyBatis.java | 8 ++---
.../bezmen/storage/SepulkaDaoSpringData.java | 14 ++++----
.../bezmen/storage/SepulkaStateMapper.java | 14 ++++----
.../storage/{EdgeSide.java => StateEdge.java} | 3 +-
.../storage/mybatis/SepulkaSqlMapper.java | 8 ++---
.../storage/springdata/SepulkaRepository.java | 4 +--
.../bezmen/construction/SepulkaDaoBeans.java | 2 +-
.../construction/StoragePropsBeans.java | 16 +++++-----
.../bezmen/messaging/SepulkaClientIT.java | 10 +++---
.../bezmen/storage/SepulkaDaoIT.java | 14 ++++----
.../{EdgeSide.java => MessageEdge.java} | 3 +-
.../{EdgeSideEg.java => MessageEdgeEg.java} | 11 +++----
.../bezmen/messaging/SepulkaClient.java | 4 +--
.../{ClientSide.java => MessageDomain.java} | 3 +-
...ClientSideEg.java => MessageDomainEg.java} | 4 +--
.../bezmen/core/SepulkaMapper.java | 6 ++--
.../bezmen/core/SepulkaService.java | 8 ++---
.../{ServerSide.java => StateDomain.java} | 2 +-
.../{ServerSideEg.java => StateDomainEg.java} | 10 +++---
.../messaging/BezmenClientJavaHttp.java | 6 ++--
.../configuration/MessageMappingProps.java | 8 -----
.../MessageMappingPropsEdge.java | 15 ---------
.../configuration/MessageMappingPropsEg.java | 11 -------
.../bezmen/configuration/MessagingDomain.java | 17 ++++++++++
.../configuration/MessagingDomainEg.java | 25 +++++++++++++++
.../bezmen/configuration/MessagingEdge.java | 32 +++++++++++++++++++
.../bezmen/configuration/MessagingEdgeEg.java | 3 ++
...ingMode.java => MessagingMappingMode.java} | 2 +-
.../bezmen/configuration/MessagingProps.java | 8 -----
.../configuration/MessagingPropsEdge.java | 14 --------
.../configuration/MessagingPropsEg.java | 14 --------
.../configuration/MessagingPropsMapper.java | 11 +++----
.../configuration/MessagingProtocolProps.java | 8 -----
.../MessagingProtocolPropsEdge.java | 15 ---------
.../MessagingProtocolPropsEg.java | 13 --------
.../ConditionalOnMessageMappingModes.java | 4 +--
.../MappingSpringJmxManagementBeans.java | 4 +--
.../MappingSpringWebManagementBeans.java | 4 +--
.../MappingSpringWebMvcBeans.java | 4 +--
.../MessageMappingModeCondition.java | 6 ++--
.../construction/MessagingConfigBeans.java | 8 ++---
.../MessagingProtocolModeCondition.java | 2 +-
.../messaging/SepulkaMessageMapper.java | 6 ++--
.../construction/MessagingConfigBeansIT.java | 4 +--
.../bezmen/configuration/EdgeSideEg.java | 30 -----------------
.../{ServerSide.java => StorageDomain.java} | 9 +++---
...ServerSideEg.java => StorageDomainEg.java} | 28 ++++++++--------
.../{EdgeSide.java => StorageEdge.java} | 18 ++++-------
.../bezmen/configuration/StorageEdgeEg.java | 29 +++++++++++++++++
...ppingMode.java => StorageMappingMode.java} | 2 +-
.../configuration/StoragePropsMapper.java | 11 +++----
.../ConditionalOnStateMappingMode.java | 4 +--
.../construction/MappingMyBatisBeans.java | 2 +-
.../construction/MappingSpringDataBeans.java | 4 +--
.../StateMappingModeCondition.java | 6 ++--
.../bezmen/construction/StorageBeans.java | 6 ++--
.../construction/StorageConfigBeans.java | 6 ++--
.../construction/StorageConfigBeansIT.java | 4 +--
.../construction/StorageConfigBeansTest.java | 4 +--
.../messaging/SepulkaClientSpringWebTest.java | 4 +--
.../bezmen/registration/SepulkaTest.java | 6 ++--
66 files changed, 274 insertions(+), 318 deletions(-)
rename apps/sepuling/src/main/java/smecalculus/bezmen/storage/{EdgeSide.java => StateEdge.java} (97%)
rename libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/{EdgeSide.java => MessageEdge.java} (92%)
rename libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/{EdgeSideEg.java => MessageEdgeEg.java} (71%)
rename libs/abstraction/src/main/java/smecalculus/bezmen/core/{ClientSide.java => MessageDomain.java} (93%)
rename libs/abstraction/src/main/java/smecalculus/bezmen/core/{ClientSideEg.java => MessageDomainEg.java} (79%)
rename libs/abstraction/src/main/java/smecalculus/bezmen/core/{ServerSide.java => StateDomain.java} (96%)
rename libs/abstraction/src/main/java/smecalculus/bezmen/core/{ServerSideEg.java => StateDomainEg.java} (79%)
delete mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingProps.java
delete mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsEdge.java
delete mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsEg.java
create mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomain.java
create mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomainEg.java
create mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingEdge.java
create mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingEdgeEg.java
rename libs/messaging/src/main/java/smecalculus/bezmen/configuration/{MessageMappingMode.java => MessagingMappingMode.java} (70%)
delete mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProps.java
delete mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsEdge.java
delete mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsEg.java
delete mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolProps.java
delete mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsEdge.java
delete mode 100644 libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsEg.java
delete mode 100644 libs/storage/src/main/java/smecalculus/bezmen/configuration/EdgeSideEg.java
rename libs/storage/src/main/java/smecalculus/bezmen/configuration/{ServerSide.java => StorageDomain.java} (65%)
rename libs/storage/src/main/java/smecalculus/bezmen/configuration/{ServerSideEg.java => StorageDomainEg.java} (53%)
rename libs/storage/src/main/java/smecalculus/bezmen/configuration/{EdgeSide.java => StorageEdge.java} (79%)
create mode 100644 libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageEdgeEg.java
rename libs/storage/src/main/java/smecalculus/bezmen/configuration/{StateMappingMode.java => StorageMappingMode.java} (69%)
diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java b/apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java
index 1955d18b..bf947a96 100644
--- a/apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java
+++ b/apps/sepuling/src/main/java/smecalculus/bezmen/construction/App.java
@@ -1,8 +1,8 @@
package smecalculus.bezmen.construction;
-import static smecalculus.bezmen.configuration.MessageMappingMode.SPRING_MVC;
-import static smecalculus.bezmen.configuration.StateMappingMode.MY_BATIS;
-import static smecalculus.bezmen.configuration.StateMappingMode.SPRING_DATA;
+import static smecalculus.bezmen.configuration.MessagingMappingMode.SPRING_MVC;
+import static smecalculus.bezmen.configuration.StorageMappingMode.MY_BATIS;
+import static smecalculus.bezmen.configuration.StorageMappingMode.SPRING_DATA;
import org.springframework.boot.SpringApplication;
import org.springframework.context.annotation.Bean;
diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java b/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java
index 7eb3e05b..e5c20ad0 100644
--- a/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java
+++ b/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java
@@ -7,10 +7,10 @@
import java.util.List;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
-import smecalculus.bezmen.core.ClientSide.PreviewRequest;
-import smecalculus.bezmen.core.ClientSide.PreviewResponse;
-import smecalculus.bezmen.core.ClientSide.RegistrationRequest;
-import smecalculus.bezmen.core.ClientSide.RegistrationResponse;
+import smecalculus.bezmen.core.MessageDomain.PreviewRequest;
+import smecalculus.bezmen.core.MessageDomain.PreviewResponse;
+import smecalculus.bezmen.core.MessageDomain.RegistrationRequest;
+import smecalculus.bezmen.core.MessageDomain.RegistrationResponse;
import smecalculus.bezmen.storage.SepulkaDao;
@RequiredArgsConstructor
diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java
index 9dba0f6d..399b8d92 100644
--- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java
+++ b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/SepulkaClientImpl.java
@@ -3,8 +3,8 @@
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
import smecalculus.bezmen.core.SepulkaService;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationRequest;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationResponse;
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationRequest;
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationResponse;
import smecalculus.bezmen.validation.EdgeValidator;
@RequiredArgsConstructor
diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/springmvc/SepulkaController.java b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/springmvc/SepulkaController.java
index 42435b47..308b30ce 100644
--- a/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/springmvc/SepulkaController.java
+++ b/apps/sepuling/src/main/java/smecalculus/bezmen/messaging/springmvc/SepulkaController.java
@@ -8,8 +8,8 @@
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationRequest;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationResponse;
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationRequest;
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationResponse;
import smecalculus.bezmen.messaging.SepulkaClient;
@RestController
diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDao.java b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDao.java
index 18bbacf5..adfb78e5 100644
--- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDao.java
+++ b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDao.java
@@ -2,16 +2,15 @@
import java.util.Optional;
import java.util.UUID;
-import smecalculus.bezmen.core.ServerSide.AggregateState;
-import smecalculus.bezmen.core.ServerSide.ExistenceState;
-import smecalculus.bezmen.core.ServerSide.PreviewState;
-import smecalculus.bezmen.core.ServerSide.TouchState;
+import smecalculus.bezmen.core.StateDomain.AggregateState;
+import smecalculus.bezmen.core.StateDomain.ExistenceState;
+import smecalculus.bezmen.core.StateDomain.PreviewState;
+import smecalculus.bezmen.core.StateDomain.TouchState;
/**
* Port: server side
*/
public interface SepulkaDao {
-
AggregateState add(AggregateState state);
Optional getBy(String externalId);
diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoMyBatis.java b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoMyBatis.java
index 123462be..2e5ab0fa 100644
--- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoMyBatis.java
+++ b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoMyBatis.java
@@ -4,10 +4,10 @@
import java.util.UUID;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
-import smecalculus.bezmen.core.ServerSide.AggregateState;
-import smecalculus.bezmen.core.ServerSide.ExistenceState;
-import smecalculus.bezmen.core.ServerSide.PreviewState;
-import smecalculus.bezmen.core.ServerSide.TouchState;
+import smecalculus.bezmen.core.StateDomain.AggregateState;
+import smecalculus.bezmen.core.StateDomain.ExistenceState;
+import smecalculus.bezmen.core.StateDomain.PreviewState;
+import smecalculus.bezmen.core.StateDomain.TouchState;
import smecalculus.bezmen.storage.mybatis.SepulkaSqlMapper;
@RequiredArgsConstructor
diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoSpringData.java b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoSpringData.java
index 47045274..d8bea31f 100644
--- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoSpringData.java
+++ b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaDaoSpringData.java
@@ -4,7 +4,7 @@
import java.util.UUID;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
-import smecalculus.bezmen.core.ServerSide;
+import smecalculus.bezmen.core.StateDomain;
import smecalculus.bezmen.storage.springdata.SepulkaRepository;
@RequiredArgsConstructor
@@ -17,27 +17,27 @@ public class SepulkaDaoSpringData implements SepulkaDao {
private SepulkaRepository repository;
@Override
- public ServerSide.AggregateState add(@NonNull ServerSide.AggregateState state) {
+ public StateDomain.AggregateState add(@NonNull StateDomain.AggregateState state) {
var stateEdge = repository.save(mapper.toEdge(state));
return mapper.toDomain(stateEdge);
}
@Override
- public Optional getBy(@NonNull String externalId) {
+ public Optional getBy(@NonNull String externalId) {
return repository
- .findByExternalId(externalId, EdgeSide.ExistenceState.class)
+ .findByExternalId(externalId, StateEdge.ExistenceState.class)
.map(mapper::toDomain);
}
@Override
- public Optional getBy(@NonNull UUID internalId) {
+ public Optional getBy(@NonNull UUID internalId) {
return repository
- .findByInternalId(internalId.toString(), EdgeSide.PreviewState.class)
+ .findByInternalId(internalId.toString(), StateEdge.PreviewState.class)
.map(mapper::toDomain);
}
@Override
- public void updateBy(ServerSide.TouchState state, UUID internalId) {
+ public void updateBy(StateDomain.TouchState state, UUID internalId) {
var stateEdge = mapper.toEdge(state);
var matchedCount = repository.updateBy(stateEdge, internalId.toString());
if (matchedCount == 0) {
diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaStateMapper.java b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaStateMapper.java
index 766b6f07..c4049e57 100644
--- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaStateMapper.java
+++ b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/SepulkaStateMapper.java
@@ -1,20 +1,20 @@
package smecalculus.bezmen.storage;
import org.mapstruct.Mapper;
-import smecalculus.bezmen.core.ServerSide;
+import smecalculus.bezmen.core.StateDomain;
import smecalculus.bezmen.mapping.EdgeMapper;
@Mapper
public interface SepulkaStateMapper extends EdgeMapper {
- EdgeSide.AggregateState toEdge(ServerSide.AggregateState state);
+ StateEdge.AggregateState toEdge(StateDomain.AggregateState state);
- ServerSide.AggregateState toDomain(EdgeSide.AggregateState state);
+ StateDomain.AggregateState toDomain(StateEdge.AggregateState state);
- EdgeSide.TouchState toEdge(ServerSide.TouchState state);
+ StateEdge.TouchState toEdge(StateDomain.TouchState state);
- ServerSide.ExistenceState toDomain(EdgeSide.ExistenceState state);
+ StateDomain.ExistenceState toDomain(StateEdge.ExistenceState state);
- EdgeSide.PreviewState toEdge(ServerSide.PreviewState state);
+ StateEdge.PreviewState toEdge(StateDomain.PreviewState state);
- ServerSide.PreviewState toDomain(EdgeSide.PreviewState state);
+ StateDomain.PreviewState toDomain(StateEdge.PreviewState state);
}
diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/EdgeSide.java b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/StateEdge.java
similarity index 97%
rename from apps/sepuling/src/main/java/smecalculus/bezmen/storage/EdgeSide.java
rename to apps/sepuling/src/main/java/smecalculus/bezmen/storage/StateEdge.java
index 27db18b8..b305518d 100644
--- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/EdgeSide.java
+++ b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/StateEdge.java
@@ -8,8 +8,7 @@
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;
-public abstract class EdgeSide {
-
+public abstract class StateEdge {
@Data
public static class ExistenceState {
UUID internalId;
diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/mybatis/SepulkaSqlMapper.java b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/mybatis/SepulkaSqlMapper.java
index 3be87324..68703231 100644
--- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/mybatis/SepulkaSqlMapper.java
+++ b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/mybatis/SepulkaSqlMapper.java
@@ -5,10 +5,10 @@
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
-import smecalculus.bezmen.storage.EdgeSide.AggregateState;
-import smecalculus.bezmen.storage.EdgeSide.ExistenceState;
-import smecalculus.bezmen.storage.EdgeSide.PreviewState;
-import smecalculus.bezmen.storage.EdgeSide.TouchState;
+import smecalculus.bezmen.storage.StateEdge.AggregateState;
+import smecalculus.bezmen.storage.StateEdge.ExistenceState;
+import smecalculus.bezmen.storage.StateEdge.PreviewState;
+import smecalculus.bezmen.storage.StateEdge.TouchState;
public interface SepulkaSqlMapper {
diff --git a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/springdata/SepulkaRepository.java b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/springdata/SepulkaRepository.java
index 42159b9e..77aeff47 100644
--- a/apps/sepuling/src/main/java/smecalculus/bezmen/storage/springdata/SepulkaRepository.java
+++ b/apps/sepuling/src/main/java/smecalculus/bezmen/storage/springdata/SepulkaRepository.java
@@ -6,8 +6,8 @@
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.lang.Nullable;
-import smecalculus.bezmen.storage.EdgeSide.AggregateState;
-import smecalculus.bezmen.storage.EdgeSide.TouchState;
+import smecalculus.bezmen.storage.StateEdge.AggregateState;
+import smecalculus.bezmen.storage.StateEdge.TouchState;
public interface SepulkaRepository extends CrudRepository {
diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaDaoBeans.java b/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaDaoBeans.java
index 7078360b..9c1bb094 100644
--- a/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaDaoBeans.java
+++ b/apps/sepuling/src/test/java/smecalculus/bezmen/construction/SepulkaDaoBeans.java
@@ -10,7 +10,7 @@
import org.springframework.context.annotation.Import;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
-import smecalculus.bezmen.configuration.ServerSide.StorageProps;
+import smecalculus.bezmen.configuration.StorageDomain.StorageProps;
import smecalculus.bezmen.storage.SepulkaDao;
import smecalculus.bezmen.storage.SepulkaDaoMyBatis;
import smecalculus.bezmen.storage.SepulkaDaoSpringData;
diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/construction/StoragePropsBeans.java b/apps/sepuling/src/test/java/smecalculus/bezmen/construction/StoragePropsBeans.java
index 4eeb1f5d..e6d9851d 100644
--- a/apps/sepuling/src/test/java/smecalculus/bezmen/construction/StoragePropsBeans.java
+++ b/apps/sepuling/src/test/java/smecalculus/bezmen/construction/StoragePropsBeans.java
@@ -1,41 +1,41 @@
package smecalculus.bezmen.construction;
-import static smecalculus.bezmen.configuration.StateMappingMode.MY_BATIS;
-import static smecalculus.bezmen.configuration.StateMappingMode.SPRING_DATA;
+import static smecalculus.bezmen.configuration.StorageMappingMode.MY_BATIS;
+import static smecalculus.bezmen.configuration.StorageMappingMode.SPRING_DATA;
import static smecalculus.bezmen.configuration.StorageProtocolMode.H2;
import static smecalculus.bezmen.configuration.StorageProtocolMode.POSTGRES;
import org.springframework.context.annotation.Bean;
-import smecalculus.bezmen.configuration.ServerSide.StorageProps;
-import smecalculus.bezmen.configuration.ServerSideEg;
+import smecalculus.bezmen.configuration.StorageDomain.StorageProps;
+import smecalculus.bezmen.configuration.StorageDomainEg;
public class StoragePropsBeans {
public static class SpringDataPostgres {
@Bean
public StorageProps storageProps() {
- return ServerSideEg.storageProps(SPRING_DATA, POSTGRES).build();
+ return StorageDomainEg.storageProps(SPRING_DATA, POSTGRES).build();
}
}
public static class SpringDataH2 {
@Bean
public StorageProps storageProps() {
- return ServerSideEg.storageProps(SPRING_DATA, H2).build();
+ return StorageDomainEg.storageProps(SPRING_DATA, H2).build();
}
}
public static class MyBatisPostgres {
@Bean
public StorageProps storageProps() {
- return ServerSideEg.storageProps(MY_BATIS, POSTGRES).build();
+ return StorageDomainEg.storageProps(MY_BATIS, POSTGRES).build();
}
}
public static class MyBatisH2 {
@Bean
public StorageProps storageProps() {
- return ServerSideEg.storageProps(MY_BATIS, H2).build();
+ return StorageDomainEg.storageProps(MY_BATIS, H2).build();
}
}
}
diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientIT.java b/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientIT.java
index bb3093cf..1276eed4 100644
--- a/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientIT.java
+++ b/apps/sepuling/src/test/java/smecalculus/bezmen/messaging/SepulkaClientIT.java
@@ -11,8 +11,8 @@
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import smecalculus.bezmen.construction.SepulkaClientBeans;
-import smecalculus.bezmen.core.ClientSide.RegistrationRequest;
-import smecalculus.bezmen.core.ClientSideEg;
+import smecalculus.bezmen.core.MessageDomain.RegistrationRequest;
+import smecalculus.bezmen.core.MessageDomainEg;
import smecalculus.bezmen.core.SepulkaService;
@ExtendWith(SpringExtension.class)
@@ -30,12 +30,12 @@ void shouldRegisterSepulka() {
// given
var externalId = UUID.randomUUID().toString();
// and
- var request = EdgeSideEg.registrationRequest(externalId);
+ var request = MessageEdgeEg.registrationRequest(externalId);
// and
when(serviceMock.register(any(RegistrationRequest.class)))
- .thenReturn(ClientSideEg.registrationResponse(externalId).build());
+ .thenReturn(MessageDomainEg.registrationResponse(externalId).build());
// and
- var expectedResponse = EdgeSideEg.registrationResponse(externalId);
+ var expectedResponse = MessageEdgeEg.registrationResponse(externalId);
// when
var actualResponse = externalClient.register(request);
// then
diff --git a/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoIT.java b/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoIT.java
index 45dff005..11edcf0a 100644
--- a/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoIT.java
+++ b/apps/sepuling/src/test/java/smecalculus/bezmen/storage/SepulkaDaoIT.java
@@ -10,7 +10,7 @@
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import smecalculus.bezmen.construction.SepulkaDaoBeans;
-import smecalculus.bezmen.core.ServerSideEg;
+import smecalculus.bezmen.core.StateDomainEg;
@DirtiesContext
@ExtendWith(SpringExtension.class)
@@ -24,10 +24,10 @@ abstract class SepulkaDaoIT {
@Test
void shouldAddOneSepulka() {
// given
- var expected1 = ServerSideEg.aggregateState().build();
+ var expected1 = StateDomainEg.aggregateState().build();
// and
var expected2 =
- ServerSideEg.creationState().internalId(expected1.internalId()).build();
+ StateDomainEg.creationState().internalId(expected1.internalId()).build();
// when
var actualSaved = sepulkaDao.add(expected1);
// and
@@ -41,11 +41,11 @@ void shouldAddOneSepulka() {
@Test
void shouldViewOneSepulka() {
// given
- var aggregate = ServerSideEg.aggregateState().build();
+ var aggregate = StateDomainEg.aggregateState().build();
// and
sepulkaDao.add(aggregate);
// and
- var expected = ServerSideEg.previewState(aggregate).build();
+ var expected = StateDomainEg.previewState(aggregate).build();
// when
var actual = sepulkaDao.getBy(aggregate.internalId());
// then
@@ -55,13 +55,13 @@ void shouldViewOneSepulka() {
@Test
void shouldUpdateOneSepulka() {
// given
- var aggregate = ServerSideEg.aggregateState().build();
+ var aggregate = StateDomainEg.aggregateState().build();
// and
sepulkaDao.add(aggregate);
// and
var updatedAt = aggregate.updatedAt().plusSeconds(1);
// and
- var touch = ServerSideEg.touchState(aggregate).updatedAt(updatedAt).build();
+ var touch = StateDomainEg.touchState(aggregate).updatedAt(updatedAt).build();
// when
sepulkaDao.updateBy(touch, aggregate.internalId());
// then
diff --git a/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/EdgeSide.java b/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/MessageEdge.java
similarity index 92%
rename from libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/EdgeSide.java
rename to libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/MessageEdge.java
index cfac3ea8..390263e8 100644
--- a/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/EdgeSide.java
+++ b/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/MessageEdge.java
@@ -4,8 +4,7 @@
import jakarta.validation.constraints.Size;
import lombok.Data;
-public class EdgeSide {
-
+public abstract class MessageEdge {
@Data
public static class RegistrationRequest {
@NotNull
diff --git a/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/EdgeSideEg.java b/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/MessageEdgeEg.java
similarity index 71%
rename from libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/EdgeSideEg.java
rename to libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/MessageEdgeEg.java
index 159f81ff..6d84c4ce 100644
--- a/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/EdgeSideEg.java
+++ b/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/MessageEdgeEg.java
@@ -1,11 +1,10 @@
package smecalculus.bezmen.messaging;
import java.util.UUID;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationRequest;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationResponse;
-
-public class EdgeSideEg {
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationRequest;
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationResponse;
+public abstract class MessageEdgeEg {
public static RegistrationRequest registrationRequest() {
var requestEdge = new RegistrationRequest();
requestEdge.setExternalId(UUID.randomUUID().toString());
@@ -19,12 +18,12 @@ public static RegistrationRequest registrationRequest(String id) {
}
public static RegistrationResponse registrationResponse() {
- var responseEdge = new EdgeSide.RegistrationResponse();
+ var responseEdge = new RegistrationResponse();
responseEdge.setExternalId(UUID.randomUUID().toString());
return responseEdge;
}
- public static EdgeSide.RegistrationResponse registrationResponse(String externalId) {
+ public static RegistrationResponse registrationResponse(String externalId) {
var responseEdge = registrationResponse();
responseEdge.setExternalId(externalId);
return responseEdge;
diff --git a/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/SepulkaClient.java b/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/SepulkaClient.java
index a786ed27..8a28e06f 100644
--- a/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/SepulkaClient.java
+++ b/libs/abstraction-client/src/main/java/smecalculus/bezmen/messaging/SepulkaClient.java
@@ -1,7 +1,7 @@
package smecalculus.bezmen.messaging;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationRequest;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationResponse;
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationRequest;
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationResponse;
/**
* Port: client side
diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/ClientSide.java b/libs/abstraction/src/main/java/smecalculus/bezmen/core/MessageDomain.java
similarity index 93%
rename from libs/abstraction/src/main/java/smecalculus/bezmen/core/ClientSide.java
rename to libs/abstraction/src/main/java/smecalculus/bezmen/core/MessageDomain.java
index 7e311224..36eabd5e 100644
--- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/ClientSide.java
+++ b/libs/abstraction/src/main/java/smecalculus/bezmen/core/MessageDomain.java
@@ -3,8 +3,7 @@
import lombok.Builder;
import lombok.NonNull;
-public class ClientSide {
-
+public class MessageDomain {
@Builder
public record RegistrationRequest(@NonNull String externalId) {}
diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/ClientSideEg.java b/libs/abstraction/src/main/java/smecalculus/bezmen/core/MessageDomainEg.java
similarity index 79%
rename from libs/abstraction/src/main/java/smecalculus/bezmen/core/ClientSideEg.java
rename to libs/abstraction/src/main/java/smecalculus/bezmen/core/MessageDomainEg.java
index 0432dbdf..07d31cd7 100644
--- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/ClientSideEg.java
+++ b/libs/abstraction/src/main/java/smecalculus/bezmen/core/MessageDomainEg.java
@@ -1,9 +1,9 @@
package smecalculus.bezmen.core;
import java.util.UUID;
-import smecalculus.bezmen.core.ClientSide.RegistrationResponse;
+import smecalculus.bezmen.core.MessageDomain.RegistrationResponse;
-public class ClientSideEg {
+public class MessageDomainEg {
public static RegistrationResponse.Builder registrationResponse() {
return RegistrationResponse.builder().externalId(UUID.randomUUID().toString());
}
diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaMapper.java b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaMapper.java
index 39cea092..4a3d062c 100644
--- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaMapper.java
+++ b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaMapper.java
@@ -1,9 +1,9 @@
package smecalculus.bezmen.core;
import org.mapstruct.Mapper;
-import smecalculus.bezmen.core.ClientSide.RegistrationRequest;
-import smecalculus.bezmen.core.ClientSide.RegistrationResponse;
-import smecalculus.bezmen.core.ServerSide.AggregateState;
+import smecalculus.bezmen.core.MessageDomain.RegistrationRequest;
+import smecalculus.bezmen.core.MessageDomain.RegistrationResponse;
+import smecalculus.bezmen.core.StateDomain.AggregateState;
@Mapper
public interface SepulkaMapper {
diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaService.java b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaService.java
index dea35e73..02e799e3 100644
--- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaService.java
+++ b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaService.java
@@ -1,10 +1,10 @@
package smecalculus.bezmen.core;
import java.util.List;
-import smecalculus.bezmen.core.ClientSide.PreviewRequest;
-import smecalculus.bezmen.core.ClientSide.PreviewResponse;
-import smecalculus.bezmen.core.ClientSide.RegistrationRequest;
-import smecalculus.bezmen.core.ClientSide.RegistrationResponse;
+import smecalculus.bezmen.core.MessageDomain.PreviewRequest;
+import smecalculus.bezmen.core.MessageDomain.PreviewResponse;
+import smecalculus.bezmen.core.MessageDomain.RegistrationRequest;
+import smecalculus.bezmen.core.MessageDomain.RegistrationResponse;
public interface SepulkaService {
RegistrationResponse register(RegistrationRequest request);
diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/ServerSide.java b/libs/abstraction/src/main/java/smecalculus/bezmen/core/StateDomain.java
similarity index 96%
rename from libs/abstraction/src/main/java/smecalculus/bezmen/core/ServerSide.java
rename to libs/abstraction/src/main/java/smecalculus/bezmen/core/StateDomain.java
index a494f7e6..5a9d46f0 100644
--- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/ServerSide.java
+++ b/libs/abstraction/src/main/java/smecalculus/bezmen/core/StateDomain.java
@@ -5,7 +5,7 @@
import lombok.Builder;
import lombok.NonNull;
-public class ServerSide {
+public class StateDomain {
@Builder
public record ExistenceState(@NonNull UUID internalId) {}
diff --git a/libs/abstraction/src/main/java/smecalculus/bezmen/core/ServerSideEg.java b/libs/abstraction/src/main/java/smecalculus/bezmen/core/StateDomainEg.java
similarity index 79%
rename from libs/abstraction/src/main/java/smecalculus/bezmen/core/ServerSideEg.java
rename to libs/abstraction/src/main/java/smecalculus/bezmen/core/StateDomainEg.java
index 94a874cb..0b5582f3 100644
--- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/ServerSideEg.java
+++ b/libs/abstraction/src/main/java/smecalculus/bezmen/core/StateDomainEg.java
@@ -4,12 +4,12 @@
import java.time.LocalDateTime;
import java.util.UUID;
-import smecalculus.bezmen.core.ServerSide.AggregateState;
-import smecalculus.bezmen.core.ServerSide.ExistenceState;
-import smecalculus.bezmen.core.ServerSide.PreviewState;
-import smecalculus.bezmen.core.ServerSide.TouchState;
+import smecalculus.bezmen.core.StateDomain.AggregateState;
+import smecalculus.bezmen.core.StateDomain.ExistenceState;
+import smecalculus.bezmen.core.StateDomain.PreviewState;
+import smecalculus.bezmen.core.StateDomain.TouchState;
-public class ServerSideEg {
+public class StateDomainEg {
public static AggregateState.Builder aggregateState() {
return AggregateState.builder()
.internalId(UUID.randomUUID())
diff --git a/libs/messaging-client/src/main/java/smecalculus/bezmen/messaging/BezmenClientJavaHttp.java b/libs/messaging-client/src/main/java/smecalculus/bezmen/messaging/BezmenClientJavaHttp.java
index d301f321..ea336b59 100644
--- a/libs/messaging-client/src/main/java/smecalculus/bezmen/messaging/BezmenClientJavaHttp.java
+++ b/libs/messaging-client/src/main/java/smecalculus/bezmen/messaging/BezmenClientJavaHttp.java
@@ -10,8 +10,8 @@
import java.net.http.HttpResponse.BodyHandlers;
import lombok.NonNull;
import lombok.RequiredArgsConstructor;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationRequest;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationResponse;
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationRequest;
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationResponse;
@RequiredArgsConstructor
public class BezmenClientJavaHttp implements BezmenClient {
@@ -33,7 +33,7 @@ public RegistrationResponse register(RegistrationRequest request) {
.header("Accept", "application/json")
.build();
var httpResponse = client.send(httpRequest, BodyHandlers.ofString());
- return mapper.readValue(httpResponse.body(), EdgeSide.RegistrationResponse.class);
+ return mapper.readValue(httpResponse.body(), MessageEdge.RegistrationResponse.class);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
} catch (IOException | InterruptedException e) {
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingProps.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingProps.java
deleted file mode 100644
index 70d91764..00000000
--- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingProps.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package smecalculus.bezmen.configuration;
-
-import java.util.Set;
-import lombok.Builder;
-import lombok.NonNull;
-
-@Builder
-public record MessageMappingProps(@NonNull Set mappingModes) {}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsEdge.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsEdge.java
deleted file mode 100644
index e1d97504..00000000
--- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsEdge.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package smecalculus.bezmen.configuration;
-
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Size;
-import java.util.Set;
-import lombok.Data;
-import smecalculus.bezmen.validation.ValueOfEnum;
-
-@Data
-public class MessageMappingPropsEdge {
-
- @NotNull
- @Size(min = 1)
- Set<@ValueOfEnum(MessageMappingMode.class) String> modes;
-}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsEg.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsEg.java
deleted file mode 100644
index 3faffea8..00000000
--- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingPropsEg.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package smecalculus.bezmen.configuration;
-
-import java.util.Set;
-
-public class MessageMappingPropsEg {
- public static class Builders {
- public static MessageMappingProps.Builder messageMappingProps() {
- return MessageMappingProps.builder().mappingModes(Set.of(MessageMappingMode.SPRING_MVC));
- }
- }
-}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomain.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomain.java
new file mode 100644
index 00000000..69830499
--- /dev/null
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomain.java
@@ -0,0 +1,17 @@
+package smecalculus.bezmen.configuration;
+
+import java.util.Set;
+import lombok.Builder;
+import lombok.NonNull;
+
+public abstract class MessagingDomain {
+ @Builder
+ public record MessagingProps(
+ @NonNull MessagingDomain.ProtocolProps protocolProps, @NonNull MessagingDomain.MappingProps mappingProps) {}
+
+ @Builder
+ public record ProtocolProps(@NonNull Set protocolModes) {}
+
+ @Builder
+ public record MappingProps(@NonNull Set mappingModes) {}
+}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomainEg.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomainEg.java
new file mode 100644
index 00000000..65812901
--- /dev/null
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomainEg.java
@@ -0,0 +1,25 @@
+package smecalculus.bezmen.configuration;
+
+import static smecalculus.bezmen.configuration.MessagingMappingMode.SPRING_MVC;
+import static smecalculus.bezmen.configuration.MessagingProtocolMode.HTTP;
+
+import java.util.Set;
+import smecalculus.bezmen.configuration.MessagingDomain.MappingProps;
+import smecalculus.bezmen.configuration.MessagingDomain.MessagingProps;
+import smecalculus.bezmen.configuration.MessagingDomain.ProtocolProps;
+
+public abstract class MessagingDomainEg {
+ public static MessagingProps.Builder messagingProps() {
+ return MessagingProps.builder()
+ .protocolProps(messagingProtocolProps().build())
+ .mappingProps(messageMappingProps().build());
+ }
+
+ public static ProtocolProps.Builder messagingProtocolProps() {
+ return MessagingDomain.ProtocolProps.builder().protocolModes(Set.of(HTTP));
+ }
+
+ public static MappingProps.Builder messageMappingProps() {
+ return MappingProps.builder().mappingModes(Set.of(SPRING_MVC));
+ }
+}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingEdge.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingEdge.java
new file mode 100644
index 00000000..5cb49762
--- /dev/null
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingEdge.java
@@ -0,0 +1,32 @@
+package smecalculus.bezmen.configuration;
+
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
+import java.util.Set;
+import lombok.Data;
+import smecalculus.bezmen.validation.ValueOfEnum;
+
+public abstract class MessagingEdge {
+ @Data
+ public static class MessagingProps {
+ @NotNull
+ ProtocolProps protocol;
+
+ @NotNull
+ MappingProps mapping;
+ }
+
+ @Data
+ public static class MappingProps {
+ @NotNull
+ @Size(min = 1)
+ Set<@ValueOfEnum(MessagingMappingMode.class) String> modes;
+ }
+
+ @Data
+ public static class ProtocolProps {
+ @NotNull
+ @Size(min = 1)
+ Set<@ValueOfEnum(MessagingProtocolMode.class) String> modes;
+ }
+}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingEdgeEg.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingEdgeEg.java
new file mode 100644
index 00000000..49a1533d
--- /dev/null
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingEdgeEg.java
@@ -0,0 +1,3 @@
+package smecalculus.bezmen.configuration;
+
+public abstract class MessagingEdgeEg {}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingMode.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingMappingMode.java
similarity index 70%
rename from libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingMode.java
rename to libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingMappingMode.java
index 4adfba89..22acc1e4 100644
--- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessageMappingMode.java
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingMappingMode.java
@@ -1,6 +1,6 @@
package smecalculus.bezmen.configuration;
-public enum MessageMappingMode {
+public enum MessagingMappingMode {
SPRING_MVC,
SPRING_MANAGEMENT
}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProps.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProps.java
deleted file mode 100644
index 37f710b9..00000000
--- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProps.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package smecalculus.bezmen.configuration;
-
-import lombok.Builder;
-import lombok.NonNull;
-
-@Builder
-public record MessagingProps(
- @NonNull MessagingProtocolProps protocolProps, @NonNull MessageMappingProps mappingProps) {}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsEdge.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsEdge.java
deleted file mode 100644
index e6ebbe90..00000000
--- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsEdge.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package smecalculus.bezmen.configuration;
-
-import jakarta.validation.constraints.NotNull;
-import lombok.Data;
-
-@Data
-public class MessagingPropsEdge {
-
- @NotNull
- MessagingProtocolPropsEdge protocol;
-
- @NotNull
- MessageMappingPropsEdge mapping;
-}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsEg.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsEg.java
deleted file mode 100644
index 44e0ef20..00000000
--- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsEg.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package smecalculus.bezmen.configuration;
-
-import static smecalculus.bezmen.configuration.MessageMappingPropsEg.Builders.messageMappingProps;
-import static smecalculus.bezmen.configuration.MessagingProtocolPropsEg.Builders.messagingProtocolProps;
-
-public class MessagingPropsEg {
- public static class Builders {
- public static MessagingProps.Builder messagingProps() {
- return MessagingProps.builder()
- .protocolProps(messagingProtocolProps().build())
- .mappingProps(messageMappingProps().build());
- }
- }
-}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsMapper.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsMapper.java
index 82f625a2..07806b7b 100644
--- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsMapper.java
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingPropsMapper.java
@@ -6,22 +6,21 @@
@Mapper
public interface MessagingPropsMapper extends EdgeMapper {
-
@Mapping(source = "protocol", target = "protocolProps")
@Mapping(source = "mapping", target = "mappingProps")
- MessagingProps toDomain(MessagingPropsEdge propsEdge);
+ MessagingDomain.MessagingProps toDomain(MessagingEdge.MessagingProps propsEdge);
@Mapping(source = "modes", target = "protocolModes")
- MessagingProtocolProps toDomain(MessagingProtocolPropsEdge propsEdge);
+ MessagingDomain.ProtocolProps toDomain(MessagingEdge.ProtocolProps propsEdge);
@Mapping(source = "modes", target = "mappingModes")
- MessageMappingProps toDomain(MessageMappingPropsEdge propsEdge);
+ MessagingDomain.MappingProps toDomain(MessagingEdge.MappingProps propsEdge);
default MessagingProtocolMode toProtocolMode(String value) {
return MessagingProtocolMode.valueOf(value.toUpperCase());
}
- default MessageMappingMode toMappingMode(String value) {
- return MessageMappingMode.valueOf(value.toUpperCase());
+ default MessagingMappingMode toMappingMode(String value) {
+ return MessagingMappingMode.valueOf(value.toUpperCase());
}
}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolProps.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolProps.java
deleted file mode 100644
index 7df3ce65..00000000
--- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolProps.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package smecalculus.bezmen.configuration;
-
-import java.util.Set;
-import lombok.Builder;
-import lombok.NonNull;
-
-@Builder
-public record MessagingProtocolProps(@NonNull Set protocolModes) {}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsEdge.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsEdge.java
deleted file mode 100644
index 045ace11..00000000
--- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsEdge.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package smecalculus.bezmen.configuration;
-
-import jakarta.validation.constraints.NotNull;
-import jakarta.validation.constraints.Size;
-import java.util.Set;
-import lombok.Data;
-import smecalculus.bezmen.validation.ValueOfEnum;
-
-@Data
-public class MessagingProtocolPropsEdge {
-
- @NotNull
- @Size(min = 1)
- Set<@ValueOfEnum(MessagingProtocolMode.class) String> modes;
-}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsEg.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsEg.java
deleted file mode 100644
index 13829818..00000000
--- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingProtocolPropsEg.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package smecalculus.bezmen.configuration;
-
-import static smecalculus.bezmen.configuration.MessagingProtocolMode.HTTP;
-
-import java.util.Set;
-
-public class MessagingProtocolPropsEg {
- public static class Builders {
- public static MessagingProtocolProps.Builder messagingProtocolProps() {
- return MessagingProtocolProps.builder().protocolModes(Set.of(HTTP));
- }
- }
-}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/ConditionalOnMessageMappingModes.java b/libs/messaging/src/main/java/smecalculus/bezmen/construction/ConditionalOnMessageMappingModes.java
index 64cea4dc..d04a8fcc 100644
--- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/ConditionalOnMessageMappingModes.java
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/construction/ConditionalOnMessageMappingModes.java
@@ -5,11 +5,11 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Conditional;
-import smecalculus.bezmen.configuration.MessageMappingMode;
+import smecalculus.bezmen.configuration.MessagingMappingMode;
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Conditional(MessageMappingModeCondition.class)
public @interface ConditionalOnMessageMappingModes {
- MessageMappingMode[] value();
+ MessagingMappingMode[] value();
}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringJmxManagementBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringJmxManagementBeans.java
index d8d71019..2a4e9698 100644
--- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringJmxManagementBeans.java
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringJmxManagementBeans.java
@@ -1,10 +1,10 @@
package smecalculus.bezmen.construction;
import org.springframework.context.annotation.Configuration;
-import smecalculus.bezmen.configuration.MessageMappingMode;
+import smecalculus.bezmen.configuration.MessagingMappingMode;
import smecalculus.bezmen.configuration.MessagingProtocolMode;
@ConditionalOnMessagingProtocolModes(MessagingProtocolMode.JMX)
-@ConditionalOnMessageMappingModes(MessageMappingMode.SPRING_MANAGEMENT)
+@ConditionalOnMessageMappingModes(MessagingMappingMode.SPRING_MANAGEMENT)
@Configuration(proxyBeanMethods = false)
public class MappingSpringJmxManagementBeans {}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebManagementBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebManagementBeans.java
index 87165215..d0bfec10 100644
--- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebManagementBeans.java
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebManagementBeans.java
@@ -7,11 +7,11 @@
import org.springframework.boot.actuate.autoconfigure.web.servlet.ServletManagementContextAutoConfiguration;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.context.annotation.Configuration;
-import smecalculus.bezmen.configuration.MessageMappingMode;
+import smecalculus.bezmen.configuration.MessagingMappingMode;
import smecalculus.bezmen.configuration.MessagingProtocolMode;
@ConditionalOnMessagingProtocolModes(MessagingProtocolMode.HTTP)
-@ConditionalOnMessageMappingModes(MessageMappingMode.SPRING_MANAGEMENT)
+@ConditionalOnMessageMappingModes(MessagingMappingMode.SPRING_MANAGEMENT)
@ImportAutoConfiguration({
ManagementContextAutoConfiguration.class,
ServletManagementContextAutoConfiguration.class,
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebMvcBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebMvcBeans.java
index 10ebf9b7..f5d56996 100644
--- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebMvcBeans.java
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MappingSpringWebMvcBeans.java
@@ -2,11 +2,11 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import smecalculus.bezmen.configuration.MessageMappingMode;
+import smecalculus.bezmen.configuration.MessagingMappingMode;
import smecalculus.bezmen.configuration.MessagingProtocolMode;
@ConditionalOnMessagingProtocolModes(MessagingProtocolMode.HTTP)
-@ConditionalOnMessageMappingModes(MessageMappingMode.SPRING_MVC)
+@ConditionalOnMessageMappingModes(MessagingMappingMode.SPRING_MVC)
@EnableWebMvc
@Configuration(proxyBeanMethods = false)
public class MappingSpringWebMvcBeans {}
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessageMappingModeCondition.java b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessageMappingModeCondition.java
index 4cf01edb..391e6545 100644
--- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessageMappingModeCondition.java
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessageMappingModeCondition.java
@@ -7,15 +7,15 @@
import org.springframework.context.annotation.ConditionContext;
import org.springframework.context.annotation.ConfigurationCondition;
import org.springframework.core.type.AnnotatedTypeMetadata;
-import smecalculus.bezmen.configuration.MessageMappingMode;
-import smecalculus.bezmen.configuration.MessagingProps;
+import smecalculus.bezmen.configuration.MessagingDomain.MessagingProps;
+import smecalculus.bezmen.configuration.MessagingMappingMode;
class MessageMappingModeCondition implements ConfigurationCondition {
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
var attributes = metadata.getAnnotationAttributes(ConditionalOnMessageMappingModes.class.getName());
- var expectedModes = (MessageMappingMode[]) attributes.get("value");
+ var expectedModes = (MessagingMappingMode[]) attributes.get("value");
var props = context.getBeanFactory().getBean(MessagingProps.class);
var actualModes = props.mappingProps().mappingModes();
return Stream.of(expectedModes).anyMatch(actualModes::contains);
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingConfigBeans.java b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingConfigBeans.java
index 589bac7a..44cb2db1 100644
--- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingConfigBeans.java
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingConfigBeans.java
@@ -5,8 +5,8 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
-import smecalculus.bezmen.configuration.MessagingProps;
-import smecalculus.bezmen.configuration.MessagingPropsEdge;
+import smecalculus.bezmen.configuration.MessagingDomain;
+import smecalculus.bezmen.configuration.MessagingEdge;
import smecalculus.bezmen.configuration.MessagingPropsMapper;
import smecalculus.bezmen.configuration.MessagingPropsMapperImpl;
import smecalculus.bezmen.configuration.PropsKeeper;
@@ -24,8 +24,8 @@ MessagingPropsMapper messagingPropsMapper() {
}
@Bean
- MessagingProps messagingProps(PropsKeeper keeper, EdgeValidator validator, MessagingPropsMapper mapper) {
- var propsEdge = keeper.read("bezmen.messaging", MessagingPropsEdge.class);
+ MessagingDomain.MessagingProps messagingProps(PropsKeeper keeper, EdgeValidator validator, MessagingPropsMapper mapper) {
+ var propsEdge = keeper.read("bezmen.messaging", MessagingEdge.MessagingProps.class);
validator.validate(propsEdge);
LOG.info("Read {}", propsEdge);
return mapper.toDomain(propsEdge);
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingProtocolModeCondition.java b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingProtocolModeCondition.java
index 2f48c2b5..da05cf6a 100644
--- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingProtocolModeCondition.java
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingProtocolModeCondition.java
@@ -7,7 +7,7 @@
import org.springframework.context.annotation.ConditionContext;
import org.springframework.context.annotation.ConfigurationCondition;
import org.springframework.core.type.AnnotatedTypeMetadata;
-import smecalculus.bezmen.configuration.MessagingProps;
+import smecalculus.bezmen.configuration.MessagingDomain.MessagingProps;
import smecalculus.bezmen.configuration.MessagingProtocolMode;
class MessagingProtocolModeCondition implements ConfigurationCondition {
diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/messaging/SepulkaMessageMapper.java b/libs/messaging/src/main/java/smecalculus/bezmen/messaging/SepulkaMessageMapper.java
index 4b8cddf0..e8f0dee1 100644
--- a/libs/messaging/src/main/java/smecalculus/bezmen/messaging/SepulkaMessageMapper.java
+++ b/libs/messaging/src/main/java/smecalculus/bezmen/messaging/SepulkaMessageMapper.java
@@ -1,12 +1,12 @@
package smecalculus.bezmen.messaging;
import org.mapstruct.Mapper;
-import smecalculus.bezmen.core.ClientSide;
+import smecalculus.bezmen.core.MessageDomain;
import smecalculus.bezmen.mapping.EdgeMapper;
@Mapper
public interface SepulkaMessageMapper extends EdgeMapper {
- ClientSide.RegistrationRequest toDomain(EdgeSide.RegistrationRequest request);
+ MessageDomain.RegistrationRequest toDomain(MessageEdge.RegistrationRequest request);
- EdgeSide.RegistrationResponse toEdge(ClientSide.RegistrationResponse response);
+ MessageEdge.RegistrationResponse toEdge(MessageDomain.RegistrationResponse response);
}
diff --git a/libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansIT.java b/libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansIT.java
index ebce0f94..d807305a 100644
--- a/libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansIT.java
+++ b/libs/messaging/src/test/java/smecalculus/bezmen/construction/MessagingConfigBeansIT.java
@@ -1,14 +1,14 @@
package smecalculus.bezmen.construction;
import static org.assertj.core.api.Assertions.assertThat;
-import static smecalculus.bezmen.configuration.MessagingPropsEg.Builders.messagingProps;
+import static smecalculus.bezmen.configuration.MessagingDomainEg.messagingProps;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
-import smecalculus.bezmen.configuration.MessagingProps;
+import smecalculus.bezmen.configuration.MessagingDomain.MessagingProps;
@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = {MessagingConfigBeans.class, ConfigBeans.class, ValidationBeans.class})
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/EdgeSideEg.java b/libs/storage/src/main/java/smecalculus/bezmen/configuration/EdgeSideEg.java
deleted file mode 100644
index 5ca4f12f..00000000
--- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/EdgeSideEg.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package smecalculus.bezmen.configuration;
-
-import static smecalculus.bezmen.configuration.StateMappingMode.SPRING_DATA;
-import static smecalculus.bezmen.configuration.StorageProtocolMode.H2;
-
-import smecalculus.bezmen.configuration.EdgeSide.StateMappingProps;
-import smecalculus.bezmen.configuration.EdgeSide.StorageProps;
-import smecalculus.bezmen.configuration.EdgeSide.StorageProtocolProps;
-
-public abstract class EdgeSideEg {
-
- public static StorageProps storageProps() {
- var propsEdge = new StorageProps();
- propsEdge.setMapping(stateMappingProps());
- propsEdge.setProtocol(storageProtocolProps());
- return propsEdge;
- }
-
- public static StateMappingProps stateMappingProps() {
- var propsEdge = new StateMappingProps();
- propsEdge.setMode(SPRING_DATA.name());
- return propsEdge;
- }
-
- public static StorageProtocolProps storageProtocolProps() {
- var propsEdge = new StorageProtocolProps();
- propsEdge.setMode(H2.name());
- return propsEdge;
- }
-}
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/ServerSide.java b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomain.java
similarity index 65%
rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/ServerSide.java
rename to libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomain.java
index bb97e4ce..dc16134e 100644
--- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/ServerSide.java
+++ b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomain.java
@@ -4,17 +4,16 @@
import lombok.NonNull;
import lombok.ToString;
-public abstract class ServerSide {
-
+public abstract class StorageDomain {
@Builder
- public record StorageProps(@NonNull StorageProtocolProps protocolProps, @NonNull StateMappingProps mappingProps) {}
+ public record StorageProps(@NonNull StorageDomain.ProtocolProps protocolProps, @NonNull StorageDomain.MappingProps mappingProps) {}
@Builder
- public record StorageProtocolProps(
+ public record ProtocolProps(
@NonNull StorageProtocolMode protocolMode, H2Props h2Props, PostgresProps postgresProps) {}
@Builder
- public record StateMappingProps(@NonNull StateMappingMode mappingMode) {}
+ public record MappingProps(@NonNull StorageMappingMode mappingMode) {}
@Builder
public record H2Props(@NonNull String url, @NonNull String username, @NonNull String password) {}
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/ServerSideEg.java b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomainEg.java
similarity index 53%
rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/ServerSideEg.java
rename to libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomainEg.java
index 42c5e35e..04bb3886 100644
--- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/ServerSideEg.java
+++ b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomainEg.java
@@ -1,37 +1,37 @@
package smecalculus.bezmen.configuration;
-import static smecalculus.bezmen.configuration.StateMappingMode.SPRING_DATA;
+import static smecalculus.bezmen.configuration.StorageMappingMode.SPRING_DATA;
import static smecalculus.bezmen.configuration.StorageProtocolMode.H2;
-import smecalculus.bezmen.configuration.ServerSide.H2Props;
-import smecalculus.bezmen.configuration.ServerSide.PostgresProps;
-import smecalculus.bezmen.configuration.ServerSide.StateMappingProps;
-import smecalculus.bezmen.configuration.ServerSide.StorageProps;
-import smecalculus.bezmen.configuration.ServerSide.StorageProtocolProps;
+import smecalculus.bezmen.configuration.StorageDomain.H2Props;
+import smecalculus.bezmen.configuration.StorageDomain.MappingProps;
+import smecalculus.bezmen.configuration.StorageDomain.PostgresProps;
+import smecalculus.bezmen.configuration.StorageDomain.ProtocolProps;
+import smecalculus.bezmen.configuration.StorageDomain.StorageProps;
-public abstract class ServerSideEg {
+public abstract class StorageDomainEg {
public static StorageProps.Builder storageProps() {
return StorageProps.builder()
.protocolProps(storageProtocolProps().build())
.mappingProps(stateMappingProps().build());
}
- public static StorageProps.Builder storageProps(StateMappingMode mappingMode, StorageProtocolMode protocolMode) {
+ public static StorageProps.Builder storageProps(StorageMappingMode mappingMode, StorageProtocolMode protocolMode) {
return storageProps()
.protocolProps(storageProtocolProps(protocolMode).build())
.mappingProps(stateMappingProps(mappingMode).build());
}
- public static StateMappingProps.Builder stateMappingProps() {
- return StateMappingProps.builder().mappingMode(SPRING_DATA);
+ public static MappingProps.Builder stateMappingProps() {
+ return MappingProps.builder().mappingMode(SPRING_DATA);
}
- public static StateMappingProps.Builder stateMappingProps(StateMappingMode mode) {
+ public static MappingProps.Builder stateMappingProps(StorageMappingMode mode) {
return stateMappingProps().mappingMode(mode);
}
- public static StorageProtocolProps.Builder storageProtocolProps() {
- return StorageProtocolProps.builder()
+ public static ProtocolProps.Builder storageProtocolProps() {
+ return ProtocolProps.builder()
.protocolMode(H2)
.h2Props(H2Props.builder()
.url("jdbc:h2:mem:bezmen;DB_CLOSE_DELAY=-1")
@@ -45,7 +45,7 @@ public static StorageProtocolProps.Builder storageProtocolProps() {
.build());
}
- public static StorageProtocolProps.Builder storageProtocolProps(StorageProtocolMode mode) {
+ public static StorageDomain.ProtocolProps.Builder storageProtocolProps(StorageProtocolMode mode) {
return storageProtocolProps().protocolMode(mode);
}
}
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/EdgeSide.java b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageEdge.java
similarity index 79%
rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/EdgeSide.java
rename to libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageEdge.java
index dde8c8d8..1562f742 100644
--- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/EdgeSide.java
+++ b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageEdge.java
@@ -7,21 +7,18 @@
import lombok.ToString;
import smecalculus.bezmen.validation.ValueOfEnum;
-public abstract class EdgeSide {
-
+public abstract class StorageEdge {
@Data
public static class StorageProps {
-
@NotNull
- StorageProtocolProps protocol;
+ ProtocolProps protocol;
@NotNull
- StateMappingProps mapping;
+ MappingProps mapping;
}
@Data
- public static class StorageProtocolProps {
-
+ public static class ProtocolProps {
@ValueOfEnum(StorageProtocolMode.class)
String mode;
@@ -33,15 +30,13 @@ public static class StorageProtocolProps {
}
@Data
- public static class StateMappingProps {
-
- @ValueOfEnum(StateMappingMode.class)
+ public static class MappingProps {
+ @ValueOfEnum(StorageMappingMode.class)
private String mode;
}
@Data
public static class PostgresProps {
-
@NotBlank
String url;
@@ -55,7 +50,6 @@ public static class PostgresProps {
@Data
public static class H2Props {
-
@NotBlank
String url;
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageEdgeEg.java b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageEdgeEg.java
new file mode 100644
index 00000000..20e5e0dd
--- /dev/null
+++ b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageEdgeEg.java
@@ -0,0 +1,29 @@
+package smecalculus.bezmen.configuration;
+
+import static smecalculus.bezmen.configuration.StorageMappingMode.SPRING_DATA;
+import static smecalculus.bezmen.configuration.StorageProtocolMode.H2;
+
+import smecalculus.bezmen.configuration.StorageEdge.MappingProps;
+import smecalculus.bezmen.configuration.StorageEdge.ProtocolProps;
+import smecalculus.bezmen.configuration.StorageEdge.StorageProps;
+
+public abstract class StorageEdgeEg {
+ public static StorageProps storageProps() {
+ var propsEdge = new StorageProps();
+ propsEdge.setMapping(stateMappingProps());
+ propsEdge.setProtocol(storageProtocolProps());
+ return propsEdge;
+ }
+
+ public static MappingProps stateMappingProps() {
+ var propsEdge = new StorageEdge.MappingProps();
+ propsEdge.setMode(SPRING_DATA.name());
+ return propsEdge;
+ }
+
+ public static ProtocolProps storageProtocolProps() {
+ var propsEdge = new ProtocolProps();
+ propsEdge.setMode(H2.name());
+ return propsEdge;
+ }
+}
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingMode.java b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageMappingMode.java
similarity index 69%
rename from libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingMode.java
rename to libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageMappingMode.java
index 40335f1a..44cc2f87 100644
--- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StateMappingMode.java
+++ b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageMappingMode.java
@@ -1,6 +1,6 @@
package smecalculus.bezmen.configuration;
-public enum StateMappingMode {
+public enum StorageMappingMode {
SPRING_DATA,
MY_BATIS
}
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsMapper.java b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsMapper.java
index 416025e8..156ed791 100644
--- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsMapper.java
+++ b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsMapper.java
@@ -6,24 +6,23 @@
@Mapper
public interface StoragePropsMapper extends EdgeMapper {
-
@Mapping(source = "protocol", target = "protocolProps")
@Mapping(source = "mapping", target = "mappingProps")
- ServerSide.StorageProps toServer(EdgeSide.StorageProps propsEdge);
+ StorageDomain.StorageProps toServer(StorageEdge.StorageProps propsEdge);
@Mapping(source = "mode", target = "protocolMode")
@Mapping(source = "h2", target = "h2Props")
@Mapping(source = "postgres", target = "postgresProps")
- ServerSide.StorageProtocolProps toServer(EdgeSide.StorageProtocolProps propsEdge);
+ StorageDomain.ProtocolProps toServer(StorageEdge.ProtocolProps propsEdge);
@Mapping(source = "mode", target = "mappingMode")
- ServerSide.StateMappingProps toServer(EdgeSide.StateMappingProps propsEdge);
+ StorageDomain.MappingProps toServer(StorageEdge.MappingProps propsEdge);
default StorageProtocolMode toProtocolMode(String mode) {
return StorageProtocolMode.valueOf(mode.toUpperCase());
}
- default StateMappingMode toMappingMode(String mode) {
- return StateMappingMode.valueOf(mode.toUpperCase());
+ default StorageMappingMode toMappingMode(String mode) {
+ return StorageMappingMode.valueOf(mode.toUpperCase());
}
}
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/ConditionalOnStateMappingMode.java b/libs/storage/src/main/java/smecalculus/bezmen/construction/ConditionalOnStateMappingMode.java
index 3b1eb03c..23d10d62 100644
--- a/libs/storage/src/main/java/smecalculus/bezmen/construction/ConditionalOnStateMappingMode.java
+++ b/libs/storage/src/main/java/smecalculus/bezmen/construction/ConditionalOnStateMappingMode.java
@@ -5,11 +5,11 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import org.springframework.context.annotation.Conditional;
-import smecalculus.bezmen.configuration.StateMappingMode;
+import smecalculus.bezmen.configuration.StorageMappingMode;
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Conditional(StateMappingModeCondition.class)
public @interface ConditionalOnStateMappingMode {
- StateMappingMode value();
+ StorageMappingMode value();
}
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingMyBatisBeans.java b/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingMyBatisBeans.java
index a0a50d21..b2b82841 100644
--- a/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingMyBatisBeans.java
+++ b/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingMyBatisBeans.java
@@ -1,6 +1,6 @@
package smecalculus.bezmen.construction;
-import static smecalculus.bezmen.configuration.StateMappingMode.MY_BATIS;
+import static smecalculus.bezmen.configuration.StorageMappingMode.MY_BATIS;
import javax.sql.DataSource;
import org.apache.ibatis.session.SqlSessionFactory;
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingSpringDataBeans.java b/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingSpringDataBeans.java
index cd914f41..5191b7a2 100644
--- a/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingSpringDataBeans.java
+++ b/libs/storage/src/main/java/smecalculus/bezmen/construction/MappingSpringDataBeans.java
@@ -1,6 +1,6 @@
package smecalculus.bezmen.construction;
-import static smecalculus.bezmen.configuration.StateMappingMode.SPRING_DATA;
+import static smecalculus.bezmen.configuration.StorageMappingMode.SPRING_DATA;
import java.util.Optional;
import javax.sql.DataSource;
@@ -21,7 +21,7 @@
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
-import smecalculus.bezmen.configuration.ServerSide.StorageProps;
+import smecalculus.bezmen.configuration.StorageDomain.StorageProps;
@ConditionalOnStateMappingMode(SPRING_DATA)
@EnableJdbcRepositories("smecalculus.bezmen.storage.springdata")
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/StateMappingModeCondition.java b/libs/storage/src/main/java/smecalculus/bezmen/construction/StateMappingModeCondition.java
index fb5eb11a..08872015 100644
--- a/libs/storage/src/main/java/smecalculus/bezmen/construction/StateMappingModeCondition.java
+++ b/libs/storage/src/main/java/smecalculus/bezmen/construction/StateMappingModeCondition.java
@@ -6,15 +6,15 @@
import org.springframework.context.annotation.ConditionContext;
import org.springframework.context.annotation.ConfigurationCondition;
import org.springframework.core.type.AnnotatedTypeMetadata;
-import smecalculus.bezmen.configuration.ServerSide.StorageProps;
-import smecalculus.bezmen.configuration.StateMappingMode;
+import smecalculus.bezmen.configuration.StorageDomain.StorageProps;
+import smecalculus.bezmen.configuration.StorageMappingMode;
class StateMappingModeCondition implements ConfigurationCondition {
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
var attributes = metadata.getAnnotationAttributes(ConditionalOnStateMappingMode.class.getName());
- var mode = (StateMappingMode) attributes.get("value");
+ var mode = (StorageMappingMode) attributes.get("value");
var props = context.getBeanFactory().getBean(StorageProps.class);
return mode == props.mappingProps().mappingMode();
}
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageBeans.java b/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageBeans.java
index 7759da8b..439d56d4 100644
--- a/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageBeans.java
+++ b/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageBeans.java
@@ -5,9 +5,9 @@
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.jdbc.datasource.DriverManagerDataSource;
-import smecalculus.bezmen.configuration.ServerSide.H2Props;
-import smecalculus.bezmen.configuration.ServerSide.PostgresProps;
-import smecalculus.bezmen.configuration.ServerSide.StorageProps;
+import smecalculus.bezmen.configuration.StorageDomain.H2Props;
+import smecalculus.bezmen.configuration.StorageDomain.PostgresProps;
+import smecalculus.bezmen.configuration.StorageDomain.StorageProps;
@Import({StorageConfigBeans.class, MappingMyBatisBeans.class, MappingSpringDataBeans.class})
@Configuration(proxyBeanMethods = false)
diff --git a/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageConfigBeans.java b/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageConfigBeans.java
index 09610c59..d20ba1b2 100644
--- a/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageConfigBeans.java
+++ b/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageConfigBeans.java
@@ -5,9 +5,9 @@
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
-import smecalculus.bezmen.configuration.EdgeSide;
import smecalculus.bezmen.configuration.PropsKeeper;
-import smecalculus.bezmen.configuration.ServerSide.StorageProps;
+import smecalculus.bezmen.configuration.StorageDomain.StorageProps;
+import smecalculus.bezmen.configuration.StorageEdge;
import smecalculus.bezmen.configuration.StoragePropsMapper;
import smecalculus.bezmen.configuration.StoragePropsMapperImpl;
import smecalculus.bezmen.validation.EdgeValidator;
@@ -25,7 +25,7 @@ StoragePropsMapper storagePropsMapper() {
@Bean
StorageProps storageProps(PropsKeeper keeper, EdgeValidator validator, StoragePropsMapper mapper) {
- var propsEdge = keeper.read("bezmen.storage", EdgeSide.StorageProps.class);
+ var propsEdge = keeper.read("bezmen.storage", StorageEdge.StorageProps.class);
validator.validate(propsEdge);
LOG.info("Read {}", propsEdge);
return mapper.toServer(propsEdge);
diff --git a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansIT.java b/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansIT.java
index f5018437..441551f0 100644
--- a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansIT.java
+++ b/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansIT.java
@@ -1,14 +1,14 @@
package smecalculus.bezmen.construction;
import static org.assertj.core.api.Assertions.assertThat;
-import static smecalculus.bezmen.configuration.ServerSideEg.storageProps;
+import static smecalculus.bezmen.configuration.StorageDomainEg.storageProps;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit.jupiter.SpringExtension;
-import smecalculus.bezmen.configuration.ServerSide.StorageProps;
+import smecalculus.bezmen.configuration.StorageDomain.StorageProps;
@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = {StorageConfigBeans.class, ConfigBeans.class, ValidationBeans.class})
diff --git a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansTest.java b/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansTest.java
index 652d4b23..04f98dd4 100644
--- a/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansTest.java
+++ b/libs/storage/src/test/java/smecalculus/bezmen/construction/StorageConfigBeansTest.java
@@ -3,12 +3,12 @@
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
-import static smecalculus.bezmen.configuration.EdgeSideEg.storageProps;
+import static smecalculus.bezmen.configuration.StorageEdgeEg.storageProps;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
-import smecalculus.bezmen.configuration.EdgeSide.StorageProps;
import smecalculus.bezmen.configuration.PropsKeeper;
+import smecalculus.bezmen.configuration.StorageEdge.StorageProps;
import smecalculus.bezmen.configuration.StoragePropsMapper;
import smecalculus.bezmen.configuration.StoragePropsMapperImpl;
import smecalculus.bezmen.validation.EdgeValidator;
diff --git a/libs/testing/src/main/java/smecalculus/bezmen/messaging/SepulkaClientSpringWebTest.java b/libs/testing/src/main/java/smecalculus/bezmen/messaging/SepulkaClientSpringWebTest.java
index 55e5d55c..6997edbf 100644
--- a/libs/testing/src/main/java/smecalculus/bezmen/messaging/SepulkaClientSpringWebTest.java
+++ b/libs/testing/src/main/java/smecalculus/bezmen/messaging/SepulkaClientSpringWebTest.java
@@ -4,8 +4,8 @@
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.test.web.reactive.server.WebTestClient;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationRequest;
-import smecalculus.bezmen.messaging.EdgeSide.RegistrationResponse;
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationRequest;
+import smecalculus.bezmen.messaging.MessageEdge.RegistrationResponse;
@RequiredArgsConstructor
public class SepulkaClientSpringWebTest implements SepulkaClient {
diff --git a/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java b/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java
index ea28af5e..31201cb4 100644
--- a/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java
+++ b/tests/e2e/src/test/java/smecalculus/bezmen/registration/SepulkaTest.java
@@ -14,7 +14,7 @@
import org.springframework.test.context.junit.jupiter.SpringExtension;
import smecalculus.bezmen.StandBeans;
import smecalculus.bezmen.messaging.BezmenClient;
-import smecalculus.bezmen.messaging.EdgeSideEg;
+import smecalculus.bezmen.messaging.MessageEdgeEg;
@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = StandBeans.class)
@@ -32,9 +32,9 @@ void beforeAll() {
@Tag("smoke")
void shouldRegisterSepulka() {
// given
- var request = EdgeSideEg.registrationRequest();
+ var request = MessageEdgeEg.registrationRequest();
// and
- var expectedResponse = EdgeSideEg.registrationResponse(request.getExternalId());
+ var expectedResponse = MessageEdgeEg.registrationResponse(request.getExternalId());
// when
var actualResponse = bezmenClient.register(request);
// then