Class ExternalOrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>

java.lang.Object
com.broadleafcommerce.orderoperation.service.provider.external.AbstractExternalProvider
com.broadleafcommerce.orderoperation.service.provider.external.ExternalOrderProvider<O>
All Implemented Interfaces:
OrderProvider<O>

public class ExternalOrderProvider<O extends com.broadleafcommerce.order.client.domain.Order> extends AbstractExternalProvider implements OrderProvider<O>
  • Field Details

  • Constructor Details

    • ExternalOrderProvider

      public ExternalOrderProvider(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalOrderProperties properties)
  • Method Details

    • readAll

      public org.springframework.data.domain.Page<O> readAll(cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderProvider
      Retrieve all Orders.
      Specified by:
      readAll in interface OrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>
      Parameters:
      filters - the list of filters to apply to this query
      page - the requested page of results from the database
      contextInfo - context information around sandbox and multitenant state.
      Returns:
      the order with the given ID
    • readCustomerOrderInfo

      public org.springframework.data.domain.Page<CustomerOrderInfo> readCustomerOrderInfo(ReadCustomerOrdersRequest request, org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderProvider
      Reads the Orders and additional related data for the ReadCustomerOrdersRequest.
      Specified by:
      readCustomerOrderInfo in interface OrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>
      Parameters:
      request - the request to read the Orders and the related data
      page - the requested page of results from the database
      contextInfo - context information related to multitenancy
      Returns:
      the page of the CustomerOrderInfo with the additional requested data if any
    • readById

      public O readById(@NonNull @NonNull String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderProvider
      Retrieve the Order with the given ID.
      Specified by:
      readById in interface OrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>
      Parameters:
      orderId - the ID of the order to retrieve
      contextInfo - context information around sandbox and multitenant state.
      Returns:
      the order with the given ID
    • readByOrderLink

      public O readByOrderLink(@NonNull @NonNull String orderLink, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderProvider
      Retrieve the Order using the provided API URL.
      Specified by:
      readByOrderLink in interface OrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>
      Parameters:
      orderLink - the API URL to read the Order
      contextInfo - context information around sandbox and multitenant state.
      Returns:
      the Order for the provided API URL
    • readByIdMatchingTenant

      public O readByIdMatchingTenant(@NonNull @NonNull String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderProvider
      Retrieve the Order with the given ID, ignoring its application as long as it's in the current tenant context.
      Specified by:
      readByIdMatchingTenant in interface OrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>
      Parameters:
      orderId - the ID of the order to retrieve
      contextInfo - context information around sandbox and multitenant state.
      Returns:
      the order with the given ID
    • readOwnedById

      @Policy(identityTypes={OWNER,ADMIN}, operationTypes=READ) public O readOwnedById(@NonNull @NonNull String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderProvider
      Retrieve the Order with the given ID, validating ownership if necessary.
      Specified by:
      readOwnedById in interface OrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>
      Parameters:
      orderId - the ID of the order to retrieve
      contextInfo - context information around sandbox and multitenant state.
      Returns:
      the order with the given ID
    • readByCartId

      public Optional<O> readByCartId(@NonNull @NonNull String cartId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderProvider
      Retrieve the Order with the given cart ID.
      Specified by:
      readByCartId in interface OrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>
      Parameters:
      cartId - the cart ID of the order to retrieve
      contextInfo - context information around sandbox and multitenant state.
      Returns:
      the order with the given cart ID
    • readByOrderNumber

      public O readByOrderNumber(@NonNull @NonNull String orderNumber, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderProvider
      Retrieve the Order with the given order number.
      Specified by:
      readByOrderNumber in interface OrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>
      Parameters:
      orderNumber - the order number of the order to retrieve
      contextInfo - context information around sandbox and multitenant state.
      Returns:
      the order with the given order number
    • update

      public O update(O order, String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderProvider
      Update the Order with the given ID.
      Specified by:
      update in interface OrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>
      Parameters:
      order - the order to update with
      orderId - the ID of the order to retrieve
      contextInfo - context information around sandbox and multitenant state.
      Returns:
      the updated order with the given ID
    • create

      public O create(O order, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderProvider
      Creates a Order.
      Specified by:
      create in interface OrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>
      Parameters:
      order - the order to replace with
      contextInfo - context information around sandbox and multitenant state.
      Returns:
      the created order
    • delete

      public void delete(String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: OrderProvider
      Deletes a Order with the given ID.
      Specified by:
      delete in interface OrderProvider<O extends com.broadleafcommerce.order.client.domain.Order>
      Parameters:
      orderId - the ID of the order to delete
      contextInfo - context information around sandbox and multitenant state.
    • 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
    • getMatchingTenantUri

      protected org.springframework.web.util.UriComponentsBuilder getMatchingTenantUri()
      Gets the base URI for requesting an order matching tenant
      Returns:
      a URI components builder with the order matching tenant URI
    • getServiceClient

      protected String getServiceClient()
    • getProperties

      protected ExternalOrderProperties getProperties()