X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Fkafka%2Fchat%2Fbackend%2Fpersistence%2Fstorage%2Ffiles%2FFilesStorageStrategy.java;h=1fd307f5ff29d0875d57e24fa4f718d8266144f5;hb=fad1a04e738182403490b11575653e3a1130fd48;hp=9952117b3fc2adc78cadf6052cf51031a4e928d8;hpb=bc6e23259c4a822a961b00f221baf5f6018d73a6;p=demos%2Fkafka%2Fchat diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageStrategy.java index 9952117b..1fd307f5 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageStrategy.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/files/FilesStorageStrategy.java @@ -1,4 +1,4 @@ -package de.juplo.kafka.chat.backend.persistence.filestorage; +package de.juplo.kafka.chat.backend.persistence.storage.files; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JavaType; @@ -23,7 +23,7 @@ import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING; @RequiredArgsConstructor @Slf4j -public class FileStorageStrategy implements StorageStrategy +public class FilesStorageStrategy implements StorageStrategy { public static final String CHATROOMS_FILENAME = "chatrooms.json"; @@ -36,7 +36,7 @@ public class FileStorageStrategy implements StorageStrategy @Override - public void writeChatrooms(Flux chatroomFlux) + public void write(Flux chatroomFlux) { Path path = chatroomsPath(); log.info("Writing chatrooms to {}", path); @@ -96,7 +96,7 @@ public class FileStorageStrategy implements StorageStrategy } @Override - public Flux readChatrooms() + public Flux read() { JavaType type = mapper.getTypeFactory().constructType(ChatRoomTo.class); return Flux @@ -110,7 +110,6 @@ public class FileStorageStrategy implements StorageStrategy bufferSize)); } - @Override public void writeMessages(ChatRoomTo chatroomTo, Flux messageFlux) { Path path = chatroomPath(chatroomTo); @@ -169,7 +168,6 @@ public class FileStorageStrategy implements StorageStrategy } } - @Override public Flux readMessages(ChatRoomTo chatroomTo) { JavaType type = mapper.getTypeFactory().constructType(MessageTo.class);