mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-11-17 03:07:12 +00:00
Small fixes
This commit is contained in:
1 parent
8bb6f8be3d
commit
e5a84a83db
15 files changed
+120
-37
No files matched your search
@@ -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