Class ReadPolicyFactoryBean
java.lang.Object
org.springframework.data.aerospike.config.ReadPolicyFactoryBean
- All Implemented Interfaces:
FactoryBean<com.aerospike.client.policy.Policy>
- Direct Known Subclasses:
BatchPolicyFactoryBean,QueryPolicyFactoryBean,ScanPolicyFactoryBean,WritePolicyFactoryBean
public class ReadPolicyFactoryBean
extends Object
implements FactoryBean<com.aerospike.client.policy.Policy>
A
FactoryBean implementation that exposes the setters necessary to configure a read policy via XML.- Author:
- Peter Milne
-
Field Summary
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.aerospike.client.policy.PolicyClass<?> booleanvoidsetMaxRetries(int maxRetries) Configures the maximum number of retries before aborting the current transaction.voidsetSleepBetweenRetries(int sleepBetweenRetries) Configures the sleep between retries if a transaction fails and the timeout was not exceeded.voidsetSocketTimeout(int socketTimeout) Configures the timeout for each transaction attempt of an operation.voidsetTotalTimeout(int totalTimeout) Configures the timeout for an operation.
-
Constructor Details
-
ReadPolicyFactoryBean
public ReadPolicyFactoryBean()Creates a newReadPolicyFactoryBean.
-
-
Method Details
-
setSocketTimeout
public void setSocketTimeout(int socketTimeout) Configures the timeout for each transaction attempt of an operation.- Parameters:
socketTimeout- The socketTimeout configuration value.
-
setTotalTimeout
public void setTotalTimeout(int totalTimeout) Configures the timeout for an operation.- Parameters:
totalTimeout- The totalTimeout configuration value.
-
setMaxRetries
public void setMaxRetries(int maxRetries) Configures the maximum number of retries before aborting the current transaction. A retry is attempted when there is a network error other than timeout. If maxRetries is exceeded, the abort will occur even if the timeout has not yet been exceeded. The default number of retries is 1.- Parameters:
maxRetries- The maxRetries configuration value.
-
setSleepBetweenRetries
public void setSleepBetweenRetries(int sleepBetweenRetries) Configures the sleep between retries if a transaction fails and the timeout was not exceeded. Enter zero to skip sleep. The default sleep between retries is 500 ms.- Parameters:
sleepBetweenRetries- The sleepBetweenRetries configuration value.
-
getObject
- Specified by:
getObjectin interfaceFactoryBean<com.aerospike.client.policy.Policy>- Throws:
Exception
-
isSingleton
public boolean isSingleton()- Specified by:
isSingletonin interfaceFactoryBean<com.aerospike.client.policy.Policy>
-
getObjectType
- Specified by:
getObjectTypein interfaceFactoryBean<com.aerospike.client.policy.Policy>
-