diff --git a/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/AtmosStorageClient.java b/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/AtmosStorageClient.java index 256f47111d..d7b3280bde 100644 --- a/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/AtmosStorageClient.java +++ b/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/AtmosStorageClient.java @@ -95,4 +95,13 @@ public interface AtmosStorageClient { @ExceptionParser(ThrowKeyNotFoundOn404.class) @Path("/rest/namespace/{path}") Future readFile(@PathParam("path") String path, GetOptions... options); + + // signature currently doesn't work + // @POST + // @QueryParams(keys = "acl") + // @Headers(keys = { "x-emc-useracl", "x-emc-groupacl" }, values = { "root=FULL_CONTROL", + // "other=READ" }) + // @Consumes(MediaType.WILDCARD) + // void makePublic(@Endpoint URI url); + } diff --git a/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/AtmosObjectName.java b/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/AtmosObjectName.java index 08f74acecd..f86b3ebfb2 100644 --- a/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/AtmosObjectName.java +++ b/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/AtmosObjectName.java @@ -1,5 +1,7 @@ package org.jclouds.atmosonline.saas.functions; +import javax.inject.Singleton; + import org.jclouds.atmosonline.saas.domain.AtmosObject; import com.google.common.base.Function; @@ -8,6 +10,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class AtmosObjectName implements Function { public String apply(Object in) { diff --git a/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseObjectFromHeadersAndHttpContent.java b/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseObjectFromHeadersAndHttpContent.java index ca45b23a83..fb96a08c4d 100644 --- a/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseObjectFromHeadersAndHttpContent.java +++ b/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseObjectFromHeadersAndHttpContent.java @@ -1,6 +1,7 @@ package org.jclouds.atmosonline.saas.functions; import javax.inject.Inject; +import javax.inject.Singleton; import javax.ws.rs.core.HttpHeaders; import org.jclouds.atmosonline.saas.domain.AtmosObject; @@ -16,6 +17,7 @@ import com.google.common.base.Function; * @see ParseMetadataFromHeaders * @author Adrian Cole */ +@Singleton public class ParseObjectFromHeadersAndHttpContent implements Function { private final ParseSystemMetadataFromHeaders systemMetadataParser; diff --git a/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseSystemMetadataFromHeaders.java b/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseSystemMetadataFromHeaders.java index a93d13352c..0e2e63091c 100644 --- a/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseSystemMetadataFromHeaders.java +++ b/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseSystemMetadataFromHeaders.java @@ -28,6 +28,7 @@ import static com.google.common.base.Preconditions.checkNotNull; import java.util.Map; import javax.inject.Inject; +import javax.inject.Singleton; import org.jclouds.atmosonline.saas.domain.FileType; import org.jclouds.atmosonline.saas.domain.SystemMetadata; @@ -41,6 +42,7 @@ import com.google.common.collect.Maps; /** * @author Adrian Cole */ +@Singleton public class ParseSystemMetadataFromHeaders implements Function { private final DateService dateService; diff --git a/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseUserMetadataFromHeaders.java b/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseUserMetadataFromHeaders.java index 069cbb5e06..328e25cf2e 100644 --- a/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseUserMetadataFromHeaders.java +++ b/atmosonline/saas/core/src/main/java/org/jclouds/atmosonline/saas/functions/ParseUserMetadataFromHeaders.java @@ -28,6 +28,8 @@ import static com.google.common.base.Preconditions.checkNotNull; import java.util.Map; import java.util.Set; +import javax.inject.Singleton; + import org.jclouds.atmosonline.saas.domain.UserMetadata; import org.jclouds.atmosonline.saas.reference.AtmosStorageHeaders; import org.jclouds.http.HttpResponse; @@ -40,6 +42,7 @@ import com.google.inject.internal.ImmutableSet; /** * @author Adrian Cole */ +@Singleton public class ParseUserMetadataFromHeaders implements Function { private final Set sysKeys = ImmutableSet.of("atime", "ctime", "gid", "itime", "mtime", "nlink", "policyname", "size", "uid"); diff --git a/atmosonline/saas/core/src/test/java/org/jclouds/atmosonline/saas/AtmosStorageClientLiveTest.java b/atmosonline/saas/core/src/test/java/org/jclouds/atmosonline/saas/AtmosStorageClientLiveTest.java index ff6142c4b4..69fc3f9205 100644 --- a/atmosonline/saas/core/src/test/java/org/jclouds/atmosonline/saas/AtmosStorageClientLiveTest.java +++ b/atmosonline/saas/core/src/test/java/org/jclouds/atmosonline/saas/AtmosStorageClientLiveTest.java @@ -126,5 +126,6 @@ public class AtmosStorageClientLiveTest { } catch (IOException e) { } + } } diff --git a/blobstore/core/src/main/java/org/jclouds/blobstore/functions/ReturnVoidOnNotFoundOr404.java b/blobstore/core/src/main/java/org/jclouds/blobstore/functions/ReturnVoidOnNotFoundOr404.java index 5fa7e2861a..f2873a9b15 100644 --- a/blobstore/core/src/main/java/org/jclouds/blobstore/functions/ReturnVoidOnNotFoundOr404.java +++ b/blobstore/core/src/main/java/org/jclouds/blobstore/functions/ReturnVoidOnNotFoundOr404.java @@ -25,12 +25,16 @@ package org.jclouds.blobstore.functions; import java.lang.reflect.Constructor; +import javax.inject.Inject; +import javax.inject.Singleton; + import org.jclouds.blobstore.ContainerNotFoundException; import org.jclouds.blobstore.KeyNotFoundException; import org.jclouds.http.functions.ReturnTrueOn404; import com.google.common.base.Function; +@Singleton public class ReturnVoidOnNotFoundOr404 implements Function { static final Void v; @@ -45,7 +49,12 @@ public class ReturnVoidOnNotFoundOr404 implements Function { } } - ReturnTrueOn404 rto404 = new ReturnTrueOn404(); + private final ReturnTrueOn404 rto404; + + @Inject + private ReturnVoidOnNotFoundOr404(ReturnTrueOn404 rto404) { + this.rto404 = rto404; + } public Void apply(Exception from) { if (from instanceof KeyNotFoundException || from instanceof ContainerNotFoundException) { diff --git a/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/BouncyCastleGenerateMD5.java b/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/BouncyCastleGenerateMD5.java index 19dc7b8e5c..108f21ef8b 100644 --- a/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/BouncyCastleGenerateMD5.java +++ b/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/BouncyCastleGenerateMD5.java @@ -23,6 +23,8 @@ */ package org.jclouds.blobstore.functions.impl; +import javax.inject.Singleton; + import org.jclouds.blobstore.functions.GenerateMD5; import org.jclouds.http.HttpUtils; @@ -30,6 +32,7 @@ import org.jclouds.http.HttpUtils; * * @author Adrian Cole */ +@Singleton public class BouncyCastleGenerateMD5 implements GenerateMD5 { public byte[] apply(Object from) { diff --git a/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/BouncyCastleGenerateMD5Result.java b/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/BouncyCastleGenerateMD5Result.java index a255186be0..15ae3242cd 100644 --- a/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/BouncyCastleGenerateMD5Result.java +++ b/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/BouncyCastleGenerateMD5Result.java @@ -26,6 +26,8 @@ package org.jclouds.blobstore.functions.impl; import java.io.IOException; import java.io.InputStream; +import javax.inject.Singleton; + import org.apache.commons.io.IOUtils; import org.apache.commons.io.output.ByteArrayOutputStream; import org.bouncycastle.crypto.digests.MD5Digest; @@ -37,6 +39,7 @@ import org.jclouds.blobstore.internal.BlobRuntimeException; * * @author Adrian Cole */ +@Singleton public class BouncyCastleGenerateMD5Result implements GenerateMD5Result { public MD5InputStreamResult apply(InputStream toEncode) { MD5Digest eTag = new MD5Digest(); diff --git a/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/CalculateSizeByLength.java b/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/CalculateSizeByLength.java index f5f8403876..ee51541942 100644 --- a/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/CalculateSizeByLength.java +++ b/blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/CalculateSizeByLength.java @@ -23,6 +23,8 @@ */ package org.jclouds.blobstore.functions.impl; +import javax.inject.Singleton; + import org.jclouds.blobstore.functions.CalculateSize; import org.jclouds.http.HttpUtils; @@ -30,6 +32,7 @@ import org.jclouds.http.HttpUtils; * * @author Adrian Cole */ +@Singleton public class CalculateSizeByLength implements CalculateSize { public Long apply(Object from) { diff --git a/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/CountBlobTypeInList.java b/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/CountBlobTypeInList.java index b7a9703a2f..a8751fcb6d 100644 --- a/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/CountBlobTypeInList.java +++ b/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/CountBlobTypeInList.java @@ -24,6 +24,7 @@ package org.jclouds.blobstore.strategy.internal; import javax.inject.Inject; +import javax.inject.Singleton; import org.jclouds.blobstore.options.ListOptions; import org.jclouds.blobstore.strategy.CountListStrategy; @@ -34,6 +35,7 @@ import org.jclouds.blobstore.strategy.ListBlobMetadataStrategy; * * @author Adrian Cole */ +@Singleton public class CountBlobTypeInList implements CountListStrategy { protected final ListBlobMetadataStrategy getAllBlobMetadata; diff --git a/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/DeleteAllKeysInList.java b/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/DeleteAllKeysInList.java index 001d43081f..e3bf884d12 100644 --- a/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/DeleteAllKeysInList.java +++ b/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/DeleteAllKeysInList.java @@ -29,6 +29,7 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Named; +import javax.inject.Singleton; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.domain.ResourceMetadata; @@ -48,6 +49,7 @@ import com.google.common.collect.Sets; * * @author Adrian Cole */ +@Singleton public class DeleteAllKeysInList implements ClearListStrategy, ClearContainerStrategy { /** * maximum duration of an blob Request diff --git a/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/FindMD5InList.java b/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/FindMD5InList.java index 2416f4e743..c1c4205087 100644 --- a/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/FindMD5InList.java +++ b/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/FindMD5InList.java @@ -26,6 +26,7 @@ package org.jclouds.blobstore.strategy.internal; import java.util.Arrays; import javax.inject.Inject; +import javax.inject.Singleton; import org.jclouds.blobstore.domain.BlobMetadata; import org.jclouds.blobstore.functions.ObjectMD5; @@ -40,6 +41,7 @@ import org.jclouds.util.Utils; * * @author Adrian Cole */ +@Singleton public class FindMD5InList implements ContainsValueInListStrategy { protected final ObjectMD5 objectMD5; diff --git a/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/GetAllBlobsInListAndRetryOnFailure.java b/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/GetAllBlobsInListAndRetryOnFailure.java index 1fedc1fc8d..26191d3fa7 100644 --- a/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/GetAllBlobsInListAndRetryOnFailure.java +++ b/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/GetAllBlobsInListAndRetryOnFailure.java @@ -34,6 +34,7 @@ import java.util.concurrent.TimeoutException; import javax.inject.Inject; import javax.inject.Named; +import javax.inject.Singleton; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.KeyNotFoundException; @@ -56,6 +57,7 @@ import com.google.common.collect.Sets; * * @author Adrian Cole */ +@Singleton public class GetAllBlobsInListAndRetryOnFailure implements GetBlobsInListStrategy { /** * maximum duration of an blob Request diff --git a/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/ListBlobMetadataInContainer.java b/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/ListBlobMetadataInContainer.java index 6b9bdbb712..e4ef9bfde9 100644 --- a/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/ListBlobMetadataInContainer.java +++ b/blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/ListBlobMetadataInContainer.java @@ -28,6 +28,7 @@ import java.util.concurrent.TimeUnit; import javax.inject.Inject; import javax.inject.Named; +import javax.inject.Singleton; import org.jclouds.blobstore.BlobStore; import org.jclouds.blobstore.domain.BlobMetadata; @@ -47,6 +48,7 @@ import com.google.common.collect.Sets; * * @author Adrian Cole */ +@Singleton public class ListBlobMetadataInContainer implements ListBlobMetadataStrategy { /** * maximum duration of an blob Request diff --git a/core/src/main/java/org/jclouds/http/functions/ParseETagHeader.java b/core/src/main/java/org/jclouds/http/functions/ParseETagHeader.java index d9249f64c8..6cc642e90b 100644 --- a/core/src/main/java/org/jclouds/http/functions/ParseETagHeader.java +++ b/core/src/main/java/org/jclouds/http/functions/ParseETagHeader.java @@ -23,6 +23,7 @@ */ package org.jclouds.http.functions; +import javax.inject.Singleton; import javax.ws.rs.core.HttpHeaders; import org.apache.commons.io.IOUtils; @@ -36,6 +37,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class ParseETagHeader implements Function { public String apply(HttpResponse from) { diff --git a/core/src/main/java/org/jclouds/http/functions/ParseJson.java b/core/src/main/java/org/jclouds/http/functions/ParseJson.java index bca56760bd..42bf42abd3 100644 --- a/core/src/main/java/org/jclouds/http/functions/ParseJson.java +++ b/core/src/main/java/org/jclouds/http/functions/ParseJson.java @@ -26,6 +26,7 @@ package org.jclouds.http.functions; import java.io.InputStream; import javax.annotation.Resource; +import javax.inject.Singleton; import org.apache.commons.io.IOUtils; import org.jclouds.http.HttpResponse; @@ -41,6 +42,7 @@ import com.google.gson.Gson; * * @author Adrian Cole */ +@Singleton public abstract class ParseJson implements Function { @Resource diff --git a/core/src/main/java/org/jclouds/http/functions/ReturnFalseOn404.java b/core/src/main/java/org/jclouds/http/functions/ReturnFalseOn404.java index a9975edea8..1999d47de9 100644 --- a/core/src/main/java/org/jclouds/http/functions/ReturnFalseOn404.java +++ b/core/src/main/java/org/jclouds/http/functions/ReturnFalseOn404.java @@ -23,6 +23,8 @@ */ package org.jclouds.http.functions; +import javax.inject.Singleton; + import org.jclouds.http.HttpResponseException; import com.google.common.base.Function; @@ -30,8 +32,8 @@ import com.google.common.base.Function; /** * * @author Adrian Cole - * @since 4.0 */ +@Singleton public class ReturnFalseOn404 implements Function { public Boolean apply(Exception from) { diff --git a/core/src/main/java/org/jclouds/http/functions/ReturnInputStream.java b/core/src/main/java/org/jclouds/http/functions/ReturnInputStream.java index 3f3fa4e797..58293da89e 100644 --- a/core/src/main/java/org/jclouds/http/functions/ReturnInputStream.java +++ b/core/src/main/java/org/jclouds/http/functions/ReturnInputStream.java @@ -25,6 +25,8 @@ package org.jclouds.http.functions; import java.io.InputStream; +import javax.inject.Singleton; + import org.jclouds.http.HttpResponse; import com.google.common.base.Function; @@ -34,6 +36,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class ReturnInputStream implements Function { public InputStream apply(HttpResponse from) { diff --git a/core/src/main/java/org/jclouds/http/functions/ReturnStringIf200.java b/core/src/main/java/org/jclouds/http/functions/ReturnStringIf200.java index 53986766ce..8c7a6203cc 100644 --- a/core/src/main/java/org/jclouds/http/functions/ReturnStringIf200.java +++ b/core/src/main/java/org/jclouds/http/functions/ReturnStringIf200.java @@ -26,6 +26,8 @@ package org.jclouds.http.functions; import java.io.IOException; import java.io.InputStream; +import javax.inject.Singleton; + import org.jclouds.http.HttpException; import org.jclouds.http.HttpResponse; import org.jclouds.util.Utils; @@ -36,6 +38,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class ReturnStringIf200 implements Function { public String apply(HttpResponse from) { diff --git a/core/src/main/java/org/jclouds/http/functions/ReturnTrueIf2xx.java b/core/src/main/java/org/jclouds/http/functions/ReturnTrueIf2xx.java index 13d8fb752f..20260e7d82 100644 --- a/core/src/main/java/org/jclouds/http/functions/ReturnTrueIf2xx.java +++ b/core/src/main/java/org/jclouds/http/functions/ReturnTrueIf2xx.java @@ -23,6 +23,8 @@ */ package org.jclouds.http.functions; +import javax.inject.Singleton; + import org.apache.commons.io.IOUtils; import org.jclouds.http.HttpResponse; @@ -33,6 +35,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class ReturnTrueIf2xx implements Function { public Boolean apply(HttpResponse from) { diff --git a/core/src/main/java/org/jclouds/http/functions/ReturnTrueOn404.java b/core/src/main/java/org/jclouds/http/functions/ReturnTrueOn404.java index 0375fe5d89..3db80423bb 100644 --- a/core/src/main/java/org/jclouds/http/functions/ReturnTrueOn404.java +++ b/core/src/main/java/org/jclouds/http/functions/ReturnTrueOn404.java @@ -23,10 +23,13 @@ */ package org.jclouds.http.functions; +import javax.inject.Singleton; + import org.jclouds.http.HttpResponseException; import com.google.common.base.Function; +@Singleton public class ReturnTrueOn404 implements Function { public Boolean apply(Exception from) { diff --git a/core/src/main/java/org/jclouds/http/functions/ReturnVoidIf2xx.java b/core/src/main/java/org/jclouds/http/functions/ReturnVoidIf2xx.java index e59d6933bc..955168a681 100644 --- a/core/src/main/java/org/jclouds/http/functions/ReturnVoidIf2xx.java +++ b/core/src/main/java/org/jclouds/http/functions/ReturnVoidIf2xx.java @@ -25,6 +25,8 @@ package org.jclouds.http.functions; import java.lang.reflect.Constructor; +import javax.inject.Singleton; + import org.apache.commons.io.IOUtils; import org.jclouds.http.HttpResponse; @@ -35,6 +37,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class ReturnVoidIf2xx implements Function { static final Void v; static { diff --git a/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java b/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java index 18eba40ff9..4c6252a5e6 100644 --- a/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java +++ b/core/src/main/java/org/jclouds/http/internal/JavaUrlHttpCommandExecutorService.java @@ -36,6 +36,7 @@ import java.util.concurrent.ExecutorService; import javax.inject.Inject; import javax.inject.Named; +import javax.inject.Singleton; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HttpsURLConnection; import javax.net.ssl.SSLSession; @@ -56,6 +57,7 @@ import com.google.common.collect.Maps; * * @author Adrian Cole */ +@Singleton public class JavaUrlHttpCommandExecutorService extends BaseHttpCommandExecutorService { diff --git a/extensions/gae/src/main/java/org/jclouds/gae/GaeHttpCommandExecutorService.java b/extensions/gae/src/main/java/org/jclouds/gae/GaeHttpCommandExecutorService.java index b12ccd0cfd..4e19b9092f 100644 --- a/extensions/gae/src/main/java/org/jclouds/gae/GaeHttpCommandExecutorService.java +++ b/extensions/gae/src/main/java/org/jclouds/gae/GaeHttpCommandExecutorService.java @@ -35,6 +35,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; import javax.inject.Inject; +import javax.inject.Singleton; import javax.ws.rs.core.HttpHeaders; import org.apache.commons.io.IOUtils; @@ -62,6 +63,7 @@ import com.google.common.annotations.VisibleForTesting; * @author Adrian Cole */ @SingleThreaded +@Singleton public class GaeHttpCommandExecutorService extends BaseHttpCommandExecutorService { private final URLFetchService urlFetchService; diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseMetadataFromJsonResponse.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseMetadataFromJsonResponse.java index 0d67d30198..684bfd8df2 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseMetadataFromJsonResponse.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseMetadataFromJsonResponse.java @@ -30,6 +30,7 @@ import java.util.List; import java.util.Map; import javax.inject.Inject; +import javax.inject.Singleton; import org.jclouds.http.functions.ParseJson; @@ -41,6 +42,7 @@ import com.google.gson.Gson; * * @author Adrian Cole */ +@Singleton public class ParseMetadataFromJsonResponse extends ParseJson> { @Inject diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseSessionTokenFromJsonResponse.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseSessionTokenFromJsonResponse.java index 5a9ada52c1..9b1deaa1ad 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseSessionTokenFromJsonResponse.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseSessionTokenFromJsonResponse.java @@ -28,6 +28,7 @@ import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import javax.inject.Inject; +import javax.inject.Singleton; import org.jclouds.http.functions.ParseJson; @@ -38,6 +39,7 @@ import com.google.gson.Gson; * * @author Adrian Cole */ +@Singleton public class ParseSessionTokenFromJsonResponse extends ParseJson { @Inject diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseUploadInfoFromJsonResponse.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseUploadInfoFromJsonResponse.java index d9d44f0240..2a66d55c6e 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseUploadInfoFromJsonResponse.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/functions/ParseUploadInfoFromJsonResponse.java @@ -30,6 +30,7 @@ import java.net.URI; import java.util.Map; import javax.inject.Inject; +import javax.inject.Singleton; import org.jclouds.http.functions.ParseJson; import org.jclouds.nirvanix.sdn.domain.UploadInfo; @@ -42,6 +43,7 @@ import com.google.gson.Gson; * @see UploadInfo * @author Adrian Cole */ +@Singleton public class ParseUploadInfoFromJsonResponse extends ParseJson { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/IpAddress.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/IpAddress.java index a8a2bd456b..155d0b59fe 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/IpAddress.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/IpAddress.java @@ -25,8 +25,11 @@ package org.jclouds.rackspace.cloudservers.functions; import java.net.InetAddress; +import javax.inject.Singleton; + import com.google.common.base.Function; +@Singleton public class IpAddress implements Function { public String apply(Object from) { diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseAddressesFromJsonResponse.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseAddressesFromJsonResponse.java index 99aea4f949..713a787829 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseAddressesFromJsonResponse.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseAddressesFromJsonResponse.java @@ -32,12 +32,14 @@ import org.jclouds.rackspace.cloudservers.domain.Addresses; import com.google.gson.Gson; import javax.inject.Inject; +import javax.inject.Singleton; /** * This parses {@link Addresses} from a gson string. * * @author Adrian Cole */ +@Singleton public class ParseAddressesFromJsonResponse extends ParseJson { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseBackupScheduleFromJsonResponse.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseBackupScheduleFromJsonResponse.java index 57312990ee..9826772005 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseBackupScheduleFromJsonResponse.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseBackupScheduleFromJsonResponse.java @@ -32,12 +32,14 @@ import org.jclouds.rackspace.cloudservers.domain.BackupSchedule; import com.google.gson.Gson; import javax.inject.Inject; +import javax.inject.Singleton; /** * This parses {@link BackupSchedule} from a gson string. * * @author Adrian Cole */ +@Singleton public class ParseBackupScheduleFromJsonResponse extends ParseJson { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseFlavorFromJsonResponse.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseFlavorFromJsonResponse.java index 5e3a05cb22..0a8fb071c1 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseFlavorFromJsonResponse.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseFlavorFromJsonResponse.java @@ -32,12 +32,14 @@ import org.jclouds.rackspace.cloudservers.domain.Flavor; import com.google.gson.Gson; import javax.inject.Inject; +import javax.inject.Singleton; /** * This parses {@link Flavor} from a gson string. * * @author Adrian Cole */ +@Singleton public class ParseFlavorFromJsonResponse extends ParseJson { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseFlavorListFromJsonResponse.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseFlavorListFromJsonResponse.java index 7241f93684..542d217990 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseFlavorListFromJsonResponse.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseFlavorListFromJsonResponse.java @@ -33,6 +33,8 @@ import org.jclouds.rackspace.cloudservers.domain.Flavor; import com.google.gson.Gson; import javax.inject.Inject; +import javax.inject.Singleton; + import com.google.inject.internal.Lists; /** @@ -40,6 +42,7 @@ import com.google.inject.internal.Lists; * * @author Adrian Cole */ +@Singleton public class ParseFlavorListFromJsonResponse extends ParseJson> { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseImageFromJsonResponse.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseImageFromJsonResponse.java index 9204ce701d..2b037ab19f 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseImageFromJsonResponse.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseImageFromJsonResponse.java @@ -32,12 +32,14 @@ import org.jclouds.rackspace.cloudservers.domain.Image; import com.google.gson.Gson; import javax.inject.Inject; +import javax.inject.Singleton; /** * This parses {@link Image} from a gson string. * * @author Adrian Cole */ +@Singleton public class ParseImageFromJsonResponse extends ParseJson { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseImageListFromJsonResponse.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseImageListFromJsonResponse.java index 6f5865cf5f..7243a339c9 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseImageListFromJsonResponse.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseImageListFromJsonResponse.java @@ -33,6 +33,8 @@ import org.jclouds.rackspace.cloudservers.domain.Image; import com.google.gson.Gson; import javax.inject.Inject; +import javax.inject.Singleton; + import com.google.inject.internal.Lists; /** @@ -40,6 +42,7 @@ import com.google.inject.internal.Lists; * * @author Adrian Cole */ +@Singleton public class ParseImageListFromJsonResponse extends ParseJson> { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseInetAddressListFromJsonResponse.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseInetAddressListFromJsonResponse.java index 3ccde0c4e9..2c9bb7c31f 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseInetAddressListFromJsonResponse.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseInetAddressListFromJsonResponse.java @@ -36,12 +36,14 @@ import org.jclouds.http.functions.ParseJson; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; import javax.inject.Inject; +import javax.inject.Singleton; /** * This parses a list of {@link InetAddress} from a gson string. * * @author Adrian Cole */ +@Singleton public class ParseInetAddressListFromJsonResponse extends ParseJson> { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseServerFromJsonResponse.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseServerFromJsonResponse.java index 4b2f67f71a..7b2b342a9c 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseServerFromJsonResponse.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseServerFromJsonResponse.java @@ -32,12 +32,14 @@ import org.jclouds.rackspace.cloudservers.domain.Server; import com.google.gson.Gson; import javax.inject.Inject; +import javax.inject.Singleton; /** * This parses {@link Server} from a gson string. * * @author Adrian Cole */ +@Singleton public class ParseServerFromJsonResponse extends ParseJson { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseServerListFromJsonResponse.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseServerListFromJsonResponse.java index 00f4a4f767..2b3aac849c 100755 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseServerListFromJsonResponse.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseServerListFromJsonResponse.java @@ -33,6 +33,8 @@ import org.jclouds.rackspace.cloudservers.domain.Server; import com.google.gson.Gson; import javax.inject.Inject; +import javax.inject.Singleton; + import com.google.inject.internal.Lists; /** @@ -40,6 +42,7 @@ import com.google.inject.internal.Lists; * * @author Adrian Cole */ +@Singleton public class ParseServerListFromJsonResponse extends ParseJson> { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseSharedIpGroupFromJsonResponse.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseSharedIpGroupFromJsonResponse.java index 6990c2c2f3..c6f4785a82 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseSharedIpGroupFromJsonResponse.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseSharedIpGroupFromJsonResponse.java @@ -32,12 +32,14 @@ import org.jclouds.rackspace.cloudservers.domain.SharedIpGroup; import com.google.gson.Gson; import javax.inject.Inject; +import javax.inject.Singleton; /** * This parses {@link SharedIpGroup} from a gson string. * * @author Adrian Cole */ +@Singleton public class ParseSharedIpGroupFromJsonResponse extends ParseJson { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseSharedIpGroupListFromJsonResponse.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseSharedIpGroupListFromJsonResponse.java index 64494f7739..2c119e6ee1 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseSharedIpGroupListFromJsonResponse.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ParseSharedIpGroupListFromJsonResponse.java @@ -33,6 +33,8 @@ import org.jclouds.rackspace.cloudservers.domain.SharedIpGroup; import com.google.gson.Gson; import javax.inject.Inject; +import javax.inject.Singleton; + import com.google.inject.internal.Lists; /** @@ -40,6 +42,7 @@ import com.google.inject.internal.Lists; * * @author Adrian Cole */ +@Singleton public class ParseSharedIpGroupListFromJsonResponse extends ParseJson> { @Inject diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnFlavorNotFoundOn404.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnFlavorNotFoundOn404.java index f452697218..8c5bd8f2a0 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnFlavorNotFoundOn404.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnFlavorNotFoundOn404.java @@ -23,6 +23,8 @@ */ package org.jclouds.rackspace.cloudservers.functions; +import javax.inject.Singleton; + import org.jclouds.http.HttpResponseException; import org.jclouds.rackspace.cloudservers.domain.Flavor; @@ -33,6 +35,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class ReturnFlavorNotFoundOn404 implements Function { public Flavor apply(Exception from) { diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnImageNotFoundOn404.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnImageNotFoundOn404.java index e06b1accf2..d9a9ddce3a 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnImageNotFoundOn404.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnImageNotFoundOn404.java @@ -23,6 +23,8 @@ */ package org.jclouds.rackspace.cloudservers.functions; +import javax.inject.Singleton; + import org.jclouds.http.HttpResponseException; import org.jclouds.rackspace.cloudservers.domain.Image; @@ -33,6 +35,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class ReturnImageNotFoundOn404 implements Function { public Image apply(Exception from) { diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnServerNotFoundOn404.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnServerNotFoundOn404.java index 3240470608..c2cf1193b6 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnServerNotFoundOn404.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnServerNotFoundOn404.java @@ -23,6 +23,8 @@ */ package org.jclouds.rackspace.cloudservers.functions; +import javax.inject.Singleton; + import org.jclouds.http.HttpResponseException; import org.jclouds.rackspace.cloudservers.domain.Server; @@ -33,6 +35,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class ReturnServerNotFoundOn404 implements Function { public Server apply(Exception from) { diff --git a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnSharedIpGroupNotFoundOn404.java b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnSharedIpGroupNotFoundOn404.java index 730aad33ac..c34cf57d97 100644 --- a/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnSharedIpGroupNotFoundOn404.java +++ b/rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/functions/ReturnSharedIpGroupNotFoundOn404.java @@ -23,6 +23,8 @@ */ package org.jclouds.rackspace.cloudservers.functions; +import javax.inject.Singleton; + import org.jclouds.http.HttpResponseException; import org.jclouds.rackspace.cloudservers.domain.SharedIpGroup; @@ -33,6 +35,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class ReturnSharedIpGroupNotFoundOn404 implements Function { public SharedIpGroup apply(Exception from) { diff --git a/rackspace/core/src/main/java/org/jclouds/rackspace/functions/ParseAuthenticationResponseFromHeaders.java b/rackspace/core/src/main/java/org/jclouds/rackspace/functions/ParseAuthenticationResponseFromHeaders.java index f524cea265..de5f5a3ee8 100755 --- a/rackspace/core/src/main/java/org/jclouds/rackspace/functions/ParseAuthenticationResponseFromHeaders.java +++ b/rackspace/core/src/main/java/org/jclouds/rackspace/functions/ParseAuthenticationResponseFromHeaders.java @@ -31,6 +31,8 @@ import static org.jclouds.rackspace.reference.RackspaceHeaders.STORAGE_URL; import java.net.URI; +import javax.inject.Singleton; + import org.jclouds.http.HttpResponse; import org.jclouds.rackspace.RackspaceAuthentication.AuthenticationResponse; @@ -41,6 +43,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class ParseAuthenticationResponseFromHeaders implements Function { diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/functions/ParseLoginResponseFromHeaders.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/functions/ParseLoginResponseFromHeaders.java index f838cc4b08..92d240afe8 100755 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/functions/ParseLoginResponseFromHeaders.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/functions/ParseLoginResponseFromHeaders.java @@ -31,6 +31,7 @@ import java.util.regex.Pattern; import javax.inject.Inject; import javax.inject.Provider; +import javax.inject.Singleton; import javax.ws.rs.core.HttpHeaders; import org.jclouds.http.HttpResponse; @@ -49,6 +50,7 @@ import com.google.common.base.Function; * * @author Adrian Cole */ +@Singleton public class ParseLoginResponseFromHeaders implements Function { static final Pattern pattern = Pattern.compile("vcloud-token=(.*); path=.*");