Interface SubscriptionLockService

All Known Implementing Classes:
DefaultSubscriptionLockService

public interface SubscriptionLockService
  • Method Details

    • lockSubscription

      default LockStatus lockSubscription(@NonNull @NonNull String subscriptionId, @NonNull @NonNull List<String> reservationList)
      Attempts to apply a lock to the Subscription identified by id, including child locks identified by values in the reservationList.
      Parameters:
      subscriptionId - The id of the subscription to lock.
      reservationList - The list of child lock identifiers to reserve. Optional. If provided, will be favored over reservationCount.
      Returns:
      A LockStatus describing the result of the attempted lock
    • lockSubscription

      LockStatus lockSubscription(SubscriptionLockRequest subscriptionLockRequest)
      Attempts to apply a lock to the Subscription identified by SubscriptionLockRequest.getSubscriptionId()
      Parameters:
      subscriptionLockRequest - Request describing the lock to apply to the subscription
      Returns:
      A LockStatus describing the result of the attempted lock
    • clearLock

      LockStatus clearLock(String subscriptionId, boolean isRevert)
      Releases all locks on the subscription, including all child locks. Along with releasing the subscription lock, this will also deploy or revert sandbox changes to the subscription based on the isRevert parameter.
      Parameters:
      subscriptionId - The id of the subscription that is locked
      isRevert - Whether to revert (isRevert == true) or deploy (isRevert == false) the subscription's sandbox changes.
      Returns:
      A LockStatus describing the state of the lock
    • createToken

      LockStatus createToken(String subscriptionId, String childIdentifier)
      Creates a child lock on the subscription's existing lock.
      Parameters:
      subscriptionId - The id of the subscription for which to apply a child lock
      childIdentifier - The identifier of the child lock that is to be created.
      Returns:
      A LockStatus describing the state of the lock
    • unlockToken

      LockStatus unlockToken(String subscriptionId, String token, boolean propagate)
      Releases a specific child lock on the subscription
      Parameters:
      subscriptionId - The id of the subscription that is locked
      token - The token used to identify the child lock
      propagate - Whether to propagate the token unlock to the parent lock
      Returns:
      A LockStatus describing the state of the lock