public class PromotionPolicyJDBCPersistenceManager extends com.ibm.commerce.marketing.promotion.persistence.JDBCPersistenceManager implements PromotionPolicyPersistenceManager
XML Snippet for PromotionPolicyJDBCPersistenceManager:
<PromotionPolicyJDBCPersistenceManager impl="com.ibm.commerce.marketing.promotion.policy.PromotionPolicyJDBCPersistenceManager"> <InitialCacheSize>64</InitialCacheSize> <MaxCacheSize>1024</MaxCacheSize> </PromotionPolicyJDBCPersistenceManager>
Constructor and Description |
---|
PromotionPolicyJDBCPersistenceManager()
Default Constructor for PromotionPolicyJDBCPersistenceManager.
|
PromotionPolicyJDBCPersistenceManager(java.sql.Connection con)
Constructor for PromotionPolicyJDBCPersistenceManager.
|
Modifier and Type | Method and Description |
---|---|
void |
create(PromotionPolicy policy)
Create a new promotion policy.
|
PromotionPolicyKey[] |
findGlobalPolicyKeysByStore(StoreKey key)
Finds all global promotion policies within a store
|
PromotionPolicyKey[] |
findPolicyKeysByGroupAndStatus(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey gkey,
int status)
Finds promotion policies based on the group with which they are associated and their status
|
void |
fromXML(org.w3c.dom.Node anXMLNode)
Transforms an XML node into a real Object.
|
int |
getCacheInitialSize()
Gets initial cache size
|
int |
getCacheMaxSize()
Gets maximum cache size
|
void |
initCache()
Initials the cache.
|
PromotionPolicy |
load(PromotionPolicyKey key)
Finds promotion policy by promotion policy key.
|
java.lang.Number |
lookup(Key key)
Find policy by key.
|
java.lang.Number |
nextNumericKey()
Returns the next primary key value
|
void |
reload(PromotionPolicyKey key)
Invalidates the cache for one promotion policy.
|
void |
reloadAll()
Invalidates all policies currently in the cache.
|
void |
remove(PromotionPolicy policy)
This removing is referring to marked for deletion.
|
Key |
reverseLookup(java.lang.Number keyValue)
Find promotion policy by numeric key.
|
void |
save(PromotionPolicy policy)
Save promotion policy.
|
void |
setCacheInitialSize(int i)
Sets initial cache size
|
void |
setCacheMaxSize(int i)
Sets maximum cache size
|
java.lang.String |
toXML()
Converts any object into an XML format representation.
|
public PromotionPolicyJDBCPersistenceManager(java.sql.Connection con)
con
- database connectionpublic PromotionPolicyJDBCPersistenceManager()
public void reload(PromotionPolicyKey key)
reload
in interface PromotionPolicyPersistenceManager
key
- to the promotion policyPromotionPolicyPersistenceManager.reload(PromotionPolicyKey)
public void reloadAll()
reloadAll
in interface PromotionPolicyPersistenceManager
PromotionPolicyPersistenceManager.reloadAll()
public PromotionPolicy load(PromotionPolicyKey key) throws PersistenceObjectNotFoundException, PersistenceObjectReadException
load
in interface PromotionPolicyPersistenceManager
PromotionPolicyKey
- keyPersistenceObjectNotFoundException
- when the object identified by the key is not foundPersistenceObjectReadException
- when fails to load this objectPromotionPolicyPersistenceManager.load(PromotionPolicyKey)
public void create(PromotionPolicy policy) throws PersistenceObjectAlreadyExistsException, PersistenceCreateException
create
in interface PromotionPolicyPersistenceManager
PromotionPolicy
- policy The promotion policy to create in the database.PersistenceObjectAlreadyException
- when the object to create as identified by the key already existsPersistenceCreateException
- when fails to create this objectPersistenceObjectAlreadyExistsException
- when the object to create as identified by the key already existsPromotionPolicyPersistenceManager.create(PromotionPolicy)
public void remove(PromotionPolicy policy) throws PersistenceObjectNotFoundException, PersistenceRemoveException
remove
in interface PromotionPolicyPersistenceManager
PromotionPolicy
- proPersistenceObjectNotFoundException
- when the object identified by the key is not foundPersistenceRemoveException
- when fails to remove this objectcom.ibm.commerce.marketing.promotion.policy.PromotionPolicyPersistenceManager#delete(PromotionPolicy)
public void save(PromotionPolicy policy) throws PersistenceObjectNotFoundException, PersistenceObjectWriteException
save
in interface PromotionPolicyPersistenceManager
PromotionPolicy
- policyPersistenceObjectNotFoundException
- when the object identified by the key is not foundPersistenceObjectWriteException
- when fails to write to this objectPromotionPolicyPersistenceManager.save(PromotionPolicy)
public java.lang.Number lookup(Key key)
lookup
in interface KeyResolver
key
- is the Key for lookup.KeyResolver.lookup(Key)
public Key reverseLookup(java.lang.Number keyValue)
reverseLookup
in interface KeyResolver
keyValue
- is a number representing the key.KeyResolver.reverseLookup(Number)
public java.lang.Number nextNumericKey()
nextNumericKey
in interface PromotionPolicyPersistenceManager
public PromotionPolicyKey[] findGlobalPolicyKeysByStore(StoreKey key)
findGlobalPolicyKeysByStore
in interface PromotionPolicyPersistenceManager
key
- identifies the storePromotionPolicyPersistenceManager.findGlobalPolicyKeysByStore(StoreKey)
public PromotionPolicyKey[] findPolicyKeysByGroupAndStatus(com.ibm.commerce.marketing.promotion.group.PromotionGroupKey gkey, int status)
findPolicyKeysByGroupAndStatus
in interface PromotionPolicyPersistenceManager
gkey
- the key of the group with which the policies are associated.status
- the status of the policiesPromotionPolicyPersistenceManager.findPolicyKeysByGroupAndStatus(PromotionGroupKey,
int)
public java.lang.String toXML() throws XMLizationException
toXML
in interface XMLizable
XMLizationException
- when this process failsXMLizable.toXML()
public void fromXML(org.w3c.dom.Node anXMLNode) throws DeXMLizationException
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()