public class SimpleMapCacheConnection extends Object implements ObjectConnection
Constructor and Description |
---|
SimpleMapCacheConnection(Map<Object,Object> cache,
ClassRegistry registry,
CacheNameProxy proxy) |
SimpleMapCacheConnection(Map<Object,Object> cache,
Map<Object,Object> stagecache,
Map<Object,Object> aliascache,
ClassRegistry registry,
CacheNameProxy proxy) |
Modifier and Type | Method and Description |
---|---|
void |
add(Object key,
Object value)
Call to add an object to the cache
|
void |
cleanUp()
Called to enable the connection to cleanup after use
|
void |
clearCache(String cacheName)
Called to clear the cache and delete all objects.
|
boolean |
configuredForMaterialization()
Call to determine if this connection is configured for materialization.
|
boolean |
configuredUsingAnnotations()
Call to determine if the JDG cache is configured using annotation (or using protobuf and marsharllers).
|
Object |
get(Object key)
Call to obtain an object from the cache based on the specified key
|
Collection<Object> |
getAll()
Call to obtain all the objects from the cache
|
Map<Object,Object> |
getCache()
Call to obtain the default cache object
|
Map<Object,Object> |
getCache(String cacheName)
Call to obtain the cache object based on the provided cacheName;
|
Class<?> |
getCacheClassType()
Returns root object class type
that is defined for the cache.
|
Class<?> |
getCacheKeyClassType()
Returns the class type of the key to the cache.
|
String |
getCacheName()
Returns the name of the cache
|
ClassRegistry |
getClassRegistry()
Return the ClassRegistry that contains which classes and their methods.
|
DDLHandler |
getDDLHandler()
Implement @link DDLHandler if the translator supports materialization.
|
String |
getPkField()
Returns the name of the primary key to the cache
|
SearchType |
getSearchType()
Returns the
SearchType that will be used to perform
dynamic searching of the cache. |
Version |
getVersion()
Call to get the version of the data source that is being accessed.
|
boolean |
isAlive()
Call to check the status of the connection
|
Object |
remove(Object key)
Call to remove an object from the cache
|
void |
setCacheClassType(Class<?> classType) |
void |
setCacheKeyClassType(Class<?> keyClassType) |
void |
setConfiguredUsingAnnotations(boolean configured) |
void |
setPkField(String pk) |
void |
setVersion(Version version) |
void |
update(Object key,
Object value)
Call to update an object in the cache
|
public SimpleMapCacheConnection(Map<Object,Object> cache, ClassRegistry registry, CacheNameProxy proxy)
public Version getVersion()
ObjectConnection
getVersion
in interface ObjectConnection
public void setVersion(Version version)
public Map<Object,Object> getCache() throws TranslatorException
ObjectConnection
getCache
in interface ObjectConnection
TranslatorException
public Map<Object,Object> getCache(String cacheName) throws TranslatorException
getCache
in interface ObjectConnection
TranslatorException
ObjectConnection.getCache(java.lang.String)
public void cleanUp()
ObjectConnection
cleanUp
in interface ObjectConnection
public ClassRegistry getClassRegistry()
ObjectConnection
getClassRegistry
in interface ObjectConnection
public boolean isAlive()
isAlive
in interface ObjectConnection
ObjectConnection.isAlive()
public String getPkField()
getPkField
in interface ObjectConnection
ObjectConnection.getPkField()
public void setPkField(String pk)
public Class<?> getCacheKeyClassType()
getCacheKeyClassType
in interface ObjectConnection
ObjectConnection.getCacheKeyClassType()
public void setCacheKeyClassType(Class<?> keyClassType)
public String getCacheName()
getCacheName
in interface ObjectConnection
ObjectConnection.getCacheName()
public Class<?> getCacheClassType()
getCacheClassType
in interface ObjectConnection
ObjectConnection.getCacheClassType()
public void setCacheClassType(Class<?> classType)
public void add(Object key, Object value) throws TranslatorException
add
in interface ObjectConnection
TranslatorException
ObjectConnection.add(java.lang.Object, java.lang.Object)
public Object remove(Object key) throws TranslatorException
remove
in interface ObjectConnection
TranslatorException
ObjectConnection.remove(java.lang.Object)
public void update(Object key, Object value) throws TranslatorException
update
in interface ObjectConnection
TranslatorException
ObjectConnection.update(java.lang.Object, java.lang.Object)
public Object get(Object key) throws TranslatorException
get
in interface ObjectConnection
key
- to use to get the object from the cacheTranslatorException
ObjectConnection.get(java.lang.Object)
public Collection<Object> getAll() throws TranslatorException
getAll
in interface ObjectConnection
TranslatorException
ObjectConnection.getAll()
public DDLHandler getDDLHandler()
getDDLHandler
in interface ObjectConnection
public void clearCache(String cacheName) throws TranslatorException
clearCache
in interface ObjectConnection
TranslatorException
ObjectConnection.clearCache(java.lang.String)
public SearchType getSearchType()
SearchType
that will be used to perform
dynamic searching of the cache.getSearchType
in interface ObjectConnection
ObjectConnection.getSearchType()
public boolean configuredUsingAnnotations()
ObjectConnection
configuredUsingAnnotations
in interface ObjectConnection
public void setConfiguredUsingAnnotations(boolean configured)
public boolean configuredForMaterialization()
configuredForMaterialization
in interface ObjectConnection
Copyright © 2017 JBoss by Red Hat. All rights reserved.