+++ /dev/null
-package de.juplo.kafka.chat.backend.domain;
-
-import lombok.Getter;
-
-
-public class InvalidUsernameException extends RuntimeException
-{
- @Getter
- private final String username;
-
- public InvalidUsernameException(String username)
- {
- super("Invalid username: " + username);
- this.username = username;
- }
-}
+++ /dev/null
-package de.juplo.kafka.chat.backend.domain;
-
-
-public class LoadInProgressException extends IllegalStateException
-{
- public LoadInProgressException()
- {
- super("Load in progress...");
- }
-}
+++ /dev/null
-package de.juplo.kafka.chat.backend.domain;
-
-import lombok.Getter;
-
-
-public class MessageMutationException extends RuntimeException
-{
- @Getter
- private final Message existing;
- @Getter
- private final String mutatedText;
-
- public MessageMutationException(Message existing, String mutatedText)
- {
- super("Messages are imutable!");
- this.existing = existing;
- this.mutatedText = mutatedText;
- }
-}
+++ /dev/null
-package de.juplo.kafka.chat.backend.domain;
-
-import lombok.Getter;
-
-
-public class ShardNotOwnedException extends IllegalStateException
-{
- @Getter
- private final int shard;
-
-
- public ShardNotOwnedException(int shard)
- {
- super("This instance does not own the shard " + shard);
- this.shard = shard;
- }
-}
+++ /dev/null
-package de.juplo.kafka.chat.backend.domain;
-
-import lombok.Getter;
-
-import java.util.Arrays;
-import java.util.Optional;
-import java.util.UUID;
-import java.util.stream.Collectors;
-
-
-public class UnknownChatroomException extends IllegalStateException
-{
- @Getter
- private final UUID chatroomId;
- @Getter
- private final Optional<Integer> shard;
- @Getter
- private final Optional<int[]> ownedShards;
-
- public UnknownChatroomException(UUID chatroomId)
- {
- super("Chatroom does not exist: " + chatroomId);
- this.chatroomId = chatroomId;
- this.shard = Optional.empty();
- this.ownedShards = Optional.empty();
- }
-
- public UnknownChatroomException(UUID chatroomId, int shard, int[] ownedShards)
- {
- super(
- "Chatroom does not exist (here): " +
- chatroomId +
- " shard=" +
- shard +
- ", owned=" +
- Arrays
- .stream(ownedShards)
- .mapToObj(ownedShard -> Integer.toString(ownedShard))
- .collect(Collectors.joining(",")));
- this.chatroomId = chatroomId;
- this.shard = Optional.of(shard);
- this.ownedShards = Optional.of(ownedShards);
- }
-}
--- /dev/null
+package de.juplo.kafka.chat.backend.domain;
+
+import lombok.Getter;
+
+
+public class InvalidUsernameException extends RuntimeException
+{
+ @Getter
+ private final String username;
+
+ public InvalidUsernameException(String username)
+ {
+ super("Invalid username: " + username);
+ this.username = username;
+ }
+}
--- /dev/null
+package de.juplo.kafka.chat.backend.domain;
+
+
+public class LoadInProgressException extends IllegalStateException
+{
+ public LoadInProgressException()
+ {
+ super("Load in progress...");
+ }
+}
--- /dev/null
+package de.juplo.kafka.chat.backend.domain;
+
+import lombok.Getter;
+
+
+public class MessageMutationException extends RuntimeException
+{
+ @Getter
+ private final Message existing;
+ @Getter
+ private final String mutatedText;
+
+ public MessageMutationException(Message existing, String mutatedText)
+ {
+ super("Messages are imutable!");
+ this.existing = existing;
+ this.mutatedText = mutatedText;
+ }
+}
--- /dev/null
+package de.juplo.kafka.chat.backend.domain;
+
+import lombok.Getter;
+
+
+public class ShardNotOwnedException extends IllegalStateException
+{
+ @Getter
+ private final int shard;
+
+
+ public ShardNotOwnedException(int shard)
+ {
+ super("This instance does not own the shard " + shard);
+ this.shard = shard;
+ }
+}
--- /dev/null
+package de.juplo.kafka.chat.backend.domain;
+
+import lombok.Getter;
+
+import java.util.Arrays;
+import java.util.Optional;
+import java.util.UUID;
+import java.util.stream.Collectors;
+
+
+public class UnknownChatroomException extends IllegalStateException
+{
+ @Getter
+ private final UUID chatroomId;
+ @Getter
+ private final Optional<Integer> shard;
+ @Getter
+ private final Optional<int[]> ownedShards;
+
+ public UnknownChatroomException(UUID chatroomId)
+ {
+ super("Chatroom does not exist: " + chatroomId);
+ this.chatroomId = chatroomId;
+ this.shard = Optional.empty();
+ this.ownedShards = Optional.empty();
+ }
+
+ public UnknownChatroomException(UUID chatroomId, int shard, int[] ownedShards)
+ {
+ super(
+ "Chatroom does not exist (here): " +
+ chatroomId +
+ " shard=" +
+ shard +
+ ", owned=" +
+ Arrays
+ .stream(ownedShards)
+ .mapToObj(ownedShard -> Integer.toString(ownedShard))
+ .collect(Collectors.joining(",")));
+ this.chatroomId = chatroomId;
+ this.shard = Optional.of(shard);
+ this.ownedShards = Optional.of(ownedShards);
+ }
+}