Class DefaultVendorService<P extends Vendor>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.vendor.service.DefaultVendorService<P>
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
,VendorService<P>
public class DefaultVendorService<P extends Vendor>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements VendorService<P>
- Author:
- Jon Fleschler (jfleschler)
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultVendorService
(VendorRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptioncreateVendorFromRequest
(VendorCreationRequest request, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Create a vendor from the givenVendorCreationRequest
.protected VendorRepository<com.broadleafcommerce.data.tracking.core.Trackable>
protected com.broadleafcommerce.common.extension.TypeFactory
protected P
Responsible for creating a vendor entity from the passed in request.org.springframework.data.domain.Page<P>
readAllByName
(String nameQuery, cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable page, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Read all vendors, optionally filtered by name.readByVendorRef
(String vendorRef, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds the vendor with the given reference key (should only be one result, as vendor keys are unique).Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService
getRsqlHelper, readAll, readAll, readAll, readAll
Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService
convertFromPersistentDomain, convertToPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getSortPositionStrategy, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, setSortPositionStrategy, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.CrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByContextId, readByContextId, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess, updateSort
Methods inherited from interface com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService
readAll, readAll, readAll, readAll
-
Constructor Details
-
DefaultVendorService
public DefaultVendorService(VendorRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper)
-
-
Method Details
-
readAllByName
public org.springframework.data.domain.Page<P> readAllByName(@Nullable String nameQuery, @NonNull cz.jirutka.rsql.parser.ast.Node filters, @Nullable org.springframework.data.domain.Pageable page, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:VendorService
Read all vendors, optionally filtered by name.- Specified by:
readAllByName
in interfaceVendorService<P extends Vendor>
- Parameters:
nameQuery
- (optional) the vendor name to filter byfilters
- additional filters to apply in the query, can be nullpage
- the requested page of results from the databasecontext
- context information surrounding multitenant state- Returns:
- all vendors, optionally filtered by name
-
readByVendorRef
public Optional<P> readByVendorRef(@NonNull String vendorRef, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:VendorService
Finds the vendor with the given reference key (should only be one result, as vendor keys are unique).- Specified by:
readByVendorRef
in interfaceVendorService<P extends Vendor>
- Parameters:
vendorRef
- the reference key of the vendor that should be retrievedcontextInfo
- context information surrounding multitenant state- Returns:
- an
Optional
containing the vendor with the given reference key, empty if not found
-
createVendorFromRequest
public P createVendorFromRequest(@NonNull VendorCreationRequest request, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:VendorService
Create a vendor from the givenVendorCreationRequest
.- Specified by:
createVendorFromRequest
in interfaceVendorService<P extends Vendor>
- Parameters:
request
- the request containing requiried vendor data.contextInfo
- context information surrounding multitenant state.- Returns:
- a new vendor.
-
getVendorFromRequest
Responsible for creating a vendor entity from the passed in request.- Parameters:
request
- The request containing new vendor information.- Returns:
- a
Vendor
entity populated from the request.
-
getRepositoryDomain
- Specified by:
getRepositoryDomain
in interfaceVendorService<P extends Vendor>
-
getRepository
@NonNull protected VendorRepository<com.broadleafcommerce.data.tracking.core.Trackable> getRepository() -
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-