org.jclouds.openstack.swift
Interface CommonSwiftClient

All Known Subinterfaces:
CloudFilesClient, HPCloudObjectStorageLasVegasClient, SwiftClient

public interface CommonSwiftClient

Common features between OpenStack Swift and CloudFiles

Author:
Adrian Cole
See Also:

Method Summary
 boolean containerExists(String container)
           
 boolean createContainer(String container)
           
 boolean deleteContainerIfEmpty(String container)
           
 AccountMetadata getAccountStatistics()
          HEAD operations against an identity are performed to retrieve the number of Containers and the total bytes stored in Cloud Files for the identity.
 SwiftObject getObject(String container, String name, GetOptions... options)
           
 MutableObjectInfoWithMetadata getObjectInfo(String container, String name)
           
 Set<ContainerMetadata> listContainers(ListContainerOptions... options)
          GET operations against the X-Storage-Url for an identity are performed to retrieve a list of existing storage

Containers ordered by name.

 PageSet<ObjectInfo> listObjects(String container, ListContainerOptions... options)
           
 SwiftObject newSwiftObject()
           
 boolean objectExists(String container, String name)
           
 String putObject(String container, SwiftObject object)
           
 void removeObject(String container, String name)
           
 boolean setObjectInfo(String container, String name, Map<String,String> userMetadata)
           
 

Method Detail

newSwiftObject

@Provides
SwiftObject newSwiftObject()

getAccountStatistics

AccountMetadata getAccountStatistics()
HEAD operations against an identity are performed to retrieve the number of Containers and the total bytes stored in Cloud Files for the identity.

Determine the number of Containers within the identity and the total bytes stored. Since the storage system is designed to store large amounts of data, care should be taken when representing the total bytes response as an integer; when possible, convert it to a 64-bit unsigned integer if your platform supports that primitive flavor.


listContainers

Set<ContainerMetadata> listContainers(ListContainerOptions... options)
GET operations against the X-Storage-Url for an identity are performed to retrieve a list of existing storage

Containers ordered by name. The following list describes the optional query parameters that are supported with this request.

At this time, a prex query parameter is not supported at the Account level.

Large Container Lists

The system will return a maximum of 10,000 Container names per request. To retrieve subsequent container names, another request must be made with a marker parameter. The marker indicates where the last list left off and the system will return container names greater than this marker, up to 10,000 again. Note that the marker value should be URL encoded prior to sending the HTTP request.

If 10,000 is larger than desired, a limit parameter may be given.

If the number of container names returned equals the limit given (or 10,000 if no limit is given), it can be assumed there are more container names to be listed. If the container name list is exactly divisible by the limit, the last request will simply have no content.


setObjectInfo

boolean setObjectInfo(String container,
                      String name,
                      Map<String,String> userMetadata)

createContainer

boolean createContainer(String container)

deleteContainerIfEmpty

boolean deleteContainerIfEmpty(String container)

listObjects

PageSet<ObjectInfo> listObjects(String container,
                                ListContainerOptions... options)

containerExists

boolean containerExists(String container)

putObject

String putObject(String container,
                 SwiftObject object)

getObject

SwiftObject getObject(String container,
                      String name,
                      GetOptions... options)

getObjectInfo

MutableObjectInfoWithMetadata getObjectInfo(String container,
                                            String name)

removeObject

void removeObject(String container,
                  String name)

objectExists

boolean objectExists(String container,
                     String name)
Throws:
ContainerNotFoundException - if the container is not present.


Copyright © 2009-2012 jclouds. All Rights Reserved.