Class ExternalFulfillmentProvider<F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
java.lang.Object
com.broadleafcommerce.orderoperation.service.provider.external.AbstractExternalProvider
com.broadleafcommerce.orderoperation.service.provider.external.ExternalFulfillmentProvider<F>
- All Implemented Interfaces:
FulfillmentProvider<F>
public class ExternalFulfillmentProvider<F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
extends AbstractExternalProvider
implements FulfillmentProvider<F>
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
protected static final String
Deprecated.protected static final String
Fields inherited from class com.broadleafcommerce.orderoperation.service.provider.external.AbstractExternalProvider
ENTITY_NOT_FOUND, RSQL_FILTER_PARAM
-
Constructor Summary
ConstructorDescriptionExternalFulfillmentProvider
(org.springframework.web.reactive.function.client.WebClient webClient, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, ExternalOrderProperties properties) -
Method Summary
Modifier and TypeMethodDescriptioncreate
(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Creates aOrderFulfillment
.void
delete
(String fulfillmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes aOrderFulfillment
with the given ID.protected org.springframework.web.util.UriComponentsBuilder
Gets the base URI common to all direct requests for fulfillments.protected org.springframework.web.util.UriComponentsBuilder
Gets the URI for requesting a fulfillment matching tenant.protected org.springframework.web.util.UriComponentsBuilder
Gets the base URI common to requests for order-owned fulfillments.protected ExternalOrderProperties
protected String
org.springframework.data.domain.Page<F>
readAll
(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve allOrderFulfillments
.readAllByOrderId
(String orderId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve all of theOrderFulfillments
with the given order ID.readById
(@NonNull String fulfillmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve theOrderFulfillment
with the given ID.readByIdMatchingTenant
(@NonNull String fulfillmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve theOrderFulfillment
with the given ID, ignoring its application as long as it's in the current tenant context.replace
(F fulfillment, String fulfillmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Replace theOrderFulfillment
with the given ID.replaceOrCreateAll
(Collection<F> fulfillments, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Replace all of the givenOrderFulfillment
which already exist, or create them.Methods inherited from class com.broadleafcommerce.orderoperation.service.provider.external.AbstractExternalProvider
buildNotFoundException, executeRequest, getHeaders, getObjectMapper, getTypeFactory, getWebClient, isEntityNotFound, pageableToParams
-
Field Details
-
BULK_REPLACE_CREATE_SEGMENT
- See Also:
-
ORDER_OWNED_FULFILLMENTS_SEGMENT
- See Also:
-
ORDER_CLIENT_ID
Deprecated.- See Also:
-
-
Constructor Details
-
ExternalFulfillmentProvider
public ExternalFulfillmentProvider(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<F> 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:FulfillmentProvider
Retrieve allOrderFulfillments
.- Specified by:
readAll
in interfaceFulfillmentProvider<F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
- Parameters:
filters
- the list of filters to apply to this querypage
- the requested page of results from the databasecontextInfo
- context information around sandbox and multitenant state.- Returns:
- the fulfillment with the given ID
-
readById
public F readById(@NonNull @NonNull String fulfillmentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentProvider
Retrieve theOrderFulfillment
with the given ID.- Specified by:
readById
in interfaceFulfillmentProvider<F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
- Parameters:
fulfillmentId
- the ID of the fulfillment to retrievecontextInfo
- context information around sandbox and multitenant state.- Returns:
- the fulfillment with the given ID
-
readByIdMatchingTenant
public F readByIdMatchingTenant(@NonNull @NonNull String fulfillmentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentProvider
Retrieve theOrderFulfillment
with the given ID, ignoring its application as long as it's in the current tenant context.- Specified by:
readByIdMatchingTenant
in interfaceFulfillmentProvider<F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
- Parameters:
fulfillmentId
- the ID of the fulfillment to retrievecontextInfo
- context information around sandbox and multitenant state.- Returns:
- the fulfillment with the given ID
-
replace
public F replace(F fulfillment, String fulfillmentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentProvider
Replace theOrderFulfillment
with the given ID.- Specified by:
replace
in interfaceFulfillmentProvider<F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
- Parameters:
fulfillment
- the fulfillment to replace withfulfillmentId
- the ID of the fulfillment to retrievecontextInfo
- context information around sandbox and multitenant state.- Returns:
- the fulfillment with the given ID
-
create
public F create(com.broadleafcommerce.order.client.domain.OrderFulfillment fulfillment, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentProvider
Creates aOrderFulfillment
.- Specified by:
create
in interfaceFulfillmentProvider<F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
- Parameters:
fulfillment
- the fulfillment to createcontextInfo
- context information around sandbox and multitenant state.- Returns:
- the fulfillment with the given ID
-
delete
public void delete(String fulfillmentId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentProvider
Deletes aOrderFulfillment
with the given ID.- Specified by:
delete
in interfaceFulfillmentProvider<F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
- Parameters:
fulfillmentId
- the ID of the fulfillment to deletecontextInfo
- context information around sandbox and multitenant state.
-
replaceOrCreateAll
public List<F> replaceOrCreateAll(Collection<F> fulfillments, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentProvider
Replace all of the givenOrderFulfillment
which already exist, or create them.- Specified by:
replaceOrCreateAll
in interfaceFulfillmentProvider<F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
- Parameters:
fulfillments
- the fulfillments to replace or createcontextInfo
- context information around sandbox and multitenant state.- Returns:
- the replaced and created fulfillments
-
readAllByOrderId
public List<F> readAllByOrderId(String orderId, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentProvider
Retrieve all of theOrderFulfillments
with the given order ID.- Specified by:
readAllByOrderId
in interfaceFulfillmentProvider<F extends com.broadleafcommerce.order.client.domain.OrderFulfillment>
- Parameters:
orderId
- the order ID of the fulfillments to retrievecontextInfo
- context information around sandbox and multitenant state.- Returns:
- the fulfillments with the given order ID
-
getBaseUri
protected org.springframework.web.util.UriComponentsBuilder getBaseUri()Gets the base URI common to all direct requests for fulfillments.- Returns:
- a URI components builder with the base URI set up
-
getMatchingTenantUri
protected org.springframework.web.util.UriComponentsBuilder getMatchingTenantUri()Gets the URI for requesting a fulfillment matching tenant.- Returns:
- a URI components builder with the fulfillment matching tenant URI
-
getOrderOwnedBaseUri
protected org.springframework.web.util.UriComponentsBuilder getOrderOwnedBaseUri()Gets the base URI common to requests for order-owned fulfillments.- Returns:
- a URI components builder with the base URI set up
-
getServiceClient
-
getProperties
-
getServiceClient()