Package com.atlassian.crowd.licensing
Class ApplicationLicensingServiceImpl
java.lang.Object
com.atlassian.crowd.licensing.ApplicationLicensingServiceImpl
- All Implemented Interfaces:
ApplicationLicensingService
@Transactional
public class ApplicationLicensingServiceImpl
extends Object
implements ApplicationLicensingService
-
Field Summary
-
Constructor Summary
ConstructorDescriptionApplicationLicensingServiceImpl
(DirectoryManager directoryManager, LicensingSummaryDao licensingSummaryDao, LicensedUserDao licensedUserDao, DirectoryInfoDao directoryInfoDao, ApplicationDAO applicationDAO, com.atlassian.beehive.ClusterLockService lockService, Clock clock, ApplicationLinkServiceSupplier serviceSupplier, com.atlassian.scheduler.SchedulerService schedulerService, ApplicationLicensingEnabledChecker licensingEnabledChecker) -
Method Summary
Modifier and TypeMethodDescriptionboolean
canShowLicenseUsageForApplication
(Long applicationId) Checks whether license usage data can be fetched/shown for the given applicationvoid
clearAllJobs
(Application application) Clears all jobs scheduled for an applicationgetLicensingSummary
(Long applicationId, String appSubType, Long version) Return the licensing summary if availableboolean
isLicensingConfigured
(Long applicationId) Checks if licensing is configured for specific applicationboolean
isVersionUptoDate
(Long applicationId, String appSubType, Long version) Checks whether requested version is up to date or not for the givenApplicationSubtype
if suppliedlistDirectories
(Long applicationId, String appSubType, Long version, int start, int limit) Returns list of directories linked to the users who are consuming licenses in the given applicationlistJiraTypes
(Long applicationId, Long version) Returns list of jira sub-types available for the givenApplicationType.JIRA
applicationvoid
scheduleRefreshApplicationDataJobImmediately
(long applicationId) Schedules updating application license usage data immediatelyio.atlassian.fugue.Pair<List<ApplicationLicensedUser>,
Long> searchLicensedUsers
(Long applicationId, String searchText, String directoryId, String productType, Long lastLoggedInDate, Long version, int start, int limit) Returns list of license consuming users in the products along with the total count of users matching the supplied queryboolean
updateApplicationData
(Application application) Fetches the license usage data from the application and updates the local copy
-
Field Details
-
APPLICATION_ID_PARAM
- See Also:
-
-
Constructor Details
-
ApplicationLicensingServiceImpl
public ApplicationLicensingServiceImpl(DirectoryManager directoryManager, LicensingSummaryDao licensingSummaryDao, LicensedUserDao licensedUserDao, DirectoryInfoDao directoryInfoDao, ApplicationDAO applicationDAO, com.atlassian.beehive.ClusterLockService lockService, Clock clock, ApplicationLinkServiceSupplier serviceSupplier, com.atlassian.scheduler.SchedulerService schedulerService, ApplicationLicensingEnabledChecker licensingEnabledChecker)
-
-
Method Details
-
canShowLicenseUsageForApplication
public boolean canShowLicenseUsageForApplication(Long applicationId) throws ApplicationNotFoundException Description copied from interface:ApplicationLicensingService
Checks whether license usage data can be fetched/shown for the given application- Specified by:
canShowLicenseUsageForApplication
in interfaceApplicationLicensingService
- Throws:
ApplicationNotFoundException
-
isVersionUptoDate
public boolean isVersionUptoDate(Long applicationId, String appSubType, Long version) throws ApplicationNotFoundException Description copied from interface:ApplicationLicensingService
Checks whether requested version is up to date or not for the givenApplicationSubtype
if supplied- Specified by:
isVersionUptoDate
in interfaceApplicationLicensingService
- Throws:
ApplicationNotFoundException
-
listJiraTypes
public List<ApplicationSubtype> listJiraTypes(Long applicationId, Long version) throws ApplicationNotFoundException Description copied from interface:ApplicationLicensingService
Returns list of jira sub-types available for the givenApplicationType.JIRA
application- Specified by:
listJiraTypes
in interfaceApplicationLicensingService
- Throws:
ApplicationNotFoundException
-
listDirectories
public List<ApplicationLicensedDirectory> listDirectories(Long applicationId, String appSubType, Long version, int start, int limit) throws ApplicationNotFoundException Description copied from interface:ApplicationLicensingService
Returns list of directories linked to the users who are consuming licenses in the given application- Specified by:
listDirectories
in interfaceApplicationLicensingService
- Parameters:
applicationId
- application id to search users forappSubType
- Jira subtype, only if the application type is Jiraversion
- version of data requestedstart
- start offset for the resultslimit
- maximum number of results- Throws:
ApplicationNotFoundException
- if application id invalid
-
searchLicensedUsers
public io.atlassian.fugue.Pair<List<ApplicationLicensedUser>,Long> searchLicensedUsers(Long applicationId, String searchText, String directoryId, String productType, Long lastLoggedInDate, Long version, int start, int limit) throws ObjectNotFoundException Description copied from interface:ApplicationLicensingService
Returns list of license consuming users in the products along with the total count of users matching the supplied query- Specified by:
searchLicensedUsers
in interfaceApplicationLicensingService
- Parameters:
applicationId
- application idsearchText
- search text to be matched across username, email and full namedirectoryId
- directory id to which the user belongproductType
- application subtype, only applicable for Jira applicationlastLoggedInDate
- last logged in date on or beforeversion
- versionstart
- offsetlimit
- max number of results- Throws:
ObjectNotFoundException
-
getLicensingSummary
public Optional<ApplicationLicensingSummary> getLicensingSummary(Long applicationId, String appSubType, Long version) throws ApplicationNotFoundException Description copied from interface:ApplicationLicensingService
Return the licensing summary if available- Specified by:
getLicensingSummary
in interfaceApplicationLicensingService
- Throws:
ApplicationNotFoundException
-
updateApplicationData
Description copied from interface:ApplicationLicensingService
Fetches the license usage data from the application and updates the local copy- Specified by:
updateApplicationData
in interfaceApplicationLicensingService
- Returns:
- true if application data was updated, or else false
-
scheduleRefreshApplicationDataJobImmediately
public void scheduleRefreshApplicationDataJobImmediately(long applicationId) throws ApplicationNotFoundException Description copied from interface:ApplicationLicensingService
Schedules updating application license usage data immediately- Specified by:
scheduleRefreshApplicationDataJobImmediately
in interfaceApplicationLicensingService
- Throws:
ApplicationNotFoundException
-
clearAllJobs
Description copied from interface:ApplicationLicensingService
Clears all jobs scheduled for an application- Specified by:
clearAllJobs
in interfaceApplicationLicensingService
-
isLicensingConfigured
Description copied from interface:ApplicationLicensingService
Checks if licensing is configured for specific application- Specified by:
isLicensingConfigured
in interfaceApplicationLicensingService
- Parameters:
applicationId
- ID of application to check- Throws:
ApplicationNotFoundException
-