com.atlassian.jira.license
Class DefaultLicenseRoleManager

java.lang.Object
  extended by com.atlassian.jira.license.DefaultLicenseRoleManager
All Implemented Interfaces:
LicenseRoleManager

public class DefaultLicenseRoleManager
extends Object
implements LicenseRoleManager

Default implementation of LicenseRoleManager.

Since:
6.3

Constructor Summary
DefaultLicenseRoleManager(com.atlassian.cache.CacheManager cacheManager, LicenseRoleStore store, LicenseRoleDefinitions definitions, GroupManager groupManager)
           
 
Method Summary
 void clearCache(ClearCacheEvent event)
           
 Set<String> getGroupsForAuthenticatedLicenseRoles()
          Get groups that has been associated with all authenticated license roles
 com.atlassian.fugue.Option<LicenseRole> getLicenseRole(LicenseRoleId licenseRoleId)
          Return the authenticated LicenseRole associated with the passed ID or Option.none() if no such role exists.
 Set<LicenseRole> getLicenseRoles()
          Returns the Set of all currently authenticated LicenseRoles.
 boolean isAuthenticated(LicenseRoleId licenseRoleId)
          Return true when the passed LicenseRoleId is authenticated.
 void onFeatureChange(FeatureEvent event)
           
 void onGroupCreated(com.atlassian.crowd.event.group.GroupCreatedEvent createdEvent)
           
 void onGroupDeleted(com.atlassian.crowd.event.group.GroupDeletedEvent deletedEvent)
           
 void onLicenseChanged(NewLicenseEvent event)
           
 void onLicenseRoleDefined(LicenseRoleDefinedEvent event)
           
 void onLicenseRoleUndefined(LicenseRoleUndefinedEvent event)
           
 LicenseRole setLicenseRole(LicenseRole role)
          Save the passed LicenseRole information to the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLicenseRoleManager

public DefaultLicenseRoleManager(@Nonnull
                                 com.atlassian.cache.CacheManager cacheManager,
                                 @Nonnull
                                 LicenseRoleStore store,
                                 @Nonnull
                                 LicenseRoleDefinitions definitions,
                                 @Nonnull
                                 GroupManager groupManager)
Method Detail

getLicenseRole

@Nonnull
public com.atlassian.fugue.Option<LicenseRole> getLicenseRole(@Nonnull
                                                                      LicenseRoleId licenseRoleId)
Description copied from interface: LicenseRoleManager
Return the authenticated LicenseRole associated with the passed ID or Option.none() if no such role exists. An authenticated LicenseRole is both defined and licensed.

Specified by:
getLicenseRole in interface LicenseRoleManager
Parameters:
licenseRoleId - the ID to search for.
Returns:
the LicenseRole associated with the passed ID.

getLicenseRoles

@Nonnull
public Set<LicenseRole> getLicenseRoles()
Description copied from interface: LicenseRoleManager
Returns the Set of all currently authenticated LicenseRoles. An authenticated LicenseRole is both defined and licensed.

Specified by:
getLicenseRoles in interface LicenseRoleManager
Returns:
the Set of authenticated LicenseRoles.

getGroupsForAuthenticatedLicenseRoles

@Nonnull
public Set<String> getGroupsForAuthenticatedLicenseRoles()
Get groups that has been associated with all authenticated license roles

Specified by:
getGroupsForAuthenticatedLicenseRoles in interface LicenseRoleManager
Returns:
groups that has been associated with all authenticated license roles

isAuthenticated

public boolean isAuthenticated(@Nonnull
                               LicenseRoleId licenseRoleId)
Description copied from interface: LicenseRoleManager
Return true when the passed LicenseRoleId is authenticated. A LicenseRoleId is authenticated when a plugin provides a LicenseRoleDefinition and it is also licensed.

Specified by:
isAuthenticated in interface LicenseRoleManager
Parameters:
licenseRoleId - the ID to check.
Returns:
true when the passed LicenseRoleId is authenticated.

setLicenseRole

@Nonnull
public LicenseRole setLicenseRole(@Nonnull
                                          LicenseRole role)
Description copied from interface: LicenseRoleManager
Save the passed LicenseRole information to the database. This method will only accept the passed role if:
  1. The role is authorised.
  2. The role only contains currently valid groups.
  3. The primary group is contained within the role.

Specified by:
setLicenseRole in interface LicenseRoleManager
Parameters:
role - the role to save.
Returns:
the role as persisted to the database.

clearCache

@EventListener
public void clearCache(ClearCacheEvent event)

onLicenseRoleDefined

@EventListener
public void onLicenseRoleDefined(LicenseRoleDefinedEvent event)

onLicenseRoleUndefined

@EventListener
public void onLicenseRoleUndefined(LicenseRoleUndefinedEvent event)

onLicenseChanged

@EventListener
public void onLicenseChanged(NewLicenseEvent event)

onFeatureChange

@EventListener
public void onFeatureChange(FeatureEvent event)

onGroupDeleted

@EventListener
public void onGroupDeleted(com.atlassian.crowd.event.group.GroupDeletedEvent deletedEvent)

onGroupCreated

@EventListener
public void onGroupCreated(com.atlassian.crowd.event.group.GroupCreatedEvent createdEvent)


Copyright © 2002-2014 Atlassian. All Rights Reserved.