Package com.xebialabs.xlrelease.service
Class TaskConcurrencyService
java.lang.Object
com.xebialabs.xlrelease.service.TaskConcurrencyService
-
Constructor Summary
ConstructorsConstructorDescriptionTaskConcurrencyService(com.xebialabs.xlrelease.repository.UserProfileRepository userProfileRepository) -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckConcurrentModification(com.xebialabs.xlrelease.domain.Task existingTask, com.xebialabs.xlrelease.domain.Task updatedTask, Set<TaskUpdateDirective> updateDirectives) This method will compare a task to be updated with the existing task when the update directive UPDATE_VERIFY_CONCURRENT_MODIFICATION is specified to determine if the tasks version has been modified after the updated task.voidcheckConcurrentModification(com.xebialabs.xlrelease.domain.Task existingTask, org.joda.time.DateTime modifiedAt) This method will compare a task to be updated with the provided modifiedAt time to determine if the tasks version has been modified after the updated task request.voidupdateLastModifiedDetails(com.xebialabs.xlrelease.domain.Task task) This method will update the lastModifiedBy field to the current authorized user and will update the lastModifiedAt field to the current time in UTC
-
Constructor Details
-
TaskConcurrencyService
@Autowired public TaskConcurrencyService(com.xebialabs.xlrelease.repository.UserProfileRepository userProfileRepository)
-
-
Method Details
-
updateLastModifiedDetails
public void updateLastModifiedDetails(com.xebialabs.xlrelease.domain.Task task) This method will update the lastModifiedBy field to the current authorized user and will update the lastModifiedAt field to the current time in UTC- Parameters:
task- - Task that will be updated
-
checkConcurrentModification
public void checkConcurrentModification(com.xebialabs.xlrelease.domain.Task existingTask, com.xebialabs.xlrelease.domain.Task updatedTask, Set<TaskUpdateDirective> updateDirectives) This method will compare a task to be updated with the existing task when the update directive UPDATE_VERIFY_CONCURRENT_MODIFICATION is specified to determine if the tasks version has been modified after the updated task. The version check will fail if the user who last modified the existingTask is different from the requested user and the existingTask has a modifiedAt time after the modifiedAt time of the updatedTask.- Parameters:
existingTask- - Existing taskupdatedTask- - Updated task with requested changesupdateDirectives- - Update directives included in request
-
checkConcurrentModification
public void checkConcurrentModification(com.xebialabs.xlrelease.domain.Task existingTask, org.joda.time.DateTime modifiedAt) This method will compare a task to be updated with the provided modifiedAt time to determine if the tasks version has been modified after the updated task request. The version check will fail if the user who last modified the existing is different from the requested user and the existingTask has a modifiedAt time after the provided time.- Parameters:
existingTask- - Existing taskmodifiedAt- - Task last modified at time reported by client
-