org.dasein.cloud.atmos
Class AtmosMethod

java.lang.Object
  extended by org.dasein.cloud.atmos.AtmosMethod

public class AtmosMethod
extends Object

Handles all RESTful interaction with the Atmos endpoint in order to perform specific REST operations.

Created by George Reese: 10/5/12 9:14 AM

Since:
2012.09
Version:
2012.09 initial version
Author:
George Reese

Nested Class Summary
static class AtmosMethod.EndpointType
           
 
Constructor Summary
AtmosMethod(Atmos provider)
           
 
Method Summary
protected  void authorize(org.dasein.cloud.ProviderContext ctx, org.apache.http.client.methods.HttpRequestBase method, String contentType, String range)
           
 org.dasein.cloud.storage.Blob create(String bucket, String name)
           
 void delete(String bucketName, String objectName)
           
 InputStream download(String bucket, String name)
           
protected  org.apache.http.client.HttpClient getClient(String endpoint)
           
protected  String getEndpoint(org.dasein.cloud.ProviderContext ctx, AtmosMethod.EndpointType type, String target)
           
 org.dasein.cloud.storage.Blob info(String bucket, String name)
           
 Iterable<org.dasein.cloud.storage.Blob> list(String directory)
           
 void rename(String root, String oldName, String newName)
           
 org.dasein.cloud.storage.Blob upload(String bucket, String name, InputStream input, org.dasein.util.uom.storage.Storage<?> size)
           
 org.dasein.cloud.storage.Blob upload(String bucket, String name, String contentType, String content)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtmosMethod

public AtmosMethod(Atmos provider)
Method Detail

authorize

protected void authorize(@Nonnull
                         org.dasein.cloud.ProviderContext ctx,
                         @Nonnull
                         org.apache.http.client.methods.HttpRequestBase method,
                         @Nonnull
                         String contentType,
                         @Nullable
                         String range)
                  throws org.dasein.cloud.CloudException,
                         org.dasein.cloud.InternalException
Throws:
org.dasein.cloud.CloudException
org.dasein.cloud.InternalException

create

@Nonnull
public org.dasein.cloud.storage.Blob create(@Nonnull
                                                    String bucket,
                                                    @Nonnull
                                                    String name)
                                     throws org.dasein.cloud.CloudException,
                                            org.dasein.cloud.InternalException
Throws:
org.dasein.cloud.CloudException
org.dasein.cloud.InternalException

delete

public void delete(@Nonnull
                   String bucketName,
                   @Nullable
                   String objectName)
            throws org.dasein.cloud.CloudException,
                   org.dasein.cloud.InternalException
Throws:
org.dasein.cloud.CloudException
org.dasein.cloud.InternalException

download

@Nonnull
public InputStream download(@Nonnull
                                    String bucket,
                                    @Nonnull
                                    String name)
                     throws org.dasein.cloud.CloudException,
                            org.dasein.cloud.InternalException
Throws:
org.dasein.cloud.CloudException
org.dasein.cloud.InternalException

getClient

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

getEndpoint

@Nonnull
protected String getEndpoint(@Nonnull
                                     org.dasein.cloud.ProviderContext ctx,
                                     @Nonnull
                                     AtmosMethod.EndpointType type,
                                     @Nullable
                                     String target)
                      throws org.dasein.cloud.CloudException,
                             org.dasein.cloud.InternalException
Throws:
org.dasein.cloud.CloudException
org.dasein.cloud.InternalException

info

@Nullable
public org.dasein.cloud.storage.Blob info(@Nonnull
                                                   String bucket,
                                                   @Nonnull
                                                   String name)
                                   throws org.dasein.cloud.CloudException,
                                          org.dasein.cloud.InternalException
Throws:
org.dasein.cloud.CloudException
org.dasein.cloud.InternalException

list

public Iterable<org.dasein.cloud.storage.Blob> list(@Nonnull
                                                    String directory)
                                             throws org.dasein.cloud.CloudException,
                                                    org.dasein.cloud.InternalException
Throws:
org.dasein.cloud.CloudException
org.dasein.cloud.InternalException

rename

public void rename(@Nonnull
                   String root,
                   @Nonnull
                   String oldName,
                   @Nonnull
                   String newName)
            throws org.dasein.cloud.CloudException,
                   org.dasein.cloud.InternalException
Throws:
org.dasein.cloud.CloudException
org.dasein.cloud.InternalException

upload

@Nonnull
public org.dasein.cloud.storage.Blob upload(@Nonnull
                                                    String bucket,
                                                    @Nonnull
                                                    String name,
                                                    @Nonnull
                                                    String contentType,
                                                    @Nonnull
                                                    String content)
                                     throws org.dasein.cloud.CloudException,
                                            org.dasein.cloud.InternalException
Throws:
org.dasein.cloud.CloudException
org.dasein.cloud.InternalException

upload

@Nonnull
public org.dasein.cloud.storage.Blob upload(@Nonnull
                                                    String bucket,
                                                    @Nonnull
                                                    String name,
                                                    @Nonnull
                                                    InputStream input,
                                                    org.dasein.util.uom.storage.Storage<?> size)
                                     throws org.dasein.cloud.CloudException,
                                            org.dasein.cloud.InternalException
Throws:
org.dasein.cloud.CloudException
org.dasein.cloud.InternalException


Copyright © 2012-2013 enStratus Networks Inc. All Rights Reserved.