Package ucar.unidata.collab
Class Client
java.lang.Object
ucar.unidata.collab.Client
- Direct Known Subclasses:
CollabClient
A generic client object.
- Author:
- Metapps development team
-
Constructor Summary
ConstructorsConstructorDescriptionClient()
Instantiates a new client.Create a new Client connection, connection to the given hostname which is of the form: hostname[:optional port number].Create a new Client connection, connection to the given hostname which is of the form: hostname[:optional port number].Instantiates a new client. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
_more_void
DebugGet the Hostname property.boolean
Get the OkToReceive property.boolean
Get the OkToSend property.boolean
getValid()
Get the Valid property.protected void
handleServerMessage
(String message) Handle the message rcvd from the server.boolean
Is this client currently connected.protected void
logException
(String msg, Exception exc) Log exception.static void
The main method.protected String
read()
Read.void
setHostname
(String value) Set the Hostname property.void
setOkToReceive
(boolean value) Set the OkToReceive property.void
setOkToSend
(boolean value) Set the OkToSend property.void
setValid
(boolean value) Set the Valid property.toString()
void
Write.
-
Constructor Details
-
Client
public Client()Instantiates a new client. -
Client
Create a new Client connection, connection to the given hostname which is of the form: hostname[:optional port number]. If alsoCreateServer is true then also create a server.- Parameters:
host
- the host
-
Client
Create a new Client connection, connection to the given hostname which is of the form: hostname[:optional port number]. If alsoCreateServer is true then also create a server.- Parameters:
host
- the hostthePort
- the the port
-
Client
Instantiates a new client.- Parameters:
socket
- the socket- Throws:
IOException
- Signals that an I/O exception has occurred.
-
-
Method Details
-
debug
Debug- Parameters:
msg
- debug message
-
isConnectionOk
public boolean isConnectionOk()Is this client currently connected.- Returns:
- Is this client currently connected.
-
handleServerMessage
Handle the message rcvd from the server.- Parameters:
message
- message from server
-
read
Read.- Returns:
- the string
- Throws:
IOException
- Signals that an I/O exception has occurred.
-
close
public void close()_more_ -
write
Write.- Parameters:
message
- the message
-
logException
Log exception.- Parameters:
msg
- the msgexc
- the exc
-
toString
-
setHostname
Set the Hostname property.- Parameters:
value
- The new value for Hostname
-
getHostname
Get the Hostname property.- Returns:
- The Hostname
-
setValid
public void setValid(boolean value) Set the Valid property.- Parameters:
value
- The new value for Valid
-
getValid
public boolean getValid()Get the Valid property.- Returns:
- The Valid
-
setOkToSend
public void setOkToSend(boolean value) Set the OkToSend property.- Parameters:
value
- The new value for OkToSend
-
getOkToSend
public boolean getOkToSend()Get the OkToSend property.- Returns:
- The OkToSend
-
setOkToReceive
public void setOkToReceive(boolean value) Set the OkToReceive property.- Parameters:
value
- The new value for OkToReceive
-
getOkToReceive
public boolean getOkToReceive()Get the OkToReceive property.- Returns:
- The OkToReceive
-
main
The main method.- Parameters:
args
- the arguments
-