public interface InventoryNotificationService
InventoryNotifications| Modifier and Type | Method and Description |
|---|---|
InventoryNotification |
create()
Creates a brand new
InventoryNotification |
void |
delete(InventoryNotification notification)
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.
|
boolean |
processNotification(InventoryNotification notification)
Processes the given notification by usually sending an email to the configured
InventoryNotification#getCustomer() or InventoryNotification.getEmailAddress(). |
InventoryNotification |
save(InventoryNotification notification)
Persists the given notification
|
InventoryNotification findById(Long id)
InventoryNotification save(InventoryNotification notification)
notification - the notification to savevoid delete(InventoryNotification notification)
notification - the notification to deleteList<InventoryNotification> findAll(int start, int pageSize, boolean processed)
start - 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 processedList<InventoryNotification> findAllForSku(org.broadleafcommerce.core.catalog.domain.Sku sku, int start, int pageSize, boolean processed)
sku - 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()}List<InventoryNotification> findAllForEmail(String email, boolean processed)
email - 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 emailboolean findOpenRequestForEmail(String email, org.broadleafcommerce.core.catalog.domain.Sku sku)
email - the email address to look up notifications forsku - the Sku to lookup notifications forboolean processNotification(InventoryNotification notification)
Processes 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
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
notification - the notification to processInventoryNotification create()
InventoryNotificationInventoryNotificationvoid deleteAllProcessed()
InventoryNotifications that have already been processed.Copyright © 2020. All rights reserved.