org.springframework.data.simpledb.config.AbstractSimpleDBConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-data-simpledb Show documentation
Show all versions of spring-data-simpledb Show documentation
Provides a POJO centric model as per Spring Data interfaces to interact with Amazon SimpleDB, a non-relational datastore
package org.springframework.data.simpledb.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.simpledb.core.SimpleDb;
import org.springframework.data.simpledb.core.SimpleDbTemplate;
/**
* Base class for Spring Data SimpleDB configuration using JavaConfig.
*
*
* support for useful bean injection
* support for declaring SimpleDB configuration elements
*
*/
@Configuration
public abstract class AbstractSimpleDBConfiguration {
@Bean
public SimpleDbTemplate simpleDBTemplate(){
return new SimpleDbTemplate(simpleDb());
}
public abstract AWSCredentials getAWSCredentials();
/**
* Override this to configure non credential {@link org.springframework.data.simpledb.core.SimpleDb} properties
*/
public void setExtraProperties(SimpleDb simpleDb){
}
@Bean
public SimpleDb simpleDb(){
AWSCredentials credentials = getAWSCredentials();
SimpleDb simpleDb = new SimpleDb(credentials.getAccessID(), credentials.getSecretKey());
setExtraProperties(simpleDb);
return simpleDb;
}
}