Download Network technologies for Java-enabled, mobile devices
Transcript
The Prototype ed to the users visible list. This is illustrated in Figure 7-25. Figure 7-25 Sequence diagram for editing a contact list If the user wants to delete one of its contacts, this is done by removing the user from the internal contact list of ITSClient. The changes will be reflected in the database after storing the list to the database upon closing the application. On the other hand, if the user wants to add a new contact, the NetworkClient need to search for the contacts in the JXTA network, which in turn will return information about the contact to the ITSClient. The contact is added to the internal contact list, and stored in the database upon closing the application, as shown in Figure 7-27. When the user is either participating in a public or private room, it can start sending and receiving messages. This is shown in Figure 7-26. 1: sendM essage(ITS M essage) client : IT SCli ent network : NetworkCl ient 4: rec eiveM essage(IT SM essage) 2: send(Stri ng, String,String, M essage) 3: poll(int) peerNetwork : PeerNetwork Figure 7-26 Collaboration diagram for sending and receiving messages When the user wants to end the running of the application, the client will tear down the connection to the network through the NetworkClient. The NetworkClient will unsubscribe from the pipe it has been listening to. This is illustrated in Figure 7-27. 78