Mediator Service Results

Mediator service requests allow you to determine who are currently connected to and which delegates are currently available on the environment's network. You can also retrieve the address card of an individual user on the environment's network. The icc.net.IDCard class provides additional functionality to help you in storing and querying a hashtable of current users. To maintain the collection of current users and/or delegates, you should also subscribe to and handle the appropriate events.

a. Retrieving the current users Given the successful data request, the resulting hashtable can be stored as follows:

if (request.service().equals(DataRequest.MEDIATOR))
    if (request.result() instanceof Hashtable)
        IDCard.set((Hashtable) request.result());

b. Retrieving the current delegates Given the successful data request, the result is a vector of 2-tuples, the first element of each is the address card, the second element the HTML script for the iconized presentation of the delegate.

if (request.service().equals(DataRequest.MEDIATOR))
    if (request.result() instanceof Vector)
        this.delegates = (Vector) request.result();

c. Retrieving a user's address card Your own address card is always known to the speaker and can be retrieved as follows:
    IDCard myCard = speaker.id(); If you have previously retrieved and maintained the current users, you can determine a user's address card given the username as follows:
    IDCard card = IDCard.get(username); Otherwise, upon requesting the user's address card from the mediator service, the result can be accessed as follows:

if (request.service().equals(DataRequest.MEDIATOR))
    if (request.result() instanceof IDCard) {
        IDCard card = (IDCard) request.result();
        ...
    }


Last modified on 27 May 1999 by Rudi Stouffs

This website has been archived and is no longer maintained.