Cliser

cliser
Class Client

java.lang.Object
  |
  +--cliser.CommunicatorUser
        |
        +--cliser.Client
Direct Known Subclasses:
TCPClient, UDPClient

public abstract class Client
extends CommunicatorUser

Client provides an abstract class for storing attributes common to all kinds of clients.

See the constructor for the specific attributes.


Constructor Summary
Client(java.lang.String service, java.lang.String remoteHost, int port)
          Explicit-value constructor.
 
Method Summary
 int getPort()
          Access myPort attribute.
 java.lang.String getServer()
          Access myServer attribute.
 java.lang.String getService()
          Access myService attribute.
abstract  void interactWithServer()
          What the client does in interacting with its server (abstract).
 void run()
          What the client does during its lifetime.
 
Methods inherited from class cliser.CommunicatorUser
getCommunicator, initCommunicator, receive, send, setCommunicator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Client

public Client(java.lang.String service,
              java.lang.String remoteHost,
              int port)
Explicit-value constructor.
Parameters:
service, - a String naming my service
remoteHost, - a String naming my remote host
port, - an int specifying the port I will use

POST: my instance variables have been initialized:
myService == service
&& myServer == remoteHost
&& myPort == port
&& myCommunicator has been initialized by a subclass via polymorphic initCommunicator.

See Also:
CommunicatorUser
Method Detail

run

public void run()
What the client does during its lifetime. Currently just calls interactWithServer() (but can be overridden).

PRE: myCommunicator has been initialized for my server.
POST: I have interacted with my server.


interactWithServer

public abstract void interactWithServer()
What the client does in interacting with its server (abstract).

PRE: myCommunicator has been initialized for my server.
POST: I have finished interacting with my server.


getService

public final java.lang.String getService()
Access myService attribute.
Returns:
myService.

getServer

public final java.lang.String getServer()
Access myServer attribute.
Returns:
myServer

getPort

public final int getPort()
Access myPort attribute.
Returns:
myPort

Cliser

Cliser is open-source freeware distributed under the GNU Public License.