package fr.insa.clavardator.client.server.proxy;

import fr.insa.clavardator.lib.network.TcpConnection;
import fr.insa.clavardator.lib.util.ErrorCallback;
import fr.insa.clavardator.lib.util.SimpleCallback;
import org.jetbrains.annotations.Nullable;

import java.io.Serializable;

public interface Proxy {
	void connect(SimpleCallback callback, ErrorCallback errorCallback);

	void send(Serializable message, @Nullable SimpleCallback callback, @Nullable ErrorCallback errorCallback);

	void receive(String userId, TcpConnection.MessageReceivedCallback callback, ErrorCallback errorCallback);

	boolean isConnected();

	void close();

	void disconnectUser(String id);
}
