Class SchedulingLock

java.lang.Object
overit.geocallapp.wfm.scheduling.bl.lock.SchedulingLock

public class SchedulingLock extends Object
The SchedulingLock class is responsible for managing locks on resources, activities, and operation centers to ensure exclusive access during scheduling operations. This class provides methods to add resources, activities, and operation centers to the lock, and to acquire, extend and release the lock using a specified lock service. The lock service can be dynamically selected based on the type, allowing for flexibility in switching between different implementations (e.g., Redis or database).
Since:
18.0
  • Field Details

    • TOTAL_OPERATION_CENTER_LOCK

      public static final Long TOTAL_OPERATION_CENTER_LOCK
    • PARTIAL_OPERATION_CENTER_LOCK

      public static final Long PARTIAL_OPERATION_CENTER_LOCK
  • Constructor Details

    • SchedulingLock

      public SchedulingLock()
  • Method Details

    • getLockService

      public LockService getLockService()
      Returns the lock service to be used for acquiring and releasing locks.
      Returns:
      the lock service to be used
    • setLockService

      public void setLockService(LockService lockService)
      Sets the lock service to be used for acquiring and releasing locks.
      Parameters:
      lockService - the lock service to be used
    • getResources

      public Set<Long> getResources()
      Returns a set of resources to be locked.
      Returns:
      resources to be locked
    • setResources

      public void setResources(Set<Long> resources)
      Sets a set of resources to be locked.
      Parameters:
      resources - the resources to be locked
    • getOperations

      public Set<Long> getOperations()
      Returns a set of operations to be locked.
      Returns:
      operations to be locked
    • setOperations

      public void setOperations(Set<Long> operations)
      Sets a set of operations to be locked.
      Parameters:
      operations - the operations to be locked
    • getUuid

      public String getUuid()
      Returns the unique identifier (UUID) for the lock, used to group and manage locks for a specific transaction
      Returns:
      the uuid to be set
    • setUuid

      public void setUuid(String uuid)
      Sets the unique identifier (UUID) for the lock, used to group and manage locks for a specific transaction
      Parameters:
      uuid - the uuid to be set
    • getLockType

      public Long getLockType()
      Returns the lock type
      Returns:
      lockType the lock type to be set
    • setLockType

      public void setLockType(Long lockType)
      Sets the lock type
      Parameters:
      lockType - the lock type to be set
    • getBaseLockKey

      public String getBaseLockKey()
      Returns the base lock key
      Returns:
      baseLockKey the base lock key to be set
    • setBaseLockKey

      public void setBaseLockKey(String baseLockKey)
      Sets the base lock key
      Parameters:
      baseLockKey - the base lock key to be set