Interface SubscriptionLockService
- All Known Implementing Classes:
DefaultSubscriptionLockService
public interface SubscriptionLockService
-
Method Summary
Modifier and TypeMethodDescriptionReleases all locks on the subscription, including all child locks.createToken(String subscriptionId, String childIdentifier) Creates a child lock on the subscription's existing lock.default LockStatuslockSubscription(@NonNull String subscriptionId, @NonNull List<String> reservationList) Attempts to apply a lock to theSubscriptionidentified by id, including child locks identified by values in thereservationList.lockSubscription(SubscriptionLockRequest subscriptionLockRequest) Attempts to apply a lock to theSubscriptionidentified bySubscriptionLockRequest.getSubscriptionId()unlockToken(String subscriptionId, String token, boolean propagate) Releases a specific child lock on the subscription
-
Method Details
-
lockSubscription
default LockStatus lockSubscription(@NonNull @NonNull String subscriptionId, @NonNull @NonNull List<String> reservationList) Attempts to apply a lock to theSubscriptionidentified by id, including child locks identified by values in thereservationList.- 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
LockStatusdescribing the result of the attempted lock
-
lockSubscription
Attempts to apply a lock to theSubscriptionidentified bySubscriptionLockRequest.getSubscriptionId()- Parameters:
subscriptionLockRequest- Request describing the lock to apply to the subscription- Returns:
- A
LockStatusdescribing the result of the attempted lock
-
clearLock
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 theisRevertparameter.- Parameters:
subscriptionId- The id of the subscription that is lockedisRevert- Whether to revert (isRevert == true) or deploy (isRevert == false) the subscription's sandbox changes.- Returns:
- A
LockStatusdescribing the state of the lock
-
createToken
Creates a child lock on the subscription's existing lock.- Parameters:
subscriptionId- The id of the subscription for which to apply a child lockchildIdentifier- The identifier of the child lock that is to be created.- Returns:
- A
LockStatusdescribing the state of the lock
-
unlockToken
Releases a specific child lock on the subscription- Parameters:
subscriptionId- The id of the subscription that is lockedtoken- The token used to identify the child lockpropagate- Whether to propagate the token unlock to the parent lock- Returns:
- A
LockStatusdescribing the state of the lock
-