public class PromotionPolicySessionBeanPersistenceManager extends java.lang.Object implements PromotionPolicyPersistenceManager
XML Snippet for PromotionPolicyJDBCPersistenceManager:
<PromotionPolicySessionBeanPersistenceManager impl="com.ibm.commerce.marketing.promotion.policy.PromotionPolicySessionBeanPersistenceManager"> <InitialCacheSize>64</InitialCacheSize> <MaxCacheSize>1024</MaxCacheSize> </PromotionPolicySessionBeanPersistenceManager>
Constructor and Description |
---|
PromotionPolicySessionBeanPersistenceManager()
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
create(PromotionPolicy policy)
Create a new promotion policy
|
PromotionPolicyKey[] |
findGlobalPolicyKeysByStore(StoreKey key)
Find global Promotion Policy Key by Store
|
PromotionPolicyKey[] |
findPolicyKeysByGroupAndStatus(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey gkey,
int status)
Find Promotion Policy Keys by group and status
|
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms the XML node into its corresponding real Object.
|
int |
getCacheInitialSize()
Gets initial cache size
|
int |
getCacheMaxSize()
Gets maximum cache size
|
void |
initCache()
Initials the cache.
|
PromotionPolicy |
load(PromotionPolicyKey key)
Find a promotion policy object by promotion policy key.
|
java.lang.Number |
lookup(Key key)
Find policy by key
|
java.lang.Number |
nextNumericKey()
Generates unique numeric key
|
void |
reload(PromotionPolicyKey key)
Reload Promotion Policy from cache
|
void |
reloadAll()
Reloads all Promotion Policies
|
void |
remove(PromotionPolicy policy)
Removes a Promotion Policy by marking it for delete
|
Key |
reverseLookup(java.lang.Number keyValue)
Find promotion policy by numeric key
|
void |
save(PromotionPolicy policy)
Save a promotion policy.
|
void |
setCacheInitialSize(int i)
Sets initial cache size
|
void |
setCacheMaxSize(int i)
Sets maximum cache size
|
java.lang.String |
toXML()
Converts the object into its corresponding XML format representation.
|
public PromotionPolicySessionBeanPersistenceManager()
public void reload(PromotionPolicyKey key)
reload
in interface PromotionPolicyPersistenceManager
key
- -
Promotion Policy Keypublic void reloadAll()
reloadAll
in interface PromotionPolicyPersistenceManager
public PromotionPolicy load(PromotionPolicyKey key) throws PersistenceObjectNotFoundException, PersistenceObjectReadException
Note: This method returns cached data. To avoid concurrency problems, cached data should not be modified.
load
in interface PromotionPolicyPersistenceManager
key
- the promotion policy key.PersistenceObjectNotFoundException
- when the object identified by the key is not foundPersistenceObjectReadException
- when fails to load this objectpublic void create(PromotionPolicy policy) throws PersistenceObjectAlreadyExistsException, PersistenceCreateException
create
in interface PromotionPolicyPersistenceManager
policy
- The promotion policy to create in the database.PersistenceObjectAlreadyExistsException
- when the object to create as identified by the key already
existsPersistenceCreateException
- when fails to create this objectpublic void remove(PromotionPolicy policy) throws PersistenceObjectNotFoundException, PersistenceRemoveException
remove
in interface PromotionPolicyPersistenceManager
policy
- Promotion Policy to removePersistenceObjectNotFoundException
- when the object identified by the key is not foundPersistenceRemoveException
- when fails to remove this objectpublic void save(PromotionPolicy policy) throws PersistenceObjectNotFoundException, PersistenceObjectWriteException
save
in interface PromotionPolicyPersistenceManager
policy
- Promotion Policy to updatePersistenceObjectNotFoundException
- when the object identified by the key is not foundPersistenceObjectWriteException
- when fails to write to this objectpublic java.lang.Number lookup(Key key)
Note: This method returns cached data. To avoid concurrency problems, cached data should not be modified.
lookup
in interface KeyResolver
key
- -
policy keypublic Key reverseLookup(java.lang.Number keyValue)
reverseLookup
in interface KeyResolver
keyValue
- -
promotion policy numeric keypublic java.lang.Number nextNumericKey()
nextNumericKey
in interface PromotionPolicyPersistenceManager
public PromotionPolicyKey[] findGlobalPolicyKeysByStore(StoreKey key)
Note: This method returns cached data. To avoid concurrency problems, cached data should not be modified.
findGlobalPolicyKeysByStore
in interface PromotionPolicyPersistenceManager
key
- -
Store Keypublic PromotionPolicyKey[] findPolicyKeysByGroupAndStatus(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey gkey, int status)
Note: This method returns cached data. To avoid concurrency problems, cached data should not be modified.
findPolicyKeysByGroupAndStatus
in interface PromotionPolicyPersistenceManager
gkey
- -
Promotion Group Keystatus
- -
Policy statuspublic java.lang.String toXML() throws XMLizationException
XMLizable
toXML
in interface XMLizable
XMLizationException
- when this process failsXMLizable.toXML()
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
XMLizable
fromXML
in interface XMLizable
anXMLNode
- The node that represents an XMLizable objectDeXMLizationException
- when this process failsXMLizable.fromXML(Node)
public void setCacheInitialSize(int i)
i
- the initial cache sizepublic void setCacheMaxSize(int i)
i
- the maximum cache sizepublic int getCacheInitialSize()
public int getCacheMaxSize()
public void initCache()