mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-24 17:35:39 +00:00
Reformat
This commit is contained in:
@@ -35,6 +35,7 @@ public class BeaconClient implements AutoCloseable {
|
||||
|
||||
@Getter
|
||||
private final Closeable base;
|
||||
|
||||
private final InputStream in;
|
||||
private final OutputStream out;
|
||||
|
||||
@@ -296,10 +297,7 @@ public class BeaconClient implements AutoCloseable {
|
||||
void run() throws E;
|
||||
}
|
||||
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
property = "type"
|
||||
)
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type")
|
||||
public abstract static class ClientInformation {
|
||||
|
||||
public final CliClientInformation cli() {
|
||||
|
||||
@@ -78,8 +78,7 @@ public abstract class BeaconConnection implements AutoCloseable {
|
||||
}
|
||||
|
||||
public <REQ extends RequestMessage, RES extends ResponseMessage> void performInputExchange(
|
||||
REQ req, BeaconClient.FailableBiConsumer<RES, InputStream, Exception> responseConsumer
|
||||
) {
|
||||
REQ req, BeaconClient.FailableBiConsumer<RES, InputStream, Exception> responseConsumer) {
|
||||
checkClosed();
|
||||
|
||||
performInputOutputExchange(req, null, responseConsumer);
|
||||
@@ -88,8 +87,7 @@ public abstract class BeaconConnection implements AutoCloseable {
|
||||
public <REQ extends RequestMessage, RES extends ResponseMessage> void performInputOutputExchange(
|
||||
REQ req,
|
||||
BeaconClient.FailableConsumer<OutputStream, IOException> reqWriter,
|
||||
BeaconClient.FailableBiConsumer<RES, InputStream, Exception> responseConsumer
|
||||
) {
|
||||
BeaconClient.FailableBiConsumer<RES, InputStream, Exception> responseConsumer) {
|
||||
checkClosed();
|
||||
|
||||
try {
|
||||
@@ -151,8 +149,7 @@ public abstract class BeaconConnection implements AutoCloseable {
|
||||
}
|
||||
|
||||
public <REQ extends RequestMessage, RES extends ResponseMessage> RES performOutputExchange(
|
||||
REQ req, BeaconClient.FailableConsumer<OutputStream, Exception> reqWriter
|
||||
) {
|
||||
REQ req, BeaconClient.FailableConsumer<OutputStream, Exception> reqWriter) {
|
||||
checkClosed();
|
||||
|
||||
try {
|
||||
@@ -183,7 +180,10 @@ public abstract class BeaconConnection implements AutoCloseable {
|
||||
|
||||
public InternalStreamStore createInternalStreamStore(String name) {
|
||||
var store = new InternalStreamStore();
|
||||
var addReq = StoreAddExchange.Request.builder().storeInput(store).name(name != null ? name : store.getUuid().toString()).build();
|
||||
var addReq = StoreAddExchange.Request.builder()
|
||||
.storeInput(store)
|
||||
.name(name != null ? name : store.getUuid().toString())
|
||||
.build();
|
||||
StoreAddExchange.Response addRes = performSimpleExchange(addReq);
|
||||
QuietDialogHandler.handle(addRes.getConfig(), this);
|
||||
return store;
|
||||
@@ -194,8 +194,7 @@ public abstract class BeaconConnection implements AutoCloseable {
|
||||
}
|
||||
|
||||
public void writeStream(String name, InputStream in) {
|
||||
performOutputExchange(
|
||||
WriteStreamExchange.Request.builder().name(name).build(), in::transferTo);
|
||||
performOutputExchange(WriteStreamExchange.Request.builder().name(name).build(), in::transferTo);
|
||||
}
|
||||
|
||||
private BeaconException unwrapException(Exception exception) {
|
||||
|
||||
@@ -39,7 +39,10 @@ public class BeaconDaemonController {
|
||||
return;
|
||||
}
|
||||
|
||||
var client = BeaconClient.connect(BeaconClient.ApiClientInformation.builder().version("?").language("Java API Test").build());
|
||||
var client = BeaconClient.connect(BeaconClient.ApiClientInformation.builder()
|
||||
.version("?")
|
||||
.language("Java API Test")
|
||||
.build());
|
||||
if (!BeaconServer.tryStop(client)) {
|
||||
throw new AssertionError();
|
||||
}
|
||||
@@ -49,9 +52,9 @@ public class BeaconDaemonController {
|
||||
private static void waitForStartup(Process process, boolean custom) throws IOException {
|
||||
for (int i = 0; i < 160; i++) {
|
||||
// Breaks when using nohup & disown
|
||||
// if (process != null && !custom && !process.isAlive()) {
|
||||
// throw new IOException("Daemon start failed");
|
||||
// }
|
||||
// if (process != null && !custom && !process.isAlive()) {
|
||||
// throw new IOException("Daemon start failed");
|
||||
// }
|
||||
|
||||
if (process != null && custom && !process.isAlive() && process.exitValue() != 0) {
|
||||
throw new IOException("Custom launch command failed");
|
||||
@@ -63,9 +66,9 @@ public class BeaconDaemonController {
|
||||
}
|
||||
|
||||
var s = BeaconClient.tryConnect(BeaconClient.ApiClientInformation.builder()
|
||||
.version("?")
|
||||
.language("Java")
|
||||
.build());
|
||||
.version("?")
|
||||
.language("Java")
|
||||
.build());
|
||||
if (s.isPresent()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@ package io.xpipe.beacon;
|
||||
*/
|
||||
public class BeaconException extends RuntimeException {
|
||||
|
||||
public BeaconException() {
|
||||
}
|
||||
public BeaconException() {}
|
||||
|
||||
public BeaconException(String message) {
|
||||
super(message);
|
||||
|
||||
@@ -11,7 +11,6 @@ public class BeaconJacksonModule extends SimpleModule {
|
||||
new NamedType(BeaconClient.ApiClientInformation.class),
|
||||
new NamedType(BeaconClient.CliClientInformation.class),
|
||||
new NamedType(BeaconClient.DaemonInformation.class),
|
||||
new NamedType(BeaconClient.ReachableCheckInformation.class)
|
||||
);
|
||||
new NamedType(BeaconClient.ReachableCheckInformation.class));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,15 +74,16 @@ public class BeaconProxyImpl extends ProxyProvider {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DataSourceReadConnection> T createRemoteReadConnection(DataSource<?> source, ShellStore proxy) throws Exception {
|
||||
public <T extends DataSourceReadConnection> T createRemoteReadConnection(DataSource<?> source, ShellStore proxy)
|
||||
throws Exception {
|
||||
var downstream = downstreamTransform(source, proxy);
|
||||
|
||||
BeaconClient client = null;
|
||||
try {
|
||||
client = BeaconClient.connectProxy(proxy);
|
||||
client.sendRequest(ProxyReadConnectionExchange.Request.builder()
|
||||
.source(downstream)
|
||||
.build());
|
||||
.source(downstream)
|
||||
.build());
|
||||
client.receiveResponse();
|
||||
BeaconClient finalClient = client;
|
||||
var inputStream = new FilterInputStream(finalClient.receiveBody()) {
|
||||
@@ -105,15 +106,16 @@ public class BeaconProxyImpl extends ProxyProvider {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends DataSourceConnection> T createRemoteWriteConnection(DataSource<?> source, WriteMode mode, ShellStore proxy) throws Exception {
|
||||
public <T extends DataSourceConnection> T createRemoteWriteConnection(
|
||||
DataSource<?> source, WriteMode mode, ShellStore proxy) throws Exception {
|
||||
var downstream = downstreamTransform(source, proxy);
|
||||
|
||||
BeaconClient client = null;
|
||||
try {
|
||||
client = BeaconClient.connectProxy(proxy);
|
||||
client.sendRequest(ProxyWriteConnectionExchange.Request.builder()
|
||||
.source(downstream)
|
||||
.build());
|
||||
.source(downstream)
|
||||
.build());
|
||||
BeaconClient finalClient = client;
|
||||
var outputStream = new FilterOutputStream(client.sendBody()) {
|
||||
@Override
|
||||
@@ -124,7 +126,8 @@ public class BeaconProxyImpl extends ProxyProvider {
|
||||
finalClient.close();
|
||||
}
|
||||
};
|
||||
var outputSource = DataSource.createInternalDataSource(source.getType(), new OutputStreamStore(outputStream));
|
||||
var outputSource =
|
||||
DataSource.createInternalDataSource(source.getType(), new OutputStreamStore(outputStream));
|
||||
return (T) outputSource.openWriteConnection(mode);
|
||||
} catch (Exception ex) {
|
||||
if (client != null) {
|
||||
|
||||
@@ -30,9 +30,9 @@ public class BeaconServer {
|
||||
if (custom != null) {
|
||||
var command = ShellTypes.getPlatformDefault()
|
||||
.executeCommandListWithShell(custom
|
||||
+ (BeaconConfig.getDaemonArguments() != null
|
||||
? " " + BeaconConfig.getDaemonArguments()
|
||||
: ""));
|
||||
+ (BeaconConfig.getDaemonArguments() != null
|
||||
? " " + BeaconConfig.getDaemonArguments()
|
||||
: ""));
|
||||
Process process = Runtime.getRuntime().exec(command.toArray(String[]::new));
|
||||
printDaemonOutput(process, command);
|
||||
return process;
|
||||
@@ -43,7 +43,8 @@ public class BeaconServer {
|
||||
public static Process start(String installationBase, XPipeDaemonMode mode) throws Exception {
|
||||
String command;
|
||||
if (!BeaconConfig.launchDaemonInDebugMode()) {
|
||||
command = XPipeInstallation.createExternalAsyncLaunchCommand(installationBase, mode, BeaconConfig.getDaemonArguments());
|
||||
command = XPipeInstallation.createExternalAsyncLaunchCommand(
|
||||
installationBase, mode, BeaconConfig.getDaemonArguments());
|
||||
} else {
|
||||
command = XPipeInstallation.createExternalLaunchCommand(
|
||||
getDaemonDebugExecutable(installationBase), BeaconConfig.getDaemonArguments(), mode);
|
||||
@@ -77,8 +78,7 @@ public class BeaconServer {
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
},
|
||||
"daemon sysout"
|
||||
);
|
||||
"daemon sysout");
|
||||
out.setDaemon(true);
|
||||
out.start();
|
||||
|
||||
@@ -98,8 +98,7 @@ public class BeaconServer {
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
},
|
||||
"daemon syserr"
|
||||
);
|
||||
"daemon syserr");
|
||||
err.setDaemon(true);
|
||||
err.start();
|
||||
}
|
||||
@@ -117,8 +116,7 @@ public class BeaconServer {
|
||||
throw new IllegalStateException();
|
||||
} else {
|
||||
if (BeaconConfig.attachDebuggerToDaemon()) {
|
||||
return FileNames.join(
|
||||
installationBase, XPipeInstallation.getDaemonDebugAttachScriptPath(osType));
|
||||
return FileNames.join(installationBase, XPipeInstallation.getDaemonDebugAttachScriptPath(osType));
|
||||
} else {
|
||||
return FileNames.join(installationBase, XPipeInstallation.getDaemonDebugScriptPath(osType));
|
||||
}
|
||||
|
||||
@@ -5,8 +5,7 @@ package io.xpipe.beacon;
|
||||
*/
|
||||
public class ClientException extends Exception {
|
||||
|
||||
public ClientException() {
|
||||
}
|
||||
public ClientException() {}
|
||||
|
||||
public ClientException(String message) {
|
||||
super(message);
|
||||
|
||||
@@ -5,8 +5,7 @@ package io.xpipe.beacon;
|
||||
*/
|
||||
public class ConnectorException extends Exception {
|
||||
|
||||
public ConnectorException() {
|
||||
}
|
||||
public ConnectorException() {}
|
||||
|
||||
public ConnectorException(String message) {
|
||||
super(message);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
package io.xpipe.beacon;
|
||||
|
||||
public interface RequestMessage {
|
||||
}
|
||||
public interface RequestMessage {}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
package io.xpipe.beacon;
|
||||
|
||||
public interface ResponseMessage {
|
||||
}
|
||||
public interface ResponseMessage {}
|
||||
|
||||
@@ -31,7 +31,6 @@ public class SecretProviderImpl extends SecretProvider {
|
||||
return nonce;
|
||||
}
|
||||
|
||||
|
||||
private static SecretKey getAESKey(int keysize) throws NoSuchAlgorithmException, InvalidKeySpecException {
|
||||
SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256");
|
||||
var salt = new byte[16];
|
||||
|
||||
@@ -5,8 +5,7 @@ package io.xpipe.beacon;
|
||||
*/
|
||||
public class ServerException extends Exception {
|
||||
|
||||
public ServerException() {
|
||||
}
|
||||
public ServerException() {}
|
||||
|
||||
public ServerException(String message) {
|
||||
super(message);
|
||||
|
||||
@@ -26,6 +26,5 @@ public class FocusExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,5 @@ public class ForwardExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@ public class OpenExchange implements MessageExchange {
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
@NonNull List<String> arguments;
|
||||
@NonNull
|
||||
List<String> arguments;
|
||||
}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -21,14 +21,8 @@ public class ProxyFunctionExchange implements MessageExchange {
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
|
||||
@JsonSerialize(
|
||||
using = ProxyFunction.Serializer.class,
|
||||
as = ProxyFunction.class
|
||||
)
|
||||
@JsonDeserialize(
|
||||
using = ProxyFunction.Deserializer.class,
|
||||
as = ProxyFunction.class
|
||||
)
|
||||
@JsonSerialize(using = ProxyFunction.Serializer.class, as = ProxyFunction.class)
|
||||
@JsonDeserialize(using = ProxyFunction.Deserializer.class, as = ProxyFunction.class)
|
||||
ProxyFunction function;
|
||||
}
|
||||
|
||||
@@ -37,14 +31,8 @@ public class ProxyFunctionExchange implements MessageExchange {
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
|
||||
@JsonSerialize(
|
||||
using = ProxyFunction.Serializer.class,
|
||||
as = ProxyFunction.class
|
||||
)
|
||||
@JsonDeserialize(
|
||||
using = ProxyFunction.Deserializer.class,
|
||||
as = ProxyFunction.class
|
||||
)
|
||||
@JsonSerialize(using = ProxyFunction.Serializer.class, as = ProxyFunction.class)
|
||||
@JsonDeserialize(using = ProxyFunction.Deserializer.class, as = ProxyFunction.class)
|
||||
ProxyFunction function;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,12 +19,12 @@ public class ProxyReadConnectionExchange implements MessageExchange {
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
@NonNull DataSource<?> source;
|
||||
@NonNull
|
||||
DataSource<?> source;
|
||||
}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -20,13 +20,15 @@ public class ProxyWriteConnectionExchange implements MessageExchange {
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
@NonNull DataSource<?> source;
|
||||
@NonNull WriteMode mode;
|
||||
@NonNull
|
||||
DataSource<?> source;
|
||||
|
||||
@NonNull
|
||||
WriteMode mode;
|
||||
}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,8 @@ public class QueryDataSourceExchange implements MessageExchange {
|
||||
@NonNull
|
||||
String provider;
|
||||
|
||||
@NonNull DataSourceType type;
|
||||
@NonNull
|
||||
DataSourceType type;
|
||||
|
||||
@NonNull
|
||||
LinkedHashMap<String, String> config;
|
||||
|
||||
@@ -21,12 +21,12 @@ public class ReadStreamExchange implements MessageExchange {
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
@NonNull String name;
|
||||
@NonNull
|
||||
String name;
|
||||
}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,7 @@ public class StopExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
}
|
||||
public static class Request implements RequestMessage {}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
|
||||
@@ -21,12 +21,12 @@ public class WriteStreamExchange implements MessageExchange {
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
@NonNull String name;
|
||||
@NonNull
|
||||
String name;
|
||||
}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,5 @@ public class QueryRawDataExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ public class QueryTableDataExchange implements MessageExchange {
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
@NonNull TupleType dataType;
|
||||
@NonNull
|
||||
TupleType dataType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,5 @@ public class QueryTextDataExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -19,8 +19,7 @@ public class InstanceExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
}
|
||||
public static class Request implements RequestMessage {}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
|
||||
@@ -20,8 +20,7 @@ public class ListCollectionsExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
}
|
||||
public static class Request implements RequestMessage {}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
|
||||
@@ -20,8 +20,7 @@ public class ListStoresExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
}
|
||||
public static class Request implements RequestMessage {}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
|
||||
@@ -30,6 +30,5 @@ public class ReadDrainExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,5 @@ public class RemoveCollectionExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,5 @@ public class RemoveStoreExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,5 @@ public class RenameCollectionExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,5 @@ public class RenameEntryExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,5 @@ public class RenameStoreExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,5 @@ public class SelectExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Response implements ResponseMessage {
|
||||
}
|
||||
public static class Response implements ResponseMessage {}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,7 @@ public class SourceProviderListExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
}
|
||||
public static class Request implements RequestMessage {}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
|
||||
@@ -17,8 +17,7 @@ public class StatusExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
}
|
||||
public static class Request implements RequestMessage {}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
|
||||
@@ -22,8 +22,7 @@ public class StoreProviderListExchange implements MessageExchange {
|
||||
@Jacksonized
|
||||
@Builder
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
}
|
||||
public static class Request implements RequestMessage {}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
|
||||
@@ -17,8 +17,7 @@ public class VersionExchange implements MessageExchange {
|
||||
@lombok.extern.jackson.Jacksonized
|
||||
@lombok.Builder
|
||||
@lombok.Value
|
||||
public static class Request implements RequestMessage {
|
||||
}
|
||||
public static class Request implements RequestMessage {}
|
||||
|
||||
@Jacksonized
|
||||
@Builder
|
||||
|
||||
@@ -17,6 +17,7 @@ public class QuietDialogHandler {
|
||||
private final BeaconConnection connection;
|
||||
private final Map<String, String> overrides;
|
||||
private DialogElement element;
|
||||
|
||||
public QuietDialogHandler(DialogReference ref, BeaconConnection connection, Map<String, String> overrides) {
|
||||
this.dialogKey = ref.getDialogId();
|
||||
this.element = ref.getStart();
|
||||
@@ -40,9 +41,9 @@ public class QuietDialogHandler {
|
||||
}
|
||||
|
||||
DialogExchange.Response res = connection.performSimpleExchange(DialogExchange.Request.builder()
|
||||
.dialogKey(dialogKey)
|
||||
.value(response)
|
||||
.build());
|
||||
.dialogKey(dialogKey)
|
||||
.value(response)
|
||||
.build());
|
||||
if (res.getElement() != null && element.equals(res.getElement())) {
|
||||
throw new BeaconException(
|
||||
"Invalid value for key " + res.getElement().toDisplayString());
|
||||
|
||||
@@ -23,7 +23,9 @@ module io.xpipe.beacon {
|
||||
opens io.xpipe.beacon.exchange.api;
|
||||
opens io.xpipe.beacon.exchange.data;
|
||||
opens io.xpipe.beacon.exchange.cli;
|
||||
|
||||
exports io.xpipe.beacon.util;
|
||||
|
||||
opens io.xpipe.beacon.util;
|
||||
|
||||
requires static com.fasterxml.jackson.core;
|
||||
@@ -34,9 +36,12 @@ module io.xpipe.beacon {
|
||||
uses MessageExchange;
|
||||
uses ProxyFunction;
|
||||
|
||||
provides ProxyProvider with BeaconProxyImpl;
|
||||
provides SecretProvider with SecretProviderImpl;
|
||||
provides Module with BeaconJacksonModule;
|
||||
provides ProxyProvider with
|
||||
BeaconProxyImpl;
|
||||
provides SecretProvider with
|
||||
SecretProviderImpl;
|
||||
provides Module with
|
||||
BeaconJacksonModule;
|
||||
provides io.xpipe.beacon.exchange.MessageExchange with
|
||||
ForwardExchange,
|
||||
InstanceExchange,
|
||||
|
||||
Reference in New Issue
Block a user