From 050f6e9a822a0bf7f63c2d12db19b23f7e33a8cb Mon Sep 17 00:00:00 2001 From: "adrian.f.cole" Date: Thu, 29 Oct 2009 20:17:42 +0000 Subject: [PATCH] Issue 74, Issue 76, Issue 101: revamped blobstore and rest subsystems; Issue 10: removed assisted inject git-svn-id: http://jclouds.googlecode.com/svn/trunk@2001 3d8758e0-26b5-11de-8745-db77d3ebf521 --- .../org/jclouds/aws/AWSResponseException.java | 2 +- .../java/org/jclouds/aws/domain/AWSError.java | 2 +- .../jclouds/aws/reference/AWSConstants.java | 2 +- .../org/jclouds/aws/xml/ErrorHandler.java | 2 +- .../org/jclouds/aws/xml/ErrorHandlerTest.java | 4 +- aws/core/src/test/resources/error.xml | 25 + aws/core/src/test/resources/log4j.xml | 2 +- .../org/jclouds/aws/ec2/EC2Connection.java | 2 +- .../java/org/jclouds/aws/ec2/EC2Context.java | 2 +- .../options/BaseEC2RequestOptions.java | 2 +- .../ec2/commands/options/EC2QuerySigner.java | 2 +- .../commands/options/EC2RequestOptions.java | 2 +- .../aws/ec2/config/EC2ConnectionModule.java | 2 +- .../aws/ec2/internal/GuiceEC2Context.java | 2 +- .../ec2/reference/CommonEC2Parameters.java | 2 +- .../aws/ec2/reference/EC2Constants.java | 2 +- .../options/BaseEC2RequestOptionsTest.java | 2 +- .../commands/options/EC2QuerySignerTest.java | 2 +- .../src/main/java/org/jclouds/aws/s3/S3.java | 2 +- .../java/org/jclouds/aws/s3/S3BlobStore.java | 258 --------- .../s3/{S3Connection.java => S3Client.java} | 31 +- .../org/jclouds/aws/s3/S3ContextBuilder.java | 125 +---- .../org/jclouds/aws/s3/S3ContextFactory.java | 27 +- .../jclouds/aws/s3/S3PropertiesBuilder.java | 80 +++ .../aws/s3/binders/BindACLToXMLEntity.java | 2 +- .../aws/s3/binders/BindS3ObjectToEntity.java | 56 +- .../jclouds/aws/s3/blobstore/S3BlobStore.java | 181 +++++++ .../blobstore/S3BlobStoreContextBuilder.java | 80 +++ .../blobstore/S3BlobStoreContextFactory.java | 66 +++ .../S3BlobStorePropertiesBuilder.java | 63 +++ .../config/S3BlobStoreContextModule.java | 73 +++ .../s3/blobstore/functions/BlobToObject.java | 41 +- .../functions/BlobToObjectGetOptions.java | 60 ++ .../functions/BlobToObjectMetadata.java | 38 +- .../BucketToContainerListOptions.java | 58 ++ .../functions/BucketToResourceList.java | 63 +++ .../functions/BucketToResourceMetadata.java} | 35 +- .../CommonPrefixesToResourceMetadata.java | 54 ++ .../ContainerToBucketListOptions.java | 56 ++ .../s3/blobstore/functions/ObjectToBlob.java | 57 ++ .../functions/ObjectToBlobMetadata.java | 55 ++ .../functions/ResourceToBucketList.java | 92 ++++ .../aws/s3/config/S3ContextModule.java | 45 +- .../jclouds/aws/s3/config/S3ObjectModule.java | 78 +++ ...ionModule.java => S3RestClientModule.java} | 26 +- .../jclouds/aws/s3/config/package-info.java | 4 +- .../aws/s3/domain/AccessControlList.java | 33 +- .../jclouds/aws/s3/domain/BucketMetadata.java | 88 ++- .../aws/s3/domain/CannedAccessPolicy.java | 2 +- .../jclouds/aws/s3/domain/CanonicalUser.java | 112 ++-- .../aws/s3/domain/ListBucketResponse.java | 51 +- .../aws/s3/domain/MutableObjectMetadata.java | 118 ++++ .../jclouds/aws/s3/domain/ObjectMetadata.java | 177 ++---- .../org/jclouds/aws/s3/domain/S3Object.java | 85 ++- .../internal/BucketListObjectMetadata.java | 251 +++++++++ .../s3/domain/internal/CopyObjectResult.java | 252 +++++++++ .../internal/MutableObjectMetadataImpl.java | 334 ++++++++++++ .../aws/s3/domain/internal/S3ObjectImpl.java | 210 +++++++ .../internal/TreeSetListBucketResponse.java | 168 ++++++ .../jclouds/aws/s3/domain/package-info.java | 2 +- .../s3/filters/RequestAuthorizeSignature.java | 2 +- .../jclouds/aws/s3/filters/package-info.java | 2 +- .../ClearAndDeleteBucketIfNotEmpty.java | 45 -- .../jclouds/aws/s3/functions/ObjectKey.java | 40 ++ .../ParseObjectFromHeadersAndHttpContent.java | 69 ++- .../ParseObjectMetadataFromHeaders.java | 49 +- .../ReturnTrueIfBucketAlreadyOwnedByYou.java | 5 +- .../ReturnTrueOn404FalseIfNotEmpty.java | 5 +- .../aws/s3/functions/package-info.java | 2 +- .../handlers/AWSClientErrorRetryHandler.java | 4 +- .../handlers/AWSRedirectionRetryHandler.java | 4 +- .../handlers/ParseAWSErrorFromXmlContent.java | 2 +- .../jclouds/aws/s3/handlers/package-info.java | 2 +- .../aws/s3/options/CopyObjectOptions.java | 4 +- .../aws/s3/options/ListBucketOptions.java | 26 +- .../aws/s3/options/PutBucketOptions.java | 6 +- .../aws/s3/options/PutObjectOptions.java | 6 +- .../jclouds/aws/s3/options/package-info.java | 2 +- .../java/org/jclouds/aws/s3/package-info.java | 2 +- .../jclouds/aws/s3/reference/S3Constants.java | 6 +- .../jclouds/aws/s3/reference/S3Headers.java | 2 +- .../aws/s3/reference/package-info.java | 2 +- .../java/org/jclouds/aws/s3/util/S3Utils.java | 2 +- .../org/jclouds/aws/s3/util/package-info.java | 2 +- .../aws/s3/xml/AccessControlListHandler.java | 2 +- .../jclouds/aws/s3/xml/CopyObjectHandler.java | 14 +- .../aws/s3/xml/ListAllMyBucketsHandler.java | 17 +- .../jclouds/aws/s3/xml/ListBucketHandler.java | 43 +- .../org/jclouds/aws/s3/xml/package-info.java | 2 +- ...ionLiveTest.java => S3ClientLiveTest.java} | 220 ++++---- .../java/org/jclouds/aws/s3/S3ClientTest.java | 382 +++++++++++++ .../jclouds/aws/s3/S3ContextBuilderTest.java | 55 +- .../S3BlobStoreContextBuilderTest.java | 110 ++++ .../config/S3BlobStoreModuleTest.java | 74 +++ .../integration/S3BlobIntegrationTest.java | 12 +- .../integration/S3BlobLiveTest.java | 12 +- .../integration/S3BlobMapIntegrationTest.java | 12 +- .../S3ContainerIntegrationTest.java | 12 +- .../integration/S3ContainerLiveTest.java | 12 +- .../S3InputStreamMapIntegrationTest.java | 11 +- .../integration/S3ServiceIntegrationTest.java | 12 +- .../integration/S3TestInitializer.java | 30 +- .../aws/s3/config/S3ContextModuleTest.java | 49 +- ...eTest.java => S3RestClientModuleTest.java} | 10 +- .../aws/s3/config/S3StubClientModule.java | 51 ++ .../aws/s3/config/StubS3BlobStoreModule.java | 63 --- .../RequestAuthorizeSignatureTest.java | 6 +- .../ParseObjectMetadataFromHeadersTest.java | 120 ++++ ...turnTrueIfBucketAlreadyOwnedByYouTest.java | 2 +- ...tubS3Connection.java => StubS3Client.java} | 237 ++++---- .../aws/s3/options/CopyObjectOptionsTest.java | 2 +- .../aws/s3/options/ListBucketOptionsTest.java | 2 +- .../aws/s3/options/PutBucketOptionsTest.java | 2 +- .../aws/s3/options/PutObjectOptionsTest.java | 2 +- .../org/jclouds/aws/s3/util/S3UtilsTest.java | 10 +- .../s3/xml/AccessControlListHandlerTest.java | 3 +- .../aws/s3/xml/CopyObjectHandlerTest.java | 39 +- .../aws/s3/xml/ListBucketHandlerTest.java | 92 +++- .../org/jclouds/aws/s3/xml/S3ParserTest.java | 10 +- .../core/src/test/resources/copy_object.xml | 29 + .../core/src/test/resources/list_bucket.xml | 152 ++++++ .../aws/s3/jets3t/JCloudsS3Service.java | 29 +- .../java/org/jclouds/aws/s3/jets3t/Util.java | 56 +- .../s3/jets3t/JCloudsS3ServiceLiveTest.java | 59 +- .../config/SunCloudS3ConnectionModule.java | 2 +- .../s3/suncloud/domain/SunCloudS3Error.java | 2 +- .../ParseSunCloudS3ErrorFromXmlContent.java | 2 +- .../reference/SunCloudS3Constants.java | 2 +- .../suncloud/xml/SunCloudS3ErrorHandler.java | 2 +- .../xml/config/SunCloudS3ParserModule.java | 2 +- .../SunCloudS3ConnectionLiveTest.java | 2 +- .../java/com/amazon/s3/DateServiceTest.java | 2 +- .../test/java/com/amazon/s3/S3ParserTest.java | 18 +- .../aws/s3/AmazonPerformanceLiveTest.java | 2 +- .../s3/BaseJCloudsPerformanceLiveTest.java | 26 +- .../aws/s3/BasePerformanceLiveTest.java | 8 +- .../aws/s3/JCloudsGaePerformanceLiveTest.java | 2 +- .../aws/s3/JCloudsNioPerformanceLiveTest.java | 2 +- .../aws/s3/JCloudsPerformanceLiveTest.java | 2 +- .../aws/s3/Jets3tPerformanceLiveTest.java | 2 +- aws/s3/perftest/src/test/resources/log4j.xml | 2 +- aws/s3/pom.xml | 2 +- .../samples/createandlistbuckets/README.txt | 2 +- .../org/jclouds/aws/s3/samples/MainApp.java | 44 +- aws/s3/samples/googleappengine/README.txt | 2 +- .../src/main/appengine/appengine-web.xml | 39 +- .../src/main/appengine/logging.properties | 23 + .../GetAllBucketsController.java | 15 +- .../googleappengine/JCloudsServlet.java | 12 +- .../config/GuiceServletConfig.java | 15 +- .../googleappengine/domain/BucketResult.java | 2 +- .../functions/MetadataToBucketResult.java | 11 +- .../src/main/webapp/WEB-INF/jsp/buckets.jsp | 2 +- .../src/main/webapp/WEB-INF/web.xml | 25 + .../googleappengine/src/main/webapp/index.jsp | 2 +- .../functest/GoogleAppEngineLiveTest.java | 2 +- .../functest/GoogleDevServer.java | 2 +- ...obConnection.java => AzureBlobClient.java} | 62 ++- .../azure/storage/blob/AzureBlobContext.java | 44 -- .../storage/blob/AzureBlobContextBuilder.java | 140 +---- .../storage/blob/AzureBlobContextFactory.java | 23 +- .../blob/AzureBlobPropertiesBuilder.java | 90 +++ .../azure/storage/blob/AzureBlobStore.java | 180 ------ .../azure/storage/blob/AzureBlobUtil.java | 2 +- .../blob/binders/BindAzureBlobToEntity.java | 68 +++ .../blob/binders/BindBlobToEntity.java | 62 --- .../blobstore/functions/AzureBlobToBlob.java | 34 ++ .../BlobMetadataToBlobProperties.java | 53 ++ .../blob/blobstore/functions/BlobName.java | 17 + .../BlobPropertiesToBlobMetadata.java | 32 ++ .../blob/config/AzureBlobContextModule.java | 55 +- .../storage/blob/config/AzureBlobModule.java | 55 ++ ...le.java => AzureBlobRestClientModule.java} | 40 +- .../azure/storage/blob/domain/AzureBlob.java | 94 ++++ .../storage/blob/domain/BlobMetadata.java | 101 ---- .../storage/blob/domain/BlobProperties.java | 44 ++ .../blob/domain/ContainerMetadata.java | 132 ----- .../blob/domain/ContainerProperties.java | 15 +- .../blob/domain/ListBlobsResponse.java | 13 +- .../blob/domain/ListableBlobProperties.java | 66 +++ .../domain/ListableContainerProperties.java | 24 +- .../blob/domain/MutableBlobProperties.java | 91 ++++ ...tableContainerPropertiesWithMetadata.java} | 51 +- .../blob/domain/TreeSetListBlobsResponse.java | 109 ---- .../blob/domain/internal/AzureBlobImpl.java | 164 ++++++ .../internal/ListableBlobPropertiesImpl.java | 166 ++++++ .../ListableContainerPropertiesImpl.java | 108 ++++ .../internal/MutableBlobPropertiesImpl.java | 256 +++++++++ ...leContainerPropertiesWithMetadataImpl.java | 152 ++++++ .../internal/TreeSetListBlobsResponse.java | 46 +- .../ParseBlobFromHeadersAndHttpContent.java | 78 ++- .../ParseBlobMetadataFromHeaders.java | 64 --- .../ParseBlobPropertiesFromHeaders.java | 73 +++ ... ParseContainerPropertiesFromHeaders.java} | 37 +- .../ReturnTrueIfContainerAlreadyExists.java | 2 +- .../AzureBlobClientErrorRetryHandler.java | 4 +- .../blob/options/CreateContainerOptions.java | 6 +- .../blob/options/ListBlobsOptions.java | 6 +- .../blob/reference/AzureBlobConstants.java | 4 +- .../AccountNameEnumerationResultsHandler.java | 27 +- .../blob/xml/AddMD5ToListBlobsResponse.java | 62 --- ...ontainerNameEnumerationResultsHandler.java | 23 +- ...Test.java => AzureBlobClientLiveTest.java} | 103 ++-- ...tionTest.java => AzureBlobClientTest.java} | 80 +-- .../blob/AzureBlobContextBuilderTest.java | 57 +- .../blob/AzureBlobContextModuleTest.java | 26 +- .../storage/blob/AzureBlobStoreTest.java | 219 -------- .../config/AzureBlobStubClientModule.java | 49 ++ ...ava => RestAzureBlobClientModuleTest.java} | 8 +- .../blob/config/StubAzureBlobStoreModule.java | 66 --- .../AzureBlobContainerIntegrationTest.java | 40 -- .../AzureBlobContainerLiveTest.java | 40 -- ...zureBlobInputStreamMapIntegrationTest.java | 41 -- .../integration/AzureBlobIntegrationTest.java | 80 --- .../blob/integration/AzureBlobLiveTest.java | 40 -- .../AzureBlobMapIntegrationTest.java | 40 -- .../AzureBlobServiceIntegrationTest.java | 40 -- .../integration/AzureBlobTestInitializer.java | 57 -- .../blob/internal/StubAzureBlobClient.java | 87 +++ .../internal/StubAzureBlobConnection.java | 137 ----- .../options/CreateContainerOptionsTest.java | 2 +- .../blob/options/ListBlobsOptionsTest.java | 2 +- ...ountNameEnumerationResultsHandlerTest.java | 71 ++- .../xml/AddMD5ToListBlobsResponseTest.java | 130 ----- ...inerNameEnumerationResultsHandlerTest.java | 63 +-- .../src/test/resources/test_list_blobs.xml | 2 +- .../test/resources/test_list_containers.xml | 2 +- .../test_list_containers_options.xml | 2 +- .../org/jclouds/azure/storage/AzureBlob.java | 2 +- .../org/jclouds/azure/storage/AzureQueue.java | 2 +- .../AzureStorageResponseException.java | 2 +- .../org/jclouds/azure/storage/AzureTable.java | 2 +- ...java => AzureStorageRestClientModule.java} | 8 +- .../storage/domain/AzureStorageError.java | 2 +- ...BoundedSortedSet.java => BoundedList.java} | 14 +- .../domain/internal/BoundedTreeSet.java | 77 +++ .../filters/SharedKeyAuthentication.java | 2 +- .../ParseAzureStorageErrorFromXmlContent.java | 2 +- .../azure/storage/options/CreateOptions.java | 6 +- .../azure/storage/options/ListOptions.java | 2 +- .../reference/AzureStorageConstants.java | 2 +- .../reference/AzureStorageHeaders.java | 2 +- .../azure/storage/util/AzureStorageUtils.java | 2 +- .../azure/storage/xml/ErrorHandler.java | 2 +- ... => AzureStorageRestClientModuleTest.java} | 10 +- .../SharedKeyAuthenticationLiveTest.java | 6 +- .../filters/SharedKeyAuthenticationTest.java | 6 +- .../storage/options/CreateOptionsTest.java | 2 +- .../storage/options/ListOptionsTest.java | 2 +- .../azure/storage/xml/ErrorHandlerTest.java | 3 +- .../storage/core/src/test/resources/log4j.xml | 2 +- .../core/src/test/resources/test_error.xml | 25 + ...eConnection.java => AzureQueueClient.java} | 8 +- .../queue/AzureQueueContextBuilder.java | 103 +--- .../queue/AzureQueueContextFactory.java | 23 +- .../queue/AzureQueuePropertiesBuilder.java | 87 +++ .../queue/config/AzureQueueContextModule.java | 28 +- ...e.java => AzureQueueRestClientModule.java} | 16 +- .../storage/queue/domain/QueueMetadata.java | 2 +- .../internal/GuiceAzureQueueContext.java | 92 ---- .../queue/reference/AzureQueueConstants.java | 2 +- .../AccountNameEnumerationResultsHandler.java | 15 +- ...est.java => AzureQueueClientLiveTest.java} | 25 +- ...ionTest.java => AzureQueueClientTest.java} | 36 +- ...ountNameEnumerationResultsHandlerTest.java | 37 +- .../src/test/resources/test_list_queues.xml | 2 +- .../resources/test_list_queues_options.xml | 2 +- .../java/org/jclouds/blobstore/BlobMap.java | 15 +- .../java/org/jclouds/blobstore/BlobStore.java | 45 +- .../jclouds/blobstore/BlobStoreContext.java | 18 +- .../blobstore/BlobStoreContextBuilder.java | 120 +--- .../blobstore/BlobStoreContextImpl.java | 76 --- .../blobstore/BlobStoreMapsModule.java | 242 --------- .../blobstore/BlobStorePropertiesBuilder.java | 43 +- .../blobstore/ContainerNotFoundException.java | 2 +- .../org/jclouds/blobstore/InputStreamMap.java | 14 +- .../blobstore/KeyNotFoundException.java | 2 +- .../org/jclouds/blobstore/ListableMap.java | 8 +- .../blobstore/attr/BlobCapabilities.java | 40 ++ .../blobstore/attr/BlobCapability.java | 105 ++++ .../org/jclouds/blobstore/attr/BlobScope.java | 40 ++ .../jclouds/blobstore/attr/BlobScopes.java | 42 ++ .../org/jclouds/blobstore/attr/Charge.java | 29 +- .../org/jclouds/blobstore/attr/Charges.java | 40 ++ .../blobstore/attr/ConsistencyModel.java | 40 ++ .../blobstore/attr/ConsistencyModels.java | 43 ++ .../blobstore/attr/ContainerCapabilities.java | 40 ++ .../blobstore/attr/ContainerCapability.java | 86 +++ .../blobstore/attr/ContainerVisibilities.java | 44 ++ .../blobstore/attr/ContainerVisibility.java | 40 ++ .../blobstore/attr/FolderCapability.java | 86 +++ .../blobstore/binders/BindBlobToEntity.java | 6 +- ...ityAndUserMetadataToHeadersWithPrefix.java | 4 +- .../binders/BindBlobToMultipartForm.java | 10 +- .../binders/BindMapToHeadersWithPrefix.java | 2 +- .../blobstore/config/BlobStoreMapModule.java | 83 +++ .../config/BlobStoreObjectModule.java | 54 ++ .../org/jclouds/blobstore/domain/Blob.java | 59 +- .../blobstore/domain/BlobMetadata.java | 54 +- .../blobstore/domain}/BoundedSortedSet.java | 8 +- .../org/jclouds/blobstore/domain/Key.java | 74 --- .../domain/MD5InputStreamResult.java | 31 +- .../blobstore/domain/MutableBlobMetadata.java | 27 +- .../domain/MutableResourceMetadata.java | 90 +++ .../blobstore/domain/ResourceMetadata.java | 103 ++++ .../blobstore/domain/ResourceType.java | 34 ++ .../{ => domain}/internal/BlobImpl.java | 257 ++++----- .../domain/internal/BlobMetadataImpl.java | 74 +++ .../domain}/internal/BoundedTreeSet.java | 24 +- .../internal/MutableBlobMetadataImpl.java | 119 ++++ .../internal/MutableResourceMetadataImpl.java | 208 +++++++ .../domain/internal/ResourceMetadataImpl.java | 181 +++++++ .../jclouds/blobstore/functions/BlobName.java | 12 +- .../blobstore/functions/CalculateSize.java | 38 ++ .../functions/ClearAndDeleteIfNotEmpty.java | 25 +- .../blobstore/functions/GenerateMD5.java | 38 ++ .../functions/GenerateMD5Result.java | 41 ++ .../HttpGetOptionsListToGetOptions.java | 68 +++ .../blobstore/functions/ObjectMD5.java | 28 +- .../ParseBlobFromHeadersAndHttpContent.java | 33 +- .../ParseContentTypeFromHeaders.java | 88 --- ...ParseSystemAndUserMetadataFromHeaders.java | 61 ++- .../functions/ReturnVoidOnNotFoundOr404.java | 2 +- .../ThrowContainerNotFoundOn404.java | 2 +- .../functions/ThrowKeyNotFoundOn404.java | 2 +- .../impl/BouncyCastleGenerateMD5.java | 39 ++ .../impl/BouncyCastleGenerateMD5Result.java | 66 +++ .../functions/impl/CalculateSizeByLength.java | 39 ++ .../blobstore/internal/BaseBlobMap.java | 150 +++-- .../blobstore/internal/BlobMapImpl.java | 122 +++-- .../blobstore/internal/BlobMetadataImpl.java | 247 --------- .../internal/BlobRuntimeException.java | 2 +- .../internal/BlobStoreContextImpl.java | 79 +++ .../internal/ContainerMetadataImpl.java | 86 --- .../internal/InputStreamMapImpl.java | 81 ++- .../jclouds/blobstore/options/GetOptions.java | 226 ++++++++ .../blobstore/options/ListOptions.java | 139 +++++ .../reference/BlobStoreConstants.java | 2 +- .../blobstore/reference/package-info.java | 2 +- .../strategy/ClearContainerStrategy.java | 14 +- .../blobstore/strategy/ClearListStrategy.java | 40 ++ ....java => ContainsValueInListStrategy.java} | 15 +- ...ntStrategy.java => CountListStrategy.java} | 15 +- ...ategy.java => GetBlobsInListStrategy.java} | 14 +- ...egy.java => ListBlobMetadataStrategy.java} | 16 +- ...Strategy.java => CountBlobTypeInList.java} | 27 +- ...Strategy.java => DeleteAllKeysInList.java} | 31 +- ...sValueStrategy.java => FindMD5InList.java} | 24 +- ...> GetAllBlobsInListAndRetryOnFailure.java} | 50 +- ....java => ListBlobMetadataInContainer.java} | 37 +- .../blobstore/util/BlobStoreUtils.java | 39 +- .../blobstore/BlobStoreMapsModuleTest.java | 131 ----- .../binders/BindBlobToMultipartFormTest.java | 16 +- .../MutableBlobMetadataImplTest.java} | 18 +- ...arseBlobFromHeadersAndHttpContentTest.java | 60 +- .../ParseBlobMetadataFromHeadersTest.java | 46 +- .../integration/StubBlobIntegrationTest.java | 12 +- .../StubBlobMapIntegrationTest.java | 10 +- .../StubBlobStoreContextBuilder.java | 48 +- .../StubContainerIntegrationTest.java | 9 +- .../StubInputStreamMapIntegrationTest.java | 10 +- .../StubServiceIntegrationTest.java | 9 +- .../integration/StubTestInitializer.java | 15 +- ...onModule.java => StubBlobStoreModule.java} | 22 +- .../internal/BaseBlobIntegrationTest.java | 127 +++-- .../internal/BaseBlobLiveTest.java | 11 +- .../internal/BaseBlobMapIntegrationTest.java | 103 ++-- .../BaseBlobStoreIntegrationTest.java | 160 ++++-- .../BaseContainerIntegrationTest.java | 122 ++++- .../internal/BaseContainerLiveTest.java | 8 +- .../BaseInputStreamMapIntegrationTest.java | 88 ++- .../internal/BaseMapIntegrationTest.java | 132 +++-- .../internal/BaseServiceIntegrationTest.java | 17 +- .../internal/BaseTestInitializer.java | 15 +- .../integration/internal/StubBlobStore.java | 291 ++++++---- .../blobstore/internal/BaseBlobMapTest.java | 43 +- .../blobstore/options/GetOptionsTest.java | 283 ++++++++++ .../blobstore/options/ListOptionsTest.java | 135 +++++ ...etryOnNotFoundGetAllBlobsStrategyTest.java | 66 ++- .../blobstore/util/BlobStoreUtilsTest.java | 31 +- .../java/org/jclouds/codegen/model/API.java | 2 +- .../org/jclouds/codegen/model/Command.java | 2 +- .../org/jclouds/codegen/model/DomainType.java | 2 +- .../java/org/jclouds/codegen/model/Field.java | 2 +- .../org/jclouds/codegen/model/Package.java | 2 +- .../jclouds/codegen/model/TopLevelType.java | 2 +- .../java/org/jclouds/codegen/model/Type.java | 2 +- .../jclouds/codegen/util/CodeGenerator.java | 2 +- .../src/main/resources/templates/Bean.ftl | 2 +- .../src/main/resources/templates/Command.ftl | 2 +- .../src/main/resources/templates/Handler.ftl | 2 +- .../src/main/resources/templates/Options.ftl | 2 +- .../src/main/resources/templates/Response.ftl | 2 +- .../src/main/resources/templates/Value.ftl | 2 +- codegen/ec2/src/main/bin/parse_ec2.pl | 23 + .../ec2/queryapi/AmazonEC2QueryAPI.java | 2 +- .../codegen/ec2/queryapi/Category.java | 2 +- .../jclouds/codegen/ec2/queryapi/Content.java | 2 +- .../codegen/ec2/queryapi/DataType.java | 2 +- .../jclouds/codegen/ec2/queryapi/Query.java | 2 +- .../parser/AmazonEC2QueryAPIExpectations.java | 2 +- .../parser/AmazonEC2QueryAPIParser.java | 2 +- .../parser/AmazonEC2QueryAPIValidator.java | 2 +- .../AmazonEC2QueryAPITransformer.java | 2 +- .../transform/ConvertContentToField.java | 2 +- .../parser/AmazonEC2QueryAPIParserTest.java | 2 +- .../transform/ConvertContentToFieldTest.java | 2 +- core/pom.xml | 25 +- .../ConfiguresResponseTransformer.java | 4 +- .../org/jclouds/command/EndpointCommand.java | 2 +- .../EndpointCommandExecutorService.java | 2 +- .../java/org/jclouds/command/Request.java | 2 +- .../config/ConfiguresExecutorService.java | 2 +- .../config/ExecutorServiceModule.java | 2 +- .../java/org/jclouds/http/HttpCommand.java | 2 +- .../http/HttpCommandExecutorService.java | 2 +- .../jclouds/http/HttpCommandRendezvous.java | 2 +- .../java/org/jclouds/http/HttpConstants.java | 2 +- .../org/jclouds/http/HttpErrorHandler.java | 2 +- .../java/org/jclouds/http/HttpException.java | 2 +- .../java/org/jclouds/http/HttpMessage.java | 2 +- .../jclouds/http/HttpPropertiesBuilder.java | 115 ++++ .../java/org/jclouds/http/HttpRequest.java | 2 +- .../org/jclouds/http/HttpRequestFilter.java | 2 +- .../java/org/jclouds/http/HttpResponse.java | 2 +- .../jclouds/http/HttpResponseException.java | 2 +- .../org/jclouds/http/HttpRetryHandler.java | 2 +- .../main/java/org/jclouds/http/HttpUtils.java | 119 ++-- .../java/org/jclouds/http/MultipartForm.java | 2 +- .../java/org/jclouds/http/RequiresHttp.java | 2 +- .../jclouds/http/TransformingHttpCommand.java | 12 +- ...ransformingHttpCommandExecutorService.java | 2 +- ...formingHttpCommandExecutorServiceImpl.java | 2 +- .../http/TransformingHttpCommandImpl.java | 21 +- .../jclouds/http/annotation/ClientError.java | 2 +- .../jclouds/http/annotation/Redirection.java | 2 +- .../jclouds/http/annotation/ServerError.java | 2 +- .../ConfiguresHttpCommandExecutorService.java | 2 +- ...vaUrlHttpCommandExecutorServiceModule.java | 2 +- .../http/filters/BasicAuthentication.java | 2 +- .../functions/ParseContentMD5FromHeaders.java | 2 +- .../http/functions/ParseETagHeader.java | 2 +- .../org/jclouds/http/functions/ParseJson.java | 2 +- .../org/jclouds/http/functions/ParseSax.java | 8 +- ...ParseURIFromListOrLocationHeaderIf20x.java | 2 +- .../http/functions/ReturnFalseOn404.java | 2 +- .../http/functions/ReturnInputStream.java | 2 +- .../http/functions/ReturnStringIf200.java | 2 +- .../http/functions/ReturnTrueIf2xx.java | 2 +- .../http/functions/ReturnTrueOn404.java | 2 +- .../http/functions/ReturnVoidIf2xx.java | 2 +- .../http/functions/config/ParserModule.java | 26 +- .../handlers/BackoffLimitedRetryHandler.java | 2 +- ...oseContentAndSetExceptionErrorHandler.java | 2 +- .../http/handlers/DelegatingErrorHandler.java | 2 +- .../http/handlers/DelegatingRetryHandler.java | 2 +- .../handlers/RedirectionRetryHandler.java | 6 +- .../BaseHttpCommandExecutorService.java | 7 +- .../JavaUrlHttpCommandExecutorService.java | 2 +- .../java/org/jclouds/http/internal/Wire.java | 2 +- .../http/options/BaseHttpRequestOptions.java | 12 +- .../org/jclouds/http/options/GetOptions.java | 14 +- .../http/options/HttpRequestOptions.java | 2 +- ...ransformingHttpCommandExecutorService.java | 2 +- .../pool/HttpCommandConnectionHandle.java | 2 +- .../http/pool/HttpCommandConnectionPool.java | 8 +- .../org/jclouds/http/pool/PoolConstants.java | 2 +- ...ctionPoolCommandExecutorServiceModule.java | 2 +- .../org/jclouds/lifecycle/BaseLifeCycle.java | 2 +- .../java/org/jclouds/lifecycle/Closer.java | 2 +- .../java/org/jclouds/lifecycle/LifeCycle.java | 2 +- .../lifecycle/config/LifeCycleModule.java | 2 +- .../java/org/jclouds/logging/BaseLogger.java | 2 +- .../main/java/org/jclouds/logging/Logger.java | 2 +- .../java/org/jclouds/logging/NullLogger.java | 2 +- .../BindLoggersAnnotatedWithResource.java | 2 +- .../jclouds/logging/config/LoggingModule.java | 2 +- .../logging/config/NullLoggingModule.java | 2 +- .../org/jclouds/logging/jdk/JDKLogger.java | 2 +- .../logging/jdk/config/JDKLoggingModule.java | 2 +- .../main/java/org/jclouds/rest/Binder.java | 2 +- .../ConfiguresRestClient.java} | 8 +- .../org/jclouds/rest/InvocationContext.java | 2 +- .../main/java/org/jclouds/rest/MapBinder.java | 2 +- .../org/jclouds/rest/RestClientFactory.java | 2 +- .../RestContext.java} | 6 +- .../RestContextBuilder.java} | 98 +--- .../jclouds/rest/annotations/BinderParam.java | 2 +- .../jclouds/rest/annotations/Endpoint.java | 2 +- .../rest/annotations/ExceptionParser.java | 2 +- .../org/jclouds/rest/annotations/Headers.java | 2 +- .../rest/annotations/HostPrefixParam.java | 2 +- .../jclouds/rest/annotations/MapBinder.java | 2 +- .../rest/annotations/MapEntityParam.java | 2 +- .../rest/annotations/MatrixParams.java | 2 +- .../annotations/OverrideRequestFilters.java | 2 +- .../jclouds/rest/annotations/ParamParser.java | 2 +- .../jclouds/rest/annotations/QueryParams.java | 2 +- .../rest/annotations/RequestFilters.java | 2 +- .../rest/annotations/ResponseParser.java | 2 +- .../rest/annotations/SkipEncoding.java | 2 +- .../jclouds/rest/annotations/VirtualHost.java | 2 +- .../rest/annotations/XMLResponseParser.java | 2 +- .../rest/binders/BindMapToMatrixParams.java | 2 +- .../rest/binders/BindToJsonEntity.java | 2 +- .../rest/binders/BindToStringEntity.java | 2 +- .../org/jclouds/rest/config/RestModule.java | 31 +- .../rest/internal/GeneratedHttpRequest.java | 2 +- .../internal/RestAnnotationProcessor.java | 10 +- .../rest/internal/RestClientProxy.java | 23 +- .../internal/RestContextImpl.java} | 10 +- .../rest/internal/RuntimeDelegateImpl.java | 2 +- ...nnection.java => ConfiguresSshClient.java} | 6 +- .../java/org/jclouds/ssh/ExecResponse.java | 2 +- .../{SshConnection.java => SshClient.java} | 13 +- .../java/org/jclouds/ssh/SshException.java | 2 +- .../java/org/jclouds/util/DateService.java | 32 +- .../org/jclouds/util/InputStreamChain.java | 2 +- .../main/java/org/jclouds/util/Jsr330.java | 2 +- .../main/java/org/jclouds/util/TimeStamp.java | 2 +- .../src/main/java/org/jclouds/util/Utils.java | 7 +- .../java/org/jclouds/PerformanceTest.java | 2 +- ...ackoffLimitedRetryJavaIntegrationTest.java | 4 +- .../BaseHttpCommandExecutorServiceTest.java | 2 +- .../java/org/jclouds/http/BaseJettyTest.java | 39 +- .../http/HttpPropertiesBuilderTest.java | 41 +- .../org/jclouds/http/HttpRequestTest.java | 2 +- .../jclouds/http/IntegrationTestClient.java | 4 +- ...JavaUrlHttpCommandExecutorServiceTest.java | 4 +- .../org/jclouds/http/MultipartFormTest.java | 2 +- .../http/TransformingHttpCommandImplTest.java | 2 +- .../http/filters/BasicAuthenticationTest.java | 2 +- .../http/functions/BaseHandlerTest.java | 2 +- ...eURIFromListOrLocationHeaderIf20xTest.java | 2 +- .../http/functions/ReturnStringIf200Test.java | 2 +- .../BackoffLimitedRetryHandlerTest.java | 2 +- .../handlers/DelegatingErrorHandlerTest.java | 2 +- .../jclouds/http/internal/WireLiveTest.java | 18 +- .../org/jclouds/http/internal/WireTest.java | 2 +- .../jclouds/http/options/GetOptionsTest.java | 4 +- .../lifecycle/config/LifeCycleModuleTest.java | 2 +- .../BindLoggersAnnotatedWithResourceTest.java | 2 +- .../java/org/jclouds/rest/RestClientTest.java | 107 ++++ .../RestContextBuilderTest.java} | 55 +- .../binders/BindMapToMatrixParamsTest.java | 23 + .../internal/RestAnnotationProcessorTest.java | 13 +- .../test/testng/UnitTestStatusListener.java | 2 +- .../org/jclouds/util/DateServiceTest.java | 38 +- .../java/org/jclouds/util/HttpUtilsTest.java | 2 +- .../gae/GaeHttpCommandExecutorService.java | 2 +- .../GaeHttpCommandExecutorServiceModule.java | 2 +- ...CommandExecutorServiceIntegrationTest.java | 4 +- .../GaeHttpCommandExecutorServiceTest.java | 2 +- ...eHttpCommandExecutorServiceModuleTest.java | 2 +- ...rmingHttpCommandExecutorServiceModule.java | 84 ++- .../pool/NioHttpCommandConnectionHandle.java | 13 +- .../pool/NioHttpCommandConnectionPool.java | 20 +- .../pool/NioHttpCommandExecutionHandler.java | 8 +- ...ransformingHttpCommandExecutorService.java | 2 +- .../http/httpnio/util/NioHttpUtils.java | 2 +- ...ackoffLimitedRetryJavaIntegrationTest.java | 4 +- .../NioHttpCommandConnectionPoolTest.java | 2 +- ...formingHttpCommandExecutorServiceTest.java | 4 +- .../http/httpnio/util/NioHttpUtilsTest.java | 2 +- .../jclouds/logging/log4j/Log4JLogger.java | 2 +- .../log4j/config/Log4JLoggingModule.java | 2 +- .../log4j/config/Log4JLoggingModuleTest.java | 2 +- ...hSshConnection.java => JschSshClient.java} | 19 +- ...onModule.java => JschSshClientModule.java} | 27 +- ...veTest.java => JschSshClientLiveTest.java} | 27 +- ...Test.java => JschSshClientModuleTest.java} | 22 +- .../main/java/org/jclouds/mezeo/pcs2/PCS.java | 2 +- .../org/jclouds/mezeo/pcs2/PCSBlobStore.java | 170 ------ .../{PCSConnection.java => PCSClient.java} | 62 ++- .../java/org/jclouds/mezeo/pcs2/PCSCloud.java | 2 +- .../org/jclouds/mezeo/pcs2/PCSContext.java | 43 -- .../jclouds/mezeo/pcs2/PCSContextBuilder.java | 111 +--- .../jclouds/mezeo/pcs2/PCSContextFactory.java | 21 +- .../mezeo/pcs2/PCSPropertiesBuilder.java | 62 +++ .../java/org/jclouds/mezeo/pcs2/PCSUtil.java | 66 --- .../binders/BindContainerNameToXmlEntity.java | 2 +- .../mezeo/pcs2/binders/BindDataToEntity.java | 8 +- .../pcs2/binders/BindFileInfoToXmlEntity.java | 12 +- .../binders/BindPCSFileToMultipartForm.java | 54 ++ .../blobstore/functions/BlobToFileInfo.java | 50 ++ .../blobstore/functions/BlobToPCSFile.java | 39 +- .../functions/FileInfoToBlobMetadata.java | 56 ++ .../blobstore/functions/PCSFileToBlob.java | 57 ++ .../mezeo/pcs2/config/PCSContextModule.java | 65 +-- .../mezeo/pcs2/config/PCSObjectModule.java | 69 +++ ...reModule.java => PCSRestClientModule.java} | 37 +- .../mezeo/pcs2/domain/ContainerInfo.java | 18 +- .../mezeo/pcs2/domain/ContainerList.java | 42 ++ .../jclouds/mezeo/pcs2/domain/FileInfo.java | 49 ++ .../pcs2/domain/FileInfoWithMetadata.java | 41 ++ .../mezeo/pcs2/domain/FileMetadata.java | 188 ------- .../mezeo/pcs2/domain/MutableFileInfo.java | 49 ++ .../pcs2/domain/MutableResourceInfo.java | 69 +++ .../jclouds/mezeo/pcs2/domain/PCSFile.java | 62 ++- .../mezeo/pcs2/domain/ResourceInfo.java | 69 +++ .../domain/internal/ContainerInfoImpl.java | 54 +- .../domain/internal/ContainerListImpl.java | 122 +++++ .../pcs2/domain/internal/FileInfoImpl.java | 124 +++++ .../internal/FileInfoWithMetadataImpl.java | 77 +++ .../domain/internal/MutableFileInfoImpl.java | 140 +++++ .../internal/MutableResourceInfoImpl.java | 276 ++++++++++ .../pcs2/domain/internal/PCSFileImpl.java | 118 ++++ .../ResourceInfoImpl.java} | 234 ++++---- .../mezeo/pcs2/endpoints/Contacts.java | 2 +- .../mezeo/pcs2/endpoints/Metacontainers.java | 2 +- .../mezeo/pcs2/endpoints/Projects.java | 2 +- .../mezeo/pcs2/endpoints/Recyclebin.java | 2 +- .../mezeo/pcs2/endpoints/RootContainer.java | 2 +- .../jclouds/mezeo/pcs2/endpoints/Shares.java | 2 +- .../jclouds/mezeo/pcs2/endpoints/Tags.java | 2 +- .../jclouds/mezeo/pcs2/endpoints/WebDAV.java | 2 +- .../functions/AddMetadataAndReturnId.java | 117 ---- ...toMap.java => AddMetadataItemIntoMap.java} | 6 +- ...sembleBlobFromContentAndMetadataCache.java | 70 --- .../ContainerAndFileNameToResourceId.java | 75 --- ...eSubFolderIfNotExistsAndGetResourceId.java | 142 ----- ...ubFolderIfNotExistsAndNewFileResource.java | 105 ---- .../pcs2/functions/FindIdInContainerList.java | 101 ---- .../pcs2/functions/FindIdInFileList.java | 79 --- ...eContainerNameCacheAndReturnTrueIf2xx.java | 66 --- ...validatePCSKeyCacheAndReturnVoidIf2xx.java | 73 --- .../ReturnFalseIfContainerNotFound.java | 2 +- .../ReturnTrueIfContainerAlreadyExists.java | 2 +- .../handlers/PCSClientErrorRetryHandler.java | 2 +- .../mezeo/pcs2/options/PutBlockOptions.java | 6 +- .../mezeo/pcs2/reference/PCSConstants.java | 2 +- .../pcs2/xml/BaseFileMetadataHandler.java | 112 ---- ...ileListToContainerMetadataListHandler.java | 57 -- .../mezeo/pcs2/xml/CloudXlinkHandler.java | 2 +- .../mezeo/pcs2/xml/ContainerHandler.java | 278 ++++++++++ ...adataListHandler.java => FileHandler.java} | 152 +++--- .../FileListToFileMetadataListHandler.java | 69 --- .../mezeo/pcs2/xml/FileMetadataHandler.java | 102 ---- .../mezeo/pcs2/PCSBlobStoreLiveTest.java | 86 --- .../jclouds/mezeo/pcs2/PCSBlobStoreTest.java | 512 ------------------ .../jclouds/mezeo/pcs2/PCSClientLiveTest.java | 252 +++++++++ .../org/jclouds/mezeo/pcs2/PCSClientTest.java | 311 +++++++++++ .../jclouds/mezeo/pcs2/PCSCloudLiveTest.java | 2 +- .../org/jclouds/mezeo/pcs2/PCSCloudTest.java | 106 ++++ .../mezeo/pcs2/PCSConnectionLiveTest.java | 165 ------ .../jclouds/mezeo/pcs2/PCSConnectionTest.java | 298 ---------- .../mezeo/pcs2/PCSContextBuilderTest.java | 51 +- .../mezeo/pcs2/PCSContextModuleTest.java | 79 --- .../BindContainerNameToXmlEntityTest.java | 2 +- .../binders/BindFileInfoToXmlEntityTest.java | 14 +- .../pcs2/config/PCSContextModuleTest.java | 15 +- ...reModule.java => PCSStubClientModule.java} | 21 +- .../functions/AddMetadataAndReturnIdTest.java | 242 ++++----- .../AssembleBlobFromBlobMetadataCallTest.java | 56 +- .../functions/FindIdInContainerListTest.java | 163 ------ .../functions/FindIdInFileListIdTest.java | 76 --- .../PCSBlobMapIntegrationTest.java | 55 -- .../PCSBlobStoreContainerIntegrationTest.java | 40 -- .../PCSBlobStoreContainerLiveTest.java | 40 -- .../PCSBlobStoreIntegrationTest.java | 119 ---- .../PCSBlobStoreServiceIntegrationTest.java | 40 -- .../PCSInputStreamMapIntegrationTest.java | 78 --- .../pcs2/integration/PCSTestInitializer.java | 61 --- ...bPCSConnection.java => PCSStubClient.java} | 49 +- .../pcs2/options/PutBlockOptionsTest.java | 2 +- .../mezeo/pcs2/xml/CloudXlinkHanderTest.java | 2 +- .../mezeo/pcs2/xml/ContainerHandlerTest.java | 168 ++++++ ...FileListToFileMetadataListHandlerTest.java | 81 --- .../pcs2/xml/FileMetadataHandlerTest.java | 85 ++- .../core/src/test/resources/discovery.xml | 25 + mezeo/pcs2/core/src/test/resources/log4j.xml | 2 +- .../src/test/resources/test_file_list.xml | 99 ---- .../src/test/resources/test_file_metadata.xml | 27 +- .../test/resources/test_root_container.xml | 142 +++++ mezeo/pcs2/pom.xml | 2 +- .../java/org/jclouds/nirvanix/sdn/SDN.java | 2 +- .../nirvanix/sdn/SDNAuthentication.java | 2 +- .../{SDNConnection.java => SDNClient.java} | 9 +- .../nirvanix/sdn/SDNContextBuilder.java | 114 +--- .../nirvanix/sdn/SDNPropertiesBuilder.java | 73 +++ .../jclouds/nirvanix/sdn/SessionToken.java | 2 +- .../binders/BindMetadataToQueryParams.java | 2 +- .../config/RestSDNAuthenticationModule.java | 2 +- ...onModule.java => RestSDNClientModule.java} | 10 +- .../nirvanix/sdn/config/SDNContextModule.java | 27 +- .../nirvanix/sdn/domain/UploadInfo.java | 2 +- .../sdn/filters/AddSessionTokenToRequest.java | 2 +- .../filters/InsertUserContextIntoPath.java | 2 +- .../ParseMetadataFromJsonResponse.java | 2 +- .../ParseSessionTokenFromJsonResponse.java | 2 +- .../ParseUploadInfoFromJsonResponse.java | 2 +- .../nirvanix/sdn/reference/SDNConstants.java | 2 +- .../sdn/reference/SDNQueryParams.java | 2 +- .../sdn/SDNAuthenticationLiveTest.java | 2 +- .../nirvanix/sdn/SDNAuthenticationTest.java | 11 +- ...onLiveTest.java => SDNClientLiveTest.java} | 31 +- ...ConnectionTest.java => SDNClientTest.java} | 31 +- .../BindMetadataToQueryParamsTest.java | 2 +- .../filters/AddSessionTokenToRequestTest.java | 2 +- .../InsertUserContextIntoPathTest.java | 2 +- .../ParseMetadataFromJsonResponseTest.java | 2 +- ...ParseSessionTokenFromJsonResponseTest.java | 2 +- .../ParseUploadInfoFromJsonResponseTest.java | 2 +- .../sdn/core/src/test/resources/log4j.xml | 2 +- project/LICENSE.txt | 2 +- project/src/etc/header.txt | 2 +- .../cloudfiles/CloudFilesBlobStore.java | 143 ----- ...sConnection.java => CloudFilesClient.java} | 39 +- .../cloudfiles/CloudFilesContextBuilder.java | 109 +--- .../cloudfiles/CloudFilesContextFactory.java | 26 +- .../CloudFilesPropertiesBuilder.java | 50 +- .../binders/BindCFObjectAsEntity.java | 20 +- .../config/CloudFilesContextModule.java | 49 +- .../config/CloudFilesRestClientModule.java | 54 ++ .../config/RestCloudFilesBlobStoreModule.java | 65 --- .../cloudfiles/domain/AccountMetadata.java | 4 +- .../domain/ContainerCDNMetadata.java | 92 ++-- .../cloudfiles/domain/ContainerMetadata.java | 58 +- ...rseAccountMetadataResponseFromHeaders.java | 2 +- ...> ParseBlobFromHeadersAndHttpContent.java} | 15 +- ...ParseBlobMetadataListFromJsonResponse.java | 55 +- .../functions/ParseCdnUriFromHeaders.java | 2 +- .../ParseContainerCDNMetadataFromHeaders.java | 2 +- ...tainerCDNMetadataListFromGsonResponse.java | 2 +- .../ParseContainerListFromJsonResponse.java | 5 +- .../ParseObjectMetadataFromHeaders.java | 20 +- .../functions/ReturnTrueOn404FalseOn409.java | 2 +- .../options/ListCdnContainerOptions.java | 2 +- .../options/ListContainerOptions.java | 74 ++- .../rackspace/cloudfiles/package-info.java | 2 +- .../reference/CloudFilesConstants.java | 23 +- .../reference/CloudFilesHeaders.java | 2 +- .../cloudfiles/reference/package-info.java | 2 +- ...est.java => CloudFilesClientLiveTest.java} | 100 +++- .../CloudFilesContextBuilderTest.java | 49 +- .../CloudFilesContextModuleTest.java | 29 +- .../binders/BindCFObjectAsEntityTest.java | 93 ++++ .../StubCloudFilesClientModule.java} | 33 +- ...eBlobMetadataListFromJsonResponseTest.java | 30 +- ...arseContainerListFromJsonResponseTest.java | 6 +- .../ParseObjectMetadataFromHeadersTest.java | 31 +- .../CloudFilesBlobIntegrationTest.java | 54 -- .../integration/CloudFilesBlobLiveTest.java | 43 -- .../CloudFilesBlobMapIntegrationTest.java | 41 -- .../CloudFilesContainerIntegrationTest.java | 42 -- .../CloudFilesContainerLiveTest.java | 42 -- ...oudFilesInputStreamMapIntegrationTest.java | 41 -- .../CloudFilesServiceIntegrationTest.java | 41 -- .../CloudFilesTestInitializer.java | 58 -- ...nection.java => StubCloudFilesClient.java} | 99 ++-- .../options/ListContainerOptionsTest.java | 194 +++++++ ...onnection.java => CloudServersClient.java} | 4 +- .../cloudservers/CloudServersContext.java | 39 -- .../CloudServersContextBuilder.java | 93 +--- .../CloudServersContextFactory.java | 27 +- .../binders/BindAdminPassToJsonEntity.java | 2 +- .../BindBackupScheduleToJsonEntity.java | 2 +- .../BindConfirmResizeToJsonEntity.java | 2 +- .../binders/BindCreateImageToJsonEntity.java | 2 +- .../binders/BindRebootTypeToJsonEntity.java | 2 +- .../binders/BindResizeFlavorToJsonEntity.java | 2 +- .../binders/BindRevertResizeToJsonEntity.java | 2 +- .../binders/BindServerNameToJsonEntity.java | 2 +- .../BindSharedIpGroupToJsonEntity.java | 2 +- .../config/CloudServersContextModule.java | 27 +- ...java => CloudServersRestClientModule.java} | 14 +- .../cloudservers/domain/AbsoluteLimit.java | 3 +- .../rackspace/cloudservers/domain/Action.java | 2 +- .../cloudservers/domain/Addresses.java | 2 +- .../cloudservers/domain/BackupSchedule.java | 2 +- .../cloudservers/domain/DailyBackup.java | 3 +- .../rackspace/cloudservers/domain/Flavor.java | 3 +- .../rackspace/cloudservers/domain/Image.java | 2 +- .../cloudservers/domain/ImageStatus.java | 3 +- .../rackspace/cloudservers/domain/Limits.java | 2 +- .../cloudservers/domain/RateLimit.java | 2 +- .../cloudservers/domain/RateLimitUnit.java | 2 +- .../cloudservers/domain/RebootType.java | 2 +- .../rackspace/cloudservers/domain/Server.java | 2 +- .../cloudservers/domain/ServerStatus.java | 2 +- .../cloudservers/domain/ShareIp.java | 2 +- .../cloudservers/domain/SharedIpGroup.java | 2 +- .../cloudservers/domain/Version.java | 2 +- .../cloudservers/domain/VersionStatus.java | 2 +- .../cloudservers/domain/WeeklyBackup.java | 3 +- .../cloudservers/functions/IpAddress.java | 2 +- .../ParseAddressesFromJsonResponse.java | 2 +- .../ParseBackupScheduleFromJsonResponse.java | 2 +- .../ParseFlavorFromJsonResponse.java | 2 +- .../ParseFlavorListFromJsonResponse.java | 2 +- .../functions/ParseImageFromJsonResponse.java | 2 +- .../ParseImageListFromJsonResponse.java | 2 +- .../ParseInetAddressListFromJsonResponse.java | 2 +- .../ParseServerFromJsonResponse.java | 2 +- .../ParseServerListFromJsonResponse.java | 2 +- .../ParseSharedIpGroupFromJsonResponse.java | 2 +- ...arseSharedIpGroupListFromJsonResponse.java | 2 +- .../functions/ReturnFlavorNotFoundOn404.java | 2 +- .../functions/ReturnImageNotFoundOn404.java | 2 +- .../functions/ReturnServerNotFoundOn404.java | 2 +- .../ReturnSharedIpGroupNotFoundOn404.java | 2 +- .../options/CreateServerOptions.java | 2 +- .../options/CreateSharedIpGroupOptions.java | 2 +- .../cloudservers/options/ListOptions.java | 2 +- .../options/RebuildServerOptions.java | 2 +- ...t.java => CloudServersClientLiveTest.java} | 39 +- ...nTest.java => CloudServersClientTest.java} | 229 ++++---- .../BindAdminPassToJsonEntityTest.java | 2 +- .../BindCreateImageToJsonEntityTest.java | 2 +- .../BindRebootTypeToJsonEntityTest.java | 2 +- .../BindServerNameToJsonEntityTest.java | 2 +- .../cloudservers/domain/ServerTest.java | 2 +- .../ParseAddressesFromJsonResponseTest.java | 2 +- ...rseBackupScheduleFromJsonResponseTest.java | 2 +- .../ParseFlavorFromJsonResponseTest.java | 2 +- .../ParseFlavorListFromJsonResponseTest.java | 2 +- .../ParseImageFromJsonResponseTest.java | 2 +- .../ParseImageListFromJsonResponseTest.java | 2 +- ...seInetAddressListFromJsonResponseTest.java | 2 +- .../ParseServerFromJsonResponseTest.java | 2 +- .../ParseServerListFromJsonResponseTest.java | 2 +- ...arseSharedIpGroupFromJsonResponseTest.java | 2 +- ...SharedIpGroupListFromJsonResponseTest.java | 2 +- .../options/CreateServerOptionsTest.java | 2 +- .../CreateSharedIpGroupOptionsTest.java | 2 +- .../cloudservers/options/ListOptionsTest.java | 2 +- .../options/RebuildServerOptionsTest.java | 2 +- .../org/jclouds/rackspace/Authentication.java | 2 +- .../org/jclouds/rackspace/CloudFiles.java | 2 +- .../org/jclouds/rackspace/CloudFilesCDN.java | 2 +- .../org/jclouds/rackspace/CloudServers.java | 2 +- .../rackspace/RackspaceAuthentication.java | 2 +- .../rackspace/RackspaceContextBuilder.java | 99 ---- .../rackspace/RackspacePropertiesBuilder.java | 70 +++ ...=> RackspaceAuthenticationRestModule.java} | 4 +- .../filters/AuthenticateRequest.java | 2 +- ...arseAuthenticationResponseFromHeaders.java | 2 +- .../rackspace/options/BaseListOptions.java | 2 +- .../reference/RackspaceConstants.java | 2 +- .../rackspace/reference/RackspaceHeaders.java | 2 +- .../rackspace/reference/package-info.java | 2 +- .../RackspaceAuthenticationLiveTest.java | 32 +- .../RackspaceAuthenticationTest.java | 2 +- .../StubRackspaceAuthenticationModule.java | 2 +- .../options/BaseListOptionsTest.java | 2 +- rackspace/core/src/test/resources/log4j.xml | 7 +- .../resteasy/specimpl/MultivaluedMapImpl.java | 2 +- .../resteasy/specimpl/UriBuilderImpl.java | 2 +- .../java/org/jboss/resteasy/spi/Failure.java | 2 +- .../jboss/resteasy/spi/LoggableFailure.java | 2 +- .../java/org/jboss/resteasy/util/Encode.java | 2 +- .../resteasy/util/HttpResponseCodes.java | 2 +- .../org/jboss/resteasy/util/IsHttpMethod.java | 2 +- .../jboss/resteasy/util/MediaTypeHelper.java | 2 +- .../org/jboss/resteasy/util/PathHelper.java | 2 +- .../vcloudx/BaseVCloudXContextBuilder.java | 38 +- .../java/org/jclouds/vcloudx/VCloudToken.java | 2 +- ...oudXConnection.java => VCloudXClient.java} | 4 +- .../org/jclouds/vcloudx/VCloudXContext.java | 39 -- .../vcloudx/VCloudXContextBuilder.java | 116 ---- .../org/jclouds/vcloudx/VCloudXLogin.java | 2 +- .../org/jclouds/vcloudx/VCloudXMediaType.java | 3 +- .../vcloudx/VCloudXPropertiesBuilder.java | 76 +++ .../config/BaseVCloudXContextModule.java | 27 +- ....java => BaseVCloudXRestClientModule.java} | 14 +- .../RestVCloudXAuthenticationModule.java | 2 +- .../org/jclouds/vcloudx/domain/OrgLinks.java | 2 +- .../jclouds/vcloudx/endpoints/Catalog.java | 2 +- .../org/jclouds/vcloudx/endpoints/Org.java | 2 +- .../jclouds/vcloudx/endpoints/TaskList.java | 2 +- .../jclouds/vcloudx/endpoints/VCloudX.java | 2 +- .../org/jclouds/vcloudx/endpoints/VDC.java | 2 +- .../vcloudx/filters/SetVCloudTokenCookie.java | 2 +- .../ParseLoginResponseFromHeaders.java | 2 +- .../vcloudx/reference/VCloudXConstants.java | 2 +- .../vcloudx/reference/package-info.java | 2 +- .../jclouds/vcloudx/xml/OrgLinksHandler.java | 2 +- .../vcloudx/xml/OrgListToOrgUriHandler.java | 2 +- .../BaseVCloudXContextBuilderTest.java | 51 +- ...veTest.java => VCloudXClientLiveTest.java} | 16 +- ...ectionTest.java => VCloudXClientTest.java} | 17 +- .../jclouds/vcloudx/VCloudXLoginLiveTest.java | 27 +- .../org/jclouds/vcloudx/VCloudXLoginTest.java | 2 +- .../RestVCloudXAuthenticationModuleTest.java | 2 +- .../filters/SetVCloudTokenCookieTest.java | 2 +- .../ParseLoginResponseFromHeadersTest.java | 2 +- .../vcloudx/xml/OrgLinksHandlerTest.java | 2 +- .../xml/OrgListToOrgUriHandlerTest.java | 2 +- vcloudx/core/src/test/resources/log4j.xml | 2 +- vcloudx/core/src/test/resources/org.xml | 2 +- vcloudx/core/src/test/resources/orglist.xml | 2 +- 891 files changed, 17804 insertions(+), 13616 deletions(-) delete mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/S3BlobStore.java rename aws/s3/core/src/main/java/org/jclouds/aws/s3/{S3Connection.java => S3Client.java} (94%) create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/S3PropertiesBuilder.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/S3BlobStore.java create mode 100755 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/S3BlobStoreContextBuilder.java create mode 100755 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/S3BlobStoreContextFactory.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/S3BlobStorePropertiesBuilder.java create mode 100755 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/config/S3BlobStoreContextModule.java rename mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/functions/ContainerNameToResourceId.java => aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/functions/BlobToObject.java (55%) create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/functions/BlobToObjectGetOptions.java rename rackspace/cloudfiles/core/src/main/java/org/jclouds/rackspace/cloudfiles/CloudFilesContext.java => aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/functions/BlobToObjectMetadata.java (52%) create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/functions/BucketToContainerListOptions.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/functions/BucketToResourceList.java rename aws/s3/core/src/main/java/org/jclouds/aws/s3/{S3Context.java => blobstore/functions/BucketToResourceMetadata.java} (57%) create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/functions/CommonPrefixesToResourceMetadata.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/functions/ContainerToBucketListOptions.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/functions/ObjectToBlob.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/functions/ObjectToBlobMetadata.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/blobstore/functions/ResourceToBucketList.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/config/S3ObjectModule.java rename aws/s3/core/src/main/java/org/jclouds/aws/s3/config/{RestS3ConnectionModule.java => S3RestClientModule.java} (83%) mode change 100644 => 100755 create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/domain/MutableObjectMetadata.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/domain/internal/BucketListObjectMetadata.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/domain/internal/CopyObjectResult.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/domain/internal/MutableObjectMetadataImpl.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/domain/internal/S3ObjectImpl.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/domain/internal/TreeSetListBucketResponse.java delete mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/functions/ClearAndDeleteBucketIfNotEmpty.java create mode 100644 aws/s3/core/src/main/java/org/jclouds/aws/s3/functions/ObjectKey.java rename aws/s3/core/src/test/java/org/jclouds/aws/s3/{S3ConnectionLiveTest.java => S3ClientLiveTest.java} (90%) create mode 100644 aws/s3/core/src/test/java/org/jclouds/aws/s3/S3ClientTest.java create mode 100644 aws/s3/core/src/test/java/org/jclouds/aws/s3/blobstore/S3BlobStoreContextBuilderTest.java create mode 100755 aws/s3/core/src/test/java/org/jclouds/aws/s3/blobstore/config/S3BlobStoreModuleTest.java rename aws/s3/core/src/test/java/org/jclouds/aws/s3/{ => blobstore}/integration/S3BlobIntegrationTest.java (73%) rename aws/s3/core/src/test/java/org/jclouds/aws/s3/{ => blobstore}/integration/S3BlobLiveTest.java (73%) rename aws/s3/core/src/test/java/org/jclouds/aws/s3/{ => blobstore}/integration/S3BlobMapIntegrationTest.java (72%) rename aws/s3/core/src/test/java/org/jclouds/aws/s3/{ => blobstore}/integration/S3ContainerIntegrationTest.java (72%) rename aws/s3/core/src/test/java/org/jclouds/aws/s3/{ => blobstore}/integration/S3ContainerLiveTest.java (73%) rename aws/s3/core/src/test/java/org/jclouds/aws/s3/{ => blobstore}/integration/S3InputStreamMapIntegrationTest.java (75%) rename aws/s3/core/src/test/java/org/jclouds/aws/s3/{ => blobstore}/integration/S3ServiceIntegrationTest.java (72%) rename aws/s3/core/src/test/java/org/jclouds/aws/s3/{ => blobstore}/integration/S3TestInitializer.java (57%) rename aws/s3/core/src/test/java/org/jclouds/aws/s3/config/{RestS3ConnectionModuleTest.java => S3RestClientModuleTest.java} (92%) create mode 100755 aws/s3/core/src/test/java/org/jclouds/aws/s3/config/S3StubClientModule.java delete mode 100755 aws/s3/core/src/test/java/org/jclouds/aws/s3/config/StubS3BlobStoreModule.java create mode 100644 aws/s3/core/src/test/java/org/jclouds/aws/s3/functions/ParseObjectMetadataFromHeadersTest.java rename aws/s3/core/src/test/java/org/jclouds/aws/s3/internal/{StubS3Connection.java => StubS3Client.java} (56%) rename mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/xml/FileListToContainerMetadataListHandlerTest.java => aws/s3/core/src/test/java/org/jclouds/aws/s3/xml/CopyObjectHandlerTest.java (50%) create mode 100644 aws/s3/core/src/test/resources/copy_object.xml create mode 100644 aws/s3/core/src/test/resources/list_bucket.xml rename azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/{AzureBlobConnection.java => AzureBlobClient.java} (86%) delete mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/AzureBlobContext.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/AzureBlobPropertiesBuilder.java delete mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/AzureBlobStore.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/binders/BindAzureBlobToEntity.java delete mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/binders/BindBlobToEntity.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/AzureBlobToBlob.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/BlobMetadataToBlobProperties.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/BlobName.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/blobstore/functions/BlobPropertiesToBlobMetadata.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/config/AzureBlobModule.java rename azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/config/{RestAzureBlobStoreModule.java => AzureBlobRestClientModule.java} (61%) create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/AzureBlob.java delete mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/BlobMetadata.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/BlobProperties.java delete mode 100755 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/ContainerMetadata.java rename nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNContext.java => azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/ContainerProperties.java (71%) create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/ListableBlobProperties.java rename mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/PCSObject.java => azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/ListableContainerProperties.java (77%) mode change 100644 => 100755 create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/MutableBlobProperties.java rename azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/{Blob.java => MutableContainerPropertiesWithMetadata.java} (52%) delete mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/TreeSetListBlobsResponse.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/internal/AzureBlobImpl.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/internal/ListableBlobPropertiesImpl.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/internal/ListableContainerPropertiesImpl.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/internal/MutableBlobPropertiesImpl.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/internal/MutableContainerPropertiesWithMetadataImpl.java rename aws/s3/core/src/main/java/org/jclouds/aws/s3/domain/TreeSetListBucketResponse.java => azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/domain/internal/TreeSetListBlobsResponse.java (53%) delete mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/functions/ParseBlobMetadataFromHeaders.java create mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/functions/ParseBlobPropertiesFromHeaders.java rename azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/functions/{ParseContainerMetadataFromHeaders.java => ParseContainerPropertiesFromHeaders.java} (69%) delete mode 100644 azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/xml/AddMD5ToListBlobsResponse.java rename azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/{AzureBlobConnectionLiveTest.java => AzureBlobClientLiveTest.java} (78%) rename azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/{AzureBlobConnectionTest.java => AzureBlobClientTest.java} (84%) delete mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/AzureBlobStoreTest.java create mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/config/AzureBlobStubClientModule.java rename azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/config/{RestAzureBlobConnectionModuleTest.java => RestAzureBlobClientModuleTest.java} (92%) delete mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/config/StubAzureBlobStoreModule.java delete mode 100755 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/integration/AzureBlobContainerIntegrationTest.java delete mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/integration/AzureBlobContainerLiveTest.java delete mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/integration/AzureBlobInputStreamMapIntegrationTest.java delete mode 100755 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/integration/AzureBlobIntegrationTest.java delete mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/integration/AzureBlobLiveTest.java delete mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/integration/AzureBlobMapIntegrationTest.java delete mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/integration/AzureBlobServiceIntegrationTest.java delete mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/integration/AzureBlobTestInitializer.java create mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/internal/StubAzureBlobClient.java delete mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/internal/StubAzureBlobConnection.java delete mode 100644 azure/storage/blob/core/src/test/java/org/jclouds/azure/storage/blob/xml/AddMD5ToListBlobsResponseTest.java rename azure/storage/core/src/main/java/org/jclouds/azure/storage/config/{RestAzureStorageConnectionModule.java => AzureStorageRestClientModule.java} (93%) rename azure/storage/core/src/main/java/org/jclouds/azure/storage/domain/{BoundedSortedSet.java => BoundedList.java} (80%) create mode 100644 azure/storage/core/src/main/java/org/jclouds/azure/storage/domain/internal/BoundedTreeSet.java rename azure/storage/core/src/test/java/org/jclouds/azure/storage/config/{RestAzureStorageConnectionModuleTest.java => AzureStorageRestClientModuleTest.java} (91%) rename azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/{AzureQueueConnection.java => AzureQueueClient.java} (95%) create mode 100644 azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueuePropertiesBuilder.java rename azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/config/{RestAzureQueueConnectionModule.java => AzureQueueRestClientModule.java} (76%) delete mode 100644 azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/internal/GuiceAzureQueueContext.java rename azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/{AzureQueueConnectionLiveTest.java => AzureQueueClientLiveTest.java} (83%) rename azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/{AzureQueueConnectionTest.java => AzureQueueClientTest.java} (86%) delete mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/BlobStoreContextImpl.java delete mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/BlobStoreMapsModule.java rename mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/util/PCSUtils.java => blobstore/core/src/main/java/org/jclouds/blobstore/BlobStorePropertiesBuilder.java (53%) create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/BlobCapabilities.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/BlobCapability.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/BlobScope.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/BlobScopes.java rename mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/reference/PCSHeaders.java => blobstore/core/src/main/java/org/jclouds/blobstore/attr/Charge.java (67%) create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/Charges.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/ConsistencyModel.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/ConsistencyModels.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/ContainerCapabilities.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/ContainerCapability.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/ContainerVisibilities.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/ContainerVisibility.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/attr/FolderCapability.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/config/BlobStoreMapModule.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/config/BlobStoreObjectModule.java rename {core/src/main/java/org/jclouds/rest/internal => blobstore/core/src/main/java/org/jclouds/blobstore/domain}/BoundedSortedSet.java (87%) delete mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/domain/Key.java rename mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/util/PCSUtilsTest.java => blobstore/core/src/main/java/org/jclouds/blobstore/domain/MD5InputStreamResult.java (62%) rename azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueContext.java => blobstore/core/src/main/java/org/jclouds/blobstore/domain/MutableBlobMetadata.java (60%) create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/domain/MutableResourceMetadata.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/domain/ResourceMetadata.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/domain/ResourceType.java rename blobstore/core/src/main/java/org/jclouds/blobstore/{ => domain}/internal/BlobImpl.java (53%) create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/domain/internal/BlobMetadataImpl.java rename {core/src/main/java/org/jclouds/rest => blobstore/core/src/main/java/org/jclouds/blobstore/domain}/internal/BoundedTreeSet.java (71%) create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/domain/internal/MutableBlobMetadataImpl.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/domain/internal/MutableResourceMetadataImpl.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/domain/internal/ResourceMetadataImpl.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/functions/CalculateSize.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/functions/GenerateMD5.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/functions/GenerateMD5Result.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/functions/HttpGetOptionsListToGetOptions.java delete mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/functions/ParseContentTypeFromHeaders.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/BouncyCastleGenerateMD5.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/BouncyCastleGenerateMD5Result.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/functions/impl/CalculateSizeByLength.java delete mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/internal/BlobMetadataImpl.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/internal/BlobStoreContextImpl.java delete mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/internal/ContainerMetadataImpl.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/options/GetOptions.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/options/ListOptions.java create mode 100644 blobstore/core/src/main/java/org/jclouds/blobstore/strategy/ClearListStrategy.java rename blobstore/core/src/main/java/org/jclouds/blobstore/strategy/{ContainsValueStrategy.java => ContainsValueInListStrategy.java} (69%) rename blobstore/core/src/main/java/org/jclouds/blobstore/strategy/{ContainerCountStrategy.java => CountListStrategy.java} (70%) rename blobstore/core/src/main/java/org/jclouds/blobstore/strategy/{GetAllBlobsStrategy.java => GetBlobsInListStrategy.java} (73%) rename blobstore/core/src/main/java/org/jclouds/blobstore/strategy/{GetAllBlobMetadataStrategy.java => ListBlobMetadataStrategy.java} (69%) rename blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/{KeyCountStrategy.java => CountBlobTypeInList.java} (55%) rename blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/{DeleteAllKeysClearContainerStrategy.java => DeleteAllKeysInList.java} (68%) rename blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/{ContentMD5ContainsValueStrategy.java => FindMD5InList.java} (68%) rename blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/{RetryOnNotFoundGetAllBlobsStrategy.java => GetAllBlobsInListAndRetryOnFailure.java} (64%) rename blobstore/core/src/main/java/org/jclouds/blobstore/strategy/internal/{ContainerListGetAllBlobMetadataStrategy.java => ListBlobMetadataInContainer.java} (59%) delete mode 100644 blobstore/core/src/test/java/org/jclouds/blobstore/BlobStoreMapsModuleTest.java rename blobstore/core/src/test/java/org/jclouds/blobstore/domain/{BlobTest.java => internal/MutableBlobMetadataImplTest.java} (68%) rename blobstore/core/src/test/java/org/jclouds/blobstore/integration/config/{StubBlobStoreConnectionModule.java => StubBlobStoreModule.java} (60%) create mode 100644 blobstore/core/src/test/java/org/jclouds/blobstore/options/GetOptionsTest.java create mode 100644 blobstore/core/src/test/java/org/jclouds/blobstore/options/ListOptionsTest.java create mode 100755 core/src/main/java/org/jclouds/http/HttpPropertiesBuilder.java rename core/src/main/java/org/jclouds/{cloud/ConfiguresCloudConnection.java => rest/ConfiguresRestClient.java} (84%) mode change 100644 => 100755 rename core/src/main/java/org/jclouds/{cloud/CloudContext.java => rest/RestContext.java} (90%) mode change 100644 => 100755 rename core/src/main/java/org/jclouds/{cloud/CloudContextBuilder.java => rest/RestContextBuilder.java} (62%) mode change 100644 => 100755 rename core/src/main/java/org/jclouds/{cloud/internal/CloudContextImpl.java => rest/internal/RestContextImpl.java} (85%) rename core/src/main/java/org/jclouds/ssh/{ConfiguresSshConnection.java => ConfiguresSshClient.java} (87%) rename core/src/main/java/org/jclouds/ssh/{SshConnection.java => SshClient.java} (77%) rename mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/integration/PCSBlobStoreLiveTest.java => core/src/test/java/org/jclouds/http/HttpPropertiesBuilderTest.java (50%) mode change 100644 => 100755 create mode 100644 core/src/test/java/org/jclouds/rest/RestClientTest.java rename core/src/test/java/org/jclouds/{cloud/CloudContextBuilderTest.java => rest/RestContextBuilderTest.java} (71%) mode change 100644 => 100755 rename extensions/ssh/jsch/src/main/java/org/jclouds/ssh/jsch/{JschSshConnection.java => JschSshClient.java} (91%) rename extensions/ssh/jsch/src/main/java/org/jclouds/ssh/jsch/config/{JschSshConnectionModule.java => JschSshClientModule.java} (63%) rename extensions/ssh/jsch/src/test/java/org/jclouds/ssh/jsch/{JschSshConnectionLiveTest.java => JschSshClientLiveTest.java} (80%) rename extensions/ssh/jsch/src/test/java/org/jclouds/ssh/jsch/config/{JschSshConnectionModuleTest.java => JschSshClientModuleTest.java} (66%) delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/PCSBlobStore.java rename mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/{PCSConnection.java => PCSClient.java} (71%) delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/PCSContext.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/PCSPropertiesBuilder.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/PCSUtil.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/binders/BindPCSFileToMultipartForm.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/blobstore/functions/BlobToFileInfo.java rename rackspace/cloudfiles/core/src/main/java/org/jclouds/rackspace/cloudfiles/functions/ClearAndDeleteContainerIfNotEmpty.java => mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/blobstore/functions/BlobToPCSFile.java (52%) create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/blobstore/functions/FileInfoToBlobMetadata.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/blobstore/functions/PCSFileToBlob.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/config/PCSObjectModule.java rename mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/config/{RestPCSBlobStoreModule.java => PCSRestClientModule.java} (79%) rename blobstore/core/src/main/java/org/jclouds/blobstore/domain/ContainerMetadata.java => mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/ContainerInfo.java (74%) create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/ContainerList.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/FileInfo.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/FileInfoWithMetadata.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/FileMetadata.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/MutableFileInfo.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/MutableResourceInfo.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/ResourceInfo.java rename azure/storage/core/src/main/java/org/jclouds/azure/storage/domain/BoundedTreeSet.java => mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/internal/ContainerInfoImpl.java (55%) create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/internal/ContainerListImpl.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/internal/FileInfoImpl.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/internal/FileInfoWithMetadataImpl.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/internal/MutableFileInfoImpl.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/internal/MutableResourceInfoImpl.java create mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/internal/PCSFileImpl.java rename mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/domain/{ContainerMetadata.java => internal/ResourceInfoImpl.java} (51%) delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/functions/AddMetadataAndReturnId.java rename mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/functions/{AddEntryIntoMap.java => AddMetadataItemIntoMap.java} (91%) delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/functions/AssembleBlobFromContentAndMetadataCache.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/functions/ContainerAndFileNameToResourceId.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/functions/CreateSubFolderIfNotExistsAndGetResourceId.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/functions/CreateSubFolderIfNotExistsAndNewFileResource.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/functions/FindIdInContainerList.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/functions/FindIdInFileList.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/functions/InvalidateContainerNameCacheAndReturnTrueIf2xx.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/functions/InvalidatePCSKeyCacheAndReturnVoidIf2xx.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/xml/BaseFileMetadataHandler.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/xml/CachingFileListToContainerMetadataListHandler.java create mode 100755 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/xml/ContainerHandler.java rename mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/xml/{FileListToContainerMetadataListHandler.java => FileHandler.java} (55%) mode change 100755 => 100644 delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/xml/FileListToFileMetadataListHandler.java delete mode 100644 mezeo/pcs2/core/src/main/java/org/jclouds/mezeo/pcs2/xml/FileMetadataHandler.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/PCSBlobStoreLiveTest.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/PCSBlobStoreTest.java create mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/PCSClientLiveTest.java create mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/PCSClientTest.java create mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/PCSCloudTest.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/PCSConnectionLiveTest.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/PCSConnectionTest.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/PCSContextModuleTest.java rename mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/config/{StubPCSBlobStoreModule.java => PCSStubClientModule.java} (69%) delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/functions/FindIdInContainerListTest.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/functions/FindIdInFileListIdTest.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/integration/PCSBlobMapIntegrationTest.java delete mode 100755 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/integration/PCSBlobStoreContainerIntegrationTest.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/integration/PCSBlobStoreContainerLiveTest.java delete mode 100755 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/integration/PCSBlobStoreIntegrationTest.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/integration/PCSBlobStoreServiceIntegrationTest.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/integration/PCSInputStreamMapIntegrationTest.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/integration/PCSTestInitializer.java rename mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/internal/{StubPCSConnection.java => PCSStubClient.java} (74%) create mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/xml/ContainerHandlerTest.java delete mode 100644 mezeo/pcs2/core/src/test/java/org/jclouds/mezeo/pcs2/xml/FileListToFileMetadataListHandlerTest.java delete mode 100644 mezeo/pcs2/core/src/test/resources/test_file_list.xml create mode 100644 mezeo/pcs2/core/src/test/resources/test_root_container.xml rename nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/{SDNConnection.java => SDNClient.java} (94%) create mode 100644 nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNPropertiesBuilder.java rename nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/{RestSDNConnectionModule.java => RestSDNClientModule.java} (83%) rename nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/{SDNConnectionLiveTest.java => SDNClientLiveTest.java} (77%) rename nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/{SDNConnectionTest.java => SDNClientTest.java} (88%) delete mode 100644 rackspace/cloudfiles/core/src/main/java/org/jclouds/rackspace/cloudfiles/CloudFilesBlobStore.java rename rackspace/cloudfiles/core/src/main/java/org/jclouds/rackspace/cloudfiles/{CloudFilesConnection.java => CloudFilesClient.java} (88%) rename azure/storage/blob/core/src/main/java/org/jclouds/azure/storage/blob/binders/GenerateMD5AndBindBlobToEntity.java => rackspace/cloudfiles/core/src/main/java/org/jclouds/rackspace/cloudfiles/CloudFilesPropertiesBuilder.java (53%) create mode 100755 rackspace/cloudfiles/core/src/main/java/org/jclouds/rackspace/cloudfiles/config/CloudFilesRestClientModule.java delete mode 100755 rackspace/cloudfiles/core/src/main/java/org/jclouds/rackspace/cloudfiles/config/RestCloudFilesBlobStoreModule.java rename rackspace/cloudfiles/core/src/main/java/org/jclouds/rackspace/cloudfiles/functions/{ParseObjectFromHeadersAndHttpContent.java => ParseBlobFromHeadersAndHttpContent.java} (67%) rename rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/{CloudFilesConnectionLiveTest.java => CloudFilesClientLiveTest.java} (83%) create mode 100644 rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/binders/BindCFObjectAsEntityTest.java rename rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/{integration/StubCloudFilesBlobStoreModule.java => config/StubCloudFilesClientModule.java} (54%) delete mode 100755 rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/integration/CloudFilesBlobIntegrationTest.java delete mode 100644 rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/integration/CloudFilesBlobLiveTest.java delete mode 100644 rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/integration/CloudFilesBlobMapIntegrationTest.java delete mode 100755 rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/integration/CloudFilesContainerIntegrationTest.java delete mode 100644 rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/integration/CloudFilesContainerLiveTest.java delete mode 100644 rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/integration/CloudFilesInputStreamMapIntegrationTest.java delete mode 100644 rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/integration/CloudFilesServiceIntegrationTest.java delete mode 100644 rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/integration/CloudFilesTestInitializer.java rename rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/internal/{StubCloudFilesConnection.java => StubCloudFilesClient.java} (68%) create mode 100644 rackspace/cloudfiles/core/src/test/java/org/jclouds/rackspace/cloudfiles/options/ListContainerOptionsTest.java rename rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/{CloudServersConnection.java => CloudServersClient.java} (99%) delete mode 100755 rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/CloudServersContext.java rename rackspace/cloudservers/core/src/main/java/org/jclouds/rackspace/cloudservers/config/{RestCloudServersConnectionModule.java => CloudServersRestClientModule.java} (75%) rename rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/{CloudServersConnectionLiveTest.java => CloudServersClientLiveTest.java} (95%) rename rackspace/cloudservers/core/src/test/java/org/jclouds/rackspace/cloudservers/{CloudServersConnectionTest.java => CloudServersClientTest.java} (81%) delete mode 100755 rackspace/core/src/main/java/org/jclouds/rackspace/RackspaceContextBuilder.java create mode 100644 rackspace/core/src/main/java/org/jclouds/rackspace/RackspacePropertiesBuilder.java rename rackspace/core/src/main/java/org/jclouds/rackspace/config/{RestRackspaceAuthenticationModule.java => RackspaceAuthenticationRestModule.java} (95%) rename vcloudx/core/src/main/java/org/jclouds/vcloudx/{VCloudXConnection.java => VCloudXClient.java} (94%) delete mode 100644 vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXContext.java delete mode 100755 vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXContextBuilder.java create mode 100644 vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXPropertiesBuilder.java rename vcloudx/core/src/main/java/org/jclouds/vcloudx/config/{BaseRestVCloudXConnectionModule.java => BaseVCloudXRestClientModule.java} (77%) rename vcloudx/core/src/test/java/org/jclouds/vcloudx/{VCloudXConnectionLiveTest.java => VCloudXClientLiveTest.java} (81%) rename vcloudx/core/src/test/java/org/jclouds/vcloudx/{VCloudXConnectionTest.java => VCloudXClientTest.java} (86%) diff --git a/aws/core/src/main/java/org/jclouds/aws/AWSResponseException.java b/aws/core/src/main/java/org/jclouds/aws/AWSResponseException.java index 8f418a4fa7..deb7ea6bdb 100644 --- a/aws/core/src/main/java/org/jclouds/aws/AWSResponseException.java +++ b/aws/core/src/main/java/org/jclouds/aws/AWSResponseException.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/core/src/main/java/org/jclouds/aws/domain/AWSError.java b/aws/core/src/main/java/org/jclouds/aws/domain/AWSError.java index 9929877286..5c3d0823f4 100644 --- a/aws/core/src/main/java/org/jclouds/aws/domain/AWSError.java +++ b/aws/core/src/main/java/org/jclouds/aws/domain/AWSError.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/core/src/main/java/org/jclouds/aws/reference/AWSConstants.java b/aws/core/src/main/java/org/jclouds/aws/reference/AWSConstants.java index fbfb6d92a8..fa6f40d3fa 100644 --- a/aws/core/src/main/java/org/jclouds/aws/reference/AWSConstants.java +++ b/aws/core/src/main/java/org/jclouds/aws/reference/AWSConstants.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/core/src/main/java/org/jclouds/aws/xml/ErrorHandler.java b/aws/core/src/main/java/org/jclouds/aws/xml/ErrorHandler.java index 3c68fc9ecd..5907d837ef 100644 --- a/aws/core/src/main/java/org/jclouds/aws/xml/ErrorHandler.java +++ b/aws/core/src/main/java/org/jclouds/aws/xml/ErrorHandler.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/core/src/test/java/org/jclouds/aws/xml/ErrorHandlerTest.java b/aws/core/src/test/java/org/jclouds/aws/xml/ErrorHandlerTest.java index 64b5cd0a90..03987cf3a7 100755 --- a/aws/core/src/test/java/org/jclouds/aws/xml/ErrorHandlerTest.java +++ b/aws/core/src/test/java/org/jclouds/aws/xml/ErrorHandlerTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -27,7 +27,6 @@ import static org.testng.Assert.assertEquals; import org.apache.commons.io.IOUtils; import org.jclouds.aws.domain.AWSError; -import org.jclouds.aws.xml.ErrorHandler; import org.jclouds.http.HttpException; import org.jclouds.http.functions.BaseHandlerTest; import org.jclouds.http.functions.ParseSax; @@ -37,7 +36,6 @@ import org.testng.annotations.Test; public class ErrorHandlerTest extends BaseHandlerTest { public static final String errorFromAmazonIfYouDontRemoveTransferEncodingHeader = "NotImplementedA header you provided implies functionality that is not implemented
Transfer-Encoding
7C59925D75D15561fbskVU51OZJg2yZS/wNIxoE2PmCf0ZqFd0iH6Vrzw0uKG3KmokswBytL/Bfp/GWb
"; - @SuppressWarnings("unchecked") ParseSax createParser() { ParseSax parser = (ParseSax) factory.create(injector .getInstance(ErrorHandler.class)); diff --git a/aws/core/src/test/resources/error.xml b/aws/core/src/test/resources/error.xml index ae4871d834..54e77c0e0e 100644 --- a/aws/core/src/test/resources/error.xml +++ b/aws/core/src/test/resources/error.xml @@ -1,4 +1,29 @@ + NoSuchKey The resource you requested does not exist diff --git a/aws/core/src/test/resources/log4j.xml b/aws/core/src/test/resources/log4j.xml index b3b07ae5e7..3be65a2ae2 100644 --- a/aws/core/src/test/resources/log4j.xml +++ b/aws/core/src/test/resources/log4j.xml @@ -2,7 +2,7 @@ + + 2009-03-19T13:23:27.000Z + "92836a3ea45a6984d1b4d23a747d46bb" + diff --git a/aws/s3/core/src/test/resources/list_bucket.xml b/aws/s3/core/src/test/resources/list_bucket.xml new file mode 100644 index 0000000000..eb408b37e3 --- /dev/null +++ b/aws/s3/core/src/test/resources/list_bucket.xml @@ -0,0 +1,152 @@ + + + adriancole.org.jclouds.aws.s3.amazons3testdelimiter + apps/ + + 1000 + false + + apps/0 + 2009-05-07T18:27:08.000Z + "c82e6a0025c31c5de5947fda62ac51ab" + 8 + + e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0 + + ferncam + + STANDARD + + + apps/1 + 2009-05-07T18:27:09.000Z + "944fab2c5a9a6bacf07db5e688310d7a" + 8 + + e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0 + + ferncam + + STANDARD + + + apps/2 + 2009-05-07T18:27:09.000Z + "a227b8888045c8fd159fb495214000f0" + 8 + + e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0 + + ferncam + + STANDARD + + + apps/3 + 2009-05-07T18:27:09.000Z + "c9caa76c3dec53e2a192608ce73eef03" + 8 + + e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0 + + ferncam + + STANDARD + + + apps/4 + 2009-05-07T18:27:09.000Z + "1ce5d0dcc6154a647ea90c7bdf82a224" + 8 + + e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0 + + ferncam + + STANDARD + + + apps/5 + 2009-05-07T18:27:09.000Z + "79433524d87462ee05708a8ef894ed55" + 8 + + e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0 + + ferncam + + STANDARD + + + apps/6 + 2009-05-07T18:27:10.000Z + "dd00a060b28ddca8bc5a21a49e306f67" + 8 + + e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0 + + ferncam + + STANDARD + + + apps/7 + 2009-05-07T18:27:10.000Z + "8cd06eca6e819a927b07a285d750b100" + 8 + + e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0 + + ferncam + + STANDARD + + + apps/8 + 2009-05-07T18:27:10.000Z + "174495094d0633b92cbe46603eee6bad" + 8 + + e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0 + + ferncam + + STANDARD + + + apps/9 + 2009-05-07T18:27:10.000Z + "cd8a19b26fea8a827276df0ad11c580d" + 8 + + e1a5f66a480ca99a4fdfe8e318c3020446c9989d7004e7778029fbcc5d990fa0 + + ferncam + + STANDARD + + diff --git a/aws/s3/extensions/jets3t/src/main/java/org/jclouds/aws/s3/jets3t/JCloudsS3Service.java b/aws/s3/extensions/jets3t/src/main/java/org/jclouds/aws/s3/jets3t/JCloudsS3Service.java index 51d34d52a4..6f00020b95 100644 --- a/aws/s3/extensions/jets3t/src/main/java/org/jclouds/aws/s3/jets3t/JCloudsS3Service.java +++ b/aws/s3/extensions/jets3t/src/main/java/org/jclouds/aws/s3/jets3t/JCloudsS3Service.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -32,10 +32,9 @@ import java.util.Map; import java.util.SortedSet; import java.util.concurrent.TimeUnit; -import org.jclouds.aws.s3.S3BlobStore; -import org.jclouds.aws.s3.S3Connection; -import org.jclouds.aws.s3.S3ContextFactory; -import org.jclouds.aws.s3.domain.BucketMetadata; +import org.jclouds.aws.s3.S3Client; +import org.jclouds.aws.s3.blobstore.S3BlobStore; +import org.jclouds.aws.s3.blobstore.S3BlobStoreContextFactory; import org.jclouds.aws.s3.domain.ListBucketResponse; import org.jclouds.aws.s3.domain.ObjectMetadata; import org.jclouds.aws.s3.options.CopyObjectOptions; @@ -65,8 +64,8 @@ public class JCloudsS3Service extends S3Service { private static final long serialVersionUID = 1L; - private final BlobStoreContext context; - private final S3Connection connection; + private final BlobStoreContext context; + private final S3Client connection; private final long requestTimeoutMilliseconds = 10000; @@ -83,8 +82,8 @@ public class JCloudsS3Service extends S3Service { protected JCloudsS3Service(AWSCredentials awsCredentials, Module... modules) throws S3ServiceException { super(awsCredentials); - context = S3ContextFactory.createContext(awsCredentials.getAccessKey(), awsCredentials - .getSecretKey(), modules); + context = S3BlobStoreContextFactory.createContext(awsCredentials.getAccessKey(), + awsCredentials.getSecretKey(), modules); connection = context.getApi(); } @@ -106,9 +105,9 @@ public class JCloudsS3Service extends S3Service { try { CopyObjectOptions options = Util.convertCopyObjectOptions(acl, destinationMetadata, ifModifiedSince, ifUnmodifiedSince, ifMatchTags, ifNoneMatchTags); - org.jclouds.aws.s3.domain.ObjectMetadata jcObjectMetadata = connection.copyObject( - sourceBucketName, sourceObjectKey, destinationBucketName, destinationObjectKey, - options).get(requestTimeoutMilliseconds, TimeUnit.MILLISECONDS); + ObjectMetadata jcObjectMetadata = connection.copyObject(sourceBucketName, sourceObjectKey, + destinationBucketName, destinationObjectKey, options).get( + requestTimeoutMilliseconds, TimeUnit.MILLISECONDS); Map map = new HashMap(); // Result fields returned when copy is successful. @@ -266,7 +265,7 @@ public class JCloudsS3Service extends S3Service { protected S3Bucket[] listAllBucketsImpl() throws S3ServiceException { try { SortedSet jcBucketList = connection - .listOwnedBuckets(); + .listOwnedBuckets().get(requestTimeoutMilliseconds, TimeUnit.MILLISECONDS); return Util.convertBuckets(jcBucketList); } catch (Exception e) { Utils. rethrowIfRuntimeOrSameType(e); @@ -284,7 +283,7 @@ public class JCloudsS3Service extends S3Service { ListBucketResponse jcBucket = null; do { ListBucketOptions options = Util.convertListObjectOptions(prefix, priorLastKey, - delimiter, maxListingLength); + delimiter, (int) maxListingLength); jcBucket = connection.listBucket(bucketName, options).get(requestTimeoutMilliseconds, TimeUnit.MILLISECONDS); @@ -351,7 +350,7 @@ public class JCloudsS3Service extends S3Service { protected S3Object putObjectImpl(String bucketName, S3Object jsObject) throws S3ServiceException { try { PutObjectOptions options = Util.convertPutObjectOptions(jsObject.getAcl()); - org.jclouds.aws.s3.domain.S3Object jcObject = Util.convertObject(jsObject); + org.jclouds.aws.s3.domain.S3Object jcObject = Util.convertObject(jsObject, connection.newS3Object()); String eTag = connection.putObject(bucketName, jcObject, options).get( requestTimeoutMilliseconds, TimeUnit.MILLISECONDS); jsObject.setETag(eTag); diff --git a/aws/s3/extensions/jets3t/src/main/java/org/jclouds/aws/s3/jets3t/Util.java b/aws/s3/extensions/jets3t/src/main/java/org/jclouds/aws/s3/jets3t/Util.java index 4dc608b0ff..16c375476f 100644 --- a/aws/s3/extensions/jets3t/src/main/java/org/jclouds/aws/s3/jets3t/Util.java +++ b/aws/s3/extensions/jets3t/src/main/java/org/jclouds/aws/s3/jets3t/Util.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -27,7 +27,6 @@ import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.Calendar; -import java.util.Collection; import java.util.Date; import java.util.Iterator; import java.util.List; @@ -40,6 +39,8 @@ import javax.ws.rs.core.MediaType; import org.jclouds.aws.s3.domain.CannedAccessPolicy; import org.jclouds.aws.s3.domain.CanonicalUser; import org.jclouds.aws.s3.domain.ListBucketResponse; +import org.jclouds.aws.s3.domain.ObjectMetadata; +import org.jclouds.aws.s3.domain.ObjectMetadata.StorageClass; import org.jclouds.aws.s3.options.CopyObjectOptions; import org.jclouds.aws.s3.options.ListBucketOptions; import org.jclouds.aws.s3.options.PutObjectOptions; @@ -59,7 +60,6 @@ import org.jets3t.service.model.S3Owner; import org.jets3t.service.utils.RestUtils; import org.joda.time.DateTime; -import com.google.common.collect.Iterables; import com.google.common.collect.Maps; /** @@ -89,39 +89,26 @@ public class Util { public static S3Object[] convertObjectHeads(ListBucketResponse jcBucket) { List jsObjects = new ArrayList(jcBucket.size()); - for (org.jclouds.aws.s3.domain.ObjectMetadata jcObjectMD : jcBucket) { + for (ObjectMetadata jcObjectMD : jcBucket) { jsObjects.add(convertObjectHead(jcObjectMD)); } return (S3Object[]) jsObjects.toArray(new S3Object[jsObjects.size()]); } - public static S3Object convertObjectHead(org.jclouds.aws.s3.domain.ObjectMetadata jcObjectMD) { - S3Object jsObject = new S3Object(jcObjectMD.getName()); + public static S3Object convertObjectHead(ObjectMetadata jcObjectMD) { + S3Object jsObject = new S3Object(jcObjectMD.getKey()); if (jcObjectMD.getOwner() != null) { jsObject.setOwner(new S3Owner(jcObjectMD.getOwner().getId(), jcObjectMD.getOwner() .getDisplayName())); } - DateService dateService = new DateService(); - - for (Entry> entry : jcObjectMD.getAllHeaders().asMap().entrySet()) { - String key = entry.getKey(); - if (key != null) { // TODO: Why is there a null-keyed item in the map? - Object value = Iterables.get(entry.getValue(), 0); - - // Work around JetS3t bug when adding date items as Strings - if (S3Object.METADATA_HEADER_LAST_MODIFIED_DATE.equals(key)) { - value = dateService.rfc822DateParse(value.toString()).toDate(); - } else if (S3Object.METADATA_HEADER_DATE.equals(key)) { - value = dateService.rfc822DateParse(value.toString()).toDate(); - } - - if (key.startsWith("x-amz-meta-")) { - key = key.substring("x-amz-meta-".length()); - } - - jsObject.addMetadata(key, value); - } - } + jsObject.setContentLength(jcObjectMD.getSize()); + jsObject.setContentDisposition(jcObjectMD.getContentDisposition()); + jsObject.setContentEncoding(jcObjectMD.getContentEncoding()); + jsObject.setLastModifiedDate(jcObjectMD.getLastModified().toDate()); + jsObject.setETag(jcObjectMD.getETag()); + jsObject.setMd5Hash(jcObjectMD.getContentMD5()); + jsObject.addAllMetadata(jcObjectMD.getUserMetadata()); + jsObject.addMetadata(S3Object.METADATA_HEADER_DATE, jcObjectMD.getLastModified().toDate()); return jsObject; } @@ -142,17 +129,16 @@ public class Util { } @SuppressWarnings("unchecked") - public static org.jclouds.aws.s3.domain.S3Object convertObject(S3Object jsObject) - throws S3ServiceException { - org.jclouds.aws.s3.domain.S3Object jcObject = new org.jclouds.aws.s3.domain.S3Object(jsObject - .getKey()); - + public static org.jclouds.aws.s3.domain.S3Object convertObject(S3Object jsObject, + org.jclouds.aws.s3.domain.S3Object jcObject) throws S3ServiceException { + jcObject.getMetadata().setKey(jsObject.getKey()); jcObject.getMetadata().setCacheControl((String) jsObject.getMetadata("Cache-Control")); jcObject.getMetadata().setContentDisposition(jsObject.getContentDisposition()); jcObject.getMetadata().setContentEncoding(jsObject.getContentEncoding()); jcObject.getMetadata().setLastModified(new DateTime(jsObject.getLastModifiedDate())); - jcObject.getMetadata().setSize(jsObject.getContentLength()); - jcObject.getMetadata().setStorageClass(jsObject.getStorageClass()); + jcObject.setContentLength(jsObject.getContentLength()); + if (jsObject.getStorageClass() != null) + jcObject.getMetadata().setStorageClass(StorageClass.valueOf(jsObject.getStorageClass())); if (jsObject.getMd5HashAsHex() != null) { jcObject.getMetadata().setETag(jsObject.getMd5HashAsHex()); @@ -214,7 +200,7 @@ public class Util { } public static ListBucketOptions convertListObjectOptions(String prefix, String marker, - String delimiter, Long maxKeys) throws UnsupportedEncodingException { + String delimiter, Integer maxKeys) throws UnsupportedEncodingException { ListBucketOptions options = new ListBucketOptions(); if (prefix != null) { options.withPrefix(prefix); diff --git a/aws/s3/extensions/jets3t/src/test/java/org/jclouds/aws/s3/jets3t/JCloudsS3ServiceLiveTest.java b/aws/s3/extensions/jets3t/src/test/java/org/jclouds/aws/s3/jets3t/JCloudsS3ServiceLiveTest.java index b62e622aed..46103c081c 100755 --- a/aws/s3/extensions/jets3t/src/test/java/org/jclouds/aws/s3/jets3t/JCloudsS3ServiceLiveTest.java +++ b/aws/s3/extensions/jets3t/src/test/java/org/jclouds/aws/s3/jets3t/JCloudsS3ServiceLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -44,12 +44,11 @@ import java.util.concurrent.TimeoutException; import javax.ws.rs.core.MediaType; import org.apache.commons.io.IOUtils; -import org.jclouds.aws.s3.S3Connection; -import org.jclouds.aws.s3.domain.BucketMetadata; +import org.jclouds.aws.s3.S3Client; import org.jclouds.aws.s3.domain.ListBucketResponse; -import org.jclouds.aws.s3.domain.ObjectMetadata; import org.jclouds.aws.s3.domain.AccessControlList.GroupGranteeURI; import org.jclouds.aws.s3.domain.AccessControlList.Permission; +import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest; import org.jets3t.service.S3ObjectsChunk; import org.jets3t.service.S3Service; @@ -78,9 +77,7 @@ import com.google.common.collect.Iterables; * @author Adrian Cole */ @Test(groups = { "live" }, testName = "jets3t.JCloudsS3ServiceIntegrationTest") -public class JCloudsS3ServiceLiveTest - extends - BaseBlobStoreIntegrationTest { +public class JCloudsS3ServiceLiveTest extends BaseBlobStoreIntegrationTest { AWSCredentials credentials; S3Service service; @@ -121,7 +118,7 @@ public class JCloudsS3ServiceLiveTest ExecutionException, TimeoutException { final String bucketName = getContainerName(); service.deleteBucket(bucketName); - assertEventually(new Runnable() { + assertConsistencyAware(new Runnable() { public void run() { assertFalse(context.getApi().bucketExists(bucketName)); } @@ -135,10 +132,10 @@ public class JCloudsS3ServiceLiveTest try { String objectKey = "key-testDeleteObjectImpl"; String objectValue = "test"; - - org.jclouds.aws.s3.domain.S3Object s3Object = new org.jclouds.aws.s3.domain.S3Object( - objectKey, objectValue); - addBlobToContainer(bucketName, s3Object); + Blob blob = context.getBlobStore().newBlob(); + blob.getMetadata().setName(objectKey); + blob.setData(objectValue); + addBlobToContainer(bucketName, blob); service.deleteObject(bucketName, objectKey); } finally { @@ -156,10 +153,11 @@ public class JCloudsS3ServiceLiveTest String metadataName = "metadata-name-1"; String metadataValue = "metadata-value-1"; - org.jclouds.aws.s3.domain.S3Object s3Object = new org.jclouds.aws.s3.domain.S3Object( - objectKey, objectValue); - s3Object.getMetadata().getUserMetadata().put("x-amz-meta-" + metadataName, metadataValue); - addBlobToContainer(bucketName, s3Object); + Blob blob = context.getBlobStore().newBlob(); + blob.getMetadata().setName(objectKey); + blob.setData(objectValue); + blob.getMetadata().getUserMetadata().put(metadataName, metadataValue); + addBlobToContainer(bucketName, blob); S3Object objectDetails = service.getObjectDetails(new S3Bucket(bucketName), objectKey); @@ -182,10 +180,11 @@ public class JCloudsS3ServiceLiveTest String metadataName = "metadata-name-2"; String metadataValue = "metadata-value-2"; - org.jclouds.aws.s3.domain.S3Object s3Object = new org.jclouds.aws.s3.domain.S3Object( - objectKey, objectValue); - s3Object.getMetadata().getUserMetadata().put("x-amz-meta-" + metadataName, metadataValue); - addBlobToContainer(bucketName, s3Object); + Blob blob = context.getBlobStore().newBlob(); + blob.getMetadata().setName(objectKey); + blob.setData(objectValue); + blob.getMetadata().getUserMetadata().put(metadataName, metadataValue); + addBlobToContainer(bucketName, blob); S3Object object = service.getObject(new S3Bucket(bucketName), objectKey); @@ -210,7 +209,7 @@ public class JCloudsS3ServiceLiveTest S3Bucket[] jsBuckets = service.listAllBuckets(); SortedSet jcBuckets = context.getApi() - .listOwnedBuckets(); + .listOwnedBuckets().get(10, TimeUnit.SECONDS); assert jsBuckets.length == jcBuckets.size(); @@ -363,7 +362,7 @@ public class JCloudsS3ServiceLiveTest jsResultObject = service.putObject(new S3Bucket(bucketName), requestObject); jcObject = context.getApi().getObject(bucketName, objectKey).get(10, TimeUnit.SECONDS); // TODO null keys from s3object! assertEquals(jcObject.getKey(), objectKey); - assertEquals(jcObject.getMetadata().getSize(), 0); + assertEquals(jcObject.getMetadata().getSize(), new Long(0)); assertEquals(jcObject.getMetadata().getContentType(), MediaType.APPLICATION_OCTET_STREAM); assertEquals(jsResultObject.getKey(), requestObject.getKey()); assertEquals(jsResultObject.getContentLength(), 0); @@ -375,7 +374,7 @@ public class JCloudsS3ServiceLiveTest jcObject = context.getApi().getObject(bucketName, requestObject.getKey()).get(10, TimeUnit.SECONDS); // TODO null keys from s3object! assertEquals(jcObject.getKey(), requestObject.getKey()); - assertEquals(jcObject.getMetadata().getSize(), 0); + assertEquals(jcObject.getMetadata().getSize(), new Long(0)); assertEquals(jcObject.getMetadata().getContentType(), MediaType.APPLICATION_OCTET_STREAM); assertEquals(jsResultObject.getKey(), requestObject.getKey()); assertEquals(jsResultObject.getContentLength(), 0); @@ -386,7 +385,7 @@ public class JCloudsS3ServiceLiveTest requestObject = new S3Object(objectKey, data); jsResultObject = service.putObject(new S3Bucket(bucketName), requestObject); jcObject = context.getApi().getObject(bucketName, objectKey).get(10, TimeUnit.SECONDS); - assertEquals(jcObject.getMetadata().getSize(), data.getBytes("UTF-8").length); + assertEquals(jcObject.getMetadata().getSize(), new Long(data.getBytes("UTF-8").length)); assertTrue(jcObject.getMetadata().getContentType().startsWith("text/plain")); assertEquals(jsResultObject.getContentLength(), data.getBytes("UTF-8").length); assertTrue(jsResultObject.getContentType().startsWith("text/plain")); @@ -412,7 +411,7 @@ public class JCloudsS3ServiceLiveTest // TODO : Any way to test a URL lookup that works for live and stub testing? // URL publicUrl = new URL( // "http://" + bucketName + ".s3.amazonaws.com:80/" + requestObject.getKey()); - // assertEquals(((HttpURLConnection) publicUrl.openConnection()).getResponseCode(), 200); + // assertEquals(((HttpURLClient) publicUrl.openClient()).getResponseCode(), 200); // Upload object and check MD5 requestObject = new S3Object(objectKey); @@ -441,11 +440,11 @@ public class JCloudsS3ServiceLiveTest String sourceMetadataValue = "souce-metadata-value"; String destinationMetadataValue = "destination-metadata-value"; - org.jclouds.aws.s3.domain.S3Object sourceObject = new org.jclouds.aws.s3.domain.S3Object( - sourceObjectKey, data); - sourceObject.getMetadata().getUserMetadata().put("x-amz-meta-" + metadataName, - sourceMetadataValue); - addBlobToContainer(bucketName, sourceObject); + Blob blob = context.getBlobStore().newBlob(); + blob.getMetadata().setName(sourceObjectKey); + blob.setData(data); + blob.getMetadata().getUserMetadata().put(metadataName, sourceMetadataValue); + addBlobToContainer(bucketName, blob); S3Object destinationObject; Map copyResult; diff --git a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/config/SunCloudS3ConnectionModule.java b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/config/SunCloudS3ConnectionModule.java index 7ab350789e..57e648c058 100644 --- a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/config/SunCloudS3ConnectionModule.java +++ b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/config/SunCloudS3ConnectionModule.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/domain/SunCloudS3Error.java b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/domain/SunCloudS3Error.java index 6d95575534..1c0f9351da 100644 --- a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/domain/SunCloudS3Error.java +++ b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/domain/SunCloudS3Error.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/handlers/ParseSunCloudS3ErrorFromXmlContent.java b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/handlers/ParseSunCloudS3ErrorFromXmlContent.java index 23c42f4f2f..51af8e9d39 100644 --- a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/handlers/ParseSunCloudS3ErrorFromXmlContent.java +++ b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/handlers/ParseSunCloudS3ErrorFromXmlContent.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/reference/SunCloudS3Constants.java b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/reference/SunCloudS3Constants.java index bee766a350..54c322a096 100644 --- a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/reference/SunCloudS3Constants.java +++ b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/reference/SunCloudS3Constants.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/xml/SunCloudS3ErrorHandler.java b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/xml/SunCloudS3ErrorHandler.java index 938cb23cd3..fc01129594 100644 --- a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/xml/SunCloudS3ErrorHandler.java +++ b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/xml/SunCloudS3ErrorHandler.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/xml/config/SunCloudS3ParserModule.java b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/xml/config/SunCloudS3ParserModule.java index fa2642ffc9..5e4f5a04a0 100644 --- a/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/xml/config/SunCloudS3ParserModule.java +++ b/aws/s3/extensions/suncloud/src/main/java/org/jclouds/aws/s3/suncloud/xml/config/SunCloudS3ParserModule.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/extensions/suncloud/src/test/java/org/jclouds/aws/s3/suncloud/SunCloudS3ConnectionLiveTest.java b/aws/s3/extensions/suncloud/src/test/java/org/jclouds/aws/s3/suncloud/SunCloudS3ConnectionLiveTest.java index 7de39e37c2..265be40d8e 100644 --- a/aws/s3/extensions/suncloud/src/test/java/org/jclouds/aws/s3/suncloud/SunCloudS3ConnectionLiveTest.java +++ b/aws/s3/extensions/suncloud/src/test/java/org/jclouds/aws/s3/suncloud/SunCloudS3ConnectionLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/perftest/src/test/java/com/amazon/s3/DateServiceTest.java b/aws/s3/perftest/src/test/java/com/amazon/s3/DateServiceTest.java index 569e2e832b..f6d7aa8475 100644 --- a/aws/s3/perftest/src/test/java/com/amazon/s3/DateServiceTest.java +++ b/aws/s3/perftest/src/test/java/com/amazon/s3/DateServiceTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/perftest/src/test/java/com/amazon/s3/S3ParserTest.java b/aws/s3/perftest/src/test/java/com/amazon/s3/S3ParserTest.java index 0848417c9c..d888619abc 100644 --- a/aws/s3/perftest/src/test/java/com/amazon/s3/S3ParserTest.java +++ b/aws/s3/perftest/src/test/java/com/amazon/s3/S3ParserTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -23,10 +23,6 @@ */ package com.amazon.s3; -import org.apache.commons.io.IOUtils; -import org.joda.time.DateTime; -import org.testng.annotations.Test; - import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; @@ -37,6 +33,10 @@ import java.util.concurrent.CompletionService; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorCompletionService; +import org.apache.commons.io.IOUtils; +import org.joda.time.DateTime; +import org.testng.annotations.Test; + /** * Compares performance of xml parsing apis. * @@ -45,7 +45,7 @@ import java.util.concurrent.ExecutorCompletionService; @Test(sequential = true, timeOut = 2 * 60 * 1000, testName = "s3.S3ParserTest") public class S3ParserTest extends org.jclouds.aws.s3.xml.S3ParserTest { - class MockHttpURLConnection extends HttpURLConnection { + class MockHttpURLClient extends HttpURLConnection { private String content; @Override @@ -53,7 +53,7 @@ public class S3ParserTest extends org.jclouds.aws.s3.xml.S3ParserTest { return IOUtils.toInputStream(content); } - protected MockHttpURLConnection(String content) { + protected MockHttpURLClient(String content) { super(null); this.content = content; } @@ -115,7 +115,7 @@ public class S3ParserTest extends org.jclouds.aws.s3.xml.S3ParserTest { } private ListAllMyBucketsResponse runAmazonParseListAllMyBuckets() throws IOException { - ListAllMyBucketsResponse response = new ListAllMyBucketsResponse(new MockHttpURLConnection( + ListAllMyBucketsResponse response = new ListAllMyBucketsResponse(new MockHttpURLClient( listAllMyBucketsResultOn200)); return response; } @@ -135,7 +135,7 @@ public class S3ParserTest extends org.jclouds.aws.s3.xml.S3ParserTest { } private ListBucketResponse runAmazonParseListBucketResult() throws IOException { - ListBucketResponse response = new ListBucketResponse(new MockHttpURLConnection( + ListBucketResponse response = new ListBucketResponse(new MockHttpURLClient( listAllMyBucketsResultOn200)); return response; } diff --git a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/AmazonPerformanceLiveTest.java b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/AmazonPerformanceLiveTest.java index 588458994c..0d37bb6ee2 100644 --- a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/AmazonPerformanceLiveTest.java +++ b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/AmazonPerformanceLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BaseJCloudsPerformanceLiveTest.java b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BaseJCloudsPerformanceLiveTest.java index bbcc9c86b3..9d6b43a625 100644 --- a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BaseJCloudsPerformanceLiveTest.java +++ b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BaseJCloudsPerformanceLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -27,6 +27,8 @@ import java.io.File; import java.io.InputStream; import java.util.concurrent.TimeUnit; +import org.jclouds.aws.s3.domain.S3Object; + /** * // TODO: Adrian: Document this! * @@ -38,8 +40,8 @@ public abstract class BaseJCloudsPerformanceLiveTest extends BasePerformanceLive // int id) throws Exception { // S3Bucket s3Bucket = new S3Bucket(); // s3Bucket.setName(bucketPrefix + "-jclouds-puts"); - // org.jclouds.aws.s3.domain.S3Object object = new - // org.jclouds.aws.s3.domain.S3Object(); + // S3Object object = new + // S3Object(); // object.setKey(id + ""); // //object.setContentType("text/plain"); // object.setContentType("application/octetstream"); @@ -47,14 +49,14 @@ public abstract class BaseJCloudsPerformanceLiveTest extends BasePerformanceLive // object.setData(test); // return context.getApi()Provider.getObject(s3Bucket, // object.getKey()).get(120,TimeUnit.SECONDS) != - // org.jclouds.aws.s3.domain.S3Object.NOT_FOUND; + // S3Object.NOT_FOUND; // } @Override protected boolean putByteArray(String bucket, String key, byte[] data, String contentType) throws Exception { - org.jclouds.aws.s3.domain.S3Object object = new org.jclouds.aws.s3.domain.S3Object(key); + S3Object object = newObject(key); object.getMetadata().setContentType(contentType); object.setData(data); return context.getApi().putObject(bucket, object).get(120, TimeUnit.SECONDS) != null; @@ -63,26 +65,32 @@ public abstract class BaseJCloudsPerformanceLiveTest extends BasePerformanceLive @Override protected boolean putFile(String bucket, String key, File data, String contentType) throws Exception { - org.jclouds.aws.s3.domain.S3Object object = new org.jclouds.aws.s3.domain.S3Object(key); + S3Object object = newObject(key); object.getMetadata().setContentType(contentType); object.setData(data); return context.getApi().putObject(bucket, object).get(120, TimeUnit.SECONDS) != null; } + private S3Object newObject(String key) { + S3Object object = context.getApi().newS3Object(); + object.getMetadata().setKey(key); + return object; + } + @Override protected boolean putInputStream(String bucket, String key, InputStream data, String contentType) throws Exception { - org.jclouds.aws.s3.domain.S3Object object = new org.jclouds.aws.s3.domain.S3Object(key); + S3Object object = newObject(key); object.getMetadata().setContentType(contentType); object.setData(data); - object.getMetadata().setSize(data.available()); + object.getMetadata().setSize(new Long(data.available())); return context.getApi().putObject(bucket, object).get(120, TimeUnit.SECONDS) != null; } @Override protected boolean putString(String bucket, String key, String data, String contentType) throws Exception { - org.jclouds.aws.s3.domain.S3Object object = new org.jclouds.aws.s3.domain.S3Object(key); + S3Object object = newObject(key); object.getMetadata().setContentType(contentType); object.setData(data); return context.getApi().putObject(bucket, object).get(120, TimeUnit.SECONDS) != null; diff --git a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BasePerformanceLiveTest.java b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BasePerformanceLiveTest.java index fd4264966f..f6cc12e694 100755 --- a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BasePerformanceLiveTest.java +++ b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/BasePerformanceLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -40,9 +40,6 @@ import java.util.concurrent.atomic.AtomicInteger; import javax.inject.Provider; -import org.jclouds.aws.s3.domain.BucketMetadata; -import org.jclouds.aws.s3.domain.ObjectMetadata; -import org.jclouds.aws.s3.domain.S3Object; import org.jclouds.aws.s3.domain.BucketMetadata.LocationConstraint; import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest; import org.testng.annotations.AfterClass; @@ -54,8 +51,7 @@ import org.testng.annotations.Test; * * @author Adrian Cole */ -public abstract class BasePerformanceLiveTest extends - BaseBlobStoreIntegrationTest { +public abstract class BasePerformanceLiveTest extends BaseBlobStoreIntegrationTest { protected int timeoutSeconds = 10; protected int loopCount = 100; protected ExecutorService exec; diff --git a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsGaePerformanceLiveTest.java b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsGaePerformanceLiveTest.java index 759580d852..6d598b3b81 100644 --- a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsGaePerformanceLiveTest.java +++ b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsGaePerformanceLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsNioPerformanceLiveTest.java b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsNioPerformanceLiveTest.java index 37400ece0e..2557e670a6 100644 --- a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsNioPerformanceLiveTest.java +++ b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsNioPerformanceLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsPerformanceLiveTest.java b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsPerformanceLiveTest.java index 237dfc5ee9..b7701c6b1d 100644 --- a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsPerformanceLiveTest.java +++ b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/JCloudsPerformanceLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/Jets3tPerformanceLiveTest.java b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/Jets3tPerformanceLiveTest.java index 7928907405..4a192af548 100644 --- a/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/Jets3tPerformanceLiveTest.java +++ b/aws/s3/perftest/src/test/java/org/jclouds/aws/s3/Jets3tPerformanceLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/perftest/src/test/resources/log4j.xml b/aws/s3/perftest/src/test/resources/log4j.xml index dca3dcc547..c6a021728c 100755 --- a/aws/s3/perftest/src/test/resources/log4j.xml +++ b/aws/s3/perftest/src/test/resources/log4j.xml @@ -2,7 +2,7 @@ + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. + ==================================================================== + +--> ${appengine.applicationid} 1 diff --git a/aws/s3/samples/googleappengine/src/main/appengine/logging.properties b/aws/s3/samples/googleappengine/src/main/appengine/logging.properties index f9f6569a04..243edcb79f 100644 --- a/aws/s3/samples/googleappengine/src/main/appengine/logging.properties +++ b/aws/s3/samples/googleappengine/src/main/appengine/logging.properties @@ -1,5 +1,28 @@ # # +# Copyright (C) 2009 Cloud Conscious, LLC. +# +# ==================================================================== +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ==================================================================== +# +# +# # Copyright (C) 2009 Global Cloud Specialists, Inc. # # ==================================================================== diff --git a/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/GetAllBucketsController.java b/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/GetAllBucketsController.java index cc058892c1..869ffc7e1f 100644 --- a/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/GetAllBucketsController.java +++ b/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/GetAllBucketsController.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -26,6 +26,7 @@ package org.jclouds.samples.googleappengine; import java.io.IOException; import java.util.SortedSet; import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; import javax.annotation.Resource; @@ -38,8 +39,9 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.jclouds.aws.s3.S3Context; +import org.jclouds.aws.s3.S3Client; import org.jclouds.aws.s3.domain.BucketMetadata; +import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.logging.Logger; import org.jclouds.samples.googleappengine.domain.BucketResult; import org.jclouds.samples.googleappengine.functions.MetadataToBucketResult; @@ -48,7 +50,7 @@ import com.google.appengine.repackaged.com.google.common.collect.Sets; import com.google.common.collect.Iterables; /** - * Shows an example of how to use @{link S3Connection} injected with Guice. + * Shows an example of how to use @{link S3Client} injected with Guice. * * @author Adrian Cole */ @@ -56,14 +58,14 @@ import com.google.common.collect.Iterables; public class GetAllBucketsController extends HttpServlet { private static final long serialVersionUID = 1L; - private final S3Context context; + private final BlobStoreContext context; private final Provider metadataToBucketResultProvider; @Resource protected Logger logger = Logger.NULL; @Inject - public GetAllBucketsController(S3Context context, + public GetAllBucketsController(BlobStoreContext context, Provider metadataToBucketResultProvider) { this.context = context; this.metadataToBucketResultProvider = metadataToBucketResultProvider; @@ -86,7 +88,8 @@ public class GetAllBucketsController extends HttpServlet { private void addMyBucketsToRequest(HttpServletRequest request) throws InterruptedException, ExecutionException, TimeoutException { System.err.println(context.getAccount() + ":" + context.getEndPoint()); - SortedSet myBucketMetadata = context.getApi().listOwnedBuckets(); + SortedSet myBucketMetadata = context.getApi().listOwnedBuckets().get(10, + TimeUnit.SECONDS); SortedSet myBuckets = Sets.newTreeSet(Iterables.transform(myBucketMetadata, metadataToBucketResultProvider.get())); request.setAttribute("buckets", myBuckets); diff --git a/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/JCloudsServlet.java b/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/JCloudsServlet.java index e93d031a6e..7e2ef902eb 100644 --- a/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/JCloudsServlet.java +++ b/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/JCloudsServlet.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -36,16 +36,17 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.jclouds.aws.s3.S3Context; +import org.jclouds.aws.s3.S3Client; import org.jclouds.aws.s3.domain.BucketMetadata; import org.jclouds.aws.s3.domain.ListBucketResponse; +import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.blobstore.ContainerNotFoundException; import org.jclouds.logging.Logger; import com.google.common.collect.Sets; /** - * Shows an example of how to use @{link S3Connection} injected with Guice. + * Shows an example of how to use @{link S3Client} injected with Guice. * * @author Adrian Cole */ @@ -65,7 +66,7 @@ public class JCloudsServlet extends HttpServlet { } @Inject - S3Context context; + BlobStoreContext context; @Resource protected Logger logger = Logger.NULL; @@ -108,7 +109,8 @@ public class JCloudsServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { - SortedSet myBucketMetadata = context.getApi().listOwnedBuckets(); + SortedSet myBucketMetadata = context.getApi().listOwnedBuckets().get(10, + TimeUnit.SECONDS); SortedSet myBuckets = Sets.newTreeSet(); for (BucketMetadata metadata : myBucketMetadata) { BucketResult result = new BucketResult(); diff --git a/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/config/GuiceServletConfig.java b/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/config/GuiceServletConfig.java index a4fb36c31f..e1d02bed70 100644 --- a/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/config/GuiceServletConfig.java +++ b/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/config/GuiceServletConfig.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -31,9 +31,11 @@ import javax.inject.Inject; import javax.servlet.ServletContextEvent; import org.apache.commons.io.IOUtils; -import org.jclouds.aws.s3.S3Context; -import org.jclouds.aws.s3.S3ContextBuilder; +import org.jclouds.aws.s3.S3Client; +import org.jclouds.aws.s3.blobstore.S3BlobStoreContextBuilder; +import org.jclouds.aws.s3.blobstore.S3BlobStorePropertiesBuilder; import org.jclouds.aws.s3.reference.S3Constants; +import org.jclouds.blobstore.BlobStoreContext; import org.jclouds.gae.config.GaeHttpCommandExecutorServiceModule; import org.jclouds.samples.googleappengine.GetAllBucketsController; @@ -48,7 +50,7 @@ import com.google.inject.servlet.ServletModule; */ public class GuiceServletConfig extends GuiceServletContextListener { @Inject - S3Context context; + BlobStoreContext context; String accessKeyId; String secretAccessKey; @@ -76,8 +78,9 @@ public class GuiceServletConfig extends GuiceServletContextListener { @Override protected Injector getInjector() { - return new S3ContextBuilder(accessKeyId, secretAccessKey).withModules( - new GaeHttpCommandExecutorServiceModule(), new ServletModule() { + return new S3BlobStoreContextBuilder(new S3BlobStorePropertiesBuilder(accessKeyId, + secretAccessKey).build()).withModules(new GaeHttpCommandExecutorServiceModule(), + new ServletModule() { @Override protected void configureServlets() { serve("*.s3").with(GetAllBucketsController.class); diff --git a/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/domain/BucketResult.java b/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/domain/BucketResult.java index 8c9bfb5358..5bffa3eb2f 100644 --- a/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/domain/BucketResult.java +++ b/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/domain/BucketResult.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/functions/MetadataToBucketResult.java b/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/functions/MetadataToBucketResult.java index 877715f344..96aa7d805d 100644 --- a/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/functions/MetadataToBucketResult.java +++ b/aws/s3/samples/googleappengine/src/main/java/org/jclouds/samples/googleappengine/functions/MetadataToBucketResult.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -26,16 +26,17 @@ package org.jclouds.samples.googleappengine.functions; import java.util.concurrent.TimeUnit; import javax.annotation.Resource; +import javax.inject.Inject; -import org.jclouds.aws.s3.S3BlobStore; +import org.jclouds.aws.s3.blobstore.S3BlobStore; import org.jclouds.aws.s3.domain.BucketMetadata; -import org.jclouds.aws.s3.domain.ListBucketResponse; import org.jclouds.blobstore.ContainerNotFoundException; +import org.jclouds.blobstore.domain.BoundedSortedSet; +import org.jclouds.blobstore.domain.ResourceMetadata; import org.jclouds.logging.Logger; import org.jclouds.samples.googleappengine.domain.BucketResult; import com.google.common.base.Function; -import javax.inject.Inject; public class MetadataToBucketResult implements Function { private final S3BlobStore connection; @@ -53,7 +54,7 @@ public class MetadataToBucketResult implements Function bucket = connection.list(from.getName()).get(10, TimeUnit.SECONDS); result.setSize(bucket.size() + ""); } catch (ContainerNotFoundException ex) { diff --git a/aws/s3/samples/googleappengine/src/main/webapp/WEB-INF/jsp/buckets.jsp b/aws/s3/samples/googleappengine/src/main/webapp/WEB-INF/jsp/buckets.jsp index 11d62de14d..91de40102f 100644 --- a/aws/s3/samples/googleappengine/src/main/webapp/WEB-INF/jsp/buckets.jsp +++ b/aws/s3/samples/googleappengine/src/main/webapp/WEB-INF/jsp/buckets.jsp @@ -1,7 +1,7 @@ <%-- - Copyright (C) 2009 Global Cloud Specialists, Inc. + Copyright (C) 2009 Cloud Conscious, LLC. ==================================================================== Licensed to the Apache Software Foundation (ASF) under one diff --git a/aws/s3/samples/googleappengine/src/main/webapp/WEB-INF/web.xml b/aws/s3/samples/googleappengine/src/main/webapp/WEB-INF/web.xml index 3d5e351de0..8411f98696 100644 --- a/aws/s3/samples/googleappengine/src/main/webapp/WEB-INF/web.xml +++ b/aws/s3/samples/googleappengine/src/main/webapp/WEB-INF/web.xml @@ -1,3 +1,28 @@ + AuthenticationFailed Server failed to authenticate the request. Make sure the value diff --git a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueConnection.java b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueClient.java similarity index 95% rename from azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueConnection.java rename to azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueClient.java index 2366cbfbbc..5640bf1267 100644 --- a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueConnection.java +++ b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueClient.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -33,7 +33,7 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; import org.jclouds.azure.storage.AzureQueue; -import org.jclouds.azure.storage.domain.BoundedSortedSet; +import org.jclouds.azure.storage.domain.BoundedList; import org.jclouds.azure.storage.filters.SharedKeyAuthentication; import org.jclouds.azure.storage.options.CreateOptions; import org.jclouds.azure.storage.options.ListOptions; @@ -70,7 +70,7 @@ import org.jclouds.rest.annotations.XMLResponseParser; @RequestFilters(SharedKeyAuthentication.class) @Headers(keys = AzureStorageHeaders.VERSION, values = "2009-07-17") @Endpoint(AzureQueue.class) -public interface AzureQueueConnection { +public interface AzureQueueClient { /** * The List Queues operation returns a list of the queues under the specified account. @@ -85,7 +85,7 @@ public interface AzureQueueConnection { @XMLResponseParser(AccountNameEnumerationResultsHandler.class) @Path("/") @QueryParams(keys = "comp", values = "list") - BoundedSortedSet listQueues(ListOptions... listOptions); + BoundedList listQueues(ListOptions... listOptions); /** * The Create Queue operation creates a new queue under the specified account. diff --git a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueContextBuilder.java b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueContextBuilder.java index 1b08877fed..a88dd2ee23 100755 --- a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueContextBuilder.java +++ b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueContextBuilder.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -23,21 +23,15 @@ */ package org.jclouds.azure.storage.queue; -import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.azure.storage.reference.AzureStorageConstants.PROPERTY_AZURESTORAGE_SESSIONINTERVAL; - -import java.net.URI; import java.util.List; import java.util.Properties; import java.util.concurrent.ExecutorService; import org.jclouds.azure.storage.queue.config.AzureQueueContextModule; -import org.jclouds.azure.storage.queue.config.RestAzureQueueConnectionModule; -import org.jclouds.azure.storage.queue.reference.AzureQueueConstants; -import org.jclouds.azure.storage.reference.AzureStorageConstants; -import org.jclouds.cloud.CloudContextBuilder; +import org.jclouds.azure.storage.queue.config.AzureQueueRestClientModule; import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; import org.jclouds.logging.jdk.config.JDKLoggingModule; +import org.jclouds.rest.RestContextBuilder; import com.google.inject.Injector; import com.google.inject.Module; @@ -56,27 +50,12 @@ import com.google.inject.TypeLiteral; * @author Adrian Cole * @see AzureQueueContext */ -public class AzureQueueContextBuilder extends CloudContextBuilder { - private static final TypeLiteral connectionType = new TypeLiteral() { +public class AzureQueueContextBuilder extends RestContextBuilder { + private static final TypeLiteral connectionType = new TypeLiteral() { }; - public AzureQueueContextBuilder(String id, String secret) { - this(new Properties()); - properties.setProperty(AzureStorageConstants.PROPERTY_AZURESTORAGE_ACCOUNT, checkNotNull(id, - "azureStorageAccount")); - properties.setProperty(AzureStorageConstants.PROPERTY_AZURESTORAGE_KEY, checkNotNull(secret, - "azureStorageKey")); - String endpoint = properties.getProperty(AzureQueueConstants.PROPERTY_AZUREQUEUE_ENDPOINT); - properties.setProperty(AzureQueueConstants.PROPERTY_AZUREQUEUE_ENDPOINT, endpoint.replaceAll( - "\\{account\\}", id)); - if (!properties.containsKey(PROPERTY_AZURESTORAGE_SESSIONINTERVAL)) - this.withTimeStampExpiration(60); - } - public AzureQueueContextBuilder(Properties properties) { super(connectionType, properties); - properties.setProperty(AzureQueueConstants.PROPERTY_AZUREQUEUE_ENDPOINT, - "https://{account}.queue.core.windows.net"); } @Override @@ -85,88 +64,20 @@ public class AzureQueueContextBuilder extends CloudContextBuilder modules) { - modules.add(new RestAzureQueueConnectionModule()); - } - - @Override - public AzureQueueContextBuilder withEndpoint(URI endpoint) { - String account = checkNotNull(properties - .getProperty(AzureStorageConstants.PROPERTY_AZURESTORAGE_ACCOUNT), - "azureStorageAccount"); - properties.setProperty(AzureQueueConstants.PROPERTY_AZUREQUEUE_ENDPOINT, checkNotNull( - endpoint, "endpoint").toString()); - properties.setProperty(AzureQueueConstants.PROPERTY_AZUREQUEUE_ENDPOINT, endpoint.toString() - .replaceAll("\\{account\\}", account)); - return this; + protected void addClientModule(List modules) { + modules.add(new AzureQueueRestClientModule()); } // below is to cast the builder to the correct type so that chained builder methods end correctly - @Override - public AzureQueueContext buildContext() { - Injector injector = buildInjector(); - return injector.getInstance(AzureQueueContext.class); - } - - @Override - public AzureQueueContextBuilder relaxSSLHostname() { - return (AzureQueueContextBuilder) super.relaxSSLHostname(); - } - @Override public AzureQueueContextBuilder withExecutorService(ExecutorService service) { return (AzureQueueContextBuilder) super.withExecutorService(service); } - @Override - public AzureQueueContextBuilder withHttpMaxRedirects(int httpMaxRedirects) { - return (AzureQueueContextBuilder) super.withHttpMaxRedirects(httpMaxRedirects); - } - - @Override - public AzureQueueContextBuilder withHttpMaxRetries(int httpMaxRetries) { - return (AzureQueueContextBuilder) super.withHttpMaxRetries(httpMaxRetries); - } - - @Override - public AzureQueueContextBuilder withModule(Module module) { - return (AzureQueueContextBuilder) super.withModule(module); - } - @Override public AzureQueueContextBuilder withModules(Module... modules) { return (AzureQueueContextBuilder) super.withModules(modules); } - @Override - public AzureQueueContextBuilder withPoolIoWorkerThreads(int poolIoWorkerThreads) { - return (AzureQueueContextBuilder) super.withPoolIoWorkerThreads(poolIoWorkerThreads); - } - - @Override - public AzureQueueContextBuilder withPoolMaxConnectionReuse(int poolMaxConnectionReuse) { - return (AzureQueueContextBuilder) super.withPoolMaxConnectionReuse(poolMaxConnectionReuse); - } - - @Override - public AzureQueueContextBuilder withPoolMaxConnections(int poolMaxConnections) { - return (AzureQueueContextBuilder) super.withPoolMaxConnections(poolMaxConnections); - } - - @Override - public AzureQueueContextBuilder withPoolMaxSessionFailures(int poolMaxSessionFailures) { - return (AzureQueueContextBuilder) super.withPoolMaxSessionFailures(poolMaxSessionFailures); - } - - @Override - public AzureQueueContextBuilder withPoolRequestInvokerThreads(int poolRequestInvokerThreads) { - return (AzureQueueContextBuilder) super - .withPoolRequestInvokerThreads(poolRequestInvokerThreads); - } - - public AzureQueueContextBuilder withTimeStampExpiration(long seconds) { - getProperties().setProperty(PROPERTY_AZURESTORAGE_SESSIONINTERVAL, seconds + ""); - return this; - } } diff --git a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueContextFactory.java b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueContextFactory.java index 99f4c2ad06..79b53979a0 100644 --- a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueContextFactory.java +++ b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueueContextFactory.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -24,9 +24,11 @@ package org.jclouds.azure.storage.queue; import java.net.URI; +import java.util.Properties; import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; import org.jclouds.logging.jdk.config.JDKLoggingModule; +import org.jclouds.rest.RestContext; import com.google.inject.Module; @@ -40,18 +42,25 @@ import com.google.inject.Module; * {@link JavaUrlHttpCommandExecutorServiceModule http transports} will be installed. * * @author Adrian Cole - * @see AzureQueueContext + * @see AzureQueueClient */ public class AzureQueueContextFactory { - public static AzureQueueContext createContext(String account, String encodedKey, + public static RestContext createContext(Properties properties, Module... modules) { - return new AzureQueueContextBuilder(account, encodedKey).withModules(modules).buildContext(); + return new AzureQueueContextBuilder(new AzureQueuePropertiesBuilder(properties).build()) + .withModules(modules).buildContext(); } - public static AzureQueueContext createContext(URI endpoint, String account, String encodedKey, + public static RestContext createContext(String account, String encodedKey, Module... modules) { - return new AzureQueueContextBuilder(account, encodedKey).withEndpoint(endpoint).withModules( - modules).buildContext(); + return new AzureQueueContextBuilder(new AzureQueuePropertiesBuilder(account, encodedKey) + .build()).withModules(modules).buildContext(); + } + + public static RestContext createContext(URI endpoint, String account, + String encodedKey, Module... modules) { + return new AzureQueueContextBuilder(new AzureQueuePropertiesBuilder(account, encodedKey) + .withEndpoint(endpoint).build()).withModules(modules).buildContext(); } } diff --git a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueuePropertiesBuilder.java b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueuePropertiesBuilder.java new file mode 100644 index 0000000000..23fd0cdf16 --- /dev/null +++ b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/AzureQueuePropertiesBuilder.java @@ -0,0 +1,87 @@ +/** + * + * Copyright (C) 2009 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + */ +package org.jclouds.azure.storage.queue; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.azure.storage.reference.AzureStorageConstants.PROPERTY_AZURESTORAGE_SESSIONINTERVAL; + +import java.net.URI; +import java.util.Properties; + +import org.jclouds.azure.storage.queue.reference.AzureQueueConstants; +import org.jclouds.azure.storage.reference.AzureStorageConstants; +import org.jclouds.http.HttpPropertiesBuilder; + +/** + * Builds properties used in AzureQueue Connections + * + * @author Adrian Cole + */ +public class AzureQueuePropertiesBuilder extends HttpPropertiesBuilder { + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(AzureQueueConstants.PROPERTY_AZUREQUEUE_ENDPOINT, + "https://{account}.queue.core.windows.net"); + properties.setProperty(PROPERTY_AZURESTORAGE_SESSIONINTERVAL, 60 + ""); + return properties; + } + + public AzureQueuePropertiesBuilder(Properties properties) { + super(properties); + } + + public AzureQueuePropertiesBuilder(String id, String secret) { + super(); + withCredentials(id, secret); + } + + public AzureQueuePropertiesBuilder withCredentials(String id, String secret) { + properties.setProperty(AzureStorageConstants.PROPERTY_AZURESTORAGE_ACCOUNT, checkNotNull(id, + "azureStorageAccount")); + properties.setProperty(AzureStorageConstants.PROPERTY_AZURESTORAGE_KEY, checkNotNull(secret, + "azureStorageKey")); + String endpoint = properties.getProperty(AzureQueueConstants.PROPERTY_AZUREQUEUE_ENDPOINT); + properties.setProperty(AzureQueueConstants.PROPERTY_AZUREQUEUE_ENDPOINT, endpoint.replaceAll( + "\\{account\\}", id)); + return this; + } + + public AzureQueuePropertiesBuilder withEndpoint(URI endpoint) { + String account = checkNotNull(properties + .getProperty(AzureStorageConstants.PROPERTY_AZURESTORAGE_ACCOUNT), + "azureStorageAccount"); + properties.setProperty(AzureQueueConstants.PROPERTY_AZUREQUEUE_ENDPOINT, checkNotNull( + endpoint, "endpoint").toString()); + properties.setProperty(AzureQueueConstants.PROPERTY_AZUREQUEUE_ENDPOINT, endpoint.toString() + .replaceAll("\\{account\\}", account)); + return this; + } + + public AzureQueuePropertiesBuilder withTimeStampExpiration(long seconds) { + properties.setProperty(PROPERTY_AZURESTORAGE_SESSIONINTERVAL, seconds + ""); + return this; + } + +} diff --git a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/config/AzureQueueContextModule.java b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/config/AzureQueueContextModule.java index 2b6f485d00..b3cae926c3 100644 --- a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/config/AzureQueueContextModule.java +++ b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/config/AzureQueueContextModule.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -25,37 +25,33 @@ package org.jclouds.azure.storage.queue.config; import java.net.URI; -import javax.inject.Inject; import javax.inject.Named; +import javax.inject.Singleton; import org.jclouds.azure.storage.AzureQueue; -import org.jclouds.azure.storage.queue.AzureQueueConnection; -import org.jclouds.azure.storage.queue.AzureQueueContext; +import org.jclouds.azure.storage.queue.AzureQueueClient; import org.jclouds.azure.storage.reference.AzureStorageConstants; -import org.jclouds.cloud.internal.CloudContextImpl; import org.jclouds.http.RequiresHttp; import org.jclouds.lifecycle.Closer; +import org.jclouds.rest.RestContext; +import org.jclouds.rest.internal.RestContextImpl; import com.google.inject.AbstractModule; -import com.google.inject.Scopes; +import com.google.inject.Provides; @RequiresHttp public class AzureQueueContextModule extends AbstractModule { @Override protected void configure() { - bind(AzureQueueContext.class).to(AzureQueueContextImpl.class).in(Scopes.SINGLETON); } - public static class AzureQueueContextImpl extends CloudContextImpl - implements AzureQueueContext { - @Inject - public AzureQueueContextImpl(Closer closer, AzureQueueConnection defaultApi, - @AzureQueue URI endPoint, - @Named(AzureStorageConstants.PROPERTY_AZURESTORAGE_ACCOUNT) String account) { - super(closer, defaultApi, endPoint, account); - } - + @Provides + @Singleton + RestContext provideContext(Closer closer, AzureQueueClient defaultApi, + @AzureQueue URI endPoint, + @Named(AzureStorageConstants.PROPERTY_AZURESTORAGE_ACCOUNT) String account) { + return new RestContextImpl(closer, defaultApi, endPoint, account); } } \ No newline at end of file diff --git a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/config/RestAzureQueueConnectionModule.java b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/config/AzureQueueRestClientModule.java similarity index 76% rename from azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/config/RestAzureQueueConnectionModule.java rename to azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/config/AzureQueueRestClientModule.java index 2118c83703..fc6cbd91ef 100644 --- a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/config/RestAzureQueueConnectionModule.java +++ b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/config/AzureQueueRestClientModule.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -29,11 +29,11 @@ import javax.inject.Named; import javax.inject.Singleton; import org.jclouds.azure.storage.AzureQueue; -import org.jclouds.azure.storage.config.RestAzureStorageConnectionModule; -import org.jclouds.azure.storage.queue.AzureQueueConnection; +import org.jclouds.azure.storage.config.AzureStorageRestClientModule; +import org.jclouds.azure.storage.queue.AzureQueueClient; import org.jclouds.azure.storage.queue.reference.AzureQueueConstants; -import org.jclouds.cloud.ConfiguresCloudConnection; import org.jclouds.http.RequiresHttp; +import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.RestClientFactory; import com.google.inject.Provides; @@ -43,9 +43,9 @@ import com.google.inject.Provides; * * @author Adrian Cole */ -@ConfiguresCloudConnection +@ConfiguresRestClient @RequiresHttp -public class RestAzureQueueConnectionModule extends RestAzureStorageConnectionModule { +public class AzureQueueRestClientModule extends AzureStorageRestClientModule { @Provides @Singleton @@ -57,8 +57,8 @@ public class RestAzureQueueConnectionModule extends RestAzureStorageConnectionMo @Provides @Singleton - protected AzureQueueConnection provideAzureStorageConnection(RestClientFactory factory) { - return factory.create(AzureQueueConnection.class); + protected AzureQueueClient provideAzureStorageClient(RestClientFactory factory) { + return factory.create(AzureQueueClient.class); } } \ No newline at end of file diff --git a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/domain/QueueMetadata.java b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/domain/QueueMetadata.java index 10699baada..74e1befd06 100755 --- a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/domain/QueueMetadata.java +++ b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/domain/QueueMetadata.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/internal/GuiceAzureQueueContext.java b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/internal/GuiceAzureQueueContext.java deleted file mode 100644 index bdc37cbff6..0000000000 --- a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/internal/GuiceAzureQueueContext.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * - * Copyright (C) 2009 Global Cloud Specialists, Inc. - * - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - */ -package org.jclouds.azure.storage.queue.internal; - -import java.io.IOException; -import java.net.URI; - -import javax.annotation.Resource; -import javax.inject.Inject; -import javax.inject.Named; - -import org.jclouds.azure.storage.AzureQueue; -import org.jclouds.azure.storage.queue.AzureQueueConnection; -import org.jclouds.azure.storage.queue.AzureQueueContext; -import org.jclouds.azure.storage.reference.AzureStorageConstants; -import org.jclouds.lifecycle.Closer; -import org.jclouds.logging.Logger; - -import com.google.inject.Injector; - -/** - * Uses a Guice Injector to configure the objects served by AzureQueueContext methods. - * - * @author Adrian Cole - * @see Injector - */ -public class GuiceAzureQueueContext implements AzureQueueContext { - - @Resource - private Logger logger = Logger.NULL; - private final Injector injector; - private final Closer closer; - private final URI endPoint; - private final String account; - - @Inject - private GuiceAzureQueueContext(Injector injector, Closer closer, - @Named(AzureStorageConstants.PROPERTY_AZURESTORAGE_ACCOUNT) String account, - @AzureQueue URI endPoint) { - this.injector = injector; - this.closer = closer; - this.endPoint = endPoint; - this.account = account; - } - - /** - * {@inheritDoc} - * - * @see Closer - */ - public void close() { - try { - closer.close(); - } catch (IOException e) { - logger.error(e, "error closing content"); - } - } - - public String getAccount() { - return account; - } - - public AzureQueueConnection getApi() { - return injector.getInstance(AzureQueueConnection.class); - } - - public URI getEndPoint() { - return endPoint; - } - -} diff --git a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/reference/AzureQueueConstants.java b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/reference/AzureQueueConstants.java index 1ebc0a0be5..dd4f62615f 100644 --- a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/reference/AzureQueueConstants.java +++ b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/reference/AzureQueueConstants.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandler.java b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandler.java index 8bc1d2a5b1..5088a25865 100755 --- a/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandler.java +++ b/azure/storage/queue/core/src/main/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandler.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -29,8 +29,8 @@ import java.util.TreeSet; import javax.inject.Inject; -import org.jclouds.azure.storage.domain.BoundedSortedSet; -import org.jclouds.azure.storage.domain.BoundedTreeSet; +import org.jclouds.azure.storage.domain.BoundedList; +import org.jclouds.azure.storage.domain.internal.BoundedTreeSet; import org.jclouds.azure.storage.queue.domain.QueueMetadata; import org.jclouds.http.functions.ParseSax; @@ -43,15 +43,15 @@ import org.jclouds.http.functions.ParseSax; * @author Adrian Cole */ public class AccountNameEnumerationResultsHandler extends - ParseSax.HandlerWithResult> { + ParseSax.HandlerWithResult> { private SortedSet metadata = new TreeSet(); + private URI currentUrl; private String prefix; private String marker; private int maxResults; private String nextMarker; private String currentName; - private URI currentUrl; private StringBuilder currentText = new StringBuilder(); @@ -59,8 +59,9 @@ public class AccountNameEnumerationResultsHandler extends public AccountNameEnumerationResultsHandler() { } - public BoundedSortedSet getResult() { - return new BoundedTreeSet(metadata, prefix, marker, maxResults, nextMarker); + public BoundedList getResult() { + return new BoundedTreeSet(metadata, currentUrl, prefix, marker, maxResults, + nextMarker); } public void endElement(String uri, String name, String qName) { diff --git a/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueConnectionLiveTest.java b/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueClientLiveTest.java similarity index 83% rename from azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueConnectionLiveTest.java rename to azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueClientLiveTest.java index b42e083807..ea42f126fc 100644 --- a/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueConnectionLiveTest.java +++ b/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueClientLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -29,7 +29,7 @@ import static org.testng.Assert.assertTrue; import java.lang.reflect.UndeclaredThrowableException; import java.security.SecureRandom; -import org.jclouds.azure.storage.domain.BoundedSortedSet; +import org.jclouds.azure.storage.domain.BoundedList; import org.jclouds.azure.storage.options.CreateOptions; import org.jclouds.azure.storage.options.ListOptions; import org.jclouds.azure.storage.queue.domain.QueueMetadata; @@ -42,31 +42,32 @@ import com.google.common.collect.ImmutableMultimap; import com.google.inject.Injector; /** - * Tests behavior of {@code AzureQueueConnection} + * Tests behavior of {@code AzureQueueClient} * * @author Adrian Cole */ -@Test(groups = "live", sequential = true, testName = "cloudservers.AzureQueueConnectionLiveTest") -public class AzureQueueConnectionLiveTest { +@Test(groups = "live", sequential = true, testName = "cloudservers.AzureQueueClientLiveTest") +public class AzureQueueClientLiveTest { String account; - protected AzureQueueConnection connection; + protected AzureQueueClient connection; private String queuePrefix = System.getProperty("user.name") + "-azurequeue"; @BeforeGroups(groups = { "live" }) - public void setupConnection() { + public void setupClient() { account = System.getProperty("jclouds.test.user"); String key = System.getProperty("jclouds.test.key"); - Injector injector = new AzureQueueContextBuilder(account, key).withModules( + Injector injector = new AzureQueueContextBuilder( + new AzureQueuePropertiesBuilder(account, key).build()).withModules( new Log4JLoggingModule()).buildInjector(); - connection = injector.getInstance(AzureQueueConnection.class); + connection = injector.getInstance(AzureQueueClient.class); } @Test public void testListQueues() throws Exception { - BoundedSortedSet response = connection.listQueues(); + BoundedList response = connection.listQueues(); assert null != response; long initialQueueCount = response.size(); assertTrue(initialQueueCount >= 0); @@ -92,7 +93,7 @@ public class AzureQueueConnectionLiveTest { throw e; } } - BoundedSortedSet response = connection.listQueues(); + BoundedList response = connection.listQueues(); assert null != response; long queueCount = response.size(); assertTrue(queueCount >= 1); @@ -102,7 +103,7 @@ public class AzureQueueConnectionLiveTest { @Test public void testListQueuesWithOptions() throws Exception { - BoundedSortedSet response = connection.listQueues(ListOptions.Builder.prefix( + BoundedList response = connection.listQueues(ListOptions.Builder.prefix( privateQueue).maxResults(1)); assert null != response; long initialQueueCount = response.size(); diff --git a/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueConnectionTest.java b/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueClientTest.java similarity index 86% rename from azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueConnectionTest.java rename to azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueClientTest.java index 0080063a4b..c0735092e9 100644 --- a/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueConnectionTest.java +++ b/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/AzureQueueClientTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -34,7 +34,7 @@ import java.util.Collections; import javax.ws.rs.HttpMethod; import org.jclouds.azure.storage.AzureQueue; -import org.jclouds.azure.storage.config.RestAzureStorageConnectionModule; +import org.jclouds.azure.storage.config.AzureStorageRestClientModule; import org.jclouds.azure.storage.options.CreateOptions; import org.jclouds.azure.storage.options.ListOptions; import org.jclouds.azure.storage.reference.AzureStorageConstants; @@ -61,21 +61,21 @@ import com.google.inject.Key; import com.google.inject.TypeLiteral; /** - * Tests behavior of {@code AzureQueueConnection} + * Tests behavior of {@code AzureQueueClient} * * @author Adrian Cole */ -@Test(groups = "unit", testName = "cloudservers.AzureQueueConnectionTest") -public class AzureQueueConnectionTest { +@Test(groups = "unit", testName = "cloudservers.AzureQueueClientTest") +public class AzureQueueClientTest { private static final Class listOptionsVarargsClass = new ListOptions[] {} .getClass(); private static final Class createOptionsVarargsClass = new CreateOptions[] {} .getClass(); public void testListQueues() throws SecurityException, NoSuchMethodException { - Method method = AzureQueueConnection.class.getMethod("listQueues", listOptionsVarargsClass); + Method method = AzureQueueClient.class.getMethod("listQueues", listOptionsVarargsClass); - GeneratedHttpRequest httpMethod = processor.createRequest(method, + GeneratedHttpRequest httpMethod = processor.createRequest(method, new Object[] {}); assertEquals(httpMethod.getEndpoint().getHost(), "localhost"); assertEquals(httpMethod.getEndpoint().getPath(), "/"); @@ -90,9 +90,9 @@ public class AzureQueueConnectionTest { } public void testListQueuesOptions() throws SecurityException, NoSuchMethodException { - Method method = AzureQueueConnection.class.getMethod("listQueues", listOptionsVarargsClass); + Method method = AzureQueueClient.class.getMethod("listQueues", listOptionsVarargsClass); - GeneratedHttpRequest httpMethod = processor.createRequest(method, + GeneratedHttpRequest httpMethod = processor.createRequest(method, new Object[] { maxResults(1).marker("marker").prefix("prefix") }); assertEquals(httpMethod.getEndpoint().getHost(), "localhost"); assertEquals(httpMethod.getEndpoint().getPath(), "/"); @@ -110,10 +110,10 @@ public class AzureQueueConnectionTest { } public void testCreateQueue() throws SecurityException, NoSuchMethodException { - Method method = AzureQueueConnection.class.getMethod("createQueue", String.class, + Method method = AzureQueueClient.class.getMethod("createQueue", String.class, createOptionsVarargsClass); - GeneratedHttpRequest httpMethod = processor.createRequest(method, + GeneratedHttpRequest httpMethod = processor.createRequest(method, new Object[] { "queue" }); assertEquals(httpMethod.getEndpoint().getHost(), "localhost"); assertEquals(httpMethod.getEndpoint().getPath(), "/queue"); @@ -130,9 +130,9 @@ public class AzureQueueConnectionTest { } public void testDeleteQueue() throws SecurityException, NoSuchMethodException { - Method method = AzureQueueConnection.class.getMethod("deleteQueue", String.class); + Method method = AzureQueueClient.class.getMethod("deleteQueue", String.class); - GeneratedHttpRequest httpMethod = processor.createRequest(method, + GeneratedHttpRequest httpMethod = processor.createRequest(method, new Object[] { "queue" }); assertEquals(httpMethod.getEndpoint().getHost(), "localhost"); assertEquals(httpMethod.getEndpoint().getPath(), "/queue"); @@ -148,10 +148,10 @@ public class AzureQueueConnectionTest { } public void testCreateQueueOptions() throws SecurityException, NoSuchMethodException { - Method method = AzureQueueConnection.class.getMethod("createQueue", String.class, + Method method = AzureQueueClient.class.getMethod("createQueue", String.class, createOptionsVarargsClass); - GeneratedHttpRequest httpMethod = processor.createRequest(method, + GeneratedHttpRequest httpMethod = processor.createRequest(method, new Object[] { "queue", withMetadata(ImmutableMultimap.of("foo", "bar")) }); assertEquals(httpMethod.getEndpoint().getHost(), "localhost"); assertEquals(httpMethod.getEndpoint().getPath(), "/queue"); @@ -189,12 +189,12 @@ public class AzureQueueConnectionTest { Jsr330.named(AzureStorageConstants.PROPERTY_AZURESTORAGE_SESSIONINTERVAL)).to( 1l); } - }, new RestAzureStorageConnectionModule(), new RestModule(), new ExecutorServiceModule( + }, new AzureStorageRestClientModule(), new RestModule(), new ExecutorServiceModule( new WithinThreadExecutorService()), new JavaUrlHttpCommandExecutorServiceModule()); processor = injector.getInstance(Key - .get(new TypeLiteral>() { + .get(new TypeLiteral>() { })); } - RestAnnotationProcessor processor; + RestAnnotationProcessor processor; } diff --git a/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandlerTest.java b/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandlerTest.java index f7be790598..2890ff43d6 100644 --- a/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandlerTest.java +++ b/azure/storage/queue/core/src/test/java/org/jclouds/azure/storage/queue/xml/AccountNameEnumerationResultsHandlerTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -28,8 +28,8 @@ import static org.testng.Assert.assertEquals; import java.io.InputStream; import java.net.URI; -import org.jclouds.azure.storage.domain.BoundedSortedSet; -import org.jclouds.azure.storage.domain.BoundedTreeSet; +import org.jclouds.azure.storage.domain.BoundedList; +import org.jclouds.azure.storage.domain.internal.BoundedTreeSet; import org.jclouds.azure.storage.queue.domain.QueueMetadata; import org.jclouds.http.functions.BaseHandlerTest; import org.testng.annotations.Test; @@ -44,35 +44,26 @@ import com.google.common.collect.ImmutableSortedSet; @Test(groups = "unit", testName = "azurequeue.AccountNameEnumerationResultsHandlerTest") public class AccountNameEnumerationResultsHandlerTest extends BaseHandlerTest { - @SuppressWarnings("unchecked") public void testApplyInputStream() { InputStream is = getClass().getResourceAsStream("/test_list_queues.xml"); - BoundedSortedSet list = new BoundedTreeSet(ImmutableSortedSet - .of( - new QueueMetadata("q1", URI - .create("http://myaccount.queue.core.windows.net/q1")), - new QueueMetadata("q2", URI - .create("http://myaccount.queue.core.windows.net/q2")), - new QueueMetadata("q3", URI - .create("http://myaccount.queue.core.windows.net/q3"))), "q", - null, 3, "q4"); - BoundedSortedSet result = (BoundedSortedSet) factory.create( + BoundedList list = new BoundedTreeSet(ImmutableSortedSet.of( + new QueueMetadata("q1", URI.create("http://myaccount.queue.core.windows.net/q1")), + new QueueMetadata("q2", URI.create("http://myaccount.queue.core.windows.net/q2")), + new QueueMetadata("q3", URI.create("http://myaccount.queue.core.windows.net/q3"))), + URI.create("http://myaccount.queue.core.windows.net"), "q", null, 3, "q4"); + BoundedList result = (BoundedList) factory.create( injector.getInstance(AccountNameEnumerationResultsHandler.class)).parse(is); assertEquals(result, list); } - @SuppressWarnings("unchecked") public void testApplyInputStreamWithOptions() { InputStream is = getClass().getResourceAsStream("/test_list_queues_options.xml"); - BoundedSortedSet list = new BoundedTreeSet(ImmutableSortedSet - .of( - new QueueMetadata("q4", URI - .create("http://myaccount.queue.core.windows.net/q4")), - new QueueMetadata("q5", URI - .create("http://myaccount.queue.core.windows.net/q5"))), "q", - "q4", 3, null); + BoundedList list = new BoundedTreeSet(ImmutableSortedSet.of( + new QueueMetadata("q4", URI.create("http://myaccount.queue.core.windows.net/q4")), + new QueueMetadata("q5", URI.create("http://myaccount.queue.core.windows.net/q5"))), + URI.create("http://myaccount.queue.core.windows.net"), "q", "q4", 3, null); - BoundedSortedSet result = (BoundedSortedSet) factory.create( + BoundedList result = (BoundedList) factory.create( injector.getInstance(AccountNameEnumerationResultsHandler.class)).parse(is); assertEquals(result, list); diff --git a/azure/storage/queue/core/src/test/resources/test_list_queues.xml b/azure/storage/queue/core/src/test/resources/test_list_queues.xml index bd9c2b0f4a..7bb4d63942 100644 --- a/azure/storage/queue/core/src/test/resources/test_list_queues.xml +++ b/azure/storage/queue/core/src/test/resources/test_list_queues.xml @@ -2,7 +2,7 @@ diff --git a/mezeo/pcs2/core/src/test/resources/log4j.xml b/mezeo/pcs2/core/src/test/resources/log4j.xml index b3b07ae5e7..3be65a2ae2 100755 --- a/mezeo/pcs2/core/src/test/resources/log4j.xml +++ b/mezeo/pcs2/core/src/test/resources/log4j.xml @@ -2,7 +2,7 @@ testfile.txt 1254000180 @@ -12,7 +37,7 @@ text/plain 5 - + diff --git a/mezeo/pcs2/core/src/test/resources/test_root_container.xml b/mezeo/pcs2/core/src/test/resources/test_root_container.xml new file mode 100644 index 0000000000..e8cc43ebac --- /dev/null +++ b/mezeo/pcs2/core/src/test/resources/test_root_container.xml @@ -0,0 +1,142 @@ + + + + / + 1254848007 + False + 1255026455 + adrian@jclouds.org + 0 + False + 1255026455 + 0 + + + + test1 + 1254008225 + false + 1254008226 + adrian@jclouds.org + 1 + true + 1254008227 + 1024 + + + + + + + more + 1254005157 + false + 1254005158 + adrian@jclouds.org + 1 + false + 1254005159 + true + application/octet-stream + 254288 + + + + + + + + + testfile.txt + 1254000180 + true + 1254000181 + adrian@jclouds.org + 3 + false + 1254000182 + false + text/plain + 5 + + + + + + + + + + + + \ No newline at end of file diff --git a/mezeo/pcs2/pom.xml b/mezeo/pcs2/pom.xml index 030a2ff11c..d167b4c320 100644 --- a/mezeo/pcs2/pom.xml +++ b/mezeo/pcs2/pom.xml @@ -40,7 +40,7 @@ core - org.jclouds.mezeo.pcs2.integration.PCSTestInitializer + org.jclouds.mezeo.pcs2.blobstore.integration.PCSTestInitializer ${jclouds.mezeo.pcs2.user} ${jclouds.mezeo.pcs2.password} ${jclouds.mezeo.pcs2.endpoint} diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDN.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDN.java index 2a99a4222f..aaf18c5496 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDN.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDN.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNAuthentication.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNAuthentication.java index 9340612857..63c0095d7f 100755 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNAuthentication.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNAuthentication.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNConnection.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNClient.java similarity index 94% rename from nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNConnection.java rename to nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNClient.java index f3117d534a..6a3eb9d407 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNConnection.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNClient.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -35,7 +35,6 @@ import javax.ws.rs.QueryParam; import org.jclouds.blobstore.binders.BindBlobToMultipartForm; import org.jclouds.blobstore.domain.Blob; -import org.jclouds.blobstore.domain.BlobMetadata; import org.jclouds.nirvanix.sdn.binders.BindMetadataToQueryParams; import org.jclouds.nirvanix.sdn.domain.UploadInfo; import org.jclouds.nirvanix.sdn.filters.AddSessionTokenToRequest; @@ -61,8 +60,10 @@ import org.jclouds.rest.annotations.SkipEncoding; @RequestFilters(AddSessionTokenToRequest.class) @SkipEncoding( { '/', ':' }) @QueryParams(keys = SDNQueryParams.OUTPUT, values = "json") -public interface SDNConnection { +public interface SDNClient { + public Blob newBlob(); + /** * The GetStorageNode method is used to determine which storage node a file should be uploaded * to. It returns the host to upload to and an Upload Token that will be used to authenticate. @@ -78,7 +79,7 @@ public interface SDNConnection { Future upload(@Endpoint URI endpoint, @QueryParam(SDNQueryParams.UPLOADTOKEN) String uploadToken, @QueryParam(SDNQueryParams.DESTFOLDERPATH) String folderPath, - @BinderParam(BindBlobToMultipartForm.class) Blob blob); + @BinderParam(BindBlobToMultipartForm.class) Blob blob); /** * The SetMetadata method is used to set specified metadata for a file or folder. diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNContextBuilder.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNContextBuilder.java index 66d59703be..aaca07be7c 100755 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNContextBuilder.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNContextBuilder.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -23,20 +23,15 @@ */ package org.jclouds.nirvanix.sdn; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.net.URI; import java.util.List; import java.util.Properties; import java.util.concurrent.ExecutorService; -import org.jclouds.cloud.CloudContextBuilder; import org.jclouds.nirvanix.sdn.config.RestSDNAuthenticationModule; -import org.jclouds.nirvanix.sdn.config.RestSDNConnectionModule; +import org.jclouds.nirvanix.sdn.config.RestSDNClientModule; import org.jclouds.nirvanix.sdn.config.SDNContextModule; -import org.jclouds.nirvanix.sdn.reference.SDNConstants; +import org.jclouds.rest.RestContextBuilder; -import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.TypeLiteral; @@ -44,60 +39,17 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -public class SDNContextBuilder extends CloudContextBuilder { - - public SDNContextBuilder(String apikey, String appname, String password) { - this(new Properties()); - authenticate(this, apikey, appname, appname, password); - } - - public SDNContextBuilder(String apikey, String appname, String username, String password) { - this(new Properties()); - authenticate(this, apikey, appname, username, password); - } +public class SDNContextBuilder extends RestContextBuilder { public SDNContextBuilder(Properties props) { - super(new TypeLiteral() { + super(new TypeLiteral() { }, props); - initialize(this); } @Override - protected void addConnectionModule(List modules) { - addAuthenticationModule(this); - } - - public static void authenticate(SDNContextBuilder builder, String appkey, String appname, - String username, String password) { - builder.getProperties().setProperty(SDNConstants.PROPERTY_SDN_APPKEY, - checkNotNull(appkey, "appkey")); - builder.getProperties().setProperty(SDNConstants.PROPERTY_SDN_APPNAME, - checkNotNull(appname, "appname")); - builder.getProperties().setProperty(SDNConstants.PROPERTY_SDN_USERNAME, - checkNotNull(username, "username")); - builder.getProperties().setProperty(SDNConstants.PROPERTY_SDN_PASSWORD, - checkNotNull(password, "password")); - } - - public static void initialize(SDNContextBuilder builder) { - builder.getProperties().setProperty(SDNConstants.PROPERTY_SDN_ENDPOINT, - "http://services.nirvanix.com"); - } - - public static void addAuthenticationModule(SDNContextBuilder builder) { - builder.withModule(new RestSDNAuthenticationModule()); - builder.withModule(new RestSDNConnectionModule()); - } - - public static SDNContextBuilder withEndpoint(SDNContextBuilder builder, URI endpoint) { - builder.getProperties().setProperty(SDNConstants.PROPERTY_SDN_ENDPOINT, - checkNotNull(endpoint, "endpoint").toString()); - return (SDNContextBuilder) builder; - } - - @Override - public SDNContextBuilder relaxSSLHostname() { - return (SDNContextBuilder) super.relaxSSLHostname(); + protected void addClientModule(List modules) { + modules.add(new RestSDNAuthenticationModule()); + modules.add(new RestSDNClientModule()); } @Override @@ -105,64 +57,14 @@ public class SDNContextBuilder extends CloudContextBuilder { return (SDNContextBuilder) super.withExecutorService(service); } - @Override - public SDNContextBuilder withHttpMaxRedirects(int httpMaxRedirects) { - return (SDNContextBuilder) super.withHttpMaxRedirects(httpMaxRedirects); - } - - @Override - public SDNContextBuilder withHttpMaxRetries(int httpMaxRetries) { - return (SDNContextBuilder) super.withHttpMaxRetries(httpMaxRetries); - } - - @Override - public SDNContextBuilder withModule(Module module) { - return (SDNContextBuilder) super.withModule(module); - } - @Override public SDNContextBuilder withModules(Module... modules) { return (SDNContextBuilder) super.withModules(modules); } - @Override - public SDNContextBuilder withPoolIoWorkerThreads(int poolIoWorkerThreads) { - return (SDNContextBuilder) super.withPoolIoWorkerThreads(poolIoWorkerThreads); - } - - @Override - public SDNContextBuilder withPoolMaxConnectionReuse(int poolMaxConnectionReuse) { - return (SDNContextBuilder) super.withPoolMaxConnectionReuse(poolMaxConnectionReuse); - } - - @Override - public SDNContextBuilder withPoolMaxConnections(int poolMaxConnections) { - return (SDNContextBuilder) super.withPoolMaxConnections(poolMaxConnections); - } - - @Override - public SDNContextBuilder withPoolMaxSessionFailures(int poolMaxSessionFailures) { - return (SDNContextBuilder) super.withPoolMaxSessionFailures(poolMaxSessionFailures); - } - - @Override - public SDNContextBuilder withPoolRequestInvokerThreads(int poolRequestInvokerThreads) { - return (SDNContextBuilder) super.withPoolRequestInvokerThreads(poolRequestInvokerThreads); - } - - @Override - public SDNContextBuilder withEndpoint(URI endpoint) { - return (SDNContextBuilder) (SDNContextBuilder) withEndpoint(this, endpoint); - } - @Override protected void addContextModule(List modules) { modules.add(new SDNContextModule()); } - @Override - public SDNContext buildContext() { - Injector injector = buildInjector(); - return injector.getInstance(SDNContext.class); - } } diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNPropertiesBuilder.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNPropertiesBuilder.java new file mode 100644 index 0000000000..3e5fbf3c1c --- /dev/null +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SDNPropertiesBuilder.java @@ -0,0 +1,73 @@ +/** + * + * Copyright (C) 2009 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + */ +package org.jclouds.nirvanix.sdn; + +import static com.google.common.base.Preconditions.checkNotNull; + +import java.net.URI; +import java.util.Properties; + +import org.jclouds.http.HttpPropertiesBuilder; +import org.jclouds.nirvanix.sdn.reference.SDNConstants; + +/** + * Builds properties used in SDN Clients + * + * @author Adrian Cole + */ +public class SDNPropertiesBuilder extends HttpPropertiesBuilder { + + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(SDNConstants.PROPERTY_SDN_ENDPOINT, "http://services.nirvanix.com"); + return properties; + } + + public SDNPropertiesBuilder(Properties properties) { + super(properties); + } + + public SDNPropertiesBuilder(String appkey, String appname, String username, String password) { + super(); + withCredentials(appkey, appname, username, password); + } + + public SDNPropertiesBuilder withCredentials(String appkey, String appname, String username, + String password) { + properties.setProperty(SDNConstants.PROPERTY_SDN_APPKEY, checkNotNull(appkey, "appkey")); + properties.setProperty(SDNConstants.PROPERTY_SDN_APPNAME, checkNotNull(appname, "appname")); + properties + .setProperty(SDNConstants.PROPERTY_SDN_USERNAME, checkNotNull(username, "username")); + properties + .setProperty(SDNConstants.PROPERTY_SDN_PASSWORD, checkNotNull(password, "password")); + return this; + } + + public SDNPropertiesBuilder withEndpoint(URI endpoint) { + properties.setProperty(SDNConstants.PROPERTY_SDN_ENDPOINT, checkNotNull(endpoint, "endpoint") + .toString()); + return this; + } +} diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SessionToken.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SessionToken.java index 186b1bb8e5..790051c7cf 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SessionToken.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/SessionToken.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/binders/BindMetadataToQueryParams.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/binders/BindMetadataToQueryParams.java index fcc0934ba5..d61300875f 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/binders/BindMetadataToQueryParams.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/binders/BindMetadataToQueryParams.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/RestSDNAuthenticationModule.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/RestSDNAuthenticationModule.java index 3ca18ac6eb..13bc93a3fe 100755 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/RestSDNAuthenticationModule.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/RestSDNAuthenticationModule.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/RestSDNConnectionModule.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/RestSDNClientModule.java similarity index 83% rename from nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/RestSDNConnectionModule.java rename to nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/RestSDNClientModule.java index 4eca9f2e1e..03432fe735 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/RestSDNConnectionModule.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/RestSDNClientModule.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -24,7 +24,7 @@ package org.jclouds.nirvanix.sdn.config; import org.jclouds.http.RequiresHttp; -import org.jclouds.nirvanix.sdn.SDNConnection; +import org.jclouds.nirvanix.sdn.SDNClient; import org.jclouds.rest.RestClientFactory; import com.google.inject.AbstractModule; @@ -36,7 +36,7 @@ import com.google.inject.Provides; * @author Adrian Cole */ @RequiresHttp -public class RestSDNConnectionModule extends AbstractModule { +public class RestSDNClientModule extends AbstractModule { @Override protected void configure() { @@ -45,8 +45,8 @@ public class RestSDNConnectionModule extends AbstractModule { } @Provides - protected SDNConnection provideConnection(RestClientFactory factory) { - return factory.create(SDNConnection.class); + protected SDNClient provideClient(RestClientFactory factory) { + return factory.create(SDNClient.class); } protected void bindErrorHandlers() { diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/SDNContextModule.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/SDNContextModule.java index 65f7c52f3d..9ae2dd5024 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/SDNContextModule.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/config/SDNContextModule.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -25,33 +25,34 @@ package org.jclouds.nirvanix.sdn.config; import java.net.URI; -import javax.inject.Inject; import javax.inject.Named; +import javax.inject.Singleton; -import org.jclouds.cloud.internal.CloudContextImpl; +import org.jclouds.blobstore.config.BlobStoreObjectModule; import org.jclouds.http.RequiresHttp; import org.jclouds.lifecycle.Closer; import org.jclouds.nirvanix.sdn.SDN; -import org.jclouds.nirvanix.sdn.SDNConnection; -import org.jclouds.nirvanix.sdn.SDNContext; +import org.jclouds.nirvanix.sdn.SDNClient; import org.jclouds.nirvanix.sdn.reference.SDNConstants; +import org.jclouds.rest.RestContext; +import org.jclouds.rest.internal.RestContextImpl; import com.google.inject.AbstractModule; -import com.google.inject.Scopes; +import com.google.inject.Provides; @RequiresHttp public class SDNContextModule extends AbstractModule { @Override protected void configure() { - bind(SDNContext.class).to(SDNContextImpl.class).in(Scopes.SINGLETON); + // for converters to work. + install(new BlobStoreObjectModule()); } - public static class SDNContextImpl extends CloudContextImpl implements SDNContext { - @Inject - public SDNContextImpl(Closer closer, SDNConnection defaultApi, @SDN URI endPoint, - @Named(SDNConstants.PROPERTY_SDN_USERNAME) String account) { - super(closer, defaultApi, endPoint, account); - } + @Provides + @Singleton + RestContext provideContext(Closer closer, SDNClient defaultApi, @SDN URI endPoint, + @Named(SDNConstants.PROPERTY_SDN_USERNAME) String account) { + return new RestContextImpl(closer, defaultApi, endPoint, account); } } \ No newline at end of file diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/domain/UploadInfo.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/domain/UploadInfo.java index d018c6842d..a6319179ef 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/domain/UploadInfo.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/domain/UploadInfo.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/filters/AddSessionTokenToRequest.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/filters/AddSessionTokenToRequest.java index a8b06a906a..46185ea1c2 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/filters/AddSessionTokenToRequest.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/filters/AddSessionTokenToRequest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/filters/InsertUserContextIntoPath.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/filters/InsertUserContextIntoPath.java index d166184eab..ae03a72554 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/filters/InsertUserContextIntoPath.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/filters/InsertUserContextIntoPath.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one 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 75e73250cf..0d67d30198 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 @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one 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 bcba07cc02..5a9ada52c1 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 @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one 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 e6ad8d5736..d9d44f0240 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 @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/reference/SDNConstants.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/reference/SDNConstants.java index 7a90836011..f91612016d 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/reference/SDNConstants.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/reference/SDNConstants.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/reference/SDNQueryParams.java b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/reference/SDNQueryParams.java index 5918eb133e..3c244d3d07 100644 --- a/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/reference/SDNQueryParams.java +++ b/nirvanix/sdn/core/src/main/java/org/jclouds/nirvanix/sdn/reference/SDNQueryParams.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNAuthenticationLiveTest.java b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNAuthenticationLiveTest.java index a5a2a06950..c8848762d5 100644 --- a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNAuthenticationLiveTest.java +++ b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNAuthenticationLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNAuthenticationTest.java b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNAuthenticationTest.java index 2edd0d617f..5e5f8bc3cc 100755 --- a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNAuthenticationTest.java +++ b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNAuthenticationTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -65,8 +65,13 @@ public class SDNAuthenticationTest { new Object[] { "apple", "foo", "bar" }); assertEquals(httpMethod.getEndpoint().getHost(), "localhost"); assertEquals(httpMethod.getEndpoint().getPath(), "/ws/Authentication/Login.ashx"); - assertEquals(httpMethod.getEndpoint().getQuery(), - "output=json&password=bar&username=foo&appKey=apple"); + try { + assertEquals(httpMethod.getEndpoint().getQuery(), + "output=json&password=bar&username=foo&appKey=apple"); + } catch (AssertionError e) {// TODO JDK 6 orders differently + assertEquals(httpMethod.getEndpoint().getQuery(), + "output=json&username=foo&password=bar&appKey=apple"); + } assertEquals(httpMethod.getMethod(), HttpMethod.GET); assertEquals(httpMethod.getHeaders().size(), 0); assertEquals(RestAnnotationProcessor.getParserOrThrowException(method), diff --git a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNConnectionLiveTest.java b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNClientLiveTest.java similarity index 77% rename from nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNConnectionLiveTest.java rename to nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNClientLiveTest.java index 25d9108efb..24420864e8 100644 --- a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNConnectionLiveTest.java +++ b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNClientLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -33,9 +33,8 @@ import java.util.concurrent.ExecutionException; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import org.jclouds.blobstore.domain.BlobMetadata; +import org.jclouds.blobstore.domain.Blob; import org.jclouds.blobstore.integration.internal.BaseBlobStoreIntegrationTest; -import org.jclouds.blobstore.internal.BlobImpl; import org.jclouds.logging.log4j.config.Log4JLoggingModule; import org.jclouds.nirvanix.sdn.domain.UploadInfo; import org.testng.annotations.BeforeGroups; @@ -44,29 +43,29 @@ import org.testng.annotations.Test; import com.google.common.collect.ImmutableMap; /** - * Tests behavior of {@code SDNConnection} + * Tests behavior of {@code SDNClient} * * @author Adrian Cole */ -@Test(groups = "live", sequential = true, testName = "sdn.SDNConnectionLiveTest") -public class SDNConnectionLiveTest { +@Test(groups = "live", sequential = true, testName = "sdn.SDNClientLiveTest") +public class SDNClientLiveTest { - protected SDNConnection connection; + protected SDNClient connection; private String containerPrefix = BaseBlobStoreIntegrationTest.CONTAINER_PREFIX; URI container1; URI container2; @BeforeGroups(groups = { "live" }) - public void setupConnection() { + public void setupClient() { String appname = checkNotNull(System.getProperty("jclouds.test.appname"), "jclouds.test.appname"); String appid = checkNotNull(System.getProperty("jclouds.test.appid"), "jclouds.test.appid"); String user = checkNotNull(System.getProperty("jclouds.test.user"), "jclouds.test.user"); String password = checkNotNull(System.getProperty("jclouds.test.key"), "jclouds.test.key"); - connection = new SDNContextBuilder(appid, appname, user, password).withModules( - new Log4JLoggingModule()).buildContext().getApi(); + connection = new SDNContextBuilder(new SDNPropertiesBuilder(appid, appname, user, password) + .build()).withModules(new Log4JLoggingModule()).buildContext().getApi(); } public void testUploadToken() throws InterruptedException, ExecutionException, TimeoutException { @@ -76,8 +75,12 @@ public class SDNConnectionLiveTest { assertNotNull(uploadInfo.getHost()); assertNotNull(uploadInfo.getToken()); - connection.upload(uploadInfo.getHost(), uploadInfo.getToken(), containerName, - new BlobImpl("test.txt", "value")).get(30, TimeUnit.SECONDS); + Blob blob = connection.newBlob(); + blob.getMetadata().setName("test.txt"); + blob.setData("value"); + + connection.upload(uploadInfo.getHost(), uploadInfo.getToken(), containerName, blob).get(30, + TimeUnit.SECONDS); String metadataS = connection.getMetadata(containerName + "/test.txt").get(30, TimeUnit.SECONDS); @@ -86,8 +89,8 @@ public class SDNConnectionLiveTest { String content = connection.getFile(containerName + "/test.txt").get(30, TimeUnit.SECONDS); assertEquals(content, "value"); - Map metadata = ImmutableMap.of("chef", "sushi", "foo", "bar"); - connection.setMetadata(containerName+"/test.txt", metadata).get(30, TimeUnit.SECONDS); + Map metadata = ImmutableMap.of("chef", "sushi", "foo", "bar"); + connection.setMetadata(containerName + "/test.txt", metadata).get(30, TimeUnit.SECONDS); } } diff --git a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNConnectionTest.java b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNClientTest.java similarity index 88% rename from nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNConnectionTest.java rename to nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNClientTest.java index 826ff0f6d1..155a5ba5eb 100644 --- a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNConnectionTest.java +++ b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/SDNClientTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -37,7 +37,6 @@ import javax.ws.rs.core.HttpHeaders; import org.jclouds.blobstore.binders.BindBlobToMultipartFormTest; import org.jclouds.blobstore.domain.Blob; -import org.jclouds.blobstore.domain.BlobMetadata; import org.jclouds.concurrent.WithinThreadExecutorService; import org.jclouds.concurrent.config.ExecutorServiceModule; import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; @@ -70,13 +69,13 @@ import com.google.inject.TypeLiteral; * * @author Adrian Cole */ -@Test(groups = "unit", testName = "sdn.SDNConnection") -public class SDNConnectionTest { +@Test(groups = "unit", testName = "sdn.SDNClient") +public class SDNClientTest { - private RestAnnotationProcessor processor; + private RestAnnotationProcessor processor; public void testGetStorageNode() throws SecurityException, NoSuchMethodException { - Method method = SDNConnection.class.getMethod("getStorageNode", String.class, long.class); + Method method = SDNClient.class.getMethod("getStorageNode", String.class, long.class); GeneratedHttpRequest httpMethod = processor.createRequest(method, new Object[] { "adriansmovies", 734859264 }); assertEquals(httpMethod.getEndpoint().getHost(), "localhost"); @@ -92,10 +91,10 @@ public class SDNConnectionTest { } public void testUpload() throws SecurityException, NoSuchMethodException, IOException { - Method method = SDNConnection.class.getMethod("upload", URI.class, String.class, + Method method = SDNClient.class.getMethod("upload", URI.class, String.class, String.class, Blob.class); - Blob blob = BindBlobToMultipartFormTest.TEST_BLOB; - GeneratedHttpRequest httpMethod = processor.createRequest(method, + Blob blob = BindBlobToMultipartFormTest.TEST_BLOB; + GeneratedHttpRequest httpMethod = processor.createRequest(method, new Object[] { URI.create("http://uploader"), "token", "adriansmovies", blob }); assertEquals(httpMethod.getEndpoint().getHost(), "uploader"); assertEquals(httpMethod.getEndpoint().getPath(), "/Upload.ashx"); @@ -117,8 +116,8 @@ public class SDNConnectionTest { } public void testSetMetadata() throws SecurityException, NoSuchMethodException, IOException { - Method method = SDNConnection.class.getMethod("setMetadata", String.class, Map.class); - GeneratedHttpRequest httpMethod = processor + Method method = SDNClient.class.getMethod("setMetadata", String.class, Map.class); + GeneratedHttpRequest httpMethod = processor .createRequest(method, new Object[] { "adriansmovies/sushi.avi", ImmutableMap.of("Chef", "Kawasaki") }); assertEquals(httpMethod.getEndpoint().getHost(), "localhost"); @@ -135,8 +134,8 @@ public class SDNConnectionTest { } public void testGetMetadata() throws SecurityException, NoSuchMethodException, IOException { - Method method = SDNConnection.class.getMethod("getMetadata", String.class); - GeneratedHttpRequest httpMethod = processor.createRequest(method, + Method method = SDNClient.class.getMethod("getMetadata", String.class); + GeneratedHttpRequest httpMethod = processor.createRequest(method, new Object[] { "adriansmovies/sushi.avi" }); assertEquals(httpMethod.getEndpoint().getHost(), "localhost"); assertEquals(httpMethod.getEndpoint().getPath(), "/ws/Metadata/GetMetadata.ashx"); @@ -151,8 +150,8 @@ public class SDNConnectionTest { } public void testGetFile() throws SecurityException, NoSuchMethodException, IOException { - Method method = SDNConnection.class.getMethod("getFile", String.class); - GeneratedHttpRequest httpMethod = processor.createRequest(method, + Method method = SDNClient.class.getMethod("getFile", String.class); + GeneratedHttpRequest httpMethod = processor.createRequest(method, new Object[] { "adriansmovies/sushi.avi" }); assertEquals(httpMethod.getEndpoint().getHost(), "localhost"); assertEquals(httpMethod.getEndpoint().getPath(), "/adriansmovies/sushi.avi"); @@ -195,7 +194,7 @@ public class SDNConnectionTest { }, new RestModule(), new ExecutorServiceModule(new WithinThreadExecutorService()), new JavaUrlHttpCommandExecutorServiceModule()); processor = injector.getInstance(Key - .get(new TypeLiteral>() { + .get(new TypeLiteral>() { })); } diff --git a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/binders/BindMetadataToQueryParamsTest.java b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/binders/BindMetadataToQueryParamsTest.java index 09fba7446a..e8b392c69a 100644 --- a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/binders/BindMetadataToQueryParamsTest.java +++ b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/binders/BindMetadataToQueryParamsTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/filters/AddSessionTokenToRequestTest.java b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/filters/AddSessionTokenToRequestTest.java index 38406381c4..fc94067223 100755 --- a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/filters/AddSessionTokenToRequestTest.java +++ b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/filters/AddSessionTokenToRequestTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/filters/InsertUserContextIntoPathTest.java b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/filters/InsertUserContextIntoPathTest.java index 805ee292d1..9a403f9e22 100644 --- a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/filters/InsertUserContextIntoPathTest.java +++ b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/filters/InsertUserContextIntoPathTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseMetadataFromJsonResponseTest.java b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseMetadataFromJsonResponseTest.java index 4cd551b6bd..1b6abb6dd8 100644 --- a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseMetadataFromJsonResponseTest.java +++ b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseMetadataFromJsonResponseTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseSessionTokenFromJsonResponseTest.java b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseSessionTokenFromJsonResponseTest.java index 7a0a6eccad..c421301cb7 100644 --- a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseSessionTokenFromJsonResponseTest.java +++ b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseSessionTokenFromJsonResponseTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseUploadInfoFromJsonResponseTest.java b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseUploadInfoFromJsonResponseTest.java index bef75a6a87..46cf64fdb4 100644 --- a/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseUploadInfoFromJsonResponseTest.java +++ b/nirvanix/sdn/core/src/test/java/org/jclouds/nirvanix/sdn/functions/ParseUploadInfoFromJsonResponseTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/nirvanix/sdn/core/src/test/resources/log4j.xml b/nirvanix/sdn/core/src/test/resources/log4j.xml index 23deb5a816..a3bff22c6b 100755 --- a/nirvanix/sdn/core/src/test/resources/log4j.xml +++ b/nirvanix/sdn/core/src/test/resources/log4j.xml @@ -2,7 +2,7 @@ + diff --git a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/specimpl/MultivaluedMapImpl.java b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/specimpl/MultivaluedMapImpl.java index 41c106b65d..97a0b91cb2 100644 --- a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/specimpl/MultivaluedMapImpl.java +++ b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/specimpl/MultivaluedMapImpl.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/specimpl/UriBuilderImpl.java b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/specimpl/UriBuilderImpl.java index bb8fb79e79..f7423edfb6 100644 --- a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/specimpl/UriBuilderImpl.java +++ b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/specimpl/UriBuilderImpl.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/spi/Failure.java b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/spi/Failure.java index 9a2b6b33ca..152d04db09 100644 --- a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/spi/Failure.java +++ b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/spi/Failure.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/spi/LoggableFailure.java b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/spi/LoggableFailure.java index cc11b9cca7..20c5a8863f 100644 --- a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/spi/LoggableFailure.java +++ b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/spi/LoggableFailure.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/Encode.java b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/Encode.java index b11df86797..63ee3af5d2 100644 --- a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/Encode.java +++ b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/Encode.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/HttpResponseCodes.java b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/HttpResponseCodes.java index e4c77420d2..6de4c225eb 100644 --- a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/HttpResponseCodes.java +++ b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/HttpResponseCodes.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/IsHttpMethod.java b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/IsHttpMethod.java index 5cf1d7acc7..19a1c053db 100644 --- a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/IsHttpMethod.java +++ b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/IsHttpMethod.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/MediaTypeHelper.java b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/MediaTypeHelper.java index c8e0bcc2b0..f679251ebc 100644 --- a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/MediaTypeHelper.java +++ b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/MediaTypeHelper.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/PathHelper.java b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/PathHelper.java index ac98ff57a9..380a4a25d9 100644 --- a/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/PathHelper.java +++ b/thirdparty/resteasy-jaxrs-client/src/main/java/org/jboss/resteasy/util/PathHelper.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/BaseVCloudXContextBuilder.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/BaseVCloudXContextBuilder.java index 5e6e994dd6..6d4dd6c36a 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/BaseVCloudXContextBuilder.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/BaseVCloudXContextBuilder.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -23,22 +23,24 @@ */ package org.jclouds.vcloudx; -import java.net.URI; import java.util.List; import java.util.Properties; +import java.util.concurrent.ExecutorService; import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; import org.jclouds.logging.jdk.config.JDKLoggingModule; -import org.jclouds.vcloudx.config.BaseRestVCloudXConnectionModule; +import org.jclouds.rest.RestContextBuilder; +import org.jclouds.vcloudx.config.BaseVCloudXRestClientModule; import org.jclouds.vcloudx.config.BaseVCloudXContextModule; +import org.jclouds.vcloudx.config.RestVCloudXAuthenticationModule; import com.google.inject.Injector; import com.google.inject.Module; import com.google.inject.TypeLiteral; /** - * Creates {@link VCloudXContext} or {@link Injector} instances based on the most commonly - * requested arguments. + * Creates {@link VCloudXContext} or {@link Injector} instances based on the most commonly requested + * arguments. *

* Note that Threadsafe objects will be bound as singletons to the Injector or Context provided. *

@@ -49,21 +51,17 @@ import com.google.inject.TypeLiteral; * @author Adrian Cole * @see CloudFilesContext */ -public class BaseVCloudXContextBuilder extends VCloudXContextBuilder { +public class BaseVCloudXContextBuilder extends RestContextBuilder { - public BaseVCloudXContextBuilder(URI endpoint, String id, String secret) { - super(new TypeLiteral(){}, endpoint, id, secret); - - } public BaseVCloudXContextBuilder(Properties props) { - super(new TypeLiteral(){}, props); - + super(new TypeLiteral() { + }, props); } @Override - protected void addConnectionModule(List modules) { - addAuthenticationModule(this); - modules.add(new BaseRestVCloudXConnectionModule()); + protected void addClientModule(List modules) { + modules.add(new RestVCloudXAuthenticationModule()); + modules.add(new BaseVCloudXRestClientModule()); } @Override @@ -71,4 +69,14 @@ public class BaseVCloudXContextBuilder extends VCloudXContextBuilder + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXConnection.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXClient.java similarity index 94% rename from vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXConnection.java rename to vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXClient.java index 410bc39427..4f28f291f3 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXConnection.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXClient.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -43,7 +43,7 @@ import org.jclouds.vcloudx.xml.OrgLinksHandler; * @author Adrian Cole */ @RequestFilters(SetVCloudTokenCookie.class) -public interface VCloudXConnection { +public interface VCloudXClient { /** * This call returns a list of all vCloud Data Centers (vDCs), catalogs, and task lists within diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXContext.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXContext.java deleted file mode 100644 index 26f0b6046e..0000000000 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXContext.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * - * Copyright (C) 2009 Global Cloud Specialists, Inc. - * - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - */ -package org.jclouds.vcloudx; - -import org.jclouds.cloud.CloudContext; - -/** - * Represents an authenticated context to VCloud Express - * - * @see - * @see VCloudXConnection - * @see CloudContext - * @author Adrian Cole - * - */ -public interface VCloudXContext extends CloudContext { - -} \ No newline at end of file diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXContextBuilder.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXContextBuilder.java deleted file mode 100755 index d8fa5d8902..0000000000 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXContextBuilder.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * - * Copyright (C) 2009 Global Cloud Specialists, Inc. - * - * ==================================================================== - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * ==================================================================== - */ -package org.jclouds.vcloudx; - -import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.vcloudx.reference.VCloudXConstants.PROPERTY_VCLOUDX_ENDPOINT; -import static org.jclouds.vcloudx.reference.VCloudXConstants.PROPERTY_VCLOUDX_KEY; -import static org.jclouds.vcloudx.reference.VCloudXConstants.PROPERTY_VCLOUDX_SESSIONINTERVAL; -import static org.jclouds.vcloudx.reference.VCloudXConstants.PROPERTY_VCLOUDX_USER; - -import java.net.URI; -import java.util.Properties; - -import org.jclouds.cloud.CloudContextBuilder; -import org.jclouds.http.config.JavaUrlHttpCommandExecutorServiceModule; -import org.jclouds.logging.jdk.config.JDKLoggingModule; -import org.jclouds.vcloudx.config.RestVCloudXAuthenticationModule; -import org.jclouds.vcloudx.reference.VCloudXConstants; - -import com.google.inject.Injector; -import com.google.inject.Key; -import com.google.inject.TypeLiteral; -import com.google.inject.util.Types; - -/** - * Creates {@link VCloudXContext} or {@link Injector} instances based on the most commonly requested - * arguments. - *

- * Note that Threadsafe objects will be bound as singletons to the Injector or Context provided. - *

- *

- * If no Modules are specified, the default {@link JDKLoggingModule logging} and - * {@link JavaUrlHttpCommandExecutorServiceModule http transports} will be installed. - * - * @author Adrian Cole - * @see CloudFilesContext - */ -public abstract class VCloudXContextBuilder extends - CloudContextBuilder { - - public VCloudXContextBuilder(TypeLiteral literal, URI endpoint, String id, String secret) { - this(literal, addEndpointTo(endpoint, new Properties())); - authenticate(this, id, secret); - withTokenExpiration(9 * 60); - } - - private static Properties addEndpointTo(URI endpoint, Properties properties) { - properties.setProperty(VCloudXConstants.PROPERTY_VCLOUDX_ENDPOINT, checkNotNull(endpoint, - "endpoint").toString()); - return properties; - } - - public VCloudXContextBuilder(TypeLiteral literal, Properties props) { - super(literal, props); - checkNotNull(properties.getProperty(VCloudXConstants.PROPERTY_VCLOUDX_ENDPOINT), - VCloudXConstants.PROPERTY_VCLOUDX_ENDPOINT); - } - - public static void authenticate(VCloudXContextBuilder builder, - String id, String secret) { - builder.getProperties().setProperty(PROPERTY_VCLOUDX_USER, checkNotNull(id, "user")); - builder.getProperties().setProperty(PROPERTY_VCLOUDX_KEY, checkNotNull(secret, "key")); - } - - public static void addAuthenticationModule( - VCloudXContextBuilder builder) { - builder.withModule(new RestVCloudXAuthenticationModule()); - } - - public static VCloudXContextBuilder withEndpoint( - VCloudXContextBuilder builder, URI endpoint) { - builder.getProperties().setProperty(PROPERTY_VCLOUDX_ENDPOINT, - checkNotNull(endpoint, "endpoint").toString()); - return builder; - } - - public VCloudXContextBuilder withTokenExpiration(long seconds) { - getProperties().setProperty(PROPERTY_VCLOUDX_SESSIONINTERVAL, seconds + ""); - return this; - } - - @Override - public VCloudXContextBuilder withEndpoint(URI endpoint) { - return (VCloudXContextBuilder) withEndpoint(this, endpoint); - } - - @Override - @SuppressWarnings("unchecked") - public VCloudXContext buildContext() { - Injector injector = buildInjector(); - return (VCloudXContext) injector.getInstance(Key.get(Types.newParameterizedType( - VCloudXContext.class, connectionType.getType()))); - } - -} diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXLogin.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXLogin.java index 72f71ed32b..e5a31f86b7 100755 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXLogin.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXLogin.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXMediaType.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXMediaType.java index e5613dce0d..19f7f3dd64 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXMediaType.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXMediaType.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -21,7 +21,6 @@ * under the License. * ==================================================================== */ - package org.jclouds.vcloudx; import javax.ws.rs.core.MediaType; diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXPropertiesBuilder.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXPropertiesBuilder.java new file mode 100644 index 0000000000..de6c56f24d --- /dev/null +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/VCloudXPropertiesBuilder.java @@ -0,0 +1,76 @@ +/** + * + * Copyright (C) 2009 Cloud Conscious, LLC. + * + * ==================================================================== + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * ==================================================================== + */ +package org.jclouds.vcloudx; + +import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.vcloudx.reference.VCloudXConstants.PROPERTY_VCLOUDX_ENDPOINT; +import static org.jclouds.vcloudx.reference.VCloudXConstants.PROPERTY_VCLOUDX_KEY; +import static org.jclouds.vcloudx.reference.VCloudXConstants.PROPERTY_VCLOUDX_SESSIONINTERVAL; +import static org.jclouds.vcloudx.reference.VCloudXConstants.PROPERTY_VCLOUDX_USER; + +import java.net.URI; +import java.util.Properties; + +import org.jclouds.http.HttpPropertiesBuilder; + +/** + * Builds properties used in VCloudX Clients + * + * @author Adrian Cole + */ +public class VCloudXPropertiesBuilder extends HttpPropertiesBuilder { + @Override + protected Properties defaultProperties() { + Properties properties = super.defaultProperties(); + properties.setProperty(PROPERTY_VCLOUDX_SESSIONINTERVAL, 9 * 60 + ""); + return properties; + } + + public VCloudXPropertiesBuilder(Properties properties) { + super(properties); + } + + public VCloudXPropertiesBuilder(URI endpoint, String id, String secret) { + super(); + withCredentials(id, secret); + withEndpoint(endpoint); + } + + public VCloudXPropertiesBuilder withTokenExpiration(long seconds) { + properties.setProperty(PROPERTY_VCLOUDX_SESSIONINTERVAL, seconds + ""); + return this; + } + + public VCloudXPropertiesBuilder withCredentials(String id, String secret) { + properties.setProperty(PROPERTY_VCLOUDX_USER, checkNotNull(id, "user")); + properties.setProperty(PROPERTY_VCLOUDX_KEY, checkNotNull(secret, "key")); + return this; + } + + public VCloudXPropertiesBuilder withEndpoint(URI endpoint) { + properties.setProperty(PROPERTY_VCLOUDX_ENDPOINT, checkNotNull(endpoint, "endpoint") + .toString()); + return this; + } +} diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/BaseVCloudXContextModule.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/BaseVCloudXContextModule.java index 52694060a5..8b9eef4545 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/BaseVCloudXContextModule.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/BaseVCloudXContextModule.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -25,19 +25,18 @@ package org.jclouds.vcloudx.config; import java.net.URI; -import javax.inject.Inject; import javax.inject.Named; +import javax.inject.Singleton; -import org.jclouds.cloud.internal.CloudContextImpl; import org.jclouds.lifecycle.Closer; -import org.jclouds.vcloudx.VCloudXConnection; -import org.jclouds.vcloudx.VCloudXContext; +import org.jclouds.rest.RestContext; +import org.jclouds.rest.internal.RestContextImpl; +import org.jclouds.vcloudx.VCloudXClient; import org.jclouds.vcloudx.endpoints.Org; import org.jclouds.vcloudx.reference.VCloudXConstants; import com.google.inject.AbstractModule; -import com.google.inject.Scopes; -import com.google.inject.TypeLiteral; +import com.google.inject.Provides; /** * @author Adrian Cole @@ -45,17 +44,13 @@ import com.google.inject.TypeLiteral; public class BaseVCloudXContextModule extends AbstractModule { @Override protected void configure() { - bind(new TypeLiteral>() { - }).to(VCloudXContextImpl.class).in(Scopes.SINGLETON); } - public static class VCloudXContextImpl extends CloudContextImpl implements - VCloudXContext { - @Inject - public VCloudXContextImpl(Closer closer, VCloudXConnection defaultApi, @Org URI endPoint, - @Named(VCloudXConstants.PROPERTY_VCLOUDX_USER) String account) { - super(closer, defaultApi, endPoint, account); - } + @Provides + @Singleton + RestContext provideContext(Closer closer, VCloudXClient defaultApi, + @Org URI endPoint, @Named(VCloudXConstants.PROPERTY_VCLOUDX_USER) String account) { + return new RestContextImpl(closer, defaultApi, endPoint, account); } } \ No newline at end of file diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/BaseRestVCloudXConnectionModule.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/BaseVCloudXRestClientModule.java similarity index 77% rename from vcloudx/core/src/main/java/org/jclouds/vcloudx/config/BaseRestVCloudXConnectionModule.java rename to vcloudx/core/src/main/java/org/jclouds/vcloudx/config/BaseVCloudXRestClientModule.java index 52443ca40a..58ab5b0ffb 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/BaseRestVCloudXConnectionModule.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/BaseVCloudXRestClientModule.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -25,10 +25,10 @@ package org.jclouds.vcloudx.config; import javax.inject.Singleton; -import org.jclouds.cloud.ConfiguresCloudConnection; import org.jclouds.http.RequiresHttp; +import org.jclouds.rest.ConfiguresRestClient; import org.jclouds.rest.RestClientFactory; -import org.jclouds.vcloudx.VCloudXConnection; +import org.jclouds.vcloudx.VCloudXClient; import com.google.inject.AbstractModule; import com.google.inject.Provides; @@ -40,8 +40,8 @@ import com.google.inject.Provides; * @author Adrian Cole */ @RequiresHttp -@ConfiguresCloudConnection -public class BaseRestVCloudXConnectionModule extends AbstractModule { +@ConfiguresRestClient +public class BaseVCloudXRestClientModule extends AbstractModule { @Override protected void configure() { @@ -49,8 +49,8 @@ public class BaseRestVCloudXConnectionModule extends AbstractModule { @Provides @Singleton - protected VCloudXConnection provideVCloudXConnection(RestClientFactory factory) { - return factory.create(VCloudXConnection.class); + protected VCloudXClient provideVCloudXClient(RestClientFactory factory) { + return factory.create(VCloudXClient.class); } diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/RestVCloudXAuthenticationModule.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/RestVCloudXAuthenticationModule.java index d7f41efc52..bd1fff6fd2 100755 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/RestVCloudXAuthenticationModule.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/config/RestVCloudXAuthenticationModule.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/domain/OrgLinks.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/domain/OrgLinks.java index 169670d7fc..c3b40a81dc 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/domain/OrgLinks.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/domain/OrgLinks.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/Catalog.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/Catalog.java index 7b9e3c7c0c..7b342457ce 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/Catalog.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/Catalog.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/Org.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/Org.java index b3883f74ef..7472f6e833 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/Org.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/Org.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/TaskList.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/TaskList.java index d4645343f6..2b05c94330 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/TaskList.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/TaskList.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/VCloudX.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/VCloudX.java index 4d2118054f..7735bc90bb 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/VCloudX.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/VCloudX.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/VDC.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/VDC.java index 334a264f07..43779edcc2 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/VDC.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/endpoints/VDC.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/filters/SetVCloudTokenCookie.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/filters/SetVCloudTokenCookie.java index 0e40526c93..35ec57d897 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/filters/SetVCloudTokenCookie.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/filters/SetVCloudTokenCookie.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one 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 0159e480ed..f838cc4b08 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 @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/reference/VCloudXConstants.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/reference/VCloudXConstants.java index 002df07796..0d10648069 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/reference/VCloudXConstants.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/reference/VCloudXConstants.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/reference/package-info.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/reference/package-info.java index 207062df2d..a3b68da07e 100755 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/reference/package-info.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/reference/package-info.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/xml/OrgLinksHandler.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/xml/OrgLinksHandler.java index 0c9fdee043..091736baff 100644 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/xml/OrgLinksHandler.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/xml/OrgLinksHandler.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/main/java/org/jclouds/vcloudx/xml/OrgListToOrgUriHandler.java b/vcloudx/core/src/main/java/org/jclouds/vcloudx/xml/OrgListToOrgUriHandler.java index 851b7cfa3d..d3dbabfafa 100755 --- a/vcloudx/core/src/main/java/org/jclouds/vcloudx/xml/OrgListToOrgUriHandler.java +++ b/vcloudx/core/src/main/java/org/jclouds/vcloudx/xml/OrgListToOrgUriHandler.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/test/java/org/jclouds/vcloudx/BaseVCloudXContextBuilderTest.java b/vcloudx/core/src/test/java/org/jclouds/vcloudx/BaseVCloudXContextBuilderTest.java index ae32514fbc..f184d66a6c 100755 --- a/vcloudx/core/src/test/java/org/jclouds/vcloudx/BaseVCloudXContextBuilderTest.java +++ b/vcloudx/core/src/test/java/org/jclouds/vcloudx/BaseVCloudXContextBuilderTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -30,12 +30,12 @@ import java.net.URI; import java.util.ArrayList; import java.util.List; -import org.jclouds.cloud.CloudContext; -import org.jclouds.cloud.CloudContextBuilder; -import org.jclouds.cloud.ConfiguresCloudConnection; -import org.jclouds.vcloudx.config.BaseRestVCloudXConnectionModule; +import org.jclouds.rest.ConfiguresRestClient; +import org.jclouds.rest.RestContext; +import org.jclouds.rest.RestContextBuilder; +import org.jclouds.rest.internal.RestContextImpl; import org.jclouds.vcloudx.config.BaseVCloudXContextModule; -import org.jclouds.vcloudx.config.BaseVCloudXContextModule.VCloudXContextImpl; +import org.jclouds.vcloudx.config.BaseVCloudXRestClientModule; import org.jclouds.vcloudx.endpoints.Org; import org.jclouds.vcloudx.reference.VCloudXConstants; import org.testng.annotations.Test; @@ -53,19 +53,19 @@ import com.google.inject.TypeLiteral; */ @Test(groups = "unit", testName = "vcloudx.BaseVCloudXContextBuilderTest") public class BaseVCloudXContextBuilderTest { - VCloudXConnection connection = createMock(VCloudXConnection.class); + VCloudXClient connection = createMock(VCloudXClient.class); - @ConfiguresCloudConnection - private final class StubConnectionModule extends AbstractModule { + @ConfiguresRestClient + private final class StubClientModule extends AbstractModule { @Override protected void configure() { bind(URI.class).annotatedWith(Org.class).toInstance(URI.create("http://org")); - bind(VCloudXConnection.class).toInstance(connection); + bind(VCloudXClient.class).toInstance(connection); } } public void testNewBuilder() { - CloudContextBuilder builder = builder(); + RestContextBuilder builder = builder(); assertEquals(builder.getProperties().getProperty(VCloudXConstants.PROPERTY_VCLOUDX_ENDPOINT), "http://localhost"); @@ -78,42 +78,41 @@ public class BaseVCloudXContextBuilderTest { } public void testBuildContext() { - CloudContextBuilder builder = builder(); - CloudContext context = builder.buildContext(); - assertEquals(context.getClass(), VCloudXContextImpl.class); + RestContextBuilder builder = builder(); + RestContext context = builder.buildContext(); + assertEquals(context.getClass(), RestContextImpl.class); assertEquals(context.getApi(), connection); assertEquals(context.getAccount(), "id"); assertEquals(context.getEndPoint(), URI.create("http://org")); } - public CloudContextBuilder builder() { - return new BaseVCloudXContextBuilder(URI.create("http://localhost"), "id", "secret") - .withModule(new StubConnectionModule()); + public BaseVCloudXContextBuilder builder() { + return new BaseVCloudXContextBuilder(new VCloudXPropertiesBuilder(URI + .create("http://localhost"), "id", "secret").build()) + .withModules(new StubClientModule()); } public void testBuildInjector() { - CloudContextBuilder builder = builder(); + RestContextBuilder builder = builder(); Injector i = builder.buildInjector(); - assert i.getInstance(Key.get(new TypeLiteral>() { + assert i.getInstance(Key.get(new TypeLiteral>() { })) != null; } protected void testAddContextModule() { List modules = new ArrayList(); - BaseVCloudXContextBuilder builder = new BaseVCloudXContextBuilder(URI - .create("http://localhost"), "id", "secret"); + BaseVCloudXContextBuilder builder = builder(); builder.addContextModule(modules); assertEquals(modules.size(), 1); assertEquals(modules.get(0).getClass(), BaseVCloudXContextModule.class); } - protected void addConnectionModule() { + protected void addClientModule() { List modules = new ArrayList(); - BaseVCloudXContextBuilder builder = new BaseVCloudXContextBuilder(URI - .create("http://localhost"), "id", "secret"); - builder.addConnectionModule(modules); + BaseVCloudXContextBuilder builder = builder(); + builder.addClientModule(modules); assertEquals(modules.size(), 1); - assertEquals(modules.get(0).getClass(), BaseRestVCloudXConnectionModule.class); + assertEquals(modules.get(0).getClass(), BaseVCloudXRestClientModule.class); } } diff --git a/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXConnectionLiveTest.java b/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXClientLiveTest.java similarity index 81% rename from vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXConnectionLiveTest.java rename to vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXClientLiveTest.java index 2628ec61ce..3b37ac40d6 100644 --- a/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXConnectionLiveTest.java +++ b/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXClientLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -35,14 +35,14 @@ import org.testng.annotations.BeforeGroups; import org.testng.annotations.Test; /** - * Tests behavior of {@code VCloudXConnection} + * Tests behavior of {@code VCloudXClient} * * @author Adrian Cole */ -@Test(groups = "live", testName = "vcloudx.VCloudXConnectionLiveTest") -public class VCloudXConnectionLiveTest { +@Test(groups = "live", testName = "vcloudx.VCloudXClientLiveTest") +public class VCloudXClientLiveTest { - private VCloudXConnection connection; + private VCloudXClient connection; private String account; @Test @@ -57,13 +57,13 @@ public class VCloudXConnectionLiveTest { } @BeforeGroups(groups = { "live" }) - public void setupConnection() { + public void setupClient() { String endpoint = checkNotNull(System.getProperty("jclouds.test.endpoint"), "jclouds.test.endpoint"); account = checkNotNull(System.getProperty("jclouds.test.user"), "jclouds.test.user"); String key = checkNotNull(System.getProperty("jclouds.test.key"), "jclouds.test.key"); - connection = new BaseVCloudXContextBuilder(URI.create(endpoint), account, key).withModules( - new Log4JLoggingModule()).buildContext().getApi(); + connection = new BaseVCloudXContextBuilder(new VCloudXPropertiesBuilder(URI.create(endpoint), + account, key).build()).withModules(new Log4JLoggingModule()).buildContext().getApi(); } } diff --git a/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXConnectionTest.java b/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXClientTest.java similarity index 86% rename from vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXConnectionTest.java rename to vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXClientTest.java index bfefab7736..25aac39acb 100644 --- a/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXConnectionTest.java +++ b/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXClientTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -53,24 +53,25 @@ import com.google.inject.Key; import com.google.inject.TypeLiteral; /** - * Tests behavior of {@code VCloudXConnection} + * Tests behavior of {@code VCloudXClient} * * @author Adrian Cole */ -@Test(groups = "unit", testName = "vcloudx.VCloudXConnection") -public class VCloudXConnectionTest { +@Test(groups = "unit", testName = "vcloudx.VCloudXClient") +public class VCloudXClientTest { - private RestAnnotationProcessor processor; + private RestAnnotationProcessor processor; public void testOrganization() throws SecurityException, NoSuchMethodException { - Method method = VCloudXConnection.class.getMethod("getOrganization"); + Method method = VCloudXClient.class.getMethod("getOrganization"); HttpRequest httpMethod = processor.createRequest(method); assertEquals(httpMethod.getRequestLine(), "GET http://org HTTP/1.1"); assertEquals(httpMethod.getHeaders().size(), 1); assertEquals(httpMethod.getFirstHeaderOrNull(HttpHeaders.ACCEPT), MediaType.APPLICATION_XML); - assertEquals(RestAnnotationProcessor.getXMLTransformerOrNull(method),OrgLinksHandler.class); + assertEquals(RestAnnotationProcessor.getSaxResponseParserClassOrNull(method),OrgLinksHandler.class); assertEquals(httpMethod.getFilters().size(), 1); assertEquals(httpMethod.getFilters().get(0).getClass(), SetVCloudTokenCookie.class); + assertEquals(processor.createExceptionParserOrNullIfNotFound(method), null); } @BeforeClass @@ -97,7 +98,7 @@ public class VCloudXConnectionTest { }, new RestModule(), new ExecutorServiceModule(new WithinThreadExecutorService()), new JavaUrlHttpCommandExecutorServiceModule()); processor = injector.getInstance(Key - .get(new TypeLiteral>() { + .get(new TypeLiteral>() { })); } diff --git a/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXLoginLiveTest.java b/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXLoginLiveTest.java index 074b0f19cb..537d71fd98 100755 --- a/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXLoginLiveTest.java +++ b/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXLoginLiveTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one @@ -36,13 +36,13 @@ import java.util.Properties; import javax.inject.Named; import javax.inject.Singleton; -import org.jclouds.cloud.CloudContext; -import org.jclouds.cloud.CloudContextBuilder; -import org.jclouds.cloud.internal.CloudContextImpl; import org.jclouds.concurrent.WithinThreadExecutorService; import org.jclouds.concurrent.config.ExecutorServiceModule; import org.jclouds.lifecycle.Closer; import org.jclouds.logging.log4j.config.Log4JLoggingModule; +import org.jclouds.rest.RestContext; +import org.jclouds.rest.RestContextBuilder; +import org.jclouds.rest.internal.RestContextImpl; import org.jclouds.vcloudx.VCloudXLogin.VCloudXSession; import org.jclouds.vcloudx.config.RestVCloudXAuthenticationModule; import org.jclouds.vcloudx.endpoints.VCloudX; @@ -68,12 +68,11 @@ public class VCloudXLoginLiveTest { @SuppressWarnings( { "unused" }) @Provides @Singleton - CloudContext provideContext(Closer closer, VCloudXLogin api, - @VCloudX URI endPoint, - @Named(VCloudXConstants.PROPERTY_VCLOUDX_USER) String account) { - return new CloudContextImpl(closer, api, endPoint, account); + RestContext provideContext(Closer closer, VCloudXLogin api, + @VCloudX URI endPoint, @Named(VCloudXConstants.PROPERTY_VCLOUDX_USER) String account) { + return new RestContextImpl(closer, api, endPoint, account); } - + @Override protected void configure() { @@ -85,7 +84,7 @@ public class VCloudXLoginLiveTest { String account = checkNotNull(System.getProperty("jclouds.test.user"), "jclouds.test.user"); String key = checkNotNull(System.getProperty("jclouds.test.key"), "jclouds.test.key"); - private CloudContext context; + private RestContext context; @Test public void testLogin() throws Exception { @@ -100,7 +99,7 @@ public class VCloudXLoginLiveTest { @BeforeClass void setupFactory() { - context = new CloudContextBuilder(new TypeLiteral() { + context = new RestContextBuilder(new TypeLiteral() { }, new Properties()) { public void addContextModule(List modules) { @@ -109,7 +108,7 @@ public class VCloudXLoginLiveTest { } @Override - protected void addConnectionModule(List modules) { + protected void addClientModule(List modules) { properties.setProperty(VCloudXConstants.PROPERTY_VCLOUDX_ENDPOINT, checkNotNull( endpoint, "endpoint").toString()); properties.setProperty(PROPERTY_VCLOUDX_USER, checkNotNull(account, "user")); @@ -118,10 +117,6 @@ public class VCloudXLoginLiveTest { modules.add(new RestVCloudXAuthenticationModule()); } - @Override - public CloudContextBuilder withEndpoint(URI endpoint) { - return this; - } }.withModules(new Log4JLoggingModule(), new ExecutorServiceModule(new WithinThreadExecutorService())).buildContext(); } diff --git a/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXLoginTest.java b/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXLoginTest.java index 9f66cdc818..bd863c88a5 100755 --- a/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXLoginTest.java +++ b/vcloudx/core/src/test/java/org/jclouds/vcloudx/VCloudXLoginTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/test/java/org/jclouds/vcloudx/config/RestVCloudXAuthenticationModuleTest.java b/vcloudx/core/src/test/java/org/jclouds/vcloudx/config/RestVCloudXAuthenticationModuleTest.java index 83217f6326..0388c235a4 100644 --- a/vcloudx/core/src/test/java/org/jclouds/vcloudx/config/RestVCloudXAuthenticationModuleTest.java +++ b/vcloudx/core/src/test/java/org/jclouds/vcloudx/config/RestVCloudXAuthenticationModuleTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/test/java/org/jclouds/vcloudx/filters/SetVCloudTokenCookieTest.java b/vcloudx/core/src/test/java/org/jclouds/vcloudx/filters/SetVCloudTokenCookieTest.java index c976f62621..3a62550399 100644 --- a/vcloudx/core/src/test/java/org/jclouds/vcloudx/filters/SetVCloudTokenCookieTest.java +++ b/vcloudx/core/src/test/java/org/jclouds/vcloudx/filters/SetVCloudTokenCookieTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/test/java/org/jclouds/vcloudx/functions/ParseLoginResponseFromHeadersTest.java b/vcloudx/core/src/test/java/org/jclouds/vcloudx/functions/ParseLoginResponseFromHeadersTest.java index 94297ccb2f..cebd8eeb1e 100644 --- a/vcloudx/core/src/test/java/org/jclouds/vcloudx/functions/ParseLoginResponseFromHeadersTest.java +++ b/vcloudx/core/src/test/java/org/jclouds/vcloudx/functions/ParseLoginResponseFromHeadersTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/test/java/org/jclouds/vcloudx/xml/OrgLinksHandlerTest.java b/vcloudx/core/src/test/java/org/jclouds/vcloudx/xml/OrgLinksHandlerTest.java index b6e5101161..a4ee21a596 100644 --- a/vcloudx/core/src/test/java/org/jclouds/vcloudx/xml/OrgLinksHandlerTest.java +++ b/vcloudx/core/src/test/java/org/jclouds/vcloudx/xml/OrgLinksHandlerTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/test/java/org/jclouds/vcloudx/xml/OrgListToOrgUriHandlerTest.java b/vcloudx/core/src/test/java/org/jclouds/vcloudx/xml/OrgListToOrgUriHandlerTest.java index 28b66ec274..fca7972a15 100644 --- a/vcloudx/core/src/test/java/org/jclouds/vcloudx/xml/OrgListToOrgUriHandlerTest.java +++ b/vcloudx/core/src/test/java/org/jclouds/vcloudx/xml/OrgListToOrgUriHandlerTest.java @@ -1,6 +1,6 @@ /** * - * Copyright (C) 2009 Global Cloud Specialists, Inc. + * Copyright (C) 2009 Cloud Conscious, LLC. * * ==================================================================== * Licensed to the Apache Software Foundation (ASF) under one diff --git a/vcloudx/core/src/test/resources/log4j.xml b/vcloudx/core/src/test/resources/log4j.xml index 23deb5a816..a3bff22c6b 100755 --- a/vcloudx/core/src/test/resources/log4j.xml +++ b/vcloudx/core/src/test/resources/log4j.xml @@ -2,7 +2,7 @@