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

## org.jivesoftware.openfire.group
Class DefaultGroupProvider

    java.lang.Object
      org.jivesoftware.openfire.group.AbstractGroupProvider
          org.jivesoftware.openfire.group.DefaultGroupProvider

All Implemented Interfaces:
  GroupProvider

    public class DefaultGroupProvider

extends AbstractGroupProvider

Database implementation of the GroupManager interface.

Author:
  Matt Tucker

Constructor Summary
`DefaultGroupProvider()`

Method Summary
`void` | `addMember(String groupName, org.xmpp.packet.JID user, boolean administrator)` Adds an entity to a group (optional operation).
`Group` | `createGroup(String name)` Creates a group with the given name (optional operation).
`void` | `deleteGroup(String groupName)` Deletes the group (optional operation).
`void` | `deleteMember(String groupName, org.xmpp.packet.JID user)` Deletes an entity from a group (optional operation).
`Group` | `getGroup(String name)` Returns a group based on it's name.
`int` | `getGroupCount()` Returns the number of groups in the system.
`Collection<String>` | `getGroupNames()` Returns the Collection of all group names in the system.
`Collection<String>` | `getGroupNames(int startIndex, int numResults)` Returns the Collection of all groups in the system.
`Collection<String>` | `getGroupNames(org.xmpp.packet.JID user)` Returns the Collection of group names that an entity belongs to.
`boolean` | `isReadOnly()` Always true for a read-only provider
`boolean` | `isSearchSupported()` Returns true if the provider supports group search capability.
`boolean` | `isSharingSupported()` Returns true if this GroupProvider allows group sharing.
`Collection<String>` | `search(String query)` Returns a collection of group search results.
`Collection<String>` | `search(String query, int startIndex, int numResults)` Returns a collection of group search results.
`void` | `setDescription(String name, String description)` Updates the group's description.
`void` | `setName(String oldName, String newName)` Sets the name of a group to a new name.
`void` | `updateMember(String groupName, org.xmpp.packet.JID user, boolean administrator)` Updates the privileges of an entity in a group.

Methods inherited from class org.jivesoftware.openfire.group.AbstractGroupProvider
`getPublicSharedGroupNames, getSharedGroupNames, getSharedGroupNames, getVisibleGroupNames, loadProperties, search`

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

Constructor Detail

### DefaultGroupProvider

    public DefaultGroupProvider()

Method Detail

### createGroup

    public Group createGroup(String name)

  Description copied from interface: `GroupProvider`
  Creates a group with the given name (optional operation).

  The provider is responsible for setting the creation date and modification date to the current date/time.

  Specified by:
    `createGroup` in interface `GroupProvider`
  Overrides:
    `createGroup` in class `AbstractGroupProvider`
  Parameters:
    `name` - name of the group.
  Returns:
    the newly created group.

### getGroup

    public Group getGroup(String name)
                   throws GroupNotFoundException

  Description copied from interface: `GroupProvider`
  Returns a group based on it's name.

  Parameters:
    `name` - the name of the group.
  Returns:
    the group with the given name.
  Throws:
    `GroupNotFoundException` - If no group with that ID could be found

### setDescription

    public void setDescription(String name,
                               String description)
                        throws GroupNotFoundException

  Description copied from interface: `GroupProvider`
  Updates the group's description.

  Specified by:
    `setDescription` in interface `GroupProvider`
  Overrides:
    `setDescription` in class `AbstractGroupProvider`
  Parameters:
    `name` - the group name.
    `description` - the group description.
  Throws:
    `GroupNotFoundException` - if no existing group could be found to update.

### setName

    public void setName(String oldName,
                        String newName)
                 throws GroupAlreadyExistsException

  Description copied from interface: `GroupProvider`
  Sets the name of a group to a new name.

  Specified by:
    `setName` in interface `GroupProvider`
  Overrides:
    `setName` in class `AbstractGroupProvider`
  Parameters:
    `oldName` - the current name of the group.
    `newName` - the desired new name of the group.
  Throws:
    `GroupAlreadyExistsException` - if a group with the same name already exists.

### deleteGroup

    public void deleteGroup(String groupName)

  Description copied from interface: `GroupProvider`
  Deletes the group (optional operation).

  Specified by:
    `deleteGroup` in interface `GroupProvider`
  Overrides:
    `deleteGroup` in class `AbstractGroupProvider`
  Parameters:
    `groupName` - the name of the group to delete.

### getGroupCount

    public int getGroupCount()

  Description copied from interface: `GroupProvider`
  Returns the number of groups in the system.

  Returns:
    the number of groups in the system.

### getGroupNames

    public Collection<String> getGroupNames()

  Description copied from interface: `GroupProvider`
  Returns the Collection of all group names in the system.

  Returns:
    the Collection of all groups.

### getGroupNames

    public Collection<String> getGroupNames(int startIndex,
                                            int numResults)

  Description copied from interface: `GroupProvider`
  Returns the Collection of all groups in the system.

  Parameters:
    `startIndex` - start index in results.
    `numResults` - number of results to return.
  Returns:
    the Collection of all group names given the `startIndex` and `numResults`.

### getGroupNames

    public Collection<String> getGroupNames(org.xmpp.packet.JID user)

  Description copied from interface: `GroupProvider`
  Returns the Collection of group names that an entity belongs to.

  Parameters:
    `user` - the JID of the entity.
  Returns:
    the Collection of group names that the user belongs to.

### addMember

    public void addMember(String groupName,
                          org.xmpp.packet.JID user,
                          boolean administrator)

  Description copied from interface: `GroupProvider`
  Adds an entity to a group (optional operation).

  Specified by:
    `addMember` in interface `GroupProvider`
  Overrides:
    `addMember` in class `AbstractGroupProvider`
  Parameters:
    `groupName` - the group to add the member to
    `user` - the JID of the entity to add
    `administrator` - True if the member is an administrator of the group

### updateMember

    public void updateMember(String groupName,
                             org.xmpp.packet.JID user,
                             boolean administrator)

  Description copied from interface: `GroupProvider`
  Updates the privileges of an entity in a group.

  Specified by:
    `updateMember` in interface `GroupProvider`
  Overrides:
    `updateMember` in class `AbstractGroupProvider`
  Parameters:
    `groupName` - the group where the change happened
    `user` - the JID of the entity with new privileges
    `administrator` - True if the member is an administrator of the group

### deleteMember

    public void deleteMember(String groupName,
                             org.xmpp.packet.JID user)

  Description copied from interface: `GroupProvider`
  Deletes an entity from a group (optional operation).

  Specified by:
    `deleteMember` in interface `GroupProvider`
  Overrides:
    `deleteMember` in class `AbstractGroupProvider`
  Parameters:
    `groupName` - the group name.
    `user` - the JID of the entity to delete.

### isReadOnly

    public boolean isReadOnly()

  Description copied from class: `AbstractGroupProvider`
  Always true for a read-only provider

  Specified by:
    `isReadOnly` in interface `GroupProvider`
  Overrides:
    `isReadOnly` in class `AbstractGroupProvider`
  Returns:
    true if the user provider is read-only.

### search

    public Collection<String> search(String query)

  Description copied from class: `AbstractGroupProvider`
  Returns a collection of group search results. This implementation returns an empty collection.

  Specified by:
    `search` in interface `GroupProvider`
  Overrides:
    `search` in class `AbstractGroupProvider`
  Parameters:
    `query` - the search string for group names.
  Returns:
    all groups that match the search.

### search

    public Collection<String> search(String query,
                                     int startIndex,
                                     int numResults)

  Description copied from class: `AbstractGroupProvider`
  Returns a collection of group search results. This implementation returns an empty collection.

  Specified by:
    `search` in interface `GroupProvider`
  Overrides:
    `search` in class `AbstractGroupProvider`
  Parameters:
    `query` - the search string for group names.
    `startIndex` - start index in results.
    `numResults` - number of results to return.
  Returns:
    all groups that match the search.

### isSearchSupported

    public boolean isSearchSupported()

  Description copied from class: `AbstractGroupProvider`
  Returns true if the provider supports group search capability. This implementation always returns false.

  Specified by:
    `isSearchSupported` in interface `GroupProvider`
  Overrides:
    `isSearchSupported` in class `AbstractGroupProvider`
  Returns:
    true if searching is supported.

### isSharingSupported

    public boolean isSharingSupported()

  Description copied from interface: `GroupProvider`
  Returns true if this GroupProvider allows group sharing. Shared groups enable roster sharing.

  Specified by:
    `isSharingSupported` in interface `GroupProvider`
  Overrides:
    `isSharingSupported` in class `AbstractGroupProvider`
  Returns:
    true if the group provider supports group sharing.

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

Copyright © 2003-2008 Jive Software.