JCLOUDS-40 unasync azureblob; plus fold otherwise unused azure-common into it.

This commit is contained in:
Adrian Cole 2014-10-03 17:35:37 -07:00 committed by Adrian Cole
parent 9b71a9dcb8
commit 4c95a57880
36 changed files with 268 additions and 1041 deletions

View File

@ -1,6 +0,0 @@
#
# The jclouds provider for Microsoft Windows Azure (http://www.microsoft.com/windowsazure/).
#
# TODO: Implementation status.
# TODO: Supported features.
# TODO: Usage example.

View File

@ -1,54 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.jclouds</groupId>
<artifactId>jclouds-project</artifactId>
<version>2.0.0-SNAPSHOT</version>
<relativePath>../../project/pom.xml</relativePath>
</parent>
<groupId>org.apache.jclouds.common</groupId>
<artifactId>azure-common</artifactId>
<name>jclouds Azure Components Core</name>
<description>jclouds Core components to access Azure</description>
<packaging>bundle</packaging>
<properties>
<jclouds.osgi.export>org.jclouds.azure*;version="${project.version}"</jclouds.osgi.export>
<jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.jclouds</groupId>
<artifactId>jclouds-core</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,31 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds.azure.storage.config;
import org.jclouds.json.config.GsonModule.DateAdapter;
import org.jclouds.json.config.GsonModule.Iso8601DateAdapter;
import com.google.inject.AbstractModule;
public class AzureStorageParserModule extends AbstractModule {
@Override
protected void configure() {
bind(DateAdapter.class).to(Iso8601DateAdapter.class);
}
}

View File

@ -1,118 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<!--
For more configuration infromation and examples see the Apache
Log4j website: http://logging.apache.org/log4j/
-->
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">
<!-- A time/date based rolling appender -->
<appender name="WIREFILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="target/test-data/jclouds-wire.log" />
<param name="Append" value="true" />
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<param name="Threshold" value="TRACE" />
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
<!--
The full pattern: Date MS Priority [Category]
(Thread:NDC) Message\n <param name="ConversionPattern"
value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
-->
</layout>
</appender>
<!-- A time/date based rolling appender -->
<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="target/test-data/jclouds.log" />
<param name="Append" value="true" />
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<param name="Threshold" value="TRACE" />
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
<!--
The full pattern: Date MS Priority [Category]
(Thread:NDC) Message\n <param name="ConversionPattern"
value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
-->
</layout>
</appender>
<appender name="ASYNC" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="FILE" />
</appender>
<appender name="ASYNCWIRE" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="WIREFILE" />
</appender>
<!-- A time/date based rolling appender -->
<appender name="BLOBSTOREFILE" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="target/test-data/jclouds-blobstore.log" />
<param name="Append" value="true" />
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd" />
<param name="Threshold" value="TRACE" />
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
<param name="ConversionPattern" value="%d %-5p [%c] (%t) %m%n" />
<!--
The full pattern: Date MS Priority [Category]
(Thread:NDC) Message\n <param name="ConversionPattern"
value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
-->
</layout>
</appender>
<appender name="ASYNCBLOBSTORE" class="org.apache.log4j.AsyncAppender">
<appender-ref ref="BLOBSTOREFILE" />
</appender>
<!-- ================ -->
<!-- Limit categories -->
<!-- ================ -->
<category name="jclouds.blobstore">
<priority value="TRACE" />
<appender-ref ref="ASYNCBLOBSTORE" />
</category>
<category name="org.jclouds">
<priority value="DEBUG" />
<appender-ref ref="ASYNC" />
</category>
<category name="jclouds.headers">
<priority value="DEBUG" />
<appender-ref ref="ASYNCWIRE" />
</category>
<category name="jclouds.wire">
<priority value="DEBUG" />
<appender-ref ref="ASYNCWIRE" />
</category>
<!-- ======================= -->
<!-- Setup the Root category -->
<!-- ======================= -->
<root>
<priority value="WARN" />
</root>
</log4j:configuration>

View File

@ -30,7 +30,6 @@
<packaging>pom</packaging>
<name>jclouds commons project</name>
<modules>
<module>azure</module>
<module>openstack</module>
</modules>
</project>

View File

@ -38,7 +38,7 @@
<test.azureblob.identity>${test.azure.identity}</test.azureblob.identity>
<test.azureblob.credential>${test.azure.credential}</test.azureblob.credential>
<jclouds.osgi.export>org.jclouds.azureblob*;version="${project.version}"</jclouds.osgi.export>
<jclouds.osgi.export>org.jclouds.azureblob*;version="${project.version}",org.jclouds.azure.storage*;version="${project.version}"</jclouds.osgi.export>
<jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import>
</properties>

View File

@ -30,7 +30,7 @@ import com.google.common.collect.Multimap;
* needed):
* <p/>
* <code>
* import static org.jclouds.azure.storage.options.CreateOptions.Builder.*
* import static CreateOptions.Builder.*
* import org.jclouds.azure.storage.queue.AzureQueueClient;
* <p/>
* AzureQueueClient connection = // get connection

View File

@ -23,28 +23,15 @@ import java.net.URI;
import java.util.Properties;
import org.jclouds.azureblob.blobstore.config.AzureBlobStoreContextModule;
import org.jclouds.azureblob.config.AzureBlobRestClientModule;
import org.jclouds.azureblob.config.AzureBlobHttpApiModule;
import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.rest.internal.BaseRestApiMetadata;
import org.jclouds.rest.internal.BaseHttpApiMetadata;
import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.TypeToken;
import com.google.inject.Module;
/**
* Implementation of {@link ApiMetadata} for Microsoft Azure Blob Service API
*/
public class AzureBlobApiMetadata extends BaseRestApiMetadata {
public class AzureBlobApiMetadata extends BaseHttpApiMetadata {
/**
* @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(AzureBlobClient.class)} as
* {@link AzureBlobAsyncClient} interface will be removed in jclouds 1.7.
*/
@Deprecated
public static final TypeToken<org.jclouds.rest.RestContext<AzureBlobClient, AzureBlobAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<AzureBlobClient, AzureBlobAsyncClient>>() {
private static final long serialVersionUID = 1L;
};
private static Builder builder() {
return new Builder();
}
@ -63,15 +50,14 @@ public class AzureBlobApiMetadata extends BaseRestApiMetadata {
}
public static Properties defaultProperties() {
Properties properties = BaseRestApiMetadata.defaultProperties();
Properties properties = BaseHttpApiMetadata.defaultProperties();
properties.setProperty(PROPERTY_USER_METADATA_PREFIX, "x-ms-meta-");
return properties;
}
public static class Builder extends BaseRestApiMetadata.Builder<Builder> {
@SuppressWarnings("deprecation")
public static class Builder extends BaseHttpApiMetadata.Builder<AzureBlobClient, Builder> {
protected Builder() {
super(AzureBlobClient.class, AzureBlobAsyncClient.class);
super(AzureBlobClient.class);
id("azureblob")
.name("Microsoft Azure Blob Service API")
.identityName("Account Name")
@ -81,7 +67,7 @@ public class AzureBlobApiMetadata extends BaseRestApiMetadata {
.documentation(URI.create("http://msdn.microsoft.com/en-us/library/dd135733.aspx"))
.defaultProperties(AzureBlobApiMetadata.defaultProperties())
.view(typeToken(BlobStoreContext.class))
.defaultModules(ImmutableSet.<Class<? extends Module>>of(AzureBlobRestClientModule.class, AzureBlobStoreContextModule.class));
.defaultModules(ImmutableSet.<Class<? extends Module>>of(AzureBlobHttpApiModule.class, AzureBlobStoreContextModule.class));
}
@Override

View File

@ -1,328 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds.azureblob;
import static com.google.common.net.HttpHeaders.EXPECT;
import java.util.List;
import java.util.Map;
import javax.inject.Named;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HEAD;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import org.jclouds.Fallbacks.TrueOnNotFoundOr404;
import org.jclouds.Fallbacks.VoidOnNotFoundOr404;
import org.jclouds.azure.storage.domain.BoundedSet;
import org.jclouds.azure.storage.filters.SharedKeyLiteAuthentication;
import org.jclouds.azure.storage.options.ListOptions;
import org.jclouds.azure.storage.reference.AzureStorageHeaders;
import org.jclouds.azureblob.AzureBlobFallbacks.FalseIfContainerAlreadyExists;
import org.jclouds.azureblob.binders.BindAzureBlobMetadataToRequest;
import org.jclouds.azureblob.binders.BindAzureBlocksToRequest;
import org.jclouds.azureblob.domain.BlobProperties;
import org.jclouds.azureblob.domain.ContainerProperties;
import org.jclouds.azureblob.domain.ListBlobBlocksResponse;
import org.jclouds.azureblob.domain.ListBlobsResponse;
import org.jclouds.azureblob.domain.PublicAccess;
import org.jclouds.azureblob.functions.BlobName;
import org.jclouds.azureblob.functions.ParseBlobFromHeadersAndHttpContent;
import org.jclouds.azureblob.functions.ParseBlobPropertiesFromHeaders;
import org.jclouds.azureblob.functions.ParseContainerPropertiesFromHeaders;
import org.jclouds.azureblob.functions.ParsePublicAccessHeader;
import org.jclouds.azureblob.options.CreateContainerOptions;
import org.jclouds.azureblob.options.ListBlobsOptions;
import org.jclouds.azureblob.predicates.validators.BlockIdValidator;
import org.jclouds.azureblob.predicates.validators.ContainerNameValidator;
import org.jclouds.azureblob.xml.AccountNameEnumerationResultsHandler;
import org.jclouds.azureblob.xml.BlobBlocksResultsHandler;
import org.jclouds.azureblob.xml.ContainerNameEnumerationResultsHandler;
import org.jclouds.blobstore.BlobStoreFallbacks.FalseOnContainerNotFound;
import org.jclouds.blobstore.BlobStoreFallbacks.FalseOnKeyNotFound;
import org.jclouds.blobstore.BlobStoreFallbacks.NullOnContainerNotFound;
import org.jclouds.blobstore.BlobStoreFallbacks.NullOnKeyNotFound;
import org.jclouds.blobstore.binders.BindMapToHeadersWithPrefix;
import org.jclouds.http.functions.ParseETagHeader;
import org.jclouds.http.options.GetOptions;
import org.jclouds.io.Payload;
import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.Headers;
import org.jclouds.rest.annotations.ParamParser;
import org.jclouds.rest.annotations.ParamValidators;
import org.jclouds.rest.annotations.QueryParams;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.ResponseParser;
import org.jclouds.rest.annotations.SkipEncoding;
import org.jclouds.rest.annotations.XMLResponseParser;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.inject.Provides;
/**
* Provides asynchronous access to Azure Blob via their REST API.
* <p/>
* All commands return a ListenableFuture of the result from Azure Blob. Any exceptions incurred
* during processing will be backend in an {@link ExecutionException} as documented in
* {@link ListenableFuture#get()}.
*
* @see <a href="http://msdn.microsoft.com/en-us/library/dd135733.aspx" />
* @see AzureBlobClient
* @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(AzureBlobClient.class)} as
* {@link AzureBlobAsyncClient} interface will be removed in jclouds 1.7.
*/
@Deprecated
@RequestFilters(SharedKeyLiteAuthentication.class)
@Headers(keys = AzureStorageHeaders.VERSION, values = "2012-02-12")
@SkipEncoding({ '/', '$' })
@Path("/")
public interface AzureBlobAsyncClient {
@Provides
org.jclouds.azureblob.domain.AzureBlob newBlob();
/**
* @see AzureBlobClient#listContainers
*/
@Named("ListContainers")
@GET
@XMLResponseParser(AccountNameEnumerationResultsHandler.class)
@QueryParams(keys = "comp", values = "list")
ListenableFuture<? extends BoundedSet<ContainerProperties>> listContainers(ListOptions... listOptions);
/**
* @see AzureBlobClient#createContainer
*/
@Named("CreateContainer")
@PUT
@Path("{container}")
@Fallback(FalseIfContainerAlreadyExists.class)
@QueryParams(keys = "restype", values = "container")
ListenableFuture<Boolean> createContainer(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
CreateContainerOptions... options);
/**
* @see AzureBlobClient#getPublicAccessForContainer
*/
@Named("GetContainerACL")
@HEAD
@Path("{container}")
@QueryParams(keys = { "restype", "comp" }, values = { "container", "acl" })
@ResponseParser(ParsePublicAccessHeader.class)
@Fallback(NullOnContainerNotFound.class)
ListenableFuture<PublicAccess> getPublicAccessForContainer(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container);
/**
* @see AzureBlobClient#getContainerProperties
*/
@Named("GetContainerProperties")
@HEAD
@Path("{container}")
@QueryParams(keys = "restype", values = "container")
@ResponseParser(ParseContainerPropertiesFromHeaders.class)
@Fallback(NullOnContainerNotFound.class)
ListenableFuture<ContainerProperties> getContainerProperties(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container);
/**
* @see AzureBlobClient#containerExists
*/
@Named("GetContainerProperties")
@HEAD
@Path("{container}")
@QueryParams(keys = "restype", values = "container")
@Fallback(FalseOnContainerNotFound.class)
ListenableFuture<Boolean> containerExists(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container);
/**
* @see AzureBlobClient#setResourceMetadata
*/
@Named("SetContainerMetadata")
@PUT
@Path("{container}")
@QueryParams(keys = { "restype", "comp" }, values = { "container", "metadata" })
ListenableFuture<Void> setResourceMetadata(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@BinderParam(BindMapToHeadersWithPrefix.class) Map<String, String> metadata);
/**
* @see AzureBlobClient#deleteContainer
*/
@Named("DeleteContainer")
@DELETE
@Path("{container}")
@Fallback(VoidOnNotFoundOr404.class)
@QueryParams(keys = "restype", values = "container")
ListenableFuture<Void> deleteContainer(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container);
/**
* @see AzureBlobClient#createRootContainer
*/
@Named("CreateContainer")
@PUT
@Path("$root")
@Fallback(FalseIfContainerAlreadyExists.class)
@QueryParams(keys = "restype", values = "container")
ListenableFuture<Boolean> createRootContainer(CreateContainerOptions... options);
/**
* @see AzureBlobClient#deleteRootContainer
*/
@Named("DeleteContainer")
@DELETE
@Path("$root")
@Fallback(TrueOnNotFoundOr404.class)
@QueryParams(keys = "restype", values = "container")
ListenableFuture<Void> deleteRootContainer();
/**
* @see AzureBlobClient#listBlobs(String, ListBlobsOptions[])
*/
@Named("ListBlobs")
@GET
@XMLResponseParser(ContainerNameEnumerationResultsHandler.class)
@Path("{container}")
@QueryParams(keys = { "restype", "comp" }, values = { "container", "list" })
ListenableFuture<ListBlobsResponse> listBlobs(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
ListBlobsOptions... options);
/**
* @see AzureBlobClient#listBlobs(ListBlobsOptions[])
*/
@Named("ListBlobs")
@GET
@XMLResponseParser(ContainerNameEnumerationResultsHandler.class)
@Path("$root")
@QueryParams(keys = { "restype", "comp" }, values = { "container", "list" })
ListenableFuture<ListBlobsResponse> listBlobs(ListBlobsOptions... options);
/**
* @see AzureBlobClient#putBlob
*/
@Named("PutBlob")
@PUT
@Path("{container}/{name}")
@Headers(keys = EXPECT, values = "100-continue")
@ResponseParser(ParseETagHeader.class)
ListenableFuture<String> putBlob(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") @ParamParser(BlobName.class) @BinderParam(BindAzureBlobMetadataToRequest.class) org.jclouds.azureblob.domain.AzureBlob object);
/**
* @see AzureBlobClient#getBlob
*/
@Named("GetBlob")
@GET
@ResponseParser(ParseBlobFromHeadersAndHttpContent.class)
@Fallback(NullOnKeyNotFound.class)
@Path("{container}/{name}")
ListenableFuture<org.jclouds.azureblob.domain.AzureBlob> getBlob(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name, GetOptions... options);
/**
* @see AzureBlobClient#getBlobProperties
*/
@Named("GetBlobProperties")
@HEAD
@ResponseParser(ParseBlobPropertiesFromHeaders.class)
@Fallback(NullOnKeyNotFound.class)
@Path("{container}/{name}")
ListenableFuture<BlobProperties> getBlobProperties(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name);
/**
* @see AzureBlobClient#blobExists
*
*/
@Named("GetBlobProperties")
@HEAD
@Fallback(FalseOnKeyNotFound.class)
@Path("{container}/{name}")
ListenableFuture<Boolean> blobExists(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name);
/**
* @see AzureBlobClient#setBlobMetadata
*/
@Named("SetBlobMetadata")
@PUT
@Path("{container}/{name}")
@QueryParams(keys = { "comp" }, values = { "metadata" })
ListenableFuture<Void> setBlobMetadata(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name, @BinderParam(BindMapToHeadersWithPrefix.class) Map<String, String> metadata);
/**
* @see AzureBlobClient#deleteBlob
*/
@Named("DeleteBlob")
@DELETE
@Fallback(VoidOnNotFoundOr404.class)
@Path("{container}/{name}")
ListenableFuture<Void> deleteBlob(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name);
/**
* @see AzureBlobClient#putBlock
*/
@Named("PutBlock")
@PUT
@Path("{container}/{name}")
@QueryParams(keys = { "comp" }, values = { "block" })
ListenableFuture<Void> putBlock(@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name,
@QueryParam("blockid") @ParamValidators(BlockIdValidator.class) String blockId, Payload part);
/**
* @see AzureBlobClient#putBlockList
*/
@Named("PutBlockList")
@PUT
@Path("{container}/{name}")
@ResponseParser(ParseETagHeader.class)
@QueryParams(keys = { "comp" }, values = { "blocklist" })
ListenableFuture<String> putBlockList(@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name,
@BinderParam(BindAzureBlocksToRequest.class) List<String> blockIdList);
/**
* @see AzureBlobClient#getBlockList
*/
@Named("GetBlockList")
@GET
@Path("{container}/{name}")
@XMLResponseParser(BlobBlocksResultsHandler.class)
@QueryParams(keys = { "comp" }, values = { "blocklist" })
ListenableFuture<ListBlobBlocksResponse> getBlockList(@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name);
}

View File

@ -16,32 +16,75 @@
*/
package org.jclouds.azureblob;
import static com.google.common.net.HttpHeaders.EXPECT;
import static org.jclouds.Fallbacks.TrueOnNotFoundOr404;
import static org.jclouds.Fallbacks.VoidOnNotFoundOr404;
import static org.jclouds.azureblob.AzureBlobFallbacks.FalseIfContainerAlreadyExists;
import static org.jclouds.blobstore.BlobStoreFallbacks.FalseOnContainerNotFound;
import static org.jclouds.blobstore.BlobStoreFallbacks.FalseOnKeyNotFound;
import static org.jclouds.blobstore.BlobStoreFallbacks.NullOnContainerNotFound;
import static org.jclouds.blobstore.BlobStoreFallbacks.NullOnKeyNotFound;
import java.io.Closeable;
import java.util.List;
import java.util.Map;
import javax.inject.Named;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.HEAD;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;
import org.jclouds.azure.storage.domain.BoundedSet;
import org.jclouds.azure.storage.filters.SharedKeyLiteAuthentication;
import org.jclouds.azure.storage.options.ListOptions;
import org.jclouds.azure.storage.reference.AzureStorageHeaders;
import org.jclouds.azureblob.binders.BindAzureBlobMetadataToRequest;
import org.jclouds.azureblob.binders.BindAzureBlocksToRequest;
import org.jclouds.azureblob.domain.AzureBlob;
import org.jclouds.azureblob.domain.BlobProperties;
import org.jclouds.azureblob.domain.ContainerProperties;
import org.jclouds.azureblob.domain.ListBlobBlocksResponse;
import org.jclouds.azureblob.domain.ListBlobsResponse;
import org.jclouds.azureblob.domain.PublicAccess;
import org.jclouds.azureblob.functions.BlobName;
import org.jclouds.azureblob.functions.ParseBlobFromHeadersAndHttpContent;
import org.jclouds.azureblob.functions.ParseBlobPropertiesFromHeaders;
import org.jclouds.azureblob.functions.ParseContainerPropertiesFromHeaders;
import org.jclouds.azureblob.functions.ParsePublicAccessHeader;
import org.jclouds.azureblob.options.CreateContainerOptions;
import org.jclouds.azureblob.options.ListBlobsOptions;
import org.jclouds.azureblob.predicates.validators.BlockIdValidator;
import org.jclouds.azureblob.predicates.validators.ContainerNameValidator;
import org.jclouds.azureblob.xml.AccountNameEnumerationResultsHandler;
import org.jclouds.azureblob.xml.BlobBlocksResultsHandler;
import org.jclouds.azureblob.xml.ContainerNameEnumerationResultsHandler;
import org.jclouds.blobstore.binders.BindMapToHeadersWithPrefix;
import org.jclouds.http.functions.ParseETagHeader;
import org.jclouds.http.options.GetOptions;
import org.jclouds.io.Payload;
import org.jclouds.rest.annotations.BinderParam;
import org.jclouds.rest.annotations.Fallback;
import org.jclouds.rest.annotations.Headers;
import org.jclouds.rest.annotations.ParamParser;
import org.jclouds.rest.annotations.ParamValidators;
import org.jclouds.rest.annotations.QueryParams;
import org.jclouds.rest.annotations.RequestFilters;
import org.jclouds.rest.annotations.ResponseParser;
import org.jclouds.rest.annotations.SkipEncoding;
import org.jclouds.rest.annotations.XMLResponseParser;
import com.google.inject.Provides;
import org.jclouds.io.Payload;
/**
* Provides access to Azure Blob via their REST API.
* <p/>
* All commands return a Future of the result from Azure Blob. Any exceptions incurred during
* processing will be backend in an {@link ExecutionException} as documented in {@link Future#get()}.
*
* @see <a href="http://msdn.microsoft.com/en-us/library/dd135733.aspx" />
*/
public interface AzureBlobClient {
/** Provides access to Azure Blob via their REST API. */
@RequestFilters(SharedKeyLiteAuthentication.class)
@Headers(keys = AzureStorageHeaders.VERSION, values = "{jclouds.api-version}")
@SkipEncoding({ '/', '$' })
@Path("/")
public interface AzureBlobClient extends Closeable {
@Provides
AzureBlob newBlob();
@ -54,8 +97,13 @@ public interface AzureBlobClient {
* controls the number or type of results requested
* @see ListOptions
*/
@Named("ListContainers")
@GET
@XMLResponseParser(AccountNameEnumerationResultsHandler.class)
@QueryParams(keys = "comp", values = "list")
BoundedSet<ContainerProperties> listContainers(ListOptions... listOptions);
/**
* The Create Container operation creates a new container under the specified identity. If the
* container with the same name already exists, the operation fails.
@ -68,18 +116,38 @@ public interface AzureBlobClient {
* @see CreateContainerOptions
*
*/
boolean createContainer(String container, CreateContainerOptions... options);
@Named("CreateContainer")
@PUT
@Path("{container}")
@Fallback(FalseIfContainerAlreadyExists.class)
@QueryParams(keys = "restype", values = "container")
boolean createContainer(@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
CreateContainerOptions... options);
/**
* The Get Container Properties operation returns all user-defined metadata and system properties
* for the specified container. The data returned does not include the container's list of blobs.
*/
ContainerProperties getContainerProperties(String container);
@Named("GetContainerProperties")
@HEAD
@Path("{container}")
@QueryParams(keys = "restype", values = "container")
@ResponseParser(ParseContainerPropertiesFromHeaders.class)
@Fallback(NullOnContainerNotFound.class)
ContainerProperties getContainerProperties(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container);
/**
* Issues a HEAD command to determine if the container exists or not.
*/
boolean containerExists(String container);
@Named("GetContainerProperties")
@HEAD
@Path("{container}")
@QueryParams(keys = "restype", values = "container")
@Fallback(FalseOnContainerNotFound.class)
boolean containerExists(@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container);
/**
* The Set Container Metadata operation sets one or more user-defined name/value pairs for the
@ -93,7 +161,14 @@ public interface AzureBlobClient {
* <p/>
* Calling Set Container Metadata updates the ETag for the container.
*/
void setResourceMetadata(String container, Map<String, String> metadata);
@Named("SetContainerMetadata")
@PUT
@Path("{container}")
@QueryParams(keys = { "restype", "comp" }, values = { "container", "metadata" })
void setResourceMetadata(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@BinderParam(BindMapToHeadersWithPrefix.class) Map<String, String> metadata);
/**
* The Delete Container operation marks the specified container for deletion. The container and
@ -108,7 +183,12 @@ public interface AzureBlobClient {
* 404 (Not Found) while the container is being deleted.
*
*/
void deleteContainer(String container);
@Named("DeleteContainer")
@DELETE
@Path("{container}")
@Fallback(VoidOnNotFoundOr404.class)
@QueryParams(keys = "restype", values = "container")
void deleteContainer(@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container);
/**
* The root container is a default container that may be inferred from a URL requesting a blob
@ -121,15 +201,25 @@ public interface AzureBlobClient {
* @see CreateContainerOptions
*
*/
@Named("CreateContainer")
@PUT
@Path("$root")
@Fallback(FalseIfContainerAlreadyExists.class)
@QueryParams(keys = "restype", values = "container")
boolean createRootContainer(CreateContainerOptions... options);
/**
*
*
* @param container
* @return whether data in the container may be accessed publicly and the level of access
* Returns whether data in the container may be accessed publicly and the level of access
*/
PublicAccess getPublicAccessForContainer(String container);
@Named("GetContainerACL")
@HEAD
@Path("{container}")
@QueryParams(keys = { "restype", "comp" }, values = { "container", "acl" })
@ResponseParser(ParsePublicAccessHeader.class)
@Fallback(NullOnContainerNotFound.class)
PublicAccess getPublicAccessForContainer(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container);
/**
* The Delete Container operation marks the specified container for deletion. The container and
@ -142,9 +232,14 @@ public interface AzureBlobClient {
* operations, including operations on any blobs under the container, will fail with status code
* 404 (Not Found) while the container is being deleted.
*
* @see deleteContainer(String)
* @see createRootContainer(CreateContainerOptions)
* @see #deleteContainer(String)
* @see #createRootContainer(CreateContainerOptions...)
*/
@Named("DeleteContainer")
@DELETE
@Path("$root")
@Fallback(TrueOnNotFoundOr404.class)
@QueryParams(keys = "restype", values = "container")
void deleteRootContainer();
/**
@ -182,8 +277,20 @@ public interface AzureBlobClient {
* <p/>
* Blobs are listed in alphabetical order in the response body.
*/
ListBlobsResponse listBlobs(String container, ListBlobsOptions... options);
@Named("ListBlobs")
@GET
@XMLResponseParser(ContainerNameEnumerationResultsHandler.class)
@Path("{container}")
@QueryParams(keys = { "restype", "comp" }, values = { "container", "list" })
ListBlobsResponse listBlobs(@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
ListBlobsOptions... options);
@Named("ListBlobs")
@GET
@XMLResponseParser(ContainerNameEnumerationResultsHandler.class)
@Path("$root")
@QueryParams(keys = { "restype", "comp" }, values = { "container", "list" })
ListBlobsResponse listBlobs(ListBlobsOptions... options);
/**
@ -201,57 +308,107 @@ public interface AzureBlobClient {
* (Request Payload Too Large). The Blob service also returns additional information about the
* error in the response, including the maximum blob size permitted in bytes.
*/
String putBlob(String container, AzureBlob object);
@Named("PutBlob")
@PUT
@Path("{container}/{name}")
@Headers(keys = EXPECT, values = "100-continue")
@ResponseParser(ParseETagHeader.class)
String putBlob(@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") @ParamParser(BlobName.class) @BinderParam(BindAzureBlobMetadataToRequest.class)
AzureBlob object);
/**
* The Get Blob operation reads or downloads a blob from the system, including its metadata and
* properties.
*/
AzureBlob getBlob(String container, String name, GetOptions... options);
@Named("GetBlob")
@GET
@ResponseParser(ParseBlobFromHeadersAndHttpContent.class)
@Fallback(NullOnKeyNotFound.class)
@Path("{container}/{name}")
AzureBlob getBlob(@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name, GetOptions... options);
/**
* The Put Block operation creates a block blob on Azure which can be later assembled into
* a single, large blob object with the Put Block List operation.
*
* @see <a href="http://msdn.microsoft.com/en-us/library/windowsazure/dd135726.aspx">Put Blob</a>
*/
void putBlock(String container, String name, String blockId, Payload object);
@Named("PutBlock")
@PUT
@Path("{container}/{name}")
@QueryParams(keys = { "comp" }, values = { "block" })
void putBlock(@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name,
@QueryParam("blockid") @ParamValidators(BlockIdValidator.class) String blockId, Payload part);
/**
* The Put Block List assembles a list of blocks previously uploaded with Put Block into a single
* blob. Blocks are either already committed to a blob or uncommitted. The blocks ids passed here
* are searched for first in the uncommitted block list; then committed using the "latest" strategy.
*
* @see <a href="http://msdn.microsoft.com/en-us/library/windowsazure/dd179467.aspx">Put Block List</a>
*/
String putBlockList(String container, String name, List<String> blockIdList);
@Named("PutBlockList")
@PUT
@Path("{container}/{name}")
@ResponseParser(ParseETagHeader.class)
@QueryParams(keys = { "comp" }, values = { "blocklist" })
String putBlockList(@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name,
@BinderParam(BindAzureBlocksToRequest.class) List<String> blockIdList);
@Named("GetBlockList")
@GET
@Path("{container}/{name}")
@XMLResponseParser(BlobBlocksResultsHandler.class)
@QueryParams(keys = { "comp" }, values = { "blocklist" })
ListBlobBlocksResponse getBlockList(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name);
/**
* Get Block ID List for a blob
*
* @see <a href="http://msdn.microsoft.com/en-us/library/windowsazure/dd179400.aspx">Get Block List</a>
*/
ListBlobBlocksResponse getBlockList(String container, String name);
/**
* The Get Blob Properties operation returns all user-defined metadata, standard HTTP properties,
* and system properties for the blob. It does not return the content of the blob.
*/
BlobProperties getBlobProperties(String container, String name);
@Named("GetBlobProperties")
@HEAD
@ResponseParser(ParseBlobPropertiesFromHeaders.class)
@Fallback(NullOnKeyNotFound.class)
@Path("{container}/{name}")
BlobProperties getBlobProperties(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name);
void setBlobMetadata(String container, String name, Map<String, String> metadata);
@Named("SetBlobMetadata")
@PUT
@Path("{container}/{name}")
@QueryParams(keys = { "comp" }, values = { "metadata" })
void setBlobMetadata(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name, @BinderParam(BindMapToHeadersWithPrefix.class) Map<String, String> metadata);
/**
* The Delete Blob operation marks the specified blob for deletion. The blob is later deleted
* during garbage collection.
*/
void deleteBlob(String container, String name);
@Named("DeleteBlob")
@DELETE
@Fallback(VoidOnNotFoundOr404.class)
@Path("{container}/{name}")
void deleteBlob(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name);
/**
* @throws ContainerNotFoundException
* if the container is not present.
* @throws org.jclouds.blobstore.ContainerNotFoundException if the container is not present.
*/
boolean blobExists(String container, String name);
@Named("GetBlobProperties")
@HEAD
@Fallback(FalseOnKeyNotFound.class)
@Path("{container}/{name}")
boolean blobExists(
@PathParam("container") @ParamValidators(ContainerNameValidator.class) String container,
@PathParam("name") String name);
}

View File

@ -1,307 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds.azureblob.blobstore;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.util.concurrent.Futures.transform;
import static org.jclouds.azure.storage.options.ListOptions.Builder.includeMetadata;
import java.util.List;
import java.util.Set;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider;
import javax.inject.Singleton;
import org.jclouds.Constants;
import org.jclouds.azure.storage.domain.BoundedSet;
import org.jclouds.azureblob.AzureBlobAsyncClient;
import org.jclouds.azureblob.blobstore.functions.AzureBlobToBlob;
import org.jclouds.azureblob.blobstore.functions.BlobPropertiesToBlobMetadata;
import org.jclouds.azureblob.blobstore.functions.BlobToAzureBlob;
import org.jclouds.azureblob.blobstore.functions.ContainerToResourceMetadata;
import org.jclouds.azureblob.blobstore.functions.ListBlobsResponseToResourceList;
import org.jclouds.azureblob.blobstore.functions.ListOptionsToListBlobsOptions;
import org.jclouds.azureblob.blobstore.strategy.MultipartUploadStrategy;
import org.jclouds.azureblob.domain.AzureBlob;
import org.jclouds.azureblob.domain.BlobProperties;
import org.jclouds.azureblob.domain.ContainerProperties;
import org.jclouds.azureblob.domain.ListBlobBlocksResponse;
import org.jclouds.azureblob.domain.ListBlobsResponse;
import org.jclouds.azureblob.domain.PublicAccess;
import org.jclouds.azureblob.options.ListBlobsOptions;
import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.blobstore.domain.Blob;
import org.jclouds.blobstore.domain.BlobMetadata;
import org.jclouds.blobstore.domain.PageSet;
import org.jclouds.blobstore.domain.StorageMetadata;
import org.jclouds.blobstore.domain.internal.PageSetImpl;
import org.jclouds.blobstore.functions.BlobToHttpGetOptions;
import org.jclouds.blobstore.internal.BaseAsyncBlobStore;
import org.jclouds.blobstore.options.CreateContainerOptions;
import org.jclouds.blobstore.options.ListContainerOptions;
import org.jclouds.blobstore.options.PutOptions;
import org.jclouds.blobstore.util.BlobUtils;
import org.jclouds.collect.Memoized;
import org.jclouds.domain.Location;
import org.jclouds.http.options.GetOptions;
import com.google.common.base.Function;
import com.google.common.base.Supplier;
import com.google.common.collect.Iterables;
import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListeningExecutorService;
import org.jclouds.io.Payload;
/**
* @deprecated will be removed in jclouds 1.7, as async interfaces are no longer
* supported. Please use {@link AzureBlobStore}
*/
@Deprecated
@Singleton
public class AzureAsyncBlobStore extends BaseAsyncBlobStore {
private final AzureBlobAsyncClient async;
private final ContainerToResourceMetadata container2ResourceMd;
private final ListOptionsToListBlobsOptions blobStore2AzureContainerListOptions;
private final ListBlobsResponseToResourceList azure2BlobStoreResourceList;
private final AzureBlobToBlob azureBlob2Blob;
private final BlobToAzureBlob blob2AzureBlob;
private final BlobPropertiesToBlobMetadata blob2BlobMd;
private final BlobToHttpGetOptions blob2ObjectGetOptions;
private final Provider<MultipartUploadStrategy> multipartUploadStrategy;
@Inject
AzureAsyncBlobStore(BlobStoreContext context, BlobUtils blobUtils,
@Named(Constants.PROPERTY_USER_THREADS) ListeningExecutorService userExecutor, Supplier<Location> defaultLocation,
@Memoized Supplier<Set<? extends Location>> locations, AzureBlobAsyncClient async,
ContainerToResourceMetadata container2ResourceMd,
ListOptionsToListBlobsOptions blobStore2AzureContainerListOptions,
ListBlobsResponseToResourceList azure2BlobStoreResourceList, AzureBlobToBlob azureBlob2Blob,
BlobToAzureBlob blob2AzureBlob, BlobPropertiesToBlobMetadata blob2BlobMd,
BlobToHttpGetOptions blob2ObjectGetOptions,
Provider<MultipartUploadStrategy> multipartUploadStrategy) {
super(context, blobUtils, userExecutor, defaultLocation, locations);
this.async = checkNotNull(async, "async");
this.container2ResourceMd = checkNotNull(container2ResourceMd, "container2ResourceMd");
this.blobStore2AzureContainerListOptions = checkNotNull(blobStore2AzureContainerListOptions,
"blobStore2AzureContainerListOptions");
this.azure2BlobStoreResourceList = checkNotNull(azure2BlobStoreResourceList, "azure2BlobStoreResourceList");
this.azureBlob2Blob = checkNotNull(azureBlob2Blob, "azureBlob2Blob");
this.blob2AzureBlob = checkNotNull(blob2AzureBlob, "blob2AzureBlob");
this.blob2BlobMd = checkNotNull(blob2BlobMd, "blob2BlobMd");
this.blob2ObjectGetOptions = checkNotNull(blob2ObjectGetOptions, "blob2ObjectGetOptions");
this.multipartUploadStrategy = checkNotNull(multipartUploadStrategy, "multipartUploadStrategy");
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#listContainers} with the
* {@link org.jclouds.azure.storage.options.ListOptions#includeMetadata} option.
*/
@Override
public ListenableFuture<org.jclouds.blobstore.domain.PageSet<? extends StorageMetadata>> list() {
return transform(
async.listContainers(includeMetadata()),
new Function<BoundedSet<ContainerProperties>, org.jclouds.blobstore.domain.PageSet<? extends StorageMetadata>>() {
public org.jclouds.blobstore.domain.PageSet<? extends StorageMetadata> apply(
BoundedSet<ContainerProperties> from) {
return new PageSetImpl<StorageMetadata>(Iterables.transform(from, container2ResourceMd),
from.getNextMarker());
}
}, userExecutor);
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#containerExists}
*
* @param container
* container name
*/
@Override
public ListenableFuture<Boolean> containerExists(String container) {
return async.containerExists(container);
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#createContainer}
*
* @param location
* ignored
* @param container
* container name
*/
@Override
public ListenableFuture<Boolean> createContainerInLocation(Location location, String container) {
return async.createContainer(container);
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#listBucket}
*
* @param container
* container name
*/
@Override
public ListenableFuture<PageSet<? extends StorageMetadata>> list(String container, ListContainerOptions options) {
ListBlobsOptions azureOptions = blobStore2AzureContainerListOptions.apply(options);
ListenableFuture<ListBlobsResponse> returnVal = async.listBlobs(container, azureOptions.includeMetadata());
return transform(returnVal, azure2BlobStoreResourceList, userExecutor);
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#deleteContainer}
*
* @param container
* container name
*/
@Override
public ListenableFuture<Void> deleteContainer(final String container) {
return async.deleteContainer(container);
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#getBlob}
*
* @param container
* container name
* @param key
* blob key
*/
@Override
public ListenableFuture<Blob> getBlob(String container, String key, org.jclouds.blobstore.options.GetOptions options) {
GetOptions azureOptions = blob2ObjectGetOptions.apply(options);
ListenableFuture<AzureBlob> returnVal = async.getBlob(container, key, azureOptions);
return transform(returnVal, azureBlob2Blob, userExecutor);
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#putBlob}
*
* @param container
* container name
* @param blob
* blob
*/
@Override
public ListenableFuture<String> putBlob(String container, Blob blob) {
return async.putBlob(container, blob2AzureBlob.apply(blob));
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#deleteObject}
*
* @param container
* container name
* @param key
* blob key
*/
@Override
public ListenableFuture<Void> removeBlob(String container, String key) {
return async.deleteBlob(container, key);
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#blobExists}
*
* @param container
* bucket name
* @param credential
* object key
*/
@Override
public ListenableFuture<Boolean> blobExists(String container, String name) {
return async.blobExists(container, name);
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#putBlock(String, String, String, Payload)}
* @param container
* @param name
* @param blockId
* @param object
*/
public ListenableFuture<Void> putBlock(String container, String name, String blockId, Payload object) {
return async.putBlock(container, name, blockId, object);
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#putBlockList(String, String, java.util.List)}
* @param container
* @param name
* @param blockIdList
*/
public ListenableFuture<String> putBlockList(String container, String name, List<String> blockIdList) {
return async.putBlockList(container, name, blockIdList);
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#getBlockList(String, String)}
* @param container
* @param name
*/
public ListenableFuture<ListBlobBlocksResponse> getBlockList(String container, String name) {
return async.getBlockList(container, name);
}
/**
* This implementation invokes {@link AzureBlobAsyncClient#getBlobProperties}
*
* @param container
* container name
* @param key
* blob key
*/
@Override
public ListenableFuture<BlobMetadata> blobMetadata(String container, String key) {
return transform(async.getBlobProperties(container, key), new Function<BlobProperties, BlobMetadata>() {
public BlobMetadata apply(BlobProperties from) {
return blob2BlobMd.apply(from);
}
}, userExecutor);
}
@Override
protected boolean deleteAndVerifyContainerGone(String container) {
// Azure deleteContainer supports deleting empty containers so emulate
// deleteIfEmpty by listing.
if (!Futures.getUnchecked(list(container)).isEmpty()) {
return false;
}
Futures.getUnchecked(async.deleteContainer(container));
return true;
}
@Override
public ListenableFuture<String> putBlob(String container, Blob blob, PutOptions options) {
if (options.isMultipart()) {
throw new UnsupportedOperationException("Multipart upload not supported in AzureAsyncBlobStore");
}
return putBlob(container, blob);
}
@Override
public ListenableFuture<Boolean> createContainerInLocation(Location location, String container,
CreateContainerOptions options) {
org.jclouds.azureblob.options.CreateContainerOptions createContainerOptions = new org.jclouds.azureblob.options.CreateContainerOptions();
if (options.isPublicRead())
createContainerOptions.withPublicAccess(PublicAccess.CONTAINER);
return async.createContainer(container, createContainerOptions);
}
}

View File

@ -23,7 +23,7 @@ import static org.jclouds.reflect.Reflection2.method;
import javax.inject.Inject;
import javax.inject.Singleton;
import org.jclouds.azureblob.AzureBlobAsyncClient;
import org.jclouds.azureblob.AzureBlobClient;
import org.jclouds.azureblob.blobstore.functions.BlobToAzureBlob;
import org.jclouds.azureblob.domain.AzureBlob;
import org.jclouds.blobstore.BlobRequestSigner;
@ -53,9 +53,9 @@ public class AzureBlobRequestSigner implements BlobRequestSigner {
this.processor = checkNotNull(processor, "processor");
this.blobToBlob = checkNotNull(blobToBlob, "blobToBlob");
this.blob2HttpGetOptions = checkNotNull(blob2HttpGetOptions, "blob2HttpGetOptions");
this.getMethod = method(AzureBlobAsyncClient.class, "getBlob", String.class, String.class, GetOptions[].class);
this.deleteMethod = method(AzureBlobAsyncClient.class, "deleteBlob", String.class, String.class);
this.createMethod = method(AzureBlobAsyncClient.class, "putBlob", String.class, AzureBlob.class);
this.getMethod = method(AzureBlobClient.class, "getBlob", String.class, String.class, GetOptions[].class);
this.deleteMethod = method(AzureBlobClient.class, "deleteBlob", String.class, String.class);
this.createMethod = method(AzureBlobClient.class, "putBlob", String.class, AzureBlob.class);
}
@Override

View File

@ -21,7 +21,6 @@ import java.util.concurrent.TimeUnit;
import javax.inject.Singleton;
import org.jclouds.azureblob.AzureBlobClient;
import org.jclouds.azureblob.blobstore.AzureAsyncBlobStore;
import org.jclouds.azureblob.blobstore.AzureBlobRequestSigner;
import org.jclouds.azureblob.blobstore.AzureBlobStore;
import org.jclouds.azureblob.domain.PublicAccess;
@ -29,6 +28,7 @@ import org.jclouds.blobstore.AsyncBlobStore;
import org.jclouds.blobstore.BlobRequestSigner;
import org.jclouds.blobstore.BlobStore;
import org.jclouds.blobstore.attr.ConsistencyModel;
import org.jclouds.blobstore.internal.SubmissionAsyncBlobStore;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
@ -37,15 +37,12 @@ import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.Scopes;
/**
* Configures the {@link AzureBlobStoreContext}; requires {@link AzureAsyncBlobStore} bound.
*/
public class AzureBlobStoreContextModule extends AbstractModule {
@Override
protected void configure() {
bind(ConsistencyModel.class).toInstance(ConsistencyModel.STRICT);
bind(AsyncBlobStore.class).to(AzureAsyncBlobStore.class).in(Scopes.SINGLETON);
bind(AsyncBlobStore.class).to(SubmissionAsyncBlobStore.class).in(Scopes.SINGLETON);
bind(BlobStore.class).to(AzureBlobStore.class).in(Scopes.SINGLETON);
bind(BlobRequestSigner.class).to(AzureBlobRequestSigner.class);
}

View File

@ -14,17 +14,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds.azure.storage.config;
package org.jclouds.azureblob.config;
import static org.jclouds.Constants.PROPERTY_SESSION_INTERVAL;
import static org.jclouds.json.config.GsonModule.DateAdapter;
import static org.jclouds.json.config.GsonModule.Iso8601DateAdapter;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import javax.inject.Named;
import org.jclouds.azure.storage.handlers.AzureStorageClientErrorRetryHandler;
import org.jclouds.azure.storage.handlers.ParseAzureStorageErrorFromXmlContent;
import org.jclouds.azureblob.AzureBlobClient;
import org.jclouds.azureblob.handlers.ParseAzureBlobErrorFromXmlContent;
import org.jclouds.date.DateService;
import org.jclouds.date.TimeStamp;
import org.jclouds.http.HttpErrorHandler;
@ -32,29 +34,24 @@ import org.jclouds.http.HttpRetryHandler;
import org.jclouds.http.annotation.ClientError;
import org.jclouds.http.annotation.Redirection;
import org.jclouds.http.annotation.ServerError;
import org.jclouds.rest.ConfiguresRestClient;
import org.jclouds.rest.config.RestClientModule;
import org.jclouds.rest.ConfiguresHttpApi;
import org.jclouds.rest.config.HttpApiModule;
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.reflect.TypeToken;
import com.google.inject.Provides;
/**
* Configures the AzureStorage connection, including logging and http transport.
* Configures the Azure Blob Service connection, including logging and http transport.
*/
@ConfiguresRestClient
public class AzureStorageRestClientModule<S, A> extends RestClientModule<S, A> {
protected AzureStorageRestClientModule() {
@ConfiguresHttpApi
public class AzureBlobHttpApiModule extends HttpApiModule<AzureBlobClient> {
}
public AzureStorageRestClientModule(Map<Class<?>, Class<?>> delegate) {
super(delegate);
}
public AzureStorageRestClientModule(TypeToken<S> syncClientType, TypeToken<A> asyncClientType) {
super(syncClientType, asyncClientType);
@Override
protected void configure() {
install(new AzureBlobModule());
bind(DateAdapter.class).to(Iso8601DateAdapter.class);
super.configure();
}
@Provides
@ -77,22 +74,15 @@ public class AzureStorageRestClientModule<S, A> extends RestClientModule<S, A> {
}, seconds, TimeUnit.SECONDS);
}
@Override
protected void bindErrorHandlers() {
bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ParseAzureStorageErrorFromXmlContent.class);
bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ParseAzureStorageErrorFromXmlContent.class);
bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ParseAzureStorageErrorFromXmlContent.class);
}
@Override
protected void bindRetryHandlers() {
bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(AzureStorageClientErrorRetryHandler.class);
}
@Override
protected void configure() {
install(new AzureStorageParserModule());
super.configure();
protected void bindErrorHandlers() {
bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ParseAzureBlobErrorFromXmlContent.class);
bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ParseAzureBlobErrorFromXmlContent.class);
bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ParseAzureBlobErrorFromXmlContent.class);
}
}

View File

@ -1,48 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jclouds.azureblob.config;
import org.jclouds.azure.storage.config.AzureStorageRestClientModule;
import org.jclouds.azureblob.AzureBlobAsyncClient;
import org.jclouds.azureblob.AzureBlobClient;
import org.jclouds.azureblob.handlers.ParseAzureBlobErrorFromXmlContent;
import org.jclouds.http.HttpErrorHandler;
import org.jclouds.http.annotation.ClientError;
import org.jclouds.http.annotation.Redirection;
import org.jclouds.http.annotation.ServerError;
import org.jclouds.rest.ConfiguresRestClient;
/**
* Configures the Azure Blob Service connection, including logging and http transport.
*/
@ConfiguresRestClient
public class AzureBlobRestClientModule extends AzureStorageRestClientModule<AzureBlobClient, AzureBlobAsyncClient> {
@Override
protected void configure() {
install(new AzureBlobModule());
super.configure();
}
@Override
protected void bindErrorHandlers() {
bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(ParseAzureBlobErrorFromXmlContent.class);
bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(ParseAzureBlobErrorFromXmlContent.class);
bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(ParseAzureBlobErrorFromXmlContent.class);
}
}

View File

@ -30,7 +30,6 @@ import java.security.SecureRandom;
import java.util.Arrays;
import java.util.Set;
import com.google.common.io.BaseEncoding;
import org.jclouds.azure.storage.AzureStorageResponseException;
import org.jclouds.azure.storage.domain.BoundedSet;
import org.jclouds.azure.storage.options.ListOptions;
@ -55,10 +54,8 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Iterables;
import com.google.common.hash.Hashing;
import com.google.common.io.BaseEncoding;
/**
* Tests behavior of {@code AzureBlobClient}
*/
@Test(groups = "live", singleThreaded = true)
public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest {
public AzureBlobClientLiveTest() {
@ -66,7 +63,7 @@ public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest {
}
public AzureBlobClient getApi() {
return view.unwrap(AzureBlobApiMetadata.CONTEXT_TOKEN).getApi();
return view.unwrapApi(AzureBlobClient.class);
}
@Test
@ -100,8 +97,8 @@ public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest {
long containerCount = response.size();
assertTrue(containerCount >= 1);
ListBlobsResponse list = getApi().listBlobs(privateContainer);
assertEquals(list.getUrl(), URI.create(String.format("https://%s.blob.core.windows.net/%s", view.unwrap(
AzureBlobApiMetadata.CONTEXT_TOKEN).getIdentity(), privateContainer)));
assertEquals(list.getUrl(), URI.create(String.format("https://%s.blob.core.windows.net/%s",
view.unwrap().getIdentity(), privateContainer)));
// TODO .. check to see the container actually exists
}
@ -156,8 +153,8 @@ public class AzureBlobClientLiveTest extends BaseBlobStoreIntegrationTest {
}
}
ListBlobsResponse list = getApi().listBlobs();
assertEquals(list.getUrl(), URI.create(String.format("https://%s.blob.core.windows.net/$root", view.unwrap(
AzureBlobApiMetadata.CONTEXT_TOKEN).getIdentity())));
assertEquals(list.getUrl(), URI.create(String.format("https://%s.blob.core.windows.net/$root",
view.unwrap().getIdentity())));
}
@Test

View File

@ -52,15 +52,12 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMultimap;
import com.google.common.reflect.Invokable;
/**
* Tests behavior of {@code AzureBlobAsyncClient}
*/
// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "AzureBlobAsyncClientTest")
public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsyncClient> {
@Test(groups = "unit", testName = "AzureBlobClientTest")
public class AzureBlobClientTest extends BaseAsyncClientTest<AzureBlobClient> {
public void testListContainers() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "listContainers", ListOptions[].class);
Invokable<?, ?> method = method(AzureBlobClient.class, "listContainers", ListOptions[].class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());
assertRequestLineEquals(request, "GET https://identity.blob.core.windows.net/?comp=list HTTP/1.1");
@ -74,7 +71,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testListContainersOptions() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "listContainers", ListOptions[].class);
Invokable<?, ?> method = method(AzureBlobClient.class, "listContainers", ListOptions[].class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of(maxResults(1).marker("marker").prefix("prefix")));
assertRequestLineEquals(request,
@ -88,7 +85,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testCreateContainer() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "createContainer", String.class,
Invokable<?, ?> method = method(AzureBlobClient.class, "createContainer", String.class,
CreateContainerOptions[].class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("container"));
@ -103,7 +100,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testDeleteContainer() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "deleteContainer", String.class);
Invokable<?, ?> method = method(AzureBlobClient.class, "deleteContainer", String.class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("container"));
assertRequestLineEquals(request,
@ -117,7 +114,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testCreateContainerOptions() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "createContainer", String.class,
Invokable<?, ?> method = method(AzureBlobClient.class, "createContainer", String.class,
CreateContainerOptions[].class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("container", withPublicAccess(PublicAccess.BLOB)
.withMetadata(ImmutableMultimap.of("foo", "bar"))));
@ -136,7 +133,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testCreateRootContainer() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "createRootContainer", CreateContainerOptions[].class);
Invokable<?, ?> method = method(AzureBlobClient.class, "createRootContainer", CreateContainerOptions[].class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());
@ -150,7 +147,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testDeleteRootContainer() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "deleteRootContainer");
Invokable<?, ?> method = method(AzureBlobClient.class, "deleteRootContainer");
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());
assertRequestLineEquals(request, "DELETE https://identity.blob.core.windows.net/$root?restype=container HTTP/1.1");
@ -163,7 +160,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testCreateRootContainerOptions() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "createRootContainer", CreateContainerOptions[].class);
Invokable<?, ?> method = method(AzureBlobClient.class, "createRootContainer", CreateContainerOptions[].class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of(withPublicAccess(PublicAccess.BLOB).withMetadata(
ImmutableMultimap.of("foo", "bar"))));
@ -180,7 +177,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testListBlobs() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "listBlobs", String.class, ListBlobsOptions[].class);
Invokable<?, ?> method = method(AzureBlobClient.class, "listBlobs", String.class, ListBlobsOptions[].class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("container"));
assertRequestLineEquals(request,
@ -194,7 +191,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testListRootBlobs() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "listBlobs", ListBlobsOptions[].class);
Invokable<?, ?> method = method(AzureBlobClient.class, "listBlobs", ListBlobsOptions[].class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.of());
assertRequestLineEquals(request,
@ -208,7 +205,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testContainerProperties() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "getContainerProperties", String.class);
Invokable<?, ?> method = method(AzureBlobClient.class, "getContainerProperties", String.class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("container"));
assertRequestLineEquals(request,
@ -222,7 +219,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testGetPublicAccessForContainer() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "getPublicAccessForContainer", String.class);
Invokable<?, ?> method = method(AzureBlobClient.class, "getPublicAccessForContainer", String.class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("container"));
assertRequestLineEquals(request,
@ -236,7 +233,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testSetResourceMetadata() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "setResourceMetadata", String.class, Map.class);
Invokable<?, ?> method = method(AzureBlobClient.class, "setResourceMetadata", String.class, Map.class);
GeneratedHttpRequest request = processor.createRequest(method,
ImmutableList.<Object> of("container", ImmutableMap.of("key", "value")));
@ -253,7 +250,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testGetBlob() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "getBlob", String.class, String.class, GetOptions[].class);
Invokable<?, ?> method = method(AzureBlobClient.class, "getBlob", String.class, String.class, GetOptions[].class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("container", "blob"));
assertRequestLineEquals(request, "GET https://identity.blob.core.windows.net/container/blob HTTP/1.1");
@ -266,7 +263,7 @@ public class AzureBlobAsyncClientTest extends BaseAsyncClientTest<AzureBlobAsync
}
public void testSetBlobMetadata() throws SecurityException, NoSuchMethodException, IOException {
Invokable<?, ?> method = method(AzureBlobAsyncClient.class, "setBlobMetadata", String.class, String.class, Map.class);
Invokable<?, ?> method = method(AzureBlobClient.class, "setBlobMetadata", String.class, String.class, Map.class);
GeneratedHttpRequest request = processor.createRequest(method, ImmutableList.<Object> of("container", "blob", ImmutableMap.of("key", "value")));
assertRequestLineEquals(request,

View File

@ -20,7 +20,7 @@ import static org.testng.Assert.assertEquals;
import java.io.File;
import org.jclouds.azureblob.AzureBlobAsyncClient;
import org.jclouds.azureblob.AzureBlobClient;
import org.jclouds.azureblob.AzureBlobProviderMetadata;
import org.jclouds.azureblob.domain.AzureBlob;
import org.jclouds.http.HttpRequest;
@ -31,12 +31,8 @@ import org.testng.annotations.Test;
import com.google.common.collect.ImmutableMap;
/**
* Tests behavior of {@code BindAzureBlobMetadataToRequest}
*/
// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "BindAzureBlobMetadataToRequestTest")
public class BindAzureBlobMetadataToRequestTest extends BaseAsyncClientTest<AzureBlobAsyncClient> {
public class BindAzureBlobMetadataToRequestTest extends BaseAsyncClientTest<AzureBlobClient> {
@Test
public void testPassWithMinimumDetailsAndPayload64MB() {

View File

@ -21,15 +21,15 @@ import static org.testng.Assert.assertEquals;
import java.io.IOException;
import java.util.Date;
import org.jclouds.azureblob.AzureBlobAsyncClient;
import org.jclouds.azureblob.AzureBlobClient;
import org.jclouds.azureblob.AzureBlobProviderMetadata;
import org.jclouds.azureblob.config.AzureBlobRestClientModule;
import org.jclouds.azureblob.config.AzureBlobHttpApiModule;
import org.jclouds.blobstore.BlobRequestSigner;
import org.jclouds.blobstore.domain.Blob;
import org.jclouds.blobstore.domain.Blob.Factory;
import org.jclouds.date.TimeStamp;
import org.jclouds.http.HttpRequest;
import org.jclouds.rest.ConfiguresRestClient;
import org.jclouds.rest.ConfiguresHttpApi;
import org.jclouds.rest.internal.BaseAsyncClientTest;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
@ -43,7 +43,7 @@ import com.google.inject.Module;
*/
// NOTE:without testName, this will not call @Before* and fail w/NPE during surefire
@Test(groups = "unit", testName = "AzureBlobRequestSignerTest")
public class AzureBlobRequestSignerTest extends BaseAsyncClientTest<AzureBlobAsyncClient> {
public class AzureBlobRequestSignerTest extends BaseAsyncClientTest<AzureBlobClient> {
public AzureBlobRequestSignerTest() {
// this is base64 decoded in the signer;
@ -122,11 +122,11 @@ public class AzureBlobRequestSignerTest extends BaseAsyncClientTest<AzureBlobAsy
@Override
protected Module createModule() {
return new TestAzureBlobRestClientModule();
return new TestAzureBlobHttpApiModule();
}
@ConfiguresRestClient
private static final class TestAzureBlobRestClientModule extends AzureBlobRestClientModule {
@ConfiguresHttpApi
private static final class TestAzureBlobHttpApiModule extends AzureBlobHttpApiModule {
@Override
protected void configure() {
super.configure();