diff --git a/api/src/main/java/io/xpipe/api/impl/DataTableImpl.java b/api/src/main/java/io/xpipe/api/impl/DataTableImpl.java index c3c82bfdd..4525a7f5e 100644 --- a/api/src/main/java/io/xpipe/api/impl/DataTableImpl.java +++ b/api/src/main/java/io/xpipe/api/impl/DataTableImpl.java @@ -6,8 +6,8 @@ import io.xpipe.beacon.ClientException; import io.xpipe.beacon.ConnectorException; import io.xpipe.beacon.ServerException; import io.xpipe.beacon.socket.SocketClient; -import io.xpipe.beacon.message.impl.ReadTableDataExchange; -import io.xpipe.beacon.message.impl.ReadTableInfoExchange; +import io.xpipe.beacon.exchange.ReadTableDataExchange; +import io.xpipe.beacon.exchange.ReadTableInfoExchange; import io.xpipe.core.data.DataStructureNode; import io.xpipe.core.data.generic.ArrayNode; import io.xpipe.core.data.generic.TupleNode; diff --git a/beacon/src/main/java/io/xpipe/beacon/message/impl/ListCollectionsExchange.java b/beacon/src/main/java/io/xpipe/beacon/exchange/ListCollectionsExchange.java similarity index 89% rename from beacon/src/main/java/io/xpipe/beacon/message/impl/ListCollectionsExchange.java rename to beacon/src/main/java/io/xpipe/beacon/exchange/ListCollectionsExchange.java index 24f2955c3..f91ab35ca 100644 --- a/beacon/src/main/java/io/xpipe/beacon/message/impl/ListCollectionsExchange.java +++ b/beacon/src/main/java/io/xpipe/beacon/exchange/ListCollectionsExchange.java @@ -1,6 +1,5 @@ -package io.xpipe.beacon.message.impl; +package io.xpipe.beacon.exchange; -import io.xpipe.beacon.message.MessageExchange; import io.xpipe.beacon.message.RequestMessage; import io.xpipe.beacon.message.ResponseMessage; diff --git a/beacon/src/main/java/io/xpipe/beacon/message/impl/ListEntriesExchange.java b/beacon/src/main/java/io/xpipe/beacon/exchange/ListEntriesExchange.java similarity index 77% rename from beacon/src/main/java/io/xpipe/beacon/message/impl/ListEntriesExchange.java rename to beacon/src/main/java/io/xpipe/beacon/exchange/ListEntriesExchange.java index f3a380a13..1ee11c160 100644 --- a/beacon/src/main/java/io/xpipe/beacon/message/impl/ListEntriesExchange.java +++ b/beacon/src/main/java/io/xpipe/beacon/exchange/ListEntriesExchange.java @@ -1,12 +1,11 @@ -package io.xpipe.beacon.message.impl; +package io.xpipe.beacon.exchange; -import io.xpipe.beacon.message.MessageExchange; import io.xpipe.beacon.message.RequestMessage; import io.xpipe.beacon.message.ResponseMessage; import java.util.List; -public class ListEntriesExchange implements MessageExchange { +public abstract class ListEntriesExchange implements MessageExchange { @Override public String getId() { diff --git a/beacon/src/main/java/io/xpipe/beacon/message/MessageExchange.java b/beacon/src/main/java/io/xpipe/beacon/exchange/MessageExchange.java similarity index 54% rename from beacon/src/main/java/io/xpipe/beacon/message/MessageExchange.java rename to beacon/src/main/java/io/xpipe/beacon/exchange/MessageExchange.java index 7e56a054d..aeb4f726a 100644 --- a/beacon/src/main/java/io/xpipe/beacon/message/MessageExchange.java +++ b/beacon/src/main/java/io/xpipe/beacon/exchange/MessageExchange.java @@ -1,5 +1,7 @@ -package io.xpipe.beacon.message; +package io.xpipe.beacon.exchange; +import io.xpipe.beacon.message.RequestMessage; +import io.xpipe.beacon.message.ResponseMessage; import io.xpipe.beacon.socket.SocketServer; import java.io.InputStream; @@ -13,5 +15,5 @@ public interface MessageExchange getResponseClass(); - default void handleRequest(SocketServer server, RQ msg, InputStream body, Socket clientSocket) throws Exception {} + void handleRequest(SocketServer server, RQ msg, InputStream body, Socket clientSocket) throws Exception; } diff --git a/beacon/src/main/java/io/xpipe/beacon/message/MessageExchanges.java b/beacon/src/main/java/io/xpipe/beacon/exchange/MessageExchanges.java similarity index 92% rename from beacon/src/main/java/io/xpipe/beacon/message/MessageExchanges.java rename to beacon/src/main/java/io/xpipe/beacon/exchange/MessageExchanges.java index a37448e0c..f780aceb0 100644 --- a/beacon/src/main/java/io/xpipe/beacon/message/MessageExchanges.java +++ b/beacon/src/main/java/io/xpipe/beacon/exchange/MessageExchanges.java @@ -1,4 +1,7 @@ -package io.xpipe.beacon.message; +package io.xpipe.beacon.exchange; + +import io.xpipe.beacon.message.RequestMessage; +import io.xpipe.beacon.message.ResponseMessage; import java.util.Optional; import java.util.ServiceLoader; diff --git a/beacon/src/main/java/io/xpipe/beacon/message/impl/ModeExchange.java b/beacon/src/main/java/io/xpipe/beacon/exchange/ModeExchange.java similarity index 88% rename from beacon/src/main/java/io/xpipe/beacon/message/impl/ModeExchange.java rename to beacon/src/main/java/io/xpipe/beacon/exchange/ModeExchange.java index 23a3b1009..264d416a9 100644 --- a/beacon/src/main/java/io/xpipe/beacon/message/impl/ModeExchange.java +++ b/beacon/src/main/java/io/xpipe/beacon/exchange/ModeExchange.java @@ -1,6 +1,5 @@ -package io.xpipe.beacon.message.impl; +package io.xpipe.beacon.exchange; -import io.xpipe.beacon.message.MessageExchange; import io.xpipe.beacon.message.RequestMessage; import io.xpipe.beacon.message.ResponseMessage; diff --git a/beacon/src/main/java/io/xpipe/beacon/message/impl/ReadStructureExchange.java b/beacon/src/main/java/io/xpipe/beacon/exchange/ReadStructureExchange.java similarity index 89% rename from beacon/src/main/java/io/xpipe/beacon/message/impl/ReadStructureExchange.java rename to beacon/src/main/java/io/xpipe/beacon/exchange/ReadStructureExchange.java index b43ec3168..fad9e29c2 100644 --- a/beacon/src/main/java/io/xpipe/beacon/message/impl/ReadStructureExchange.java +++ b/beacon/src/main/java/io/xpipe/beacon/exchange/ReadStructureExchange.java @@ -1,6 +1,5 @@ -package io.xpipe.beacon.message.impl; +package io.xpipe.beacon.exchange; -import io.xpipe.beacon.message.MessageExchange; import io.xpipe.beacon.message.RequestMessage; import io.xpipe.beacon.message.ResponseMessage; import io.xpipe.core.source.DataSourceId; diff --git a/beacon/src/main/java/io/xpipe/beacon/message/impl/ReadTableDataExchange.java b/beacon/src/main/java/io/xpipe/beacon/exchange/ReadTableDataExchange.java similarity index 90% rename from beacon/src/main/java/io/xpipe/beacon/message/impl/ReadTableDataExchange.java rename to beacon/src/main/java/io/xpipe/beacon/exchange/ReadTableDataExchange.java index 5f985f74d..9cadb7ea1 100644 --- a/beacon/src/main/java/io/xpipe/beacon/message/impl/ReadTableDataExchange.java +++ b/beacon/src/main/java/io/xpipe/beacon/exchange/ReadTableDataExchange.java @@ -1,6 +1,5 @@ -package io.xpipe.beacon.message.impl; +package io.xpipe.beacon.exchange; -import io.xpipe.beacon.message.MessageExchange; import io.xpipe.beacon.message.RequestMessage; import io.xpipe.beacon.message.ResponseMessage; import io.xpipe.core.source.DataSourceId; diff --git a/beacon/src/main/java/io/xpipe/beacon/message/impl/ReadTableInfoExchange.java b/beacon/src/main/java/io/xpipe/beacon/exchange/ReadTableInfoExchange.java similarity index 91% rename from beacon/src/main/java/io/xpipe/beacon/message/impl/ReadTableInfoExchange.java rename to beacon/src/main/java/io/xpipe/beacon/exchange/ReadTableInfoExchange.java index 27993f7e0..f7ff18fbf 100644 --- a/beacon/src/main/java/io/xpipe/beacon/message/impl/ReadTableInfoExchange.java +++ b/beacon/src/main/java/io/xpipe/beacon/exchange/ReadTableInfoExchange.java @@ -1,6 +1,5 @@ -package io.xpipe.beacon.message.impl; +package io.xpipe.beacon.exchange; -import io.xpipe.beacon.message.MessageExchange; import io.xpipe.beacon.message.RequestMessage; import io.xpipe.beacon.message.ResponseMessage; import io.xpipe.core.data.type.DataType; diff --git a/beacon/src/main/java/io/xpipe/beacon/message/impl/StatusExchange.java b/beacon/src/main/java/io/xpipe/beacon/exchange/StatusExchange.java similarity index 88% rename from beacon/src/main/java/io/xpipe/beacon/message/impl/StatusExchange.java rename to beacon/src/main/java/io/xpipe/beacon/exchange/StatusExchange.java index cc5d1b01f..a8e2a333d 100644 --- a/beacon/src/main/java/io/xpipe/beacon/message/impl/StatusExchange.java +++ b/beacon/src/main/java/io/xpipe/beacon/exchange/StatusExchange.java @@ -1,6 +1,5 @@ -package io.xpipe.beacon.message.impl; +package io.xpipe.beacon.exchange; -import io.xpipe.beacon.message.MessageExchange; import io.xpipe.beacon.message.RequestMessage; import io.xpipe.beacon.message.ResponseMessage; diff --git a/beacon/src/main/java/io/xpipe/beacon/message/impl/VersionExchange.java b/beacon/src/main/java/io/xpipe/beacon/exchange/VersionExchange.java similarity index 91% rename from beacon/src/main/java/io/xpipe/beacon/message/impl/VersionExchange.java rename to beacon/src/main/java/io/xpipe/beacon/exchange/VersionExchange.java index 910ae3bda..6e7bee624 100644 --- a/beacon/src/main/java/io/xpipe/beacon/message/impl/VersionExchange.java +++ b/beacon/src/main/java/io/xpipe/beacon/exchange/VersionExchange.java @@ -1,6 +1,5 @@ -package io.xpipe.beacon.message.impl; +package io.xpipe.beacon.exchange; -import io.xpipe.beacon.message.MessageExchange; import io.xpipe.beacon.message.RequestMessage; import io.xpipe.beacon.message.ResponseMessage; diff --git a/beacon/src/main/java/io/xpipe/beacon/socket/SocketClient.java b/beacon/src/main/java/io/xpipe/beacon/socket/SocketClient.java index af2adefcd..a7df9c19e 100644 --- a/beacon/src/main/java/io/xpipe/beacon/socket/SocketClient.java +++ b/beacon/src/main/java/io/xpipe/beacon/socket/SocketClient.java @@ -6,10 +6,12 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; -import io.xpipe.beacon.ClientException; -import io.xpipe.beacon.ConnectorException; -import io.xpipe.beacon.ServerException; -import io.xpipe.beacon.message.*; +import io.xpipe.beacon.*; +import io.xpipe.beacon.exchange.MessageExchanges; +import io.xpipe.beacon.message.ClientErrorMessage; +import io.xpipe.beacon.message.RequestMessage; +import io.xpipe.beacon.message.ResponseMessage; +import io.xpipe.beacon.message.ServerErrorMessage; import io.xpipe.core.util.JacksonHelper; import org.apache.commons.lang3.function.FailableBiConsumer; import org.slf4j.Logger; diff --git a/beacon/src/main/java/io/xpipe/beacon/socket/SocketServer.java b/beacon/src/main/java/io/xpipe/beacon/socket/SocketServer.java index b2818496c..a99ac1196 100644 --- a/beacon/src/main/java/io/xpipe/beacon/socket/SocketServer.java +++ b/beacon/src/main/java/io/xpipe/beacon/socket/SocketServer.java @@ -6,7 +6,11 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; -import io.xpipe.beacon.message.*; +import io.xpipe.beacon.exchange.MessageExchanges; +import io.xpipe.beacon.message.ClientErrorMessage; +import io.xpipe.beacon.message.RequestMessage; +import io.xpipe.beacon.message.ResponseMessage; +import io.xpipe.beacon.message.ServerErrorMessage; import io.xpipe.core.util.JacksonHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/beacon/src/main/java/module-info.java b/beacon/src/main/java/module-info.java index bafee2e45..325513152 100644 --- a/beacon/src/main/java/module-info.java +++ b/beacon/src/main/java/module-info.java @@ -1,9 +1,9 @@ -import io.xpipe.beacon.message.MessageExchange; +import io.xpipe.beacon.exchange.MessageExchange; module io.xpipe.beacon { exports io.xpipe.beacon; + exports io.xpipe.beacon.exchange; exports io.xpipe.beacon.message; - exports io.xpipe.beacon.message.impl; requires org.slf4j; requires org.slf4j.simple; @@ -13,10 +13,10 @@ module io.xpipe.beacon { requires io.xpipe.core; opens io.xpipe.beacon; - opens io.xpipe.beacon.message; - opens io.xpipe.beacon.message.impl; + opens io.xpipe.beacon.exchange; exports io.xpipe.beacon.socket; opens io.xpipe.beacon.socket; + opens io.xpipe.beacon.message; requires org.apache.commons.lang;