public interface PromotionPersistenceManager extends XMLizable, KeyResolver
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright
|
Modifier and Type | Method and Description |
---|---|
void |
changePromotionStatus(PromotionKey key,
int status)
Changes the status of a promotion.
|
void |
changePromotionStatus(PromotionKey key,
int status,
java.util.HashMap sessionData)
Deprecated.
|
void |
create(Promotion pro)
Creates a new promotion.
|
void |
create(Promotion pro,
java.util.HashMap sessionData)
Deprecated.
|
PromotionKey |
findActivePromotionByCodeAndStoreID(java.lang.String code,
java.lang.Integer storeID)
Finds all promotions by their code (visualCue) and storeID.
|
PromotionKey[] |
findActivePromotionByCodePatternAndStoreID(java.lang.String code,
java.lang.Integer storeID)
Finds all promotions by their code (visualCue) and storeID.
|
PromotionKey |
findActivePromotionByNameAndStoreID(java.lang.String name,
java.lang.Integer storeID)
Finds all active promotions by their Name and storeID.
|
PromotionKey[] |
findActivePromotionByStoreIDAndDate(java.lang.Integer storeID,
java.sql.Timestamp aStartDate,
java.sql.Timestamp aEndDate)
Finds all active promotions of a store that has its start date is before
the specified date and its end date is after the specified date.
|
PromotionKey[] |
findActivePromotionsInAGroupByDate(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey aGroupKey,
java.sql.Timestamp aStartDate,
java.sql.Timestamp aEndDate)
Finds all active promotions in a promotion group that has its start date
is before the specified date and its end date is after the specified
date.
|
PromotionKey |
findCurrentPromotionByNameAndStoreID(java.lang.String name,
java.lang.Integer storeID)
Finds all promotions that are either active, inactive or suspended, but
not deleted or obsolete by their Name and storeID.
|
PromotionKey |
findCurrentPromotionByNameVersionAndStoreID(java.lang.String name,
java.lang.Integer version,
java.lang.Integer storeID)
Finds all promotions that are either active, inactive or suspended, but
not deleted or obsolete by their Name, version and storeID.
|
PromotionKey[] |
findCurrentPromotionByStoreID(java.lang.Integer storeID)
Finds current promotions by storeID.
|
PromotionKey[] |
findPromotionByStatusAndStoreID(int status,
java.lang.Integer storeID)
Finds all promotions by status and storeID.
|
PromotionKey[] |
findPromotionByStoreID(java.lang.Integer storeID)
Finds all promotions by storeID.
|
PromotionKey[] |
findPromotionsInAGroupByStatus(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey key,
int status)
Finds all the promotions in a promotion group by status.
|
Promotion |
load(PromotionKey key)
Finds promotion by promotion key.
|
java.lang.Number |
nextNumericKey()
Returns the next available numeric key value for promotions.
|
void |
reload(PromotionKey key)
Reload any cache for the promotion identified by its key.
|
void |
reloadAll()
Reloads the entire promotion cache.
|
void |
remove(Promotion pro)
Removes the promotion from persistence storage.
|
void |
remove(Promotion pro,
java.util.HashMap sessionData)
Deprecated.
|
void |
save(Promotion pro)
Saves promotion.
|
void |
save(Promotion pro,
java.util.HashMap sessionData)
Deprecated.
|
PromotionKey |
saveAsANewRevision(Promotion promotion)
Saves the promotion as a new revision.
|
PromotionKey |
saveAsANewRevision(Promotion promotion,
java.util.HashMap sessionData)
Deprecated.
|
PromotionKey |
saveAsANewVersion(Promotion promotion)
Saves the promotion as a new version.
|
PromotionKey |
saveAsANewVersion(Promotion promotion,
java.util.HashMap sessionData)
Deprecated.
|
lookup, reverseLookup
static final java.lang.String COPYRIGHT
Promotion load(PromotionKey key) throws PersistenceObjectNotFoundException, PersistenceObjectReadException
key
- is the promotion key.PersistenceObjectNotFoundException
- if the promotion object is not foundPersistenceObjectReadException
- if the object can not be read properly from the database.void save(Promotion pro) throws PersistenceObjectNotFoundException, PersistenceObjectWriteException
pro
- is the promotion object.PersistenceObjectNotFoundException
- when this object does not exist in the database.PersistenceObjectWriteException
- when it fails to write this promotion to DB.void create(Promotion pro) throws PersistenceObjectAlreadyExistsException, PersistenceCreateException
pro
- is the promotion object.PersistenceObjectAlreadyExistsException
- when this object to be created already exists in the
database.PersistenceCreateException
- when the creation process fails.void remove(Promotion pro) throws PersistenceObjectNotFoundException, PersistenceRemoveException
pro
- promotion to be removed.PersistenceObjectNotFoundException
- when the object to be removed does not exist in the database.PersistenceRemoveException
- when the object removal fails.void changePromotionStatus(PromotionKey key, int status) throws PersistenceObjectNotFoundException, PersistenceObjectWriteException
key
- the key of the promotion whose status is about to be changed.status
- the new status for the promotion.PersistenceObjectNotFoundException
- when the object as referenced by the key does not exist in
the persistence storage.PersistenceObjectWriteException
- when it failes to write the object to DB.PromotionKey[] findPromotionsInAGroupByStatus(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey key, int status) throws PersistenceObjectReadException
key
- is the key of promotion group.status
- is promotion status.PersistenceObjectReadException
- when reading objects in the database fails.PromotionKey saveAsANewRevision(Promotion promotion) throws PersistenceObjectWriteException, PersistenceCreateException
promotion
- the promotion to be saved.PersistenceObjectWriteException
- when writing a promotion to persistence storage fails.PersistenceCreateException
- when system fails to create the new revision of this
promotion.PromotionKey saveAsANewVersion(Promotion promotion) throws PersistenceObjectWriteException, PersistenceCreateException
promotion
- the promotion to be saved.PersistenceObjectWriteException
- when writing a promotion to persistence storage fails.PersistenceCreateException
- when creation of the new version of this promotion fails.java.lang.Number nextNumericKey()
void reload(PromotionKey key)
key
- representing promotion whose cache needs to be reloaded.void reloadAll()
PromotionKey findActivePromotionByCodeAndStoreID(java.lang.String code, java.lang.Integer storeID)
code
- visual cue of the promotion to be found.storeID
- is the ID of the store.PromotionKey findActivePromotionByNameAndStoreID(java.lang.String name, java.lang.Integer storeID)
name
- is the name of the promotion to be found.storeID
- is the ID of the store.PromotionKey findCurrentPromotionByNameAndStoreID(java.lang.String name, java.lang.Integer storeID) throws PersistenceObjectNotFoundException, PersistenceObjectReadException
name
- of the promotion to be found.storeID
- is the store ID of the store.PersistenceObjectNotFoundException
- when no current object is found.PersistenceObjectReadException
- when reading of the object fails.PromotionKey findCurrentPromotionByNameVersionAndStoreID(java.lang.String name, java.lang.Integer version, java.lang.Integer storeID) throws PersistenceObjectNotFoundException, PersistenceObjectReadException
name
- is the name of the promotion to be found.version
- is the version of the promotion to be found.storeID
- is the store ID of the store.PersistenceObjectNotFoundException
- when no current object is found.PersistenceObjectReadException
- when reading of the object fails.PromotionKey[] findPromotionByStatusAndStoreID(int status, java.lang.Integer storeID)
status
- is the status of the promotion to be found.storeID
- ID of the store.PromotionKey[] findCurrentPromotionByStoreID(java.lang.Integer storeID)
storeID
- is the ID of the store.PromotionKey[] findPromotionByStoreID(java.lang.Integer storeID)
storeID
- is the ID of the store.void changePromotionStatus(PromotionKey key, int status, java.util.HashMap sessionData) throws PersistenceObjectNotFoundException, PersistenceObjectWriteException
key
- is the key of the promotion whose status is about to be
changed.status
- the new statussessionData
- Session data that needs to passed to persistence managersPersistenceObjectNotFoundException
- when the object as referenced by the key does not exist in
the persistence storagePersistenceObjectWriteException
- when writes to the object failvoid create(Promotion pro, java.util.HashMap sessionData) throws PersistenceObjectAlreadyExistsException, PersistenceCreateException
pro
- The Promotion object to create.sessionData
- Session data that needs to passed to persistence managersPersistenceObjectAlreadyExistsException
- when this object to be created already exists in the
database.PersistenceCreateException
- when the creation process fails.void remove(Promotion pro, java.util.HashMap sessionData) throws PersistenceObjectNotFoundException, PersistenceRemoveException
pro
- Promotion to be removedsessionData
- Session data that needs to passed to persistence managersPersistenceObjectNotFoundException
- when the object to be removed does not exist in the database.PersistenceRemoveException
- when the object removal failsvoid save(Promotion pro, java.util.HashMap sessionData) throws PersistenceObjectNotFoundException, PersistenceObjectWriteException
pro
- A Promotion objectsessionData
- Session data that needs to passed to persistence managersPersistenceObjectNotFoundException
- when this object does not exist in the database.PersistenceObjectWriteException
- when writes to this promotion fail.PromotionKey saveAsANewRevision(Promotion promotion, java.util.HashMap sessionData) throws PersistenceObjectWriteException, PersistenceCreateException
promotion
- the promotion to be savedsessionData
- Session data that needs to passed to persistence managersPersistenceObjectWriteException
- when the write operation failsPersistenceCreateException
- when system fails to create the new revision of this
promotionPromotionKey saveAsANewVersion(Promotion promotion, java.util.HashMap sessionData) throws PersistenceObjectWriteException, PersistenceCreateException
promotion
- the promotion to be savedsessionData
- Session data that needs to passed to persistence managersPersistenceObjectWriteException
- when write operation failsPersistenceCreateException
- when creation of the new version of this promotion fails.PromotionKey[] findActivePromotionByCodePatternAndStoreID(java.lang.String code, java.lang.Integer storeID)
code
- is the visual cue of the promotion to be found.storeID
- is the ID of the store.PromotionKey[] findActivePromotionsInAGroupByDate(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey aGroupKey, java.sql.Timestamp aStartDate, java.sql.Timestamp aEndDate) throws PersistenceObjectReadException
aGroupKey
- The key of a promotion group.aStartDate
- The date to check against the promotion start date. If the
date is null, then all active promotion will be returned
regardless its start date.aEndDate
- The date to check against the promotion end date. If the date
is null, then all active promotion will be returned regardless
its end date.PersistenceObjectReadException
- when reading objects in the database fails.PromotionKey[] findActivePromotionByStoreIDAndDate(java.lang.Integer storeID, java.sql.Timestamp aStartDate, java.sql.Timestamp aEndDate)
storeID
- ID of the store.aStartDate
- The date to check against the promotion start date. If the
date is null, then all active promotion will be returned
regardless its start date.aEndDate
- The date to check against the promotion end date. If the date
is null, then all active promotion will be returned regardless
its end date.