1 package be
.nikiroo
.utils
.serial
.server
;
3 import java
.io
.IOException
;
4 import java
.net
.Socket
;
6 import be
.nikiroo
.utils
.Version
;
9 * Class used for the client basic handling.
11 * It represents a single action: a client is expected to only execute one
16 public class ConnectActionClientObject
extends ConnectActionClient
{
18 * Create a new {@link ConnectActionClientObject} with the current
19 * application version (see {@link Version#getCurrentVersion()}) as the
23 * the socket to bind to
25 public ConnectActionClientObject(Socket s
) {
30 * Create a new {@link ConnectActionClientObject} with the current
31 * application version (see {@link Version#getCurrentVersion()}) as the
39 * TRUE for an SSL connection, FALSE for plain text
42 * in case of I/O error when creating the socket
44 public ConnectActionClientObject(String host
, int port
, boolean ssl
)
46 super(host
, port
, ssl
);
50 * Create a new {@link ConnectActionClientObject}.
57 * TRUE for an SSL connection, FALSE for plain text
62 * in case of I/O error when creating the socket
64 public ConnectActionClientObject(String host
, int port
, boolean ssl
,
65 Version version
) throws IOException
{
66 super(host
, port
, ssl
, version
);
70 * Create a new {@link ConnectActionClientObject}.
73 * the socket to bind to
77 public ConnectActionClientObject(Socket s
, Version version
) {
82 * Serialise and send the given object to the server (and return the
83 * deserialised answer).
88 * @return the answer, which can be NULL
91 * in case of I/O error
92 * @throws NoSuchFieldException
93 * if the serialised data contains information about a field
94 * which does actually not exist in the class we know of
95 * @throws NoSuchMethodException
96 * if a class described in the serialised data cannot be created
97 * because it is not compatible with this code
98 * @throws ClassNotFoundException
99 * if a class described in the serialised data cannot be found
101 public Object
send(Object data
) throws IOException
, NoSuchFieldException
,
102 NoSuchMethodException
, ClassNotFoundException
{
103 return action
.sendObject(data
);