org.glassfish.cafe.api
Interface Group


public interface Group

This entity is responsible for actions on a user specific group that is stored on a RLS server. All actions related to the content of the group result in interactions with the RLS server.

A group contains the list of users to whose presence information an application subscribes to when initiating a PresenceWatcher. In a convenience method it has been made possible to start a PresenceWatcher from a group. The PresenceWatcher also allows to specify filters.

See Also:
PresenceWatcher

Method Summary
 void createOrModifyBuddy(String userId, String displayName)
          Adds a buddy to the group with the specified user ID and display name, or, if a buddy with the specified user ID already exists, modifies the display name.
 void delete()
          Deletes the complete group.
 String getBuddyDisplayName(String userId)
          Returns the display name of the buddy with the specified user ID.
 List<String> getBuddyNames()
          Returns the list of user IDs of the buddies in the group.
 String getDisplayName()
          Returns the display name of the group.
 String getName()
          Returns the name of the group.
 String getOwner()
          Returns the owner of the group.
 void removeBuddy(String userId)
          Removes the buddy with the specified user ID from the group.
 void setDisplayName(String name)
          Returns the name of the group.
 PresenceWatcher startWatching(CommunicationSession session)
          Creates a new PresenceWatcher in the provided CommunicationSession, and issues the update() method for the current group on the newly created PresenceWatcher.
 

Method Detail

delete

void delete()
Deletes the complete group.


createOrModifyBuddy

void createOrModifyBuddy(String userId,
                         String displayName)
Adds a buddy to the group with the specified user ID and display name, or, if a buddy with the specified user ID already exists, modifies the display name.

Parameters:
userId - the user ID of the buddy.
displayName - the new display name of the buddy.

removeBuddy

void removeBuddy(String userId)
Removes the buddy with the specified user ID from the group.

Parameters:
userId - The user ID of the buddy to be removed.

getBuddyNames

List<String> getBuddyNames()
Returns the list of user IDs of the buddies in the group.

Returns:
a List of URLs.

getBuddyDisplayName

String getBuddyDisplayName(String userId)
Returns the display name of the buddy with the specified user ID.

Parameters:
userId - the user ID.
Returns:
the buddy's display name.

getName

String getName()
Returns the name of the group.

Returns:
the group name.

setDisplayName

void setDisplayName(String name)
Returns the name of the group.

Parameters:
name - the group display name.

getDisplayName

String getDisplayName()
Returns the display name of the group.

Returns:
the group display name.

getOwner

String getOwner()
Returns the owner of the group.

Returns:
the owner's URL.

startWatching

PresenceWatcher startWatching(CommunicationSession session)
Creates a new PresenceWatcher in the provided CommunicationSession, and issues the update() method for the current group on the newly created PresenceWatcher.

Parameters:
session - the CommunicationSession in which the PresenceWatcher is created.
Returns:
the newly created PresenceWatcher.


Copyright © 2010. All Rights Reserved.