Class TaskConcurrencyService

java.lang.Object
com.xebialabs.xlrelease.service.TaskConcurrencyService

@Service public class TaskConcurrencyService extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    TaskConcurrencyService(com.xebialabs.xlrelease.repository.UserProfileRepository userProfileRepository)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    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.
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 task
      updatedTask - - Updated task with requested changes
      updateDirectives - - 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 task
      modifiedAt - - Task last modified at time reported by client