|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ceryle.util.HashCache
org.ceryle.wiki.plugin.assertion.AssertionQueryCache
public class AssertionQueryCache
Extends HashCache as a cache for Assertion queries.
TODO: Currently this class does not manage cache dirtiness nor support
AssertionQueryExecutor.getAssertions(),
AssertionQueryExecutor.getAssertionCount(), or
AssertionQueryExecutor.getAssertionTemplates()
since it's not considered that these three methods will be called
frequently by actual applications.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
AssertionQueryCache(WikiMapManager manager,
AssertionQueryExecutor executor)
Constructor for the AssertionQueryCache. |
|
| Method Summary | |
|---|---|
Object |
get(Object key)
Returns the value to which this map maps the specified key. |
static String |
getQuerySignature(String pagename,
String subject,
String predicate,
String object,
int templateMode,
int logicMode)
Creates a base 64 signature from the provided query parameters. |
Object |
put(Object key,
Object value)
Associates the specified value with the specified key in this map. |
Collection |
queryAssertions(Collection associations,
String pagename,
String subject,
String predicate,
String object,
int templateMode,
int logicMode)
The method that calls AssertionQueryExecutor with a getAssertions() query. |
boolean |
queryHasAssertion(String pagename,
String subject,
String predicate,
String object,
int templateMode,
int logicMode)
The method that calls AssertionQueryExecutor with a hasAssertion() query. |
void |
setEnabled(boolean enabled)
Enables or disables the cache. |
| Methods inherited from class org.ceryle.util.HashCache |
|---|
clear, contains, containsKey, containsValue, entrySet, equals, hashCode, isEmpty, keySet, putAll, rankOf, remove, setMaximumSize, size, trimCache, values |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AssertionQueryCache(WikiMapManager manager,
AssertionQueryExecutor executor)
manager - the WikiMapManager for the wiki's TopicMap.executor - the AssertionqueryExecutor to execute queries.| Method Detail |
|---|
public void setEnabled(boolean enabled)
public Object get(Object key)
Overrides the superclass to do a check on the key being an instance of a String, throwing an IllegalArgumentException if not.
get in interface Mapget in class HashCachekey - key whose associated value is to be returned.
ClassCastException - if the key is not a String.
NullPointerException - if the key is null.Map.get(Object)
public Object put(Object key,
Object value)
Overrides the superclass to do a check on the key being an instance of a String and the value being an instance of a Collection, throwing an IllegalArgumentException if not.
put in interface Mapput in class HashCachekey - key with which the specified value is to be associated.value - value to be associated with the specified key.
UnsupportedOperationException - if the put operation is not supported by this map.
ClassCastException - if the class of the specified key or value
prevents it from being stored in this map.
IllegalArgumentException - if some aspect of this key or value prevents
it from being stored in this map.
NullPointerException - this map does not permit null keys or values,
and the specified key or value is null.Map.put(Object,Object)
public Collection queryAssertions(Collection associations,
String pagename,
String subject,
String predicate,
String object,
int templateMode,
int logicMode)
throws AssertionException,
TopicMapException
Note that the cache can contain both Assertions and Collections.
AssertionException
TopicMapException
public boolean queryHasAssertion(String pagename,
String subject,
String predicate,
String object,
int templateMode,
int logicMode)
throws AssertionQueryException
AssertionQueryException
public static String getQuerySignature(String pagename,
String subject,
String predicate,
String object,
int templateMode,
int logicMode)
Assertion.getSignature()
but includes the template and logic modes that are part of the query.
Base64Converter.toBase64(long)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||