Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base
Interface Group

All Known Subinterfaces:
IntrospectiveGroup
All Known Implementing Classes:
DbGroup, GroupAdapter, GroupProxy, LdapGroup, LdapSearchGroup, MockGroup

public interface Group

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 forum. A forum administrator may wish to create a "Thread Posters" group that has CREATE_THREAD permissions in the forum. Then, users can be added to that group and will automatically receive CREATE_THREAD permissions in that forum.

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.
 void deleteProperty(java.lang.String name)
          Deletes an extended property.
 int getAdministratorCount()
          Returns the number of group administrators.
 java.util.Iterator getAdministrators()
          An iterator for all the users that are administrators of the group.
 java.util.Date getCreationDate()
          Returns the date that the group was created.
 java.lang.String getDescription()
          Returns the description of the group.
 long getID()
          Returns the id of the group.
 int getMemberCount()
          Returns the number of group members.
 java.util.Iterator getMembers()
          An iterator for all the users that are members of the group.
 java.util.Date getModificationDate()
          Returns the date that the group was last modified.
 java.lang.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.
 java.lang.String getProperty(java.lang.String name)
          Returns an extended property of the group.
 java.util.Iterator getPropertyNames()
          Returns an Iterator for all the names of the extended group properties.
 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(java.util.Date creationDate)
          Sets the creation date of the group.
 void setDescription(java.lang.String description)
          Sets the description of the group.
 void setModificationDate(java.util.Date modificationDate)
          Sets the date the group was last modified.
 void setName(java.lang.String name)
          Sets the name of the group.
 void setProperty(java.lang.String name, java.lang.String value)
          Sets an extended property of the group.
 

Method Detail

getID

long getID()
Returns the id of the group.

Returns:
the id of the group.

getName

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

Returns:
the name of the group.

setName

void setName(java.lang.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

java.lang.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

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

getCreationDate

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

Returns:
the date the group was created.

setCreationDate

void setCreationDate(java.util.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

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

Returns:
the date the group record was last modified.

setModificationDate

void setModificationDate(java.util.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.

getProperty

java.lang.String getProperty(java.lang.String name)
Returns an extended property of the group. Each group can have an arbitrary number of extended properties. This lets particular skins or filters provide enhanced functionality that is not part of the base interface.

Parameters:
name - the name of the property to get.
Returns:
the value of the property

setProperty

void setProperty(java.lang.String name,
                 java.lang.String value)
                 throws UnauthorizedException
Sets an extended property of the group. Each group can have an arbitrary number of extended properties. This lets particular skins or filters provide enhanced functionality that is not part of the base interface.

Parameters:
name - the name of the property to set.
value - the new value for the property.
Throws:
UnauthorizedException - if not allowed to change the group.

deleteProperty

void deleteProperty(java.lang.String name)
                    throws UnauthorizedException
Deletes an extended property. If the property specified by name does not exist, this method will do nothing.

Parameters:
name - the name of the property to delete.
Throws:
UnauthorizedException - if not allowed to edit messages.

getPropertyNames

java.util.Iterator getPropertyNames()
Returns an Iterator for all the names of the extended group properties.

Returns:
an Iterator for the property names.

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.

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.

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

java.util.Iterator getMembers()
An iterator for all the users that are members of the group.

Returns:
an Iterator for all members of the group.

getAdministrators

java.util.Iterator getAdministrators()
An iterator for all the users that are administrators of the group.

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

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.