Package com.atlassian.jira.propertyset
Class PropertySetCache
java.lang.Object
com.atlassian.jira.propertyset.PropertySetCache
This class provides a cache for PropertySet values as used by JiraCachingPropertySet.
The intention is that the cache is non-blocking for reads, and it is up to the JiraCachingPropertySet to synchronise writes with reading/writing from the underlying Property Set.
This cache looks and works a lot like a PropertySet for obvious reasons, however it is not declared to implement
PropertySet because it does not implement all methods - only the ones we want to cache for. With that in mind, it
generally attempts to follow the contract of the PropertySet interface. Namely:
- If a property is retrieved that exists but contains a value of different
type, a
InvalidPropertyTypeExceptionshould be thrown. - If a property is retrieved that does not exist, null (or the primitive equivalent) is returned.
- Since:
- v4.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidbulkLoad(com.opensymphony.module.propertyset.PropertySet source) Eagerly loads all the values from the given PropertySet into this cache.voidcacheExistance(String key, boolean keyExists) voidclear()Returns the cached value for whether the given key exists in the underlying PropertySet.booleangetBoolean(String key) byte[]doubleintlonggetProperties(String key) intvoidvoidsetBoolean(String key, boolean value) voidvoidvoidvoidvoidvoidvoidsetProperties(String key, Properties value) voidvoidvoidvoid
-
Method Details
-
setBoolean
-
getBoolean
public boolean getBoolean(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
-
setData
-
getData
public byte[] getData(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
-
setDate
-
getDate
public Date getDate(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
-
setDouble
-
getDouble
public double getDouble(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
-
setInt
-
getInt
public int getInt(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
-
setLong
-
getLong
public long getLong(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
-
setObject
-
getObject
public Object getObject(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
-
setProperties
-
getProperties
public Properties getProperties(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
-
setString
-
getString
public String getString(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException, com.opensymphony.module.propertyset.InvalidPropertyTypeException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedExceptioncom.opensymphony.module.propertyset.InvalidPropertyTypeException
-
setText
-
getText
public String getText(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
-
setXML
-
getXML
public Document getXML(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
-
remove
-
clear
public void clear() -
bulkLoad
public void bulkLoad(com.opensymphony.module.propertyset.PropertySet source) Eagerly loads all the values from the given PropertySet into this cache.- Parameters:
source- The PropertySet to bulk load from.
-
exists
Returns the cached value for whether the given key exists in the underlying PropertySet.It is important not to confuse this method with the
Map.containsKey(java.lang.Object)method.- Parameters:
key- The property key.- Returns:
- A Boolean object containing the cached existance of a value for the key, or null if we haven't cached the existance for this key.
- See Also:
-
cacheExistance
-
setType
-
getType
public int getType(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException - Throws:
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
-