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 e5c20ad0..f149c838 100644 --- a/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java +++ b/apps/sepuling/src/main/java/smecalculus/bezmen/core/SepulkaServiceImpl.java @@ -25,14 +25,14 @@ public class SepulkaServiceImpl implements SepulkaService { @Override public RegistrationResponse register(RegistrationRequest request) { var now = LocalDateTime.now(); - var sepulkaCreated = mapper.toServer(request) + var sepulkaCreated = mapper.toState(request) .internalId(randomUUID()) .revision(0) .createdAt(now) .updatedAt(now) .build(); var sepulkaSaved = dao.add(sepulkaCreated); - return mapper.toClient(sepulkaSaved).build(); + return mapper.toMessage(sepulkaSaved).build(); } @Override 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 4a3d062c..e03f1f32 100644 --- a/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaMapper.java +++ b/libs/abstraction/src/main/java/smecalculus/bezmen/core/SepulkaMapper.java @@ -7,7 +7,7 @@ @Mapper public interface SepulkaMapper { - AggregateState.Builder toServer(RegistrationRequest request); + AggregateState.Builder toState(RegistrationRequest request); - RegistrationResponse.Builder toClient(AggregateState state); + RegistrationResponse.Builder toMessage(AggregateState state); } diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomain.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomain.java index 69830499..2cadb817 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomain.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomain.java @@ -6,8 +6,7 @@ public abstract class MessagingDomain { @Builder - public record MessagingProps( - @NonNull MessagingDomain.ProtocolProps protocolProps, @NonNull MessagingDomain.MappingProps mappingProps) {} + public record MessagingProps(@NonNull ProtocolProps protocolProps, @NonNull MappingProps mappingProps) {} @Builder public record ProtocolProps(@NonNull Set protocolModes) {} diff --git a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomainEg.java b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomainEg.java index 65812901..21e2f314 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomainEg.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/configuration/MessagingDomainEg.java @@ -11,15 +11,15 @@ public abstract class MessagingDomainEg { public static MessagingProps.Builder messagingProps() { return MessagingProps.builder() - .protocolProps(messagingProtocolProps().build()) - .mappingProps(messageMappingProps().build()); + .protocolProps(protocolProps().build()) + .mappingProps(mappingProps().build()); } - public static ProtocolProps.Builder messagingProtocolProps() { + public static ProtocolProps.Builder protocolProps() { return MessagingDomain.ProtocolProps.builder().protocolModes(Set.of(HTTP)); } - public static MappingProps.Builder messageMappingProps() { + public static MappingProps.Builder mappingProps() { return MappingProps.builder().mappingModes(Set.of(SPRING_MVC)); } } 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 44cb2db1..379509e7 100644 --- a/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingConfigBeans.java +++ b/libs/messaging/src/main/java/smecalculus/bezmen/construction/MessagingConfigBeans.java @@ -24,7 +24,8 @@ MessagingPropsMapper messagingPropsMapper() { } @Bean - MessagingDomain.MessagingProps messagingProps(PropsKeeper keeper, EdgeValidator validator, MessagingPropsMapper mapper) { + 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); diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomain.java b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomain.java index dc16134e..eeae4a8b 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomain.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomain.java @@ -6,7 +6,7 @@ public abstract class StorageDomain { @Builder - public record StorageProps(@NonNull StorageDomain.ProtocolProps protocolProps, @NonNull StorageDomain.MappingProps mappingProps) {} + public record StorageProps(@NonNull ProtocolProps protocolProps, @NonNull MappingProps mappingProps) {} @Builder public record ProtocolProps( diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomainEg.java b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomainEg.java index 04bb3886..93d589cf 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomainEg.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageDomainEg.java @@ -12,25 +12,25 @@ public abstract class StorageDomainEg { public static StorageProps.Builder storageProps() { return StorageProps.builder() - .protocolProps(storageProtocolProps().build()) - .mappingProps(stateMappingProps().build()); + .protocolProps(protocolProps().build()) + .mappingProps(mappingProps().build()); } public static StorageProps.Builder storageProps(StorageMappingMode mappingMode, StorageProtocolMode protocolMode) { return storageProps() - .protocolProps(storageProtocolProps(protocolMode).build()) - .mappingProps(stateMappingProps(mappingMode).build()); + .protocolProps(protocolProps(protocolMode).build()) + .mappingProps(mappingProps(mappingMode).build()); } - public static MappingProps.Builder stateMappingProps() { + public static MappingProps.Builder mappingProps() { return MappingProps.builder().mappingMode(SPRING_DATA); } - public static MappingProps.Builder stateMappingProps(StorageMappingMode mode) { - return stateMappingProps().mappingMode(mode); + public static MappingProps.Builder mappingProps(StorageMappingMode mode) { + return mappingProps().mappingMode(mode); } - public static ProtocolProps.Builder storageProtocolProps() { + public static ProtocolProps.Builder protocolProps() { return ProtocolProps.builder() .protocolMode(H2) .h2Props(H2Props.builder() @@ -45,7 +45,7 @@ public static ProtocolProps.Builder storageProtocolProps() { .build()); } - public static StorageDomain.ProtocolProps.Builder storageProtocolProps(StorageProtocolMode mode) { - return storageProtocolProps().protocolMode(mode); + public static ProtocolProps.Builder protocolProps(StorageProtocolMode mode) { + return protocolProps().protocolMode(mode); } } diff --git a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageEdgeEg.java b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageEdgeEg.java index 20e5e0dd..296d2a15 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageEdgeEg.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StorageEdgeEg.java @@ -10,18 +10,18 @@ public abstract class StorageEdgeEg { public static StorageProps storageProps() { var propsEdge = new StorageProps(); - propsEdge.setMapping(stateMappingProps()); - propsEdge.setProtocol(storageProtocolProps()); + propsEdge.setMapping(mappingProps()); + propsEdge.setProtocol(protocolProps()); return propsEdge; } - public static MappingProps stateMappingProps() { - var propsEdge = new StorageEdge.MappingProps(); + public static MappingProps mappingProps() { + var propsEdge = new MappingProps(); propsEdge.setMode(SPRING_DATA.name()); return propsEdge; } - public static ProtocolProps storageProtocolProps() { + public static ProtocolProps protocolProps() { var propsEdge = new ProtocolProps(); propsEdge.setMode(H2.name()); return propsEdge; 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 156ed791..d2813e25 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsMapper.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/configuration/StoragePropsMapper.java @@ -8,15 +8,15 @@ public interface StoragePropsMapper extends EdgeMapper { @Mapping(source = "protocol", target = "protocolProps") @Mapping(source = "mapping", target = "mappingProps") - StorageDomain.StorageProps toServer(StorageEdge.StorageProps propsEdge); + StorageDomain.StorageProps toDomain(StorageEdge.StorageProps propsEdge); @Mapping(source = "mode", target = "protocolMode") @Mapping(source = "h2", target = "h2Props") @Mapping(source = "postgres", target = "postgresProps") - StorageDomain.ProtocolProps toServer(StorageEdge.ProtocolProps propsEdge); + StorageDomain.ProtocolProps toDomain(StorageEdge.ProtocolProps propsEdge); @Mapping(source = "mode", target = "mappingMode") - StorageDomain.MappingProps toServer(StorageEdge.MappingProps propsEdge); + StorageDomain.MappingProps toDomain(StorageEdge.MappingProps propsEdge); default StorageProtocolMode toProtocolMode(String mode) { return StorageProtocolMode.valueOf(mode.toUpperCase()); 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 d20ba1b2..d2c9901c 100644 --- a/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageConfigBeans.java +++ b/libs/storage/src/main/java/smecalculus/bezmen/construction/StorageConfigBeans.java @@ -28,6 +28,6 @@ StorageProps storageProps(PropsKeeper keeper, EdgeValidator validator, StoragePr var propsEdge = keeper.read("bezmen.storage", StorageEdge.StorageProps.class); validator.validate(propsEdge); LOG.info("Read {}", propsEdge); - return mapper.toServer(propsEdge); + return mapper.toDomain(propsEdge); } }