From 2a8ec6be9b319025569f48722b3d4af6739eb3b1 Mon Sep 17 00:00:00 2001 From: Jeremy Daggett Date: Mon, 16 Dec 2013 12:11:37 -0800 Subject: [PATCH] Add deprecation warnings and provide links to new APIs --- .../swift/CommonSwiftAsyncClient.java | 9 +- .../openstack/swift/CommonSwiftClient.java | 114 +++++++++++++++++- .../openstack/swift/SwiftApiMetadata.java | 2 +- .../openstack/swift/SwiftAsyncClient.java | 6 +- .../jclouds/openstack/swift/SwiftClient.java | 6 +- .../swift/SwiftKeystoneApiMetadata.java | 2 +- .../swift/SwiftKeystoneAsyncClient.java | 5 +- .../openstack/swift/SwiftKeystoneClient.java | 3 +- .../swift/blobstore/SwiftAsyncBlobStore.java | 4 +- 9 files changed, 132 insertions(+), 19 deletions(-) diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftAsyncClient.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftAsyncClient.java index 988b95399a..d2cfa139ca 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftAsyncClient.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftAsyncClient.java @@ -73,13 +73,14 @@ import com.google.common.util.concurrent.ListenableFuture; import com.google.inject.Provides; /** - * Common features between OpenStack Swift and CloudFiles + * Common features in OpenStack Swift. * * @see CommonSwiftClient - * @see + * * @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 public interface CommonSwiftAsyncClient extends Closeable { diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftClient.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftClient.java index b65091b00c..3dad525715 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftClient.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/CommonSwiftClient.java @@ -19,6 +19,7 @@ package org.jclouds.openstack.swift; import java.io.Closeable; import java.util.Map; import java.util.Set; + import org.jclouds.blobstore.domain.PageSet; import org.jclouds.http.options.GetOptions; import org.jclouds.openstack.swift.domain.AccountMetadata; @@ -32,12 +33,21 @@ import org.jclouds.openstack.swift.options.ListContainerOptions; import com.google.inject.Provides; /** - * Common features between OpenStack Swift and CloudFiles + * Common features in OpenStack Swift. * - * @see * @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 { + + /** + * @deprecated This method will be replaced by + * {@link com.jclouds.openstack.swift.v1.domain.SwiftObject#builder()} + */ @Provides 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 * 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. + * + * @return the {@link AccountMetadata} + * @deprecated This method will be replaced by + * {@link com.jclouds.openstack.swift.v1.features.AccountApi#get()} */ 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 * 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. + * + * @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 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); + /** + * Set the {@link ContainerMetadata} on the given container. + * + * @param container + * the container to set the metadata on + * @param containerMetadata + * a {@code Map} 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 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 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); + /** + * @deprecated This method will be replaced by + * {@link com.jclouds.openstack.swift.v1.features.ContainerApi#createIfAbsent()} + */ 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); + /** + * @deprecated This method will be replaced by + * {@link com.jclouds.openstack.swift.v1.features.ContainerApi#head()} + */ 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 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); + /** + * @deprecated This method will be replaced by + * {@link com.jclouds.openstack.swift.v1.features.ObjectApi@updateMetadata()} + */ boolean setObjectInfo(String container, String name, Map userMetadata); + /** + * @deprecated This method will be replaced by + * {@link com.jclouds.openstack.swift.v1.features.ObjectApi#head()} + */ 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); /** * @return True If the object was 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); + /** + * @deprecated This method will be replaced by + * {@link com.jclouds.openstack.swift.v1.features.ObjectApi#delete()} + */ void removeObject(String container, String name); /** - * @throws ContainerNotFoundException - * if the container is not present. + * @throws org.jclouds.blobstore.ContainerNotFoundException + * 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); + /** + * @deprecated This method will be replaced by + * {@link com.jclouds.openstack.swift.v1.features.ObjectApi#replaceManifest()} + */ String putObjectManifest(String container, String name); } diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftApiMetadata.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftApiMetadata.java index 256b8e8af9..f633225893 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftApiMetadata.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftApiMetadata.java @@ -44,7 +44,7 @@ public class SwiftApiMetadata extends BaseRestApiMetadata { /** * @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 public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftAsyncClient.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftAsyncClient.java index fc7471afcf..a0d0270a64 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftAsyncClient.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftAsyncClient.java @@ -24,12 +24,12 @@ import org.jclouds.rest.annotations.RequestFilters; * Functionality that's in Swift, and not in CloudFiles. * * @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 @RequestFilters(AuthenticateRequest.class) @Endpoint(Storage.class) public interface SwiftAsyncClient extends CommonSwiftAsyncClient { - } diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftClient.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftClient.java index f6cf0db0f7..9ff6117cb8 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftClient.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftClient.java @@ -20,7 +20,11 @@ package org.jclouds.openstack.swift; * Functionality that's in Swift, and not in CloudFiles. * * @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 { - } diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneApiMetadata.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneApiMetadata.java index 3d42effe35..fedeb2f80b 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneApiMetadata.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneApiMetadata.java @@ -45,7 +45,7 @@ public class SwiftKeystoneApiMetadata extends SwiftApiMetadata { /** * @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 public static final TypeToken> CONTEXT_TOKEN = new TypeToken>() { diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneAsyncClient.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneAsyncClient.java index 399ff4a4b5..0aedf768c1 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneAsyncClient.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneAsyncClient.java @@ -24,8 +24,9 @@ import org.jclouds.rest.annotations.RequestFilters; * Functionality that's in Swift, and not in CloudFiles. * * @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 @RequestFilters(AuthenticateRequest.class) diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneClient.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneClient.java index 0db5b5fba4..e0af226758 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneClient.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/SwiftKeystoneClient.java @@ -20,7 +20,8 @@ package org.jclouds.openstack.swift; * Functionality that's in Swift, and not in CloudFiles. * * @author Adrian Cole + * @deprecated This interface will be removed in jclouds 2.0. */ +@Deprecated public interface SwiftKeystoneClient extends SwiftClient { - } diff --git a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/SwiftAsyncBlobStore.java b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/SwiftAsyncBlobStore.java index 702a2e3e05..38f8f52664 100644 --- a/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/SwiftAsyncBlobStore.java +++ b/apis/swift/src/main/java/org/jclouds/openstack/swift/blobstore/SwiftAsyncBlobStore.java @@ -67,8 +67,8 @@ import com.google.common.util.concurrent.ListeningExecutorService; /** * * @author Adrian Cole - * @deprecated will be removed in jclouds 1.7, as async interfaces are no longer - * supported. Please use {@link SwiftBlobStore} + * @deprecated This class will be removed in jclouds 2.0, as async interfaces are no longer + * supported. Please use {@link SwiftBlobStore}. */ @Deprecated @Singleton