public class CachingOfBizPropertyEntryStore extends Object implements OfBizPropertyEntryStore
OfBizPropertyEntryStore.PropertyEntry
Constructor and Description |
---|
CachingOfBizPropertyEntryStore(org.ofbiz.core.entity.DelegatorInterface genericDelegator,
com.atlassian.cache.CacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
OfBizPropertyEntryStore.PropertyEntry |
getEntry(String entityName,
long entityId,
String propertyKey)
Retrieve the type and value of the specified property.
|
Collection<String> |
getKeys(String entityName,
long entityId)
Retrieve all keys that are stored in the given property set.
|
Collection<String> |
getKeys(String entityName,
long entityId,
int type)
Retrieve all keys that are stored in the given property set and have the specified value type.
|
void |
onClearCache(ClearCacheEvent event) |
void |
refreshAll() |
void |
removeEntry(String entityName,
long entityId,
String propertyKey)
Remove a specific property from a property set.
|
void |
removePropertySet(String entityName,
long entityId)
Removes an entire property set.
|
void |
setEntry(String entityName,
long entityId,
String propertyKey,
int type,
Object value)
Stores a new value for the specified property.
|
String |
toString() |
public CachingOfBizPropertyEntryStore(org.ofbiz.core.entity.DelegatorInterface genericDelegator, com.atlassian.cache.CacheManager cacheManager)
public Collection<String> getKeys(String entityName, long entityId)
OfBizPropertyEntryStore
getKeys
in interface OfBizPropertyEntryStore
entityName
- the entity name of the property set's ownerentityId
- the entity ID of the property set's ownerpublic Collection<String> getKeys(String entityName, long entityId, int type)
OfBizPropertyEntryStore
getKeys
in interface OfBizPropertyEntryStore
entityName
- the entity name of the property set's ownerentityId
- the entity ID of the property set's ownertype
- the value type, as defined by the value constants in the PropertySet
interface,
that the keys must have to be returnedpublic OfBizPropertyEntryStore.PropertyEntry getEntry(String entityName, long entityId, String propertyKey)
OfBizPropertyEntryStore
getEntry
in interface OfBizPropertyEntryStore
entityName
- the entity name of the property set's ownerentityId
- the entity ID of the property set's ownerpropertyKey
- the name of the property to loadnull
if the property does not exist. Note that even if it does "exist",
the value
can itself be null
.public void setEntry(String entityName, long entityId, String propertyKey, int type, Object value)
OfBizPropertyEntryStore
setEntry
in interface OfBizPropertyEntryStore
entityName
- the entity name of the property set's ownerentityId
- the entity ID of the property set's ownerpropertyKey
- the name of the property to storetype
- the value type that is to be stored, as defined by the value constants in the
PropertySet
interface.value
- the value to be storedpublic void removeEntry(String entityName, long entityId, String propertyKey)
OfBizPropertyEntryStore
removeEntry
in interface OfBizPropertyEntryStore
entityName
- the entity name of the property set's ownerentityId
- the entity ID of the property set's ownerpropertyKey
- the name of the property to removepublic void removePropertySet(String entityName, long entityId)
Implementation note: This is a "hard" operation to optimize due to the way the tables are structured, OfBiz's poor support for joins and sub-selects, the cache's inability to replicate the invalidation of a group of keys, and the probable performance cost of flushing the entire entry cache. We will make these assumptions:
Based on those assumptions, the decision is to invalidate only those keys for which we actually find and remove an entry, exactly as if they have been removed individually.
removePropertySet
in interface OfBizPropertyEntryStore
entityName
- the entity name of the property set's ownerentityId
- the entity ID of the property set's ownerpublic void refreshAll()
@EventListener public void onClearCache(ClearCacheEvent event)
Copyright © 2002-2015 Atlassian. All Rights Reserved.