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>
  • 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: SubscriptionOpsProvider
      Persists a subscription alongside its items. By default, this method returns existing subscriptions if they already exist for the given request.
      Specified by:
      create in interface SubscriptionOpsProvider<SWI extends SubscriptionWithItems>
      Parameters:
      request - A request DTO to create a subscription with its items
      contextInfo - context information around multi-tenant state
      Returns:
      the created subscription and items
    • lockSubscription

      public LockStatus lockSubscription(String subscriptionId, @Nullable List<String> reservations)
      Description copied from interface: SubscriptionOpsProvider
      Create a top-level lock for a subscription
      Specified by:
      lockSubscription in interface SubscriptionOpsProvider<SWI extends SubscriptionWithItems>
      Parameters:
      subscriptionId - The subscription ID to lock
      reservations - The child lock identifiers to reserve
      Returns:
      The status of the lock operation
    • clearLock

      public LockStatus clearLock(String subscriptionId, boolean isRevert)
      Description copied from interface: SubscriptionOpsProvider
      Clear a lock for a subscription
      Specified by:
      clearLock in interface SubscriptionOpsProvider<SWI extends SubscriptionWithItems>
      Parameters:
      subscriptionId - The subscription ID to clear the lock for
      isRevert - Whether the lock clearing is the result of a revert operation
      Returns:
      The status of the lock operation
    • unlockToken

      public LockStatus unlockToken(String subscriptionId, String token, boolean propagate)
      Description copied from interface: SubscriptionOpsProvider
      Unlock a child lock identified by a token
      Specified by:
      unlockToken in interface SubscriptionOpsProvider<SWI extends SubscriptionWithItems>
      Parameters:
      subscriptionId - The subscription ID to unlock a child lock for
      token - The token identifying the child lock
      propagate - Whether to propagate the unlock operation to the parent lock
      Returns:
      The status of the unlock operation
    • createToken

      public LockStatus createToken(String subscriptionId, String tokenIdentifier)
      Description copied from interface: SubscriptionOpsProvider
      Create a reservation token for a child lock
      Specified by:
      createToken in interface SubscriptionOpsProvider<SWI extends SubscriptionWithItems>
      Parameters:
      subscriptionId - The subscription ID to create a token for
      tokenIdentifier - 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

      protected String getServiceClient()
    • getProperties

      protected ExternalSubscriptionOpsProperties getProperties()