Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.base
Interface Group

All Superinterfaces:
JiveObject
All Known Subinterfaces:
IntrospectiveGroup

public interface Group
extends JiveObject

Organizes users into a group for easier permissions management. In this way, groups essentially serve the same purpose that they do in Unix or Windows.

For example, CREATE_THREAD permissions can be set per community. An administrator may wish to create a "Thread Posters" group that has CREATE_THREAD permissions in the community. Then, users can be added to that group and will automatically receive CREATE_THREAD permissions in that community.

Security for Group objects is provide by GroupProxy protection proxy objects.

See Also:
User

Method Summary
 void addAdministrator(User user)
          Grants administrator privileges of the group to a user.
 void addMember(User user)
          Adds a member to the group.
 int getAdministratorCount()
          Returns the number of group administrators.
 List<User> getAdministrators()
          An iterator for all the users that are administrators of the group.
 Date getCreationDate()
          Returns the date that the group was created.
 String getDescription()
          Returns the description of the group.
 long getID()
          Returns the id of the group.
 int getMemberCount()
          Returns the number of group members.
 List<User> getMembers()
          An iterator for all the users that are members of the group.
 Iterable<User> getMembers(int startIndex, int numResults)
          Returns an iterator for all members starting at startIndex with the given number of results.
 Date getModificationDate()
          Returns the date that the group was last modified.
 String getName()
          Returns the name of the group.
 Permissions getPermissions(AuthToken authToken)
          Returns the permissions for the group that correspond to the passed-in AuthToken.
 Map<String,String> getProperties()
          Retrieve a map of all the extended properties for the group.
 boolean isAdministrator(User user)
          Returns true if the User has group administrator permissions.
 boolean isAuthorized(long permissionType)
          Returns true if the handle on the object has the permission specified.
 boolean isMember(User user)
          Returns true if if the User is a member of the group.
 void removeAdministrator(User user)
          Revokes administrator privileges of the group to a user.
 void removeMember(User user)
          Removes a member from the group.
 void setCreationDate(Date creationDate)
          Sets the creation date of the group.
 void setDescription(String description)
          Sets the description of the group.
 void setModificationDate(Date modificationDate)
          Sets the date the group was last modified.
 void setName(String name)
          Sets the name of the group.
 
Methods inherited from interface com.jivesoftware.community.JiveObject
getObjectType
 

Method Detail

getID

long getID()
Returns the id of the group.

Specified by:
getID in interface JiveObject
Returns:
the id of the group.

getName

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

Returns:
the name of the group.

setName

void setName(String name)
             throws UnauthorizedException
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.
Throws:
UnauthorizedException - if does not have group administrator permissions.

getDescription

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

Returns:
the description of the group.

setDescription

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

Parameters:
description - the description of the group.
Throws:
UnauthorizedException - if does not have group administrator permissions.

getCreationDate

Date getCreationDate()
Returns the date that the group was created.

Returns:
the date the group was created.

setCreationDate

void setCreationDate(Date creationDate)
                     throws UnauthorizedException
Sets the creation date of the group. In most cases, the creation date will default to when the group was entered into the system. However, the date needs to be set manually when importing data. In other words, skin authors should ignore this method since it only intended for system maintenance.

Parameters:
creationDate - the date the group was created.
Throws:
UnauthorizedException - if does not have administrator permissions.

getModificationDate

Date getModificationDate()
Returns the date that the group was last modified.

Returns:
the date the group record was last modified.

setModificationDate

void setModificationDate(Date modificationDate)
                         throws UnauthorizedException
Sets the date the group was last modified. Skin authors should ignore this method since it only intended for system maintenance.

Parameters:
modificationDate - the date the group was modified.
Throws:
UnauthorizedException - if does not have administrator permissions.

getProperties

Map<String,String> getProperties()
Retrieve a map of all the extended properties for the group. Each group can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface. The map is alterable if the user is authorized to modify the group. Null keys and values are not allowed.

If the user is not authorized to modify the group any method which modifies the map will fail with a UnsupportedOperationException;

Requires update if modified

Returns:
a map of group extended properties.

addAdministrator

void addAdministrator(User user)
                      throws UnauthorizedException
Grants administrator privileges of the group to a user. This method is restricted to those with group administration permission.

Parameters:
user - the User to grant adminstrative privileges to.
Throws:
UnauthorizedException - if does not have group administrator permissions.

removeAdministrator

void removeAdministrator(User user)
                         throws UnauthorizedException
Revokes administrator privileges of the group to a user. This method is restricted to those with group administration permission.

Parameters:
user - the User to grant adminstrative privileges to.
Throws:
UnauthorizedException - if does not have group administrator permissions.

addMember

void addMember(User user)
               throws UnauthorizedException
Adds a member to the group. This method is restricted to those with group administration permission.

Parameters:
user - the User to add to the group.
Throws:
UnauthorizedException - if does not have group administrator permissions.

removeMember

void removeMember(User user)
                  throws UnauthorizedException
Removes a member from the group. If the User is not in the group, this method does nothing. This method is restricted to those with group administration permission.

Parameters:
user - the User to remove from the group.
Throws:
UnauthorizedException - if does not have group administrator permissions.

isAdministrator

boolean isAdministrator(User user)
Returns true if the User has group administrator permissions.

Parameters:
user - User to test.
Returns:
true if the User is an administrator of the group.

isMember

boolean isMember(User user)
Returns true if if the User is a member of the group.

Parameters:
user - User to test.
Returns:
true if the User is a member of the group.

getAdministratorCount

int getAdministratorCount()
Returns the number of group administrators.

Returns:
the number of group administrators.

getMemberCount

int getMemberCount()
Returns the number of group members.

Returns:
the number of group members.

getMembers

List<User> getMembers()
An iterator for all the users that are members of the group.

If the list is modified an update will be required.

Returns:
an Iterator for all members of the group.

getMembers

Iterable<User> getMembers(int startIndex,
                          int numResults)
Returns an iterator for all members starting at startIndex with the given number of results. This is useful to support pagination in a GUI where you may only want to display a certain number of results per page. It is possible that the number of results returned will be less than that specified by numResults if numResults is greater than the number of records left in the system to display.

Parameters:
startIndex - the beginning index to start the results at.
numResults - the total number of results to return.
Returns:
an Iterator for all users in the specified range.

getAdministrators

List<User> getAdministrators()
An iterator for all the users that are administrators of the group.

If the list is modified an update will be required.

Returns:
an Iterator for all administrators of the group.

getPermissions

Permissions getPermissions(AuthToken authToken)
Returns the permissions for the group that correspond to the passed-in AuthToken.

Parameters:
authToken - the auth token to lookup permissions for.
Returns:
the permissions for the group that correspond to the passed-in AuthToken.
See Also:
Permissions

isAuthorized

boolean isAuthorized(long permissionType)
Returns true if the handle on the object has the permission specified. A list of possible permissions can be found in the Permissions class. Certain methods of this class are restricted to certain permissions as specified in the method comments.

Parameters:
permissionType - a permission type.
Returns:
true if the specified permission is valid.
See Also:
Permissions

Clearspace Project Page

Copyright © 1999-2007 Jive Software.