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
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final StringDeprecated.protected static final StringFields inherited from class com.broadleafcommerce.orderoperation.service.provider.external.AbstractExternalProvider
ENTITY_NOT_FOUND, RSQL_FILTER_PARAM -
Constructor Summary
ConstructorsConstructorDescriptionExternalFulfillmentProvider(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.voiddelete(String fulfillmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Deletes aOrderFulfillmentwith the given ID.protected org.springframework.web.util.UriComponentsBuilderGets the base URI common to all direct requests for fulfillments.protected org.springframework.web.util.UriComponentsBuilderGets the URI for requesting a fulfillment matching tenant.protected org.springframework.web.util.UriComponentsBuilderGets the base URI common to requests for order-owned fulfillments.protected ExternalOrderPropertiesprotected Stringorg.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 theOrderFulfillmentswith the given order ID.readById(@NonNull String fulfillmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve theOrderFulfillmentwith the given ID.readByIdMatchingTenant(@NonNull String fulfillmentId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Retrieve theOrderFulfillmentwith 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 theOrderFulfillmentwith the given ID.replaceOrCreateAll(Collection<F> fulfillments, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Replace all of the givenOrderFulfillmentwhich 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:FulfillmentProviderRetrieve allOrderFulfillments.- Specified by:
readAllin 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:FulfillmentProviderRetrieve theOrderFulfillmentwith the given ID.- Specified by:
readByIdin 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:FulfillmentProviderRetrieve theOrderFulfillmentwith the given ID, ignoring its application as long as it's in the current tenant context.- Specified by:
readByIdMatchingTenantin 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:FulfillmentProviderReplace theOrderFulfillmentwith the given ID.- Specified by:
replacein 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:FulfillmentProviderCreates aOrderFulfillment.- Specified by:
createin 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:FulfillmentProviderDeletes aOrderFulfillmentwith the given ID.- Specified by:
deletein 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:FulfillmentProviderReplace all of the givenOrderFulfillmentwhich already exist, or create them.- Specified by:
replaceOrCreateAllin 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:FulfillmentProviderRetrieve all of theOrderFulfillmentswith the given order ID.- Specified by:
readAllByOrderIdin 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()