Jive Messenger 2.2.2 Javadoc

org.jivesoftware.messenger.group
Class Group

java.lang.Object
  extended by org.jivesoftware.messenger.group.Group
All Implemented Interfaces:
Serializable, Cacheable

public class Group
extends Object
implements Cacheable

Groups organize users into a single entity for easier management.

Author:
Matt Tucker
See Also:
GroupManager.createGroup(String), Serialized Form

Constructor Summary
Group(GroupProvider provider, String name, String description, Collection<String> members, Collection<String> administrators)
          Constructs a new group.
 
Method Summary
 Collection<String> getAdmins()
          Returns a Collection of the group administrators.
 int getCachedSize()
          Returns the approximate size of the Object in bytes.
 String getDescription()
          Returns the description of the group.
 Collection<String> getMembers()
          Returns a Collection of the group members.
 String getName()
          Returns the name of the group.
 Map<String,String> getProperties()
          Returns all extended properties of the group.
 boolean isUser(String username)
          Returns true if the provided username belongs to a user of the group.
 void setDescription(String description)
          Sets the description of the group.
 void setName(String name)
          Sets the name of the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Group

public Group(GroupProvider provider,
             String name,
             String description,
             Collection<String> members,
             Collection<String> administrators)
Constructs a new group. Note: this constructor is intended for implementors of the GroupProvider interface. To create a new group, use the GroupManager.createGroup(String) method.

Parameters:
provider - the group provider.
name - the name.
description - the description.
members - a Collection of the group members.
administrators - a Collection of the group administrators.
Method Detail

getName

public String getName()
Returns the name of the group. For example, 'XYZ Admins'.

Returns:
the name of the group.

setName

public void setName(String name)
Sets the name of the group. For example, 'XYZ Admins'. This method is restricted to those with group administration permission.

Parameters:
name - the name for the group.

getDescription

public String getDescription()
Returns the description of the group. The description often summarizes a group's function, such as 'Administrators of the XYZ forum'.

Returns:
the description of the group.

setDescription

public void setDescription(String description)
Sets the description of the group. The description often summarizes a group's function, such as 'Administrators of the XYZ forum'. This method is restricted to those with group administration permission.

Parameters:
description - the description of the group.

getProperties

public Map<String,String> getProperties()
Returns all extended properties of the group. Groups have an arbitrary number of extended properties.

Returns:
the extended properties.

getAdmins

public Collection<String> getAdmins()
Returns a Collection of the group administrators.

Returns:
a Collection of the group administrators.

getMembers

public Collection<String> getMembers()
Returns a Collection of the group members.

Returns:
a Collection of the group members.

isUser

public boolean isUser(String username)
Returns true if the provided username belongs to a user of the group.

Parameters:
username - the username to check.
Returns:
true if the provided username belongs to a user of the group.

getCachedSize

public int getCachedSize()
Description copied from interface: Cacheable
Returns the approximate size of the Object in bytes. The size should be considered to be a best estimate of how much memory the Object occupies and may be based on empirical trials or dynamic calculations.

Specified by:
getCachedSize in interface Cacheable
Returns:
the size of the Object in bytes.

Jive Messenger 2.2.2 Javadoc

Copyright © 1999-2004 Jive Software.