com.atlassian.crowd.integration.jive
Class CrowdGroup

java.lang.Object
  extended by com.atlassian.crowd.integration.jive.CrowdGroup
All Implemented Interfaces:
com.jivesoftware.base.Group, com.jivesoftware.util.Cacheable, java.io.Serializable

public class CrowdGroup
extends java.lang.Object
implements com.jivesoftware.base.Group, com.jivesoftware.util.Cacheable

This is a modified version of the Jive LDAP group integration class LdapGroup. All calls to LDAP have been replaced with calls to Crowd.

Thus the caching mechanisms and inherent inefficiency in some of the calls have been retained from the original implementation. This is "as good as" Jive's LDAP implementation.

See Also:
Serialized Form

Constructor Summary
protected CrowdGroup(long ID)
          Creates a new CrowdGroup.
protected CrowdGroup(java.lang.String name, java.lang.String description, java.util.List members)
          Creates a new CrowdGroup.
 
Method Summary
 void addAdministrator(com.jivesoftware.base.User user)
           
 void addMember(com.jivesoftware.base.User user)
           
 void deleteProperty(java.lang.String name)
           
 boolean equals(java.lang.Object object)
           
 int getAdministratorCount()
           
 java.util.Iterator getAdministrators()
           
 int getCachedSize()
           
 java.util.Date getCreationDate()
           
 java.lang.String getDescription()
           
 long getID()
           
 int getMemberCount()
           
 java.util.Iterator getMembers()
           
 java.util.Date getModificationDate()
           
 java.lang.String getName()
           
 com.jivesoftware.base.Permissions getPermissions(com.jivesoftware.base.AuthToken auth)
           
 java.lang.String getProperty(java.lang.String name)
           
 java.util.Iterator getPropertyNames()
           
 int hashCode()
           
 boolean isAdministrator(com.jivesoftware.base.User user)
           
 boolean isAuthorized(long permissionType)
           
 boolean isMember(com.jivesoftware.base.User user)
           
 void removeAdministrator(com.jivesoftware.base.User user)
           
 void removeMember(com.jivesoftware.base.User user)
           
 void setCreationDate(java.util.Date creationDate)
           
 void setDescription(java.lang.String description)
           
 void setModificationDate(java.util.Date modificationDate)
           
 void setName(java.lang.String name)
           
 void setProperty(java.lang.String name, java.lang.String value)
           
 java.lang.String toString()
          Returns a String representation of the Group object using the group name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CrowdGroup

protected CrowdGroup(java.lang.String name,
                     java.lang.String description,
                     java.util.List members)
Creates a new CrowdGroup. This doesn't actually create a new Crowd record, but instead creates the db record that supports an existing Crowd entry.

Parameters:
name - the name for the new entry.

CrowdGroup

protected CrowdGroup(long ID)
              throws com.jivesoftware.base.GroupNotFoundException
Creates a new CrowdGroup. This doesn't actually create a new Crowd record, but instead loads the db record for the given ID.

Parameters:
ID - the ID for the existing entry.
Throws:
com.jivesoftware.base.GroupNotFoundException
Method Detail

getID

public long getID()
Specified by:
getID in interface com.jivesoftware.base.Group

getName

public java.lang.String getName()
Specified by:
getName in interface com.jivesoftware.base.Group

setName

public void setName(java.lang.String name)
             throws com.jivesoftware.base.UnauthorizedException
Specified by:
setName in interface com.jivesoftware.base.Group
Throws:
com.jivesoftware.base.UnauthorizedException

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface com.jivesoftware.base.Group

setDescription

public void setDescription(java.lang.String description)
                    throws com.jivesoftware.base.UnauthorizedException
Specified by:
setDescription in interface com.jivesoftware.base.Group
Throws:
com.jivesoftware.base.UnauthorizedException

getCreationDate

public java.util.Date getCreationDate()
Specified by:
getCreationDate in interface com.jivesoftware.base.Group

setCreationDate

public void setCreationDate(java.util.Date creationDate)
                     throws com.jivesoftware.base.UnauthorizedException
Specified by:
setCreationDate in interface com.jivesoftware.base.Group
Throws:
com.jivesoftware.base.UnauthorizedException

getModificationDate

public java.util.Date getModificationDate()
Specified by:
getModificationDate in interface com.jivesoftware.base.Group

setModificationDate

public void setModificationDate(java.util.Date modificationDate)
                         throws com.jivesoftware.base.UnauthorizedException
Specified by:
setModificationDate in interface com.jivesoftware.base.Group
Throws:
com.jivesoftware.base.UnauthorizedException

getProperty

public java.lang.String getProperty(java.lang.String name)
Specified by:
getProperty in interface com.jivesoftware.base.Group

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws com.jivesoftware.base.UnauthorizedException
Specified by:
setProperty in interface com.jivesoftware.base.Group
Throws:
com.jivesoftware.base.UnauthorizedException

deleteProperty

public void deleteProperty(java.lang.String name)
                    throws com.jivesoftware.base.UnauthorizedException
Specified by:
deleteProperty in interface com.jivesoftware.base.Group
Throws:
com.jivesoftware.base.UnauthorizedException

getPropertyNames

public java.util.Iterator getPropertyNames()
Specified by:
getPropertyNames in interface com.jivesoftware.base.Group

addAdministrator

public void addAdministrator(com.jivesoftware.base.User user)
                      throws com.jivesoftware.base.UnauthorizedException
Specified by:
addAdministrator in interface com.jivesoftware.base.Group
Throws:
com.jivesoftware.base.UnauthorizedException

removeAdministrator

public void removeAdministrator(com.jivesoftware.base.User user)
                         throws com.jivesoftware.base.UnauthorizedException
Specified by:
removeAdministrator in interface com.jivesoftware.base.Group
Throws:
com.jivesoftware.base.UnauthorizedException

addMember

public void addMember(com.jivesoftware.base.User user)
               throws com.jivesoftware.base.UnauthorizedException
Specified by:
addMember in interface com.jivesoftware.base.Group
Throws:
com.jivesoftware.base.UnauthorizedException

removeMember

public void removeMember(com.jivesoftware.base.User user)
                  throws com.jivesoftware.base.UnauthorizedException
Specified by:
removeMember in interface com.jivesoftware.base.Group
Throws:
com.jivesoftware.base.UnauthorizedException

isAdministrator

public boolean isAdministrator(com.jivesoftware.base.User user)
Specified by:
isAdministrator in interface com.jivesoftware.base.Group

isMember

public boolean isMember(com.jivesoftware.base.User user)
Specified by:
isMember in interface com.jivesoftware.base.Group

getAdministratorCount

public int getAdministratorCount()
Specified by:
getAdministratorCount in interface com.jivesoftware.base.Group

getMemberCount

public int getMemberCount()
Specified by:
getMemberCount in interface com.jivesoftware.base.Group

getMembers

public java.util.Iterator getMembers()
Specified by:
getMembers in interface com.jivesoftware.base.Group

getAdministrators

public java.util.Iterator getAdministrators()
Specified by:
getAdministrators in interface com.jivesoftware.base.Group

getPermissions

public com.jivesoftware.base.Permissions getPermissions(com.jivesoftware.base.AuthToken auth)
Specified by:
getPermissions in interface com.jivesoftware.base.Group

isAuthorized

public boolean isAuthorized(long permissionType)
Specified by:
isAuthorized in interface com.jivesoftware.base.Group

getCachedSize

public int getCachedSize()
Specified by:
getCachedSize in interface com.jivesoftware.util.Cacheable

toString

public java.lang.String toString()
Returns a String representation of the Group object using the group name.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of the Group object.

hashCode

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

equals

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


Copyright © 2010 Atlassian. All Rights Reserved.