Add deprecation warnings and provide links to new APIs

This commit is contained in:
Jeremy Daggett 2013-12-16 12:11:37 -08:00 committed by Everett Toews
parent f3303f03c3
commit 2a8ec6be9b
9 changed files with 132 additions and 19 deletions

View File

@ -73,13 +73,14 @@ import com.google.common.util.concurrent.ListenableFuture;
import com.google.inject.Provides; import com.google.inject.Provides;
/** /**
* Common features between OpenStack Swift and CloudFiles * Common features in OpenStack Swift.
* *
* @see CommonSwiftClient * @see CommonSwiftClient
* @see <a href="http://www.rackspacecloud.com/cf-devguide-20090812.pdf" /> *
* @author Adrian Cole * @author Adrian Cole
* @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(CommonSwiftClient.class)} as *
* {@link CommonSwiftAsyncClient} interface will be removed in jclouds 1.7. * @deprecated Please use {@code org.jclouds.ContextBuilder#buildApi(CommonSwiftClient.class)} as
* {@link CommonSwiftAsyncClient} will be removed in jclouds 2.0.
*/ */
@Deprecated @Deprecated
public interface CommonSwiftAsyncClient extends Closeable { public interface CommonSwiftAsyncClient extends Closeable {

View File

@ -19,6 +19,7 @@ package org.jclouds.openstack.swift;
import java.io.Closeable; import java.io.Closeable;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.jclouds.blobstore.domain.PageSet; import org.jclouds.blobstore.domain.PageSet;
import org.jclouds.http.options.GetOptions; import org.jclouds.http.options.GetOptions;
import org.jclouds.openstack.swift.domain.AccountMetadata; import org.jclouds.openstack.swift.domain.AccountMetadata;
@ -32,12 +33,21 @@ import org.jclouds.openstack.swift.options.ListContainerOptions;
import com.google.inject.Provides; import com.google.inject.Provides;
/** /**
* Common features between OpenStack Swift and CloudFiles * Common features in OpenStack Swift.
* *
* @see <a href="http://www.rackspacecloud.com/cf-devguide-20090812.pdf" />
* @author Adrian Cole * @author Adrian Cole
*
* @deprecated Please use {@code com.jclouds.openstack.swift.v1.SwiftApi} and related
* feature APIs in {@code com.jclouds.openstack.swift.v1.features.*} as noted in
* each method. This interface will be removed in jclouds 2.0.
*/ */
@Deprecated
public interface CommonSwiftClient extends Closeable { public interface CommonSwiftClient extends Closeable {
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.domain.SwiftObject#builder()}
*/
@Provides @Provides
SwiftObject newSwiftObject(); SwiftObject newSwiftObject();
@ -49,6 +59,10 @@ public interface CommonSwiftClient extends Closeable {
* storage system is designed to store large amounts of data, care should be taken when * 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 * 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. * unsigned integer if your platform supports that primitive flavor.
*
* @return the {@link AccountMetadata}
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.AccountApi#get()}
*/ */
AccountMetadata getAccountStatistics(); AccountMetadata getAccountStatistics();
@ -79,46 +93,138 @@ public interface CommonSwiftClient extends Closeable {
* If the number of container names returned equals the limit given (or 10,000 if no limit is * 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 * 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. * list is exactly divisible by the limit, the last request will simply have no content.
*
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#list()} and
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#list(ListContainerOptions)}
*/ */
Set<ContainerMetadata> listContainers(ListContainerOptions... options); Set<ContainerMetadata> listContainers(ListContainerOptions... options);
/**
* Get the {@link ContainerMetadata} for the specified container.
*
* @param container
* the container to get the metadata from
* @return the {@link ContainerMetadata}
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#get()}
*/
ContainerMetadata getContainerMetadata(String container); ContainerMetadata getContainerMetadata(String container);
/**
* Set the {@link ContainerMetadata} on the given container.
*
* @param container
* the container to set the metadata on
* @param containerMetadata
* a {@code Map<String, String>} containing the metadata
* @return {@code true}
* if the Container Metadata was successfully created or updated, false if not.
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#updateMetadata()}
*/
boolean setContainerMetadata(String container, Map<String, String> containerMetadata); boolean setContainerMetadata(String container, Map<String, String> containerMetadata);
/**
* Delete the metadata on the given container.
*
* @param container
* the container to delete the metadata from
* @param metadataKeys
* the metadata keys
* @return {@code true}
* if the Container was successfully deleted, false if not.
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#deleteMetadata()}
*/
boolean deleteContainerMetadata(String container, Iterable<String> metadataKeys); boolean deleteContainerMetadata(String container, Iterable<String> metadataKeys);
/**
* Create a container.
*
* @param container
* the name of the container
* @return {@code true}
* if the Container was successfully created, false if not.
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#createIfAbsent()}
*/
boolean createContainer(String container); boolean createContainer(String container);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#createIfAbsent()}
*/
boolean createContainer(String container, CreateContainerOptions... options); boolean createContainer(String container, CreateContainerOptions... options);
/**
* @deprecated This method will be replaced by
* (@link com.jclouds.openstack.swift.v1.features.ContainerApi#deleteIfEmpty()}
*/
boolean deleteContainerIfEmpty(String container); boolean deleteContainerIfEmpty(String container);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ContainerApi#head()}
*/
boolean containerExists(String container); boolean containerExists(String container);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#list()} and
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#list(ListContainerOptions)}
*/
PageSet<ObjectInfo> listObjects(String container, ListContainerOptions... options); PageSet<ObjectInfo> listObjects(String container, ListContainerOptions... options);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#get()}
*/
SwiftObject getObject(String container, String name, GetOptions... options); SwiftObject getObject(String container, String name, GetOptions... options);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi@updateMetadata()}
*/
boolean setObjectInfo(String container, String name, Map<String, String> userMetadata); boolean setObjectInfo(String container, String name, Map<String, String> userMetadata);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#head()}
*/
MutableObjectInfoWithMetadata getObjectInfo(String container, String name); MutableObjectInfoWithMetadata getObjectInfo(String container, String name);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#replace()}
*/
String putObject(String container, SwiftObject object); String putObject(String container, SwiftObject object);
/** /**
* @return True If the object was copied * @return True If the object was copied
* @throws CopyObjectException If the object was not copied * @throws CopyObjectException If the object was not copied
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#copy()}
*/ */
boolean copyObject(String sourceContainer, String sourceObject, String destinationContainer, String destinationObject); boolean copyObject(String sourceContainer, String sourceObject, String destinationContainer, String destinationObject);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#delete()}
*/
void removeObject(String container, String name); void removeObject(String container, String name);
/** /**
* @throws ContainerNotFoundException * @throws org.jclouds.blobstore.ContainerNotFoundException
* if the container is not present. * if the container is not present
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#head()}
*/ */
boolean objectExists(String container, String name); boolean objectExists(String container, String name);
/**
* @deprecated This method will be replaced by
* {@link com.jclouds.openstack.swift.v1.features.ObjectApi#replaceManifest()}
*/
String putObjectManifest(String container, String name); String putObjectManifest(String container, String name);
} }

View File

@ -44,7 +44,7 @@ public class SwiftApiMetadata extends BaseRestApiMetadata {
/** /**
* @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SwiftClient.class)} as * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SwiftClient.class)} as
* {@link SwiftAsyncClient} interface will be removed in jclouds 1.7. * {@link SwiftAsyncClient} interface will be removed in jclouds 2.0.
*/ */
@Deprecated @Deprecated
public static final TypeToken<org.jclouds.rest.RestContext<? extends SwiftClient, ? extends SwiftAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<? extends SwiftClient, ? extends SwiftAsyncClient>>() { public static final TypeToken<org.jclouds.rest.RestContext<? extends SwiftClient, ? extends SwiftAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<? extends SwiftClient, ? extends SwiftAsyncClient>>() {

View File

@ -24,12 +24,12 @@ import org.jclouds.rest.annotations.RequestFilters;
* Functionality that's in Swift, and not in CloudFiles. * Functionality that's in Swift, and not in CloudFiles.
* *
* @author Adrian Cole * @author Adrian Cole
* @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SwiftClient.class)} as *
* {@link SwiftAsyncClient} interface will be removed in jclouds 1.7. * @deprecated Please use {@code org.jclouds.ContextBuilder#buildApi(SwiftClient.class)}, as
* {@link SwiftAsyncClient} will be removed in jclouds 2.0.
*/ */
@Deprecated @Deprecated
@RequestFilters(AuthenticateRequest.class) @RequestFilters(AuthenticateRequest.class)
@Endpoint(Storage.class) @Endpoint(Storage.class)
public interface SwiftAsyncClient extends CommonSwiftAsyncClient { public interface SwiftAsyncClient extends CommonSwiftAsyncClient {
} }

View File

@ -20,7 +20,11 @@ package org.jclouds.openstack.swift;
* Functionality that's in Swift, and not in CloudFiles. * Functionality that's in Swift, and not in CloudFiles.
* *
* @author Adrian Cole * @author Adrian Cole
*
* @deprecated Please use {@code com.jclouds.openstack.swift.v1.SwiftApi} and related
* feature APIs in {@code com.jclouds.openstack.swift.v1.features.*}. This interface
* will be removed in jclouds 2.0.
*/ */
@Deprecated
public interface SwiftClient extends CommonSwiftClient { public interface SwiftClient extends CommonSwiftClient {
} }

View File

@ -45,7 +45,7 @@ public class SwiftKeystoneApiMetadata extends SwiftApiMetadata {
/** /**
* @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SwiftKeystoneClient.class)} as * @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SwiftKeystoneClient.class)} as
* {@link SwiftKeystoneAsyncClient} interface will be removed in jclouds 1.7. * {@link SwiftKeystoneAsyncClient} interface will be removed in jclouds 2.0.
*/ */
@Deprecated @Deprecated
public static final TypeToken<org.jclouds.rest.RestContext<SwiftKeystoneClient, SwiftKeystoneAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<SwiftKeystoneClient, SwiftKeystoneAsyncClient>>() { public static final TypeToken<org.jclouds.rest.RestContext<SwiftKeystoneClient, SwiftKeystoneAsyncClient>> CONTEXT_TOKEN = new TypeToken<org.jclouds.rest.RestContext<SwiftKeystoneClient, SwiftKeystoneAsyncClient>>() {

View File

@ -24,8 +24,9 @@ import org.jclouds.rest.annotations.RequestFilters;
* Functionality that's in Swift, and not in CloudFiles. * Functionality that's in Swift, and not in CloudFiles.
* *
* @author Adrian Cole * @author Adrian Cole
* @deprecated please use {@code org.jclouds.ContextBuilder#buildApi(SwiftKeystoneClient.class)} as *
* {@link SwiftKeystoneAsyncClient} interface will be removed in jclouds 1.7. * @deprecated Please use {@code org.jclouds.ContextBuilder#buildApi(SwiftKeystoneClient.class)}, as
* {@link SwiftKeystoneAsyncClient} will be removed in jclouds 2.0.
*/ */
@Deprecated @Deprecated
@RequestFilters(AuthenticateRequest.class) @RequestFilters(AuthenticateRequest.class)

View File

@ -20,7 +20,8 @@ package org.jclouds.openstack.swift;
* Functionality that's in Swift, and not in CloudFiles. * Functionality that's in Swift, and not in CloudFiles.
* *
* @author Adrian Cole * @author Adrian Cole
* @deprecated This interface will be removed in jclouds 2.0.
*/ */
@Deprecated
public interface SwiftKeystoneClient extends SwiftClient { public interface SwiftKeystoneClient extends SwiftClient {
} }

View File

@ -67,8 +67,8 @@ import com.google.common.util.concurrent.ListeningExecutorService;
/** /**
* *
* @author Adrian Cole * @author Adrian Cole
* @deprecated will be removed in jclouds 1.7, as async interfaces are no longer * @deprecated This class will be removed in jclouds 2.0, as async interfaces are no longer
* supported. Please use {@link SwiftBlobStore} * supported. Please use {@link SwiftBlobStore}.
*/ */
@Deprecated @Deprecated
@Singleton @Singleton