X-Git-Url: http://git.nikiroo.be/?p=nikiroo-utils.git;a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fserial%2Fserver%2FConnectActionServer.java;fp=src%2Fbe%2Fnikiroo%2Futils%2Fserial%2FConnectActionServer.java;h=85b46a2fdd89f594528d166f78e26a7177eb8e2c;hp=2d85c79c86f41b2d7807bb3fcc3ad6b508a3cddc;hb=79ce1a4973eba079ba819ba841d906de42f38e40;hpb=d463d2663337bb11aaeab48a06d2b3091c3b7830 diff --git a/src/be/nikiroo/utils/serial/ConnectActionServer.java b/src/be/nikiroo/utils/serial/server/ConnectActionServer.java similarity index 51% rename from src/be/nikiroo/utils/serial/ConnectActionServer.java rename to src/be/nikiroo/utils/serial/server/ConnectActionServer.java index 2d85c79..85b46a2 100644 --- a/src/be/nikiroo/utils/serial/ConnectActionServer.java +++ b/src/be/nikiroo/utils/serial/server/ConnectActionServer.java @@ -1,6 +1,5 @@ -package be.nikiroo.utils.serial; +package be.nikiroo.utils.serial.server; -import java.io.IOException; import java.net.Socket; import be.nikiroo.utils.Version; @@ -13,8 +12,13 @@ import be.nikiroo.utils.Version; * * @author niki */ -public class ConnectActionServer { - private ConnectAction action; +abstract class ConnectActionServer { + /** + * The underlying {@link ConnectAction}. + *

+ * Cannot be NULL. + */ + protected ConnectAction action; /** * Create a new {@link ConnectActionServer} with the current application @@ -86,51 +90,6 @@ public class ConnectActionServer { public void action(Version clientVersion) throws Exception { } - /** - * Serialise and send the given object to the client. - * - * @param data - * the data to send - * - * @throws IOException - * in case of I/O error - * @throws NoSuchFieldException - * if the serialised data contains information about a field - * which does actually not exist in the class we know of - * @throws NoSuchMethodException - * if a class described in the serialised data cannot be created - * because it is not compatible with this code - * @throws ClassNotFoundException - * if a class described in the serialised data cannot be found - */ - public void send(Object data) throws IOException, NoSuchFieldException, - NoSuchMethodException, ClassNotFoundException { - action.send(data); - } - - /** - * (Flush the data to the client if needed and) retrieve its answer. - * - * @return the deserialised answer (which can actually be NULL) - * - * @throws IOException - * in case of I/O error - * @throws NoSuchFieldException - * if the serialised data contains information about a field - * which does actually not exist in the class we know of - * @throws NoSuchMethodException - * if a class described in the serialised data cannot be created - * because it is not compatible with this code - * @throws ClassNotFoundException - * if a class described in the serialised data cannot be found - * @throws java.lang.NullPointerException - * if the counter part has no data to send - */ - public Object rec() throws NoSuchFieldException, NoSuchMethodException, - ClassNotFoundException, IOException, java.lang.NullPointerException { - return action.rec(); - } - /** * Handler called when an unexpected error occurs in the code. *

@@ -156,25 +115,4 @@ public class ConnectActionServer { @SuppressWarnings("unused") Version clientVersion) { return action.getVersion(); } - - // old stuff: - - /** - * Not used anymore. See {@link ConnectActionServer#rec()}. - */ - @SuppressWarnings("javadoc") - @Deprecated - public Object flush() throws NoSuchFieldException, NoSuchMethodException, - ClassNotFoundException, IOException, java.lang.NullPointerException { - return rec(); - } - - /** - * Not used anymore. See - * {@link ConnectActionServer#negotiateVersion(Version)}. - */ - @SuppressWarnings({ "unused", "javadoc" }) - @Deprecated - protected void onClientVersionReceived(Version clientVersion) { - } } \ No newline at end of file