Class DefaultFulfillmentPricingConfigService<P extends com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
com.broadleafcommerce.fulfillment.service.DefaultFulfillmentPricingConfigService<P>
- All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.service.CrudEntityService<P>
,com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityService<P>
,FulfillmentPricingConfigAccessor<P>
,FulfillmentPricingConfigService<P>
public class DefaultFulfillmentPricingConfigService<P extends com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig>
extends com.broadleafcommerce.data.tracking.core.service.BaseRsqlCrudEntityService<P>
implements FulfillmentPricingConfigService<P>
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDefaultFulfillmentPricingConfigService
(com.broadleafcommerce.data.tracking.core.TrackableRepository<T> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig
copyFulfillmentPricingConfig
(P tenantConfig, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Copy the givenFulfillmentPricingConfig
into a new object.protected P
getApplicationConfig
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Get theFulfillmentPricingConfig
for the given application context.protected com.broadleafcommerce.common.extension.cache.CacheStateManager
protected FulfillmentPricingConfigRepository<com.broadleafcommerce.data.tracking.core.Trackable>
getFulfillmentPricingConfigRepository
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Convenience method to cast the repository toFulfillmentPricingConfigRepository
.protected P
getTenantConfig
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Get theFulfillmentPricingConfig
for the given tenant context.protected com.broadleafcommerce.common.extension.TypeFactory
boolean
hasApplicationConfig
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Indicate if the current application context has aFulfillmentPricingConfig
saved in the database.boolean
hasTenantConfig
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Indicate if the current tenant context has aFulfillmentPricingConfig
saved in the database.readFulfillmentPricingConfig
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Finds theFulfillmentPricingConfig
for the providedContextInfo
.readOrGetNewConfigForApplication
(com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Fetch theFulfillmentPricingConfig
for the providedContextInfo
.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, getRepository, 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
-
Field Details
-
CACHE_PRICING_CONFIG
- See Also:
-
-
Constructor Details
-
DefaultFulfillmentPricingConfigService
public DefaultFulfillmentPricingConfigService(com.broadleafcommerce.data.tracking.core.TrackableRepository<T> repository, com.broadleafcommerce.data.tracking.core.service.RsqlCrudEntityHelper helper, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager)
-
-
Method Details
-
hasApplicationConfig
public boolean hasApplicationConfig(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentPricingConfigService
Indicate if the current application context has aFulfillmentPricingConfig
saved in the database.- Specified by:
hasApplicationConfig
in interfaceFulfillmentPricingConfigService<P extends com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig>
- Parameters:
contextInfo
- The context of the request.- Returns:
- TRUE if the current application context has a
FulfillmentPricingConfig
.
-
hasTenantConfig
public boolean hasTenantConfig(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentPricingConfigService
Indicate if the current tenant context has aFulfillmentPricingConfig
saved in the database.- Specified by:
hasTenantConfig
in interfaceFulfillmentPricingConfigService<P extends com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig>
- Parameters:
contextInfo
- The context of the request.- Returns:
- TRUE if the current tenant context has a
FulfillmentPricingConfig
.
-
readFulfillmentPricingConfig
public P readFulfillmentPricingConfig(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentPricingConfigAccessor
Finds theFulfillmentPricingConfig
for the providedContextInfo
.- Specified by:
readFulfillmentPricingConfig
in interfaceFulfillmentPricingConfigAccessor<P extends com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig>
- Parameters:
contextInfo
- The context of the request.- Returns:
- The
FulfillmentPricingConfig
for this context.
-
readOrGetNewConfigForApplication
public P readOrGetNewConfigForApplication(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:FulfillmentPricingConfigService
Fetch theFulfillmentPricingConfig
for the providedContextInfo
. If none is found, return a new, non-persisted object.- Specified by:
readOrGetNewConfigForApplication
in interfaceFulfillmentPricingConfigService<P extends com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig>
- Parameters:
contextInfo
- The context of the request.- Returns:
- The
FulfillmentPricingConfig
for this context.
-
getApplicationConfig
protected P getApplicationConfig(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Get theFulfillmentPricingConfig
for the given application context.- Parameters:
contextInfo
- The context of the request.- Returns:
- The
FulfillmentPricingConfig
for the given application context.
-
getTenantConfig
protected P getTenantConfig(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Get theFulfillmentPricingConfig
for the given tenant context.- Parameters:
contextInfo
- The context of the request.- Returns:
- The
FulfillmentPricingConfig
for the given application context.
-
copyFulfillmentPricingConfig
protected com.broadleafcommerce.fulfillment.common.domain.FulfillmentPricingConfig copyFulfillmentPricingConfig(P tenantConfig, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Copy the givenFulfillmentPricingConfig
into a new object. This deep copies theSupportedFulfillmentOption
List.- Parameters:
tenantConfig
- The source object to copy.contextInfo
- The context of the request.- Returns:
- A new
FulfillmentPricingConfig
that is a copy of the given object.
-
getFulfillmentPricingConfigRepository
protected FulfillmentPricingConfigRepository<com.broadleafcommerce.data.tracking.core.Trackable> getFulfillmentPricingConfigRepository(@Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Convenience method to cast the repository toFulfillmentPricingConfigRepository
.- Parameters:
contextInfo
- The context of the request.- Returns:
- The repository as
FulfillmentPricingConfigRepository
.
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
getCacheStateManager
protected com.broadleafcommerce.common.extension.cache.CacheStateManager getCacheStateManager()
-