package eu.mosaic.cloud.driver;
import java.util.ResourceBundle;
import com.amazonaws.auth.BasicAWSCredentials;
import eu.mosaic.cloud.amazon.AmazonConnection;
/**
* This class is used as a factory for Cloud connections.
*
* @author Adrian Copie
*
*/
public class Connection {
private Connection() {
}
/**
* Factory method (draft)
*
* @return the DriverConnection object
*/
public static DriverConnection getConnection(String storageProvider) {
DriverConnection conn = null;
if (storageProvider.equals("AMAZON_S3")) {
ResourceBundle props = ResourceBundle
.getBundle("eu.mosaic.cloud.amazon.AwsCredentials");
String accessKey = props.getString("accessKey");
String secretKey = props.getString("secretKey");
conn = new AmazonConnection(new BasicAWSCredentials(accessKey,
secretKey));
}
return conn;
}
}