Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.7.1 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.group
Class Group

    java.lang.Object
      org.jivesoftware.openfire.group.Group

All Implemented Interfaces:
  Externalizable, Serializable, Cacheable

    public class Group

extends Object
implements Cacheable, Externalizable

Groups organize users into a single entity for easier management.

The actual group implementation is controlled by the `GroupProvider`, which includes things like the group name, the members, and adminstrators. Each group also has properties, which are always stored in the Openfire database.

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

Constructor Summary
`Group()` Constructor added for Externalizable.
`Group(String name, String description, Collection<org.xmpp.packet.JID> members, Collection<org.xmpp.packet.JID> administrators)` Constructs a new group.
`Group(String name, String description, Collection<org.xmpp.packet.JID> members, Collection<org.xmpp.packet.JID> administrators, Map<String,String> properties)` Constructs a new group.

Method Summary
`boolean` | `equals(Object object)`
`Collection<org.xmpp.packet.JID>` | `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<org.xmpp.packet.JID>` | `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.
`static Set<String>` | `getSharedGroupsNames()` Returns the name of the groups that are shared groups.
`int` | `hashCode()`
`boolean` | `isUser(org.xmpp.packet.JID user)` Returns true if the provided JID belongs to a user that is part of the group.
`boolean` | `isUser(String username)` Returns true if the provided username belongs to a user of the group.
`void` | `readExternal(ObjectInput in)`
`void` | `setDescription(String description)` Sets the description of the group.
`void` | `setName(String name)` Sets the name of the group.
`String` | `toString()`
`void` | `writeExternal(ObjectOutput out)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Group

    public Group()

  Constructor added for Externalizable. Do not use this constructor.

### Group

    public Group(String name,
                 String description,
                 Collection<org.xmpp.packet.JID> members,
                 Collection<org.xmpp.packet.JID> 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:
    `name` - the name.
    `description` - the description.
    `members` - a Collection of the group members.
    `administrators` - a Collection of the group administrators.

### Group

    public Group(String name,
                 String description,
                 Collection<org.xmpp.packet.JID> members,
                 Collection<org.xmpp.packet.JID> administrators,
                 Map<String,String> properties)

  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:
    `name` - the name.
    `description` - the description.
    `members` - a Collection of the group members.
    `administrators` - a Collection of the group administrators.
    `properties` - a Map of properties with names and its values.

Method Detail

### getSharedGroupsNames

    public static Set<String> getSharedGroupsNames()

  Returns the name of the groups that are shared groups.

  Returns:
    the name of the groups that are shared groups.

### 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.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### getProperties

    public Map<String,String> getProperties()

  Returns all extended properties of the group. Groups have an arbitrary number of extended properties. The returned collection can be modified to add new properties or remove existing ones.

  Returns:
    the extended properties.

### getAdmins

    public Collection<org.xmpp.packet.JID> getAdmins()

  Returns a Collection of the group administrators.

  Returns:
    a Collection of the group administrators.

### getMembers

    public Collection<org.xmpp.packet.JID> getMembers()

  Returns a Collection of the group members.

  Returns:
    a Collection of the group members.

### isUser

    public boolean isUser(org.xmpp.packet.JID user)

  Returns true if the provided JID belongs to a user that is part of the group.

  Parameters:
    `user` - the JID address of the user to check.
  Returns:
    true if the specified user is a group user.

### 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.

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### equals

    public boolean equals(Object object)

  Overrides:
    `equals` in class `Object`

### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

  Specified by:
    `writeExternal` in interface `Externalizable`
  Throws:
    `IOException`

### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

  Specified by:
    `readExternal` in interface `Externalizable`
  Throws:
    `IOException`
    `ClassNotFoundException`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.7.1 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Jive Software.