mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-28 11:25:37 +00:00
Small fixes
This commit is contained in:
@@ -6,6 +6,7 @@ import io.xpipe.beacon.message.ResponseMessage;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
|
||||
public abstract class BeaconConnector {
|
||||
@@ -40,6 +41,10 @@ public abstract class BeaconConnector {
|
||||
return response.get();
|
||||
}
|
||||
|
||||
protected void writeLength(BeaconClient socket, int bytes) throws IOException {
|
||||
socket.getOutputStream().write(ByteBuffer.allocate(4).putInt(bytes).array());
|
||||
}
|
||||
|
||||
protected <REQ extends RequestMessage, RES extends ResponseMessage> RES performSimpleExchange(
|
||||
BeaconClient socket,
|
||||
REQ req) throws ServerException, ConnectorException, ClientException {
|
||||
|
||||
@@ -10,7 +10,7 @@ public interface BeaconHandler {
|
||||
|
||||
void prepareBody() throws IOException;
|
||||
|
||||
void startBodyRead() throws IOException;
|
||||
InputStream startBodyRead() throws IOException;
|
||||
|
||||
public <T extends ResponseMessage> void sendResponse(T obj) throws Exception;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class StoreResourceExchange implements MessageExchange<StoreResourceExcha
|
||||
@Value
|
||||
public static class Request implements RequestMessage {
|
||||
URL url;
|
||||
String type;
|
||||
String providerId;
|
||||
}
|
||||
|
||||
@Jacksonized
|
||||
|
||||
@@ -26,5 +26,6 @@ module io.xpipe.beacon {
|
||||
ReadInfoExchange,
|
||||
StatusExchange,
|
||||
StopExchange,
|
||||
StoreResourceExchange,
|
||||
VersionExchange;
|
||||
}
|
||||
Reference in New Issue
Block a user