public class

CachingOfBizPropertyEntryStore

extends Object
implements OfBizPropertyEntryStore
java.lang.Object
   ↳ com.atlassian.jira.propertyset.CachingOfBizPropertyEntryStore

Summary

Public Constructors
CachingOfBizPropertyEntryStore(DelegatorInterface genericDelegator, CacheManager cacheManager)
Public Methods
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.
@EventListener 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()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.propertyset.OfBizPropertyEntryStore

Public Constructors

public CachingOfBizPropertyEntryStore (DelegatorInterface genericDelegator, CacheManager cacheManager)

Public Methods

public OfBizPropertyEntryStore.PropertyEntry getEntry (String entityName, long entityId, String propertyKey)

Retrieve the type and value of the specified property.

Parameters
entityName the entity name of the property set's owner
entityId the entity ID of the property set's owner
propertyKey the name of the property to load
Returns
  • the property entry, or null if the property does not exist. Note that even if it does "exist", the value can itself be null.

public Collection<String> getKeys (String entityName, long entityId)

Retrieve all keys that are stored in the given property set.

Parameters
entityName the entity name of the property set's owner
entityId the entity ID of the property set's owner
Returns
  • all of the keys that are stored for this property set, in no particular order

public 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.

Parameters
entityName the entity name of the property set's owner
entityId the entity ID of the property set's owner
type the value type, as defined by the value constants in the PropertySet interface, that the keys must have to be returned
Returns
  • all of the keys that are stored for this property set and have the given type, in no particular order

@EventListener public void onClearCache (ClearCacheEvent event)

public void refreshAll ()

public void removeEntry (String entityName, long entityId, String propertyKey)

Remove a specific property from a property set.

Parameters
entityName the entity name of the property set's owner
entityId the entity ID of the property set's owner
propertyKey the name of the property to remove

public void removePropertySet (String entityName, long entityId)

Removes an entire property set.

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:

  1. It is rare to delete an entire property set that is also large, so going row-at-a-time is acceptable.
  2. Another cluster node that explicitly removes a row from the property set will itself be responsible for invalidating that row's entry.
  3. Exhaustively searching for matching keys is both expensive and unreliable (if we can have stale rows, then so can other nodes have different stale rows that we don't even know to invalidate for them).
  4. The only real alternative would be to flush the entire cache.

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.

Parameters
entityName the entity name of the property set's owner
entityId the entity ID of the property set's owner

public void setEntry (String entityName, long entityId, String propertyKey, int type, Object value)

Stores a new value for the specified property.

Parameters
entityName the entity name of the property set's owner
entityId the entity ID of the property set's owner
propertyKey the name of the property to store
type the value type that is to be stored, as defined by the value constants in the PropertySet interface.
value the value to be stored

public String toString ()