Package org.intermine.api.query
Class MemoryQueryStore
- java.lang.Object
-
- org.intermine.api.query.MemoryQueryStore
-
- All Implemented Interfaces:
QueryStore
public class MemoryQueryStore extends java.lang.Object implements QueryStore
An in-memory implementation of a query store. This implementation is aware of when it was instantiated, and complains differently to the user about missing keys depending on whether the key is from a time before the lifetime of this object, in which case the server may have been restarted, or after, in which case it is all their fault.- Author:
- Alex Kalderimis
-
-
Constructor Summary
Constructors Constructor Description MemoryQueryStore(int maxSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getQuery(java.lang.String key)
java.lang.String
putQuery(java.lang.String xml)
-
-
-
Method Detail
-
putQuery
public java.lang.String putQuery(java.lang.String xml) throws BadQueryException
- Specified by:
putQuery
in interfaceQueryStore
- Parameters:
xml
- xml- Returns:
- id
- Throws:
BadQueryException
- if query is bad
-
getQuery
public java.lang.String getQuery(java.lang.String key) throws KeyFormatException, NotPresentException
- Specified by:
getQuery
in interfaceQueryStore
- Parameters:
key
- key- Returns:
- query
- Throws:
KeyFormatException
- if something goes wrongNotPresentException
- if key is not in query store
-
-