public class PropertySetCache extends Object
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:
InvalidPropertyTypeException
should be thrown.JiraCachingPropertySet
,
PropertySet
Modifier and Type | Method and Description |
---|---|
void |
bulkLoad(com.opensymphony.module.propertyset.PropertySet source)
Eagerly loads all the values from the given PropertySet into this cache.
|
void |
cacheExistance(String key,
boolean keyExists) |
void |
clear() |
Boolean |
exists(String key)
Returns the cached value for whether the given key exists in the underlying PropertySet.
|
boolean |
getBoolean(String key) |
byte[] |
getData(String key) |
Date |
getDate(String key) |
double |
getDouble(String key) |
int |
getInt(String key) |
long |
getLong(String key) |
Object |
getObject(String key) |
Properties |
getProperties(String key) |
String |
getString(String key) |
String |
getText(String key) |
int |
getType(String key) |
Document |
getXML(String key) |
void |
remove(String key) |
void |
setBoolean(String key,
boolean value) |
void |
setData(String key,
byte[] value) |
void |
setDate(String key,
Date value) |
void |
setDouble(String key,
double value) |
void |
setInt(String key,
int value) |
void |
setLong(String key,
long value) |
void |
setObject(String key,
Object value) |
void |
setProperties(String key,
Properties value) |
void |
setString(String key,
String value) |
void |
setText(String key,
String value) |
void |
setType(String key,
int type) |
void |
setXML(String key,
Document value) |
public void setBoolean(String key, boolean value)
public boolean getBoolean(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
public void setData(String key, byte[] value)
public byte[] getData(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
public Date getDate(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
public void setDouble(String key, double value)
public double getDouble(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
public void setInt(String key, int value)
public int getInt(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
public void setLong(String key, long value)
public long getLong(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
public Object getObject(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
public void setProperties(String key, Properties value)
public Properties getProperties(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
public String getString(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException, com.opensymphony.module.propertyset.InvalidPropertyTypeException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.opensymphony.module.propertyset.InvalidPropertyTypeException
public String getText(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
public Document getXML(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
public void remove(String key)
public void clear()
public void bulkLoad(com.opensymphony.module.propertyset.PropertySet source)
source
- The PropertySet to bulk load from.public Boolean exists(String key)
It is important not to confuse this method with the Map.containsKey(java.lang.Object)
method.
key
- The property key.JiraCachingPropertySet.exists(String)
public void cacheExistance(String key, boolean keyExists)
public void setType(String key, int type)
public int getType(String key) throws com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
com.atlassian.jira.propertyset.PropertySetCache.NoValueCachedException
Copyright © 2002-2024 Atlassian. All Rights Reserved.