|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectroomba.roombanetwork.client.RoombaNetworkClient
public class RoombaNetworkClient
This class performs the role of RNC (Roomba Network Client). It provides the base for a service to build upon.
| Field Summary | |
|---|---|
static java.lang.String |
PROTOCOL_VERSION
The Protocol version that the client is using |
| Constructor Summary | |
|---|---|
RoombaNetworkClient(ClientListener clientListener,
java.lang.String serviceName,
java.lang.String serviceType,
java.lang.String rnsHost,
int rnsPort,
boolean verbose)
Constructor for creating the RNC. |
|
RoombaNetworkClient(ClientListener clientListener,
java.lang.String serviceName,
java.lang.String serviceType,
java.lang.String rnsHost,
int rnsPort,
boolean verbose,
boolean blockStart)
Constructor for creating the RNC. |
|
| Method Summary | |
|---|---|
void |
connect()
Connects to the RNS. |
void |
disconnect()
Disconnects from the RNS. |
int |
getOutgoingQueueSize()
Returns the queue size of messages waiting to be sent |
int |
getServiceID()
Gets the service ID that has been assigned to the RNC |
boolean |
isConnected()
Returns the flag indicating if the client is connected to the RNS. |
static void |
main(java.lang.String[] args)
Test main method |
void |
messageReceived(java.lang.String message)
Processes a message received. |
void |
messageReceived(java.lang.String messageType,
java.lang.String[] messageComponents)
Processes a message received. |
protected boolean |
sendMessage(java.lang.String message)
Sends a message to the RNS. |
boolean |
sendMessage(java.lang.String[] messageComponents)
Sends a message to the RNS. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String PROTOCOL_VERSION
| Constructor Detail |
|---|
public RoombaNetworkClient(ClientListener clientListener,
java.lang.String serviceName,
java.lang.String serviceType,
java.lang.String rnsHost,
int rnsPort,
boolean verbose)
clientListener - The client listener for any incoming messages. This can
be nullserviceName - The name of the client serviceserviceType - The type of the client servicernsHost - The host name that the RNS is running onrnsPort - The port number that the RNS is running onverbose - True iff the client should be verbose
public RoombaNetworkClient(ClientListener clientListener,
java.lang.String serviceName,
java.lang.String serviceType,
java.lang.String rnsHost,
int rnsPort,
boolean verbose,
boolean blockStart)
clientListener - The client listener for any incoming messages. This can
be nullserviceName - The name of the client serviceserviceType - The type of the client servicernsHost - The host name that the RNS is running onrnsPort - The port number that the RNS is running onverbose - True iff the client should be verboseblockStart - If true, the constructor will block until the client
is connected to the server.| Method Detail |
|---|
public void connect()
public int getOutgoingQueueSize()
public void disconnect()
public boolean isConnected()
public void messageReceived(java.lang.String message)
messageReceived in interface SocketListenermessage - The message that is received
public void messageReceived(java.lang.String messageType,
java.lang.String[] messageComponents)
messageType - The message typemessageComponents - The components of the received messageprotected boolean sendMessage(java.lang.String message)
message - The message to send
public boolean sendMessage(java.lang.String[] messageComponents)
messageComponents - The message components to send
public int getServiceID()
public static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||