You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ab...@apache.org on 2013/05/12 16:43:02 UTC
[17/18] git commit: JCLOUDS-25. Removing sandbox-*.
JCLOUDS-25. Removing sandbox-*.
Project: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/commit/46e2f006
Tree: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/tree/46e2f006
Diff: http://git-wip-us.apache.org/repos/asf/incubator-jclouds/diff/46e2f006
Branch: refs/heads/1.5.x
Commit: 46e2f006441fcd7f9cc68b45d692fd968d72f61f
Parents: 28b0257
Author: Andrew Bayer <an...@gmail.com>
Authored: Fri May 10 17:11:16 2013 -0700
Committer: Andrew Bayer <an...@gmail.com>
Committed: Fri May 10 17:11:16 2013 -0700
----------------------------------------------------------------------
sandbox-apis/libvirt/README.txt | 92 --
sandbox-apis/libvirt/TODO | 1 -
sandbox-apis/libvirt/pom.xml | 148 ----
.../src/main/java/org/jclouds/libvirt/Image.java | 55 --
.../java/org/jclouds/libvirt/LibvirtConstants.java | 32 -
.../libvirt/compute/LibvirtComputeService.java | 121 ---
.../LibvirtComputeServiceContextBuilder.java | 49 --
.../compute/LibvirtComputeServiceContextSpec.java | 42 -
.../libvirt/compute/LibvirtPropertiesBuilder.java | 72 --
.../domain/LibvirtComputeServiceContextModule.java | 180 ----
.../compute/functions/DomainToHardware.java | 98 ---
.../compute/functions/DomainToNodeMetadata.java | 138 ---
.../compute/functions/LibvirtImageToImage.java | 61 --
.../strategy/LibvirtComputeServiceAdapter.java | 282 ------
.../LibvirtComputeServiceContextBuilderTest.java | 76 --
.../compute/LibvirtComputeServiceLiveTest.java | 73 --
.../libvirt/compute/LibvirtExperimentLiveTest.java | 95 ---
sandbox-apis/libvirt/src/test/resources/log4j.xml | 117 ---
sandbox-apis/nirvanix/README.txt | 25 -
sandbox-apis/nirvanix/pom.xml | 127 ---
.../org/jclouds/nirvanix/sdn/SDNAsyncClient.java | 112 ---
.../jclouds/nirvanix/sdn/SDNAuthAsyncClient.java | 53 --
.../java/org/jclouds/nirvanix/sdn/SDNClient.java | 67 --
.../jclouds/nirvanix/sdn/SDNContextBuilder.java | 46 -
.../jclouds/nirvanix/sdn/SDNPropertiesBuilder.java | 45 -
.../org/jclouds/nirvanix/sdn/SessionToken.java | 39 -
.../sdn/binders/BindMetadataToQueryParams.java | 58 --
.../sdn/config/SDNAuthRestClientModule.java | 97 ---
.../nirvanix/sdn/config/SDNRestClientModule.java | 50 --
.../jclouds/nirvanix/sdn/domain/UploadInfo.java | 40 -
.../sdn/filters/AddSessionTokenToRequest.java | 93 --
.../sdn/filters/InsertUserContextIntoPath.java | 71 --
.../functions/ParseMetadataFromJsonResponse.java | 67 --
.../ParseSessionTokenFromJsonResponse.java | 58 --
.../functions/ParseUploadInfoFromJsonResponse.java | 65 --
.../nirvanix/sdn/reference/SDNConstants.java | 30 -
.../nirvanix/sdn/reference/SDNQueryParams.java | 38 -
.../jclouds/nirvanix/sdn/SDNAsyncClientTest.java | 188 ----
.../nirvanix/sdn/SDNAuthAsyncClientTest.java | 75 --
.../nirvanix/sdn/SDNAuthenticationLiveTest.java | 84 --
.../jclouds/nirvanix/sdn/SDNClientLiveTest.java | 101 ---
.../sdn/binders/BindMetadataToQueryParamsTest.java | 79 --
.../sdn/filters/AddSessionTokenToRequestTest.java | 132 ---
.../sdn/filters/InsertUserContextIntoPathTest.java | 130 ---
.../ParseMetadataFromJsonResponseTest.java | 53 --
.../ParseSessionTokenFromJsonResponseTest.java | 52 --
.../ParseUploadInfoFromJsonResponseTest.java | 55 --
.../nirvanix/src/test/resources/authtoken.json | 1 -
sandbox-apis/nirvanix/src/test/resources/log4j.xml | 90 --
.../nirvanix/src/test/resources/login.json | 1 -
.../nirvanix/src/test/resources/metadata.json | 1 -
sandbox-apis/pcs/README.txt | 25 -
sandbox-apis/pcs/pom.xml | 127 ---
.../java/org/jclouds/mezeo/pcs/PCSAsyncClient.java | 179 ----
.../main/java/org/jclouds/mezeo/pcs/PCSClient.java | 70 --
.../org/jclouds/mezeo/pcs/PCSCloudAsyncClient.java | 76 --
.../org/jclouds/mezeo/pcs/PCSContextBuilder.java | 42 -
.../jclouds/mezeo/pcs/PCSPropertiesBuilder.java | 44 -
.../pcs/binders/BindContainerNameToXmlPayload.java | 39 -
.../pcs/binders/BindFileInfoToXmlPayload.java | 50 --
.../pcs/binders/BindPCSFileToMultipartForm.java | 52 --
.../pcs/blobstore/functions/BlobToFileInfo.java | 46 -
.../pcs/blobstore/functions/BlobToPCSFile.java | 49 --
.../functions/FileInfoToBlobMetadata.java | 57 --
.../pcs/blobstore/functions/PCSFileToBlob.java | 50 --
.../jclouds/mezeo/pcs/config/PCSObjectModule.java | 64 --
.../mezeo/pcs/config/PCSRestClientModule.java | 139 ---
.../jclouds/mezeo/pcs/domain/ContainerInfo.java | 37 -
.../jclouds/mezeo/pcs/domain/ContainerList.java | 37 -
.../org/jclouds/mezeo/pcs/domain/FileInfo.java | 44 -
.../mezeo/pcs/domain/FileInfoWithMetadata.java | 36 -
.../jclouds/mezeo/pcs/domain/MutableFileInfo.java | 44 -
.../mezeo/pcs/domain/MutableResourceInfo.java | 64 --
.../java/org/jclouds/mezeo/pcs/domain/PCSFile.java | 44 -
.../org/jclouds/mezeo/pcs/domain/ResourceInfo.java | 64 --
.../pcs/domain/internal/ContainerInfoImpl.java | 72 --
.../pcs/domain/internal/ContainerListImpl.java | 117 ---
.../mezeo/pcs/domain/internal/FileInfoImpl.java | 120 ---
.../domain/internal/FileInfoWithMetadataImpl.java | 72 --
.../pcs/domain/internal/MutableFileInfoImpl.java | 135 ---
.../domain/internal/MutableResourceInfoImpl.java | 271 ------
.../mezeo/pcs/domain/internal/PCSFileImpl.java | 78 --
.../pcs/domain/internal/ResourceInfoImpl.java | 224 -----
.../org/jclouds/mezeo/pcs/endpoints/Contacts.java | 39 -
.../mezeo/pcs/endpoints/Metacontainers.java | 40 -
.../org/jclouds/mezeo/pcs/endpoints/Projects.java | 39 -
.../jclouds/mezeo/pcs/endpoints/Recyclebin.java | 39 -
.../jclouds/mezeo/pcs/endpoints/RootContainer.java | 39 -
.../org/jclouds/mezeo/pcs/endpoints/Shares.java | 39 -
.../java/org/jclouds/mezeo/pcs/endpoints/Tags.java | 39 -
.../org/jclouds/mezeo/pcs/endpoints/WebDAV.java | 39 -
.../pcs/functions/AddMetadataItemIntoMap.java | 74 --
.../functions/ReturnFalseIfContainerNotFound.java | 43 -
.../ReturnTrueIfContainerAlreadyExists.java | 45 -
.../pcs/handlers/PCSClientErrorRetryHandler.java | 54 --
.../jclouds/mezeo/pcs/options/PutBlockOptions.java | 85 --
.../jclouds/mezeo/pcs/xml/CloudXlinkHandler.java | 120 ---
.../jclouds/mezeo/pcs/xml/ContainerHandler.java | 277 ------
.../org/jclouds/mezeo/pcs/xml/FileHandler.java | 182 ----
.../org/jclouds/mezeo/pcs/PCSAsyncClientTest.java | 298 -------
.../org/jclouds/mezeo/pcs/PCSClientLiveTest.java | 278 ------
.../jclouds/mezeo/pcs/PCSCloudAsyncClientTest.java | 86 --
.../binders/BindContainerNameToXmlPayloadTest.java | 48 --
.../pcs/binders/BindFileInfoToXmlPayloadTest.java | 76 --
.../pcs/functions/AddMetadataAndReturnIdTest.java | 132 ---
.../AssembleBlobFromBlobMetadataCallTest.java | 48 --
.../mezeo/pcs/internal/StubPCSAsyncClient.java | 96 ---
.../mezeo/pcs/options/PutBlockOptionsTest.java | 88 --
.../mezeo/pcs/xml/CloudXlinkHanderTest.java | 65 --
.../mezeo/pcs/xml/ContainerHandlerTest.java | 164 ----
.../mezeo/pcs/xml/FileMetadataHandlerTest.java | 96 ---
sandbox-apis/pcs/src/test/resources/discovery.xml | 11 -
sandbox-apis/pcs/src/test/resources/log4j.xml | 90 --
.../pcs/src/test/resources/test_file_metadata.xml | 22 -
.../pcs/src/test/resources/test_root_container.xml | 117 ---
sandbox-apis/scality-rs2/README.txt | 27 -
sandbox-apis/scality-rs2/pom.xml | 126 ---
.../jclouds/scality/rs2/ScalityRS2AsyncClient.java | 39 -
.../scality/rs2/ScalityRS2ContextBuilder.java | 50 --
.../scality/rs2/ScalityRS2PropertiesBuilder.java | 44 -
.../config/ScalityRS2BlobStoreContextModule.java | 29 -
.../rs2/config/ScalityRS2RestClientModule.java | 50 --
.../rs2/ScalityRS2AsyncClientTestDisabled.java | 47 -
.../scality/rs2/ScalityRS2ClientLiveTest.java | 46 -
.../ScalityRS2BlobIntegrationLiveTest.java | 55 --
.../rs2/blobstore/ScalityRS2BlobLiveTest.java | 37 -
.../ScalityRS2BlobMapIntegrationLiveTest.java | 30 -
.../blobstore/ScalityRS2BlobSignerLiveTest.java | 31 -
.../ScalityRS2ContainerIntegrationLiveTest.java | 39 -
.../rs2/blobstore/ScalityRS2ContainerLiveTest.java | 30 -
...calityRS2InputStreamMapIntegrationLiveTest.java | 30 -
.../ScalityRS2ServiceIntegrationLiveTest.java | 30 -
.../rs2/blobstore/ScalityRS2TestInitializer.java | 35 -
sandbox-apis/simpledb/pom.xml | 101 ---
.../org/jclouds/simpledb/SimpleDBAsyncClient.java | 113 ---
.../java/org/jclouds/simpledb/SimpleDBClient.java | 110 ---
.../jclouds/simpledb/SimpleDBContextBuilder.java | 56 --
.../simpledb/SimpleDBPropertiesBuilder.java | 55 --
.../binders/BindAttributesToIndexedFormParams.java | 78 --
.../simpledb/config/SimpleDBRestClientModule.java | 41 -
.../org/jclouds/simpledb/domain/AttributePair.java | 78 --
.../jclouds/simpledb/domain/DomainMetadata.java | 190 -----
.../java/org/jclouds/simpledb/domain/Item.java | 63 --
.../simpledb/domain/ListDomainsResponse.java | 37 -
.../simpledb/options/ListDomainsOptions.java | 101 ---
.../java/org/jclouds/simpledb/package-info.java | 25 -
.../simpledb/reference/SimpleDBParameters.java | 74 --
.../jclouds/simpledb/reference/package-info.java | 23 -
.../org/jclouds/simpledb/xml/ItemsHandler.java | 109 ---
.../simpledb/xml/ListDomainsResponseHandler.java | 83 --
.../jclouds/simpledb/SimpleDBAsyncClientTest.java | 139 ---
.../jclouds/simpledb/SimpleDBClientLiveTest.java | 172 ----
.../simpledb/options/ListDomainsOptionsTest.java | 89 --
.../xml/ListDomainsResponseHandlerTest.java | 51 --
.../simpledb/src/test/resources/list_domains.xml | 11 -
sandbox-apis/simpledb/src/test/resources/log4j.xml | 89 --
sandbox-drivers/asynchttpclient/pom.xml | 76 --
.../http/ning/NingHttpCommandExecutorService.java | 201 -----
.../NingHttpCommandExecutorServiceModule.java | 67 --
.../ning/NingHttpCommandExecutorServiceTest.java | 59 --
.../asynchttpclient/src/test/resources/test.jks | Bin 1365 -> 0 bytes
sandbox-providers/aws-simpledb/pom.xml | 115 ---
.../aws/simpledb/AWSSimpleDBPropertiesBuilder.java | 74 --
.../aws/simpledb/AWSSimpleDBProviderMetadata.java | 115 ---
.../org.jclouds.providers.ProviderMetadata | 1 -
.../aws/simpledb/AWSSimpleDBAsyncClientTest.java | 61 --
.../aws/simpledb/AWSSimpleDBClientLiveTest.java | 50 --
.../aws/simpledb/AWSSimpleDBProviderTest.java | 36 -
sandbox-providers/azurequeue/pom.xml | 107 ---
.../jclouds/azurequeue/AzureQueueAsyncClient.java | 123 ---
.../org/jclouds/azurequeue/AzureQueueClient.java | 142 ----
.../azurequeue/AzureQueueProviderMetadata.java | 116 ---
.../azurequeue/binders/BindToXmlStringPayload.java | 38 -
.../jclouds/azurequeue/domain/QueueMessage.java | 162 ----
.../jclouds/azurequeue/domain/QueueMetadata.java | 84 --
.../org/jclouds/azurequeue/options/GetOptions.java | 87 --
.../azurequeue/options/PutMessageOptions.java | 63 --
.../xml/AccountNameEnumerationResultsHandler.java | 90 --
.../azurequeue/xml/QueueMessagesListHandler.java | 104 ---
.../org.jclouds.providers.ProviderMetadata | 1 -
.../azurequeue/AzureQueueAsyncClientTest.java | 240 ------
.../azurequeue/AzureQueueClientLiveTest.java | 162 ----
.../jclouds/azurequeue/AzureQueueProviderTest.java | 35 -
.../jclouds/azurequeue/options/GetOptionsTest.java | 75 --
.../AccountNameEnumerationResultsHandlerTest.java | 67 --
.../xml/QueueMessagesListHandlerTest.java | 69 --
.../azurequeue/src/test/resources/log4j.xml | 88 --
.../src/test/resources/test_get_messages.xml | 21 -
.../src/test/resources/test_list_queues.xml | 20 -
.../test/resources/test_list_queues_options.xml | 17 -
sandbox-providers/boxdotnet/pom.xml | 118 ---
.../jclouds/boxdotnet/BoxDotNetAsyncClient.java | 70 --
.../org/jclouds/boxdotnet/BoxDotNetClient.java | 50 --
.../jclouds/boxdotnet/BoxDotNetContextBuilder.java | 44 -
.../boxdotnet/BoxDotNetPropertiesBuilder.java | 44 -
.../config/BoxDotNetRestClientModule.java | 60 --
.../boxdotnet/handlers/BoxDotNetErrorHandler.java | 90 --
.../boxdotnet/BoxDotNetAsyncClientTest.java | 128 ---
.../jclouds/boxdotnet/BoxDotNetClientLiveTest.java | 83 --
.../boxdotnet/src/test/resources/log4j.xml | 90 --
sandbox-providers/dunkel-vcd/pom.xml | 126 ---
.../vcd/DunkelVCloudDirectorContextBuilder.java | 45 -
.../vcd/DunkelVCloudDirectorPropertiesBuilder.java | 40 -
.../vcd/DunkelVCloudDirectorProviderMetadata.java | 109 ---
...lVCloudDirectorComputeServiceContextModule.java | 38 -
.../DunkelVCloudDirectorRestClientModule.java | 29 -
.../org.jclouds.providers.ProviderMetadata | 1 -
.../vcd/DunkelVCloudDirectorProviderTest.java | 33 -
...DunkelVCloudDirectorComputeServiceLiveTest.java | 33 -
...unkelVCloudDirectorTemplateBuilderLiveTest.java | 63 --
.../dunkel-vcd/src/test/resources/log4j.xml | 151 ----
sandbox-providers/googlestorage/README.txt | 27 -
sandbox-providers/googlestorage/pom.xml | 125 ---
.../googlestorage/GoogleStorageAsyncClient.java | 68 --
.../googlestorage/GoogleStorageContextBuilder.java | 44 -
.../GoogleStoragePropertiesBuilder.java | 50 --
.../GoogleStorageProviderMetadata.java | 108 ---
.../BindGoogleStorageObjectMetadataToRequest.java | 70 --
.../config/GoogleStorageRestClientModule.java | 58 --
.../org.jclouds.providers.ProviderMetadata | 1 -
.../GoogleStorageAsyncClientTestDisabled.java | 46 -
.../googlestorage/GoogleStorageClientLiveTest.java | 32 -
.../googlestorage/GoogleStorageProviderTest.java | 37 -
...ndGoogleStorageObjectMetadataToRequestTest.java | 145 ----
.../GoogleStorageBlobIntegrationLiveTest.java | 45 -
.../blobstore/GoogleStorageBlobLiveTest.java | 30 -
.../GoogleStorageBlobMapIntegrationLiveTest.java | 30 -
.../blobstore/GoogleStorageBlobSignerLiveTest.java | 31 -
.../GoogleStorageContainerIntegrationLiveTest.java | 30 -
.../blobstore/GoogleStorageContainerLiveTest.java | 30 -
...leStorageInputStreamMapIntegrationLiveTest.java | 30 -
.../GoogleStorageServiceIntegrationLiveTest.java | 38 -
.../blobstore/GoogleStorageTestInitializer.java | 33 -
sandbox-providers/hosteurope-storage/pom.xml | 133 ---
.../HostEuropeStoragePropertiesBuilder.java | 46 -
.../storage/HostEuropeStorageClientLiveTest.java | 32 -
.../HostEuropeStorageBlobIntegrationLiveTest.java | 32 -
.../blobstore/HostEuropeStorageBlobLiveTest.java | 30 -
...ostEuropeStorageBlobMapIntegrationLiveTest.java | 30 -
.../HostEuropeStorageBlobSignerLiveTest.java | 31 -
...tEuropeStorageContainerIntegrationLiveTest.java | 30 -
.../HostEuropeStorageContainerLiveTest.java | 30 -
...peStorageInputStreamMapIntegrationLiveTest.java | 30 -
...ostEuropeStorageServiceIntegrationLiveTest.java | 37 -
.../HostEuropeStorageTestInitializer.java | 35 -
sandbox-providers/ibm-smartcloud/pom.xml | 133 ---
.../ibm/smartcloud/IBMSmartCloudAsyncClient.java | 358 --------
.../ibm/smartcloud/IBMSmartCloudClient.java | 468 ----------
.../smartcloud/IBMSmartCloudContextBuilder.java | 49 --
.../smartcloud/IBMSmartCloudPropertiesBuilder.java | 62 --
.../IBMSmartCloudBindComputeStrategiesByClass.java | 75 --
.../IBMSmartCloudBindComputeSuppliersByClass.java | 50 --
.../IBMSmartCloudComputeServiceContextModule.java | 50 --
...SmartCloudComputeServiceDependenciesModule.java | 114 ---
.../compute/functions/InstanceToNodeMetadata.java | 112 ---
.../options/IBMSmartCloudTemplateOptions.java | 366 --------
...eNodesWithGroupEncodedIntoNameThenAddToSet.java | 114 ---
...artCloudCreateNodeWithGroupEncodedIntoName.java | 62 --
.../strategy/IBMSmartCloudDestroyNodeStrategy.java | 74 --
.../IBMSmartCloudGetNodeMetadataStrategy.java | 53 --
.../strategy/IBMSmartCloudLifeCycleStrategy.java | 63 --
.../strategy/IBMSmartCloudListNodesStrategy.java | 59 --
.../suppliers/IBMSmartCloudHardwareSupplier.java | 87 --
.../suppliers/IBMSmartCloudImageSupplier.java | 100 ---
.../suppliers/IBMSmartCloudLocationSupplier.java | 80 --
.../config/IBMSmartCloudParserModule.java | 66 --
.../config/IBMSmartCloudRestClientModule.java | 61 --
.../org/jclouds/ibm/smartcloud/domain/Address.java | 149 ----
.../java/org/jclouds/ibm/smartcloud/domain/IP.java | 127 ---
.../org/jclouds/ibm/smartcloud/domain/Image.java | 221 -----
.../jclouds/ibm/smartcloud/domain/Instance.java | 449 ----------
.../ibm/smartcloud/domain/InstanceType.java | 103 ---
.../org/jclouds/ibm/smartcloud/domain/Key.java | 151 ----
.../jclouds/ibm/smartcloud/domain/Location.java | 174 ----
.../jclouds/ibm/smartcloud/domain/Offering.java | 93 --
.../org/jclouds/ibm/smartcloud/domain/Price.java | 132 ---
.../ibm/smartcloud/domain/StorageOffering.java | 125 ---
.../org/jclouds/ibm/smartcloud/domain/Vlan.java | 125 ---
.../org/jclouds/ibm/smartcloud/domain/Volume.java | 250 ------
.../smartcloud/functions/ParseLongFromDate.java | 39 -
.../handlers/IBMSmartCloudErrorHandler.java | 91 --
.../smartcloud/options/CreateInstanceOptions.java | 207 -----
.../smartcloud/options/RestartInstanceOptions.java | 55 --
.../ibm/smartcloud/predicates/AddressFree.java | 71 --
.../ibm/smartcloud/predicates/InstanceActive.java | 63 --
.../predicates/InstanceActiveOrFailed.java | 58 --
.../predicates/InstanceRemovedOrNotFound.java | 59 --
.../ibm/smartcloud/predicates/VolumeUnmounted.java | 58 --
.../ibm/smartcloud/reference/Capabilities.java | 33 -
.../ibm/smartcloud/xml/LocationHandler.java | 98 ---
.../ibm/smartcloud/xml/LocationsHandler.java | 69 --
.../BaseIBMSmartCloudClientLiveTest.java | 91 --
.../smartcloud/IBMSmartCloudAsyncClientTest.java | 658 ---------------
.../smartcloud/IBMSmartCloudClientLiveTest.java | 515 -----------
.../ReadOnlyIBMSmartCloudClientLiveTest.java | 125 ---
.../IBMSmartCloudComputeServiceLiveTest.java | 44 -
.../IBMSmartCloudTemplateBuilderLiveTest.java | 83 --
.../parse/ExtendReservationForInstanceTest.java | 55 --
.../ibm/smartcloud/parse/GetAddressTest.java | 41 -
.../jclouds/ibm/smartcloud/parse/GetImageTest.java | 76 --
.../ibm/smartcloud/parse/GetInstanceTest.java | 61 --
.../jclouds/ibm/smartcloud/parse/GetKeyTest.java | 54 --
.../ibm/smartcloud/parse/GetVolumeTest.java | 50 --
.../ibm/smartcloud/parse/ListAddressesTest.java | 48 --
.../ibm/smartcloud/parse/ListImagesTest.java | 80 --
.../ibm/smartcloud/parse/ListInstancesTest.java | 66 --
.../jclouds/ibm/smartcloud/parse/ListKeysTest.java | 58 --
.../smartcloud/parse/ListStorageOfferingsTest.java | 66 --
.../ibm/smartcloud/parse/ListVolumesTest.java | 57 --
.../ibm/smartcloud/parse/NewInstanceTest.java | 62 --
.../ibm/smartcloud/xml/LocationHandlerTest.java | 53 --
.../ibm/smartcloud/xml/LocationsHandlerTest.java | 90 --
.../ibm-smartcloud/src/test/resources/address.json | 7 -
.../src/test/resources/addresses.json | 16 -
.../ibm-smartcloud/src/test/resources/image.json | 51 --
.../ibm-smartcloud/src/test/resources/images.json | 55 --
.../src/test/resources/instance.json | 29 -
.../src/test/resources/instances.json | 31 -
.../ibm-smartcloud/src/test/resources/key.json | 7 -
.../ibm-smartcloud/src/test/resources/keys.json | 18 -
.../ibm-smartcloud/src/test/resources/location.xml | 24 -
.../src/test/resources/locations.xml | 124 ---
.../ibm-smartcloud/src/test/resources/log4j.xml | 151 ----
.../src/test/resources/new_instance.json | 24 -
.../src/test/resources/storage-offerings.json | 56 --
.../ibm-smartcloud/src/test/resources/volume.json | 12 -
.../ibm-smartcloud/src/test/resources/volumes.json | 26 -
sandbox-providers/scaleup-storage/README.txt | 27 -
sandbox-providers/scaleup-storage/pom.xml | 133 ---
.../storage/ScaleUpStoragePropertiesBuilder.java | 46 -
.../storage/ScaleUpStorageClientLiveTest.java | 32 -
.../ScaleUpStorageBlobIntegrationLiveTest.java | 32 -
.../blobstore/ScaleUpStorageBlobLiveTest.java | 30 -
.../ScaleUpStorageBlobMapIntegrationLiveTest.java | 30 -
.../ScaleUpStorageBlobSignerLiveTest.java | 31 -
...ScaleUpStorageContainerIntegrationLiveTest.java | 30 -
.../blobstore/ScaleUpStorageContainerLiveTest.java | 30 -
...UpStorageInputStreamMapIntegrationLiveTest.java | 30 -
.../ScaleUpStorageServiceIntegrationLiveTest.java | 37 -
.../blobstore/ScaleUpStorageTestInitializer.java | 35 -
sandbox-providers/tiscali-storage/pom.xml | 133 ---
.../storage/TiscaliStoragePropertiesBuilder.java | 46 -
.../storage/TiscaliStorageClientLiveTest.java | 34 -
.../TiscaliStorageBlobIntegrationLiveTest.java | 32 -
.../blobstore/TiscaliStorageBlobLiveTest.java | 32 -
.../TiscaliStorageBlobMapIntegrationLiveTest.java | 32 -
.../TiscaliStorageBlobSignerLiveTest.java | 33 -
...TiscaliStorageContainerIntegrationLiveTest.java | 32 -
.../blobstore/TiscaliStorageContainerLiveTest.java | 32 -
...liStorageInputStreamMapIntegrationLiveTest.java | 32 -
.../TiscaliStorageServiceIntegrationLiveTest.java | 41 -
.../blobstore/TiscaliStorageTestInitializer.java | 35 -
sandbox-providers/twitter/.gitignore | 9 -
sandbox-providers/twitter/README.txt | 25 -
sandbox-providers/twitter/pom.xml | 118 ---
.../src/main/java/org/jclouds/twitter/Twitter.java | 39 -
.../org/jclouds/twitter/TwitterAsyncClient.java | 53 --
.../java/org/jclouds/twitter/TwitterClient.java | 40 -
.../org/jclouds/twitter/TwitterContextBuilder.java | 44 -
.../jclouds/twitter/TwitterPropertiesBuilder.java | 46 -
.../twitter/config/TwitterRestClientModule.java | 60 --
.../java/org/jclouds/twitter/domain/Status.java | 197 -----
.../main/java/org/jclouds/twitter/domain/User.java | 363 --------
.../jclouds/twitter/TwitterAsyncClientTest.java | 111 ---
.../org/jclouds/twitter/TwitterClientLiveTest.java | 106 ---
.../twitter/src/test/resources/log4j.xml | 90 --
.../twitter/src/test/resources/test_mentions.json | 77 --
.../virtacore-publiccloud-lax/pom.xml | 125 ---
.../VirtacorePublicCloudLAXContextBuilder.java | 51 --
.../VirtacorePublicCloudLAXPropertiesBuilder.java | 50 --
.../VirtacorePublicCloudLAXProviderMetadata.java | 116 ---
...ePublicCloudLAXComputeServiceContextModule.java | 47 -
.../VirtacorePublicCloudLAXRestClientModule.java | 38 -
.../org.jclouds.providers.ProviderMetadata | 1 -
.../VirtacorePublicCloudLAXProviderTest.java | 36 -
...tacorePublicCloudLAXComputeServiceLiveTest.java | 35 -
...acorePublicCloudLAXTemplateBuilderLiveTest.java | 83 --
.../src/test/resources/log4j.xml | 151 ----
378 files changed, 0 insertions(+), 29777 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/README.txt
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/README.txt b/sandbox-apis/libvirt/README.txt
deleted file mode 100644
index 10453e5..0000000
--- a/sandbox-apis/libvirt/README.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-====
- Licensed to jclouds, Inc. (jclouds) under one or more
- contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. jclouds 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.
-====
-
-The libvirt library is used to interface with different virtualization technologies (http://libvirt.org/)
-
-libvirt supports:
-The Xen hypervisor on Linux and Solaris hosts.
-The QEMU emulator
-The KVM Linux hypervisor
-The LXC Linux container system
-The OpenVZ Linux container system
-The User Mode Linux paravirtualized kernel
-The VirtualBox hypervisor
-The VMware ESX and GSX hypervisors
-Storage on IDE/SCSI/USB disks, FibreChannel, LVM, iSCSI, NFS and filesystems
-
-Getting Started Guide for jclouds-libvirt
-
-install libvirt on your os
- * if os/x, see http://github.com/justinclift/libvirt
- * if you are using Linux, let's suppose you want to use KVM:
-- install libvirt and KVM (http://www.linux-kvm.org/page/Main_Page).
-
-Remember to run
- egrep '(vmx|svm)' /proc/cpuinfo
- If nothing is printed, it means that your cpu does not support hardware virtualization.
-
-Verify Installation
-$ virsh -c qemu:///system list
- Id Name State
-----------------------------------
-
-(for Ubuntu users: look also at this good turorial https://help.ubuntu.com/community/KVM)
-
-Create your first guest
-- download, for example, an ubuntu 10.04 LTS ISO
-- create a libvirt domain by using:
- virt-manager: a GUI tool at http://virt-manager.et.redhat.com/
- virt-install, a python script developed by Red Hat (sudo apt-get install python-virtinst)
- ubuntu-vm-builder, developed by Canonical. (sudo apt-get install ubuntu-vm-builder)
- NB: use Javascript tool that generates the parameters for ubuntu-vm-builder: http://people.ubuntu.com/~kirkland/ubuntu-vm-builder.html
-
-Now that you have a libvirt domain, your workstation is ready to use jclouds-libvirt.
-You can now download jclouds-libvirt and give a try by running
-
-ComputeServiceContext context = null;
- try {
- context = new ComputeServiceContextFactory()
- .createContext(new StandaloneComputeServiceContextSpec<Domain, Domain, Image, Datacenter>("libvirt",
- endpoint, apiversion, identity, credential, new LibvirtComputeServiceContextModule(), ImmutableSet
- .<Module> of()));
-
- Template defaultTemplate = context.getComputeService().templateBuilder()
- .hardwareId("c7ff2039-a9f1-a659-7f91-e0f82f59d52e").imageId("1").build();
-
-
- context.getComputeService().runNodesWithTag(domainName, 1, defaultTemplate);
-
- } catch (RunNodesException e) {
- e.printStackTrace();
- } finally {
- if (context != null)
- context.close();
- }
-
-where identity=your_name, endpoint=qemu:///system
- and domainName equals to the name chosen during the creation of libvirt domain
-
-NB: apiversion, credential can be null
-
-
-
-
-
-
-
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/TODO
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/TODO b/sandbox-apis/libvirt/TODO
deleted file mode 100644
index 81960b3..0000000
--- a/sandbox-apis/libvirt/TODO
+++ /dev/null
@@ -1 +0,0 @@
-runNodesWithTag: when ask for more than 1 node, cloning step fails cause of concurrent access to the originale virtual disk to be cloned.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/pom.xml b/sandbox-apis/libvirt/pom.xml
deleted file mode 100644
index c0dc683..0000000
--- a/sandbox-apis/libvirt/pom.xml
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to jclouds, Inc. (jclouds) under one or more
- contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. jclouds 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.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-project</artifactId>
- <version>1.5.0-SNAPSHOT</version>
- <relativePath>../../project/pom.xml</relativePath>
- </parent>
- <groupId>org.jclouds.api</groupId>
- <artifactId>libvirt</artifactId>
- <name>jclouds example components for a libvirt provider</name>
- <packaging>bundle</packaging>
-
- <properties>
- <!-- when instances are hung, open a ticket and add here -->
- <jclouds.compute.blacklist.nodes>trmkrun-ccc,test.trmk-924</jclouds.compute.blacklist.nodes>
- <test.libvirt.endpoint>test:///default</test.libvirt.endpoint>
- <test.libvirt.api-version>1.0</test.libvirt.api-version>
- <test.libvirt.build-version></test.libvirt.build-version>
- <test.libvirt.identity>FIXME</test.libvirt.identity>
- <test.libvirt.credential>FIXME</test.libvirt.credential>
- <test.libvirt.image-id></test.libvirt.image-id>
-
- <jclouds.osgi.export>org.jclouds.libvirt*;version="${project.version}"</jclouds.osgi.export>
- <jclouds.osgi.import>org.jclouds*;version="${project.version}",*</jclouds.osgi.import>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.libvirt</groupId>
- <artifactId>libvirt</artifactId>
- <version>0.4.6</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
-
- <dependency>
- <groupId>com.sun.jna</groupId>
- <artifactId>jna</artifactId>
- <version>3.0.9</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>com.jamesmurty.utils</groupId>
- <artifactId>java-xmlbuilder</artifactId>
- <version>0.3</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-core</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.jclouds</groupId>
- <artifactId>jclouds-compute</artifactId>
- <version>${project.version}</version>
- <type>test-jar</type>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.16</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-log4j</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.jclouds.driver</groupId>
- <artifactId>jclouds-jsch</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.jcraft</groupId>
- <artifactId>jsch</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <profiles>
- <profile>
- <id>live</id>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>integration</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
- <test.libvirt.endpoint>${test.libvirt.endpoint}</test.libvirt.endpoint>
- <test.libvirt.api-version>${test.libvirt.api-version}</test.libvirt.api-version>
- <test.libvirt.build-version>${test.libvirt.build-version}</test.libvirt.build-version>
- <test.libvirt.identity>${test.libvirt.identity}</test.libvirt.identity>
- <test.libvirt.credential>${test.libvirt.credential}</test.libvirt.credential>
- <test.libvirt.image-id>${test.libvirt.image-id}</test.libvirt.image-id>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-
-</project>
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/Image.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/Image.java b/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/Image.java
deleted file mode 100644
index 2536924..0000000
--- a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/Image.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds 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.libvirt;
-
-import com.google.common.base.Objects;
-
-/**
- * This would be replaced with the real java object related to the underlying image
- *
- * @author Adrian Cole
- */
-public class Image {
-
- public int id;
- public String name;
-
- public Image(int id, String name) {
- this.id = id;
- this.name = name;
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(id, name);
- }
-
- @Override
- public boolean equals(Object that) {
- if (that == null)
- return false;
- return Objects.equal(this.toString(), that.toString());
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper(this).add("id", id).add("name", name).toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/LibvirtConstants.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/LibvirtConstants.java b/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/LibvirtConstants.java
deleted file mode 100644
index b211b4d..0000000
--- a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/LibvirtConstants.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds 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.libvirt;
-
-/**
- * Configuration properties and constants used in libvirt local connections.
- *
- * @author Adrian Cole
- */
-public interface LibvirtConstants {
- public static final String PROPERTY_LIBVIRT_DOMAIN_DIR = "jclouds.libvirt.domain.dir";
-}
-
-
-//public static final String PROPERTY_AUTH_TAG = "jclouds.aws.auth.tag";
-//public static final String PROPERTY_HEADER_TAG = "jclouds.aws.header.tag";
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeService.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeService.java b/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeService.java
deleted file mode 100644
index 5feec7c..0000000
--- a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeService.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds 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.libvirt.compute;
-
-import java.io.StringReader;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ExecutorService;
-
-import javax.inject.Inject;
-import javax.inject.Named;
-import javax.inject.Provider;
-import javax.inject.Singleton;
-
-import org.jclouds.Constants;
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.ComputeServiceContext;
-import org.jclouds.compute.ImageExtension;
-import org.jclouds.compute.callables.RunScriptOnNode;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.TemplateBuilder;
-import org.jclouds.compute.internal.BaseComputeService;
-import org.jclouds.compute.internal.PersistNodeCredentials;
-import org.jclouds.compute.options.TemplateOptions;
-import org.jclouds.compute.reference.ComputeServiceConstants.Timeouts;
-import org.jclouds.compute.strategy.CreateNodesInGroupThenAddToSet;
-import org.jclouds.compute.strategy.DestroyNodeStrategy;
-import org.jclouds.compute.strategy.GetNodeMetadataStrategy;
-import org.jclouds.compute.strategy.InitializeRunScriptOnNodeOrPlaceInBadMap;
-import org.jclouds.compute.strategy.ListNodesStrategy;
-import org.jclouds.compute.strategy.RebootNodeStrategy;
-import org.jclouds.compute.strategy.ResumeNodeStrategy;
-import org.jclouds.compute.strategy.SuspendNodeStrategy;
-import org.jclouds.domain.Credentials;
-import org.jclouds.domain.Location;
-import org.jclouds.scriptbuilder.functions.InitAdminAccess;
-import org.libvirt.Connect;
-import org.libvirt.StorageVol;
-import org.xml.sax.InputSource;
-
-import com.google.common.base.Optional;
-import com.google.common.base.Predicate;
-import com.google.common.base.Supplier;
-import com.google.common.base.Throwables;
-import com.jamesmurty.utils.XMLBuilder;
-
-/**
- *
- * @author andrea turli
- *
- */
-@Singleton
-public class LibvirtComputeService extends BaseComputeService {
-
- private final Connect client;
-
- @Inject
- protected LibvirtComputeService(ComputeServiceContext context, Map<String, Credentials> credentialStore,
- @Memoized Supplier<Set<? extends Image>> images,
- @Memoized Supplier<Set<? extends Hardware>> hardwareProfiles,
- @Memoized Supplier<Set<? extends Location>> locations, ListNodesStrategy listNodesStrategy,
- GetNodeMetadataStrategy getNodeMetadataStrategy,
- CreateNodesInGroupThenAddToSet runNodesAndAddToSetStrategy, RebootNodeStrategy rebootNodeStrategy,
- DestroyNodeStrategy destroyNodeStrategy, ResumeNodeStrategy resumeNodeStrategy,
- SuspendNodeStrategy suspendNodeStrategy, Provider<TemplateBuilder> templateBuilderProvider,
- Provider<TemplateOptions> templateOptionsProvider,
- @Named("NODE_RUNNING") Predicate<NodeMetadata> nodeRunning,
- @Named("NODE_TERMINATED") Predicate<NodeMetadata> nodeTerminated,
- @Named("NODE_SUSPENDED") Predicate<NodeMetadata> nodeSuspended,
- InitializeRunScriptOnNodeOrPlaceInBadMap.Factory initScriptRunnerFactory, InitAdminAccess initAdminAccess,
- RunScriptOnNode.Factory runScriptOnNodeFactory, PersistNodeCredentials persistNodeCredentials,
- Timeouts timeouts, @Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor, Connect client,
- Optional<ImageExtension> imageExtension) {
- super(context, credentialStore, images, hardwareProfiles, locations, listNodesStrategy, getNodeMetadataStrategy,
- runNodesAndAddToSetStrategy, rebootNodeStrategy, destroyNodeStrategy, resumeNodeStrategy,
- suspendNodeStrategy, templateBuilderProvider, templateOptionsProvider, nodeRunning, nodeTerminated,
- nodeSuspended, initScriptRunnerFactory, initAdminAccess, runScriptOnNodeFactory, persistNodeCredentials,
- timeouts, executor, imageExtension);
- this.client = client;
- }
-
- @Override
- protected void cleanUpIncidentalResourcesOfDeadNodes(Set<? extends NodeMetadata> deadNodes) {
- // TODO Was previously commented out in overridden destroyNode; refactored to here but left commented out
-// for (NodeMetadata deadNode : deadNodes) {
-// eliminateDomain(deadNode.getId());
-// }
- }
-
- private void eliminateDomain(String id) {
- try {
- XMLBuilder builder = XMLBuilder.parse(new InputSource(new StringReader(client.domainLookupByUUIDString(id)
- .getXMLDesc(0))));
- String diskFileName = builder.xpathFind("//devices/disk[@device='disk']/source").getElement().getAttribute(
- "file");
- StorageVol storageVol = client.storageVolLookupByPath(diskFileName);
- storageVol.delete(0);
- client.domainLookupByUUIDString(id).undefine();
- } catch (Exception e) {
- Throwables.propagate(e);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeServiceContextBuilder.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeServiceContextBuilder.java b/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeServiceContextBuilder.java
deleted file mode 100644
index dd9e1de..0000000
--- a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeServiceContextBuilder.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds 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.libvirt.compute;
-
-import static org.jclouds.libvirt.LibvirtConstants.PROPERTY_LIBVIRT_DOMAIN_DIR;
-
-import java.util.List;
-import java.util.Properties;
-
-import org.jclouds.compute.StandaloneComputeServiceContextBuilder;
-import org.jclouds.libvirt.compute.domain.LibvirtComputeServiceContextModule;
-import org.libvirt.Connect;
-
-import com.google.inject.Module;
-
-/**
- *
- * @author Adrian Cole
- */
-public class LibvirtComputeServiceContextBuilder extends StandaloneComputeServiceContextBuilder<Connect> {
-
- public LibvirtComputeServiceContextBuilder(Properties props) {
- super(Connect.class, props);
-
- if (!properties.containsKey(PROPERTY_LIBVIRT_DOMAIN_DIR))
- properties.setProperty(PROPERTY_LIBVIRT_DOMAIN_DIR, "/etc/libvirt/qemu");
- }
-
- @Override
- protected void addContextModule(List<Module> modules) {
- modules.add(new LibvirtComputeServiceContextModule());
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeServiceContextSpec.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeServiceContextSpec.java b/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeServiceContextSpec.java
deleted file mode 100644
index 917007a..0000000
--- a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtComputeServiceContextSpec.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds 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.libvirt.compute;
-
-import org.jclouds.PropertiesBuilder;
-import org.jclouds.compute.ComputeService;
-import org.jclouds.rest.RestContextSpec;
-
-import com.google.common.collect.ImmutableSet;
-import com.google.inject.Module;
-
-/**
- * @author Adrian Cole
- */
-public class LibvirtComputeServiceContextSpec extends RestContextSpec<ComputeService, ComputeService> {
-
- @SuppressWarnings("unchecked")
- public LibvirtComputeServiceContextSpec(String endpoint, String identity, String credential, Iterable<Module> modules) {
- super("libvirt", endpoint, "1", "", identity, credential, ComputeService.class, ComputeService.class,
- PropertiesBuilder.class, (Class) LibvirtComputeServiceContextBuilder.class, modules);
- }
-
- public LibvirtComputeServiceContextSpec(String endpoint, String identity, String credential) {
- this(endpoint, identity, credential, ImmutableSet.<Module> of());
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtPropertiesBuilder.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtPropertiesBuilder.java b/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtPropertiesBuilder.java
deleted file mode 100644
index e86ac8a..0000000
--- a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/LibvirtPropertiesBuilder.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds 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.libvirt.compute;
-
-import static org.jclouds.Constants.PROPERTY_API_VERSION;
-import static org.jclouds.Constants.PROPERTY_ENDPOINT;
-import static org.jclouds.libvirt.LibvirtConstants.PROPERTY_LIBVIRT_DOMAIN_DIR;
-import static org.jclouds.compute.reference.ComputeServiceConstants.PROPERTY_TIMEOUT_NODE_SUSPENDED;
-
-import java.util.Properties;
-
-import org.jclouds.PropertiesBuilder;
-
-/**
- * Builds properties used in Libvirt Clients
- *
- * @author Andrea Turli
- */
-public class LibvirtPropertiesBuilder extends PropertiesBuilder {
- @Override
- protected Properties defaultProperties() {
- Properties properties = super.defaultProperties();
- properties.setProperty(PROPERTY_LIBVIRT_DOMAIN_DIR, "/etc/libvirt/qemu");
-
- /*
- properties.setProperty(PROPERTY_AUTH_TAG, "AWS");
- properties.setProperty(PROPERTY_HEADER_TAG, "amz");
- properties.setProperty(PROPERTY_ENDPOINT, "https://ec2.us-east-1.amazonaws.com");
- properties.setProperty(PROPERTY_API_VERSION, EC2AsyncClient.VERSION);
- properties.setProperty(PROPERTY_ELB_ENDPOINT, "https://elasticloadbalancing.us-east-1.amazonaws.com");
- // amazon, alestic, canonical, and rightscale
- properties.setProperty(PROPERTY_EC2_AMI_OWNERS, "137112412989,063491364108,099720109477,411009282317");
- // amis that work with the cluster instances
- properties.setProperty(PROPERTY_EC2_CC_AMIs, "us-east-1/ami-7ea24a17");
- */
-
- // sometimes, like in ec2, stop takes a very long time, perhaps
- // due to volume management. one example spent 2 minutes moving
- // from stopping->stopped state on an ec2 micro
- properties.setProperty(PROPERTY_TIMEOUT_NODE_SUSPENDED, 120 * 1000 + "");
- // auth fail sometimes happens in EC2, as the rc.local script that injects the
- // authorized key executes after ssh has started
- properties.setProperty("jclouds.ssh.max_retries", "7");
- properties.setProperty("jclouds.ssh.retryable_messages",
- "Auth fail,invalid data,End of IO Stream Read,Connection reset,socket is not established");
- return properties;
- }
-
- public LibvirtPropertiesBuilder(Properties properties) {
- super(properties);
- }
-
- public LibvirtPropertiesBuilder() {
- super();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/domain/LibvirtComputeServiceContextModule.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/domain/LibvirtComputeServiceContextModule.java b/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/domain/LibvirtComputeServiceContextModule.java
deleted file mode 100644
index 7e8f177..0000000
--- a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/domain/LibvirtComputeServiceContextModule.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds 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.libvirt.compute.domain;
-
-import static com.google.common.base.Predicates.notNull;
-import static com.google.common.collect.Iterables.filter;
-import static com.google.common.collect.Iterables.transform;
-import static org.jclouds.libvirt.LibvirtConstants.PROPERTY_LIBVIRT_DOMAIN_DIR;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.net.URI;
-
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.io.filefilter.WildcardFileFilter;
-import org.jclouds.Constants;
-import org.jclouds.compute.ComputeServiceAdapter;
-import org.jclouds.compute.config.ComputeServiceAdapterContextModule;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.TemplateBuilder;
-import org.jclouds.domain.Location;
-import org.jclouds.functions.IdentityFunction;
-import org.jclouds.http.functions.ParseSax;
-import org.jclouds.libvirt.Image;
-import org.jclouds.libvirt.compute.functions.DomainToHardware;
-import org.jclouds.libvirt.compute.functions.DomainToNodeMetadata;
-import org.jclouds.libvirt.compute.functions.LibvirtImageToImage;
-import org.jclouds.libvirt.compute.strategy.LibvirtComputeServiceAdapter;
-import org.jclouds.location.Provider;
-import org.jclouds.location.suppliers.OnlyLocationOrFirstZone;
-import org.libvirt.Connect;
-import org.libvirt.Domain;
-import org.libvirt.LibvirtException;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-import com.google.common.collect.Iterables;
-import com.google.inject.Injector;
-import com.google.inject.Key;
-import com.google.inject.Provides;
-import com.google.inject.TypeLiteral;
-import com.google.inject.name.Names;
-
-/**
- *
- * @author Adrian Cole
- */
-public class LibvirtComputeServiceContextModule extends
- ComputeServiceAdapterContextModule<Connect, Connect, Domain, Domain, Image, Location> {
-
- public LibvirtComputeServiceContextModule() {
- super(Connect.class, Connect.class);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- protected void configure() {
- super.configure();
- bind(new TypeLiteral<ComputeServiceAdapter<Domain, Domain, Image, Location>>() {
- }).to(LibvirtComputeServiceAdapter.class);
- bind(new TypeLiteral<Supplier<Location>>() {
- }).to(OnlyLocationOrFirstZone.class);
- bind(new TypeLiteral<Function<Domain, NodeMetadata>>() {
- }).to(DomainToNodeMetadata.class);
- bind(new TypeLiteral<Function<Image, org.jclouds.compute.domain.Image>>() {
- }).to(LibvirtImageToImage.class);
- bind(new TypeLiteral<Function<Domain, Hardware>>() {
- }).to(DomainToHardware.class);
- bind(new TypeLiteral<Function<Location, Location>>() {
- }).to((Class) IdentityFunction.class);
-
- // bind(ComputeService.class).to(LibvirtComputeService.class);
- }
-
- @Provides
- @Singleton
- protected Connect createConnection(@Provider URI endpoint, @Named(Constants.PROPERTY_IDENTITY) String identity,
- @Named(Constants.PROPERTY_CREDENTIAL) String credential) throws LibvirtException {
- // ConnectAuth connectAuth = null;
- return new Connect(endpoint.toASCIIString());
- }
-
- @Override
- protected TemplateBuilder provideTemplate(Injector injector, TemplateBuilder template) {
- String domainDir = injector.getInstance(Key.get(String.class, Names.named(PROPERTY_LIBVIRT_DOMAIN_DIR)));
- String hardwareId = searchForHardwareIdInDomainDir(domainDir, injector.getInstance(ParseSax.Factory.class),
- injector.getProvider(UUIDHandler.class));
- String image = searchForImageIdInDomainDir(domainDir);
- return template.hardwareId(hardwareId).imageId(image);
- }
-
- private String searchForImageIdInDomainDir(String domainDir) {
- // TODO
- return "1";
- }
-
- @SuppressWarnings("unchecked")
- private String searchForHardwareIdInDomainDir(String domainDir, final ParseSax.Factory factory,
- final javax.inject.Provider<UUIDHandler> provider) {
-
- // TODO: remove commons-io dependency
- return Iterables.<String> getLast(filter(transform(FileUtils.listFiles(new File(domainDir),
- new WildcardFileFilter("*.xml"), null), new Function<File, String>() {
-
- @Override
- public String apply(File input) {
- try {
- return factory.create(provider.get()).parse(new FileInputStream(input));
- } catch (FileNotFoundException e) {
- // log error.
- return null;
- }
- }
-
- }), notNull()));
- }
-
- public static class UUIDHandler extends ParseSax.HandlerWithResult<String> {
- private StringBuilder currentText = new StringBuilder();
-
- private boolean inDomain;
- private String uuid;
-
- public String getResult() {
- return uuid;
- }
-
- @Override
- public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException {
- if (qName.equals("domain")) {
- inDomain = true;
- }
- }
-
- @Override
- public void endElement(String uri, String localName, String qName) {
- if (qName.equalsIgnoreCase("uuid") && inDomain) {
- this.uuid = currentText.toString();
- } else if (qName.equalsIgnoreCase("domain")) {
- inDomain = false;
- }
- currentText = new StringBuilder();
- }
-
- public void characters(char ch[], int start, int length) {
- currentText.append(ch, start, length);
- }
- }
-
- /*
- * Map<String, URI> regions = newLinkedHashMap(); for (String region :
- * Splitter.on(',').split(regionString)) { regions.put( region,
- * URI.create(injector.getInstance(Key.get(String.class, Names.named(Constants.PROPERTY_ENDPOINT
- * + "." + region))))); } return regions;
- */
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/DomainToHardware.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/DomainToHardware.java b/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/DomainToHardware.java
deleted file mode 100644
index 7044321..0000000
--- a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/DomainToHardware.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds 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.libvirt.compute.functions;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.List;
-
-import javax.inject.Singleton;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.HardwareBuilder;
-import org.jclouds.compute.domain.Processor;
-import org.jclouds.compute.domain.Volume;
-import org.jclouds.compute.domain.internal.VolumeImpl;
-import org.libvirt.Domain;
-import org.libvirt.LibvirtException;
-import org.libvirt.StorageVol;
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-import com.google.common.base.Function;
-import com.google.common.base.Throwables;
-import com.google.common.collect.Lists;
-
-import com.jamesmurty.utils.XMLBuilder;
-
-/**
- * @author Adrian Cole
- */
-@Singleton
-public class DomainToHardware implements Function<Domain, Hardware> {
-
- @Override
- public Hardware apply(Domain from) {
- HardwareBuilder builder = new HardwareBuilder();
-
- try {
- builder.id(from.getUUIDString());
- builder.providerId(from.getID() + "");
- builder.name(from.getName());
- List<Processor> processors = Lists.newArrayList();
- for (int i = 0; i < from.getInfo().nrVirtCpu; i++) {
- processors.add(new Processor(i + 1, 1));
- }
- builder.processors(processors);
-
- builder.ram((int) from.getInfo().maxMem);
- List<Volume> volumes = Lists.newArrayList();
- XMLBuilder xmlBuilder = XMLBuilder.parse(new InputSource(new StringReader(from.getXMLDesc(0))));
- Document doc = xmlBuilder.getDocument();
- XPathExpression expr = XPathFactory.newInstance().newXPath().compile("//devices/disk[@device='disk']/source/@file");
- NodeList nodes = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
- String diskFileName = nodes.item(0).getNodeValue();
- for (int i = 0; i < nodes.getLength(); i++) {
- StorageVol storageVol = from.getConnect().storageVolLookupByPath(diskFileName);
- String id = storageVol.getKey();
- float size = Long.valueOf(storageVol.getInfo().capacity).floatValue();
- volumes.add(new VolumeImpl(id, Volume.Type.LOCAL, size, null, true, false));
- }
- builder.volumes((List<Volume>) volumes);
- } catch (LibvirtException e) {
- Throwables.propagate(e);
- } catch (XPathExpressionException e) {
- Throwables.propagate(e);
- } catch (ParserConfigurationException e) {
- Throwables.propagate(e);
- } catch (SAXException e) {
- Throwables.propagate(e);
- } catch (IOException e) {
- Throwables.propagate(e);
- }
- return builder.build();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/DomainToNodeMetadata.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/DomainToNodeMetadata.java b/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/DomainToNodeMetadata.java
deleted file mode 100644
index 03a4c24..0000000
--- a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/DomainToNodeMetadata.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds 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.libvirt.compute.functions;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.compute.util.ComputeServiceUtils.parseGroupFromName;
-
-import java.util.Map;
-import java.util.Set;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-
-import org.jclouds.collect.FindResourceInSet;
-import org.jclouds.collect.Memoized;
-import org.jclouds.compute.domain.Hardware;
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.NodeMetadata;
-import org.jclouds.compute.domain.NodeMetadataBuilder;
-import org.jclouds.compute.domain.NodeState;
-import org.jclouds.compute.domain.OperatingSystemBuilder;
-import org.jclouds.domain.Credentials;
-import org.jclouds.domain.Location;
-import org.libvirt.Domain;
-import org.libvirt.DomainInfo;
-import org.libvirt.LibvirtException;
-
-import com.google.common.base.Function;
-import com.google.common.base.Supplier;
-import com.google.common.collect.ImmutableMap;
-
-/**
- * @author Adrian Cole
- */
-@Singleton
-public class DomainToNodeMetadata implements Function<Domain, NodeMetadata> {
-
- public static final Map<DomainInfo.DomainState, NodeState> domainStateToNodeState = ImmutableMap
- .<DomainInfo.DomainState, NodeState> builder().put(DomainInfo.DomainState.VIR_DOMAIN_RUNNING,
- NodeState.RUNNING)//
- .put(DomainInfo.DomainState.VIR_DOMAIN_BLOCKED, NodeState.PENDING)//
- .put(DomainInfo.DomainState.VIR_DOMAIN_PAUSED, NodeState.SUSPENDED)//
- .put(DomainInfo.DomainState.VIR_DOMAIN_SHUTDOWN, NodeState.SUSPENDED)//
- .put(DomainInfo.DomainState.VIR_DOMAIN_SHUTOFF, NodeState.SUSPENDED)//
- .put(DomainInfo.DomainState.VIR_DOMAIN_CRASHED, NodeState.ERROR)//
-
- .put(DomainInfo.DomainState.VIR_DOMAIN_NOSTATE, NodeState.UNRECOGNIZED)//
- .build();
-
- private final Function<Domain, Hardware> findHardwareForDomain;
- private final FindLocationForDomain findLocationForDomain;
- private final FindImageForDomain findImageForDomain;
- private final Map<String, Credentials> credentialStore;
-
- @Inject
- DomainToNodeMetadata(Map<String, Credentials> credentialStore, Function<Domain, Hardware> findHardwareForDomain,
- FindLocationForDomain findLocationForDomain, FindImageForDomain findImageForDomain) {
- this.credentialStore = checkNotNull(credentialStore, "credentialStore");
- this.findHardwareForDomain = checkNotNull(findHardwareForDomain, "findHardwareForDomain");
- this.findLocationForDomain = checkNotNull(findLocationForDomain, "findLocationForDomain");
- this.findImageForDomain = checkNotNull(findImageForDomain, "findImageForDomain");
- }
-
- @Override
- public NodeMetadata apply(Domain from) {
-
- // convert the result object to a jclouds NodeMetadata
- NodeMetadataBuilder builder = new NodeMetadataBuilder();
- try {
- builder.id(from.getUUIDString());
- builder.providerId(from.getID() + "");
- builder.name(from.getName());
- builder.location(findLocationForDomain.apply(from));
- builder.group(parseGroupFromName(from.getName()));
-
- builder.operatingSystem(new OperatingSystemBuilder().description(from.getOSType()).build());
- builder.hardware(findHardwareForDomain.apply(from));
-
- builder.state(domainStateToNodeState.get(from.getInfo().state));
- // builder.publicAddresses(ImmutableSet.<String> of(from.publicAddress));
- // builder.privateAddresses(ImmutableSet.<String> of(from.privateAddress));
- builder.credentials(credentialStore.get("node#" + from.getUUIDString()));
-
- } catch (LibvirtException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return builder.build();
- }
-
- @Singleton
- public static class FindImageForDomain extends FindResourceInSet<Domain, Image> {
-
- @Inject
- public FindImageForDomain(@Memoized Supplier<Set<? extends Image>> hardware) {
- super(hardware);
- }
-
- @Override
- public boolean matches(Domain from, Image input) {
- // TODO
- // return input.getProviderId().equals(from.imageId + "");
- return true;
- }
- }
-
- @Singleton
- public static class FindLocationForDomain extends FindResourceInSet<Domain, Location> {
-
- @Inject
- public FindLocationForDomain(@Memoized Supplier<Set<? extends Location>> hardware) {
- super(hardware);
- }
-
- @Override
- public boolean matches(Domain from, Location input) {
- // TODO
- // return input.getId().equals(from.datacenter + "");
- return true;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/LibvirtImageToImage.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/LibvirtImageToImage.java b/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/LibvirtImageToImage.java
deleted file mode 100644
index fe208e1..0000000
--- a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/functions/LibvirtImageToImage.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds 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.libvirt.compute.functions;
-
-import javax.annotation.Resource;
-import javax.inject.Named;
-import javax.inject.Singleton;
-
-import org.jclouds.compute.domain.Image;
-import org.jclouds.compute.domain.ImageBuilder;
-import org.jclouds.compute.domain.OperatingSystemBuilder;
-import org.jclouds.compute.domain.OsFamily;
-import org.jclouds.compute.reference.ComputeServiceConstants;
-import org.jclouds.logging.Logger;
-
-import com.google.common.base.Function;
-
-/**
- * @author Adrian Cole
- */
-@Singleton
-public class LibvirtImageToImage implements Function<org.jclouds.libvirt.Image, Image> {
- @Resource
- @Named(ComputeServiceConstants.COMPUTE_LOGGER)
- protected Logger logger = Logger.NULL;
-
- @Override
- public Image apply(org.jclouds.libvirt.Image from) {
-
- ImageBuilder builder = new ImageBuilder();
- builder.ids(from.id + "");
- builder.name(from.name);
- builder.description(from.name);
-
- OsFamily family = null;
- try {
- family = OsFamily.fromValue(from.name);
- builder.operatingSystem(new OperatingSystemBuilder().name(from.name).family(family).description(from.name).build());
- } catch (IllegalArgumentException e) {
- logger.debug("<< didn't match os(%s)", from);
- }
- return builder.build();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-jclouds/blob/46e2f006/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/strategy/LibvirtComputeServiceAdapter.java
----------------------------------------------------------------------
diff --git a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/strategy/LibvirtComputeServiceAdapter.java b/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/strategy/LibvirtComputeServiceAdapter.java
deleted file mode 100644
index cde06ea..0000000
--- a/sandbox-apis/libvirt/src/main/java/org/jclouds/libvirt/compute/strategy/LibvirtComputeServiceAdapter.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/**
- * Licensed to jclouds, Inc. (jclouds) under one or more
- * contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. jclouds 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.libvirt.compute.strategy;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.jclouds.libvirt.LibvirtConstants.PROPERTY_LIBVIRT_DOMAIN_DIR;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.security.SecureRandom;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.UUID;
-
-import javax.inject.Inject;
-import javax.inject.Singleton;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.jclouds.compute.ComputeService;
-import org.jclouds.compute.ComputeServiceAdapter;
-import org.jclouds.compute.domain.Template;
-import org.jclouds.domain.Credentials;
-import org.jclouds.domain.Location;
-import org.jclouds.libvirt.Image;
-import org.libvirt.Connect;
-import org.libvirt.Domain;
-import org.libvirt.LibvirtException;
-import org.libvirt.StoragePool;
-import org.libvirt.StorageVol;
-import org.libvirt.jna.Libvirt;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-import com.google.common.base.Throwables;
-import com.google.common.collect.ImmutableSet;
-import com.google.common.collect.Lists;
-import com.google.inject.name.Named;
-import com.jamesmurty.utils.XMLBuilder;
-
-/**
- * defines the connection between the {@link Libvirt} implementation and the jclouds
- * {@link ComputeService}
- *
- */
-@Singleton
-public class LibvirtComputeServiceAdapter implements ComputeServiceAdapter<Domain, Domain, Image, Location> {
-
- private final Connect client;
-
- @Inject
- public LibvirtComputeServiceAdapter(Connect client, @Named(PROPERTY_LIBVIRT_DOMAIN_DIR) String domainDir) {
- this.client = checkNotNull(client, "client");
- System.out.println(domainDir);
- }
-
- @Override
- public Domain createNodeWithGroupEncodedIntoNameThenStoreCredentials(String tag, String name, Template template,
- Map<String, Credentials> credentialStore) {
- try {
- String domainName = tag;
- Domain domain = client.domainLookupByName(domainName);
- XMLBuilder builder = XMLBuilder.parse(new InputSource(new StringReader(domain.getXMLDesc(0))));
- Document doc = builder.getDocument();
- String xpathString = "//devices/disk[@device='disk']/source/@file";
- XPathExpression expr = XPathFactory.newInstance().newXPath().compile(xpathString);
- NodeList nodes = (NodeList) expr.evaluate(doc, XPathConstants.NODESET);
- String diskFileName = nodes.item(0).getNodeValue();
- StorageVol storageVol = client.storageVolLookupByPath(diskFileName);
-
- // cloning volume
- String poolName = storageVol.storagePoolLookupByVolume().getName();
- StoragePool storagePool = client.storagePoolLookupByName(poolName);
- StorageVol clonedVol = null;
- boolean cloned = false;
- int retry = 0;
- while (!cloned && retry < 10) {
- try {
- clonedVol = cloneVolume(storagePool, storageVol);
- cloned = true;
- } catch (LibvirtException e) {
- retry++;
- Thread.sleep(1000);
- }
- }
- // define Domain
- String xmlFinal = generateClonedDomainXML(domain.getXMLDesc(0), clonedVol);
- Domain newDomain = client.domainDefineXML(xmlFinal);
- newDomain.create();
- // store the credentials so that later functions can use them
- credentialStore.put(domain.getUUIDString() + "", new Credentials("identity", "credential"));
- return newDomain;
- } catch (LibvirtException e) {
- throw Throwables.propagate(e);
- } catch (Exception e) {
- throw Throwables.propagate(e);
- }
- }
-
- @Override
- public Iterable<Domain> listHardwareProfiles() {
- return listNodes();
- }
-
- @Override
- public Iterable<Image> listImages() {
- int i = 1;
- try {
- String[] domains = client.listDefinedDomains();
- List<Image> images = Lists.newArrayList();
- for (String domainName : domains) {
- images.add(new Image(i++, domainName));
- }
- return images;
- } catch (Exception e) {
- throw Throwables.propagate(e);
- }
- }
-
- @Override
- public Iterable<Domain> listNodes() {
- try {
- List<Domain> domains = Lists.newArrayList();
- for (String domain : client.listDefinedDomains()) {
- domains.add(client.domainLookupByName(domain));
- }
- return domains;
- } catch (LibvirtException e) {
- throw Throwables.propagate(e);
- }
- }
-
- @Override
- public Iterable<Location> listLocations() {
- return ImmutableSet.of();
- }
-
- @Override
- public Domain getNode(String id) {
- Domain d = null;
- try {
- d = client.domainLookupByUUIDString(id);
- } catch (LibvirtException e) {
- if (e.getMessage().indexOf("Domain not found: no domain with matching uuid") != -1)
- return null;
- Throwables.propagate(e);
- }
- return d;
- }
-
- @Override
- public void destroyNode(String id) {
- try {
- client.domainLookupByUUIDString(id).destroy();
-
- XMLBuilder builder = XMLBuilder.parse(new InputSource(new StringReader(client.domainLookupByUUIDString(id)
- .getXMLDesc(0))));
- String diskFileName = builder.xpathFind("//devices/disk[@device='disk']/source").getElement().getAttribute(
- "file");
- StorageVol storageVol = client.storageVolLookupByPath(diskFileName);
- storageVol.delete(0);
- client.domainLookupByUUIDString(id).undefine();
-
- } catch (LibvirtException e) {
- Throwables.propagate(e);
- } catch (Exception e) {
- Throwables.propagate(e);
- }
- }
-
- @Override
- public void rebootNode(String id) {
- try {
- client.domainLookupByUUIDString(id).reboot(0);
- } catch (LibvirtException e) {
- Throwables.propagate(e);
- }
- }
-
- private static StorageVol cloneVolume(StoragePool storagePool, StorageVol from) throws LibvirtException,
- XPathExpressionException, ParserConfigurationException, SAXException, IOException, TransformerException {
- return storagePool.storageVolCreateXMLFrom(generateClonedVolumeXML(from.getXMLDesc(0)), from, 0);
- }
-
- @Override
- public void resumeNode(String id) {
- try {
- client.domainLookupByUUIDString(id).resume();
- } catch (LibvirtException e) {
- Throwables.propagate(e);
- }
- }
-
- @Override
- public void suspendNode(String id) {
- try {
- client.domainLookupByUUIDString(id).suspend();
- } catch (LibvirtException e) {
- Throwables.propagate(e);
- }
- }
-
- private static String generateClonedVolumeXML(String fromXML) throws ParserConfigurationException, SAXException,
- IOException, XPathExpressionException, TransformerException {
-
- Properties outputProperties = generateOutputXMLProperties();
- XMLBuilder builder = XMLBuilder.parse(new InputSource(new StringReader(fromXML)));
- String nodeNamingConvention = "%s-%s";
- String tag = "-clone";
- String suffix = String.format(nodeNamingConvention, tag, Integer.toHexString(new SecureRandom().nextInt(4095)));
- builder.xpathFind("//volume/name").t(suffix);
- builder.xpathFind("//volume/key").t(suffix);
- builder.xpathFind("//volume/target/path").t(suffix);
-
- return builder.asString(outputProperties);
- }
-
- private static String generateClonedDomainXML(String fromXML, StorageVol clonedVol)
- throws ParserConfigurationException, SAXException, IOException, XPathExpressionException,
- TransformerException, LibvirtException {
-
- Properties outputProperties = generateOutputXMLProperties();
-
- XMLBuilder builder = XMLBuilder.parse(new InputSource(new StringReader(fromXML)));
-
- String nodeNamingConvention = "%s-%s";
- String tag = "-clone";
- String suffix = String.format(nodeNamingConvention, tag, Integer.toHexString(new SecureRandom().nextInt(4095)));
- builder.xpathFind("//domain/name").t(suffix);
- // change uuid domain
- Element oldChild = builder.xpathFind("//domain/uuid").getElement();
- Node newNode = oldChild.cloneNode(true);
- newNode.getFirstChild().setNodeValue(UUID.randomUUID().toString());
- builder.getDocument().getDocumentElement().replaceChild(newNode, oldChild);
-
- // String fromVolPath =
- // builder.xpathFind("//domain/devices/disk/source").getElement().getAttribute("file");
- builder.xpathFind("//domain/devices/disk/source").a("file", clonedVol.getPath());
- // generate valid MAC address
- String fromMACaddress = builder.xpathFind("//domain/devices/interface/mac").getElement().getAttribute("address");
- String lastMACoctet = Integer.toHexString(new SecureRandom().nextInt(255));
- builder.xpathFind("//domain/devices/interface/mac").a("address",
- fromMACaddress.substring(0, fromMACaddress.lastIndexOf(":") + 1) + lastMACoctet);
- return builder.asString(outputProperties);
- }
-
- private static Properties generateOutputXMLProperties() {
- Properties outputProperties = new Properties();
- // Explicitly identify the output as an XML document
- outputProperties.put(javax.xml.transform.OutputKeys.METHOD, "xml");
- // Pretty-print the XML output (doesn't work in all cases)
- outputProperties.put(javax.xml.transform.OutputKeys.INDENT, "yes");
- // Get 2-space indenting when using the Apache transformer
- outputProperties.put("{http://xml.apache.org/xslt}indent-amount", "2");
- return outputProperties;
- }
-}
\ No newline at end of file