restgroupsClient
Class User

java.lang.Object
  extended by restgroupsClient.User
All Implemented Interfaces:
java.util.EventListener, RestGroupsMessageListener

public class User
extends java.lang.Object
implements RestGroupsMessageListener

User is a simple console test application, analogous to the User application included in Spread Toolkit archive. Running User application creates a new profile for given username on the RestGroups server and allows joining/leaving custom groups and sending/receiving messages.

Author:
tkob

Constructor Summary
User(java.lang.String username, java.lang.String daemonUri)
          Constructor.
 
Method Summary
static void main(java.lang.String[] args)
          The main method.
 void messageReceived(java.util.List<RestGroupsMessage> messages)
           
static java.lang.String printMessages(java.util.List<RestGroupsMessage> messages)
          Used for formatting and printing given by the argument list of messages.
 void run()
          Provides interface for interactive program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

User

public User(java.lang.String username,
            java.lang.String daemonUri)
Constructor.

Parameters:
username - the clients desired username
daemonUri - the RestGroups server URI
Method Detail

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        org.restlet.resource.ResourceException
The main method. As arguments takes the clients desired username and URI to the RestGroups server.

Parameters:
args - clients desired username and URI to the RestGroups server
Throws:
java.io.IOException
org.restlet.resource.ResourceException

run

public void run()
Provides interface for interactive program.


messageReceived

public void messageReceived(java.util.List<RestGroupsMessage> messages)
Specified by:
messageReceived in interface RestGroupsMessageListener

printMessages

public static java.lang.String printMessages(java.util.List<RestGroupsMessage> messages)
Used for formatting and printing given by the argument list of messages.

Parameters:
messages - list of messages which have to be printed
Returns:
formatted list of messages