org.dasein.cloud.azure
Class AzureStorageMethod

java.lang.Object
  extended by org.dasein.cloud.azure.AzureStorageMethod

public class AzureStorageMethod
extends Object

Handles connectivity to Microsoft Azure Storage services.

Since:
2012.07.1
Version:
2013.04.1
Author:
George Reese (george.reese@imaginary.com), Qunying Huang (qunying.huang@enstratus.com), Danielle Mayne (danielle.mayne@enstratius.com)

Field Summary
static String Storage_OPERATION_DELETE
           
static String Storage_OPERATION_GET
           
static String Storage_OPERATION_PUT
           
static String VERSION
           
 
Constructor Summary
AzureStorageMethod(Azure azure)
           
 
Method Summary
 String buildUrl(String resource, Map<String,String> queries)
           
static String convertDomToString(Document doc)
          Convert a xml document to string
static Document createDoc()
           
 Document getAsDoc(String httpVerb, String resource, Map<String,String> queries, String body, Map<String,String> headerMap, boolean authorization)
           
 InputStream getAsStream(String strMethod, String resource, Map<String,String> queries, String body, Map<String,String> headerMap, boolean authorization)
           
 String getBlobProperty(String strMethod, String resource, Map<String,String> queries, String body, Map<String,String> headerMap, boolean authorization, String propertyName)
           
protected  org.apache.http.client.HttpClient getClient()
           
protected  org.apache.http.client.methods.HttpRequestBase getMethod(String httpMethod, String endpoint, Map<String,String> queryParams, Map<String,String> headers, boolean authorization)
           
 void invoke(String strMethod, String resource, Map<String,String> queries, String body, Map<String,String> headerMap, boolean authorization)
           
 Document parseResponse(InputStream responseBodyAsStream, boolean withWireLogging)
           
 Document parseResponse(String responseBody, boolean withWireLogging)
           
 void putWithBytes(String strMethod, String resource, Map<String,String> queries, byte[] body, Map<String,String> headerMap, boolean authorization)
           
 void putWithFile(String strMethod, String resource, Map<String,String> queries, File file, Map<String,String> headerMap, boolean authorization)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION

public static final String VERSION
See Also:
Constant Field Values

Storage_OPERATION_DELETE

public static final String Storage_OPERATION_DELETE
See Also:
Constant Field Values

Storage_OPERATION_PUT

public static final String Storage_OPERATION_PUT
See Also:
Constant Field Values

Storage_OPERATION_GET

public static final String Storage_OPERATION_GET
See Also:
Constant Field Values
Constructor Detail

AzureStorageMethod

public AzureStorageMethod(Azure azure)
                   throws AzureConfigException
Throws:
AzureConfigException
Method Detail

createDoc

public static Document createDoc()
                          throws InternalException
Throws:
InternalException

convertDomToString

public static String convertDomToString(Document doc)
                                 throws CloudException,
                                        InternalException
Convert a xml document to string

Throws:
CloudException
InternalException

getAsDoc

public Document getAsDoc(@Nonnull
                         String httpVerb,
                         @Nonnull
                         String resource,
                         @Nullable
                         Map<String,String> queries,
                         @Nullable
                         String body,
                         @Nullable
                         Map<String,String> headerMap,
                         boolean authorization)
                  throws CloudException,
                         InternalException
Throws:
CloudException
InternalException

getAsStream

@Nullable
public InputStream getAsStream(@Nonnull
                                        String strMethod,
                                        @Nonnull
                                        String resource,
                                        @Nonnull
                                        Map<String,String> queries,
                                        @Nullable
                                        String body,
                                        @Nullable
                                        Map<String,String> headerMap,
                                        boolean authorization)
                        throws CloudException,
                               InternalException
Throws:
CloudException
InternalException

getClient

@Nonnull
protected org.apache.http.client.HttpClient getClient()
                                               throws InternalException,
                                                      CloudException
Throws:
InternalException
CloudException

parseResponse

@Nonnull
public Document parseResponse(@Nonnull
                                      String responseBody,
                                      boolean withWireLogging)
                       throws CloudException,
                              InternalException
Throws:
CloudException
InternalException

parseResponse

@Nonnull
public Document parseResponse(@Nonnull
                                      InputStream responseBodyAsStream,
                                      boolean withWireLogging)
                       throws CloudException,
                              InternalException
Throws:
CloudException
InternalException

buildUrl

public String buildUrl(String resource,
                       Map<String,String> queries)
                throws InternalException,
                       CloudException
Throws:
InternalException
CloudException

getBlobProperty

public String getBlobProperty(@Nonnull
                              String strMethod,
                              @Nonnull
                              String resource,
                              @Nonnull
                              Map<String,String> queries,
                              String body,
                              @Nullable
                              Map<String,String> headerMap,
                              boolean authorization,
                              String propertyName)
                       throws CloudException,
                              InternalException
Throws:
CloudException
InternalException

invoke

public void invoke(@Nonnull
                   String strMethod,
                   @Nonnull
                   String resource,
                   @Nonnull
                   Map<String,String> queries,
                   @Nullable
                   String body,
                   @Nullable
                   Map<String,String> headerMap,
                   boolean authorization)
            throws CloudException,
                   InternalException
Throws:
CloudException
InternalException

putWithFile

public void putWithFile(@Nonnull
                        String strMethod,
                        @Nonnull
                        String resource,
                        Map<String,String> queries,
                        File file,
                        Map<String,String> headerMap,
                        boolean authorization)
                 throws CloudException,
                        InternalException
Throws:
CloudException
InternalException

putWithBytes

public void putWithBytes(@Nonnull
                         String strMethod,
                         @Nonnull
                         String resource,
                         Map<String,String> queries,
                         byte[] body,
                         Map<String,String> headerMap,
                         boolean authorization)
                  throws CloudException,
                         InternalException
Throws:
CloudException
InternalException

getMethod

protected org.apache.http.client.methods.HttpRequestBase getMethod(@Nonnull
                                                                   String httpMethod,
                                                                   @Nonnull
                                                                   String endpoint,
                                                                   @Nonnull
                                                                   Map<String,String> queryParams,
                                                                   @Nullable
                                                                   Map<String,String> headers,
                                                                   boolean authorization)
                                                            throws CloudException,
                                                                   InternalException
Throws:
CloudException
InternalException


Copyright © 2013 enStratus Networks Inc. All Rights Reserved.