Clearspace API (2.0.15) Web Services Client Javadocs

com.jivesoftware.community.webservices
Interface GroupService


public interface GroupService

Provides a the ability for managing groups and group membership.


Method Summary
 void addAdministratorToGroup(long userID, long groupID)
          Make the user with the specified userID an administrator of the group with the specified groupID.
 void addMemberToGroup(long userID, long groupID)
          Add the user with the specified userID to the group with the specified groupID.
 WSGroup createGroup(java.lang.String name, java.lang.String description)
          Creates a new group.
 void deleteGroup(long groupID)
          Delete the group with the specified id.
 void deleteProperty(java.lang.String name, long groupID)
          Deletes an extended property from the specfied group.
 int getAdministratorCount(long groupID)
          Returns the count of how many administrators there are for the group with the specified ID.
 WSGroup getGroup(long groupID)
          Returns a WSGroup by its ID.
 WSUser[] getGroupAdmins(long groupID)
          Returns an array of all the user IDs that administer this group.
 WSGroup getGroupByName(java.lang.String name)
          Returns a WSGroup by its name.
 int getGroupCount()
          Returns a count of all groups in the system.
 WSUser[] getGroupMembers(long groupID)
          Returns an array of all userIDs for all the members of a particular group.
 java.lang.String[] getGroupNames()
          Returns an array of all the group names for all the groups in the system.
 java.lang.String[] getGroupNamesBounded(int startIndex, int numResults)
          Returns an array of the group names beginning at startIndex and until the number results equals numResults.
 WSGroup[] getGroups()
          Returns an array of all the group IDs for all the groups in the system.
 WSProperty[] getProperties(long groupID)
          Returns an array of all the extended properties for a group.
 java.lang.String[] getUserGroupNames(long userID)
          Returns an array of group names that an entity belongs to.
 WSGroup[] getUserGroups(long userID)
          Returns an array of all the group IDs that a user belongs too.
 boolean isReadOnly()
          Returns true if this GroupService is read-only.
 void removeAdministratorFromGroup(long userID, long groupID)
          Remove the user with the specified ID as an administrator from the group with the specified ID.
 void removeMemberFromGroup(long userID, long groupID)
          Remove the user with the specified id from the group with the specified id.
 void setProperty(java.lang.String name, java.lang.String value, long groupID)
          Set a new extended property on the specified group.
 void updateGroup(WSGroup group)
          Update the following group in the system.
 

Method Detail

getGroup

WSGroup getGroup(long groupID)
                 throws GroupNotFoundException
Returns a WSGroup by its ID.

Parameters:
groupID - The ID of the group.
Returns:
The group that matches the ID specified.
Throws:
GroupNotFoundException - Thrown if the group with the specified id does not exist

getGroupByName

WSGroup getGroupByName(java.lang.String name)
                       throws GroupNotFoundException
Returns a WSGroup by its name. The name should be encoded using java.net.URLEncoder.encode(name, "UTF-8") or equivalent.

Parameters:
name - The name of the group UTF-8 encoded.
Returns:
The group with the matching name.
Throws:
GroupNotFoundException - Thrown if the group with the specified id does not exist

getGroupMembers

WSUser[] getGroupMembers(long groupID)
                         throws GroupNotFoundException
Returns an array of all userIDs for all the members of a particular group.

Parameters:
groupID - The ID of the group to acquire members for.
Returns:
A array of user IDs.
Throws:
GroupNotFoundException - Thrown if the group with the specified id does not exist

getGroupCount

int getGroupCount()
Returns a count of all groups in the system.

Returns:
A count of all groups in the system.

getGroups

WSGroup[] getGroups()
Returns an array of all the group IDs for all the groups in the system.

Returns:
An array of all the group IDs for all the groups in the system.

getGroupNames

java.lang.String[] getGroupNames()
Returns an array of all the group names for all the groups in the system.

Returns:
An array of all the group names for all the groups in the system.

getGroupNamesBounded

java.lang.String[] getGroupNamesBounded(int startIndex,
                                        int numResults)
Returns an array of the group names beginning at startIndex and until the number results equals numResults.

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

getUserGroupNames

java.lang.String[] getUserGroupNames(long userID)
                                     throws UserNotFoundException
Returns an array of group names that an entity belongs to.

Parameters:
userID - the ID of the user.
Returns:
An array of group names that the user belongs to.
Throws:
UserNotFoundException - Thrown if the group with the specified id does not exist.

getUserGroups

WSGroup[] getUserGroups(long userID)
                        throws UserNotFoundException
Returns an array of all the group IDs that a user belongs too.

Parameters:
userID - The ID of the user to acquire group IDs for.
Returns:
An array of all the group IDs that a user belongs too.
Throws:
UserNotFoundException - Thrown if the group with the specified id does not exist.

getGroupAdmins

WSUser[] getGroupAdmins(long groupID)
                        throws GroupNotFoundException
Returns an array of all the user IDs that administer this group.

Parameters:
groupID - The group ID to acquire administrator IDs for.
Returns:
An array of all the user IDs that administer this group.
Throws:
GroupNotFoundException - Thrown if the group with the specified id does not exist.

getAdministratorCount

int getAdministratorCount(long groupID)
                          throws GroupNotFoundException
Returns the count of how many administrators there are for the group with the specified ID.

Parameters:
groupID - The ID of the group to acquire the administrator count for.
Returns:
The number of administrators in the group.
Throws:
GroupNotFoundException - Thrown if the group with the specified id does not exist.

createGroup

WSGroup createGroup(java.lang.String name,
                    java.lang.String description)
                    throws GroupAlreadyExistsException
Creates a new group.

Parameters:
name - The name of the group.
description - A short description of this group.
Returns:
The newly created group.
Throws:
com.jivesoftware.base.GroupAlreadyExistsException - Thrown if a grouip with the specified name already exists.
GroupAlreadyExistsException

deleteGroup

void deleteGroup(long groupID)
                 throws GroupNotFoundException
Delete the group with the specified id.

Parameters:
groupID - The id of the group to delete.
Throws:
GroupNotFoundException - Thrown if the group with the specified id does not exist.

updateGroup

void updateGroup(WSGroup group)
                 throws GroupNotFoundException,
                        GroupAlreadyExistsException
Update the following group in the system.

Parameters:
group - The group to update.
Throws:
com.jivesoftware.base.GroupAlreadyExistsException - If attempts to change the group name to another groups name.
GroupNotFoundException - If the specified group does not exist.
GroupAlreadyExistsException

getProperties

WSProperty[] getProperties(long groupID)
                           throws GroupNotFoundException
Returns an array of all the extended properties for a group.

Parameters:
groupID - The ID of the group to acquire extended properties for.
Returns:
An array of extended properties for the specified group.
Throws:
GroupNotFoundException - Thrown if the group with the specified id does not exist.

setProperty

void setProperty(java.lang.String name,
                 java.lang.String value,
                 long groupID)
                 throws GroupNotFoundException,
                        GroupAlreadyExistsException
Set a new extended property on the specified group.

Parameters:
name - The extended property name.
value - The extended property value.
groupID - The ID of the group to set the extended property on.
Throws:
com.jivesoftware.base.GroupAlreadyExistsException - If attempts to change the group name to another groups name.
GroupNotFoundException - If the specified group does not exist.
GroupAlreadyExistsException

deleteProperty

void deleteProperty(java.lang.String name,
                    long groupID)
                    throws GroupNotFoundException,
                           GroupAlreadyExistsException
Deletes an extended property from the specfied group.

Parameters:
name - The name of the extended property to delete.
groupID - The id of the group to delete an extended property from.
Throws:
GroupNotFoundException - If the specified group already exists.
GroupAlreadyExistsException

addMemberToGroup

void addMemberToGroup(long userID,
                      long groupID)
                      throws UserNotFoundException,
                             GroupNotFoundException,
                             GroupAlreadyExistsException
Add the user with the specified userID to the group with the specified groupID.

Parameters:
userID - The ID of the user to add to a group.
groupID - The ID of the group to add a user too.
Throws:
UserNotFoundException
GroupNotFoundException
GroupAlreadyExistsException

addAdministratorToGroup

void addAdministratorToGroup(long userID,
                             long groupID)
                             throws UserNotFoundException,
                                    GroupNotFoundException,
                                    GroupAlreadyExistsException
Make the user with the specified userID an administrator of the group with the specified groupID.

Parameters:
userID - The ID of the user to add as a member to a group.
groupID - The ID of the group to make a user an administrator for.
Throws:
UserNotFoundException
GroupNotFoundException
GroupAlreadyExistsException

removeMemberFromGroup

void removeMemberFromGroup(long userID,
                           long groupID)
                           throws UserNotFoundException,
                                  GroupNotFoundException,
                                  GroupAlreadyExistsException
Remove the user with the specified id from the group with the specified id.

Parameters:
userID - The ID of the User to remove from a group.
groupID - The ID of the group to remove a user from.
Throws:
UserNotFoundException
GroupNotFoundException
GroupAlreadyExistsException

removeAdministratorFromGroup

void removeAdministratorFromGroup(long userID,
                                  long groupID)
                                  throws UserNotFoundException,
                                         GroupNotFoundException,
                                         GroupAlreadyExistsException
Remove the user with the specified ID as an administrator from the group with the specified ID.

Parameters:
userID - The ID of the user to remove admin status from a group.
groupID - The ID of the group to remove the user as an admin.
Throws:
UserNotFoundException
GroupNotFoundException
GroupAlreadyExistsException

isReadOnly

boolean isReadOnly()
Returns true if this GroupService is read-only. When read-only, groups can not be created, deleted, or modified.

Returns:
true if the user provider is read-only.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.