1 package be
.nikiroo
.utils
.serial
.server
;
3 import java
.io
.IOException
;
4 import java
.net
.Socket
;
5 import java
.net
.UnknownHostException
;
7 import be
.nikiroo
.utils
.Version
;
10 * Class used for the client basic handling.
12 * It represents a single action: a client is expected to only execute one
17 public class ConnectActionClientObject
extends ConnectActionClient
{
19 * Create a new {@link ConnectActionClientObject} .
22 * the socket to bind to
24 * an optional key to encrypt all the communications (if NULL,
25 * everything will be sent in clear text)
27 public ConnectActionClientObject(Socket s
, String key
) {
32 * Create a new {@link ConnectActionClientObject} .
35 * the socket to bind to
37 * an optional key to encrypt all the communications (if NULL,
38 * everything will be sent in clear text)
39 * @param clientVersion
40 * the version of the client
42 public ConnectActionClientObject(Socket s
, String key
, Version clientVersion
) {
43 super(s
, key
, clientVersion
);
47 * Create a new {@link ConnectActionClientObject}.
54 * an optional key to encrypt all the communications (if NULL,
55 * everything will be sent in clear text)
58 * in case of I/O error
59 * @throws UnknownHostException
60 * if the IP address of the host could not be determined
61 * @throws IllegalArgumentException
62 * if the port parameter is outside the specified range of valid
63 * port values, which is between 0 and 65535, inclusive
65 public ConnectActionClientObject(String host
, int port
, String key
)
67 super(host
, port
, key
);
71 * Create a new {@link ConnectActionClientObject}.
78 * an optional key to encrypt all the communications (if NULL,
79 * everything will be sent in clear text)
80 * @param clientVersion
81 * the version of the client
84 * in case of I/O error
85 * @throws UnknownHostException
86 * if the IP address of the host could not be determined
87 * @throws IllegalArgumentException
88 * if the port parameter is outside the specified range of valid
89 * port values, which is between 0 and 65535, inclusive
91 public ConnectActionClientObject(String host
, int port
, String key
,
92 Version clientVersion
) throws IOException
{
93 super(host
, port
, key
, clientVersion
);
97 * Serialise and send the given object to the server (and return the
98 * deserialised answer).
103 * @return the answer, which can be NULL
105 * @throws IOException
106 * in case of I/O error
107 * @throws NoSuchFieldException
108 * if the serialised data contains information about a field
109 * which does actually not exist in the class we know of
110 * @throws NoSuchMethodException
111 * if a class described in the serialised data cannot be created
112 * because it is not compatible with this code
113 * @throws ClassNotFoundException
114 * if a class described in the serialised data cannot be found
116 public Object
send(Object data
) throws IOException
, NoSuchFieldException
,
117 NoSuchMethodException
, ClassNotFoundException
{
118 return action
.sendObject(data
);
124 * @deprecated SSL support has been replaced by key-based encryption.
126 * Please use the version with key encryption (this deprecated
127 * version uses an empty key when <tt>ssl</tt> is TRUE and no
128 * key (NULL) when <tt>ssl</tt> is FALSE).
131 public ConnectActionClientObject(String host
, int port
, boolean ssl
)
133 this(host
, port
, ssl ?
"" : null);
137 * @deprecated SSL support has been replaced by key-based encryption.
139 * Please use the version with key encryption (this deprecated
140 * version uses an empty key when <tt>ssl</tt> is TRUE and no
141 * key (NULL) when <tt>ssl</tt> is FALSE).
144 public ConnectActionClientObject(String host
, int port
, boolean ssl
,
145 Version version
) throws IOException
{
146 this(host
, port
, ssl ?
"" : null, version
);
150 * @deprecated SSL support has been replaced by key-based encryption.
152 * Please use the version with key encryption (this deprecated
153 * version uses an empty key when <tt>ssl</tt> is TRUE and no
154 * key (NULL) when <tt>ssl</tt> is FALSE).
156 @SuppressWarnings("unused")
158 public ConnectActionClientObject(Socket s
, boolean ssl
) throws IOException
{
159 this(s
, ssl ?
"" : null);
163 * @deprecated SSL support has been replaced by key-based encryption.
165 * Please use the version with key encryption (this deprecated
166 * version uses an empty key when <tt>ssl</tt> is TRUE and no
167 * key (NULL) when <tt>ssl</tt> is FALSE).
169 @SuppressWarnings("unused")
171 public ConnectActionClientObject(Socket s
, boolean ssl
, Version version
)
173 this(s
, ssl ?
"" : null, version
);