Package net.handle.hdllib
Interface Cache
- 
- All Known Implementing Classes:
- MemCache
 
 public interface Cache
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Remove all values from the cachevoidclose()byte[][]getCachedValues(byte[] handle, byte[][] reqTypes, int[] reqIndexes)Returns any non-expired handle values that are in the caches storage.booleanisCachedNotFound(byte[][] values)Returns true if this return value of getCachedValues indicates a cached value of HANDLE_NOT_FOUNDvoidremoveHandle(byte[] handle)Remove one handle from the cachevoidsetCachedNotFound(byte[] handle, int ttl)Returns true if this handle should have a cached HANDLE_NOT_FOUND.voidsetCachedValues(byte[] handle, HandleValue[] newValues, byte[][] newTypeList, int[] newIndexList)Store the given handle values after a query for the handle.voidsetMaximumHandles(int maxHandles)Set the maximum size for the cache by the number of handles.voidsetMaximumSize(int maxSize)Set the maximum size for the cache by the number of bytes used for storage.
 
- 
- 
- 
Method Detail- 
getCachedValuesbyte[][] getCachedValues(byte[] handle, byte[][] reqTypes, int[] reqIndexes) throws java.lang.ExceptionReturns any non-expired handle values that are in the caches storage. A null return value indicates that the requested values aren't in the cache. Returning the an array of values (including an array of zero length) indicates that the returned values are the only values from the requested set (ie the handle doesn't have any more values from the requested set). Returns a sentinel value if HANDLE_NOT_FOUND has been cached; return value should be checked against isCachedNotFound before using. ***** Speed is important in this method *****- Throws:
- java.lang.Exception
 
 - 
isCachedNotFoundboolean isCachedNotFound(byte[][] values) Returns true if this return value of getCachedValues indicates a cached value of HANDLE_NOT_FOUND
 - 
setCachedValuesvoid setCachedValues(byte[] handle, HandleValue[] newValues, byte[][] newTypeList, int[] newIndexList) throws java.lang.ExceptionStore the given handle values after a query for the handle. The query was performed with the given type-list and index-list. ***** Speed is less important in this method *****- Throws:
- java.lang.Exception
 
 - 
setCachedNotFoundvoid setCachedNotFound(byte[] handle, int ttl) throws java.lang.ExceptionReturns true if this handle should have a cached HANDLE_NOT_FOUND. Pass time-to-live.- Throws:
- java.lang.Exception
 
 - 
setMaximumHandlesvoid setMaximumHandles(int maxHandles) Set the maximum size for the cache by the number of handles.
 - 
setMaximumSizevoid setMaximumSize(int maxSize) Set the maximum size for the cache by the number of bytes used for storage.
 - 
removeHandlevoid removeHandle(byte[] handle) throws java.lang.ExceptionRemove one handle from the cache- Throws:
- java.lang.Exception
 
 - 
clearvoid clear() throws java.lang.ExceptionRemove all values from the cache- Throws:
- java.lang.Exception
 
 - 
closevoid close() throws java.lang.Exception- Throws:
- java.lang.Exception
 
 
- 
 
-