org.jclouds.openstack.swift
Interface CommonSwiftClient

All Known Subinterfaces:
SwiftClient, SwiftKeystoneClient

public interface CommonSwiftClient

Common features between OpenStack Swift and CloudFiles

Author:
Adrian Cole
See Also:

Method Summary
 boolean containerExists(String container)
           
 boolean copyObject(String sourceContainer, String sourceObject, String destinationContainer, String destinationObject)
           
 boolean createContainer(String container)
           
 boolean createContainer(String container, CreateContainerOptions... options)
           
 boolean deleteContainerIfEmpty(String container)
           
 boolean deleteContainerMetadata(String container, Iterable<String> metadataKeys)
           
 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.
 ContainerMetadata getContainerMetadata(String container)
           
 SwiftObject getObject(String container, String name, org.jclouds.http.options.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.

 org.jclouds.blobstore.domain.PageSet<ObjectInfo> listObjects(String container, ListContainerOptions... options)
           
 SwiftObject newSwiftObject()
           
 boolean objectExists(String container, String name)
           
 String putObject(String container, SwiftObject object)
           
 String putObjectManifest(String container, String name)
           
 void removeObject(String container, String name)
           
 boolean setContainerMetadata(String container, Map<String,String> containerMetadata)
           
 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.


getContainerMetadata

ContainerMetadata getContainerMetadata(String container)

setContainerMetadata

boolean setContainerMetadata(String container,
                             Map<String,String> containerMetadata)

deleteContainerMetadata

boolean deleteContainerMetadata(String container,
                                Iterable<String> metadataKeys)

createContainer

boolean createContainer(String container)

createContainer

boolean createContainer(String container,
                        CreateContainerOptions... options)

deleteContainerIfEmpty

boolean deleteContainerIfEmpty(String container)

containerExists

boolean containerExists(String container)

listObjects

org.jclouds.blobstore.domain.PageSet<ObjectInfo> listObjects(String container,
                                                             ListContainerOptions... options)

getObject

SwiftObject getObject(String container,
                      String name,
                      org.jclouds.http.options.GetOptions... options)

setObjectInfo

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

getObjectInfo

MutableObjectInfoWithMetadata getObjectInfo(String container,
                                            String name)

putObject

String putObject(String container,
                 SwiftObject object)

copyObject

boolean copyObject(String sourceContainer,
                   String sourceObject,
                   String destinationContainer,
                   String destinationObject)
Returns:
True If the object was copied
Throws:
CopyObjectException - If the object was not copied

removeObject

void removeObject(String container,
                  String name)

objectExists

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

putObjectManifest

String putObjectManifest(String container,
                         String name)


Copyright © 2009-2013 jclouds. All Rights Reserved.