Class ExternalSubscriptionOpsProvider<SWI extends SubscriptionWithItems>
java.lang.Object
com.broadleafcommerce.orderoperation.service.provider.external.AbstractExternalProvider
com.broadleafcommerce.orderoperation.service.provider.external.ExternalSubscriptionOpsProvider<SWI>
- All Implemented Interfaces:
SubscriptionOpsProvider<SWI>
public class ExternalSubscriptionOpsProvider<SWI extends SubscriptionWithItems>
extends AbstractExternalProvider
implements SubscriptionOpsProvider<SWI>
-
Field Summary
Fields inherited from class com.broadleafcommerce.orderoperation.service.provider.external.AbstractExternalProvider
ENTITY_NOT_FOUND, RSQL_FILTER_PARAM -
Constructor Summary
ConstructorsConstructorDescriptionExternalSubscriptionOpsProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalSubscriptionOpsProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionClear a lock for a subscriptioncreate(@NonNull CreateSubscriptionFromOrderRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Persists a subscription alongside its items.createToken(String subscriptionId, String tokenIdentifier) Create a reservation token for a child lockprotected org.springframework.web.util.UriComponentsBuilderGets the base URI common to all requests this provider will make.protected ExternalSubscriptionOpsPropertiesprotected StringlockSubscription(String subscriptionId, List<String> reservations) Create a top-level lock for a subscriptionunlockToken(String subscriptionId, String token, boolean propagate) Unlock a child lock identified by a tokenMethods inherited from class com.broadleafcommerce.orderoperation.service.provider.external.AbstractExternalProvider
addOffsetOrPageNumber, buildNotFoundException, executeRequest, getHeaders, getObjectMapper, getTypeFactory, getWebClient, isEntityNotFound, pageableToParams
-
Constructor Details
-
ExternalSubscriptionOpsProvider
public ExternalSubscriptionOpsProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalSubscriptionOpsProperties properties)
-
-
Method Details
-
create
public List<SWI> create(@NonNull @NonNull CreateSubscriptionFromOrderRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:SubscriptionOpsProviderPersists a subscription alongside its items. By default, this method returns existing subscriptions if they already exist for the given request.- Specified by:
createin interfaceSubscriptionOpsProvider<SWI extends SubscriptionWithItems>- Parameters:
request- A request DTO to create a subscription with its itemscontextInfo- context information around multi-tenant state- Returns:
- the created subscription and items
-
lockSubscription
Description copied from interface:SubscriptionOpsProviderCreate a top-level lock for a subscription- Specified by:
lockSubscriptionin interfaceSubscriptionOpsProvider<SWI extends SubscriptionWithItems>- Parameters:
subscriptionId- The subscription ID to lockreservations- The child lock identifiers to reserve- Returns:
- The status of the lock operation
-
clearLock
Description copied from interface:SubscriptionOpsProviderClear a lock for a subscription- Specified by:
clearLockin interfaceSubscriptionOpsProvider<SWI extends SubscriptionWithItems>- Parameters:
subscriptionId- The subscription ID to clear the lock forisRevert- Whether the lock clearing is the result of a revert operation- Returns:
- The status of the lock operation
-
unlockToken
Description copied from interface:SubscriptionOpsProviderUnlock a child lock identified by a token- Specified by:
unlockTokenin interfaceSubscriptionOpsProvider<SWI extends SubscriptionWithItems>- Parameters:
subscriptionId- The subscription ID to unlock a child lock fortoken- The token identifying the child lockpropagate- Whether to propagate the unlock operation to the parent lock- Returns:
- The status of the unlock operation
-
createToken
Description copied from interface:SubscriptionOpsProviderCreate a reservation token for a child lock- Specified by:
createTokenin interfaceSubscriptionOpsProvider<SWI extends SubscriptionWithItems>- Parameters:
subscriptionId- The subscription ID to create a token fortokenIdentifier- The identifier for the token- Returns:
- The status of the token creation operation
-
getBaseUri
protected org.springframework.web.util.UriComponentsBuilder getBaseUri()Gets the base URI common to all requests this provider will make.- Returns:
- a URI components builder with the base URI set up
-
getServiceClient
-
getProperties
-