Interface MarketplaceApplicationCatalogService<P extends MarketplaceApplicationCatalog>
- All Known Implementing Classes:
DefaultMarketplaceApplicationCatalogService
public interface MarketplaceApplicationCatalogService<P extends MarketplaceApplicationCatalog>
MarketplaceApplicationCatalog
business domain specific version of
CrudEntityService
.- Author:
- Jeff Fischer
-
Method Summary
Modifier and TypeMethodDescriptioncreate
(P applicationCatalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Create an instance of an entity based on a business instance containing relevant property values.void
Perform a delete operation on the entity identified by the context id.void
hydrate
(Collection<P> applicationCatalogs, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hydrates fields on each of the givenapplicationCatalogs
instances such asMarketplaceApplicationCatalog.getHydratedCatalog()
.hydrate
(P applicationCatalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hydrates fields on the givenapplicationCatalog
instance such asMarketplaceApplicationCatalog.getHydratedCatalog()
.Find the marketplace catalog by idorg.springframework.data.domain.Page<P>
readAll
(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all the marketplace to catalog associations.readByCatalog
(String catalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all the marketplace to catalog associations for a specific catalog.readByCatalogAndApplication
(String catalog, String application, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find the association between a specific catalog and application.readByVendorRef
(String vendorRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all the marketplace to catalog associations for a specific vendor.replace
(String id, P applicationCatalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Replace a single, narrowed instance of an entity based on a business instance containing relevant property values.update
(String id, P applicationCatalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Update a single, narrowed instance of an entity based on a business instance containing relevant property values.
-
Method Details
-
readAll
org.springframework.data.domain.Page<P> readAll(@Nullable cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all the marketplace to catalog associations.- Parameters:
filters
- additional filters to apply in the query, can be nullpage
- the requested page of results from the databasecontextInfo
- context information surrounding the sandboxing and multitenant state. If this is an application context, results will only include entities associated to that application.- Returns:
- all of the
MarketplaceApplicationCatalog
instances that were found - Throws:
com.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if the target application was not found
-
read
P read(String id, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find the marketplace catalog by id- Parameters:
id
- The contextId for theMarketplaceApplicationCatalog
contextInfo
- context information surrounding the sandboxing and multitenant state. If this is an application context, results will only include entities associated to that application.- Returns:
- The
MarketplaceApplicationCatalog
instance - Throws:
com.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if the target application was not found
-
create
P create(P applicationCatalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Create an instance of an entity based on a business instance containing relevant property values.- Parameters:
applicationCatalog
- The business domain instance.contextInfo
- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.- Returns:
- The new entity instance in the form of a business type instance.
- Throws:
com.broadleafcommerce.common.error.validation.ValidationException
- if the given businessInstance could not be created
-
update
P update(String id, P applicationCatalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Update a single, narrowed instance of an entity based on a business instance containing relevant property values. SeeTrackableRepository
for more information on entity persistence behavior in light of sandboxing and multitenant concerns.- Parameters:
id
- The context id for the entity. This is the id by which the business recognizes the item.applicationCatalog
- The payload type that domain class should be converted tocontextInfo
- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.- Returns:
- The updated, narrowed entity instance in the form of a payload instance, or
EntityMissingException
if not available. - Throws:
com.broadleafcommerce.common.error.validation.ValidationException
- if the businessInstance failed validationcom.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if a managed instance corresponding to the given id could not be found
-
replace
P replace(String id, P applicationCatalog, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Replace a single, narrowed instance of an entity based on a business instance containing relevant property values.- Parameters:
id
- The context id for the entity. This is the id by which the business recognizes the item.applicationCatalog
- The payload type that domain class should be converted to.contextInfo
- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.- Returns:
- The replaced, narrowed entity instance in the form of a payload instance, or
EntityMissingException
if not available. - Throws:
com.broadleafcommerce.common.error.validation.ValidationException
- if the given businessInstance failed validation on replacementcom.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if a managed instance corresponding to the given id could not be found
-
delete
Perform a delete operation on the entity identified by the context id. This could result in an archival, or a raw delete, depending on the result of processing throughDomainMapper.deleteMap(Object, ContextInfo)
.- Parameters:
id
- The context id for the entity. This is the id by which the business recognizes the item.contextInfo
- Context information used to discriminate the correct version of an entity by context id when multiple verions may be available across sandboxes, catalogs and applications.- Throws:
com.broadleafcommerce.data.tracking.core.exception.EntityMissingException
- if no instance was found in the backing store corresponding to id
-
hydrate
P hydrate(P applicationCatalog, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hydrates fields on the givenapplicationCatalog
instance such asMarketplaceApplicationCatalog.getHydratedCatalog()
.If referenced entities cannot be found, the hydrated fields will remain null.
- Parameters:
applicationCatalog
- the instance whose hydrated fields should be setcontextInfo
- context information surrounding sandboxing and multitenant state- Returns:
- the given
applicationCatalog
instance after hydrating fields
-
hydrate
void hydrate(Collection<P> applicationCatalogs, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hydrates fields on each of the givenapplicationCatalogs
instances such asMarketplaceApplicationCatalog.getHydratedCatalog()
.If referenced entities cannot be found, the hydrated fields will remain null.
- Parameters:
applicationCatalogs
- the instances whose hydrated fields should be set. Can be empty, but can never benull
.contextInfo
- context information surrounding sandboxing and multitenant state
-
readByCatalog
List<P> readByCatalog(String catalog, @NonNull com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all the marketplace to catalog associations for a specific catalog.This method does not perform any application-discrimination.
- Parameters:
catalog
- The vendor catalog to checkcontextInfo
- context information surrounding the sandboxing and multitenant state- Returns:
- The marketplace to catalog associations
-
readByVendorRef
List<P> readByVendorRef(String vendorRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find all the marketplace to catalog associations for a specific vendor.This method does not perform any application-discrimination.
- Parameters:
vendorRef
- the vendor ref to find marketplace-catalog associations forcontextInfo
- context information around multitenant state- Returns:
- the marketplace-catalog associations
-
readByCatalogAndApplication
Optional<P> readByCatalogAndApplication(String catalog, String application, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Find the association between a specific catalog and application.This method does not perform any application-discrimination.
- Parameters:
catalog
- the ID of the catalog to find the association for. MatchesMarketplaceApplicationCatalog.getCatalog()
application
- the ID of the application to find the association for. MatchesMarketplaceApplicationCatalog.getApplication()
contextInfo
- context information around sandboxing and multitenant state- Returns:
- an
Optional
containing the relationship if found,Optional.empty()
otherwise
-