org.openanzo.common.rdb.layout
Interface ILayoutCache<T>

Type Parameters:
T - Type of object being cached
All Known Implementing Classes:
NodeLayoutCacheProxy, ValueLayoutCacheProxy

public interface ILayoutCache<T>

Provides cache clearing and checking presence of objects cached by their reference or (long) id.

Author:
Stephen Evanchik, Joe Betz

Method Summary
 T cache(java.lang.Long id, java.lang.String value, java.lang.Long modifierId)
          Create object from provided ID and value and cache result
 void clearCache()
          Clear all cached objects and IDs
 void clearUncommittedCache()
          Clear any uncommitted cache entries
 void commitUncommittedCache()
          Commit any uncommitted cache entries
 T getIfCached(java.lang.Long id)
          Get the Object for this ID, if already cached
 java.lang.Long getIfCached(T obj)
          Get the ID for this Object, if already cached
 boolean isCached(java.lang.Long id)
          Return true if an Object with this ID is already cached
 boolean isCached(T obj)
          Return true if a ID for this Object is already cached
 

Method Detail

cache

T cache(java.lang.Long id,
        java.lang.String value,
        java.lang.Long modifierId)
Create object from provided ID and value and cache result

Parameters:
id - ID of node
value - String value of node
modifierId - modifierId for literals
Returns:
converted object for provided data

isCached

boolean isCached(T obj)
Return true if a ID for this Object is already cached

Parameters:
obj - object to check
Returns:
true if a ID for this Object is already cached

getIfCached

java.lang.Long getIfCached(T obj)
Get the ID for this Object, if already cached

Parameters:
obj - object to find cached ID
Returns:
the ID for this Object, if already cached

isCached

boolean isCached(java.lang.Long id)
Return true if an Object with this ID is already cached

Parameters:
id - id to check
Returns:
true if an Object with this ID is already cached

getIfCached

T getIfCached(java.lang.Long id)
Get the Object for this ID, if already cached

Parameters:
id - id of Object to retrieve
Returns:
the Object for this ID, if already cached

clearCache

void clearCache()
Clear all cached objects and IDs


commitUncommittedCache

void commitUncommittedCache()
Commit any uncommitted cache entries


clearUncommittedCache

void clearUncommittedCache()
Clear any uncommitted cache entries



Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.