mirror of https://github.com/apache/jclouds.git
Issue 897: moved clojure off Factory -> Builder
This commit is contained in:
parent
2c4f9c23d4
commit
c56c2d2f72
|
@ -46,7 +46,7 @@ See http://code.google.com/p/jclouds for details."
|
|||
java.util.Properties
|
||||
[org.jclouds.blobstore
|
||||
AsyncBlobStore domain.BlobBuilder BlobStore BlobStoreContext
|
||||
BlobStoreContextFactory domain.BlobMetadata domain.StorageMetadata
|
||||
BlobStoreContextBuilder domain.BlobMetadata domain.StorageMetadata
|
||||
domain.Blob domain.internal.BlobBuilderImpl options.PutOptions
|
||||
options.PutOptions$Builder
|
||||
options.CreateContainerOptions options.ListContainerOptions]
|
||||
|
@ -112,13 +112,12 @@ Options can also be specified for extension modules
|
|||
(let [module-keys (set (keys module-lookup))
|
||||
ext-modules (filter #(module-keys %) options)
|
||||
opts (apply hash-map (filter #(not (module-keys %)) options))]
|
||||
(let [context (.. (BlobStoreContextFactory.)
|
||||
(createContext
|
||||
provider provider-identity provider-credential
|
||||
(apply modules
|
||||
(concat ext-modules (opts :extensions)))
|
||||
(reduce #(do (.put %1 (name (first %2)) (second %2)) %1)
|
||||
(Properties.) (dissoc opts :extensions))))]
|
||||
(let [context (.. (BlobStoreContextBuilder/newBuilder provider)
|
||||
(credentials provider-identity provider-credential)
|
||||
(modules (apply modules (concat ext-modules (opts :extensions))))
|
||||
(overrides (reduce #(do (.put %1 (name (first %2)) (second %2)) %1)
|
||||
(Properties.) (dissoc opts :extensions)))
|
||||
(build))]
|
||||
(if (some #(= :async %) options)
|
||||
(.getAsyncBlobStore context)
|
||||
(.getBlobStore context)))))
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
You can inquire about which providers are loaded via the following:
|
||||
(seq (org.jclouds.providers.Providers/allCompute))
|
||||
(seq (org.jclouds.apis.Apis/allCompute))
|
||||
|
||||
Here's an example of getting some compute configuration from rackspace:
|
||||
|
||||
|
@ -65,7 +66,7 @@ Here's an example of creating and running a small linux node in the group webser
|
|||
java.util.Properties
|
||||
[org.jclouds.domain Location]
|
||||
[org.jclouds.compute
|
||||
ComputeService ComputeServiceContext ComputeServiceContextFactory]
|
||||
ComputeService ComputeServiceContext ComputeServiceContextBuilder]
|
||||
[org.jclouds.compute.domain
|
||||
Template TemplateBuilder ComputeMetadata NodeMetadata Hardware
|
||||
OsFamily Image]
|
||||
|
@ -83,12 +84,12 @@ Here's an example of creating and running a small linux node in the group webser
|
|||
(let [module-keys (set (keys module-lookup))
|
||||
ext-modules (filter #(module-keys %) options)
|
||||
opts (apply hash-map (filter #(not (module-keys %)) options))]
|
||||
(.. (ComputeServiceContextFactory.)
|
||||
(createContext
|
||||
provider provider-identity provider-credential
|
||||
(apply modules (concat ext-modules (opts :extensions)))
|
||||
(reduce #(do (.put %1 (name (first %2)) (second %2)) %1)
|
||||
(.. (ComputeServiceContextBuilder/newBuilder provider)
|
||||
(credentials provider-identity provider-credential)
|
||||
(modules (apply modules (concat ext-modules (opts :extensions))))
|
||||
(overrides (reduce #(do (.put %1 (name (first %2)) (second %2)) %1)
|
||||
(Properties.) (dissoc opts :extensions)))
|
||||
(build)
|
||||
(getComputeService))))
|
||||
([#^ComputeServiceContext compute-context]
|
||||
(.getComputeService compute-context)))
|
||||
|
|
Loading…
Reference in New Issue