Class RegionScopedBlobStoreContext
- java.lang.Object
-
- com.google.common.collect.ForwardingObject
-
- org.jclouds.internal.BaseView
-
- org.jclouds.openstack.swift.v1.blobstore.RegionScopedBlobStoreContext
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,BlobStoreContext
,View
public class RegionScopedBlobStoreContext extends BaseView implements BlobStoreContext
Implementation ofBlobStoreContext
which allows you to employ multiple regions. Example.ctx = contextBuilder.buildView(RegionScopedBlobStoreContext.class); Set<String> regionIds = ctx.getConfiguredRegions(); // isolated to a specific region BlobStore texasBlobStore = ctx.getBlobStore("US-TX"); BlobStore virginiaBlobStore = ctx.getBlobStore("US-VA");
-
-
Constructor Summary
Constructors Constructor Description RegionScopedBlobStoreContext(Context backend, com.google.common.reflect.TypeToken<? extends Context> backendType, com.google.common.base.Supplier<Set<String>> regionIds, com.google.common.base.Supplier<String> implicitRegionId, com.google.common.base.Function<String,BlobStore> blobStore, com.google.common.base.Function<String,BlobRequestSigner> blobRequestSigner, Utils utils, ConsistencyModel consistencyModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkRegionId(String regionId)
void
close()
closes threads and resources related to this connection.boolean
equals(Object obj)
BlobStore
getBlobStore()
BlobStore
getBlobStore(String regionId)
Set<String>
getConfiguredRegions()
ConsistencyModel
getConsistencyModel()
BlobRequestSigner
getSigner()
Generates signed requests for blobs.BlobRequestSigner
getSigner(String regionId)
int
hashCode()
String
toString()
Utils
utils()
-
Methods inherited from class org.jclouds.internal.BaseView
delegate, getBackendType, string, unwrap, unwrap, unwrapApi
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jclouds.View
getBackendType, unwrap, unwrap, unwrapApi
-
-
-
-
Constructor Detail
-
RegionScopedBlobStoreContext
@Inject public RegionScopedBlobStoreContext(Context backend, com.google.common.reflect.TypeToken<? extends Context> backendType, com.google.common.base.Supplier<Set<String>> regionIds, com.google.common.base.Supplier<String> implicitRegionId, com.google.common.base.Function<String,BlobStore> blobStore, com.google.common.base.Function<String,BlobRequestSigner> blobRequestSigner, Utils utils, ConsistencyModel consistencyModel)
-
-
Method Detail
-
getConfiguredRegions
public Set<String> getConfiguredRegions()
- Returns:
- regions supported in this context.
-
getBlobStore
public BlobStore getBlobStore(String regionId)
- Parameters:
regionId
- valid region id fromgetConfiguredRegions()
- Throws:
IllegalArgumentException
- ifregionId
was invalid.
-
getSigner
public BlobRequestSigner getSigner(String regionId)
- Parameters:
regionId
- valid region id fromgetConfiguredRegions()
- Throws:
IllegalArgumentException
- ifregionId
was invalid.
-
checkRegionId
protected void checkRegionId(String regionId)
-
getConsistencyModel
public ConsistencyModel getConsistencyModel()
- Specified by:
getConsistencyModel
in interfaceBlobStoreContext
- Returns:
- best guess at the consistency model used in this BlobStore.
-
getBlobStore
public BlobStore getBlobStore()
- Specified by:
getBlobStore
in interfaceBlobStoreContext
- Returns:
- a portable interface for the BlobStore.
-
getSigner
public BlobRequestSigner getSigner()
Description copied from interface:BlobStoreContext
Generates signed requests for blobs. useful in other tools such as backup utilities.- Specified by:
getSigner
in interfaceBlobStoreContext
-
utils
public Utils utils()
- Specified by:
utils
in interfaceBlobStoreContext
-
close
public void close()
Description copied from interface:BlobStoreContext
closes threads and resources related to this connection.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBlobStoreContext
- Specified by:
close
in interfaceCloseable
-
-