Class BlobStoreConnection
- java.lang.Object
-
- com.adaptris.core.AdaptrisConnectionImp
-
- com.adaptris.jclouds.common.JcloudsConnection
-
- com.adaptris.jclouds.blobstore.BlobStoreConnection
-
- All Implemented Interfaces:
AdaptrisComponent
,AdaptrisConnection
,ComponentLifecycle
,ComponentLifecycleExtension
,StateManagedComponent
@ComponentProfile(summary="Connect via apache jclouds to a pluggable cloud storage provider", recommended=BlobStoreConnection.class, tag="blob,s3,azure,backblaze,cloud") public class BlobStoreConnection extends com.adaptris.jclouds.common.JcloudsConnection
Interacting with cloud storage via apache jclouds.You will need to also have one of the supported providers in your classpath to be able to use this connection. Use the associated provider in your configuration. Note that
identity
andcredentials
are not mandatory (and could be overriden viaJcloudsConnection.setConfiguration(KeyValuePairSet)
or system properties). If not explicitly configured, then those values are left to the underlying provider to make a choice about what credentials will be used to access cloud storage (for the aws-s3 provider, it will always fail if no identity/credentials are provided as it doesn't use the java AWS SDK to handle authentication).All the providers supported by jclouds are listed on their website. You should use that as the canonical reference. We have tested the blob storage with 3 different providers (the unit tests use the filesystem provider); and the operations have been confirmed to work.
- To access AWS-S3 via jclouds you will need to include the artefact
org.apache.jclouds.provider:aws-s3:XYZ
; whereXYZ
is the appropriate version; and use the provideraws-s3
. This was tested for completeness, using theinterlok-aws-s3
optional component is generally the better option. - To access Backblaze via jclouds you will need to include the artefact
org.apache.jclouds.provider:b2:XYZ
; whereXYZ
is the appropriate version; and use the providerb2
- To access MS Azure blob storage via jclouds you will need to include the artefact
org.apache.jclouds.provider:azureblob:XYZ
; whereXYZ
is the appropriate version; and use the providerazureblob
In the adapter configuration file this class is aliased as jclouds-blobstore-connection which is the preferred alternative to the fully qualified classname when building your configuration.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.AdaptrisConnectionImp
log
-
-
Constructor Summary
Constructors Constructor Description BlobStoreConnection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
closeConnection()
protected org.jclouds.blobstore.BlobStore
getBlobStore(java.lang.String bucket)
protected org.jclouds.blobstore.BlobStoreContext
getBlobStoreContext()
protected void
initConnection()
protected void
startConnection()
protected void
stopConnection()
-
Methods inherited from class com.adaptris.jclouds.common.JcloudsConnection
credentialsBuilder, getConfiguration, getCredentialsBuilder, getProvider, newContextBuilder, overrideConfiguration, prepareConnection, setConfiguration, setCredentialsBuilder, setProvider, withConfiguration, withCredentials, withProvider
-
Methods inherited from class com.adaptris.core.AdaptrisConnectionImp
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
-
-
-
-
Method Detail
-
getBlobStoreContext
protected org.jclouds.blobstore.BlobStoreContext getBlobStoreContext()
-
getBlobStore
protected org.jclouds.blobstore.BlobStore getBlobStore(java.lang.String bucket) throws CoreException
- Throws:
CoreException
-
initConnection
protected void initConnection() throws CoreException
- Specified by:
initConnection
in classAdaptrisConnectionImp
- Throws:
CoreException
-
startConnection
protected void startConnection() throws CoreException
- Specified by:
startConnection
in classAdaptrisConnectionImp
- Throws:
CoreException
-
stopConnection
protected void stopConnection()
- Specified by:
stopConnection
in classAdaptrisConnectionImp
-
closeConnection
protected void closeConnection()
- Specified by:
closeConnection
in classAdaptrisConnectionImp
-
-