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


@Beta
public interface ContainerApi

Provides access to the OpenStack Object Storage (Swift) Container 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 create(String containerName)
          Creates a container, if not already present.
 boolean create(String containerName, CreateContainerOptions options)
          Creates a container, if not already present.
 boolean deleteIfEmpty(String containerName)
          Deletes a Container, if empty.
 boolean deleteMetadata(String containerName, Map<String,String> metadata)
          Deletes Container metadata.
 Container get(String containerName)
          Gets the Container.
 com.google.common.collect.FluentIterable<Container> list()
          Lists up to 10,000 containers.
 com.google.common.collect.FluentIterable<Container> list(ListContainerOptions options)
          Lists containers with the supplied ListContainerOptions.
 boolean update(String containerName, UpdateContainerOptions options)
          Updates the Container.
 boolean updateMetadata(String containerName, Map<String,String> metadata)
          Creates or updates the Container metadata.
 

Method Detail

list

@Named(value="container:list")
com.google.common.collect.FluentIterable<Container> list()
Lists up to 10,000 containers.

NOTE

This method returns a list of Container objects without metadata. To retrieve the Container metadata, use the get(String) method.

Returns:
a list of containers ordered by name.

list

@Named(value="container:list")
com.google.common.collect.FluentIterable<Container> list(ListContainerOptions options)
Lists containers with the supplied ListContainerOptions.

NOTE

This method returns a list of Container objects without metadata. To retrieve the Container metadata, use the get(String) method.

Parameters:
options - the options to control the output list.
Returns:
a list of containers ordered by name.

create

@Named(value="container:create")
boolean create(String containerName)
Creates a container, if not already present.

Parameters:
containerName - corresponds to Container.getName().
Returns:
true if the container was created, false if the container already existed.

create

@Named(value="container:create")
boolean create(String containerName,
                     CreateContainerOptions options)
Creates a container, if not already present.

Parameters:
containerName - corresponds to Container.getName().
options - the options to use when creating the container.
Returns:
true if the container was created, false if the container already existed.

get

@Named(value="container:get")
@Nullable
Container get(String containerName)
Gets the Container.

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

update

@Named(value="container:update")
boolean update(String containerName,
                     UpdateContainerOptions options)
Updates the Container.

Parameters:
containerName - the container name corresponding to Container.getName().
options - the container options to update.
Returns:
true if the container metadata was successfully created or updated, false if not.

updateMetadata

@Named(value="container:updateMetadata")
boolean updateMetadata(String containerName,
                             Map<String,String> metadata)
Creates or updates the Container metadata.

Parameters:
containerName - the container name corresponding to Container.getName().
metadata - the container metadata to create or update.
Returns:
true if the container metadata was successfully created or updated, false if not.

deleteMetadata

@Named(value="container:deleteMetadata")
boolean deleteMetadata(String containerName,
                             Map<String,String> metadata)
Deletes Container metadata.

Parameters:
containerName - corresponds to Container.getName().
metadata - the container metadata to delete.
Returns:
true if the container metadata was successfully deleted, false if not.

deleteIfEmpty

@Named(value="container:deleteIfEmpty")
boolean deleteIfEmpty(String containerName)
                      throws IllegalStateException
Deletes a Container, if empty.

Parameters:
containerName - corresponds to Container.getName().
Returns:
true if the container was deleted or not present.
Throws:
IllegalStateException - if the container was not empty.


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