@Service(value="blInventoryNotificationService") public class InventoryNotificationServiceImpl extends Object implements InventoryNotificationService
| Modifier and Type | Field and Description |
|---|---|
protected org.broadleafcommerce.common.email.service.EmailService |
emailService |
protected InventoryNotificationDao |
inventoryNotificationDao |
protected AdvancedInventoryService |
inventoryService |
| Constructor and Description |
|---|
InventoryNotificationServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
InventoryNotification |
create()
Creates a brand new
InventoryNotification |
void |
delete(InventoryNotification request)
Deletes the given notification
|
void |
deleteAllProcessed()
Deletes all
InventoryNotifications that have already been processed. |
List<InventoryNotification> |
findAll(int start,
int pageSize,
boolean processed)
Finds all notifications in the system regardless of Sku or Customer
|
List<InventoryNotification> |
findAllForEmail(String email,
boolean processed)
Finds all the notifications that a given email address has subscribed to, usually for anonymous users.
|
List<InventoryNotification> |
findAllForSku(org.broadleafcommerce.core.catalog.domain.Sku sku,
int start,
int pageSize,
boolean processed)
Finds all notifications in the system for the given Sku
|
InventoryNotification |
findById(Long id) |
boolean |
findOpenRequestForEmail(String email,
org.broadleafcommerce.core.catalog.domain.Sku sku)
Returns whether an email address has requested an availability notification which has not yet been processed
for a specific Sku.
|
protected org.broadleafcommerce.common.email.service.info.EmailInfo |
getInStockNotificationEmailInfo() |
boolean |
processNotification(InventoryNotification notification)
Processes the given notification by usually sending an email to the configured
InventoryNotification#getCustomer() or InventoryNotification.getEmailAddress(). |
InventoryNotification |
save(InventoryNotification request)
Persists the given notification
|
protected InventoryNotificationDao inventoryNotificationDao
protected AdvancedInventoryService inventoryService
protected org.broadleafcommerce.common.email.service.EmailService emailService
public InventoryNotification findById(Long id)
findById in interface InventoryNotificationService@Transactional(value="blTransactionManager") public InventoryNotification save(InventoryNotification request)
InventoryNotificationServicesave in interface InventoryNotificationServicerequest - the notification to save@Transactional(value="blTransactionManager") public void delete(InventoryNotification request)
InventoryNotificationServicedelete in interface InventoryNotificationServicerequest - the notification to deletepublic InventoryNotification create()
InventoryNotificationServiceInventoryNotificationcreate in interface InventoryNotificationServiceInventoryNotificationpublic List<InventoryNotification> findAll(int start, int pageSize, boolean processed)
InventoryNotificationServicefindAll in interface InventoryNotificationServicestart - which record to start at. Use 0 to start at the beginningpageSize - the size of each page of records to retrive. If you want to retrieve all of the records, pass in
a very large number like Integer.MAX_VALUE.processed - whether or not the returned InventoryNotifications should be processed or notInventoryNotifications that are filterd by processedpublic List<InventoryNotification> findAllForSku(org.broadleafcommerce.core.catalog.domain.Sku sku, int start, int pageSize, boolean processed)
InventoryNotificationServicefindAllForSku in interface InventoryNotificationServicesku - the Sku that the notifications arestart - which record to start at. Use 0 to start at the beginningpageSize - the size of each page of records to retrive. If you want to retrieve all of the records, pass in
a very large number like Integer.MAX_VALUE.processed - whether or not the returned InventoryNotifications should be processed or notInventoryNotifications that are filterd by processed and the given skuInventoryNotification#getSku()}public List<InventoryNotification> findAllForEmail(String email, boolean processed)
InventoryNotificationServicefindAllForEmail in interface InventoryNotificationServiceemail - the email address that wanted to be notifiedprocessed - whether or not the returned InventoryNotifications should be processed or notInventoryNotifications that are filterd by processed and the given email@Transactional(value="blTransactionManager") public void deleteAllProcessed()
InventoryNotificationServiceInventoryNotifications that have already been processed.deleteAllProcessed in interface InventoryNotificationServicepublic boolean findOpenRequestForEmail(String email, org.broadleafcommerce.core.catalog.domain.Sku sku)
InventoryNotificationServicefindOpenRequestForEmail in interface InventoryNotificationServiceemail - the email address to look up notifications forsku - the Sku to lookup notifications forpublic boolean processNotification(InventoryNotification notification)
InventoryNotificationServiceProcesses the given notification by usually sending an email to the configured
InventoryNotification#getCustomer() or InventoryNotification.getEmailAddress(). Once the notification
has been successfully processed, this will also invoke InventoryNotification.setProcessed(boolean) with true
or false indicating that the notification was successfully processed.
After invoking this method (like from a batch process) then you should save the notification with
InventoryNotificationService.save(InventoryNotification) since the process result could have changed.
If the given notification has already been processed then this method will do nothing and return false
processNotification in interface InventoryNotificationServicenotification - the notification to processprotected org.broadleafcommerce.common.email.service.info.EmailInfo getInStockNotificationEmailInfo()
Copyright © 2020. All rights reserved.