23
23
import com .google .cloud .storage .Storage .BlobGetOption ;
24
24
import com .google .cloud .storage .Storage .BlobSourceOption ;
25
25
import com .google .cloud .storage .Storage .BlobTargetOption ;
26
+ import com .google .cloud .storage .TransportCompatibility .Transport ;
26
27
import com .google .cloud .storage .UnifiedOpts .Opts ;
27
28
import com .google .cloud .storage .spi .v1 .RpcBatch ;
28
29
import com .google .cloud .storage .spi .v1 .StorageRpc ;
53
54
* Blob blob = result.get(); // returns get result or throws StorageException
54
55
* }</pre>
55
56
*/
57
+ @ TransportCompatibility (Transport .HTTP )
56
58
public class StorageBatch {
57
59
58
60
private final RpcBatch batch ;
@@ -86,6 +88,7 @@ StorageOptions getOptions() {
86
88
* {@code false} if the blob was not found, or throws a {@link StorageException} if the operation
87
89
* failed.
88
90
*/
91
+ @ TransportCompatibility (Transport .HTTP )
89
92
public StorageBatchResult <Boolean > delete (
90
93
String bucket , String blob , BlobSourceOption ... options ) {
91
94
return delete (BlobId .of (bucket , blob ), options );
@@ -97,6 +100,7 @@ public StorageBatchResult<Boolean> delete(
97
100
* {@code false} if the blob was not found, or throws a {@link StorageException} if the operation
98
101
* failed.
99
102
*/
103
+ @ TransportCompatibility (Transport .HTTP )
100
104
public StorageBatchResult <Boolean > delete (BlobId blob , BlobSourceOption ... options ) {
101
105
StorageBatchResult <Boolean > result = new StorageBatchResult <>();
102
106
RpcBatch .Callback <Void > callback = createDeleteCallback (result );
@@ -111,6 +115,7 @@ public StorageBatchResult<Boolean> delete(BlobId blob, BlobSourceOption... optio
111
115
* {@link StorageBatchResult#get()} on the return value yields the updated {@link Blob} if
112
116
* successful, or throws a {@link StorageException} if the operation failed.
113
117
*/
118
+ @ TransportCompatibility (Transport .HTTP )
114
119
public StorageBatchResult <Blob > update (BlobInfo blobInfo , BlobTargetOption ... options ) {
115
120
StorageBatchResult <Blob > result = new StorageBatchResult <>();
116
121
RpcBatch .Callback <StorageObject > callback = createUpdateCallback (this .options , result );
@@ -127,6 +132,7 @@ public StorageBatchResult<Blob> update(BlobInfo blobInfo, BlobTargetOption... op
127
132
* {@code null} if no such blob exists, or throws a {@link StorageException} if the operation
128
133
* failed.
129
134
*/
135
+ @ TransportCompatibility (Transport .HTTP )
130
136
public StorageBatchResult <Blob > get (String bucket , String blob , BlobGetOption ... options ) {
131
137
return get (BlobId .of (bucket , blob ), options );
132
138
}
@@ -138,6 +144,7 @@ public StorageBatchResult<Blob> get(String bucket, String blob, BlobGetOption...
138
144
* {@code null} if no such blob exists, or throws a {@link StorageException} if the operation
139
145
* failed.
140
146
*/
147
+ @ TransportCompatibility (Transport .HTTP )
141
148
public StorageBatchResult <Blob > get (BlobId blob , BlobGetOption ... options ) {
142
149
StorageBatchResult <Blob > result = new StorageBatchResult <>();
143
150
RpcBatch .Callback <StorageObject > callback = createGetCallback (this .options , result );
@@ -147,6 +154,7 @@ public StorageBatchResult<Blob> get(BlobId blob, BlobGetOption... options) {
147
154
}
148
155
149
156
/** Submits this batch for processing using a single RPC request. */
157
+ @ TransportCompatibility (Transport .HTTP )
150
158
public void submit () {
151
159
batch .submit ();
152
160
}
0 commit comments