Interface ReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>

  • All Known Implementing Classes:
    ExternalReturnAuthorizationProvider

    public interface ReturnAuthorizationProvider<R extends com.broadleafcommerce.order.client.domain.ReturnAuthorization>
    Provider for interfacing with operations involving return authorizations. Typically utilizes WebClient to make requests to an external REST API.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      R create​(R returnAuthorization, String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Creates a ReturnAuthorization.
      void delete​(String returnAuthorizationId, String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Deletes a ReturnAuthorization with the given ID.
      List<R> readAllByOrderId​(String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Retrieve all of the ReturnAuthorizations with the given order ID.
      R readById​(String returnAuthorizationId, String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Retrieve the ReturnAuthorization with the given ID.
      Map<String,​List<R>> readByOrderIds​(Set<String> orderIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Fetches ReturnAuthorizations for a Set of order ids.
      R replace​(R returnAuthorization, String returnAuthorizationId, String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Replace the ReturnAuthorization with the given ID.
      List<R> replaceOrCreateAll​(Collection<R> returnAuthorizations, String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Replace all of the given ReturnAuthorizations which already exist, or create them.
    • Method Detail

      • readAllByOrderId

        List<R> readAllByOrderId​(String orderId,
                                 @Nullable
                                 com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Retrieve all of the ReturnAuthorizations with the given order ID.
        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

        R readById​(String returnAuthorizationId,
                   String orderId,
                   @Nullable
                   com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Retrieve the ReturnAuthorization with the given ID.
        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

        R create​(R returnAuthorization,
                 String orderId,
                 @Nullable
                 com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Creates a 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

        R replace​(R returnAuthorization,
                  String returnAuthorizationId,
                  String orderId,
                  @Nullable
                  com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Replace the ReturnAuthorization with the given ID.
        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

        void delete​(String returnAuthorizationId,
                    String orderId,
                    @Nullable
                    com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Deletes a ReturnAuthorization with the given ID.
        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

        List<R> replaceOrCreateAll​(Collection<R> returnAuthorizations,
                                   String orderId,
                                   @Nullable
                                   com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        Replace all of the given ReturnAuthorizations which already exist, or create them.
        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

        Map<String,​List<R>> readByOrderIds​(Set<String> orderIds,
                                                 @Nullable
                                                 com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
        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.
        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.