Package com.atlassian.jira.issue.worklog
Class DatabaseWorklogStore
java.lang.Object
com.atlassian.jira.issue.worklog.DatabaseWorklogStore
- All Implemented Interfaces:
WorklogStore
QueryDSL based implementation of
WorklogStore.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDatabaseWorklogStore(OfBizDelegator delegator, QueryDslAccessor queryDslAccessor, QueryDSLWorklogFactory queryDSLWorklogFactory, DatabaseConfigurationManager databaseConfigurationManager) -
Method Summary
Modifier and TypeMethodDescriptionCreates a new worklog in the data store based on the values in the passed in Worklog object.booleanDeletes a worklog from the data store based on the passed in id.longdeleteWorklogsForIssue(Issue issue) Deletes all worklogs which are related to the givenIssue.Returns a worklog specified by it's idgetByIssue(Issue issue) Returns all child worklogs of a specified issuelonggetCountForWorklogsRestrictedByGroup(String groupName) Returns the count of allWorklog's that have a visibility restriction of the provided group.longReturns the count of allWorklog's that have a visibility restriction of the provided role.getWorklogsDeletedSince(Long sinceInMilliseconds, int maxResults) ReturnsWorklogManager.WORKLOG_UPDATE_DATA_PAGE_SIZEof worklog ids and removal dates, which were removed after (inclusive) provided time in milliseconds.getWorklogsForIds(Set<Long> worklogIds, int maxResults) Returns a set of worklogs for provided ids.getWorklogsUpdateSince(Long sinceInMiliseconds, int maxResults) Returns of worklogs, which were updated or created after (inclusive) provided time in milliseconds.intswapWorklogGroupRestriction(String groupName, String swapGroup) UpdatesWorklog's such that worklogs that have a visibility restriction of the provided groupName will be changed to have a visibility restriction of the provided swapGroup.intswapWorklogRoleRestriction(Long roleId, Long swapRoleId) UpdatesWorklog's such that worklogs that have a visibility restriction of the provided role will be changed to have a visibility restriction to the provided swapRole.Updates fields of an existing worklog in the datastore (identified by its id) with the supplied worklog.
-
Field Details
-
WORKLOG_ENTITY
- See Also:
-
-
Constructor Details
-
DatabaseWorklogStore
public DatabaseWorklogStore(OfBizDelegator delegator, QueryDslAccessor queryDslAccessor, QueryDSLWorklogFactory queryDSLWorklogFactory, DatabaseConfigurationManager databaseConfigurationManager)
-
-
Method Details
-
update
Description copied from interface:WorklogStoreUpdates fields of an existing worklog in the datastore (identified by its id) with the supplied worklog.- Specified by:
updatein interfaceWorklogStore- Parameters:
worklog- identifies the worklog to update and provides the updated values.- Returns:
- the updated worklog.
-
create
Description copied from interface:WorklogStoreCreates a new worklog in the data store based on the values in the passed in Worklog object.- Specified by:
createin interfaceWorklogStore- Parameters:
worklog- specifies the values to create the worklog with.- Returns:
- the representation of the created worklog, including the id.
-
delete
Description copied from interface:WorklogStoreDeletes a worklog from the data store based on the passed in id.- Specified by:
deletein interfaceWorklogStore- Parameters:
worklogId- specifies which worklog to delete (not null)- Returns:
- true if the worklog was deleted, false otherwise
-
deleteWorklogsForIssue
Description copied from interface:WorklogStoreDeletes all worklogs which are related to the givenIssue.- Specified by:
deleteWorklogsForIssuein interfaceWorklogStore- Parameters:
issue- issue for which worklogs will be removed- Returns:
- the number of worklogs deleted
-
getById
Description copied from interface:WorklogStoreReturns a worklog specified by it's id- Specified by:
getByIdin interfaceWorklogStore- Parameters:
id- the specified id (not null)- Returns:
- the specified worklog, or null if not found
-
getByIssue
Description copied from interface:WorklogStoreReturns all child worklogs of a specified issue- Specified by:
getByIssuein interfaceWorklogStore- Parameters:
issue- the specified parent issue (not null)- Returns:
- a List of Worklogs, ordered by creation date. An empty List will be returned if none are found
-
swapWorklogGroupRestriction
Description copied from interface:WorklogStoreUpdatesWorklog's such that worklogs that have a visibility restriction of the provided groupName will be changed to have a visibility restriction of the provided swapGroup.Note: There is no validation performed by this method to determine if the provided swapGroup is a valid group with JIRA. This validation must be done by the caller.
- Specified by:
swapWorklogGroupRestrictionin interfaceWorklogStore- Parameters:
groupName- identifies the group the worklogs are restricted by, this must not be null.swapGroup- identifies the group the worklogs will be changed to be restricted by, this must not be null.- Returns:
- tbe number of worklogs affected by the update.
-
getCountForWorklogsRestrictedByGroup
Description copied from interface:WorklogStoreReturns the count of allWorklog's that have a visibility restriction of the provided group.- Specified by:
getCountForWorklogsRestrictedByGroupin interfaceWorklogStore- Parameters:
groupName- identifies the group the worklogs are restricted by, this must not be null.- Returns:
- the count of restricted groups
-
getCountForWorklogsRestrictedByRole
Description copied from interface:WorklogStoreReturns the count of allWorklog's that have a visibility restriction of the provided role.- Specified by:
getCountForWorklogsRestrictedByRolein interfaceWorklogStore- Parameters:
roleId- identifies the role the worklogs are restricted by, this must not be null.- Returns:
- the count of restricted worklogs
-
swapWorklogRoleRestriction
Description copied from interface:WorklogStoreUpdatesWorklog's such that worklogs that have a visibility restriction of the provided role will be changed to have a visibility restriction to the provided swapRole.Note: There is no validation performed by this method to determine if the provided swapRoleId is a valid group with JIRA. This validation must be done by the caller.
- Specified by:
swapWorklogRoleRestrictionin interfaceWorklogStore- Parameters:
roleId- identifies the role the worklogs are restricted by, this must not be null.swapRoleId- identifies the role the worklogs will be changed to be restricted by, this must not be null.- Returns:
- the number of worklogs affected by the update.
-
getWorklogsUpdateSince
Description copied from interface:WorklogStoreReturns of worklogs, which were updated or created after (inclusive) provided time in milliseconds. Returned worklogs are ordered by the update time.- Specified by:
getWorklogsUpdateSincein interfaceWorklogStore- Parameters:
sinceInMiliseconds- the time (measured as a difference between the timestamp and midnight, January 1, 1970 UTC) since which the modified worklogs will be returned.maxResults- the maximum number of worklogs to return.- Returns:
- the list of worklogs updated after provided time.
-
getWorklogsDeletedSince
Description copied from interface:WorklogStoreReturnsWorklogManager.WORKLOG_UPDATE_DATA_PAGE_SIZEof worklog ids and removal dates, which were removed after (inclusive) provided time in milliseconds.- Specified by:
getWorklogsDeletedSincein interfaceWorklogStore- Parameters:
sinceInMilliseconds- the time (measured as a difference between the timestamp and midnight, January 1, 1970 UTC) since which the modified worklogs will be returned.maxResults- the maximum number ofDeletedWorklogto return.- Returns:
- ids and removal dates of worklogs which were deleted since provided time.
-
getWorklogsForIds
Description copied from interface:WorklogStoreReturns a set of worklogs for provided ids.- Specified by:
getWorklogsForIdsin interfaceWorklogStore- Parameters:
worklogIds- set of worklog ids.maxResults- the maximu number ofWorklogto return.- Returns:
- a list of worklogs for provided ids.
-