Class ExternalReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>

    • Constructor Detail

      • ExternalReturnAuthorizationProvider

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

      • readAllByOrderId

        public List<R> readAllByOrderId​(String orderId,
                                        @Nullable
                                        com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: ReturnAuthorizationProvider
        Retrieve all of the ReturnAuthorizations with the given order ID.
        Specified by:
        readAllByOrderId in interface ReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
        Parameters:
        orderId - the order ID of the return authorizations to retrieve
        contextInfo - context information around sandbox and multitenant state.
        Returns:
        the return authorizations with the given order ID
      • readById

        public R readById​(String returnAuthorizationId,
                          String orderId,
                          @Nullable
                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: ReturnAuthorizationProvider
        Retrieve the ReturnAuthorization with the given ID.
        Specified by:
        readById in interface ReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
        Parameters:
        returnAuthorizationId - the ID of the return authorization to retrieve
        orderId - the ID of the order containing the return authorization
        contextInfo - context information around sandbox and multitenant state.
        Returns:
        the return authorization with the given ID
      • create

        public R create​(R returnAuthorization,
                        String orderId,
                        @Nullable
                        com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: ReturnAuthorizationProvider
        Creates a ReturnAuthorization.
        Specified by:
        create in interface ReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
        Parameters:
        returnAuthorization - the return authorization to replace with
        orderId - the ID of the order containing the return authorization
        contextInfo - context information around sandbox and multitenant state.
        Returns:
        the return authorization with the given ID
      • replace

        public R replace​(R returnAuthorization,
                         String returnAuthorizationId,
                         String orderId,
                         @Nullable
                         com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: ReturnAuthorizationProvider
        Replace the ReturnAuthorization with the given ID.
        Specified by:
        replace in interface ReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
        Parameters:
        returnAuthorization - the return authorization to create
        returnAuthorizationId - the ID of the return authorization to retrieve
        orderId - the ID of the order containing the return authorization
        contextInfo - context information around sandbox and multitenant state.
        Returns:
        the return authorization with the given ID
      • delete

        public void delete​(String returnAuthorizationId,
                           String orderId,
                           @Nullable
                           com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: ReturnAuthorizationProvider
        Deletes a ReturnAuthorization with the given ID.
        Specified by:
        delete in interface ReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
        Parameters:
        returnAuthorizationId - the ID of the return authorization to delete
        orderId - the ID of the order containing the return authorization
        contextInfo - context information around sandbox and multitenant state.
      • replaceOrCreateAll

        public List<R> replaceOrCreateAll​(Collection<R> returnAuthorizations,
                                          String orderId,
                                          @Nullable
                                          com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: ReturnAuthorizationProvider
        Replace all of the given ReturnAuthorizations which already exist, or create them.
        Specified by:
        replaceOrCreateAll in interface ReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
        Parameters:
        returnAuthorizations - the return authorizations to replace or create
        orderId - the ID of the order containing the return authorization
        contextInfo - context information around sandbox and multitenant state.
        Returns:
        the replaced and created return authorizations
      • readByOrderIds

        @NonNull
        public @NonNull Map<String,​List<R>> readByOrderIds​(Set<String> orderIds,
                                                                 @Nullable
                                                                 com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Description copied from interface: ReturnAuthorizationProvider
        Fetches ReturnAuthorizations for a Set of order ids. Returns a map with the order id as the key and a list of ReturnAuthorizations as the value.
        Specified by:
        readByOrderIds in interface ReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
        Parameters:
        orderIds - Set of Order IDs.
        contextInfo - Optional ContextInfo.
        Returns:
        A map with Order ID as the key and a list of return authorizations as the value.
      • getOrderOwnedBaseUri

        protected org.springframework.web.util.UriComponentsBuilder getOrderOwnedBaseUri​(String orderId)
        Gets the base URI common to all requests for return authorizations within an order.
        Parameters:
        orderId - the order to manage return authorizations within
        Returns:
        a URI components builder with the base URI set up
      • getBaseUri

        protected org.springframework.web.util.UriComponentsBuilder getBaseUri()
        Gets the base URI common to all direct requests for ReturnAuthorizations.
        Returns:
        a URI components builder with the base URI set up
      • getOrderIdsParams

        protected org.springframework.util.MultiValueMap<String,​String> getOrderIdsParams​(Set<String> orderIds)
        Formats Order ids into a query parameter.
        Parameters:
        orderIds - Order IDs for which we are looking for Return Authorizations.
        Returns:
      • getServiceClient

        protected String getServiceClient()