org.jclouds.openstack.swift.v1.features
Interface ObjectApi


@Beta
public interface ObjectApi

Provides access to the OpenStack Object Storage (Swift) Object API features.

This API is new to jclouds and hence is in Beta. That means we need people to use it and give us feedback. Based on that feedback, minor changes to the interfaces may happen. This code will replace org.jclouds.openstack.swift.SwiftClient in jclouds 2.0 and it is recommended you adopt it sooner than later.


Method Summary
 boolean copy(String destinationObject, String sourceContainer, String sourceObject)
          Copies an object from one container to another.
 void delete(String objectName)
          Deletes an object, if present.
 boolean deleteMetadata(String objectName, Map<String,String> metadata)
          Deletes the metadata from a SwiftObject.
 SwiftObject get(String objectName)
          Gets the SwiftObject including its body.
 SwiftObject get(String objectName, org.jclouds.http.options.GetOptions options)
          Gets the SwiftObject including its body.
 SwiftObject getWithoutBody(String objectName)
          Gets the SwiftObject metadata without its body.
 ObjectList list()
          Lists up to 10,000 objects.
 ObjectList list(ListContainerOptions options)
          Lists up to 10,000 objects.
 String put(String objectName, org.jclouds.io.Payload payload)
          Creates or updates a SwiftObject.
 String put(String objectName, org.jclouds.io.Payload payload, PutOptions options)
          Creates or updates a SwiftObject.
 boolean updateMetadata(String objectName, Map<String,String> metadata)
          Creates or updates the metadata for a SwiftObject.
 

Method Detail

list

@Named(value="object:list")
@Nullable
ObjectList list()
Lists up to 10,000 objects.

Returns:
an ObjectList of SwiftObject ordered by name or null.

list

@Named(value="object:list")
@Nullable
ObjectList list(ListContainerOptions options)
Lists up to 10,000 objects. To control a large list of containers beyond 10,000 objects, use the marker and endMarker parameters in the ListContainerOptions class.

Parameters:
options - the ListContainerOptions for controlling the returned list.
Returns:
an ObjectList of SwiftObject ordered by name or null.

put

@Named(value="object:put")
String put(String objectName,
                 org.jclouds.io.Payload payload)
Creates or updates a SwiftObject.

Parameters:
objectName - corresponds to SwiftObject.getName().
payload - corresponds to SwiftObject.getPayload().
Returns:
SwiftObject.getETag() of the object.

put

@Named(value="object:put")
String put(String objectName,
                 org.jclouds.io.Payload payload,
                 PutOptions options)
Creates or updates a SwiftObject.

Parameters:
objectName - corresponds to SwiftObject.getName().
payload - corresponds to SwiftObject.getPayload().
options - options to control creating the SwiftObject.
Returns:
SwiftObject.getETag() of the object.

getWithoutBody

@Named(value="object:getWithoutBody")
@Nullable
SwiftObject getWithoutBody(String objectName)
Gets the SwiftObject metadata without its body.

Parameters:
objectName - corresponds to SwiftObject.getName().
Returns:
the SwiftObject or null, if not found.

get

@Named(value="object:get")
@Nullable
SwiftObject get(String objectName)
Gets the SwiftObject including its body.

Parameters:
objectName - corresponds to SwiftObject.getName().
Returns:
the SwiftObject or null, if not found.

get

@Named(value="object:get")
@Nullable
SwiftObject get(String objectName,
                               org.jclouds.http.options.GetOptions options)
Gets the SwiftObject including its body.

Parameters:
objectName - corresponds to SwiftObject.getName().
options - options to control the download.
Returns:
the SwiftObject or null, if not found.

updateMetadata

@Named(value="object:updateMetadata")
boolean updateMetadata(String objectName,
                             Map<String,String> metadata)
Creates or updates the metadata for a SwiftObject.

Parameters:
objectName - corresponds to SwiftObject.getName().
metadata - the metadata to create or update.
Returns:
true if the metadata was successfully created or updated, false if not.

deleteMetadata

@Named(value="object:deleteMetadata")
boolean deleteMetadata(String objectName,
                             Map<String,String> metadata)
Deletes the metadata from a SwiftObject.

Parameters:
objectName - corresponds to SwiftObject.getName().
metadata - corresponds to SwiftObject.getMetadata().
Returns:
true if the metadata was successfully deleted, false if not.

delete

@Named(value="object:delete")
void delete(String objectName)
Deletes an object, if present.

Parameters:
objectName - corresponds to SwiftObject.getName().

copy

@Named(value="object:copy")
boolean copy(String destinationObject,
                   String sourceContainer,
                   String sourceObject)
Copies an object from one container to another.

NOTE

This is a server side copy.

Parameters:
destinationObject - the destination object name.
sourceContainer - the source container name.
sourceObject - the source object name.
Returns:
true if the object was successfully copied, false if not.
Throws:
CopyObjectException - if the source or destination container do not exist.


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.