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 TypeMethodDescriptionvoidclose()_more_voidDebugGet the Hostname property.booleanGet the OkToReceive property.booleanGet the OkToSend property.booleangetValid()Get the Valid property.protected voidhandleServerMessage(String message) Handle the message rcvd from the server.booleanIs this client currently connected.protected voidlogException(String msg, Exception exc) Log exception.static voidThe main method.protected Stringread()Read.voidsetHostname(String value) Set the Hostname property.voidsetOkToReceive(boolean value) Set the OkToReceive property.voidsetOkToSend(boolean value) Set the OkToSend property.voidsetValid(boolean value) Set the Valid property.toString()voidWrite.
-
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
-