Class JpaCustomizedApplicationRepository<D extends JpaTenantApplication>
java.lang.Object
com.broadleafcommerce.tenant.provider.jpa.repository.JpaCustomizedApplicationRepository<D>
Fragment repository for handling specialized persistence behavior for applications
- Author:
- Jeff Fischer
-
Constructor Summary
ConstructorsConstructorDescriptionJpaCustomizedApplicationRepository(JpaCatalogRepository<? super JpaTenantCatalog> catalogRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidarchiveCatalog(JpaTenantCatalog catalog, Instant now, boolean deleteParentRefs, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected voidarchiveUnassignedImplicitCatalogs(D application, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Serves as the inverse ofbuildApplicableIsolatedImplicitCatalogs(Trackable, ContextInfo).protected voidbuildApplicableIsolatedImplicitCatalogs(com.broadleafcommerce.data.tracking.core.Trackable application, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Establish implicit catalogs for any unset application catalog refsprotected voiddeleteSearchGroupCatalogs(D application, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected com.fasterxml.jackson.databind.ObjectMapperMapper that used internally to deserialize from change detailsprotected TenantApplicationPropertiesprotected voidnotify(JpaTenantCatalog catalog) Send a message covering the changed catalog state via thePersistenceProducerchannel.com.broadleafcommerce.data.tracking.core.Trackablesave(com.broadleafcommerce.data.tracking.core.Trackable application, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) voidsetNotificationManager(com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager) voidsetTenantApplicationProperties(TenantApplicationProperties tenantApplicationProperties)
-
Constructor Details
-
JpaCustomizedApplicationRepository
public JpaCustomizedApplicationRepository(JpaCatalogRepository<? super JpaTenantCatalog> catalogRepository, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.common.messaging.notification.NotificationStateService notificationStateService)
-
-
Method Details
-
setNotificationManager
@Autowired public void setNotificationManager(@Nullable com.broadleafcommerce.common.messaging.notification.NotificationManager notificationManager) -
save
public com.broadleafcommerce.data.tracking.core.Trackable save(com.broadleafcommerce.data.tracking.core.Trackable application, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
deleteSearchGroupCatalogs
protected void deleteSearchGroupCatalogs(D application, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
buildApplicableIsolatedImplicitCatalogs
protected void buildApplicableIsolatedImplicitCatalogs(com.broadleafcommerce.data.tracking.core.Trackable application, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Establish implicit catalogs for any unset application catalog refsWhen
ApplicationConfigurationProperties.isAllowVendorCatalogInApplicationIsolatedCatalogs()istrue, the isolated implicit catalog may be from a vendor catalog.- Parameters:
application- The application instance to checkcontextInfo- The request context- See Also:
-
ApplicationCatalogRef.getImplicit()ApplicationConfigurationProperties.isAllowVendorCatalogInApplicationIsolatedCatalogs()
-
archiveUnassignedImplicitCatalogs
protected void archiveUnassignedImplicitCatalogs(D application, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Serves as the inverse ofbuildApplicableIsolatedImplicitCatalogs(Trackable, ContextInfo). When an application is updated to unassign one or more of its catalogs, this mechanism will ensure the now-orphaned implicit catalogs are archived. This is often desirable, as it prunes these now-irrelevant descendant catalogs from the actual/main catalogs' ancestries. Otherwise, since these implicit catalogs are not directly accessible by admins or API callers, they would not be removable and could, for example, preclude their parents from being deleted for having children.- Parameters:
application- the application which may have unassigned catalogs whose implicit counterparts should be archivedcontextInfo- context information about multitenant state
-
archiveCatalog
protected void archiveCatalog(JpaTenantCatalog catalog, Instant now, boolean deleteParentRefs, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) -
notify
Send a message covering the changed catalog state via thePersistenceProducerchannel.- Parameters:
catalog- The changed catalog instance
-
getTenantApplicationProperties
-
setTenantApplicationProperties
@Autowired public void setTenantApplicationProperties(TenantApplicationProperties tenantApplicationProperties) -
getMapper
protected com.fasterxml.jackson.databind.ObjectMapper getMapper()Mapper that used internally to deserialize from change details
-