Top Fields Constructors Methods
org.jabref.logic.remote

public Class Protocol

extends Object
implements AutoCloseable
Class Inheritance
All Implemented Interfaces
java.lang.AutoCloseable
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, java.net.Socket, .URLDecoder, .URLEncoder, java.nio.charset.StandardCharsets, javafx.util.Pair, org.slf4j.Logger, .LoggerFactory

Implementation Note

The first byte of every message identifies its type as a RemoteMessage. Every message is terminated with '\0'.

Field Summary

Modifier and TypeField and Description
public static final String
private final ObjectInputStream
private static final Logger
private final ObjectOutputStream
private final Socket

Constructor Summary

AccessConstructor and Description
public
Protocol(Socket socket)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources.

public Pair<RemoteMessage, Object>
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

IDENTIFIERback to summary
public static final String IDENTIFIER
inback to summary
private final ObjectInputStream in
LOGGERback to summary
private static final Logger LOGGER
outback to summary
private final ObjectOutputStream out
socketback to summary
private final Socket socket

Constructor Detail

Protocolback to summary
public Protocol(Socket socket) throws IOException

Method Detail

closeback to summary
public void close()

Implements java.lang.AutoCloseable.close.

Doc from java.lang.AutoCloseable.close.

Closes this resource, relinquishing any underlying resources. This method is invoked automatically on objects managed by the try-with-resources statement.

Annotations
@Override
receiveMessageback to summary
public Pair<RemoteMessage, Object> receiveMessage() throws IOException
sendMessageback to summary
public void sendMessage(RemoteMessage type) throws IOException
sendMessageback to summary
public void sendMessage(RemoteMessage type, Object argument) throws IOException