mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-27 19:05:46 +00:00
Rework various parts
This commit is contained in:
@@ -18,6 +18,7 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -134,6 +135,8 @@ public class BeaconClient implements AutoCloseable {
|
||||
try {
|
||||
var in = socket.getInputStream();
|
||||
read = JacksonHelper.newMapper().disable(JsonParser.Feature.AUTO_CLOSE_SOURCE).readTree(in);
|
||||
} catch (SocketException ex) {
|
||||
throw new ConnectorException("Connection to xpipe daemon closed unexpectedly");
|
||||
} catch (IOException ex) {
|
||||
throw new ConnectorException("Couldn't read from socket", ex);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package io.xpipe.beacon.exchange;
|
||||
|
||||
import io.xpipe.beacon.message.RequestMessage;
|
||||
import io.xpipe.beacon.message.ResponseMessage;
|
||||
import io.xpipe.core.store.LocalFileDataStore;
|
||||
import lombok.Builder;
|
||||
import lombok.Value;
|
||||
import lombok.extern.jackson.Jacksonized;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class PreStoreExchange implements MessageExchange<PreStoreExchange.Request, PreStoreExchange.Response> {
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "preStore";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<PreStoreExchange.Request> getRequestClass() {
|
||||
return PreStoreExchange.Request.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<PreStoreExchange.Response> getResponseClass() {
|
||||
return PreStoreExchange.Response.class;
|
||||
}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
LocalFileDataStore store;
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,9 @@ package io.xpipe.beacon.exchange;
|
||||
import io.xpipe.beacon.message.RequestMessage;
|
||||
import io.xpipe.beacon.message.ResponseMessage;
|
||||
import io.xpipe.core.source.DataSourceConfigInstance;
|
||||
import io.xpipe.core.store.DataStore;
|
||||
import io.xpipe.core.store.StreamDataStore;
|
||||
import lombok.Builder;
|
||||
import lombok.NonNull;
|
||||
import lombok.Value;
|
||||
import lombok.extern.jackson.Jacksonized;
|
||||
|
||||
@@ -30,6 +31,7 @@ public class ReadPreparationExchange implements MessageExchange<ReadPreparationE
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
String providerType;
|
||||
@NonNull
|
||||
String dataStore;
|
||||
}
|
||||
|
||||
@@ -38,6 +40,6 @@ public class ReadPreparationExchange implements MessageExchange<ReadPreparationE
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
DataSourceConfigInstance config;
|
||||
DataStore dataStore;
|
||||
StreamDataStore dataStore;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public class WriteExecuteExchange implements MessageExchange<WriteExecuteExchang
|
||||
public static class Request implements RequestMessage {
|
||||
@NonNull
|
||||
DataSourceId sourceId;
|
||||
@NonNull
|
||||
|
||||
DataStore dataStore;
|
||||
@NonNull
|
||||
DataSourceConfigInstance config;
|
||||
|
||||
@@ -41,7 +41,6 @@ public class WritePreparationExchange implements MessageExchange<WritePreparatio
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
@NonNull
|
||||
DataStore dataStore;
|
||||
|
||||
@NonNull
|
||||
|
||||
@@ -32,5 +32,6 @@ module io.xpipe.beacon {
|
||||
ReadExecuteExchange,
|
||||
DialogExchange,
|
||||
InfoExchange,
|
||||
PreStoreExchange,
|
||||
VersionExchange;
|
||||
}
|
||||
Reference in New Issue
Block a user