Skip to end of metadata
Go to start of metadata

Introduction

The BlobStoreService provides an API to use Blob Stores such as Amazon S3, AzureBlob and GoogleStorage. Blob Stores are generally used to store (large) files. The API is based on the jclouds BlobStore API to get an abstraction on top of the specific Blob Stores. The jclouds API is exposed by an OSGI service that needs to be configured per store provider.

Getting Started

To start using a Blob Store you first need an account for one of the supported providers. For this example we will use Amazon S3. The BlobStoreService uses a Managed Service Factory to create a new service for each configured provider. A provider can be configured using Configuration Admin. In this example we will use a configuration file to provide the provider configuration, but you can use any way supported by you Configuration Admin implementation.

When using Felix Config Admin you can put configuration files in the load directory and will be automatically picked up.

org.amdatu.storage.servicefactory-aws.cfg

The provider value must be one of the provider keys supported by jclouds. 

Provider
transient
filesystem
eucalyptus-partnercloud-s3
synaptic-storage
azureblob
cloudonestorage
cloudfiles-us
cloudfiles-uk
ninefold-storage
aws-s3
googlestorage
scaleup-storage
hosteurope-storage
tiscali-storage

A BlobStoreService will be available now using the provider key as service filter.

For example you could use the Felix Dependency Manager to inject the service.

The BlobStoreService only provides one method: 

BlobStoreContext is a jclouds interface which acts as the starting point of working with a BlobStore. In a normal jclouds application you would need to configure a BlobStoreContext from code. Amdatu provides the integration with Configuration Admin to better align with OSGI.

From here you can use the BlobStoreContext as described in the jclouds documentation. For example you could iterate over all blobs in a folder:

Labels
  • None