View Javadoc

1   /**
2    *
3    * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com>
4    *
5    * ====================================================================
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   * http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   * ====================================================================
18   */
19  package org.jclouds.blobstore;
20  
21  import java.util.Set;
22  
23  import javax.annotation.Nullable;
24  
25  import org.jclouds.blobstore.domain.Blob;
26  import org.jclouds.blobstore.domain.BlobBuilder;
27  import org.jclouds.blobstore.domain.BlobMetadata;
28  import org.jclouds.blobstore.domain.PageSet;
29  import org.jclouds.blobstore.domain.StorageMetadata;
30  import org.jclouds.blobstore.options.CreateContainerOptions;
31  import org.jclouds.blobstore.options.GetOptions;
32  import org.jclouds.blobstore.options.ListContainerOptions;
33  import org.jclouds.blobstore.options.PutOptions;
34  import org.jclouds.domain.Location;
35  
36  import com.google.common.util.concurrent.ListenableFuture;
37  
38  /**
39   * Provides hooks needed to run a blob store asynchronously
40   * 
41   * @see AsyncBlobStore
42   */
43  public interface AsyncBlobStore {
44     /**
45      * @see BlobStore#getContext
46      */
47     BlobStoreContext getContext();
48  
49     /**
50      * @see BlobStore#newBlob
51      */
52     @Deprecated
53     Blob newBlob(String name);
54  
55     /**
56      * @see BlobStore#blobBuilder
57      */
58     BlobBuilder blobBuilder(String name);
59  
60     /**
61      * @see BlobStore#listAssignableLocations
62      */
63     ListenableFuture<Set<? extends Location>> listAssignableLocations();
64  
65     /**
66      * @see BlobStore#list
67      */
68     ListenableFuture<PageSet<? extends StorageMetadata>> list();
69  
70     /**
71      * @see BlobStore#containerExists
72      */
73     ListenableFuture<Boolean> containerExists(String container);
74  
75     /**
76      * @see BlobStore#createContainerInLocation(Location, String)
77      */
78     ListenableFuture<Boolean> createContainerInLocation(@Nullable Location location, String container);
79  
80     /**
81      * @see BlobStore#createContainerInLocation(Location,String,CreateContainerOptions)
82      */
83     ListenableFuture<Boolean> createContainerInLocation(@Nullable Location location, String container,
84              CreateContainerOptions options);
85  
86     /**
87      * @see BlobStore#list(String)
88      */
89     ListenableFuture<PageSet<? extends StorageMetadata>> list(String container);
90  
91     /**
92      * @see BlobStore#list(String, ListContainerOptions)
93      */
94     ListenableFuture<PageSet<? extends StorageMetadata>> list(String container, ListContainerOptions options);
95  
96     /**
97      * @see BlobStore#clearContainer(String)
98      */
99     ListenableFuture<Void> clearContainer(String container);
100 
101    /**
102     * @see BlobStore#clearContainer(String, ListContainerOptions)
103     */
104    ListenableFuture<Void> clearContainer(String container, ListContainerOptions options);
105 
106    /**
107     * @see BlobStore#deleteContainer
108     */
109    ListenableFuture<Void> deleteContainer(String container);
110 
111    /**
112     * @see BlobStore#directoryExists
113     */
114    ListenableFuture<Boolean> directoryExists(String container, String directory);
115 
116    /**
117     * @see BlobStore#createDirectory
118     */
119    ListenableFuture<Void> createDirectory(String container, String directory);
120 
121    /**
122     * @see BlobStore#deleteDirectory
123     */
124    ListenableFuture<Void> deleteDirectory(String containerName, String name);
125 
126    /**
127     * @see BlobStore#blobExists
128     */
129    ListenableFuture<Boolean> blobExists(String container, String name);
130 
131    /**
132     * @see BlobStore#putBlob(String,Blob)
133     */
134    ListenableFuture<String> putBlob(String container, Blob blob);
135 
136    /**
137     * @see BlobStore#putBlob(String,Blob,PutOptions)
138     */
139    ListenableFuture<String> putBlob(String container, Blob blob, PutOptions options);
140 
141    /**
142     * @see BlobStore#blobMetadata
143     */
144    ListenableFuture<BlobMetadata> blobMetadata(String container, String key);
145 
146    /**
147     * @see BlobStore#getBlob(String, String)
148     */
149    ListenableFuture<Blob> getBlob(String container, String key);
150 
151    /**
152     * @see BlobStore#getBlob(String, String, GetOptions)
153     */
154    ListenableFuture<Blob> getBlob(String container, String key, GetOptions options);
155 
156    /**
157     * @see BlobStore#removeBlob
158     */
159    ListenableFuture<Void> removeBlob(String container, String key);
160 
161    /**
162     * @see BlobStore#countBlobs(String)
163     */
164    ListenableFuture<Long> countBlobs(String container);
165 
166    /**
167     * @see BlobStore#countBlobs(String,ListContainerOptions)
168     */
169    ListenableFuture<Long> countBlobs(String container, ListContainerOptions options);
170 
171 }