public class ExternalResourceLockProvider extends AbstractExternalProvider implements ResourceLockProvider
| Constructor and Description |
|---|
ExternalResourceLockProvider(org.springframework.web.reactive.function.client.WebClient webClient,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
com.broadleafcommerce.common.extension.TypeFactory typeFactory,
ExternalCartProperties properties) |
| Modifier and Type | Method and Description |
|---|---|
protected <T> T |
executeRequest(Supplier<T> request)
Executes a request with default Web Client error handling.
|
String |
obtainLock(@NonNull String contextId,
@NonNull String conceptKey,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Obtains a resource lock.
|
void |
releaseLock(@NonNull String token,
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
Releases a resource lock using a token.
|
getHeaders, getObjectMapper, getTypeFactory, getWebClient, pageableToParams, uriVarspublic ExternalResourceLockProvider(org.springframework.web.reactive.function.client.WebClient webClient,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
com.broadleafcommerce.common.extension.TypeFactory typeFactory,
ExternalCartProperties properties)
public String obtainLock(@NonNull @NonNull String contextId, @NonNull @NonNull String conceptKey, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
ResourceLockProviderobtainLock in interface ResourceLockProvidercontextId - the context ID of the entity to lockconceptKey - some key indicating what is being locked or by whocontextInfo - the context of the requestpublic void releaseLock(@NonNull
@NonNull String token,
@Nullable
com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
ResourceLockProviderResourceLockProvider.obtainLock(String, String, ContextInfo).releaseLock in interface ResourceLockProvidertoken - the token tied to the lock which should be releasedcontextInfo - the context of the requestprotected <T> T executeRequest(Supplier<T> request)
AbstractExternalProviderexecuteRequest in class AbstractExternalProviderT - the return type of the request operationrequest - the request to executeCopyright © 2021. All rights reserved.