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 ConnectActionClientString
extends ConnectActionClient
{
19 * Create a new {@link ConnectActionClientString}.
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 ConnectActionClientString(Socket s
, String key
) {
32 * Create a new {@link ConnectActionClientString}.
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 this client
42 public ConnectActionClientString(Socket s
, String key
, Version clientVersion
) {
43 super(s
, key
, clientVersion
);
47 * Create a new {@link ConnectActionClientString}.
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 ConnectActionClientString(String host
, int port
, String key
)
67 super(host
, port
, key
);
71 * Create a new {@link ConnectActionClientString}.
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 this 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 ConnectActionClientString(String host
, int port
, String key
,
92 Version clientVersion
) throws IOException
{
93 super(host
, port
, key
, clientVersion
);
97 * Send the given object to the server (and return the answer).
102 * @return the answer, which can be NULL
104 * @throws IOException
105 * in case of I/O error
107 public String
send(String data
) throws IOException
{
108 return action
.sendString(data
);
114 * @deprecated SSL support has been replaced by key-based encryption.
116 * Please use the version with key encryption (this deprecated
117 * version uses an empty key when <tt>ssl</tt> is TRUE and no
118 * key (NULL) when <tt>ssl</tt> is FALSE).
121 public ConnectActionClientString(String host
, int port
, boolean ssl
)
123 this(host
, port
, ssl ?
"" : null);
127 * @deprecated SSL support has been replaced by key-based encryption.
129 * Please use the version with key encryption (this deprecated
130 * version uses an empty key when <tt>ssl</tt> is TRUE and no
131 * key (NULL) when <tt>ssl</tt> is FALSE).
134 public ConnectActionClientString(String host
, int port
, boolean ssl
,
135 Version version
) throws IOException
{
136 this(host
, port
, ssl ?
"" : null, version
);
140 * @deprecated SSL support has been replaced by key-based encryption.
142 * Please use the version with key encryption (this deprecated
143 * version uses an empty key when <tt>ssl</tt> is TRUE and no
144 * key (NULL) when <tt>ssl</tt> is FALSE).
146 @SuppressWarnings("unused")
148 public ConnectActionClientString(Socket s
, boolean ssl
) throws IOException
{
149 this(s
, ssl ?
"" : null);
153 * @deprecated SSL support has been replaced by key-based encryption.
155 * Please use the version with key encryption (this deprecated
156 * version uses an empty key when <tt>ssl</tt> is TRUE and no
157 * key (NULL) when <tt>ssl</tt> is FALSE).
159 @SuppressWarnings("unused")
161 public ConnectActionClientString(Socket s
, boolean ssl
, Version version
)
163 this(s
, ssl ?
"" : null, version
);