Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base
Class GroupProxy

java.lang.Object
  extended by com.jivesoftware.base.GroupProxy
All Implemented Interfaces:
Group, IntrospectiveGroup

public class GroupProxy
extends java.lang.Object
implements IntrospectiveGroup

Protection proxy for the Group interface. It restricts access of certain methods to those that have the proper permissions to administer this object.


Constructor Summary
GroupProxy(Group group, AuthToken authToken, Permissions permissions)
           
 
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.
 boolean equals(java.lang.Object obj)
           
 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.
 int hashCode()
           
 boolean isAddAdministratorSupported()
          Indicates whether adding an administrator to this group is supported.
 boolean isAddMemberSupported()
          Indicates whether adding a member to this group is supported.
 boolean isAdministrator(User user)
          Returns true if the User has group administrator permissions.
 boolean isAdministratorListSupported()
          Indicates whether returning a list of group administrators is supported.
 boolean isAuthorized(long type)
          Returns true if the handle on the object has the permission specified.
 boolean isGetAdministratorCountSupported()
          Indicates whether getting a count of administrators is supported.
 boolean isGetMemberCountSupported()
          Indicates whether getting a count of members is supported.
 boolean isMember(User user)
          Returns true if if the User is a member of the group.
 boolean isMembersSupported()
          Indicates whether returning a list of group members is supported.
 boolean isPropertyEditSupported()
          Indicates whether the property methods (get, set, delete, etc.) are supported.
 boolean isReadOnly()
           
 boolean isRemoveAdministratorSupported()
          Indicates whether removing a group administrator is supported.
 boolean isRemoveMemberSupported()
          Indicates whether removing a group member is supported.
 boolean isSetDescriptionSupported()
          Indicates whether modifying the group description is supported.
 boolean isSetNameSupported()
          Indicates whether modifying the group name is supported.
 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.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GroupProxy

public GroupProxy(Group group,
                  AuthToken authToken,
                  Permissions permissions)
Method Detail

getID

public long getID()
Description copied from interface: Group
Returns the id of the group.

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

getName

public java.lang.String getName()
Description copied from interface: Group
Returns the name of the group. For example, 'XYZ Admins'.

Specified by:
getName in interface Group
Returns:
the name of the group.

setName

public void setName(java.lang.String name)
             throws UnauthorizedException
Description copied from interface: Group
Sets the name of the group. For example, 'XYZ Admins'. This method is restricted to those with group administration permission.

Specified by:
setName in interface Group
Parameters:
name - the name for the group.
Throws:
UnauthorizedException - if does not have group administrator permissions.

getDescription

public java.lang.String getDescription()
Description copied from interface: Group
Returns the description of the group. The description often summarizes a group's function, such as 'Administrators of the XYZ forum'.

Specified by:
getDescription in interface Group
Returns:
the description of the group.

setDescription

public void setDescription(java.lang.String description)
                    throws UnauthorizedException
Description copied from interface: Group
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.

Specified by:
setDescription in interface Group
Parameters:
description - the description of the group.
Throws:
UnauthorizedException - if does not have group administrator permissions.

getCreationDate

public java.util.Date getCreationDate()
Description copied from interface: Group
Returns the date that the group was created.

Specified by:
getCreationDate in interface Group
Returns:
the date the group was created.

setCreationDate

public void setCreationDate(java.util.Date creationDate)
                     throws UnauthorizedException
Description copied from interface: Group
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.

Specified by:
setCreationDate in interface Group
Parameters:
creationDate - the date the group was created.
Throws:
UnauthorizedException - if does not have administrator permissions.

getModificationDate

public java.util.Date getModificationDate()
Description copied from interface: Group
Returns the date that the group was last modified.

Specified by:
getModificationDate in interface Group
Returns:
the date the group record was last modified.

setModificationDate

public void setModificationDate(java.util.Date modificationDate)
                         throws UnauthorizedException
Description copied from interface: Group
Sets the date the group was last modified. Skin authors should ignore this method since it only intended for system maintenance.

Specified by:
setModificationDate in interface Group
Parameters:
modificationDate - the date the group was modified.
Throws:
UnauthorizedException - if does not have administrator permissions.

getProperty

public java.lang.String getProperty(java.lang.String name)
Description copied from interface: Group
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.

Specified by:
getProperty in interface Group
Parameters:
name - the name of the property to get.
Returns:
the value of the property

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws UnauthorizedException
Description copied from interface: Group
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.

Specified by:
setProperty in interface Group
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

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

Specified by:
deleteProperty in interface Group
Parameters:
name - the name of the property to delete.
Throws:
UnauthorizedException - if not allowed to edit messages.

getPropertyNames

public java.util.Iterator getPropertyNames()
Description copied from interface: Group
Returns an Iterator for all the names of the extended group properties.

Specified by:
getPropertyNames in interface Group
Returns:
an Iterator for the property names.

addAdministrator

public void addAdministrator(User user)
                      throws UnauthorizedException
Description copied from interface: Group
Grants administrator privileges of the group to a user. This method is restricted to those with group administration permission.

Specified by:
addAdministrator in interface Group
Parameters:
user - the User to grant adminstrative privileges to.
Throws:
UnauthorizedException - if does not have group administrator permissions.

removeAdministrator

public void removeAdministrator(User user)
                         throws UnauthorizedException
Description copied from interface: Group
Revokes administrator privileges of the group to a user. This method is restricted to those with group administration permission.

Specified by:
removeAdministrator in interface Group
Parameters:
user - the User to grant adminstrative privileges to.
Throws:
UnauthorizedException - if does not have group administrator permissions.

addMember

public void addMember(User user)
               throws UnauthorizedException
Description copied from interface: Group
Adds a member to the group. This method is restricted to those with group administration permission.

Specified by:
addMember in interface Group
Parameters:
user - the User to add to the group.
Throws:
UnauthorizedException - if does not have group administrator permissions.

removeMember

public void removeMember(User user)
                  throws UnauthorizedException
Description copied from interface: Group
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.

Specified by:
removeMember in interface Group
Parameters:
user - the User to remove from the group.
Throws:
UnauthorizedException - if does not have group administrator permissions.

isAdministrator

public boolean isAdministrator(User user)
Description copied from interface: Group
Returns true if the User has group administrator permissions.

Specified by:
isAdministrator in interface Group
Returns:
true if the User is an administrator of the group.

isMember

public boolean isMember(User user)
Description copied from interface: Group
Returns true if if the User is a member of the group.

Specified by:
isMember in interface Group
Returns:
true if the User is a member of the group.

getAdministratorCount

public int getAdministratorCount()
Description copied from interface: Group
Returns the number of group administrators.

Specified by:
getAdministratorCount in interface Group
Returns:
the number of group administrators.

getMemberCount

public int getMemberCount()
Description copied from interface: Group
Returns the number of group members.

Specified by:
getMemberCount in interface Group
Returns:
the number of group members.

getMembers

public java.util.Iterator getMembers()
Description copied from interface: Group
An iterator for all the users that are members of the group.

Specified by:
getMembers in interface Group
Returns:
an Iterator for all members of the group.

getAdministrators

public java.util.Iterator getAdministrators()
Description copied from interface: Group
An iterator for all the users that are administrators of the group.

Specified by:
getAdministrators in interface Group
Returns:
an Iterator for all administrators of the group.

getPermissions

public Permissions getPermissions(AuthToken authToken)
Description copied from interface: Group
Returns the permissions for the group that correspond to the passed-in AuthToken.

Specified by:
getPermissions in interface Group
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

public boolean isAuthorized(long type)
Description copied from interface: Group
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.

Specified by:
isAuthorized in interface Group
Parameters:
type - a permission type.
Returns:
true if the specified permission is valid.
See Also:
Permissions

isAddAdministratorSupported

public boolean isAddAdministratorSupported()
Description copied from interface: IntrospectiveGroup
Indicates whether adding an administrator to this group is supported.

Specified by:
isAddAdministratorSupported in interface IntrospectiveGroup
Returns:
true if adding an administrator to this group is supported.

isAddMemberSupported

public boolean isAddMemberSupported()
Description copied from interface: IntrospectiveGroup
Indicates whether adding a member to this group is supported.

Specified by:
isAddMemberSupported in interface IntrospectiveGroup
Returns:
true if adding a memeber to this group is supported.

isAdministratorListSupported

public boolean isAdministratorListSupported()
Description copied from interface: IntrospectiveGroup
Indicates whether returning a list of group administrators is supported.

Specified by:
isAdministratorListSupported in interface IntrospectiveGroup
Returns:
true if returning a list of group administrators is supported.

isMembersSupported

public boolean isMembersSupported()
Description copied from interface: IntrospectiveGroup
Indicates whether returning a list of group members is supported.

Specified by:
isMembersSupported in interface IntrospectiveGroup
Returns:
true if returning a list of group members is supported.

isRemoveAdministratorSupported

public boolean isRemoveAdministratorSupported()
Description copied from interface: IntrospectiveGroup
Indicates whether removing a group administrator is supported.

Specified by:
isRemoveAdministratorSupported in interface IntrospectiveGroup
Returns:
true if removing a group administrator is supported.

isRemoveMemberSupported

public boolean isRemoveMemberSupported()
Description copied from interface: IntrospectiveGroup
Indicates whether removing a group member is supported.

Specified by:
isRemoveMemberSupported in interface IntrospectiveGroup
Returns:
true if removing a group member is supported.

isSetDescriptionSupported

public boolean isSetDescriptionSupported()
Description copied from interface: IntrospectiveGroup
Indicates whether modifying the group description is supported.

Specified by:
isSetDescriptionSupported in interface IntrospectiveGroup
Returns:
true if modifying the group description is supported.

isSetNameSupported

public boolean isSetNameSupported()
Description copied from interface: IntrospectiveGroup
Indicates whether modifying the group name is supported.

Specified by:
isSetNameSupported in interface IntrospectiveGroup
Returns:
true if modifying the group name is supported.

isGetMemberCountSupported

public boolean isGetMemberCountSupported()
Description copied from interface: IntrospectiveGroup
Indicates whether getting a count of members is supported.

Specified by:
isGetMemberCountSupported in interface IntrospectiveGroup
Returns:
true if getting a count of members is supported.

isGetAdministratorCountSupported

public boolean isGetAdministratorCountSupported()
Description copied from interface: IntrospectiveGroup
Indicates whether getting a count of administrators is supported.

Specified by:
isGetAdministratorCountSupported in interface IntrospectiveGroup
Returns:
true if getting a count of administrators is supported.

isPropertyEditSupported

public boolean isPropertyEditSupported()
Description copied from interface: IntrospectiveGroup
Indicates whether the property methods (get, set, delete, etc.) are supported.

Specified by:
isPropertyEditSupported in interface IntrospectiveGroup
Returns:
true if the property methods are supported.

isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface IntrospectiveGroup

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.