com.atlassian.confluence.spaces
Class DefaultSpaceGroupManager

java.lang.Object
  extended by com.atlassian.confluence.spaces.DefaultSpaceGroupManager
All Implemented Interfaces:
SpaceGroupManager

public class DefaultSpaceGroupManager
extends Object
implements SpaceGroupManager


Constructor Summary
DefaultSpaceGroupManager()
           
 
Method Summary
 SpaceGroup createSpaceGroup(String key, String name)
          Create a Space Group
 SpaceGroup createSpaceGroup(String key, String name, String creatorName)
          Create a space Group
 com.atlassian.license.License getLicenseForSpace(String spaceKey)
          Get the license attached to the group of the space.
 com.atlassian.license.License getLicenseForSpaceGroup(String spaceGroupKey)
          Get the license attached to the space group and create a new license object
 SpaceGroup getSpaceGroup(long id)
          Retrieve a space by its ID.
 SpaceGroup getSpaceGroup(String spaceGroupKey)
          Retrieve a spaceGroup by its key.
 com.atlassian.license.License getSpaceGroupLicense(SpaceGroup spaceGroup)
          Retrieves a license stored against a given SpaceGroup
 List getSpaceGroups()
          Retrieves all SpaceGroups in the system
 Set<SpaceGroup> getSpaceGroupsForUser(String username)
          Currently this method will return a all spacegroups the user has access to.
 void removeSpaceGroup(SpaceGroup spaceGroup, boolean removeSpaces)
          Removes the spaceGroup without removing the space.
 void removeSpaceGroupLicense(SpaceGroup spaceGroup)
          Removes the license key from the given spaceGroup
 void saveSpaceGroup(SpaceGroup spaceGroup)
           
 void setSpaceGroupDao(SpaceGroupDao spaceGroupDao)
           
 void setSpaceGroupLicense(SpaceGroup spaceGroup, String licenseKey)
          Stores a license key against a given SpaceGroup
 void setSpaceGroupPermissionManager(SpaceGroupPermissionManager spaceGroupPermissionManager)
           
 void setSpaceManager(SpaceManager spaceManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSpaceGroupManager

public DefaultSpaceGroupManager()
Method Detail

createSpaceGroup

public SpaceGroup createSpaceGroup(String key,
                                   String name)
Description copied from interface: SpaceGroupManager
Create a Space Group

Specified by:
createSpaceGroup in interface SpaceGroupManager

createSpaceGroup

public SpaceGroup createSpaceGroup(String key,
                                   String name,
                                   String creatorName)
Description copied from interface: SpaceGroupManager
Create a space Group

Specified by:
createSpaceGroup in interface SpaceGroupManager

saveSpaceGroup

public void saveSpaceGroup(SpaceGroup spaceGroup)
Specified by:
saveSpaceGroup in interface SpaceGroupManager

removeSpaceGroup

public void removeSpaceGroup(SpaceGroup spaceGroup,
                             boolean removeSpaces)
Description copied from interface: SpaceGroupManager
Removes the spaceGroup without removing the space. The contained spaces will be without a spaceGroup.

Specified by:
removeSpaceGroup in interface SpaceGroupManager

getSpaceGroup

public SpaceGroup getSpaceGroup(long id)
Description copied from interface: SpaceGroupManager
Retrieve a space by its ID. The space can be of any type.

Specified by:
getSpaceGroup in interface SpaceGroupManager
Parameters:
id - the ID of the space
Returns:
the space, or null if no space exists with that id.

getSpaceGroup

public SpaceGroup getSpaceGroup(String spaceGroupKey)
Description copied from interface: SpaceGroupManager
Retrieve a spaceGroup by its key.

Specified by:
getSpaceGroup in interface SpaceGroupManager
Parameters:
spaceGroupKey - the key of the spaceGroup to retrieve
Returns:
the spaceGroup, or null if no spaceGroup exists with that key

getSpaceGroupLicense

public com.atlassian.license.License getSpaceGroupLicense(SpaceGroup spaceGroup)
Description copied from interface: SpaceGroupManager
Retrieves a license stored against a given SpaceGroup

Specified by:
getSpaceGroupLicense in interface SpaceGroupManager
Parameters:
spaceGroup - SpaceGroup to retrieve the License from
Returns:
License stored against the SpaceGroup

setSpaceGroupLicense

public void setSpaceGroupLicense(SpaceGroup spaceGroup,
                                 String licenseKey)
                          throws com.atlassian.license.LicenseException
Description copied from interface: SpaceGroupManager
Stores a license key against a given SpaceGroup

Specified by:
setSpaceGroupLicense in interface SpaceGroupManager
Parameters:
spaceGroup - SpaceGroup to store the license against
licenseKey - String of the license key
Throws:
com.atlassian.license.LicenseException - if the license cannot be stored.

removeSpaceGroupLicense

public void removeSpaceGroupLicense(SpaceGroup spaceGroup)
Description copied from interface: SpaceGroupManager
Removes the license key from the given spaceGroup

Specified by:
removeSpaceGroupLicense in interface SpaceGroupManager

getSpaceGroups

public List getSpaceGroups()
Description copied from interface: SpaceGroupManager
Retrieves all SpaceGroups in the system

Specified by:
getSpaceGroups in interface SpaceGroupManager
Returns:
List of SpaceGroup objects

getLicenseForSpaceGroup

public com.atlassian.license.License getLicenseForSpaceGroup(String spaceGroupKey)
Description copied from interface: SpaceGroupManager
Get the license attached to the space group and create a new license object

Specified by:
getLicenseForSpaceGroup in interface SpaceGroupManager
Parameters:
spaceGroupKey - key of the space group
Returns:
License

getLicenseForSpace

public com.atlassian.license.License getLicenseForSpace(String spaceKey)
Description copied from interface: SpaceGroupManager
Get the license attached to the group of the space. If the space is not part of a spacegroup, return null.

Specified by:
getLicenseForSpace in interface SpaceGroupManager
Parameters:
spaceKey - key of the space
Returns:
License

getSpaceGroupsForUser

public Set<SpaceGroup> getSpaceGroupsForUser(String username)
Currently this method will return a all spacegroups the user has access to. Not matter what permission he has.

Specified by:
getSpaceGroupsForUser in interface SpaceGroupManager
Parameters:
username - The name of the user
Returns:
Set of SpaceGroups

setSpaceGroupDao

public void setSpaceGroupDao(SpaceGroupDao spaceGroupDao)

setSpaceManager

public void setSpaceManager(SpaceManager spaceManager)

setSpaceGroupPermissionManager

public void setSpaceGroupPermissionManager(SpaceGroupPermissionManager spaceGroupPermissionManager)


Copyright © 2003-2011 Atlassian. All Rights Reserved.