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%2Fserver%2FConnectActionServer.java;h=aadc06c67503c6aebfa9aae5dc7785c46fce9841;hp=699f3074b44b228ac797e186c0f18da58208d08c;hb=23cf894daa02843da6e6f1b199eaaea29a739f81;hpb=e838eb0ef7ce247c2d3adbc1e01e8aef9161b125 diff --git a/src/be/nikiroo/utils/serial/server/ConnectActionServer.java b/src/be/nikiroo/utils/serial/server/ConnectActionServer.java index 699f307..aadc06c 100644 --- a/src/be/nikiroo/utils/serial/server/ConnectActionServer.java +++ b/src/be/nikiroo/utils/serial/server/ConnectActionServer.java @@ -2,8 +2,6 @@ package be.nikiroo.utils.serial.server; import java.net.Socket; -import be.nikiroo.utils.Version; - /** * Base class used for the server basic handling. *

@@ -22,20 +20,6 @@ abstract class ConnectActionServer { */ protected ConnectAction action; - /** - * Create a new {@link ConnectActionServer} with the current application - * version (see {@link Version#getCurrentVersion()}) as the server version. - * - * @param s - * the socket to bind to - * @param key - * an optional key to encrypt all the communications (if NULL, - * everything will be sent in clear text) - */ - public ConnectActionServer(Socket s, String key) { - this(s, key, Version.getCurrentVersion()); - } - /** * Create a new {@link ConnectActionServer}. * @@ -44,25 +28,18 @@ abstract class ConnectActionServer { * @param key * an optional key to encrypt all the communications (if NULL, * everything will be sent in clear text) - * @param version - * the server version */ - public ConnectActionServer(Socket s, String key, Version version) { - action = new ConnectAction(s, true, key, version) { + public ConnectActionServer(Socket s, String key) { + action = new ConnectAction(s, true, key) { @Override - protected void action(Version clientVersion) throws Exception { - ConnectActionServer.this.action(clientVersion); + protected void action() throws Exception { + ConnectActionServer.this.action(); } @Override protected void onError(Exception e) { ConnectActionServer.this.onError(e); } - - @Override - protected Version negotiateVersion(Version clientVersion) { - return ConnectActionServer.this.negotiateVersion(clientVersion); - } }; } @@ -134,14 +111,11 @@ abstract class ConnectActionServer { /** * Method that will be called when an action is performed on the server. * - * @param clientVersion - * the client version - * * @throws Exception * in case of I/O error */ @SuppressWarnings("unused") - public void action(Version clientVersion) throws Exception { + public void action() throws Exception { } /** @@ -154,19 +128,4 @@ abstract class ConnectActionServer { */ protected void onError(@SuppressWarnings("unused") Exception e) { } - - /** - * Method called when we negotiate the version with the client. - *

- * Will return the actual server version by default. - * - * @param clientVersion - * the client version - * - * @return the version to send to the client - */ - protected Version negotiateVersion( - @SuppressWarnings("unused") Version clientVersion) { - return action.getVersion(); - } } \ No newline at end of file