|
Spring Data Key-Value | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.client.support.RestGatewaySupport org.springframework.data.keyvalue.riak.core.AbstractRiakTemplate
public abstract class AbstractRiakTemplate
Base class for RiakTemplates that defines basic behaviour common to both kinds of templates (Key/Value and Bucket/Key/Value).
Field Summary | |
---|---|
protected List<BucketKeyResolver> |
bucketKeyResolvers
A list of resolvers to turn a single object into a BucketKeyPair . |
protected ConcurrentSkipListMap<BucketKeyPair,RiakValue<?>> |
cache
For caching objects based on ETags. |
protected ClassLoader |
classLoader
ClassLoader to use for saving/loading objects using the automatic converters. |
protected ConversionService |
conversionService
For converting objects to/from other kinds of objects. |
protected QosParameters |
defaultQosParameters
The default QosParameters to use for all operations through this template. |
protected Class<?> |
defaultType
Default type to use when trying to deserialize objects and we can't otherwise tell what to do. |
protected String |
defaultUri
The URI to use inside the RestTemplate. |
protected boolean |
groovyPresent
Do we need to handle Groovy strings in the Jackson JSON processor? |
protected static SimpleDateFormat |
httpDate
For getting a java.util.Date from the Last-Modified header. |
protected org.apache.commons.logging.Log |
log
|
protected String |
mapReduceUri
The URI for the Riak Map/Reduce API. |
protected static Pattern |
prefix
Regex used to extract host, port, and prefix from the given URI. |
protected String |
RIAK_CLIENT_ID
Client ID used by Riak to correlate updates. |
protected static String |
RIAK_META_CLASSNAME
|
protected static String |
RIAK_VCLOCK
|
protected boolean |
useCache
Whether or not to use the ETag-based cache. |
protected ExecutorService |
workerPool
ExecutorService to use for running asynchronous jobs. |
Fields inherited from class org.springframework.web.client.support.RestGatewaySupport |
---|
logger |
Constructor Summary | |
---|---|
AbstractRiakTemplate()
Take all the defaults. |
|
AbstractRiakTemplate(ClientHttpRequestFactory requestFactory)
Use the specified ClientHttpRequestFactory . |
Method Summary | ||
---|---|---|
void |
afterPropertiesSet()
|
|
protected
|
checkCache(K key,
Class<T> requiredType)
|
|
protected HttpHeaders |
defaultHeaders(Map<String,?> metadata)
|
|
protected MediaType |
extractMediaType(Object value)
|
|
protected RiakMetaData |
extractMetaData(HttpHeaders headers)
|
|
protected String |
extractQosParameters(QosParameters qosParams)
Get a string that represents the QOS parameters, taken either from the specified object or from the template defaults. |
|
protected
|
extractValue(ResponseEntity<?> response,
Class<?> origType,
Class<T> requiredType)
|
|
ConversionService |
getConversionService()
|
|
QosParameters |
getDefaultQosParameters()
|
|
Class<?> |
getDefaultType()
Get the default type to use if none can be inferred. |
|
String |
getDefaultUri()
|
|
String |
getHost()
|
|
boolean |
getIgnoreNotFound()
|
|
String |
getMapReduceUri()
|
|
Integer |
getPort()
|
|
String |
getPrefix()
Extract the prefix from the URI for use in creating links. |
|
protected
|
getType(B bucket,
K key)
|
|
protected
|
getType(B bucket,
K key,
ClassLoader classLoader)
|
|
ExecutorService |
getWorkerPool()
|
|
boolean |
isUseCache()
|
|
protected BucketKeyPair |
resolveBucketKeyPair(Object key,
Object val)
|
|
void |
setBeanClassLoader(ClassLoader classLoader)
|
|
void |
setConversionService(ConversionService conversionService)
Specify the conversion service to use. |
|
void |
setDefaultQosParameters(QosParameters defaultQosParameters)
|
|
void |
setDefaultType(Class<?> defaultType)
Set the default type to use if none can be inferred. |
|
void |
setDefaultUri(String defaultUri)
|
|
void |
setIgnoreNotFound(boolean b)
|
|
void |
setMapReduceUri(String mapReduceUri)
|
|
void |
setUseCache(boolean useCache)
|
|
void |
setWorkerPool(ExecutorService workerPool)
|
Methods inherited from class org.springframework.web.client.support.RestGatewaySupport |
---|
getRestTemplate, setRestTemplate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String RIAK_META_CLASSNAME
protected static final String RIAK_VCLOCK
protected static final Pattern prefix
protected final boolean groovyPresent
protected static SimpleDateFormat httpDate
java.util.Date
from the Last-Modified header.
protected final org.apache.commons.logging.Log log
protected final String RIAK_CLIENT_ID
protected ConversionService conversionService
protected ConcurrentSkipListMap<BucketKeyPair,RiakValue<?>> cache
protected boolean useCache
protected String defaultUri
protected String mapReduceUri
protected List<BucketKeyResolver> bucketKeyResolvers
BucketKeyPair
.
protected QosParameters defaultQosParameters
protected ExecutorService workerPool
ExecutorService
to use for running asynchronous jobs.
protected Class<?> defaultType
protected ClassLoader classLoader
Constructor Detail |
---|
public AbstractRiakTemplate()
public AbstractRiakTemplate(ClientHttpRequestFactory requestFactory)
ClientHttpRequestFactory
.
requestFactory
- Method Detail |
---|
public ConversionService getConversionService()
public void setConversionService(ConversionService conversionService)
conversionService
- public String getDefaultUri()
public void setDefaultUri(String defaultUri)
public String getMapReduceUri()
public void setMapReduceUri(String mapReduceUri)
public boolean isUseCache()
public void setUseCache(boolean useCache)
public QosParameters getDefaultQosParameters()
public void setDefaultQosParameters(QosParameters defaultQosParameters)
public ExecutorService getWorkerPool()
public void setWorkerPool(ExecutorService workerPool)
public void setIgnoreNotFound(boolean b)
public boolean getIgnoreNotFound()
public Class<?> getDefaultType()
public void setDefaultType(Class<?> defaultType)
defaultType
- public void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
public String getHost()
public Integer getPort()
public String getPrefix()
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
protected BucketKeyPair resolveBucketKeyPair(Object key, Object val)
protected MediaType extractMediaType(Object value)
protected RiakMetaData extractMetaData(HttpHeaders headers) throws IOException
IOException
protected <T> RiakValue<T> extractValue(ResponseEntity<?> response, Class<?> origType, Class<T> requiredType) throws IOException
IOException
protected <K,T> T checkCache(K key, Class<T> requiredType)
protected String extractQosParameters(QosParameters qosParams)
qosParams
-
protected HttpHeaders defaultHeaders(Map<String,?> metadata)
protected <B,K> Class<?> getType(B bucket, K key)
protected <B,K> Class<?> getType(B bucket, K key, ClassLoader classLoader)
|
Spring Data Key-Value | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |