From 76fac92b216f37870ecfe9b8e01fb4d496c32222 Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Wed, 21 Dec 2011 11:04:47 -0800 Subject: [PATCH] removed tmrk-enterprisecloud due to licensing reasons --- core/src/main/resources/rest.properties | 3 - .../tmrk-enterprisecloud/pom.xml | 142 - .../TerremarkEnterpriseCloudAsyncClient.java | 89 - .../TerremarkEnterpriseCloudClient.java | 93 - ...erremarkEnterpriseCloudContextBuilder.java | 45 - ...emarkEnterpriseCloudPropertiesBuilder.java | 46 - ...remarkEnterpriseCloudProviderMetadata.java | 117 - ...BindCreateInternetServiceToXmlPayload.java | 37 - .../binders/BindCreateSSHKeyToXmlPayload.java | 78 - ...ndCreateVirtualMachineKeyToXmlPayload.java | 180 - .../binders/BindDateToQueryParam.java | 55 - .../binders/BindEndTimeQueryParam.java | 36 - .../BindInternetServiceToXmlPayload.java | 144 - .../binders/BindSSHKeyToXmlPayload.java | 78 - .../binders/BindStartTimeQueryParam.java | 36 - ...remarkEnterpriseCloudRestClientModule.java | 80 - .../tmrk/enterprisecloud/domain/Action.java | 218 -- .../tmrk/enterprisecloud/domain/Actions.java | 106 - .../domain/ConfigurationOptionRange.java | 134 - .../domain/CustomizationOption.java | 167 - .../tmrk/enterprisecloud/domain/Link.java | 231 -- .../tmrk/enterprisecloud/domain/Links.java | 108 - .../tmrk/enterprisecloud/domain/Location.java | 221 -- .../enterprisecloud/domain/NamedResource.java | 115 - .../domain/ResourceCapacityRange.java | 140 - .../tmrk/enterprisecloud/domain/Task.java | 416 --- .../tmrk/enterprisecloud/domain/Tasks.java | 112 - .../hardware/DiskConfigurationOption.java | 156 - .../DiskConfigurationOptionRange.java | 122 - .../domain/hardware/Disks.java | 109 - .../hardware/HardwareConfiguration.java | 249 -- .../domain/hardware/VirtualDisk.java | 144 - .../domain/internal/BaseNamedResource.java | 122 - .../domain/internal/BaseResource.java | 148 - .../domain/internal/Entity.java | 158 - .../domain/internal/Resource.java | 173 - .../domain/internal/ResourceCapacity.java | 122 - .../enterprisecloud/domain/keys/SshKey.java | 239 -- .../enterprisecloud/domain/keys/SshKeys.java | 182 - .../domain/layout/DeviceLayout.java | 183 - .../enterprisecloud/domain/layout/Groups.java | 106 - .../enterprisecloud/domain/layout/Layout.java | 86 - .../domain/layout/LayoutGroup.java | 206 -- .../domain/layout/LayoutRequest.java | 181 - .../domain/layout/LayoutRow.java | 200 -- .../enterprisecloud/domain/layout/Rows.java | 106 - .../domain/network/AssignedIpAddresses.java | 80 - .../domain/network/DeviceIps.java | 76 - .../domain/network/DeviceNetwork.java | 49 - .../domain/network/DeviceNetworks.java | 57 - .../domain/network/DnsSettings.java | 121 - .../domain/network/IpAddress.java | 221 -- .../domain/network/IpAddressReference.java | 182 - .../domain/network/IpAddresses.java | 105 - .../domain/network/LinuxCustomization.java | 120 - .../domain/network/NetworkAdapterSetting.java | 122 - .../network/NetworkAdapterSettings.java | 105 - .../domain/network/NetworkReference.java | 292 -- .../domain/network/NetworkSettings.java | 125 - .../domain/network/Networks.java | 182 - .../enterprisecloud/domain/network/Nics.java | 108 - .../domain/network/VirtualNic.java | 164 - .../domain/network/WindowsCustomization.java | 141 - .../ComputePoolPerformanceStatistic.java | 98 - .../ComputePoolPerformanceStatistics.java | 202 -- .../resource/ComputePoolResourceSummary.java | 286 -- .../ComputePoolResourceSummaryList.java | 184 - .../resource/ComputeResourceSummary.java | 162 - .../MemoryComputeResourceSummary.java | 73 - .../domain/resource/PerformanceStatistic.java | 123 - .../resource/PerformanceStatistics.java | 224 -- .../resource/StorageResourceSummary.java | 123 - .../VirtualMachinePerformanceStatistic.java | 184 - .../VirtualMachinePerformanceStatistics.java | 102 - .../VirtualMachineResourceSummary.java | 132 - .../resource/cpu/ComputePoolCpuUsage.java | 223 -- .../cpu/ComputePoolCpuUsageDetail.java | 225 -- ...ComputePoolCpuUsageDetailSummaryEntry.java | 127 - .../cpu/CpuComputeResourceSummary.java | 133 - .../domain/resource/cpu/CpuUsageDetails.java | 106 - .../cpu/VirtualMachineCpuUsageDetail.java | 199 -- .../resource/cpu/VirtualMachinesCpuUsage.java | 107 - .../memory/ComputePoolMemoryUsage.java | 223 -- .../memory/ComputePoolMemoryUsageDetail.java | 225 -- ...putePoolMemoryUsageDetailSummaryEntry.java | 127 - .../resource/memory/MemoryUsageDetails.java | 106 - .../VirtualMachineMemoryUsageDetail.java | 199 -- .../memory/VirtualMachinesMemoryUsage.java | 107 - .../ComputePoolStorageUsageDetail.java | 183 - .../VirtualMachineStorageUsageDetail.java | 204 -- .../VirtualMachinesStorageDetails.java | 107 - .../domain/service/Protocol.java | 56 - .../service/internet/InternetService.java | 419 --- .../InternetServicePersistenceType.java | 135 - .../domain/service/node/NodeService.java | 281 -- .../domain/service/node/NodeServices.java | 104 - .../domain/software/OperatingSystem.java | 139 - .../domain/software/ToolsStatus.java | 50 - .../domain/template/Template.java | 315 -- .../domain/template/TemplateCategories.java | 108 - .../domain/template/TemplateCategory.java | 124 - .../domain/template/TemplateFamilies.java | 108 - .../domain/template/TemplateFamily.java | 124 - .../template/TemplateOperatingSystem.java | 125 - .../template/TemplateOperatingSystems.java | 108 - .../domain/template/TemplateReferences.java | 109 - .../domain/template/TemplateStorage.java | 122 - .../domain/template/Templates.java | 185 - .../domain/vm/CreateVirtualMachine.java | 232 -- .../vm/CreateVirtualMachineRequest.java | 182 - .../domain/vm/VirtualMachine.java | 469 --- .../VirtualMachineConfigurationOptions.java | 279 -- .../domain/vm/VirtualMachineIpAddresses.java | 49 - .../domain/vm/VirtualMachineReference.java | 312 -- .../domain/vm/VirtualMachineReferences.java | 108 - .../domain/vm/VirtualMachines.java | 109 - .../features/InternetServiceAsyncClient.java | 87 - .../features/InternetServiceClient.java | 111 - .../features/LayoutAsyncClient.java | 62 - .../features/LayoutClient.java | 59 - .../features/LocationAsyncClient.java | 54 - .../features/LocationClient.java | 47 - .../features/NetworkAsyncClient.java | 63 - .../features/NetworkClient.java | 60 - .../features/ResourceAsyncClient.java | 137 - .../features/ResourceClient.java | 217 -- .../features/SshKeyAsyncClient.java | 96 - .../features/SshKeyClient.java | 99 - .../features/TaskAsyncClient.java | 74 - .../enterprisecloud/features/TaskClient.java | 65 - .../features/TemplateAsyncClient.java | 63 - .../features/TemplateClient.java | 57 - .../features/VirtualMachineAsyncClient.java | 175 - .../features/VirtualMachineClient.java | 157 - ...rnEmptyVirtualMachinesOnNotFoundOr404.java | 57 - .../enterprisecloud/functions/URISource.java | 37 - .../TerremarkEnterpriseCloudErrorHandler.java | 92 - .../predicates/TaskPredicates.java | 60 - .../org.jclouds.providers.ProviderMetadata | 1 - ...rremarkEnterpriseCloudAsyncClientTest.java | 72 - ...remarkEnterpriseCloudErrorHandlerTest.java | 118 - .../TerremarkEnterpriseCloudProviderTest.java | 35 - ...CreateInternetServiceToXmlPayloadTest.java | 74 - .../BindCreateSSHKeyToXmlPayloadTest.java | 59 - ...eateVirtualMachineKeyToXmlPayloadTest.java | 121 - .../binders/BindDateToQueryParamTest.java | 76 - .../BindInternetServiceToXmlPayloadTest.java | 169 - .../binders/BindSSHKeyToXmlPayloadTest.java | 70 - .../enterprisecloud/domain/ActionsTest.java | 57 - .../enterprisecloud/domain/LinksTest.java | 58 - .../enterprisecloud/domain/TasksTest.java | 89 - .../domain/hardware/DisksTest.java | 56 - .../domain/internal/NamedResourceTest.java | 44 - .../domain/network/NicsTest.java | 58 - .../domain/vm/VirtualMachinesTest.java | 80 - ...rremarkEnterpriseCloudAsyncClientTest.java | 50 - ...erremarkEnterpriseCloudClientLiveTest.java | 67 - .../InternetServiceAsyncClientTest.java | 141 - .../InternetServiceClientLiveTest.java | 89 - .../features/LayoutAsyncClientTest.java | 71 - .../features/LayoutClientLiveTest.java | 62 - .../features/LocationAsyncClientTest.java | 62 - .../features/LocationClientLiveTest.java | 55 - .../features/NetworkClientLiveTest.java | 61 - .../features/ResourceAsyncClientTest.java | 210 -- .../features/ResourceClientLiveTest.java | 158 - .../features/SSHKeyAsyncClientTest.java | 130 - .../features/SSHKeyClientLiveTest.java | 86 - .../features/TaskAsyncClientTest.java | 90 - .../features/TaskClientLiveTest.java | 68 - .../features/TemplateAsyncClientTest.java | 76 - .../features/TemplateClientLiveTest.java | 73 - .../VirtualMachineAsyncClientTest.java | 215 -- .../VirtualMachineClientActionsLiveTest.java | 199 -- .../VirtualMachineClientLiveTest.java | 157 - .../enterprisecloud/functions/GetURITest.java | 62 - ...ptyVirtualMachinesOnNotFoundOr404Test.java | 63 - .../predicates/TaskPredicatesTest.java | 73 - .../AssignedIpAddressesJAXBParsingTest.java | 119 - ...putePoolCpuUsageDetailJAXBParsingTest.java | 145 - .../ComputePoolCpuUsageJAXBParsingTest.java | 145 - ...ePoolMemoryUsageDetailJAXBParsingTest.java | 145 - ...ComputePoolMemoryUsageJAXBParsingTest.java | 145 - ...lPerformanceStatisticsJAXBParsingTest.java | 117 - ...utePoolResourceSummaryJAXBParsingTest.java | 148 - ...oolResourceSummaryListJAXBParsingTest.java | 117 - ...PoolStorageUsageDetailJAXBParsingTest.java | 120 - .../xml/DeviceLayoutJAXBParsingTest.java | 134 - .../HardwareConfigurationJAXBParsingTest.java | 143 - .../xml/InternetServiceJAXBParsingTest.java | 128 - .../xml/LocationJAXBParsingTest.java | 111 - .../xml/NetworksJAXBParsingTest.java | 156 - .../PerformanceStatisticsJAXBParsingTest.java | 124 - .../xml/SSHKeysJAXBParsingTest.java | 153 - .../xml/TaskJAXBParsingTest.java | 162 - .../xml/TemplateJAXBParsingTest.java | 162 - .../xml/TemplatesJAXBParsingTest.java | 138 - ...neConfigurationOptionsJAXBParsingTest.java | 154 - .../xml/VirtualMachineJAXBParsingTest.java | 200 -- .../test/resources/assignedIpAddresses.xml | 19 - .../test/resources/computePoolCpuUsage.xml | 2039 ----------- .../resources/computePoolCpuUsageDetail.xml | 28 - .../computePoolCpuUsageDetailNoDetail.xml | 17 - .../test/resources/computePoolMemoryUsage.xml | 2039 ----------- .../computePoolMemoryUsageDetail.xml | 29 - .../computePoolMemoryUsageDetailNoDetail.xml | 18 - .../computePoolPerformanceStatistics.xml | 22 - .../computePoolPerformanceStatisticsDaily.xml | 70 - .../resources/computePoolResourceSummary.xml | 56 - .../computePoolResourceSummaryList.xml | 64 - .../resources/computePoolStorageUsage.xml | 25 - .../src/test/resources/deviceLayout.xml | 89 - .../test/resources/hardwareConfiguration.xml | 37 - .../src/test/resources/internetService.xml | 97 - .../src/test/resources/location.xml | 7 - .../src/test/resources/log4j.xml | 151 - .../src/test/resources/network.xml | 224 -- .../src/test/resources/networks.xml | 16 - .../resources/schema/eCloudAPI-2011-07-01.xsd | 3184 ----------------- .../src/test/resources/sshKey.xml | 17 - .../src/test/resources/sshKeys.xml | 48 - .../src/test/resources/task.xml | 10 - .../src/test/resources/tasks.xml | 22 - .../src/test/resources/template.xml | 46 - .../src/test/resources/templates.xml | 55 - .../src/test/resources/virtualMachine.xml | 144 - .../virtualMachineConfigurationOptions.xml | 73 - 227 files changed, 34411 deletions(-) delete mode 100644 sandbox-providers/tmrk-enterprisecloud/pom.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudAsyncClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudContextBuilder.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudPropertiesBuilder.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudProviderMetadata.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateInternetServiceToXmlPayload.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateSSHKeyToXmlPayload.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayload.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindDateToQueryParam.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindEndTimeQueryParam.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindInternetServiceToXmlPayload.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindSSHKeyToXmlPayload.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindStartTimeQueryParam.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/config/TerremarkEnterpriseCloudRestClientModule.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Action.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Actions.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/ConfigurationOptionRange.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/CustomizationOption.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Link.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Links.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Location.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/NamedResource.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/ResourceCapacityRange.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Task.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Tasks.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/DiskConfigurationOption.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/DiskConfigurationOptionRange.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/Disks.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/HardwareConfiguration.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/VirtualDisk.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/BaseNamedResource.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/BaseResource.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/Entity.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/Resource.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/ResourceCapacity.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/keys/SshKey.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/keys/SshKeys.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/DeviceLayout.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Groups.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Layout.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutGroup.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRequest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRow.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Rows.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/AssignedIpAddresses.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceIps.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceNetwork.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceNetworks.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DnsSettings.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddress.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddressReference.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddresses.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/LinuxCustomization.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkAdapterSetting.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkAdapterSettings.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkReference.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkSettings.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/Networks.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/Nics.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/VirtualNic.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/WindowsCustomization.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistic.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistics.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolResourceSummary.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolResourceSummaryList.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputeResourceSummary.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/MemoryComputeResourceSummary.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/PerformanceStatistic.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/PerformanceStatistics.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/StorageResourceSummary.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachinePerformanceStatistic.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachinePerformanceStatistics.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachineResourceSummary.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsage.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsageDetail.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsageDetailSummaryEntry.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/CpuComputeResourceSummary.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/CpuUsageDetails.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/VirtualMachineCpuUsageDetail.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/VirtualMachinesCpuUsage.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsage.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsageDetail.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsageDetailSummaryEntry.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/MemoryUsageDetails.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/VirtualMachineMemoryUsageDetail.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/VirtualMachinesMemoryUsage.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/ComputePoolStorageUsageDetail.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/VirtualMachineStorageUsageDetail.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/VirtualMachinesStorageDetails.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/Protocol.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/internet/InternetService.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/internet/InternetServicePersistenceType.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/node/NodeService.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/node/NodeServices.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/software/OperatingSystem.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/software/ToolsStatus.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/Template.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/TemplateCategories.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/TemplateCategory.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/TemplateFamilies.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/TemplateFamily.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/TemplateOperatingSystem.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/TemplateOperatingSystems.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/TemplateReferences.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/TemplateStorage.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/Templates.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/CreateVirtualMachine.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/CreateVirtualMachineRequest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/VirtualMachine.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/VirtualMachineConfigurationOptions.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/VirtualMachineIpAddresses.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/VirtualMachineReference.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/VirtualMachineReferences.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/vm/VirtualMachines.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceAsyncClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/LayoutAsyncClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/LayoutClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/LocationAsyncClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/LocationClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/NetworkAsyncClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/NetworkClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/ResourceAsyncClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/ResourceClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/SshKeyAsyncClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/SshKeyClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/TaskAsyncClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/TaskClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/TemplateAsyncClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/TemplateClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineAsyncClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineClient.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/functions/ReturnEmptyVirtualMachinesOnNotFoundOr404.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/functions/URISource.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/handlers/TerremarkEnterpriseCloudErrorHandler.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/predicates/TaskPredicates.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/main/resources/META-INF/services/org.jclouds.providers.ProviderMetadata delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudAsyncClientTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudErrorHandlerTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudProviderTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateInternetServiceToXmlPayloadTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateSSHKeyToXmlPayloadTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayloadTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/binders/BindDateToQueryParamTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/binders/BindInternetServiceToXmlPayloadTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/binders/BindSSHKeyToXmlPayloadTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/domain/ActionsTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/domain/LinksTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/domain/TasksTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/DisksTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/domain/internal/NamedResourceTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/domain/network/NicsTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/domain/vm/VirtualMachinesTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/BaseTerremarkEnterpriseCloudAsyncClientTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/BaseTerremarkEnterpriseCloudClientLiveTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceAsyncClientTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/InternetServiceClientLiveTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/LayoutAsyncClientTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/LayoutClientLiveTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/LocationAsyncClientTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/LocationClientLiveTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/NetworkClientLiveTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/ResourceAsyncClientTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/ResourceClientLiveTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/SSHKeyAsyncClientTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/SSHKeyClientLiveTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/TaskAsyncClientTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/TaskClientLiveTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/TemplateAsyncClientTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/TemplateClientLiveTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineAsyncClientTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineClientActionsLiveTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/features/VirtualMachineClientLiveTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/functions/GetURITest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/functions/ReturnEmptyVirtualMachinesOnNotFoundOr404Test.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/predicates/TaskPredicatesTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/AssignedIpAddressesJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolCpuUsageDetailJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolCpuUsageJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolMemoryUsageDetailJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolMemoryUsageJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolPerformanceStatisticsJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolResourceSummaryJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolResourceSummaryListJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/ComputePoolStorageUsageDetailJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/DeviceLayoutJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/HardwareConfigurationJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/InternetServiceJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/LocationJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/NetworksJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/PerformanceStatisticsJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/SSHKeysJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/TaskJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/TemplateJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/TemplatesJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/VirtualMachineConfigurationOptionsJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/java/org/jclouds/tmrk/enterprisecloud/xml/VirtualMachineJAXBParsingTest.java delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/assignedIpAddresses.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/computePoolCpuUsage.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/computePoolCpuUsageDetail.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/computePoolCpuUsageDetailNoDetail.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/computePoolMemoryUsage.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/computePoolMemoryUsageDetail.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/computePoolMemoryUsageDetailNoDetail.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/computePoolPerformanceStatistics.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/computePoolPerformanceStatisticsDaily.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/computePoolResourceSummary.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/computePoolResourceSummaryList.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/computePoolStorageUsage.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/deviceLayout.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/hardwareConfiguration.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/internetService.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/location.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/log4j.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/network.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/networks.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/schema/eCloudAPI-2011-07-01.xsd delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/sshKey.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/sshKeys.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/task.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/tasks.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/template.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/templates.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/virtualMachine.xml delete mode 100644 sandbox-providers/tmrk-enterprisecloud/src/test/resources/virtualMachineConfigurationOptions.xml diff --git a/core/src/main/resources/rest.properties b/core/src/main/resources/rest.properties index 3ff7c3d7cd..17b919de08 100644 --- a/core/src/main/resources/rest.properties +++ b/core/src/main/resources/rest.properties @@ -50,9 +50,6 @@ trmk-vcloudexpress.propertiesbuilder=org.jclouds.trmk.vcloudexpress.TerremarkVCl trmk-ecloud.contextbuilder=org.jclouds.trmk.ecloud.TerremarkECloudContextBuilder trmk-ecloud.propertiesbuilder=org.jclouds.trmk.ecloud.TerremarkECloudPropertiesBuilder -tmrk-enterprisecloud.contextbuilder=org.jclouds.tmrk.enterprisecloud.TerremarkEnterpriseCloudContextBuilder -tmrk-enterprisecloud.propertiesbuilder=org.jclouds.tmrk.enterprisecloud.TerremarkEnterpriseCloudPropertiesBuilder - chef.contextbuilder=org.jclouds.chef.ChefContextBuilder chef.propertiesbuilder=org.jclouds.chef.ChefPropertiesBuilder diff --git a/sandbox-providers/tmrk-enterprisecloud/pom.xml b/sandbox-providers/tmrk-enterprisecloud/pom.xml deleted file mode 100644 index c054ed0233..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/pom.xml +++ /dev/null @@ -1,142 +0,0 @@ - - - - 4.0.0 - - org.jclouds - jclouds-project - 1.3.0-SNAPSHOT - ../../project/pom.xml - - org.jclouds.provider - tmrk-enterprisecloud - jclouds Terremark Enterprise Cloud core - jclouds components to access Terremark Enterprise Cloud - bundle - - - - - jclouds-sona-snapshots-nexus - https://oss.sonatype.org/content/repositories/snapshots - - false - - - true - - - - - - https://services-beta.enterprisecloud.terremark.com/cloudapi/ecloud - 2011-07-01 - FIXME - FIXME - - - - - org.jclouds - jclouds-compute - ${project.version} - - - com.jamesmurty.utils - java-xmlbuilder - 0.4 - - - org.jclouds - jclouds-core - ${project.version} - test-jar - test - - - org.jclouds - jclouds-compute - ${project.version} - test-jar - test - - - org.jclouds.driver - jclouds-log4j - ${project.version} - test - - - org.jclouds.driver - jclouds-sshj - ${project.version} - test - - - - - live - - - - org.apache.maven.plugins - maven-surefire-plugin - - - integration - integration-test - - test - - - - ${test.tmrk-enterprisecloud.endpoint} - ${test.tmrk-enterprisecloud.apiversion} - ${test.tmrk-enterprisecloud.identity} - ${test.tmrk-enterprisecloud.credential} - ${test.tmrk-enterprisecloud.image-id} - - - - - - - - - - - - - - org.apache.felix - maven-bundle-plugin - - - ${project.artifactId} - org.jclouds.tmrk.enterprisecloud.*;version="${project.version}" - org.jclouds.*;version="${project.version}",* - - - - - - diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudAsyncClient.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudAsyncClient.java deleted file mode 100644 index 9acd27839b..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudAsyncClient.java +++ /dev/null @@ -1,89 +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.tmrk.enterprisecloud; - -import org.jclouds.rest.annotations.Delegate; -import org.jclouds.tmrk.enterprisecloud.features.*; - -/** - * Provides asynchronous access to TerremarkEnterpriseCloud via their REST API. - *

- * - * @see TerremarkEnterpriseCloudClient - * @see - * @author Adrian Cole - */ -public interface TerremarkEnterpriseCloudAsyncClient { - - /** - * Provides asynchronous access to Internet Service features. - */ - @Delegate - InternetServiceAsyncClient getInternetServiceClient(); - - /** - * Provides asynchronous access to Layout features. - */ - @Delegate - LayoutAsyncClient getLayoutClient(); - - /** - * Provides asynchronous access to Location features. - */ - @Delegate - LocationAsyncClient getLocationClient(); - - /** - * Provides asynchronous access to Network features. - */ - @Delegate - NetworkAsyncClient getNetworkClient(); - - /** - * Provides asynchronous access to Resource features. - */ - @Delegate - ResourceAsyncClient getResourceClient(); - - /** - * Provides asynchronous access to Task features. - */ - @Delegate - TaskAsyncClient getTaskClient(); - - /** - * Provides asynchronous access to SSH Key features. - */ - @Delegate - SSHKeyAsyncClient getSSHKeyClient(); - - /** - * Provides asynchronous access to VirtualMachine features. - */ - @Delegate - VirtualMachineAsyncClient getVirtualMachineClient(); - - /** - * Provides asynchronous access to Template features. - */ - @Delegate - TemplateAsyncClient getTemplateClient(); -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudClient.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudClient.java deleted file mode 100644 index fb498ea839..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudClient.java +++ /dev/null @@ -1,93 +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.tmrk.enterprisecloud; - -import java.util.concurrent.TimeUnit; - -import org.jclouds.concurrent.Timeout; -import org.jclouds.rest.annotations.Delegate; -import org.jclouds.tmrk.enterprisecloud.features.*; - -/** - * Provides synchronous access to TerremarkEnterpriseCloud. - *

- * - * @see TerremarkEnterpriseCloudAsyncClient - * @see - * @author Adrian Cole - */ -@Timeout(duration = 180, timeUnit = TimeUnit.SECONDS) -public interface TerremarkEnterpriseCloudClient { - - /** - * Provides synchronous access to Internet Service features. - */ - @Delegate - InternetServiceClient getInternetServiceClient(); - - /** - * Provides synchronous access to Layout features. - */ - @Delegate - LayoutClient getLayoutClient(); - - /** - * Provides synchronous access to Location features. - */ - @Delegate - LocationClient getLocationClient(); - - /** - * Provides synchronous access to Resource features. - */ - @Delegate - ResourceClient getResourceClient(); - - /** - * Provides synchronous access to Network features. - */ - @Delegate - NetworkClient getNetworkClient(); - - /** - * Provides synchronous access to SSH Key features. - */ - @Delegate - SSHKeyClient getSSHKeyClient(); - - /** - * Provides synchronous access to Task features. - */ - @Delegate - TaskClient getTaskClient(); - - /** - * Provides synchronous access to VirtualMachine features. - */ - @Delegate - VirtualMachineClient getVirtualMachineClient(); - - /** - * Provides synchronous access to Template features. - */ - @Delegate - TemplateClient getTemplateClient(); -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudContextBuilder.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudContextBuilder.java deleted file mode 100644 index f5c2cc7254..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudContextBuilder.java +++ /dev/null @@ -1,45 +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.tmrk.enterprisecloud; - -import java.util.List; -import java.util.Properties; - -import org.jclouds.rest.RestContextBuilder; -import org.jclouds.tmrk.enterprisecloud.config.TerremarkEnterpriseCloudRestClientModule; - -import com.google.inject.Module; - -/** - * - * @author Adrian Cole - */ -public class TerremarkEnterpriseCloudContextBuilder extends - RestContextBuilder { - - public TerremarkEnterpriseCloudContextBuilder(Properties props) { - super(TerremarkEnterpriseCloudClient.class, TerremarkEnterpriseCloudAsyncClient.class, props); - } - - @Override - protected void addClientModule(List modules) { - modules.add(new TerremarkEnterpriseCloudRestClientModule()); - } - -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudPropertiesBuilder.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudPropertiesBuilder.java deleted file mode 100644 index 96383460da..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudPropertiesBuilder.java +++ /dev/null @@ -1,46 +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.tmrk.enterprisecloud; - -import static org.jclouds.Constants.PROPERTY_API_VERSION; -import static org.jclouds.Constants.PROPERTY_ENDPOINT; - -import java.util.Properties; - -import org.jclouds.PropertiesBuilder; - -/** - * Builds properties used in TerremarkEnterpriseCloud Clients - * - * @author Adrian Cole - */ -public class TerremarkEnterpriseCloudPropertiesBuilder extends PropertiesBuilder { - @Override - protected Properties defaultProperties() { - Properties properties = super.defaultProperties(); - properties.setProperty(PROPERTY_ENDPOINT, "https://services-beta.enterprisecloud.terremark.com/cloudapi/ecloud"); - properties.setProperty(PROPERTY_API_VERSION, "2011-07-01"); - return properties; - } - - public TerremarkEnterpriseCloudPropertiesBuilder(Properties properties) { - super(properties); - } - -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudProviderMetadata.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudProviderMetadata.java deleted file mode 100644 index 41d3e79815..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/TerremarkEnterpriseCloudProviderMetadata.java +++ /dev/null @@ -1,117 +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.tmrk.enterprisecloud; - -import java.net.URI; -import java.util.Set; - -import org.jclouds.providers.BaseProviderMetadata; -import org.jclouds.providers.ProviderMetadata; - -import com.google.common.collect.ImmutableSet; - -/** - * Implementation of {@link org.jclouds.types.ProviderMetadata} for Terremark - * Enterprise Cloud. - * - * @author Adrian Cole - */ -public class TerremarkEnterpriseCloudProviderMetadata extends BaseProviderMetadata { - - /** - * {@inheritDoc} - */ - @Override - public String getId() { - return "tmrk-enterprisecloud"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getType() { - return ProviderMetadata.COMPUTE_TYPE; - } - - /** - * {@inheritDoc} - */ - @Override - public String getName() { - return "Terremark Enterprise Cloud"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getIdentityName() { - return "Email"; - } - - /** - * {@inheritDoc} - */ - @Override - public String getCredentialName() { - return "Password"; - } - - /** - * {@inheritDoc} - */ - @Override - public URI getHomepage() { - return URI.create("http://www.terremark.com/services/cloudcomputing/theenterprisecloud.aspx"); - } - - /** - * {@inheritDoc} - */ - @Override - public URI getConsole() { - return URI.create("https://my-beta.enterprisecloud.terremark.com/"); - } - - /** - * {@inheritDoc} - */ - @Override - public URI getApiDocumentation() { - return URI.create("http://support.theenterprisecloud.com/kb/default.asp?id=984&Lang=1&SID="); - } - - /** - * {@inheritDoc} - */ - @Override - public Set getLinkedServices() { - return ImmutableSet.of("tmrk-enterprisecloud", "tmrk-ecloud", "tmrk-vcloudexpress"); - } - - /** - * {@inheritDoc} - */ - @Override - public Set getIso3166Codes() { - return ImmutableSet.of("TODO"); - } - -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateInternetServiceToXmlPayload.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateInternetServiceToXmlPayload.java deleted file mode 100644 index 229277a1fe..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateInternetServiceToXmlPayload.java +++ /dev/null @@ -1,37 +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.tmrk.enterprisecloud.binders; - -import org.jclouds.rest.binders.BindToStringPayload; - -import javax.inject.Inject; -import javax.inject.Singleton; - -/** - * For use with {@see org.jclouds.tmrk.enterprisecloud.features.InternetServiceClient#createInternetService} - * @author Jason King - */ -@Singleton -public class BindCreateInternetServiceToXmlPayload extends BindInternetServiceToXmlPayload { - - @Inject - BindCreateInternetServiceToXmlPayload(BindToStringPayload stringBinder) { - super(stringBinder, "CreateInternetService"); - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateSSHKeyToXmlPayload.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateSSHKeyToXmlPayload.java deleted file mode 100644 index f3bfd115b5..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateSSHKeyToXmlPayload.java +++ /dev/null @@ -1,78 +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.tmrk.enterprisecloud.binders; - -import com.jamesmurty.utils.XMLBuilder; -import org.jclouds.http.HttpRequest; -import org.jclouds.rest.MapBinder; -import org.jclouds.rest.binders.BindToStringPayload; - -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; -import java.util.Map; -import java.util.Properties; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - */ -@Singleton -public class BindCreateSSHKeyToXmlPayload implements MapBinder { - - private final BindToStringPayload stringBinder; - - @Inject - BindCreateSSHKeyToXmlPayload(BindToStringPayload stringBinder) { - this.stringBinder = stringBinder; - } - - @Override - public R bindToRequest(R request, Map params) { - checkNotNull(request, "request"); - checkNotNull(params, "params"); - String name = checkNotNull(params.get("name"), "name"); - String isDefault = checkNotNull(params.get("isDefault"), "isDefault"); - - String payload = createXMLPayload(name,isDefault); - return stringBinder.bindToRequest(request, payload); - } - - private String createXMLPayload(String name, String isDefault) { - try { - Properties outputProperties = new Properties(); - outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes"); - return XMLBuilder.create("CreateSshKey").a("name",name) - .e("Default").t(isDefault) - .asString(outputProperties); - } catch (ParserConfigurationException e) { - throw new RuntimeException(e); - } catch (TransformerException t) { - throw new RuntimeException(t); - } - } - - @Override - public R bindToRequest(R request, Object input) { - throw new IllegalStateException("BindCreateKey needs parameters"); - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayload.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayload.java deleted file mode 100644 index 3ed7c374ad..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindCreateVirtualMachineKeyToXmlPayload.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.tmrk.enterprisecloud.binders; - -import com.jamesmurty.utils.XMLBuilder; -import org.jclouds.http.HttpRequest; -import org.jclouds.rest.Binder; -import org.jclouds.rest.binders.BindToStringPayload; -import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.layout.LayoutRequest; -import org.jclouds.tmrk.enterprisecloud.domain.network.*; -import org.jclouds.tmrk.enterprisecloud.domain.vm.CreateVirtualMachine; - -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; -import java.util.Properties; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * For use with {@see VirtualMachineClient#createVirtualMachineFromTemplate} - * @author Jason King - */ -@Singleton -public class BindCreateVirtualMachineKeyToXmlPayload implements Binder { - - private final BindToStringPayload stringBinder; - - @Inject - BindCreateVirtualMachineKeyToXmlPayload(BindToStringPayload stringBinder) { - this.stringBinder = stringBinder; - } - - @Override - public R bindToRequest(R request, Object key) { - checkArgument(checkNotNull(key, "key") instanceof CreateVirtualMachine, "this binder is only valid for CreateOsTemplateVirtualMachineRequest instances!"); - checkNotNull(request, "request"); - CreateVirtualMachine vmData = CreateVirtualMachine.class.cast(key); - - String payload = createXMLPayload(vmData); - return stringBinder.bindToRequest(request, payload); - } - - private String createXMLPayload(CreateVirtualMachine vmData) { - try { - Properties outputProperties = new Properties(); - outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes"); - - final String name = vmData.getName(); - final String processorCount = Integer.toString(vmData.getProcessorCount()); - final String memoryUnit = vmData.getMemory().getUnit(); - final int memoryValue = ((Double)(vmData.getMemory().getValue())).intValue(); - final Set tags = vmData.getTags(); - final String description = vmData.getDescription(); - final LayoutRequest layout = vmData.getLayout(); - final String poweredOn = Boolean.toString(vmData.isPoweredOn()); - final NamedResource template = vmData.getTemplate(); - - XMLBuilder builder = XMLBuilder.create("CreateVirtualMachine").a("name",name) - .e("ProcessorCount").t(processorCount).up() - .e("Memory").e("Unit").t(memoryUnit).up() - .e("Value").t(Integer.toString(memoryValue)).up().up(); - builder = layout(builder,layout); - builder.e("Description").t(description).up(); - builder = tags(builder,tags); - builder = linuxCustomization(builder, vmData); - builder = windowsCustomization(builder, vmData); - builder.e("PoweredOn").t(poweredOn).up() - .e("Template").a("href",template.getHref().toString()) - .a("type", template.getType()).up(); - - return builder.asString(outputProperties); - } catch (ParserConfigurationException e) { - throw new RuntimeException(e); - } catch (TransformerException t) { - throw new RuntimeException(t); - } - } - - private XMLBuilder layout(XMLBuilder in, LayoutRequest layout) { - in = in.e("Layout"); - if(layout.getGroup()!=null) { - in = in.e("Group").a("href",layout.getGroup().getHref().toString()) - .a("type",layout.getGroup().getType()).up(); - } else if (layout.getRow()!=null) { - checkNotNull(layout.getNewGroup(),"newGroup"); - in = in.e("Row").a("href",layout.getRow().getHref().toString()) - .a("type", layout.getRow().getType()).up() - .e("NewGroup").t(layout.getNewGroup()).up(); - } else { - checkNotNull(layout.getNewRow(),"newRow"); - checkNotNull(layout.getNewGroup(), "newGroup"); - in = in.e("NewRow").t(layout.getNewRow()).up() - .e("NewGroup").t(layout.getNewGroup()).up(); - } - return in.up(); - } - - private XMLBuilder tags(XMLBuilder in, Set tags ) { - checkNotNull(tags,"tags"); - in = in.e("Tags"); - for(String tag: tags) { - in = in.e("Tag").t(tag).up(); - } - return in.up(); - } - - private XMLBuilder linuxCustomization(XMLBuilder in, CreateVirtualMachine vmData) { - LinuxCustomization linuxCustomization = vmData.getLinuxCustomization(); - if(linuxCustomization==null) return in; - if(vmData.getWindowsCustomization()!=null) throw new IllegalStateException("Cannot have linux and windows customizations"); - - in = in.e("LinuxCustomization") - .e("NetworkSettings") - .e("NetworkAdapterSettings"); - - for(NetworkAdapterSetting setting:linuxCustomization.getNetworkSettings().getNetworkAdapterSettings().getNetworkAdapterSettings()) { - in = networkAdapterSetting(in,setting); - } - - in = in.up(); - in = dnsSettings(in, linuxCustomization.getNetworkSettings().getDnsSettings()); - - String href = linuxCustomization.getSshKey().getHref().toString(); - String type = linuxCustomization.getSshKey().getType(); - return in.up().e("SshKey").a("href",href).a("type",type).up().up(); - } - - private XMLBuilder networkAdapterSetting(XMLBuilder builder, NetworkAdapterSetting setting) { - String href = setting.getNetwork().getHref().toString(); - String name = setting.getNetwork().getName(); - String type = setting.getNetwork().getType(); - builder.e("NetworkAdapter") - .e("Network").a("href",href).a("name",name).a("type",type).up() - .e("IpAddress").t(setting.getIpAddress()).up(); - return builder; - } - - private XMLBuilder dnsSettings(XMLBuilder in, DnsSettings dnsSettings) { - if(dnsSettings==null)return in; - final String primary = dnsSettings.getPrimaryDns(); - final String secondary = dnsSettings.getSecondaryDns(); - - in = in.e("DnsSettings").e("PrimaryDns").t(primary).up(); - if(secondary!=null && !secondary.isEmpty()) { - in = in.e("SecondaryDns").t(secondary).up(); - } - return in.up(); - } - - private XMLBuilder windowsCustomization(XMLBuilder builder, CreateVirtualMachine vmData) { - WindowsCustomization windowsCustomization = vmData.getWindowsCustomization(); - if(windowsCustomization==null) return builder; - if(vmData.getLinuxCustomization()!=null) throw new IllegalStateException("Cannot have linux and windows customizations"); - - //TODO: Not implemented yet - throw new UnsupportedOperationException("windowsCustomization has not been implemented yet"); - //return builder; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindDateToQueryParam.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindDateToQueryParam.java deleted file mode 100644 index 7278fe4183..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindDateToQueryParam.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.tmrk.enterprisecloud.binders; - -import org.jclouds.date.DateService; -import org.jclouds.date.internal.SimpleDateFormatDateService; -import org.jclouds.http.HttpRequest; -import org.jclouds.http.utils.ModifyRequest; -import org.jclouds.rest.Binder; - -import javax.inject.Provider; -import javax.ws.rs.core.UriBuilder; -import java.util.Date; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * @author Jason King - */ -abstract class BindDateToQueryParam implements Binder { - - private final Provider uriBuilderProvider; - private final DateService dateService; - private final String key; - - public BindDateToQueryParam(Provider uriBuilderProvider, String key) { - this.uriBuilderProvider = checkNotNull(uriBuilderProvider, "uriBuilderProvider"); - this.dateService = new SimpleDateFormatDateService(); - this.key = key; - } - - @Override - public R bindToRequest(R request, Object input) { - if(input==null) return request; - Date date = Date.class.cast(input); - String dateString = dateService.iso8601SecondsDateFormat(date); - return ModifyRequest.addQueryParam(request, key, dateString, uriBuilderProvider.get()); - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindEndTimeQueryParam.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindEndTimeQueryParam.java deleted file mode 100644 index 069a599dd1..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindEndTimeQueryParam.java +++ /dev/null @@ -1,36 +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.tmrk.enterprisecloud.binders; - -import javax.inject.Inject; -import javax.inject.Provider; -import javax.inject.Singleton; -import javax.ws.rs.core.UriBuilder; - -/** - * @author Jason King - */ -@Singleton -public class BindEndTimeQueryParam extends BindDateToQueryParam { - - @Inject - public BindEndTimeQueryParam(Provider uriBuilderProvider) { - super(uriBuilderProvider,"endtime"); - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindInternetServiceToXmlPayload.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindInternetServiceToXmlPayload.java deleted file mode 100644 index eaa3be8131..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindInternetServiceToXmlPayload.java +++ /dev/null @@ -1,144 +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.tmrk.enterprisecloud.binders; - -import com.jamesmurty.utils.XMLBuilder; -import org.jclouds.http.HttpRequest; -import org.jclouds.rest.Binder; -import org.jclouds.rest.binders.BindToStringPayload; -import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.service.Protocol; -import org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService; -import org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetServicePersistenceType; - -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; -import java.util.Properties; - -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * For use with {@see org.jclouds.tmrk.enterprisecloud.features.InternetServiceClient#editInternetService} - * @author Jason King - */ -@Singleton -public class BindInternetServiceToXmlPayload implements Binder { - - private final BindToStringPayload stringBinder; - private final String rootElement; - - @Inject - BindInternetServiceToXmlPayload(BindToStringPayload stringBinder) { - this(stringBinder,"InternetService"); - } - - protected BindInternetServiceToXmlPayload(BindToStringPayload stringBinder, String rootElement) { - this.stringBinder = stringBinder; - this.rootElement = rootElement; - } - - @Override - public R bindToRequest(R request, Object key) { - checkArgument(checkNotNull(key, "key") instanceof InternetService, "this binder is only valid for InternetService instances"); - checkNotNull(request, "request"); - InternetService data = InternetService.class.cast(key); - - String payload = createXMLPayload(data); - return stringBinder.bindToRequest(request, payload); - } - - private String createXMLPayload(InternetService data) { - try { - Properties outputProperties = new Properties(); - outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes"); - - final String name = checkNotNull(data.getName(), "name"); - final Protocol protocol = data.getProtocol(); - final int port = data.getPort(); - final String enabled = Boolean.toString(data.isEnabled()); - final String description = data.getDescription(); - final InternetServicePersistenceType persistence = data.getPersistence(); - final String redirectUrl = data.getRedirectUrl(); - final NamedResource trustedNetworkGroup = data.getTrustedNetworkGroup(); - final NamedResource backupInternetService = data.getBackupInternetService(); - - XMLBuilder builder = XMLBuilder.create(rootElement).a("name", name); - - if(protocol!=null) { - builder = builder.e("Protocol").t(protocol.value()).up(); - } - - if(port>0) { - builder = builder.e("Port").t(Integer.toString(port)).up(); - } - - builder = builder.e("Enabled").t(enabled).up(); - - if(description!=null) { - builder = builder.e("Description").t(description).up(); - } - //TODO: Public IP - builder = persistence(builder,persistence); - - if(redirectUrl!=null) { - builder = builder.e("RedirectUrl").t(redirectUrl); - } - - //TODO: Monitor - - if(trustedNetworkGroup!=null) { - final String href = trustedNetworkGroup.getHref().toString(); - String groupName = trustedNetworkGroup.getName(); - String type = trustedNetworkGroup.getType(); - builder = builder.e("TrustedNetworkGroup").a("href",href).a("name",groupName).a("type", type).up(); - } - - if(backupInternetService!=null) { - final String href = backupInternetService.getHref().toString(); - String groupName = backupInternetService.getName(); - String type = backupInternetService.getType(); - builder = builder.e("BackupInternetService").a("href",href).a("name",groupName).a("type",type).up(); - } - - //TODO: NodeServices - - return builder.asString(outputProperties); - } catch (ParserConfigurationException e) { - throw new RuntimeException(e); - } catch (TransformerException t) { - throw new RuntimeException(t); - } - } - - private XMLBuilder persistence(XMLBuilder in, InternetServicePersistenceType persistenceType) { - checkNotNull(persistenceType,"persistenceType"); - - final InternetServicePersistenceType.PersistenceType type = persistenceType.getPersistenceType(); - final int timeout = persistenceType.getTimeout(); - - in = in.e("Persistence").e("Type").t(type.value()).up(); - if(!type.equals(InternetServicePersistenceType.PersistenceType.NONE) && timeout > -1 ) { - in = in.e("Timeout").t(Integer.toString(timeout)).up(); - } - return in.up(); - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindSSHKeyToXmlPayload.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindSSHKeyToXmlPayload.java deleted file mode 100644 index 1720c1cad1..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindSSHKeyToXmlPayload.java +++ /dev/null @@ -1,78 +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.tmrk.enterprisecloud.binders; - -import com.jamesmurty.utils.XMLBuilder; -import org.jclouds.http.HttpRequest; -import org.jclouds.rest.Binder; -import org.jclouds.rest.binders.BindToStringPayload; -import org.jclouds.tmrk.enterprisecloud.domain.keys.SSHKey; - -import javax.inject.Inject; -import javax.inject.Singleton; -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerException; -import java.util.Properties; - -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - */ -@Singleton -public class BindSSHKeyToXmlPayload implements Binder { - - private final BindToStringPayload stringBinder; - - @Inject - BindSSHKeyToXmlPayload(BindToStringPayload stringBinder) { - this.stringBinder = stringBinder; - } - - @Override - public R bindToRequest(R request, Object key) { - checkArgument(checkNotNull(key, "key") instanceof SSHKey, "this binder is only valid for SSHKey instances!"); - checkNotNull(request, "request"); - SSHKey sshKey = SSHKey.class.cast(key); - - String name = sshKey.getName(); - String isDefault = Boolean.toString(sshKey.isDefaultKey()); - String fingerPrint = sshKey.getFingerPrint(); - - String payload = createXMLPayload(name,isDefault,fingerPrint); - return stringBinder.bindToRequest(request, payload); - } - - private String createXMLPayload(String name, String isDefault, String fingerPrint) { - try { - Properties outputProperties = new Properties(); - outputProperties.put(javax.xml.transform.OutputKeys.OMIT_XML_DECLARATION, "yes"); - return XMLBuilder.create("SshKey").a("name",name) - .e("Default").t(isDefault).up() - .e("FingerPrint").t(fingerPrint) - .asString(outputProperties); - } catch (ParserConfigurationException e) { - throw new RuntimeException(e); - } catch (TransformerException t) { - throw new RuntimeException(t); - } - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindStartTimeQueryParam.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindStartTimeQueryParam.java deleted file mode 100644 index 55e06f4c06..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/binders/BindStartTimeQueryParam.java +++ /dev/null @@ -1,36 +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.tmrk.enterprisecloud.binders; - -import javax.inject.Inject; -import javax.inject.Provider; -import javax.inject.Singleton; -import javax.ws.rs.core.UriBuilder; - -/** - * @author Jason King - */ -@Singleton -public class BindStartTimeQueryParam extends BindDateToQueryParam { - - @Inject - public BindStartTimeQueryParam(Provider uriBuilderProvider) { - super(uriBuilderProvider,"starttime"); - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/config/TerremarkEnterpriseCloudRestClientModule.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/config/TerremarkEnterpriseCloudRestClientModule.java deleted file mode 100644 index 5cd1fc1307..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/config/TerremarkEnterpriseCloudRestClientModule.java +++ /dev/null @@ -1,80 +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.tmrk.enterprisecloud.config; - -import com.google.common.collect.ImmutableMap; -import org.jclouds.http.HttpErrorHandler; -import org.jclouds.http.HttpRetryHandler; -import org.jclouds.http.RequiresHttp; -import org.jclouds.http.annotation.ClientError; -import org.jclouds.http.annotation.Redirection; -import org.jclouds.http.annotation.ServerError; -import org.jclouds.http.handlers.BackoffLimitedRetryHandler; -import org.jclouds.rest.ConfiguresRestClient; -import org.jclouds.rest.config.RestClientModule; -import org.jclouds.tmrk.enterprisecloud.TerremarkEnterpriseCloudAsyncClient; -import org.jclouds.tmrk.enterprisecloud.TerremarkEnterpriseCloudClient; -import org.jclouds.tmrk.enterprisecloud.features.*; -import org.jclouds.tmrk.enterprisecloud.handlers.TerremarkEnterpriseCloudErrorHandler; - -import java.util.Map; - -/** - * Configures the TerremarkEnterpriseCloud connection. - * - * @author Adrian Cole - */ -@RequiresHttp -@ConfiguresRestClient -public class TerremarkEnterpriseCloudRestClientModule extends - RestClientModule { - - public static final Map, Class> DELEGATE_MAP = ImmutableMap., Class> builder() - .put(InternetServiceClient.class, InternetServiceAsyncClient.class) - .put(LayoutClient.class, LayoutAsyncClient.class) - .put(LocationClient.class, LocationAsyncClient.class) - .put(NetworkClient.class, NetworkAsyncClient.class) - .put(ResourceClient.class, ResourceAsyncClient.class) - .put(TaskClient.class, TaskAsyncClient.class) - .put(SSHKeyClient.class, SSHKeyAsyncClient.class) - .put(VirtualMachineClient.class, VirtualMachineAsyncClient.class) - .put(TemplateClient.class, TemplateAsyncClient.class) - .build(); - - public TerremarkEnterpriseCloudRestClientModule() { - super(TerremarkEnterpriseCloudClient.class, TerremarkEnterpriseCloudAsyncClient.class, DELEGATE_MAP); - } - - @Override - protected void configure() { - super.configure(); - } - - @Override - protected void bindErrorHandlers() { - bind(HttpErrorHandler.class).annotatedWith(Redirection.class).to(TerremarkEnterpriseCloudErrorHandler.class); - bind(HttpErrorHandler.class).annotatedWith(ClientError.class).to(TerremarkEnterpriseCloudErrorHandler.class); - bind(HttpErrorHandler.class).annotatedWith(ServerError.class).to(TerremarkEnterpriseCloudErrorHandler.class); - } - - @Override - protected void bindRetryHandlers() { - bind(HttpRetryHandler.class).annotatedWith(ClientError.class).to(BackoffLimitedRetryHandler.class); - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Action.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Action.java deleted file mode 100644 index 0e7defe390..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Action.java +++ /dev/null @@ -1,218 +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.tmrk.enterprisecloud.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseNamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import java.net.URI; -import java.util.Map; - -import static com.google.common.base.CaseFormat.LOWER_CAMEL; -import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE; -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Adrian Cole - * - */ -public class Action extends BaseNamedResource { - @XmlEnum - public static enum ActionDisabled { - /** - * The actionDisabled attribute will have a value of noAccess when a user - * does not have permission to perform the action. For example, for a user - * with read-only access, all actions have actionDisabled="noAccess" set. - */ - @XmlEnumValue("noAccess") - NO_ACCESS, - /** - * The attribute will have a value of disabled when the action is contrary - * to business rules. For example, the action virtual machine with - * name="power:powerOff" has actionDisabled="disabled" when the virtual - * machine is currently powered off; a virtual machine, which is currently - * off, may not be powered off; it may only be powered on. If both - * conditions apply, actions have actionDisabled="noAccess" set. If - * neither condition applies, the attribute will not appear. - */ - @XmlEnumValue("disabled") - DISABLED, - /** - * ActionDisabled was not parsed by jclouds. - */ - UNRECOGNIZED; - - public String value() { - return UPPER_UNDERSCORE.to(LOWER_CAMEL, name()); - } - - @Override - public String toString() { - return value(); - } - - public static ActionDisabled fromValue(String actionDisabled) { - try { - return valueOf(LOWER_CAMEL.to(UPPER_UNDERSCORE, checkNotNull(actionDisabled, "actionDisabled"))); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromAction(this); - } - - public static class Builder extends BaseNamedResource.Builder { - - protected ActionDisabled actionDisabled; - - /** - * @see Action#getActionDisabled - */ - public Builder actionDisabled(ActionDisabled actionDisabled) { - this.actionDisabled = actionDisabled; - return this; - } - - @Override - public Action build() { - return new Action(href, type, name, actionDisabled); - } - - public Builder fromAction(Action in) { - return fromNamedResource(in).actionDisabled(in.getActionDisabled()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromNamedResource(BaseNamedResource in) { - return Builder.class.cast(super.fromNamedResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - super.fromAttributes(attributes); - if (attributes.containsKey("actionDisabled")) - actionDisabled(ActionDisabled.fromValue(attributes.get("actionDisabled"))); - return this; - } - - } - - @XmlAttribute - protected ActionDisabled actionDisabled; - - private Action(URI href, String type, String name, @Nullable ActionDisabled actionDisabled) { - super(href, type, name); - this.actionDisabled = actionDisabled; - } - - private Action() { - //For JAXB - } - - /** - * The attribute actionDisabled appears only when the example has an action - * disabled for business rules. - * - * @return - */ - @Nullable - public ActionDisabled getActionDisabled() { - return actionDisabled; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - Action action = (Action) o; - - if (actionDisabled != action.actionDisabled) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (actionDisabled != null ? actionDisabled.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", actionDisabled="+actionDisabled; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Actions.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Actions.java deleted file mode 100644 index 64ae9c5125..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Actions.java +++ /dev/null @@ -1,106 +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.tmrk.enterprisecloud.domain; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual Action elements. - * Needed because parsing is done with JAXB and it does not handle Generic collections - * @author Jason King - */ -public class Actions { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromActions(this); - } - - public static class Builder { - - private Set actions = Sets.newLinkedHashSet(); - - /** - * @see Actions#getActions - */ - public Builder actions(Set actions) { - this.actions = Sets.newLinkedHashSet(checkNotNull(actions, "actions")); - return this; - } - - public Builder addAction(Action action) { - actions.add(checkNotNull(action,"action")); - return this; - } - - public Actions build() { - return new Actions(actions); - } - - public Builder fromActions(Actions in) { - return actions(in.getActions()); - } - } - - private Actions() { - //For JAXB and builder use - } - - private Actions(Set actions) { - this.actions = Sets.newLinkedHashSet(actions); - } - - @XmlElement(name = "Action") - private Set actions = Sets.newLinkedHashSet(); - - public Set getActions() { - return Collections.unmodifiableSet(actions); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Actions actions1 = (Actions) o; - - if (!actions.equals(actions1.actions)) return false; - - return true; - } - - @Override - public int hashCode() { - return actions.hashCode(); - } - - public String toString() { - return "["+ actions.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/ConfigurationOptionRange.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/ConfigurationOptionRange.java deleted file mode 100644 index 8f21f44b8d..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/ConfigurationOptionRange.java +++ /dev/null @@ -1,134 +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.tmrk.enterprisecloud.domain; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class ConfigurationOptionRange { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromConfigurationOptionRange(this); - } - - public static class Builder { - - private int minimum; - private int maximum; - private int stepFactor; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.ConfigurationOptionRange#getMinimum - */ - public Builder minimum(int minimum) { - this.minimum = minimum; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.ConfigurationOptionRange#getMaximum - */ - public Builder maximum(int maximum) { - this.maximum = maximum; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.ConfigurationOptionRange#getStepFactor - */ - public Builder stepFactor(int stepFactor) { - this.stepFactor = stepFactor; - return this; - } - - public ConfigurationOptionRange build() { - return new ConfigurationOptionRange(minimum, maximum,stepFactor); - } - - public Builder fromConfigurationOptionRange(ConfigurationOptionRange in) { - return minimum(in.getMinimum()).maximum(in.getMaximum()).stepFactor(in.getStepFactor()); - } - } - - @XmlElement(name = "Minimum") - private int minimum; - - @XmlElement(name = "Maximum") - private int maximum; - - @XmlElement(name = "StepFactor") - private int stepFactor; - - private ConfigurationOptionRange(int minimum, int maximum, int stepFactor) { - this.minimum = minimum; - this.maximum = maximum; - this.stepFactor = stepFactor; - } - - private ConfigurationOptionRange() { - //For JAXB - } - - public int getMinimum() { - return minimum; - } - - public int getMaximum() { - return maximum; - } - - public int getStepFactor() { - return stepFactor; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ConfigurationOptionRange that = (ConfigurationOptionRange) o; - - if (maximum != that.maximum) return false; - if (minimum != that.minimum) return false; - if (stepFactor != that.stepFactor) return false; - - return true; - } - - @Override - public int hashCode() { - int result = minimum; - result = 31 * result + maximum; - result = 31 * result + stepFactor; - return result; - } - - @Override - public String toString() { - return "[minimum="+ minimum +", maximum="+ maximum +", stepFactor="+stepFactor+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/CustomizationOption.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/CustomizationOption.java deleted file mode 100644 index 2077cf8cdb..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/CustomizationOption.java +++ /dev/null @@ -1,167 +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.tmrk.enterprisecloud.domain; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - */ -public class CustomizationOption { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromConfigurationOptionRange(this); - } - - public static class Builder { - - private CustomizationType type; - private boolean canPowerOn; - private boolean passwordRequired; - private boolean sshKeyRequired; - - /** - * @see CustomizationOption#getType - */ - public Builder type(CustomizationType type) { - this.type = type; - return this; - } - - /** - * @see CustomizationOption#canPowerOn - */ - public Builder canPowerOn(boolean canPowerOn) { - this.canPowerOn = canPowerOn; - return this; - } - - /** - * @see CustomizationOption#isPasswordRequired() - */ - public Builder passwordRequired(boolean passwordRequired) { - this.passwordRequired = passwordRequired; - return this; - } - - /** - * @see CustomizationOption#isSshKeyRequired() - */ - public Builder sshKeyRequired(boolean sshKeyRequired) { - this.sshKeyRequired = sshKeyRequired; - return this; - } - - public CustomizationOption build() { - return new CustomizationOption(type, canPowerOn, passwordRequired,sshKeyRequired); - } - - public Builder fromConfigurationOptionRange(CustomizationOption in) { - return type(in.getType()).canPowerOn(in.canPowerOn()).passwordRequired(in.isPasswordRequired()).sshKeyRequired(in.isSshKeyRequired()); - } - } - - @XmlElement(name = "Type") - private CustomizationType type; - - @XmlElement(name = "CanPowerOn") - private boolean canPowerOn; - - @XmlElement(name = "PasswordRequired") - private boolean passwordRequired; - - @XmlElement(name = "SshKeyRequired") - private boolean sshKeyRequired; - - private CustomizationOption(CustomizationType type, boolean canPowerOn, boolean passwordRequired, boolean sshKeyRequired) { - this.type = checkNotNull(type,"type"); - this.canPowerOn = canPowerOn; - this.passwordRequired = passwordRequired; - this.sshKeyRequired = sshKeyRequired; - } - - private CustomizationOption() { - //For JAXB - } - - public CustomizationType getType() { - return type; - } - - public boolean canPowerOn() { - return canPowerOn; - } - - public boolean isPasswordRequired() { - return passwordRequired; - } - - public boolean isSshKeyRequired() { - return sshKeyRequired; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - CustomizationOption that = (CustomizationOption) o; - - if (canPowerOn != that.canPowerOn) return false; - if (passwordRequired != that.passwordRequired) return false; - if (sshKeyRequired != that.sshKeyRequired) return false; - if (type != that.type) return false; - - return true; - } - - @Override - public int hashCode() { - int result = type.hashCode(); - result = 31 * result + (canPowerOn ? 1 : 0); - result = 31 * result + (passwordRequired ? 1 : 0); - result = 31 * result + (sshKeyRequired ? 1 : 0); - return result; - } - - @Override - public String toString() { - return "[type="+type+", canPowerOn="+ canPowerOn +", passwordRequired="+ passwordRequired +", sshKeyRequired="+sshKeyRequired+"]"; - } - - @XmlEnum - public enum CustomizationType { - @XmlEnumValue("Linux") - LINUX, - - @XmlEnumValue("Windows") - WINDOWS; - } - -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Link.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Link.java deleted file mode 100644 index f9a47b4037..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Link.java +++ /dev/null @@ -1,231 +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.tmrk.enterprisecloud.domain; - -import com.google.common.collect.Sets; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseNamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Adrian Cole - * - */ -public class Link extends BaseNamedResource { - @XmlEnum - public static enum Relationship { - /** - * The entity in the link owns the entity in the response - */ - @XmlEnumValue("up") - UP, - /** - * The entity in the response owns the entity in the link - */ - @XmlEnumValue("down") - DOWN, - /** - * The entity in the link is an alternate view of the entity in the - * response - */ - @XmlEnumValue("alternate") - ALTERNATE, - /** - * The link is a path to the first page in the pages of responses - */ - @XmlEnumValue("first") - FIRST, - /** - * The link is a path to the previous page in the pages of responses - */ - @XmlEnumValue("previous") - PREVIOUS, - /** - * The link is a path to the next page in the pages of responses - */ - @XmlEnumValue("next") - NEXT, - /** - * The link is a path to the last page in the pages of responses - */ - @XmlEnumValue("last") - LAST, - /** - * Relationship was not parsed by jclouds. - */ - UNRECOGNIZED; - - public String value() { - return name().toLowerCase(); - } - - @Override - public String toString() { - return value(); - } - - public static Relationship fromValue(String rel) { - try { - return valueOf(checkNotNull(rel, "rel").toUpperCase()); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromLink(this); - } - - public static class Builder extends BaseNamedResource.Builder { - - protected Relationship rel; - - /** - * @see Link#getRelationship - */ - public Builder rel(Relationship rel) { - this.rel = rel; - return this; - } - - @Override - public Link build() { - return new Link(href, type, name, rel); - } - - public Builder fromLink(Link in) { - return fromNamedResource(in).rel(in.getRelationship()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromNamedResource(BaseNamedResource in) { - return Builder.class.cast(super.fromNamedResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - super.fromAttributes(attributes); - if (attributes.containsKey("rel")) - rel(Relationship.fromValue(attributes.get("rel"))); - return this; - } - } - - @XmlAttribute - protected Relationship rel; - - private Link(URI href, String type, String name, Relationship rel) { - super(href, type, name); - this.rel = checkNotNull(rel, "rel"); - } - - private Link() { - //For JAXB - } - - /** - * - * @return - */ - public Relationship getRelationship() { - return rel; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - Link link = (Link) o; - - if (rel != link.rel) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + rel.hashCode(); - return result; - } - - @Override - public String string() { - return super.string()+", rel="+rel; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Links.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Links.java deleted file mode 100644 index f3b41f82b3..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Links.java +++ /dev/null @@ -1,108 +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.tmrk.enterprisecloud.domain; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual Link elements. - * Needed because parsing is done with JAXB and it does not handle Generic collections - * @author Jason King - */ -public class Links { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromLinks(this); - } - - public static class Builder { - - private Set links = Sets.newLinkedHashSet(); - - /** - * @see Links#getLinks - */ - public Builder links(Set links) { - this.links = Sets.newLinkedHashSet(checkNotNull(links, "links")); - return this; - } - - public Builder addLink(Link link) { - links.add(checkNotNull(link,"link")); - return this; - } - - public Links build() { - return new Links(links); - } - - public Builder fromLinks(Links in) { - return links(in.getLinks()); - } - } - - @XmlElement(name = "Link") - private LinkedHashSet links = Sets.newLinkedHashSet(); - - private Links() { - //For JAXB - } - - private Links(Set links) { - this.links = Sets.newLinkedHashSet(links); - } - - public Set getLinks() { - return Collections.unmodifiableSet(links); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Links links1 = (Links) o; - - if (!links.equals(links1.links)) return false; - - return true; - } - - @Override - public int hashCode() { - return links.hashCode(); - } - - public String toString() { - return "["+ links.toString()+"]"; - } - -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Location.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Location.java deleted file mode 100644 index efd74602eb..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Location.java +++ /dev/null @@ -1,221 +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.tmrk.enterprisecloud.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -/** - * - * @author Jason King - * - */ -@XmlRootElement(name = "Location") -public class Location extends Resource { - - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromLocation(this); - } - - public static class Builder extends Resource.Builder { - private String friendlyName; - private String locode; - private String iso3166; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.Location#getFriendlyName - */ - public Builder friendlyName(String friendlyName) { - this.friendlyName = friendlyName; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.Location#getLocode - */ - public Builder locode(String locode) { - this.locode = locode; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.Location#getIso3166 - */ - public Builder iso3166(String iso3166) { - this.iso3166 = iso3166; - return this; - } - - @Override - public Location build() { - return new Location(href, type, name, links, - actions, friendlyName, locode, iso3166); - } - - public Builder fromLocation(Location in) { - return fromResource(in).friendlyName(in.getFriendlyName()).locode(in.getLocode()).iso3166(in.getIso3166()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "FriendlyName", required = true) - private String friendlyName; - - @XmlElement(name = "Locode", required = false) - private String locode; - - @XmlElement(name = "ISO3166", required = false) - private String iso3166; - - private Location(URI href, String type, String name, Set links, Set actions, @Nullable String friendlyName, @Nullable String locode, @Nullable String iso3166) { - super(href, type, name, links, actions); - this.friendlyName = friendlyName; - this.locode = locode; - this.iso3166 = iso3166; - } - - private Location() { - //For JAXB - } - - public String getFriendlyName() { - return friendlyName; - } - - public String getLocode() { - return locode; - } - - public String getIso3166() { - return iso3166; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - Location location = (Location) o; - - if (friendlyName != null ? !friendlyName.equals(location.friendlyName) : location.friendlyName != null) - return false; - if (iso3166 != null ? !iso3166.equals(location.iso3166) : location.iso3166 != null) - return false; - if (locode != null ? !locode.equals(location.locode) : location.locode != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (friendlyName != null ? friendlyName.hashCode() : 0); - result = 31 * result + (locode != null ? locode.hashCode() : 0); - result = 31 * result + (iso3166 != null ? iso3166.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", friendlyName="+friendlyName+", locode="+locode+", iso3166="+iso3166; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/NamedResource.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/NamedResource.java deleted file mode 100644 index 1365f5fb67..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/NamedResource.java +++ /dev/null @@ -1,115 +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.tmrk.enterprisecloud.domain; - -import java.net.URI; -import java.util.Map; -import java.util.Set; - -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseNamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; - -/** - * - * @author Adrian Cole - * - */ -public class NamedResource extends BaseNamedResource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromNamedResource(this); - } - - public static class Builder extends BaseNamedResource.Builder { - - /** - * {@inheritDoc} - */ - @Override - public NamedResource build() { - return new NamedResource(href, type, name); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromNamedResource(BaseNamedResource in) { - return Builder.class.cast(super.fromNamedResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map in) { - return Builder.class.cast(super.fromAttributes(in)); - } - - } - - private NamedResource(URI href, String type, String name) { - super(href, type, name); - } - - protected NamedResource() { - //For JAXB - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/ResourceCapacityRange.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/ResourceCapacityRange.java deleted file mode 100644 index 1515cd8426..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/ResourceCapacityRange.java +++ /dev/null @@ -1,140 +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.tmrk.enterprisecloud.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class ResourceCapacityRange { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromResourceCapacityRange(this); - } - - public static class Builder { - - private ResourceCapacity minimumSize; - private ResourceCapacity maximumSize; - private ResourceCapacity stepFactor; - - /** - * @see ResourceCapacityRange#getMinimumSize - */ - public Builder minimumSize(ResourceCapacity minimumSize) { - this.minimumSize = minimumSize; - return this; - } - - /** - * @see ResourceCapacityRange#getMaximumSize - */ - public Builder maximumSize(ResourceCapacity maximumSize) { - this.maximumSize = maximumSize; - return this; - } - - /** - * @see ResourceCapacityRange#getStepFactor - */ - public Builder stepFactor(ResourceCapacity stepFactor) { - this.stepFactor = stepFactor; - return this; - } - - public ResourceCapacityRange build() { - return new ResourceCapacityRange(minimumSize,maximumSize,stepFactor); - } - - public Builder fromResourceCapacityRange(ResourceCapacityRange in) { - return minimumSize(in.getMinimumSize()).maximumSize(in.getMaximumSize()).stepFactor(in.getStepFactor()); - } - } - - @XmlElement(name = "MinimumSize", required = false) - private ResourceCapacity minimumSize; - - @XmlElement(name = "MaximumSize", required = false) - private ResourceCapacity maximumSize; - - @XmlElement(name = "StepFactor", required = false) - private ResourceCapacity stepFactor; - - private ResourceCapacityRange(@Nullable ResourceCapacity minimumSize, @Nullable ResourceCapacity maximumSize, @Nullable ResourceCapacity stepFactor) { - this.minimumSize = minimumSize; - this.maximumSize = maximumSize; - this.stepFactor = stepFactor; - } - - private ResourceCapacityRange() { - //For JAXB - } - - public ResourceCapacity getMinimumSize() { - return minimumSize; - } - - public ResourceCapacity getMaximumSize() { - return maximumSize; - } - - public ResourceCapacity getStepFactor() { - return stepFactor; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ResourceCapacityRange that = (ResourceCapacityRange) o; - - if (maximumSize != null ? !maximumSize.equals(that.maximumSize) : that.maximumSize != null) - return false; - if (minimumSize != null ? !minimumSize.equals(that.minimumSize) : that.minimumSize != null) - return false; - if (stepFactor != null ? !stepFactor.equals(that.stepFactor) : that.stepFactor != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = minimumSize != null ? minimumSize.hashCode() : 0; - result = 31 * result + (maximumSize != null ? maximumSize.hashCode() : 0); - result = 31 * result + (stepFactor != null ? stepFactor.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "[minimumSize="+ minimumSize +", maximumSize="+maximumSize+", stepFactor="+stepFactor+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Task.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Task.java deleted file mode 100644 index 3cced5ef2f..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Task.java +++ /dev/null @@ -1,416 +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.tmrk.enterprisecloud.domain; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Date; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.CaseFormat.UPPER_CAMEL; -import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE; -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Adrian Cole - * - */ -@XmlRootElement(name = "Task") -public class Task extends Resource { - @XmlEnum - public static enum Status { - /** - * the task is queued for execution. - */ - @XmlEnumValue("Queued") - QUEUED, - /** - * the task is running. - */ - @XmlEnumValue("Running") - RUNNING, - /** - * the task failed. - */ - @XmlEnumValue("Failed") - FAILED, - /** - * the task completed successfully. - */ - @XmlEnumValue("Success") - SUCCESS, - /** - * the task completed successfully. - */ - @XmlEnumValue("Complete") - COMPLETE, - /** - * the task failed with an error. - */ - @XmlEnumValue("Error") - ERROR, - /** - * Status was not parsed by jclouds. - */ - UNRECOGNIZED; - - public String value() { - return UPPER_UNDERSCORE.to(UPPER_CAMEL, name()); - } - - @Override - public String toString() { - return value(); - } - - public static Status fromValue(String status) { - try { - return valueOf(UPPER_CAMEL.to(UPPER_UNDERSCORE, checkNotNull(status, "status"))); - } catch (IllegalArgumentException e) { - return UNRECOGNIZED; - } - } - } - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromTask(this); - } - - public static class Builder extends Resource.Builder { - //TODO There are additional fields - protected String operation; - protected Status status; - protected NamedResource impactedItem; - protected Date startTime; - protected Date completedTime; - protected String notes; - protected String errorMessage; - protected NamedResource initiatedBy; - - /** - * @see Task#getOperation - */ - public Builder operation(String operation) { - this.operation = operation; - return this; - } - - /** - * @see Task#getStatus - */ - public Builder status(Status status) { - this.status = status; - return this; - } - - /** - * @see Task#getImpactedItem - */ - public Builder impactedItem(NamedResource impactedItem) { - this.impactedItem = impactedItem; - return this; - } - - /** - * @see Task#getStartTime - */ - public Builder startTime(Date startTime) { - this.startTime = startTime; - return this; - } - - /** - * @see Task#getCompletedTime - */ - public Builder completedTime(Date completedTime) { - this.completedTime = completedTime; - return this; - } - - /** - * @see Task#getNotes - */ - public Builder notes(String notes) { - this.notes = notes; - return this; - } - - /** - * @see Task#getErrorMessage - */ - public Builder errorMessage(String errorMessage) { - this.errorMessage = errorMessage; - return this; - } - - /** - * @see Task#getInitiatedBy - */ - public Builder initiatedBy(NamedResource initiatedBy) { - this.initiatedBy = initiatedBy; - return this; - } - - @Override - public Task build() { - return new Task(href, type, name, links, - actions, operation, status, impactedItem, startTime, completedTime, notes, errorMessage, initiatedBy); - } - - public Builder fromTask(Task in) { - return fromResource(in).operation(in.getOperation()).status(in.getStatus()).impactedItem(in.getImpactedItem()) - .startTime(in.getStartTime()).completedTime(in.getCompletedTime()).notes(in.getNotes()) - .errorMessage(in.getErrorMessage()).initiatedBy(in.getInitiatedBy()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "Operation", required = true) - protected String operation; - - @XmlElement(name = "Status", required = true) - protected Status status; - - @XmlElement(name = "ImpactedItem", required = true) - protected NamedResource impactedItem; - - @XmlElement(name = "StartTime", required = true) - protected Date startTime; - - @XmlElement(name = "CompletedTime", required = false) - protected Date completedTime; - - @XmlElement(name = "Notes", required = false) - protected String notes; - - @XmlElement(name = "ErrorMessage", required = false) - protected String errorMessage; - - @XmlElement(name = "InitiatedBy", required = true) - protected NamedResource initiatedBy; - - private Task(URI href, String type, String name, Set links, Set actions, String operation, Status status, NamedResource impactedItem, Date startTime, - @Nullable Date completedTime, @Nullable String notes, @Nullable String errorMessage, NamedResource initiatedBy) { - super(href, type, name, links, actions); - this.operation = checkNotNull(operation, "operation"); - this.status = checkNotNull(status, "status"); - this.impactedItem = checkNotNull(impactedItem, "impactedItem"); - this.startTime = checkNotNull(startTime, "startTime"); - this.completedTime = completedTime;// null if Queued or Running - this.notes = notes; - this.errorMessage = errorMessage; - this.initiatedBy = checkNotNull(initiatedBy, "initiatedBy"); - } - - private Task() { - //For JAXB - } - - /** - * - * - * @return name of action performed - */ - public String getOperation() { - return operation; - } - - /** - * - * - * @return the status of the task - */ - public Status getStatus() { - return status; - } - - /** - * - * @return the item acted upon - */ - public NamedResource getImpactedItem() { - return impactedItem; - } - - /** - * - * @return time action started - */ - public Date getStartTime() { - return startTime; - } - - /** - * - * @return time action completed, or null if Queued or Running - */ - @Nullable - public Date getCompletedTime() { - return completedTime; - } - - /** - * @return notes on action - */ - public String getNotes() { - return notes; - } - - /** - * @return error message - */ - public String getErrorMessage() { - return errorMessage; - } - - /** - * - * @return the item acted upon - */ - public NamedResource getInitiatedBy() { - return initiatedBy; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - Task task = (Task) o; - - if (completedTime != null ? !completedTime.equals(task.completedTime) : task.completedTime != null) - return false; - if (errorMessage != null ? !errorMessage.equals(task.errorMessage) : task.errorMessage != null) - return false; - if (!impactedItem.equals(task.impactedItem)) return false; - if (!initiatedBy.equals(task.initiatedBy)) return false; - if (notes != null ? !notes.equals(task.notes) : task.notes != null) - return false; - if (!operation.equals(task.operation)) return false; - if (!startTime.equals(task.startTime)) return false; - if (status != task.status) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + operation.hashCode(); - result = 31 * result + status.hashCode(); - result = 31 * result + impactedItem.hashCode(); - result = 31 * result + startTime.hashCode(); - result = 31 * result + (completedTime != null ? completedTime.hashCode() : 0); - result = 31 * result + (notes != null ? notes.hashCode() : 0); - result = 31 * result + (errorMessage != null ? errorMessage.hashCode() : 0); - result = 31 * result + initiatedBy.hashCode(); - return result; - } - - @Override - public String string() { - return super.string()+", operation="+operation+", status="+status+ - ", impactedItem="+impactedItem+", startTime="+startTime+", completedTime="+completedTime+ - ", notes="+notes+", errorMessage="+errorMessage+", initiatedBy="+initiatedBy; - } - -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Tasks.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Tasks.java deleted file mode 100644 index f3d5224fe6..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/Tasks.java +++ /dev/null @@ -1,112 +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.tmrk.enterprisecloud.domain; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual Task elements. - * Needed because parsing is done with JAXB and it does not handle Generic collections - * - * @author Jason King - */ -@XmlRootElement(name = "Tasks") -public class Tasks { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromTasks(this); - } - - public static class Builder { - - private Set tasks = Sets.newLinkedHashSet(); - - /** - * @see Tasks#getTasks - */ - public Builder tasks(Set tasks) { - this.tasks = Sets.newLinkedHashSet(checkNotNull(tasks, "tasks")); - return this; - } - - public Builder addTask(Task task) { - tasks.add(checkNotNull(task,"task")); - return this; - } - - public Tasks build() { - return new Tasks(tasks); - } - - public Builder fromTasks(Tasks in) { - return tasks(in.getTasks()); - } - } - - private Tasks() { - //For JAXB and builder use - } - - private Tasks(Set tasks) { - this.tasks = Sets.newLinkedHashSet(tasks); - } - - //TODO: There is a total count field - - @XmlElement(name = "Task") - private LinkedHashSet tasks = Sets.newLinkedHashSet(); - - public Set getTasks() { - return Collections.unmodifiableSet(tasks); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Tasks tasks1 = (Tasks) o; - - if (!tasks.equals(tasks1.tasks)) return false; - - return true; - } - - @Override - public int hashCode() { - return tasks.hashCode(); - } - - public String toString() { - return "["+tasks.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/DiskConfigurationOption.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/DiskConfigurationOption.java deleted file mode 100644 index 365df574ca..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/DiskConfigurationOption.java +++ /dev/null @@ -1,156 +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.tmrk.enterprisecloud.domain.hardware; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class DiskConfigurationOption { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromConfigurationOptionRange(this); - } - - public static class Builder { - - private int minimum; - private int maximum; - private DiskConfigurationOptionRange systemDisk; - private DiskConfigurationOptionRange dataDisk; - - /** - * @see DiskConfigurationOption#getMinimum() - */ - public Builder minimum(int minimum) { - this.minimum = minimum; - return this; - } - - /** - * @see DiskConfigurationOption#getMaximum() - */ - public Builder maximum(int maximum) { - this.maximum = maximum; - return this; - } - - /** - * @see DiskConfigurationOption#getSystemDisk() - */ - public Builder systemDisk(DiskConfigurationOptionRange systemDisk) { - this.systemDisk = systemDisk; - return this; - } - - /** - * @see DiskConfigurationOption#getDataDisk() - */ - public Builder dataDisk(DiskConfigurationOptionRange dataDisk) { - this.dataDisk = dataDisk; - return this; - } - - public DiskConfigurationOption build() { - return new DiskConfigurationOption(minimum, maximum, systemDisk, dataDisk); - } - - public Builder fromConfigurationOptionRange(DiskConfigurationOption in) { - return minimum(in.getMinimum()).maximum(in.getMaximum()).systemDisk(in.getSystemDisk()).dataDisk(in.getDataDisk()); - } - } - - @XmlElement(name = "Minimum") - private int minimum; - - @XmlElement(name = "Maximum") - private int maximum; - - @XmlElement(name = "SystemDisk") - private DiskConfigurationOptionRange systemDisk; - - @XmlElement(name = "DataDisk") - private DiskConfigurationOptionRange dataDisk; - - private DiskConfigurationOption(int minimum, int maximum, DiskConfigurationOptionRange systemDisk, DiskConfigurationOptionRange dataDisk) { - this.minimum = minimum; - this.maximum = maximum; - this.systemDisk = systemDisk; - this.dataDisk = dataDisk; - } - - private DiskConfigurationOption() { - //For JAXB - } - - public int getMinimum() { - return minimum; - } - - public int getMaximum() { - return maximum; - } - - public DiskConfigurationOptionRange getSystemDisk() { - return systemDisk; - } - - public DiskConfigurationOptionRange getDataDisk() { - return dataDisk; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - DiskConfigurationOption that = (DiskConfigurationOption) o; - - if (maximum != that.maximum) return false; - if (minimum != that.minimum) return false; - if (dataDisk != null ? !dataDisk.equals(that.dataDisk) : that.dataDisk != null) - return false; - if (systemDisk != null ? !systemDisk.equals(that.systemDisk) : that.systemDisk != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = minimum; - result = 31 * result + maximum; - result = 31 * result + (systemDisk != null ? systemDisk.hashCode() : 0); - result = 31 * result + (dataDisk != null ? dataDisk.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "[minimum="+minimum+", maximum="+ maximum +", systemDisk="+ systemDisk +", dataDisk="+dataDisk+"]"; - } - -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/DiskConfigurationOptionRange.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/DiskConfigurationOptionRange.java deleted file mode 100644 index 4bfa1f5a63..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/DiskConfigurationOptionRange.java +++ /dev/null @@ -1,122 +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.tmrk.enterprisecloud.domain.hardware; - -import org.jclouds.tmrk.enterprisecloud.domain.ResourceCapacityRange; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class DiskConfigurationOptionRange { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromConfigurationOptionRange(this); - } - - public static class Builder { - - private ResourceCapacityRange resourceCapacityRange; - private double monthlyCost; - - /** - * @see DiskConfigurationOptionRange#getResourceCapacityRange - */ - public Builder resourceCapacityRange(ResourceCapacityRange resourceCapacityRange) { - this.resourceCapacityRange = resourceCapacityRange; - return this; - } - - /** - * @see DiskConfigurationOptionRange#getMonthlyCost() - */ - public Builder monthlyCost(double monthlyCost) { - this.monthlyCost = monthlyCost; - return this; - } - - - public DiskConfigurationOptionRange build() { - return new DiskConfigurationOptionRange(resourceCapacityRange, monthlyCost); - } - - public Builder fromConfigurationOptionRange(DiskConfigurationOptionRange in) { - return resourceCapacityRange(in.getResourceCapacityRange()).monthlyCost(in.getMonthlyCost()); - } - } - - @XmlElement(name = "ResourceCapacityRange") - private ResourceCapacityRange resourceCapacityRange; - - @XmlElement(name = "MonthlyCost") - private double monthlyCost; - - private DiskConfigurationOptionRange(ResourceCapacityRange resourceCapacityRange, double monthlyCost) { - this.resourceCapacityRange = resourceCapacityRange; - this.monthlyCost = monthlyCost; - } - - private DiskConfigurationOptionRange() { - //For JAXB - } - - public ResourceCapacityRange getResourceCapacityRange() { - return resourceCapacityRange; - } - - public double getMonthlyCost() { - return monthlyCost; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - DiskConfigurationOptionRange that = (DiskConfigurationOptionRange) o; - - if (Double.compare(that.monthlyCost, monthlyCost) != 0) return false; - if (resourceCapacityRange != null ? !resourceCapacityRange.equals(that.resourceCapacityRange) : that.resourceCapacityRange != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result; - long temp; - result = resourceCapacityRange != null ? resourceCapacityRange.hashCode() : 0; - temp = monthlyCost != +0.0d ? Double.doubleToLongBits(monthlyCost) : 0L; - result = 31 * result + (int) (temp ^ (temp >>> 32)); - return result; - } - - @Override - public String toString() { - return "[resourceCapacityRange="+resourceCapacityRange+", monthlyCost="+monthlyCost+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/Disks.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/Disks.java deleted file mode 100644 index 5e5f805ac9..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/Disks.java +++ /dev/null @@ -1,109 +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.tmrk.enterprisecloud.domain.hardware; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual Disk elements. - * Needed because parsing is done with JAXB and it does not handle Generic collections - * - * @author Jason King - */ -public class Disks { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromDisks(this); - } - - public static class Builder { - - private Set disks = Sets.newLinkedHashSet(); - - /** - * @see Disks#getVirtualDisks() - */ - public Builder disks(Set disks) { - this.disks = Sets.newLinkedHashSet(checkNotNull(disks, "disks")); - return this; - } - - public Builder addDisk(VirtualDisk disk) { - disks.add(checkNotNull(disk,"disk")); - return this; - } - - public Disks build() { - return new Disks(disks); - } - - public Builder fromDisks(Disks in) { - return disks(in.getVirtualDisks()); - } - } - - @XmlElement(name = "Disk") - private LinkedHashSet disks = Sets.newLinkedHashSet(); - - private Disks() { - //For JAXB and builder use - } - - private Disks(Set disks) { - this.disks = Sets.newLinkedHashSet(disks); - } - - public Set getVirtualDisks() { - return Collections.unmodifiableSet(disks); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Disks disks1 = (Disks) o; - - if (!disks.equals(disks1.disks)) return false; - - return true; - } - - @Override - public int hashCode() { - return disks.hashCode(); - } - - public String toString() { - return "["+ disks.toString()+"]"; - } - -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/HardwareConfiguration.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/HardwareConfiguration.java deleted file mode 100644 index cf5dc767cd..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/HardwareConfiguration.java +++ /dev/null @@ -1,249 +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.tmrk.enterprisecloud.domain.hardware; - -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; -import org.jclouds.tmrk.enterprisecloud.domain.network.Nics; -import org.jclouds.tmrk.enterprisecloud.domain.network.VirtualNic; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - */ -@XmlRootElement(name = "HardwareConfiguration") -public class HardwareConfiguration extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromHardwareConfiguration(this); - } - - public static class Builder extends Resource.Builder { - - private int processorCount; - private ResourceCapacity memory; - private Set virtualDisks = Sets.newLinkedHashSet(); - private Set virtualNics = Sets.newLinkedHashSet(); - - /** - * @see HardwareConfiguration#getProcessorCount - */ - public Builder processorCount(int processorCount) { - this.processorCount = processorCount; - return this; - } - - /** - * @see HardwareConfiguration#getMemory - */ - public Builder memory(ResourceCapacity memory) { - this.memory = memory; - return this; - } - - /** - * @see HardwareConfiguration#getVirtualDisks - */ - public Builder disks(Set virtualDisks) { - this.virtualDisks = ImmutableSet. copyOf(checkNotNull(virtualDisks, "virtualDisks")); - return this; - } - - - /** - * @see HardwareConfiguration#getVirtualNics - */ - public Builder nics(Set virtualNics) { - this.virtualNics = ImmutableSet. copyOf(checkNotNull(virtualNics, "virtualNics")); - return this; - } - - @Override - public HardwareConfiguration build() { - return new HardwareConfiguration(processorCount, memory, virtualDisks, virtualNics); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - public Builder fromHardwareConfiguration(HardwareConfiguration in) { - return fromResource(in).processorCount(in.getProcessorCount()) - .memory(in.getMemory()) - .disks(in.getVirtualDisks()) - .nics(in.getVirtualNics()); - } - } - - @XmlElement(name = "ProcessorCount", required = true) - private int processorCount; - - @XmlElement(name = "Memory", required = false) - private ResourceCapacity memory; - - @XmlElement(name = "Disks", required = false) - private Disks virtualDisks = Disks.builder().build(); - - @XmlElement(name = "Nics", required = false) - private Nics virtualNics = Nics.builder().build(); - - private HardwareConfiguration(int processorCount, @Nullable ResourceCapacity memory, Set virtualDisks, Set virtualNics) { - this.virtualDisks = Disks.builder().disks(checkNotNull(virtualDisks,"virtualDisks")).build(); - this.virtualNics = Nics.builder().nics(checkNotNull(virtualNics, "virtualNics")).build(); - this.processorCount = processorCount; - this.memory = memory; - } - - private HardwareConfiguration() { - //For JAXB - } - - public int getProcessorCount() { - return processorCount; - } - - public ResourceCapacity getMemory() { - return memory; - } - - public Set getVirtualDisks() { - return Collections.unmodifiableSet(virtualDisks.getVirtualDisks()); - } - - public Set getVirtualNics() { - return Collections.unmodifiableSet(virtualNics.getVirtualNics()); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - HardwareConfiguration that = (HardwareConfiguration) o; - - if (processorCount != that.processorCount) return false; - if (!virtualDisks.equals(that.virtualDisks)) return false; - if (memory != null ? !memory.equals(that.memory) : that.memory != null) - return false; - if (!virtualNics.equals(that.virtualNics)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + processorCount; - result = 31 * result + (memory != null ? memory.hashCode() : 0); - result = 31 * result + virtualDisks.hashCode(); - result = 31 * result + virtualNics.hashCode(); - return result; - } - - @Override - public String string() { - return super.string()+", processorCount="+processorCount+ - ", memory="+memory+", disks="+ virtualDisks +", nics="+ virtualNics; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/VirtualDisk.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/VirtualDisk.java deleted file mode 100644 index 3256508801..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/hardware/VirtualDisk.java +++ /dev/null @@ -1,144 +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.tmrk.enterprisecloud.domain.hardware; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class VirtualDisk { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - public Builder toBuilder() { - return new Builder().fromVirtualDisk(this); - } - - public static class Builder { - - private String name; - private ResourceCapacity size; - private int index; - - /** - * @see VirtualDisk#getName - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * @see VirtualDisk#getSize - */ - public Builder size(ResourceCapacity size) { - this.size = size; - return this; - } - - /** - * @see VirtualDisk#getIndex - */ - public Builder index(int index) { - this.index = index; - return this; - } - - public VirtualDisk build() { - return new VirtualDisk(name, size, index); - } - - public Builder fromVirtualDisk(VirtualDisk in) { - return name(in.getName()) - .size(in.getSize()) - .index(in.getIndex()); - } - } - - @XmlElement(name = "Name", required = false) - private String name; - - @XmlElement(name = "Size", required = false) - private ResourceCapacity size; - - @XmlElement(name = "Index", required = false) - private int index; - - public VirtualDisk(@Nullable String name, @Nullable ResourceCapacity size, int index) { - this.name = name; - this.size = size; - this.index = index; - } - - protected VirtualDisk() { - //For JAXB - } - - public String getName() { - return name; - } - - public ResourceCapacity getSize() { - return size; - } - - public int getIndex() { - return index; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - VirtualDisk disk = (VirtualDisk) o; - - if (index != disk.index) return false; - if (name != null ? !name.equals(disk.name) : disk.name != null) - return false; - if (size != null ? !size.equals(disk.size) : disk.size != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = name != null ? name.hashCode() : 0; - result = 31 * result + (size != null ? size.hashCode() : 0); - result = 31 * result + index; - return result; - } - - @Override - public String toString() { - return "[name="+name+", size="+size+", index="+index+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/BaseNamedResource.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/BaseNamedResource.java deleted file mode 100644 index 58f12aeda7..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/BaseNamedResource.java +++ /dev/null @@ -1,122 +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.tmrk.enterprisecloud.domain.internal; - -import javax.xml.bind.annotation.XmlAttribute; -import java.net.URI; -import java.util.Map; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Location of a Rest resource - * - * @author Adrian Cole - * - */ -public class BaseNamedResource> extends BaseResource { - - public static > Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromNamedResource(this); - } - - public static class Builder> extends BaseResource.Builder { - - protected String name; - - /** - * @see BaseNamedResource#getName - */ - public Builder name(String name) { - this.name = name; - return this; - } - - public BaseNamedResource build() { - return new BaseNamedResource(href, type, name); - } - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - public Builder fromNamedResource(BaseNamedResource in) { - return fromBaseResource(in).name(in.getName()); - } - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)).name(attributes.get("name")); - } - } - - @XmlAttribute - protected String name; - - protected BaseNamedResource(URI href, String type, String name) { - super(href, type); - this.name = name; - } - - protected BaseNamedResource() { - //For JAXB - } - - public String getName() { - return name; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - BaseNamedResource that = (BaseNamedResource) o; - - if (name != null ? !name.equals(that.name) : that.name != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (name != null ? name.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", name="+name; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/BaseResource.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/BaseResource.java deleted file mode 100644 index 6e98eacc3a..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/BaseResource.java +++ /dev/null @@ -1,148 +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.tmrk.enterprisecloud.domain.internal; - -import org.jclouds.tmrk.enterprisecloud.functions.URISource; - -import javax.xml.bind.annotation.XmlAttribute; -import java.net.URI; -import java.util.Map; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Location of a Rest resource - * - * @author Adrian Cole - * - */ -public class BaseResource> implements URISource { - - public static > Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromBaseResource(this); - } - - public static class Builder> { - - protected String type; - protected URI href; - - /** - * @see BaseResource#getType - */ - public Builder type(String type) { - this.type = type; - return this; - } - - /** - * @see BaseResource#getHref - */ - public Builder href(URI href) { - this.href = href; - return this; - } - - public BaseResource build() { - return new BaseResource(href, type); - } - - protected Builder fromBaseResource(BaseResource in) { - return type(in.getType()).href(in.getHref()); - } - - protected Builder fromAttributes(Map attributes) { - return href(URI.create(attributes.get("href"))).type(attributes.get("type")); - } - - } - - @XmlAttribute - protected String type; - - @XmlAttribute - protected URI href; - - protected BaseResource(URI href, String type) { - this.type = type; - this.href = checkNotNull(href, "href"); - } - - protected BaseResource() { - //For JAXB - } - - /** - * - * @return type definition, type, expressed as an HTTP Content-Type - */ - public String getType() { - return type; - } - - /** - * - * @return an opaque reference and should never be parsed - */ - public URI getHref() { - return href; - } - - /** - * @see #getHref - */ - public URI getURI() { - return getHref(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - BaseResource that = (BaseResource) o; - - if (href != null ? !href.equals(that.href) : that.href != null) - return false; - if (type != null ? !type.equals(that.type) : that.type != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = type != null ? type.hashCode() : 0; - result = 31 * result + (href != null ? href.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return String.format("[%s]",string()); - } - - protected String string() { - return "href="+href+", type="+type; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/Entity.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/Entity.java deleted file mode 100644 index bd290255ef..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/Entity.java +++ /dev/null @@ -1,158 +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.tmrk.enterprisecloud.domain.internal; - -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.Task; -import org.jclouds.tmrk.enterprisecloud.domain.Tasks; - -import javax.xml.bind.annotation.XmlElement; -import java.net.URI; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Base Entity class. Extends Resource with Tasks - * - * @author Jason King - * - */ -public class Entity> extends Resource { - - public static > Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromResource(this); - } - - public static class Builder> extends Resource.Builder { - - protected Set tasks = Sets.newLinkedHashSet(); - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.internal.Entity#getTasks - */ - public Builder tasks(Set tasks) { - this.tasks = ImmutableSet. copyOf(checkNotNull(tasks, "tasks")); - return this; - } - - /** - * @see Resource#getLinks - */ - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * @see Resource#getActions - */ - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * @see Resource#getActions - */ - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - public Entity build() { - return new Entity(href, type, name, links, actions, tasks); - } - - /** - * {@inheritDoc} - */ - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - public Builder fromEntity(Entity in) { - return fromResource(in).links(in.getLinks()).actions(in.getActions()).name(in.getName()) - .tasks(in.getTasks()); - } - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - } - - @XmlElement(name = "Tasks", required = false) - private Tasks tasks = Tasks.builder().build(); - - protected Entity(URI href, String type, @Nullable String name, Set links, Set actions, Set tasks) { - super(href, type, name, links, actions); - this.tasks = Tasks.builder().tasks(checkNotNull(tasks,"tasks")).build(); - } - - protected Entity() { - //For JAXB - } - - public Set getTasks() { - return Collections.unmodifiableSet(tasks.getTasks()); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - Entity entity = (Entity) o; - - if (!tasks.equals(entity.tasks)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + tasks.hashCode(); - return result; - } - - @Override - public String string() { - return super.string()+", tasks="+tasks; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/Resource.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/Resource.java deleted file mode 100644 index c0e4f84670..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/Resource.java +++ /dev/null @@ -1,173 +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.tmrk.enterprisecloud.domain.internal; - -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Actions; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.Links; - -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import java.net.URI; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Base Resource class. - * has Links and Actions and name (plus href and type are inherited) - * - * @author Jason King - * - */ -public class Resource> extends BaseResource { - - public static > Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromResource(this); - } - - public static class Builder> extends BaseResource.Builder { - - protected Set links = Sets.newLinkedHashSet(); - protected Set actions = Sets.newLinkedHashSet(); - protected String name; - - /** - * @see Resource#getLinks - */ - public Builder links(Set links) { - this.links = ImmutableSet. copyOf(checkNotNull(links, "links")); - return this; - } - - /** - * @see Resource#getActions - */ - public Builder actions(Set actions) { - this.actions = ImmutableSet. copyOf(checkNotNull(actions, "actions")); - return this; - } - - /** - * @see Resource#getActions - */ - public Builder name(String name) { - this.name = checkNotNull(name, "name"); - return this; - } - - public Resource build() { - return new Resource(href, type, name, links, actions); - } - - /** - * {@inheritDoc} - */ - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - public Builder fromResource(Resource in) { - return fromBaseResource(in).links(in.getLinks()) - .actions(in.getActions()).name(in.getName()); - } - - /** - * {@inheritDoc} - */ - @SuppressWarnings("unchecked") - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - } - - @XmlElement(name = "Links", required = false) - protected Links links = Links.builder().build(); - - @XmlElement(name = "Actions", required = false) - protected Actions actions = Actions.builder().build(); - - @XmlAttribute(required = false) - protected String name; - - protected Resource(URI href, String type, @Nullable String name, Set links, Set actions) { - super(href, type); - this.name = name; - this.links = Links.builder().links(checkNotNull(links,"links")).build(); - this.actions = Actions.builder().actions(checkNotNull(actions, "actions")).build(); - } - - protected Resource() { - //For JAXB - } - - public Set getLinks() { - return Collections.unmodifiableSet(links.getLinks()); - } - - public Set getActions() { - return Collections.unmodifiableSet(actions.getActions()); - } - - public String getName() { - return name; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - Resource resource = (Resource) o; - - if (actions != null ? !actions.equals(resource.actions) : resource.actions != null) - return false; - if (links != null ? !links.equals(resource.links) : resource.links != null) - return false; - if (name != null ? !name.equals(resource.name) : resource.name != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (links != null ? links.hashCode() : 0); - result = 31 * result + (actions != null ? actions.hashCode() : 0); - result = 31 * result + (name != null ? name.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", name="+name+", links="+links+", actions="+actions; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/ResourceCapacity.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/ResourceCapacity.java deleted file mode 100644 index b00fca6fbf..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/internal/ResourceCapacity.java +++ /dev/null @@ -1,122 +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.tmrk.enterprisecloud.domain.internal; - -import org.jclouds.javax.annotation.Nullable; - -import javax.xml.bind.annotation.XmlElement; - -/** - * @author Jason King - */ -public class ResourceCapacity { - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromResource(this); - } - - public static class Builder { - - protected double value; //mandatory - protected String unit; //optional - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity#getValue - */ - public Builder value(double value) { - this.value = value; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity#getUnit - */ - public Builder unit(String unit) { - this.unit = unit; - return this; - } - - public ResourceCapacity build() { - return new ResourceCapacity(value, unit); - } - - public Builder fromResource(ResourceCapacity in) { - return value(in.getValue()).unit(in.getUnit()); - } - } - - @XmlElement(name = "Value") - protected double value; - - @XmlElement(name = "Unit") - protected String unit; - - public ResourceCapacity(double value, @Nullable String unit) { - this.value = value; - this.unit = unit; - } - - protected ResourceCapacity() { - //For JAXB - } - - public double getValue() { - return value; - } - - /** - * Optional. May be null - */ - public String getUnit() { - return unit; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ResourceCapacity that = (ResourceCapacity) o; - - if (Double.compare(that.value, value) != 0) return false; - if (unit != null ? !unit.equals(that.unit) : that.unit != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result; - long temp; - temp = value != +0.0d ? Double.doubleToLongBits(value) : 0L; - result = (int) (temp ^ (temp >>> 32)); - result = 31 * result + (unit != null ? unit.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "[value="+value+", unit="+unit+"]"; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/keys/SshKey.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/keys/SshKey.java deleted file mode 100644 index 635844d65f..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/keys/SshKey.java +++ /dev/null @@ -1,239 +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.tmrk.enterprisecloud.domain.keys; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.Task; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Entity; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -/** - * - * @author Jason King - */ -@XmlRootElement(name = "SshKey") -public class SSHKey extends Entity { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromSshKey(this); - } - - public static class Builder extends Entity.Builder { - private boolean defaultKey; - private String fingerPrint; - private String privateKey; - - /** - * @see SSHKey#isDefaultKey - */ - public Builder defaultKey(boolean defaultKey) { - this.defaultKey = defaultKey; - return this; - } - - /** - * @see SSHKey#getFingerPrint - */ - public Builder fingerPrint(String fingerPrint) { - this.fingerPrint = fingerPrint; - return this; - } - - /** - * @see SSHKey#getPrivateKey - */ - public Builder privateKey(String privateKey) { - this.privateKey = privateKey; - return this; - } - - @Override - public SSHKey build() { - return new SSHKey(href, type, name, links, actions, tasks, defaultKey, fingerPrint, privateKey); - } - - public Builder fromSshKey(SSHKey in) { - return fromEntity(in).defaultKey(in.isDefaultKey()).fingerPrint(in.getFingerPrint()).privateKey(in.getPrivateKey()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromEntity(Entity in) { - return Builder.class.cast(super.fromEntity(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder tasks(Set tasks) { - return Builder.class.cast(super.tasks(tasks)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "Default", required = false) - private boolean defaultKey; - - @XmlElement(name = "FingerPrint", required = false) - private String fingerPrint; - - @XmlElement(name = "PrivateKey", required = false) - private String privateKey; - - private SSHKey(URI href, String type, String name, Set links, Set actions, Set tasks, - boolean defaultKey, @Nullable String fingerPrint, @Nullable String privateKey) { - super(href, type, name, links, actions, tasks); - this.defaultKey = defaultKey; - this.fingerPrint = fingerPrint; - this.privateKey = privateKey; - } - - private SSHKey() { - //For JAXB - } - - public boolean isDefaultKey() { - return defaultKey; - } - - public String getFingerPrint() { - return fingerPrint; - } - - public String getPrivateKey() { - return privateKey; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - SSHKey sshKey = (SSHKey) o; - - if (defaultKey != sshKey.defaultKey) return false; - if (fingerPrint != null ? !fingerPrint.equals(sshKey.fingerPrint) : sshKey.fingerPrint != null) - return false; - if (privateKey != null ? !privateKey.equals(sshKey.privateKey) : sshKey.privateKey != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (defaultKey ? 1 : 0); - result = 31 * result + (fingerPrint != null ? fingerPrint.hashCode() : 0); - result = 31 * result + (privateKey != null ? privateKey.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", defaultKey="+defaultKey+", fingerPrint="+fingerPrint+", privateKey="+privateKey; - } - -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/keys/SshKeys.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/keys/SshKeys.java deleted file mode 100644 index 4cebdbe02a..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/keys/SshKeys.java +++ /dev/null @@ -1,182 +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.tmrk.enterprisecloud.domain.keys; - -import com.google.common.collect.Sets; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * SshKeys is more than a simple wrapper as it extends Resource. - * @author Jason King - * - */ -@XmlRootElement(name = "SshKeys") -public class SSHKeys extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromTemplates(this); - } - - public static class Builder extends Resource.Builder { - private Set sshKeys = Sets.newLinkedHashSet(); - - /** - * @see SSHKeys#getSSHKeys - */ - public Builder sshKeys(Set sshKeys) { - this.sshKeys =(checkNotNull(sshKeys,"sshKeys")); - return this; - } - - @Override - public SSHKeys build() { - return new SSHKeys(href, type, name, links, actions, sshKeys); - } - - public Builder fromTemplates(SSHKeys in) { - return fromResource(in).sshKeys(in.getSSHKeys()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "SshKey", required = false) - private Set sshKeys = Sets.newLinkedHashSet(); - - private SSHKeys(URI href, String type, String name, Set links, Set actions, Set sshKeys) { - super(href, type, name, links, actions); - this.sshKeys = checkNotNull(sshKeys,"sshKeys"); - } - - private SSHKeys() { - //For JAXB - } - - public Set getSSHKeys() { - return sshKeys; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - SSHKeys networks1 = (SSHKeys) o; - - if (!sshKeys.equals(networks1.sshKeys)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + sshKeys.hashCode(); - return result; - } - - @Override - public String string() { - return super.string()+", sshKeys="+sshKeys; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/DeviceLayout.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/DeviceLayout.java deleted file mode 100644 index 4927d440bc..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/DeviceLayout.java +++ /dev/null @@ -1,183 +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.tmrk.enterprisecloud.domain.layout; - -import com.google.common.collect.Sets; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * DeviceLayout is more than a simple wrapper as it extends Resource. - * - * @author Jason King - * - */ -@XmlRootElement(name = "DeviceLayout") -public class DeviceLayout extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromTemplates(this); - } - - public static class Builder extends Resource.Builder { - private Set rows = Sets.newLinkedHashSet(); - - /** - * @see DeviceLayout#getRows - */ - public Builder rows(Set rows) { - this.rows =(checkNotNull(rows,"rows")); - return this; - } - - @Override - public DeviceLayout build() { - return new DeviceLayout(href, type, name, links, actions, rows); - } - - public Builder fromTemplates(DeviceLayout in) { - return fromResource(in).rows(in.getRows()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "Rows", required = false) - private Rows rows = Rows.builder().build(); - - private DeviceLayout(URI href, String type, String name, Set links, Set actions, Set rows) { - super(href, type, name, links, actions); - this.rows = Rows.builder().rows(checkNotNull(rows,"rows")).build(); - } - - private DeviceLayout() { - //For JAXB - } - - public Set getRows() { - return rows.getRows(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - DeviceLayout that = (DeviceLayout) o; - - if (!rows.equals(that.rows)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + rows.hashCode(); - return result; - } - - @Override - public String string() { - return super.string()+", rows="+rows; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Groups.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Groups.java deleted file mode 100644 index f557464ad9..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Groups.java +++ /dev/null @@ -1,106 +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.tmrk.enterprisecloud.domain.layout; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual LayoutGroup elements. - * - * @author Jason King - */ -public class Groups { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromGroups(this); - } - - public static class Builder { - - private Set groups = Sets.newLinkedHashSet(); - - /** - * @see Groups#getGroups - */ - public Builder groups(Set groups) { - this.groups = Sets.newLinkedHashSet(checkNotNull(groups, "groups")); - return this; - } - - public Builder addGroup(LayoutGroup group) { - groups.add(checkNotNull(group, "group")); - return this; - } - - public Groups build() { - return new Groups(groups); - } - - public Builder fromGroups(Groups in) { - return groups(in.getGroups()); - } - } - - private Groups() { - //For JAXB and builder use - } - - private Groups(Set entries) { - this.groups = Sets.newLinkedHashSet(entries); - } - - @XmlElement(name = "Group", required=false) - private Set groups = Sets.newLinkedHashSet(); - - public Set getGroups() { - return Collections.unmodifiableSet(groups); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Groups tasks1 = (Groups) o; - - if (!groups.equals(tasks1.groups)) return false; - - return true; - } - - @Override - public int hashCode() { - return groups.hashCode(); - } - - public String toString() { - return "["+ groups.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Layout.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Layout.java deleted file mode 100644 index 2aa9aa8f8d..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Layout.java +++ /dev/null @@ -1,86 +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.tmrk.enterprisecloud.domain.layout; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; - -import javax.xml.bind.annotation.XmlElement; - -/** - * Layout is a logical aggregation of virtual machines and physical devices defined by the organization. - * Layout is an environment concept but visible from both the environment and the compute pool. - * From the environment, all rows, groups, virtual machines, and physical devices are visible. - * From the compute pool, only a subset is visible. - * To appear in a compute pool layout, virtual machines in the rows and groups must be allocated from the compute pool. - * As physical devices are not allocated from the compute pool, they do not appear on compute pool layouts. - * - * @author Jason King - */ -public class Layout { - @XmlElement(name = "Group") - private NamedResource group; - - @XmlElement(name = "Row") - private NamedResource row; - - public Layout(@Nullable NamedResource group, @Nullable NamedResource row) { - this.group = group; - this.row = row; - } - - public Layout() { - //For JAXB - } - - public NamedResource getGroup() { - return group; - } - - public NamedResource getRow() { - return row; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Layout layout = (Layout) o; - - if (group != null ? !group.equals(layout.group) : layout.group != null) - return false; - if (row != null ? !row.equals(layout.row) : layout.row != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = group != null ? group.hashCode() : 0; - result = 31 * result + (row != null ? row.hashCode() : 0); - return result; - } - - public String toString() { - return "[group="+group+", row="+row+"]"; - } - -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutGroup.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutGroup.java deleted file mode 100644 index 21c3cd263e..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutGroup.java +++ /dev/null @@ -1,206 +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.tmrk.enterprisecloud.domain.layout; - -import com.google.common.collect.Sets; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; -import org.jclouds.tmrk.enterprisecloud.domain.vm.VirtualMachineReference; -import org.jclouds.tmrk.enterprisecloud.domain.vm.VirtualMachineReferences; - -import javax.xml.bind.annotation.XmlElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * LayoutGroup is more than a simple wrapper as it extends Resource. - * - * @author Jason King - * - */ -public class LayoutGroup extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromLayoutGroup(this); - } - - public static class Builder extends Resource.Builder { - private int index; - private Set virtualMachineReferences = Sets.newLinkedHashSet(); - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.layout.LayoutGroup#getIndex - */ - public Builder index(int index) { - this.index = index; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.layout.LayoutGroup#getVirtualMachineReferences() - */ - public Builder virtualMachineReferences(Set virtualMachineReferences) { - this.virtualMachineReferences = Sets.newLinkedHashSet(checkNotNull(virtualMachineReferences, "virtualMachineReferences")); - return this; - } - - - @Override - public LayoutGroup build() { - return new LayoutGroup(href, type, name, links, actions, index,virtualMachineReferences); - } - - public Builder fromLayoutGroup(LayoutGroup in) { - return fromResource(in).index(in.getIndex()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - } - - @XmlElement(name = "Index", required = false) - private int index; - - @XmlElement(name = "VirtualMachines", required = false) - private VirtualMachineReferences virtualMachineReferences; - - //TODO: PhysicalDevices - - private LayoutGroup(URI href, String type, String name, Set links, Set actions, - int index, Set virtualMachineReferences) { - super(href, type, name, links, actions); - this.index = index; - this.virtualMachineReferences = VirtualMachineReferences.builder().virtualMachineReferences(virtualMachineReferences).build(); - } - - private LayoutGroup() { - //For JAXB - } - - public int getIndex() { - return index; - } - - public Set getVirtualMachineReferences() { - return virtualMachineReferences.getVirtualMachineReferences(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - LayoutGroup that = (LayoutGroup) o; - - if (index != that.index) return false; - if (!virtualMachineReferences.equals(that.virtualMachineReferences)) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + index; - result = 31 * result + virtualMachineReferences.hashCode(); - return result; - } - - @Override - public String string() { - return super.string()+", index="+index+", virtualMachineReferences="+virtualMachineReferences; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRequest.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRequest.java deleted file mode 100644 index 6661915f36..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRequest.java +++ /dev/null @@ -1,181 +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.tmrk.enterprisecloud.domain.layout; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; - -import javax.xml.bind.annotation.XmlElement; - -/** - * LayoutRequest has three variations. Only one of the three variations is permitted in a call: - * - * 1. Use an existing group. - * Group is required and the href attribute on the element is required to identify - * the group to use. - * - * 2. Use a newly created group in an existing row. - * Row is required and the href attribute on the element is required to identify - * the row in which the new group will be created. - * NewGroup is required to provide the required name, - * which may not exceed fifty characters, - * and to create the group to use. - * - * 3. Move to a newly created group in a newly created row. - * NewRow is required to provide the required name, - * which may not exceed fifty characters, - * and to create the row in which the new group will be created. - * NewGroup is required to provide the required name, - * which may not exceed fifty characters, - * and to create the group to use. - * - * - * @author Jason King - * - */ -public class LayoutRequest { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromLayoutRequest(this); - } - - public static class Builder { - private NamedResource row; - private NamedResource group; - private String newRow; - private String newGroup; - - /** - * @see LayoutRequest#getRow - */ - public Builder row(NamedResource row) { - this.row = row; - return this; - } - - /** - * @see LayoutRequest#getGroup - */ - public Builder group(NamedResource group) { - this.group = group; - return this; - } - - /** - * @see LayoutRequest#getNewRow - */ - public Builder newRow(String newRow) { - this.newRow = newRow; - return this; - } - - /** - * @see LayoutRequest#getNewGroup - */ - public Builder newGroup(String newGroup) { - this.newGroup = newGroup; - return this; - } - - public LayoutRequest build() { - return new LayoutRequest(row, group, newRow, newGroup); - } - - public Builder fromLayoutRequest(LayoutRequest in) { - return row(in.getRow()).group(in.getGroup()).newRow(in.getNewRow()).newGroup(in.getNewGroup()); - } - } - - @XmlElement(name = "Row", required = false) - private NamedResource row; - - @XmlElement(name = "Group", required = false) - private NamedResource group; - - @XmlElement(name = "NewRow", required = false) - private String newRow; - - @XmlElement(name = "NewGroup", required = false) - private String newGroup; - - - private LayoutRequest(@Nullable NamedResource row, @Nullable NamedResource group, @Nullable String newRow, @Nullable String newGroup) { - this.row = row; - this.group = group; - this.newRow = newRow; - this.newGroup = newGroup; - } - - private LayoutRequest() { - //For JAXB - } - - public NamedResource getRow() { - return row; - } - - public NamedResource getGroup() { - return group; - } - - public String getNewRow() { - return newRow; - } - - public String getNewGroup() { - return newGroup; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - LayoutRequest that = (LayoutRequest) o; - - if (group != null ? !group.equals(that.group) : that.group != null) - return false; - if (newGroup != null ? !newGroup.equals(that.newGroup) : that.newGroup != null) - return false; - if (newRow != null ? !newRow.equals(that.newRow) : that.newRow != null) - return false; - if (row != null ? !row.equals(that.row) : that.row != null) return false; - - return true; - } - - @Override - public int hashCode() { - int result = row != null ? row.hashCode() : 0; - result = 31 * result + (group != null ? group.hashCode() : 0); - result = 31 * result + (newRow != null ? newRow.hashCode() : 0); - result = 31 * result + (newGroup != null ? newGroup.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "row="+row+", group="+group+", newRow="+newRow+", newGroup="+newGroup; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRow.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRow.java deleted file mode 100644 index 449442e11f..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/LayoutRow.java +++ /dev/null @@ -1,200 +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.tmrk.enterprisecloud.domain.layout; - -import com.google.common.collect.Sets; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * LayoutRow is more than a simple wrapper as it extends Resource. - * - * @author Jason King - * - */ -public class LayoutRow extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromLayoutRow(this); - } - - public static class Builder extends Resource.Builder { - private int index; - private Set groups = Sets.newLinkedHashSet(); - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.layout.LayoutRow#getIndex - */ - public Builder index(int index) { - this.index = index; - return this; - } - - /** - * @see Groups#getGroups - */ - public Builder groups(Set groups) { - this.groups = Sets.newLinkedHashSet(checkNotNull(groups, "groups")); - return this; - } - - @Override - public LayoutRow build() { - return new LayoutRow(href, type, name, links, actions, index, groups); - } - - public Builder fromLayoutRow(LayoutRow in) { - return fromResource(in).index(in.getIndex()).groups(in.getGroups()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "Index", required = false) - private int index; - - @XmlElement(name = "Groups", required = false) - private Groups groups = Groups.builder().build(); - - private LayoutRow(URI href, String type, String name, Set links, Set actions, int index, Set groups) { - super(href, type, name, links, actions); - this.index = index; - this.groups = Groups.builder().groups(groups).build(); - } - - private LayoutRow() { - //For JAXB - } - - public int getIndex() { - return index; - } - - public Set getGroups() { - return groups.getGroups(); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - LayoutRow layoutRow = (LayoutRow) o; - - if (index != layoutRow.index) return false; - if (!groups.equals(layoutRow.groups)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + index; - result = 31 * result + groups.hashCode(); - return result; - } - - @Override - public String string() { - return super.string()+", index="+index+", groups="+groups; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Rows.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Rows.java deleted file mode 100644 index 3de18713f1..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/layout/Rows.java +++ /dev/null @@ -1,106 +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.tmrk.enterprisecloud.domain.layout; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual LayoutRow elements. - * - * @author Jason King - */ -public class Rows { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromRows(this); - } - - public static class Builder { - - private Set rows = Sets.newLinkedHashSet(); - - /** - * @see Rows#getRows - */ - public Builder rows(Set rows) { - this.rows = Sets.newLinkedHashSet(checkNotNull(rows, "rows")); - return this; - } - - public Builder addRow(LayoutRow row) { - rows.add(checkNotNull(row,"row")); - return this; - } - - public Rows build() { - return new Rows(rows); - } - - public Builder fromRows(Rows in) { - return rows(in.getRows()); - } - } - - private Rows() { - //For JAXB and builder use - } - - private Rows(Set entries) { - this.rows = Sets.newLinkedHashSet(entries); - } - - @XmlElement(name = "Row", required=false) - private Set rows = Sets.newLinkedHashSet(); - - public Set getRows() { - return Collections.unmodifiableSet(rows); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Rows tasks1 = (Rows) o; - - if (!rows.equals(tasks1.rows)) return false; - - return true; - } - - @Override - public int hashCode() { - return rows.hashCode(); - } - - public String toString() { - return "["+ rows.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/AssignedIpAddresses.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/AssignedIpAddresses.java deleted file mode 100644 index 724e21c102..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/AssignedIpAddresses.java +++ /dev/null @@ -1,80 +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.tmrk.enterprisecloud.domain.network; - -import com.google.common.collect.Sets; -import org.jclouds.tmrk.enterprisecloud.domain.Actions; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - */ -@XmlRootElement(name="AssignedIpAddresses") -public class AssignedIpAddresses extends Resource { - - @XmlElement(name = "Networks", required = true) - private DeviceNetworks networks = new DeviceNetworks(); - - public AssignedIpAddresses(URI href, String type, String name, Actions actions, DeviceNetworks networks) { - super(href, type, name, Sets.newIdentityHashSet(), actions.getActions()); - this.networks = checkNotNull(networks,"networks"); - } - - public AssignedIpAddresses() { - //For JAXB - } - - public DeviceNetworks getNetworks() { - return networks; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - AssignedIpAddresses that = (AssignedIpAddresses) o; - - if (!networks.equals(that.networks)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + networks.hashCode(); - return result; - } - - @Override - public String string() { - return super.string()+", networks="+networks; - } - -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceIps.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceIps.java deleted file mode 100644 index c19118c568..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceIps.java +++ /dev/null @@ -1,76 +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.tmrk.enterprisecloud.domain.network; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; -import static org.jclouds.util.Preconditions2.checkNotEmpty; - -/** - * - * Wraps individual IpAddresses - * @author Jason King - */ -public class DeviceIps { - - private LinkedHashSet ipAddresses = Sets.newLinkedHashSet(); - - protected DeviceIps() { - // For JAXB - } - - @XmlElement(name = "IpAddress") - void setIpAddress(String ipAddress) { - checkNotNull(ipAddress,"ipAddress"); - checkNotEmpty(ipAddress, "ipAddress"); - this.ipAddresses.add(ipAddress); - } - - public Set getIpAddresses() { - return Collections.unmodifiableSet(ipAddresses); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - DeviceIps deviceIps = (DeviceIps) o; - - if (!ipAddresses.equals(deviceIps.ipAddresses)) return false; - - return true; - } - - @Override - public int hashCode() { - return ipAddresses.hashCode(); - } - - public String toString() { - return "["+ ipAddresses.toString()+"]"; - } - -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceNetwork.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceNetwork.java deleted file mode 100644 index 97f2b74dff..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceNetwork.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.tmrk.enterprisecloud.domain.network; - -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; - -/** - * Container for DeviceIps (ipAddresses) - * - * @author Jason King - */ -public class DeviceNetwork extends Resource { - - //TODO: Builder - - @XmlElement(name = "IpAddresses") - private DeviceIps ipAddresses = new DeviceIps(); - - private DeviceNetwork() { - //For JAXB - } - - public DeviceIps getIpAddresses() { - return ipAddresses; - } - - @Override - public String string() { - return super.string()+"ipAddresses="+ ipAddresses; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceNetworks.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceNetworks.java deleted file mode 100644 index 260fc7df71..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DeviceNetworks.java +++ /dev/null @@ -1,57 +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.tmrk.enterprisecloud.domain.network; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Container for DeviceNetwork items - * - * @author Jason King - */ -public class DeviceNetworks { - - private LinkedHashSet deviceNetworks = Sets.newLinkedHashSet(); - - protected DeviceNetworks() { - //For JAXB - } - - @XmlElement(name = "Network") - void setDeviceNetwork(DeviceNetwork deviceNetwork) { - checkNotNull(deviceNetwork,"deviceNetwork"); - this.deviceNetworks.add(deviceNetwork); - } - - public Set getDeviceNetworks() { - return Collections.unmodifiableSet(deviceNetworks); - } - - @Override - public String toString() { - return "[deviceNetworks="+deviceNetworks+"]"; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DnsSettings.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DnsSettings.java deleted file mode 100644 index a1cdfa404f..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/DnsSettings.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.tmrk.enterprisecloud.domain.network; - -import org.jclouds.javax.annotation.Nullable; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class DnsSettings { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromDnsSettings(this); - } - - public static class Builder { - - private String primaryDns; - private String secondaryDns; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.DnsSettings#getPrimaryDns - */ - public Builder primaryDns(String primaryDns) { - this.primaryDns = primaryDns; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.DnsSettings#getSecondaryDns - */ - public Builder secondaryDns(String secondaryDns) { - this.secondaryDns = secondaryDns; - return this; - } - - public DnsSettings build() { - return new DnsSettings(primaryDns, secondaryDns); - } - - public Builder fromDnsSettings(DnsSettings in) { - return primaryDns(in.getPrimaryDns()).secondaryDns(in.getSecondaryDns()); - } - } - - @XmlElement(name = "PrimaryDns", required = false) - private String primaryDns; - - @XmlElement(name = "SecondaryDns", required = false) - private String secondaryDns; - - public DnsSettings(@Nullable String primaryDns, @Nullable String secondaryDns) { - this.primaryDns = primaryDns; - this.secondaryDns = secondaryDns; - } - - protected DnsSettings() { - //For JAXB - } - - @Nullable - public String getPrimaryDns() { - return primaryDns; - } - - @Nullable - public String getSecondaryDns() { - return secondaryDns; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - DnsSettings that = (DnsSettings) o; - - if (primaryDns != null ? !primaryDns.equals(that.primaryDns) : that.primaryDns != null) - return false; - if (secondaryDns != null ? !secondaryDns.equals(that.secondaryDns) : that.secondaryDns != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = primaryDns != null ? primaryDns.hashCode() : 0; - result = 31 * result + (secondaryDns != null ? secondaryDns.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "[primaryDns="+ primaryDns +",secondaryDns="+ secondaryDns +"]"; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddress.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddress.java deleted file mode 100644 index 6fdc732ba7..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddress.java +++ /dev/null @@ -1,221 +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.tmrk.enterprisecloud.domain.network; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -/** - * - * @author Jason King - */ -public class IpAddress extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromIpAddress(this); - } - - public static class Builder extends Resource.Builder { - private NamedResource host; - private NamedResource detectedOn; - private NamedResource rnatAddress; - - /** - * @see IpAddress#getHost - */ - public Builder host(NamedResource host) { - this.host = host; - return this; - } - - /** - * @see IpAddress#getDetectedOn - */ - public Builder detectedOn(NamedResource detectedOn) { - this.detectedOn = detectedOn; - return this; - } - - /** - * @see IpAddress#getRnatAddress - */ - public Builder rnatAddress(NamedResource rnatAddress) { - this.rnatAddress = rnatAddress; - return this; - } - - @Override - public IpAddress build() { - return new IpAddress(href, type, name, links, actions, host, detectedOn, rnatAddress); - } - - public Builder fromIpAddress(IpAddress in) { - return fromResource(in).host(in.getHost()).detectedOn(in.getDetectedOn()).rnatAddress(in.getRnatAddress()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "Host", required = false) - private NamedResource host; - - @XmlElement(name = "DetectedOn", required = false) - private NamedResource detectedOn; - - @XmlElement(name = "RnatAddress", required = false) - private NamedResource rnatAddress; - - private IpAddress(URI href, String type, String name, Set links,Set actions, - @Nullable NamedResource host,@Nullable NamedResource detectedOn,@Nullable NamedResource rnatAddress) { - super(href, type, name, links, actions); - this.host = host; - this.detectedOn = detectedOn; - this.rnatAddress = rnatAddress; - } - - private IpAddress() { - //For JAXB - } - - public NamedResource getHost() { - return host; - } - - public NamedResource getDetectedOn() { - return detectedOn; - } - - public NamedResource getRnatAddress() { - return rnatAddress; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - IpAddress ipAddress = (IpAddress) o; - - if (detectedOn != null ? !detectedOn.equals(ipAddress.detectedOn) : ipAddress.detectedOn != null) - return false; - if (host != null ? !host.equals(ipAddress.host) : ipAddress.host != null) - return false; - if (rnatAddress != null ? !rnatAddress.equals(ipAddress.rnatAddress) : ipAddress.rnatAddress != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (host != null ? host.hashCode() : 0); - result = 31 * result + (detectedOn != null ? detectedOn.hashCode() : 0); - result = 31 * result + (rnatAddress != null ? rnatAddress.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", host="+host+", detectedOn="+detectedOn+", rnatAddress="+rnatAddress; - } - -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddressReference.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddressReference.java deleted file mode 100644 index 4ee970787b..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddressReference.java +++ /dev/null @@ -1,182 +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.tmrk.enterprisecloud.domain.network; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseNamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; - -import javax.xml.bind.annotation.XmlElement; -import java.net.URI; -import java.util.Map; - -/** - * - * @author Jason King - * - */ -public class IpAddressReference extends BaseNamedResource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromNetworkReference(this); - } - - public static class Builder extends BaseNamedResource.Builder { - - private NamedResource network; - private NamedResource host; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.IpAddressReference#getNetwork - */ - public Builder network(NamedResource network) { - this.network = network; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.IpAddressReference#getHost - */ - public Builder host(NamedResource host) { - this.host = host; - return this; - } - - @Override - public IpAddressReference build() { - return new IpAddressReference(href, type, name, network, host); - } - - public Builder fromNetworkReference(IpAddressReference in) { - return fromNamedResource(in).network(in.getNetwork()).host(in.getHost()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromNamedResource(BaseNamedResource in) { - return Builder.class.cast(super.fromNamedResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - } - - @XmlElement(name = "Network", required = false) - private NamedResource network; - - @XmlElement(name = "Host", required = false) - private NamedResource host; - - private IpAddressReference(URI href, String type, String name, - @Nullable NamedResource network, @Nullable NamedResource host) { - super(href, type, name); - this.network = network; - this.host = host; - } - - private IpAddressReference() { - //For JAXB - } - - public NamedResource getNetwork() { - return network; - } - - public NamedResource getHost() { - return host; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - IpAddressReference that = (IpAddressReference) o; - - if (host != null ? !host.equals(that.host) : that.host != null) - return false; - if (network != null ? !network.equals(that.network) : that.network != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (network != null ? network.hashCode() : 0); - result = 31 * result + (host != null ? host.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", network="+network+", host="+host; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddresses.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddresses.java deleted file mode 100644 index c25b512782..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/IpAddresses.java +++ /dev/null @@ -1,105 +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.tmrk.enterprisecloud.domain.network; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - */ -public class IpAddresses { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromIpAddresses(this); - } - - public static class Builder { - - private Set addresses = Sets.newLinkedHashSet(); - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.IpAddresses#getIpAddresses - */ - public Builder addresses(Set addresses) { - this.addresses = Sets.newLinkedHashSet(checkNotNull(addresses, "addresses")); - return this; - } - - public Builder addIpAddress(IpAddress address) { - addresses.add(checkNotNull(address, "address")); - return this; - } - - public IpAddresses build() { - return new IpAddresses(addresses); - } - - public Builder fromIpAddresses(IpAddresses in) { - return addresses(in.getIpAddresses()); - } - } - - private IpAddresses() { - //For JAXB and builder use - } - - private IpAddresses(Set addresses) { - this.addresses = Sets.newLinkedHashSet(addresses); - } - - @XmlElement(name = "IpAddress") - private Set addresses = Sets.newLinkedHashSet(); - - public Set getIpAddresses() { - return Collections.unmodifiableSet(addresses); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - IpAddresses that = (IpAddresses) o; - - if (!addresses.equals(that.addresses)) return false; - - return true; - } - - @Override - public int hashCode() { - return addresses.hashCode(); - } - - public String toString() { - return "["+ addresses.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/LinuxCustomization.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/LinuxCustomization.java deleted file mode 100644 index f63cb1a59d..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/LinuxCustomization.java +++ /dev/null @@ -1,120 +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.tmrk.enterprisecloud.domain.network; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class LinuxCustomization { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromLinuxCustomization(this); - } - - public static class Builder { - - private NetworkSettings networkSettings = NetworkSettings.builder().build(); - private NamedResource sshKey; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.LinuxCustomization#getNetworkSettings - */ - public Builder networkSettings(NetworkSettings networkSettings) { - this.networkSettings = networkSettings; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.LinuxCustomization#getSshKey - */ - public Builder sshKey(NamedResource sshKey) { - this.sshKey = sshKey; - return this; - } - - public LinuxCustomization build() { - return new LinuxCustomization(networkSettings, sshKey); - } - - public Builder fromLinuxCustomization(LinuxCustomization in) { - return networkSettings(in.getNetworkSettings()).sshKey(in.getSshKey()); - } - } - - @XmlElement(name = "NetworkSettings", required = false) - private NetworkSettings networkSettings; - - @XmlElement(name = "SshKey", required = false) - private NamedResource sshKey; - - public LinuxCustomization(@Nullable NetworkSettings networkSettings, @Nullable NamedResource sshKey) { - this.networkSettings = networkSettings; - this.sshKey = sshKey; - } - - private LinuxCustomization() { - //For JAXB - } - - public NetworkSettings getNetworkSettings() { - return networkSettings; - } - - public NamedResource getSshKey() { - return sshKey; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - LinuxCustomization that = (LinuxCustomization) o; - - if (networkSettings != null ? !networkSettings.equals(that.networkSettings) : that.networkSettings != null) - return false; - if (sshKey != null ? !sshKey.equals(that.sshKey) : that.sshKey != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = networkSettings != null ? networkSettings.hashCode() : 0; - result = 31 * result + (sshKey != null ? sshKey.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "[networkSettings="+ networkSettings +",sshKey="+ sshKey +"]"; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkAdapterSetting.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkAdapterSetting.java deleted file mode 100644 index 96e307b051..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkAdapterSetting.java +++ /dev/null @@ -1,122 +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.tmrk.enterprisecloud.domain.network; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class NetworkAdapterSetting { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromNetworkAdapterSetting(this); - } - - public static class Builder { - - private NamedResource network; - private String ipAddress; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.NetworkAdapterSetting#getNetwork - */ - public Builder network(NamedResource network) { - this.network = network; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.NetworkAdapterSetting#getIpAddress - */ - public Builder ipAddress(String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - public NetworkAdapterSetting build() { - return new NetworkAdapterSetting(ipAddress, network); - } - - public Builder fromNetworkAdapterSetting(NetworkAdapterSetting in) { - return ipAddress(in.getIpAddress()).network(in.getNetwork()); - } - } - - @XmlElement(name = "Network", required = false) - private NamedResource network; - - @XmlElement(name = "IpAddress", required = false) - private String ipAddress; - - public NetworkAdapterSetting(@Nullable String ipAddress, @Nullable NamedResource network) { - this.ipAddress = ipAddress; - this.network = network; - } - - protected NetworkAdapterSetting() { - //For JAXB - } - - @Nullable - public String getIpAddress() { - return ipAddress; - } - - @Nullable - public NamedResource getNetwork() { - return network; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - NetworkAdapterSetting that = (NetworkAdapterSetting) o; - - if (ipAddress != null ? !ipAddress.equals(that.ipAddress) : that.ipAddress != null) - return false; - if (network != null ? !network.equals(that.network) : that.network != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = network != null ? network.hashCode() : 0; - result = 31 * result + (ipAddress != null ? ipAddress.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "[ipAddress="+ ipAddress +",network="+ network +"]"; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkAdapterSettings.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkAdapterSettings.java deleted file mode 100644 index ada4cfd429..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkAdapterSettings.java +++ /dev/null @@ -1,105 +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.tmrk.enterprisecloud.domain.network; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - */ -public class NetworkAdapterSettings { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromNetworkAdapterSettings(this); - } - - public static class Builder { - - private Set adapters = Sets.newLinkedHashSet(); - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.NetworkAdapterSettings#getNetworkAdapterSettings() - */ - public Builder adapters(Set adapters) { - this.adapters = Sets.newLinkedHashSet(checkNotNull(adapters, "adapters")); - return this; - } - - public Builder addNetworkAdapterSetting(NetworkAdapterSetting adapter) { - adapters.add(checkNotNull(adapter, "adapter")); - return this; - } - - public NetworkAdapterSettings build() { - return new NetworkAdapterSettings(adapters); - } - - public Builder fromNetworkAdapterSettings(NetworkAdapterSettings in) { - return adapters(in.getNetworkAdapterSettings()); - } - } - - private NetworkAdapterSettings() { - //For JAXB and builder use - } - - private NetworkAdapterSettings(Set adapters) { - this.adapters = Sets.newLinkedHashSet(adapters); - } - - @XmlElement(name = "NetworkAdapter") - private Set adapters = Sets.newLinkedHashSet(); - - public Set getNetworkAdapterSettings() { - return Collections.unmodifiableSet(adapters); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - NetworkAdapterSettings that = (NetworkAdapterSettings) o; - - if (!adapters.equals(that.adapters)) return false; - - return true; - } - - @Override - public int hashCode() { - return adapters.hashCode(); - } - - public String toString() { - return "["+ adapters.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkReference.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkReference.java deleted file mode 100644 index 3598a856e8..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkReference.java +++ /dev/null @@ -1,292 +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.tmrk.enterprisecloud.domain.network; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseNamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Map; - -import static com.google.common.base.CaseFormat.LOWER_CAMEL; -import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE; -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - * - */ -@XmlRootElement(name = "Network") -public class NetworkReference extends BaseNamedResource { - @XmlEnum - public static enum NetworkType { - - @XmlEnumValue("Dmz") - DMZ, - - @XmlEnumValue("Internal") - INTERNAL; - - public String value() { - return UPPER_UNDERSCORE.to(LOWER_CAMEL, name()); - } - - @Override - public String toString() { - return value(); - } - } - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromNetworkReference(this); - } - - public static class Builder extends BaseNamedResource.Builder { - - private String address; - private NetworkType networkType; - private String broadcastAddress; - private String gatewayAddress; - private NamedResource rnatAddress; - private IpAddresses ipAddresses; - - /** - * @see NetworkReference#getAddress - */ - public Builder address(String address) { - this.address = address; - return this; - } - - /** - * @see NetworkReference#getNetworkType - */ - public Builder networkType(NetworkType networkType) { - this.networkType = networkType; - return this; - } - - /** - * @see NetworkReference#getBroadcastAddress - */ - public Builder broadcastAddress(String broadcastAddress) { - this.broadcastAddress = broadcastAddress; - return this; - } - - /** - * @see NetworkReference#getGatewayAddress - */ - public Builder gatewayAddress(String gatewayAddress) { - this.gatewayAddress = gatewayAddress; - return this; - } - - /** - * @see NetworkReference#getRnatAddress - */ - public Builder rnatAddress(NamedResource rnatAddress) { - this.rnatAddress = rnatAddress; - return this; - } - - /** - * @see NetworkReference#getIpAddresses - */ - public Builder ipAddresses(IpAddresses ipAddresses) { - this.ipAddresses = ipAddresses; - return this; - } - - @Override - public NetworkReference build() { - return new NetworkReference(href, type, name, address, networkType, broadcastAddress, gatewayAddress, rnatAddress, ipAddresses); - } - - public Builder fromNetworkReference(NetworkReference in) { - return fromNamedResource(in).address(in.getAddress()) - .networkType(in.getNetworkType()) - .broadcastAddress(in.getBroadcastAddress()) - .gatewayAddress(in.getGatewayAddress()) - .rnatAddress(in.getRnatAddress()) - .ipAddresses(in.getIpAddresses()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromNamedResource(BaseNamedResource in) { - return Builder.class.cast(super.fromNamedResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - } - - @XmlElement(name = "Address", required = false) - private String address; - - @XmlElement(name = "NetworkType", required = true) - private NetworkType networkType; - - @XmlElement(name = "BroadcastAddress", required = false) - private String broadcastAddress; - - @XmlElement(name = "GatewayAddress", required = false) - private String gatewayAddress; - - @XmlElement(name = "RnatAddress", required = false) - private NamedResource rnatAddress; - - @XmlElement(name = "IpAddresses", required = false) - private IpAddresses ipAddresses; - - private NetworkReference(URI href, String type, String name,@Nullable String address, NetworkType networkType, - @Nullable String broadcastAddress, @Nullable String gatewayAddress, @Nullable NamedResource rnatAddress, @Nullable IpAddresses ipAddresses) { - super(href, type, name); - this.address = address; - this.networkType = checkNotNull(networkType,"networkType"); - this.broadcastAddress = broadcastAddress; - this.gatewayAddress = gatewayAddress; - this.rnatAddress = rnatAddress; - this.ipAddresses = ipAddresses; - } - - private NetworkReference() { - //For JAXB - } - - public String getAddress() { - return address; - } - - public NetworkType getNetworkType() { - return networkType; - } - - public String getBroadcastAddress() { - return broadcastAddress; - } - - public String getGatewayAddress() { - return gatewayAddress; - } - - public NamedResource getRnatAddress() { - return rnatAddress; - } - - public IpAddresses getIpAddresses() { - return ipAddresses; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - NetworkReference that = (NetworkReference) o; - - if (address != null ? !address.equals(that.address) : that.address != null) - return false; - if (broadcastAddress != null ? !broadcastAddress.equals(that.broadcastAddress) : that.broadcastAddress != null) - return false; - if (gatewayAddress != null ? !gatewayAddress.equals(that.gatewayAddress) : that.gatewayAddress != null) - return false; - if (ipAddresses != null ? !ipAddresses.equals(that.ipAddresses) : that.ipAddresses != null) - return false; - if (networkType != that.networkType) return false; - if (rnatAddress != null ? !rnatAddress.equals(that.rnatAddress) : that.rnatAddress != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (address != null ? address.hashCode() : 0); - result = 31 * result + networkType.hashCode(); - result = 31 * result + (broadcastAddress != null ? broadcastAddress.hashCode() : 0); - result = 31 * result + (gatewayAddress != null ? gatewayAddress.hashCode() : 0); - result = 31 * result + (rnatAddress != null ? rnatAddress.hashCode() : 0); - result = 31 * result + (ipAddresses != null ? ipAddresses.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", address="+address+", networkType="+networkType+", broadcastAddress="+broadcastAddress+", gatewayAddress="+gatewayAddress+", rnatAddress="+rnatAddress+", ipAddresses="+ipAddresses; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkSettings.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkSettings.java deleted file mode 100644 index 391459d41d..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/NetworkSettings.java +++ /dev/null @@ -1,125 +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.tmrk.enterprisecloud.domain.network; - -import org.jclouds.javax.annotation.Nullable; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class NetworkSettings { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromNetworkAdapterSetting(this); - } - - public static class Builder { - - private NetworkAdapterSettings networkAdapterSettings = NetworkAdapterSettings.builder().build(); - private DnsSettings dnsSettings; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.NetworkSettings#getNetworkAdapterSettings - */ - public Builder networkAdapterSettings(NetworkAdapterSettings networkAdapterSettings) { - this.networkAdapterSettings = networkAdapterSettings; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.NetworkSettings#getDnsSettings - */ - public Builder dnsSettings(DnsSettings dnsSettings) { - this.dnsSettings = dnsSettings; - return this; - } - - public NetworkSettings build() { - return new NetworkSettings(networkAdapterSettings, dnsSettings); - } - - public Builder fromNetworkAdapterSetting(NetworkSettings in) { - return networkAdapterSettings(in.getNetworkAdapterSettings()).dnsSettings(in.getDnsSettings()); - } - } - - @XmlElement(name = "NetworkAdapterSettings", required = false) - private NetworkAdapterSettings networkAdapterSettings; - - @XmlElement(name = "DnsSettings", required = false) - private DnsSettings dnsSettings; - - public NetworkSettings(@Nullable NetworkAdapterSettings networkAdapterSettings, @Nullable DnsSettings dnsSettings) { - this.networkAdapterSettings = networkAdapterSettings; - this.dnsSettings = dnsSettings; - } - - protected NetworkSettings() { - //For JAXB - } - - public NetworkAdapterSettings getNetworkAdapterSettings() { - return networkAdapterSettings; - } - - /** - * DnsSettings is optional. - * If not included, defaults to DNS for the data center. - * PrimaryDns is required if DnsSettings is included. - * @return - */ - public DnsSettings getDnsSettings() { - return dnsSettings; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - NetworkSettings that = (NetworkSettings) o; - - if (dnsSettings != null ? !dnsSettings.equals(that.dnsSettings) : that.dnsSettings != null) - return false; - if (networkAdapterSettings != null ? !networkAdapterSettings.equals(that.networkAdapterSettings) : that.networkAdapterSettings != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = networkAdapterSettings != null ? networkAdapterSettings.hashCode() : 0; - result = 31 * result + (dnsSettings != null ? dnsSettings.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "[networkAdapterSettings="+ networkAdapterSettings +",dnsSettings="+ dnsSettings +"]"; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/Networks.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/Networks.java deleted file mode 100644 index a888dd2f84..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/Networks.java +++ /dev/null @@ -1,182 +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.tmrk.enterprisecloud.domain.network; - -import com.google.common.collect.Sets; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Networks is more than a simple wrapper as it extends Resource. - * @author Jason King - * - */ -@XmlRootElement(name = "Networks") -public class Networks extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromTemplates(this); - } - - public static class Builder extends Resource.Builder { - private Set networks = Sets.newLinkedHashSet(); - - /** - * @see Networks#getNetworks - */ - public Builder networks(Set networks) { - this.networks =(checkNotNull(networks,"networks")); - return this; - } - - @Override - public Networks build() { - return new Networks(href, type, name, links, actions, networks); - } - - public Builder fromTemplates(Networks in) { - return fromResource(in).networks(in.getNetworks()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "Network", required = false) - private Set networks = Sets.newLinkedHashSet(); - - private Networks(URI href, String type, String name, Set links, Set actions, Set networks) { - super(href, type, name, links, actions); - this.networks = checkNotNull(networks,"networks"); - } - - private Networks() { - //For JAXB - } - - public Set getNetworks() { - return networks; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - Networks networks1 = (Networks) o; - - if (!networks.equals(networks1.networks)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + networks.hashCode(); - return result; - } - - @Override - public String string() { - return super.string()+", networks="+networks; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/Nics.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/Nics.java deleted file mode 100644 index eed23d9221..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/Nics.java +++ /dev/null @@ -1,108 +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.tmrk.enterprisecloud.domain.network; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.LinkedHashSet; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual VirtualNic elements. - * Needed because parsing is done with JAXB and it does not handle Generic collections - * - * @author Jason King - */ -public class Nics { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromNics(this); - } - - public static class Builder { - - private Set nics = Sets.newLinkedHashSet(); - - /** - * @see Nics#getVirtualNics() - */ - public Builder nics(Set nics) { - this.nics = Sets.newLinkedHashSet(checkNotNull(nics, "nics")); - return this; - } - - public Builder addVirtualNic(VirtualNic nic) { - nics.add(checkNotNull(nic,"nic")); - return this; - } - - public Nics build() { - return new Nics(nics); - } - - public Builder fromNics(Nics in) { - return nics(in.getVirtualNics()); - } - } - - private Nics() { - //For JAXB and builder use - } - - private Nics(Set nics) { - this.nics = Sets.newLinkedHashSet(nics); - } - - @XmlElement(name = "Nic") - private LinkedHashSet nics = Sets.newLinkedHashSet(); - - public Set getVirtualNics() { - return Collections.unmodifiableSet(nics); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Nics nics1 = (Nics) o; - - if (!nics.equals(nics1.nics)) return false; - - return true; - } - - @Override - public int hashCode() { - return nics.hashCode(); - } - - public String toString() { - return "["+ nics.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/VirtualNic.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/VirtualNic.java deleted file mode 100644 index 03bb25cd1e..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/VirtualNic.java +++ /dev/null @@ -1,164 +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.tmrk.enterprisecloud.domain.network; - -import org.jclouds.javax.annotation.Nullable; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class VirtualNic { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromVirtualNic(this); - } - - public static class Builder { - - private String name; - private String macAddress; - private int unitNumber; - private NetworkReference network; - - /** - * @see VirtualNic#getName - */ - public Builder name(String name) { - this.name = name; - return this; - } - - /** - * @see VirtualNic#getMacAddress - */ - public Builder macAddress(String macAddress) { - this.macAddress = macAddress; - return this; - } - - /** - * @see VirtualNic#getUnitNumber - */ - public Builder unitNumber(int unitNumber) { - this.unitNumber = unitNumber; - return this; - } - - /** - * @see VirtualNic#getNetwork - */ - public Builder network(NetworkReference network) { - this.network = network; - return this; - } - - public VirtualNic build() { - return new VirtualNic(name, macAddress, unitNumber, network); - } - - public Builder fromVirtualNic(VirtualNic in) { - return name(in.getName()) - .macAddress(in.getMacAddress()) - .unitNumber(in.getUnitNumber()) - .network(in.getNetwork()); - } - } - - @XmlElement(name = "Name") - private String name; - - @XmlElement(name = "MacAddress") - private String macAddress; - - @XmlElement(name = "UnitNumber") - private int unitNumber; - - @XmlElement(name = "Network") - private NetworkReference network; - - public VirtualNic(@Nullable String name, @Nullable String macAddress, int unitNumber, @Nullable NetworkReference network) { - this.name = name; - this.macAddress = macAddress; - this.unitNumber = unitNumber; - this.network = network; - } - - protected VirtualNic() { - //For JAXB - } - - @Nullable - public String getName() { - return name; - } - - @Nullable - public String getMacAddress() { - return macAddress; - } - - public int getUnitNumber() { - return unitNumber; - } - - @Nullable - public NetworkReference getNetwork() { - return network; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - VirtualNic that = (VirtualNic) o; - - if (unitNumber != that.unitNumber) return false; - if (macAddress != null ? !macAddress.equals(that.macAddress) : that.macAddress != null) - return false; - if (name != null ? !name.equals(that.name) : that.name != null) - return false; - if (network != null ? !network.equals(that.network) : that.network != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = name != null ? name.hashCode() : 0; - result = 31 * result + (macAddress != null ? macAddress.hashCode() : 0); - result = 31 * result + unitNumber; - result = 31 * result + (network != null ? network.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "[name="+name+",macAddress="+macAddress+",unitNumber="+unitNumber+",network="+network+"]"; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/WindowsCustomization.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/WindowsCustomization.java deleted file mode 100644 index 9c40126e37..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/network/WindowsCustomization.java +++ /dev/null @@ -1,141 +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.tmrk.enterprisecloud.domain.network; - -import org.jclouds.javax.annotation.Nullable; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class WindowsCustomization { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromLinuxCustomization(this); - } - - public static class Builder { - - private NetworkSettings networkSettings; - private String password; - private String licenseKey; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.WindowsCustomization#getNetworkSettings - */ - public Builder networkSettings(NetworkSettings networkSettings) { - this.networkSettings = networkSettings; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.WindowsCustomization#getPassword - */ - public Builder password(String password) { - this.password = password; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.network.WindowsCustomization#getLicenseKey - */ - public Builder licenseKey(String licenseKey) { - this.licenseKey = licenseKey; - return this; - } - - public WindowsCustomization build() { - return new WindowsCustomization(networkSettings, password, licenseKey); - } - - public Builder fromLinuxCustomization(WindowsCustomization in) { - return networkSettings(in.getNetworkSettings()).password(in.getPassword()).licenseKey(in.getLicenseKey()); - } - } - - @XmlElement(name = "NetworkSettings", required = false) - private NetworkSettings networkSettings; - - @XmlElement(name = "Password", required = false) - private String password; - - @XmlElement(name = "LicenseKey", required = false) - private String licenseKey; - - public WindowsCustomization(@Nullable NetworkSettings networkSettings, @Nullable String password, @Nullable String licenseKey) { - this.networkSettings = networkSettings; - this.password = password; - this.licenseKey = licenseKey; - } - - private WindowsCustomization() { - //For JAXB - } - - public NetworkSettings getNetworkSettings() { - return networkSettings; - } - - public String getPassword() { - return password; - } - - public String getLicenseKey() { - return licenseKey; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - WindowsCustomization that = (WindowsCustomization) o; - - if (licenseKey != null ? !licenseKey.equals(that.licenseKey) : that.licenseKey != null) - return false; - if (networkSettings != null ? !networkSettings.equals(that.networkSettings) : that.networkSettings != null) - return false; - if (password != null ? !password.equals(that.password) : that.password != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = networkSettings != null ? networkSettings.hashCode() : 0; - result = 31 * result + (password != null ? password.hashCode() : 0); - result = 31 * result + (licenseKey != null ? licenseKey.hashCode() : 0); - return result; - } - - @Override - public String toString() { - final String pw = password==null ? null : "*******"; - final String lic = licenseKey==null ? null : "*******"; - return "[networkSettings="+networkSettings+",password="+pw+",licenseKey="+lic+"]"; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistic.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistic.java deleted file mode 100644 index df066bcef4..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistic.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.tmrk.enterprisecloud.domain.resource; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - * - */ -public class ComputePoolPerformanceStatistic { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromComputePoolPerformanceStatistic(this); - } - - public static class Builder { - private NamedResource cpu; - private NamedResource memory; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolPerformanceStatistic#getCpu - */ - public Builder cpu(NamedResource cpu) { - this.cpu = cpu; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolPerformanceStatistic#getMemory - */ - public Builder memory(NamedResource memory) { - this.memory = memory; - return this; - } - - public ComputePoolPerformanceStatistic build() { - return new ComputePoolPerformanceStatistic(cpu, memory); - } - - public Builder fromComputePoolPerformanceStatistic(ComputePoolPerformanceStatistic in) { - return cpu(in.getCpu()).memory(in.getMemory()); - } - } - - @XmlElement(name = "Cpu", required = false) - private NamedResource cpu; - - @XmlElement(name = "Memory", required = false) - private NamedResource memory; - - private ComputePoolPerformanceStatistic(@Nullable NamedResource cpu, @Nullable NamedResource memory) { - this.cpu = cpu; - this.memory = memory; - } - - private ComputePoolPerformanceStatistic() { - //For JAXB - } - - public NamedResource getCpu() { - return cpu; - } - - public NamedResource getMemory() { - return memory; - } - - @Override - public String toString() { - return "cpu="+cpu+", memory="+memory; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistics.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistics.java deleted file mode 100644 index 5a67b45ac0..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolPerformanceStatistics.java +++ /dev/null @@ -1,202 +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.tmrk.enterprisecloud.domain.resource; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -/** - * - * @author Jason King - * - */ -@XmlRootElement(name = "ComputePoolPerformanceStatistics") -public class ComputePoolPerformanceStatistics extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromComputePoolResourceSummary(this); - } - - public static class Builder extends Resource.Builder { - ComputePoolPerformanceStatistic hourly; - ComputePoolPerformanceStatistic daily; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolPerformanceStatistics#getHourly - */ - public Builder hourly(ComputePoolPerformanceStatistic hourly) { - this.hourly = hourly; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolPerformanceStatistics#getDaily - */ - public Builder daily(ComputePoolPerformanceStatistic daily) { - this.daily = daily; - return this; - } - - @Override - public ComputePoolPerformanceStatistics build() { - return new ComputePoolPerformanceStatistics(href, type, name, links, actions, hourly, daily); - } - - public Builder fromComputePoolResourceSummary(ComputePoolPerformanceStatistics in) { - return fromResource(in).hourly(in.getHourly()).daily(in.getDaily()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "Hourly", required = false) - ComputePoolPerformanceStatistic hourly; - - @XmlElement(name = "Daily", required = false) - ComputePoolPerformanceStatistic daily; - - private ComputePoolPerformanceStatistics(URI href, String type, String name, Set links, Set actions, - @Nullable ComputePoolPerformanceStatistic hourly, @Nullable ComputePoolPerformanceStatistic daily) { - super(href, type, name, links, actions); - this.hourly = hourly; - this.daily = daily; - } - - private ComputePoolPerformanceStatistics() { - //For JAXB - } - - public ComputePoolPerformanceStatistic getHourly() { - return hourly; - } - - public ComputePoolPerformanceStatistic getDaily() { - return daily; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - ComputePoolPerformanceStatistics that = (ComputePoolPerformanceStatistics) o; - - if (daily != null ? !daily.equals(that.daily) : that.daily != null) - return false; - if (hourly != null ? !hourly.equals(that.hourly) : that.hourly != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (hourly != null ? hourly.hashCode() : 0); - result = 31 * result + (daily != null ? daily.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", hourly="+hourly+", daily="+daily; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolResourceSummary.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolResourceSummary.java deleted file mode 100644 index 599517b74c..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolResourceSummary.java +++ /dev/null @@ -1,286 +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.tmrk.enterprisecloud.domain.resource; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; -import org.jclouds.tmrk.enterprisecloud.domain.resource.cpu.CpuComputeResourceSummary; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Date; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - * - */ -@XmlRootElement(name = "ComputePoolResourceSummary") -public class ComputePoolResourceSummary extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromComputePoolResourceSummary(this); - } - - public static class Builder extends Resource.Builder { - private Date startTime; - private Date endTime; - private CpuComputeResourceSummary cpu; - private MemoryComputeResourceSummary memory; - private StorageResourceSummary storage; - private VirtualMachineResourceSummary virtualMachines; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolResourceSummary#getStartTime - */ - public Builder startTime(Date startTime) { - this.startTime = startTime; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolResourceSummary#getEndTime - */ - public Builder endTime(Date endTime) { - this.endTime = endTime; - return this; - } - - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolResourceSummary#getCpu - */ - public Builder cpu(CpuComputeResourceSummary cpu) { - this.cpu = cpu; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolResourceSummary#getMemory - */ - public Builder memory(MemoryComputeResourceSummary memory) { - this.memory = memory; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolResourceSummary#getStorage - */ - public Builder storage(StorageResourceSummary storage) { - this.storage = storage; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolResourceSummary#getVirtualMachines - */ - public Builder virtualMachines(VirtualMachineResourceSummary virtualMachines) { - this.virtualMachines = virtualMachines; - return this; - } - - @Override - public ComputePoolResourceSummary build() { - return new ComputePoolResourceSummary(href, type, name, links, actions, - startTime, endTime, cpu, memory, storage, virtualMachines); - } - - public Builder fromComputePoolResourceSummary(ComputePoolResourceSummary in) { - return fromResource(in).startTime(in.getStartTime()).endTime(in.getEndTime()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "StartTime", required = true) - private Date startTime; - - @XmlElement(name = "EndTime", required = true) - private Date endTime; - - @XmlElement(name = "Cpu", required = false) - private CpuComputeResourceSummary cpu; - - @XmlElement(name = "Memory", required = false) - private MemoryComputeResourceSummary memory; - - @XmlElement(name = "Storage", required = false) - private StorageResourceSummary storage; - - @XmlElement(name = "VirtualMachines", required = false) - private VirtualMachineResourceSummary virtualMachines; - - private ComputePoolResourceSummary(URI href, String type, String name, Set links, Set actions, Date startTime, Date completedTime, - @Nullable CpuComputeResourceSummary cpu, @Nullable MemoryComputeResourceSummary memory, @Nullable StorageResourceSummary storage, @Nullable VirtualMachineResourceSummary virtualMachines) { - super(href, type, name, links, actions); - this.startTime = checkNotNull(startTime, "startTime"); - this.endTime = checkNotNull(endTime, "endTime"); - this.cpu = cpu; - this.memory = memory; - this.storage = storage; - this.virtualMachines = virtualMachines; - } - - private ComputePoolResourceSummary() { - //For JAXB - } - - public Date getStartTime() { - return startTime; - } - - public Date getEndTime() { - return endTime; - } - - public CpuComputeResourceSummary getCpu() { - return cpu; - } - - public MemoryComputeResourceSummary getMemory() { - return memory; - } - - public StorageResourceSummary getStorage() { - return storage; - } - - public VirtualMachineResourceSummary getVirtualMachines() { - return virtualMachines; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - ComputePoolResourceSummary that = (ComputePoolResourceSummary) o; - - if (cpu != null ? !cpu.equals(that.cpu) : that.cpu != null) return false; - if (!endTime.equals(that.endTime)) return false; - if (memory != null ? !memory.equals(that.memory) : that.memory != null) - return false; - if (!startTime.equals(that.startTime)) return false; - if (storage != null ? !storage.equals(that.storage) : that.storage != null) - return false; - if (virtualMachines != null ? !virtualMachines.equals(that.virtualMachines) : that.virtualMachines != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + startTime.hashCode(); - result = 31 * result + endTime.hashCode(); - result = 31 * result + (cpu != null ? cpu.hashCode() : 0); - result = 31 * result + (memory != null ? memory.hashCode() : 0); - result = 31 * result + (storage != null ? storage.hashCode() : 0); - result = 31 * result + (virtualMachines != null ? virtualMachines.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", startTime="+startTime+", endTime="+endTime+", cpu="+cpu+", memory="+memory+", storage="+storage+", virtualMachines="+virtualMachines; - } - -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolResourceSummaryList.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolResourceSummaryList.java deleted file mode 100644 index fbd949bd01..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputePoolResourceSummaryList.java +++ /dev/null @@ -1,184 +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.tmrk.enterprisecloud.domain.resource; - -import com.google.common.collect.Sets; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * ComputePoolResourceSummaryList is more than a simple wrapper as it extends Resource. - * - * @author Jason King - * - */ -@XmlRootElement(name = "ComputePoolResourceSummaryList") -public class ComputePoolResourceSummaryList extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromSummaryList(this); - } - - public static class Builder extends Resource.Builder { - private Set summaries = Sets.newLinkedHashSet(); - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputePoolResourceSummaryList#getComputePoolResourceSummaries - */ - public Builder summaries(Set summaries) { - this.summaries =(checkNotNull(summaries,"summaries")); - return this; - } - - @Override - public ComputePoolResourceSummaryList build() { - return new ComputePoolResourceSummaryList(href, type, name, links, actions, summaries); - } - - public Builder fromSummaryList(ComputePoolResourceSummaryList in) { - return fromResource(in).summaries(in.getComputePoolResourceSummaries()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "ComputePoolResourceSummary") - private Set summaries = Sets.newLinkedHashSet(); - - private ComputePoolResourceSummaryList(URI href, String type, String name, Set links, Set actions, Set summaries) { - super(href, type, name, links, actions); - this.summaries = checkNotNull(summaries,"summaries"); - } - - private ComputePoolResourceSummaryList() { - //For JAXB - } - - public Set getComputePoolResourceSummaries() { - return summaries; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - ComputePoolResourceSummaryList that = (ComputePoolResourceSummaryList) o; - - if (!summaries.equals(that.summaries)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + summaries.hashCode(); - return result; - } - - @Override - public String string() { - return super.string()+", summaries="+summaries; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputeResourceSummary.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputeResourceSummary.java deleted file mode 100644 index b57c05497d..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/ComputeResourceSummary.java +++ /dev/null @@ -1,162 +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.tmrk.enterprisecloud.domain.resource; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class ComputeResourceSummary { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromComputeResourceSummary(this); - } - - public static class Builder { - protected ResourceCapacity allocated; - protected ResourceCapacity consumed; - protected ResourceCapacity purchased; - protected int utilization; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputeResourceSummary#getAllocated - */ - public Builder allocated(ResourceCapacity allocated) { - this.allocated = allocated; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputeResourceSummary#getConsumed - */ - public Builder consumed(ResourceCapacity consumed) { - this.consumed = consumed; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputeResourceSummary#getPurchased - */ - public Builder purchased(ResourceCapacity purchased) { - this.purchased = purchased; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.ComputeResourceSummary#getUtilization - */ - public Builder utilization(int utilization) { - this.utilization = utilization; - return this; - } - - public ComputeResourceSummary build() { - return new ComputeResourceSummary(allocated,consumed,purchased,utilization); - } - - public Builder fromComputeResourceSummary(ComputeResourceSummary in) { - return allocated(in.getAllocated()).consumed(in.getConsumed()).purchased(in.getPurchased()).utilization(in.getUtilization()); - } - } - - @XmlElement(name = "Allocated", required = false) - private ResourceCapacity allocated; - - @XmlElement(name = "Consumed", required = false) - private ResourceCapacity consumed; - - @XmlElement(name = "Purchased", required = false) - private ResourceCapacity purchased; - - @XmlElement(name = "Utilization", required = false) - private int utilization; - - protected ComputeResourceSummary(@Nullable ResourceCapacity allocated, @Nullable ResourceCapacity consumed, @Nullable ResourceCapacity purchased, int utilization) { - this.allocated = allocated; - this.consumed = consumed; - this.purchased = purchased; - this.utilization = utilization; - } - - protected ComputeResourceSummary() { - //For JAXB - } - - public ResourceCapacity getAllocated() { - return allocated; - } - - public ResourceCapacity getConsumed() { - return consumed; - } - - public ResourceCapacity getPurchased() { - return purchased; - } - - public int getUtilization() { - return utilization; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ComputeResourceSummary that = (ComputeResourceSummary) o; - - if (utilization != that.utilization) return false; - if (allocated != null ? !allocated.equals(that.allocated) : that.allocated != null) - return false; - if (consumed != null ? !consumed.equals(that.consumed) : that.consumed != null) - return false; - if (purchased != null ? !purchased.equals(that.purchased) : that.purchased != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = allocated != null ? allocated.hashCode() : 0; - result = 31 * result + (consumed != null ? consumed.hashCode() : 0); - result = 31 * result + (purchased != null ? purchased.hashCode() : 0); - result = 31 * result + utilization; - return result; - } - - @Override - public String toString() { - return String.format("[%s]",string()); - } - - protected String string() { - return "allocated="+ allocated +", consumed="+consumed+", purchased="+purchased+", utilization="+utilization; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/MemoryComputeResourceSummary.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/MemoryComputeResourceSummary.java deleted file mode 100644 index 32368486f4..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/MemoryComputeResourceSummary.java +++ /dev/null @@ -1,73 +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.tmrk.enterprisecloud.domain.resource; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -/** - * - * @author Jason King - */ -public class MemoryComputeResourceSummary extends ComputeResourceSummary { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromMemoryComputeResourceSummary(this); - } - - public static class Builder extends ComputeResourceSummary.Builder { - - public Builder allocated(ResourceCapacity allocated) { - return Builder.class.cast(super.allocated(allocated)); - } - - public Builder consumed(ResourceCapacity consumed) { - return Builder.class.cast(super.consumed(consumed)); - } - - public Builder purchased(ResourceCapacity purchased) { - return Builder.class.cast(super.purchased(purchased)); - } - - public Builder utilization(int utilization) { - return Builder.class.cast(super.utilization(utilization)); - } - - public MemoryComputeResourceSummary build() { - return new MemoryComputeResourceSummary(allocated,consumed,purchased,utilization); - } - - public Builder fromMemoryComputeResourceSummary(MemoryComputeResourceSummary in) { - return allocated(in.getAllocated()).consumed(in.getConsumed()).purchased(in.getPurchased()).utilization(in.getUtilization()); - } - } - - private MemoryComputeResourceSummary(@Nullable ResourceCapacity allocated, @Nullable ResourceCapacity consumed, @Nullable ResourceCapacity purchased, int utilization) { - super(allocated,consumed,purchased,utilization); - } - - private MemoryComputeResourceSummary() { - //For JAXB - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/PerformanceStatistic.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/PerformanceStatistic.java deleted file mode 100644 index 85a8807d9b..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/PerformanceStatistic.java +++ /dev/null @@ -1,123 +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.tmrk.enterprisecloud.domain.resource; - -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.util.Date; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - * - */ -@XmlRootElement(name = "PerformanceStatistic") -public class PerformanceStatistic { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromPerformanceStatistic(this); - } - - public static class Builder { - private Date time; - private ResourceCapacity used; - - /** - * @see PerformanceStatistic#getTime - */ - public Builder time(Date time) { - this.time =(checkNotNull(time,"time")); - return this; - } - - /** - * @see PerformanceStatistic#getUsed - */ - public Builder used(ResourceCapacity used) { - this.used =(checkNotNull(used,"used")); - return this; - } - - public PerformanceStatistic build() { - return new PerformanceStatistic(time,used); - } - - public Builder fromPerformanceStatistic(PerformanceStatistic in) { - return time(in.getTime()).used(in.getUsed()); - } - } - - @XmlElement(name = "Time", required = true) - private Date time; - - @XmlElement(name = "Used", required = false) - private ResourceCapacity used; - - private PerformanceStatistic(Date time, ResourceCapacity used) { - this.time = checkNotNull(time, "time"); - this.used = used; - } - - private PerformanceStatistic() { - //For JAXB - } - - public Date getTime() { - return time; - } - - public ResourceCapacity getUsed() { - return used; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - PerformanceStatistic that = (PerformanceStatistic) o; - - if (!time.equals(that.time)) return false; - if (used != null ? !used.equals(that.used) : that.used != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = time.hashCode(); - result = 31 * result + (used != null ? used.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "[time="+time+", used="+used+"]"; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/PerformanceStatistics.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/PerformanceStatistics.java deleted file mode 100644 index ad09997811..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/PerformanceStatistics.java +++ /dev/null @@ -1,224 +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.tmrk.enterprisecloud.domain.resource; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Date; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * PerformanceStatistics is more than a simple wrapper as it extends BaseResource. - * - * @author Jason King - * - */ -@XmlRootElement(name = "PerformanceStatistics") -public class PerformanceStatistics extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromPerformanceStatistics(this); - } - - public static class Builder extends Resource.Builder { - private Date startTime; - private Date endTime; - private VirtualMachinePerformanceStatistics statistics; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.PerformanceStatistics#getStartTime - */ - public Builder startTime(Date startTime) { - this.startTime =(checkNotNull(startTime,"startTime")); - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.PerformanceStatistics#getEndTime - */ - public Builder endTime(Date endTime) { - this.endTime =(checkNotNull(endTime,"endTime")); - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.PerformanceStatistics#getStatistics - */ - public Builder statistics(VirtualMachinePerformanceStatistics statistics) { - this.statistics =(checkNotNull(statistics,"statistics")); - return this; - } - - @Override - public PerformanceStatistics build() { - return new PerformanceStatistics(href, type, name, links, actions, startTime, endTime, statistics); - } - - public Builder fromPerformanceStatistics(PerformanceStatistics in) { - return fromResource(in).startTime(in.getStartTime()).endTime(in.getEndTime()).statistics(in.getStatistics()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "StartTime", required = true) - private Date startTime; - - @XmlElement(name = "EndTime", required = true) - private Date endTime; - - @XmlElement(name = "VirtualMachines", required = false) - private VirtualMachinePerformanceStatistics statistics; - - private PerformanceStatistics(URI href, String type, String name, Set links, Set actions, - Date startTime, Date endTime, @Nullable VirtualMachinePerformanceStatistics statistics) { - super(href, type, name, links, actions); - this.startTime = startTime; - this.endTime = endTime; - this.statistics = statistics; - } - - private PerformanceStatistics() { - //For JAXB - } - - public Date getStartTime() { - return startTime; - } - - public Date getEndTime() { - return endTime; - } - - public VirtualMachinePerformanceStatistics getStatistics() { - return statistics; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - PerformanceStatistics that = (PerformanceStatistics) o; - - if (!endTime.equals(that.endTime)) return false; - if (!startTime.equals(that.startTime)) return false; - if (statistics != null ? !statistics.equals(that.statistics) : that.statistics != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + startTime.hashCode(); - result = 31 * result + endTime.hashCode(); - result = 31 * result + (statistics != null ? statistics.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", startTime="+ startTime+", endTime="+ endTime+", statistics="+ statistics; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/StorageResourceSummary.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/StorageResourceSummary.java deleted file mode 100644 index 91dea77892..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/StorageResourceSummary.java +++ /dev/null @@ -1,123 +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.tmrk.enterprisecloud.domain.resource; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class StorageResourceSummary { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromStorageResourceSummary(this); - } - - public static class Builder { - private ResourceCapacity purchased; - private ResourceCapacity used; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.StorageResourceSummary#getPurchased - */ - public Builder purchased(ResourceCapacity purchased) { - this.purchased = purchased; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.StorageResourceSummary#getUsed - */ - public Builder used(ResourceCapacity used) { - this.used = used; - return this; - } - - public StorageResourceSummary build() { - return new StorageResourceSummary(purchased,used); - } - - public Builder fromStorageResourceSummary(StorageResourceSummary in) { - return purchased(in.getPurchased()).used(in.getUsed()); - } - } - - @XmlElement(name = "Purchased", required = false) - private ResourceCapacity purchased; - - @XmlElement(name = "Used", required = false) - private ResourceCapacity used; - - protected StorageResourceSummary(@Nullable ResourceCapacity purchased, @Nullable ResourceCapacity used) { - this.purchased = purchased; - this.used = used; - } - - protected StorageResourceSummary() { - //For JAXB - } - - public ResourceCapacity getPurchased() { - return purchased; - } - - public ResourceCapacity getUsed() { - return used; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - StorageResourceSummary that = (StorageResourceSummary) o; - - if (purchased != null ? !purchased.equals(that.purchased) : that.purchased != null) - return false; - if (used != null ? !used.equals(that.used) : that.used != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = purchased != null ? purchased.hashCode() : 0; - result = 31 * result + (used != null ? used.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return String.format("[%s]",string()); - } - - protected String string() { - return "purchased="+purchased+", used="+ used; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachinePerformanceStatistic.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachinePerformanceStatistic.java deleted file mode 100644 index 464acbb5ed..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachinePerformanceStatistic.java +++ /dev/null @@ -1,184 +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.tmrk.enterprisecloud.domain.resource; - -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import java.net.URI; -import java.util.Collections; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * VirtualMachinePerformanceStatistic is more than a simple wrapper as it extends BaseResource. - * - * @author Jason King - * - */ -public class VirtualMachinePerformanceStatistic extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromVirtualMachinePerformanceStatistic(this); - } - - public static class Builder extends Resource.Builder { - private Set statistics = Sets.newLinkedHashSet(); - - /** - * @see VirtualMachinePerformanceStatistic#getStatistics - */ - public Builder statistics(Set statistics) { - this.statistics =(checkNotNull(statistics,"statistics")); - return this; - } - - @Override - public VirtualMachinePerformanceStatistic build() { - return new VirtualMachinePerformanceStatistic(href, type, name, links, actions, statistics); - } - - public Builder fromVirtualMachinePerformanceStatistic(VirtualMachinePerformanceStatistic in) { - return fromResource(in).statistics(in.getStatistics()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "PerformanceStatistic", required = false) - private Set statistics = Sets.newLinkedHashSet(); - - private VirtualMachinePerformanceStatistic(URI href, String type, String name, Set links, Set actions, Set statistics) { - super(href, type, name, links, actions); - this.statistics = ImmutableSet.copyOf(statistics); - } - - private VirtualMachinePerformanceStatistic() { - //For JAXB - } - - public Set getStatistics() { - return Collections.unmodifiableSet(statistics); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - VirtualMachinePerformanceStatistic templates = (VirtualMachinePerformanceStatistic) o; - - if (statistics != null ? !statistics.equals(templates.statistics) : templates.statistics != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (statistics != null ? statistics.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", statistics="+ statistics; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachinePerformanceStatistics.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachinePerformanceStatistics.java deleted file mode 100644 index 9bcdb29bdf..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachinePerformanceStatistics.java +++ /dev/null @@ -1,102 +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.tmrk.enterprisecloud.domain.resource; - -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual VirtualMachinePerformanceStatistic elements. - * Needed because parsing is done with JAXB and it does not handle Generic collections - * @author Jason King - */ -public class VirtualMachinePerformanceStatistics { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromVirtualMachinePerformanceStatistics(this); - } - - public static class Builder { - - private Set virtualMachines = Sets.newLinkedHashSet(); - - /** - * @see VirtualMachinePerformanceStatistics#getVirtualMachinesPerformanceStatistics - */ - public Builder virtualMachines(Set virtualMachines) { - this.virtualMachines = Sets.newLinkedHashSet(checkNotNull(virtualMachines, "virtualMachines")); - return this; - } - - public VirtualMachinePerformanceStatistics build() { - return new VirtualMachinePerformanceStatistics(virtualMachines); - } - - public Builder fromVirtualMachinePerformanceStatistics(VirtualMachinePerformanceStatistics in) { - return virtualMachines(in.getVirtualMachinesPerformanceStatistics()); - } - } - - @XmlElement(name = "VirtualMachine", required = false) - private Set virtualMachines = Sets.newLinkedHashSet(); - - private VirtualMachinePerformanceStatistics() { - //For JAXB - } - - private VirtualMachinePerformanceStatistics(Set virtualMachines) { - this.virtualMachines = ImmutableSet.copyOf(virtualMachines); - } - - public Set getVirtualMachinesPerformanceStatistics() { - return Collections.unmodifiableSet(virtualMachines); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - VirtualMachinePerformanceStatistics links1 = (VirtualMachinePerformanceStatistics) o; - - if (!virtualMachines.equals(links1.virtualMachines)) return false; - - return true; - } - - @Override - public int hashCode() { - return virtualMachines.hashCode(); - } - - public String toString() { - return "["+ virtualMachines.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachineResourceSummary.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachineResourceSummary.java deleted file mode 100644 index c45890ac51..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/VirtualMachineResourceSummary.java +++ /dev/null @@ -1,132 +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.tmrk.enterprisecloud.domain.resource; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class VirtualMachineResourceSummary extends ComputeResourceSummary { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromVirtualMachineResourceSummary(this); - } - - public static class Builder extends ComputeResourceSummary.Builder { - - protected int count; - protected int poweredOnCount; - - public Builder allocated(ResourceCapacity allocated) { - return Builder.class.cast(super.allocated(allocated)); - } - - public Builder consumed(ResourceCapacity consumed) { - return Builder.class.cast(super.consumed(consumed)); - } - - public Builder purchased(ResourceCapacity purchased) { - return Builder.class.cast(super.purchased(purchased)); - } - - public Builder utilization(int utilization) { - return Builder.class.cast(super.utilization(utilization)); - } - - public Builder count(int count) { - this.count = count; - return this; - } - - public Builder poweredOnCount(int poweredOnCount) { - this.poweredOnCount = poweredOnCount; - return this; - } - - public VirtualMachineResourceSummary build() { - return new VirtualMachineResourceSummary(allocated,consumed,purchased,utilization,count,poweredOnCount); - } - - public Builder fromVirtualMachineResourceSummary(VirtualMachineResourceSummary in) { - return allocated(in.getAllocated()).consumed(in.getConsumed()).purchased(in.getPurchased()).utilization(in.getUtilization()) - .count(in.getCount()).poweredOnCount(in.getPoweredOnCount()); - } - } - - @XmlElement(name = "Count", required = false) - private int count; - - @XmlElement(name = "PoweredOnCount", required = false) - private int poweredOnCount; - - private VirtualMachineResourceSummary(@Nullable ResourceCapacity allocated, @Nullable ResourceCapacity consumed, @Nullable ResourceCapacity purchased, int utilization, int count, int poweredOnCount) { - super(allocated,consumed,purchased,utilization); - this.count = count; - this.poweredOnCount = poweredOnCount; - } - - private VirtualMachineResourceSummary() { - //For JAXB - } - - public int getCount() { - return count; - } - - public int getPoweredOnCount() { - return poweredOnCount; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - VirtualMachineResourceSummary that = (VirtualMachineResourceSummary) o; - - if (count != that.count) return false; - if (poweredOnCount != that.poweredOnCount) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + count; - result = 31 * result + poweredOnCount; - return result; - } - - @Override - public String string() { - return super.string()+", count="+count+", poweredOnCount="+poweredOnCount; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsage.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsage.java deleted file mode 100644 index a0274ab795..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsage.java +++ /dev/null @@ -1,223 +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.tmrk.enterprisecloud.domain.resource.cpu; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Date; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * ComputePoolCpuUsage is more than a simple wrapper as it extends Resource. - * - * @author Jason King - * - */ -@XmlRootElement(name = "ComputePoolCpuUsage") -public class ComputePoolCpuUsage extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromComputePoolCpuUsage(this); - } - - public static class Builder extends Resource.Builder { - private Date startTime; - private Date endTime; - private CpuUsageDetails details; - - /** - * @see ComputePoolCpuUsage#getStartTime - */ - public Builder startTime(Date startTime) { - this.startTime =(checkNotNull(startTime,"startTime")); - return this; - } - - /** - * @see ComputePoolCpuUsage#getEndTime - */ - public Builder endTime(Date endTime) { - this.endTime =(checkNotNull(endTime,"endTime")); - return this; - } - - /** - * @see ComputePoolCpuUsage#getDetails - */ - public Builder details(CpuUsageDetails details) { - this.details =(checkNotNull(details,"details")); - return this; - } - - @Override - public ComputePoolCpuUsage build() { - return new ComputePoolCpuUsage(href, type, name, links, actions, startTime, endTime, details); - } - - public Builder fromComputePoolCpuUsage(ComputePoolCpuUsage in) { - return fromResource(in).startTime(in.getStartTime()).endTime(in.getEndTime()).details(in.getDetails()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "StartTime", required = true) - private Date startTime; - - @XmlElement(name = "EndTime", required = true) - private Date endTime; - - @XmlElement(name = "CpuUsageDetailSummary", required = false) - private CpuUsageDetails details; - - private ComputePoolCpuUsage(URI href, String type, String name, Set links, Set actions, Date startTime, Date endTime, @Nullable CpuUsageDetails details) { - super(href, type, name, links, actions); - this.startTime = checkNotNull(startTime, "startTime"); - this.endTime = checkNotNull(endTime, "endTime"); - this.details = details; - } - - private ComputePoolCpuUsage() { - //For JAXB - } - - public Date getStartTime() { - return startTime; - } - - public Date getEndTime() { - return endTime; - } - - public CpuUsageDetails getDetails() { - return details; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - ComputePoolCpuUsage that = (ComputePoolCpuUsage) o; - - if (details != null ? !details.equals(that.details) : that.details != null) - return false; - if (!endTime.equals(that.endTime)) return false; - if (!startTime.equals(that.startTime)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + startTime.hashCode(); - result = 31 * result + endTime.hashCode(); - result = 31 * result + (details != null ? details.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", startTime="+startTime+", endTime="+endTime+", details="+details; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsageDetail.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsageDetail.java deleted file mode 100644 index 434024c8a6..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsageDetail.java +++ /dev/null @@ -1,225 +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.tmrk.enterprisecloud.domain.resource.cpu; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Date; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * ComputePoolCpuUsageDetail is more than a simple wrapper as it extends Resource. - * - * @author Jason King - * - */ -@XmlRootElement(name = "ComputePoolCpuUsageDetail") -public class ComputePoolCpuUsageDetail extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromComputePoolCpuUsage(this); - } - - public static class Builder extends Resource.Builder { - private Date time; - private ResourceCapacity value; - private VirtualMachinesCpuUsage virtualMachinesCpuUsage; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.cpu.ComputePoolCpuUsageDetail#getTime - */ - public Builder time(Date time) { - this.time =(checkNotNull(time,"time")); - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.cpu.ComputePoolCpuUsageDetail#getValue - */ - public Builder value(ResourceCapacity value) { - this.value =(checkNotNull(value,"value")); - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.cpu.ComputePoolCpuUsageDetail#getVirtualMachinesCpuUsage - */ - public Builder virtualMachines(VirtualMachinesCpuUsage virtualMachinesCpuUsage) { - this.virtualMachinesCpuUsage =(checkNotNull(virtualMachinesCpuUsage,"virtualMachinesCpuUsage")); - return this; - } - - @Override - public ComputePoolCpuUsageDetail build() { - return new ComputePoolCpuUsageDetail(href, type, name, links, actions, time, value, virtualMachinesCpuUsage); - } - - public Builder fromComputePoolCpuUsage(ComputePoolCpuUsageDetail in) { - return fromResource(in).time(in.getTime()).value(in.getValue()).virtualMachines(in.getVirtualMachinesCpuUsage()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "Time", required = true) - private Date time; - - @XmlElement(name = "Value", required = false) - private ResourceCapacity value; - - @XmlElement(name = "VirtualMachines", required = false) - private VirtualMachinesCpuUsage virtualMachinesCpuUsage; - - private ComputePoolCpuUsageDetail(URI href, String type, String name, Set links, Set actions, Date time, @Nullable ResourceCapacity value, @Nullable VirtualMachinesCpuUsage virtualMachinesCpuUsage) { - super(href, type, name, links, actions); - this.time = checkNotNull(time, "time"); - this.value = value; - this.virtualMachinesCpuUsage = virtualMachinesCpuUsage; - } - - private ComputePoolCpuUsageDetail() { - //For JAXB - } - - public Date getTime() { - return time; - } - - public ResourceCapacity getValue() { - return value; - } - - public VirtualMachinesCpuUsage getVirtualMachinesCpuUsage() { - return virtualMachinesCpuUsage; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - ComputePoolCpuUsageDetail that = (ComputePoolCpuUsageDetail) o; - - if (!time.equals(that.time)) return false; - if (value != null ? !value.equals(that.value) : that.value != null) - return false; - if (virtualMachinesCpuUsage != null ? !virtualMachinesCpuUsage.equals(that.virtualMachinesCpuUsage) : that.virtualMachinesCpuUsage != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + time.hashCode(); - result = 31 * result + (value != null ? value.hashCode() : 0); - result = 31 * result + (virtualMachinesCpuUsage != null ? virtualMachinesCpuUsage.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", time="+ time +", value="+value+", virtualMachinesCpuUsage="+ virtualMachinesCpuUsage; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsageDetailSummaryEntry.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsageDetailSummaryEntry.java deleted file mode 100644 index c59b9fae96..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/ComputePoolCpuUsageDetailSummaryEntry.java +++ /dev/null @@ -1,127 +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.tmrk.enterprisecloud.domain.resource.cpu; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Date; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - * - */ -public class ComputePoolCpuUsageDetailSummaryEntry { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - public Builder toBuilder() { - return new Builder().ComputePoolCpuUsageDetailSummaryEntry(this); - } - - public static class Builder { - private Date time; - private ResourceCapacity value; - - /** - * @see ComputePoolCpuUsageDetailSummaryEntry#getTime - */ - public Builder time(Date time) { - this.time = time; - return this; - } - - /** - * @see ComputePoolCpuUsageDetailSummaryEntry#getValue - */ - public Builder value(ResourceCapacity value) { - this.value = value; - return this; - } - - public ComputePoolCpuUsageDetailSummaryEntry build() { - return new ComputePoolCpuUsageDetailSummaryEntry(time,value); - } - - public Builder ComputePoolCpuUsageDetailSummaryEntry(ComputePoolCpuUsageDetailSummaryEntry in) { - return time(in.getTime()).value(in.getValue()); - } - } - - @XmlElement(name = "Time", required = true) - private Date time; - - @XmlElement(name = "Value", required = false) - private ResourceCapacity value; - - - private ComputePoolCpuUsageDetailSummaryEntry(Date time,@Nullable ResourceCapacity value) { - this.time = checkNotNull(time, "time"); - this.value = value; - } - - private ComputePoolCpuUsageDetailSummaryEntry() { - //For JAXB - } - - public Date getTime() { - return time; - } - - public ResourceCapacity getValue() { - return value; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ComputePoolCpuUsageDetailSummaryEntry that = (ComputePoolCpuUsageDetailSummaryEntry) o; - - if (!time.equals(that.time)) return false; - if (value != null ? !value.equals(that.value) : that.value != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = time.hashCode(); - result = 31 * result + (value != null ? value.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "[time="+ time +", value="+value+"]"; - } - -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/CpuComputeResourceSummary.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/CpuComputeResourceSummary.java deleted file mode 100644 index 707e8d8d23..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/CpuComputeResourceSummary.java +++ /dev/null @@ -1,133 +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.tmrk.enterprisecloud.domain.resource.cpu; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; -import org.jclouds.tmrk.enterprisecloud.domain.resource.ComputeResourceSummary; - -import javax.xml.bind.annotation.XmlElement; - -/** - * - * @author Jason King - */ -public class CpuComputeResourceSummary extends ComputeResourceSummary { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromCpuComputeResourceSummary(this); - } - - public static class Builder extends ComputeResourceSummary.Builder { - - protected int count; - protected int poweredOnCount; - - public Builder allocated(ResourceCapacity allocated) { - return Builder.class.cast(super.allocated(allocated)); - } - - public Builder consumed(ResourceCapacity consumed) { - return Builder.class.cast(super.consumed(consumed)); - } - - public Builder purchased(ResourceCapacity purchased) { - return Builder.class.cast(super.purchased(purchased)); - } - - public Builder utilization(int utilization) { - return Builder.class.cast(super.utilization(utilization)); - } - - public Builder count(int count) { - this.count = count; - return this; - } - - public Builder poweredOnCount(int poweredOnCount) { - this.poweredOnCount = poweredOnCount; - return this; - } - - public CpuComputeResourceSummary build() { - return new CpuComputeResourceSummary(allocated,consumed,purchased,utilization,count,poweredOnCount); - } - - public Builder fromCpuComputeResourceSummary(CpuComputeResourceSummary in) { - return allocated(in.getAllocated()).consumed(in.getConsumed()).purchased(in.getPurchased()).utilization(in.getUtilization()) - .count(in.getCount()).poweredOnCount(in.getPoweredOnCount()); - } - } - - @XmlElement(name = "Count", required = false) - private int count; - - @XmlElement(name = "PoweredOnCount", required = false) - private int poweredOnCount; - - private CpuComputeResourceSummary(@Nullable ResourceCapacity allocated, @Nullable ResourceCapacity consumed, @Nullable ResourceCapacity purchased, int utilization, int count, int poweredOnCount) { - super(allocated,consumed,purchased,utilization); - this.count = count; - this.poweredOnCount = poweredOnCount; - } - - private CpuComputeResourceSummary() { - //For JAXB - } - - public int getCount() { - return count; - } - - public int getPoweredOnCount() { - return poweredOnCount; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - CpuComputeResourceSummary that = (CpuComputeResourceSummary) o; - - if (count != that.count) return false; - if (poweredOnCount != that.poweredOnCount) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + count; - result = 31 * result + poweredOnCount; - return result; - } - - @Override - public String string() { - return super.string()+", count="+count+", poweredOnCount="+poweredOnCount; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/CpuUsageDetails.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/CpuUsageDetails.java deleted file mode 100644 index 8727434727..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/CpuUsageDetails.java +++ /dev/null @@ -1,106 +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.tmrk.enterprisecloud.domain.resource.cpu; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual ComputePoolCpuUsageDetailSummaryEntry elements. - * - * @author Jason King - */ -public class CpuUsageDetails { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromCpuUsageDetails(this); - } - - public static class Builder { - - private Set entries = Sets.newLinkedHashSet(); - - /** - * @see CpuUsageDetails#getEntries - */ - public Builder entries(Set entries) { - this.entries = Sets.newLinkedHashSet(checkNotNull(entries, "entries")); - return this; - } - - public Builder addEntry(ComputePoolCpuUsageDetailSummaryEntry entry) { - entries.add(checkNotNull(entry,"entry")); - return this; - } - - public CpuUsageDetails build() { - return new CpuUsageDetails(entries); - } - - public Builder fromCpuUsageDetails(CpuUsageDetails in) { - return entries(in.getEntries()); - } - } - - private CpuUsageDetails() { - //For JAXB and builder use - } - - private CpuUsageDetails(Set entries) { - this.entries = Sets.newLinkedHashSet(entries); - } - - @XmlElement(name = "CpuUsageDetail", required=false) - private Set entries = Sets.newLinkedHashSet(); - - public Set getEntries() { - return Collections.unmodifiableSet(entries); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - CpuUsageDetails tasks1 = (CpuUsageDetails) o; - - if (!entries.equals(tasks1.entries)) return false; - - return true; - } - - @Override - public int hashCode() { - return entries.hashCode(); - } - - public String toString() { - return "["+ entries.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/VirtualMachineCpuUsageDetail.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/VirtualMachineCpuUsageDetail.java deleted file mode 100644 index e01e4899c2..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/VirtualMachineCpuUsageDetail.java +++ /dev/null @@ -1,199 +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.tmrk.enterprisecloud.domain.resource.cpu; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseNamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; -import java.net.URI; -import java.util.Map; - -/** - * - * @author Jason King - * - */ -public class VirtualMachineCpuUsageDetail extends BaseNamedResource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromVirtualMachineCpuUsageDetai(this); - } - - public static class Builder extends BaseNamedResource.Builder { - private ResourceCapacity usage; - private int utilization; - private boolean deleted; - - /** - * @see VirtualMachineCpuUsageDetail#getUsage - */ - public Builder usage(ResourceCapacity usage) { - this.usage = usage; - return this; - } - - /** - * @see VirtualMachineCpuUsageDetail#getUtilization - */ - public Builder utilization(int utilization) { - this.utilization = utilization; - return this; - } - - /** - * @see VirtualMachineCpuUsageDetail#isDeleted - */ - public Builder deleted(boolean deleted) { - this.deleted = deleted; - return this; - } - - @Override - public VirtualMachineCpuUsageDetail build() { - return new VirtualMachineCpuUsageDetail(href, type, name, usage, utilization, deleted); - } - - public Builder fromVirtualMachineCpuUsageDetai(VirtualMachineCpuUsageDetail in) { - return fromNamedResource(in).usage(in.getUsage()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromNamedResource(BaseNamedResource in) { - return Builder.class.cast(super.fromNamedResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - } - - @XmlElement(name = "Usage", required = false) - private ResourceCapacity usage; - - @XmlElement(name = "Utilization", required = true) - private int utilization; - - @XmlElement(name = "Deleted", required = false) - private boolean deleted; - - private VirtualMachineCpuUsageDetail(URI href, String type, String name, - @Nullable ResourceCapacity usage, int utilization, boolean deleted) { - super(href, type, name); - this.usage = usage; - this.utilization = utilization; - this.deleted = deleted; - } - - private VirtualMachineCpuUsageDetail() { - //For JAXB - } - - public ResourceCapacity getUsage() { - return usage; - } - - public int getUtilization() { - return utilization; - } - - public boolean isDeleted() { - return deleted; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - VirtualMachineCpuUsageDetail that = (VirtualMachineCpuUsageDetail) o; - - if (deleted != that.deleted) return false; - if (utilization != that.utilization) return false; - if (usage != null ? !usage.equals(that.usage) : that.usage != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (usage != null ? usage.hashCode() : 0); - result = 31 * result + utilization; - result = 31 * result + (deleted ? 1 : 0); - return result; - } - - @Override - public String string() { - return super.string()+", usage="+usage+", utilization="+utilization+", deleted="+deleted; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/VirtualMachinesCpuUsage.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/VirtualMachinesCpuUsage.java deleted file mode 100644 index b2212bfe98..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/cpu/VirtualMachinesCpuUsage.java +++ /dev/null @@ -1,107 +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.tmrk.enterprisecloud.domain.resource.cpu; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual VirtualMachineCpuUsageDetail elements. - * - * @author Jason King - */ -public class VirtualMachinesCpuUsage { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromCpuUsageDetails(this); - } - - public static class Builder { - - private Set virtualMachinesCpuUsageDetail = Sets.newLinkedHashSet(); - - /** - * @see VirtualMachinesCpuUsage#getVirtualMachinesCpuUsageDetail - */ - public Builder vmCpuUsageDetails(Set vmCpuUsageDetails) { - this.virtualMachinesCpuUsageDetail = Sets.newLinkedHashSet(checkNotNull(vmCpuUsageDetails, "vmCpuUsageDetails")); - return this; - } - - public Builder addVmCpuUsageDetail(VirtualMachineCpuUsageDetail vmCpuUsageDetail) { - virtualMachinesCpuUsageDetail.add(checkNotNull(vmCpuUsageDetail,"vmCpuUsageDetail")); - return this; - } - - public VirtualMachinesCpuUsage build() { - return new VirtualMachinesCpuUsage(virtualMachinesCpuUsageDetail); - } - - public Builder fromCpuUsageDetails(VirtualMachinesCpuUsage in) { - return vmCpuUsageDetails(in.getVirtualMachinesCpuUsageDetail()); - } - } - - private VirtualMachinesCpuUsage() { - //For JAXB and builder use - } - - private VirtualMachinesCpuUsage(Set virtualMachinesCpuUsageDetail) { - this.virtualMachinesCpuUsageDetail = Sets.newLinkedHashSet(virtualMachinesCpuUsageDetail); - } - - @XmlElement(name = "VirtualMachine", required=false) - private Set virtualMachinesCpuUsageDetail = Sets.newLinkedHashSet(); - - public Set getVirtualMachinesCpuUsageDetail() { - return Collections.unmodifiableSet(virtualMachinesCpuUsageDetail); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - VirtualMachinesCpuUsage that = (VirtualMachinesCpuUsage) o; - - if (virtualMachinesCpuUsageDetail != null ? !virtualMachinesCpuUsageDetail.equals(that.virtualMachinesCpuUsageDetail) : that.virtualMachinesCpuUsageDetail != null) - return false; - - return true; - } - - @Override - public int hashCode() { - return virtualMachinesCpuUsageDetail != null ? virtualMachinesCpuUsageDetail.hashCode() : 0; - } - - public String toString() { - return "["+ virtualMachinesCpuUsageDetail.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsage.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsage.java deleted file mode 100644 index 87d5651899..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsage.java +++ /dev/null @@ -1,223 +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.tmrk.enterprisecloud.domain.resource.memory; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Date; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * ComputePoolMemoryUsage is more than a simple wrapper as it extends Resource. - * - * @author Jason King - * - */ -@XmlRootElement(name = "ComputePoolMemoryUsage") -public class ComputePoolMemoryUsage extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromComputePoolCpuUsage(this); - } - - public static class Builder extends Resource.Builder { - private Date startTime; - private Date endTime; - private MemoryUsageDetails details; - - /** - * @see ComputePoolMemoryUsage#getStartTime - */ - public Builder startTime(Date startTime) { - this.startTime =(checkNotNull(startTime,"startTime")); - return this; - } - - /** - * @see ComputePoolMemoryUsage#getEndTime - */ - public Builder endTime(Date endTime) { - this.endTime =(checkNotNull(endTime,"endTime")); - return this; - } - - /** - * @see ComputePoolMemoryUsage#getDetails - */ - public Builder details(MemoryUsageDetails details) { - this.details =(checkNotNull(details,"details")); - return this; - } - - @Override - public ComputePoolMemoryUsage build() { - return new ComputePoolMemoryUsage(href, type, name, links, actions, startTime, endTime, details); - } - - public Builder fromComputePoolCpuUsage(ComputePoolMemoryUsage in) { - return fromResource(in).startTime(in.getStartTime()).endTime(in.getEndTime()).details(in.getDetails()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "StartTime", required = true) - private Date startTime; - - @XmlElement(name = "EndTime", required = true) - private Date endTime; - - @XmlElement(name = "MemoryUsageDetailSummary", required = false) - private MemoryUsageDetails details; - - private ComputePoolMemoryUsage(URI href, String type, String name, Set links, Set actions, Date startTime, Date endTime, @Nullable MemoryUsageDetails details) { - super(href, type, name, links, actions); - this.startTime = checkNotNull(startTime, "startTime"); - this.endTime = checkNotNull(endTime, "endTime"); - this.details = details; - } - - private ComputePoolMemoryUsage() { - //For JAXB - } - - public Date getStartTime() { - return startTime; - } - - public Date getEndTime() { - return endTime; - } - - public MemoryUsageDetails getDetails() { - return details; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - ComputePoolMemoryUsage that = (ComputePoolMemoryUsage) o; - - if (details != null ? !details.equals(that.details) : that.details != null) - return false; - if (!endTime.equals(that.endTime)) return false; - if (!startTime.equals(that.startTime)) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + startTime.hashCode(); - result = 31 * result + endTime.hashCode(); - result = 31 * result + (details != null ? details.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", startTime="+startTime+", endTime="+endTime+", details="+details; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsageDetail.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsageDetail.java deleted file mode 100644 index faf709f204..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsageDetail.java +++ /dev/null @@ -1,225 +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.tmrk.enterprisecloud.domain.resource.memory; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Date; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * ComputePoolMemoryUsageDetail is more than a simple wrapper as it extends Resource. - * - * @author Jason King - * - */ -@XmlRootElement(name = "ComputePoolMemoryUsageDetail") -public class ComputePoolMemoryUsageDetail extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromComputePoolMemoryUsage(this); - } - - public static class Builder extends Resource.Builder { - private Date time; - private ResourceCapacity value; - private VirtualMachinesMemoryUsage virtualMachinesMemoryUsage; - - /** - * @see ComputePoolMemoryUsageDetail#getTime - */ - public Builder time(Date time) { - this.time =(checkNotNull(time,"time")); - return this; - } - - /** - * @see ComputePoolMemoryUsageDetail#getValue - */ - public Builder value(ResourceCapacity value) { - this.value =(checkNotNull(value,"value")); - return this; - } - - /** - * @see ComputePoolMemoryUsageDetail#getVirtualMachinesMemoryUsage - */ - public Builder virtualMachines(VirtualMachinesMemoryUsage virtualMachinesMemoryUsage) { - this.virtualMachinesMemoryUsage =(checkNotNull(virtualMachinesMemoryUsage,"virtualMachinesMemoryUsage")); - return this; - } - - @Override - public ComputePoolMemoryUsageDetail build() { - return new ComputePoolMemoryUsageDetail(href, type, name, links, actions, time, value, virtualMachinesMemoryUsage); - } - - public Builder fromComputePoolMemoryUsage(ComputePoolMemoryUsageDetail in) { - return fromResource(in).time(in.getTime()).value(in.getValue()).virtualMachines(in.getVirtualMachinesMemoryUsage()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "Time", required = true) - private Date time; - - @XmlElement(name = "Value", required = false) - private ResourceCapacity value; - - @XmlElement(name = "VirtualMachines", required = false) - private VirtualMachinesMemoryUsage virtualMachinesMemoryUsage; - - private ComputePoolMemoryUsageDetail(URI href, String type, String name, Set links, Set actions, Date time, @Nullable ResourceCapacity value, @Nullable VirtualMachinesMemoryUsage virtualMachinesMemoryUsage) { - super(href, type, name, links, actions); - this.time = checkNotNull(time, "time"); - this.value = value; - this.virtualMachinesMemoryUsage = virtualMachinesMemoryUsage; - } - - private ComputePoolMemoryUsageDetail() { - //For JAXB - } - - public Date getTime() { - return time; - } - - public ResourceCapacity getValue() { - return value; - } - - public VirtualMachinesMemoryUsage getVirtualMachinesMemoryUsage() { - return virtualMachinesMemoryUsage; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - ComputePoolMemoryUsageDetail that = (ComputePoolMemoryUsageDetail) o; - - if (!time.equals(that.time)) return false; - if (value != null ? !value.equals(that.value) : that.value != null) - return false; - if (virtualMachinesMemoryUsage != null ? !virtualMachinesMemoryUsage.equals(that.virtualMachinesMemoryUsage) : that.virtualMachinesMemoryUsage != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + time.hashCode(); - result = 31 * result + (value != null ? value.hashCode() : 0); - result = 31 * result + (virtualMachinesMemoryUsage != null ? virtualMachinesMemoryUsage.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", time="+ time +", value="+value+", virtualMachinesMemoryUsage="+ virtualMachinesMemoryUsage; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsageDetailSummaryEntry.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsageDetailSummaryEntry.java deleted file mode 100644 index 5709166af0..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/ComputePoolMemoryUsageDetailSummaryEntry.java +++ /dev/null @@ -1,127 +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.tmrk.enterprisecloud.domain.resource.memory; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Date; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * - * @author Jason King - * - */ -public class ComputePoolMemoryUsageDetailSummaryEntry { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - public Builder toBuilder() { - return new Builder().ComputePoolCpuUsageDetailSummaryEntry(this); - } - - public static class Builder { - private Date time; - private ResourceCapacity value; - - /** - * @see ComputePoolMemoryUsageDetailSummaryEntry#getTime - */ - public Builder time(Date time) { - this.time = time; - return this; - } - - /** - * @see ComputePoolMemoryUsageDetailSummaryEntry#getValue - */ - public Builder value(ResourceCapacity value) { - this.value = value; - return this; - } - - public ComputePoolMemoryUsageDetailSummaryEntry build() { - return new ComputePoolMemoryUsageDetailSummaryEntry(time,value); - } - - public Builder ComputePoolCpuUsageDetailSummaryEntry(ComputePoolMemoryUsageDetailSummaryEntry in) { - return time(in.getTime()).value(in.getValue()); - } - } - - @XmlElement(name = "Time", required = true) - private Date time; - - @XmlElement(name = "Value", required = false) - private ResourceCapacity value; - - - private ComputePoolMemoryUsageDetailSummaryEntry(Date time, @Nullable ResourceCapacity value) { - this.time = checkNotNull(time, "time"); - this.value = value; - } - - private ComputePoolMemoryUsageDetailSummaryEntry() { - //For JAXB - } - - public Date getTime() { - return time; - } - - public ResourceCapacity getValue() { - return value; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ComputePoolMemoryUsageDetailSummaryEntry that = (ComputePoolMemoryUsageDetailSummaryEntry) o; - - if (!time.equals(that.time)) return false; - if (value != null ? !value.equals(that.value) : that.value != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = time.hashCode(); - result = 31 * result + (value != null ? value.hashCode() : 0); - return result; - } - - @Override - public String toString() { - return "[time="+ time +", value="+value+"]"; - } - -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/MemoryUsageDetails.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/MemoryUsageDetails.java deleted file mode 100644 index db4dcf38e6..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/MemoryUsageDetails.java +++ /dev/null @@ -1,106 +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.tmrk.enterprisecloud.domain.resource.memory; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual ComputePoolMemoryUsageDetailSummaryEntry elements. - * - * @author Jason King - */ -public class MemoryUsageDetails { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromMemoryUsageDetails(this); - } - - public static class Builder { - - private Set entries = Sets.newLinkedHashSet(); - - /** - * @see MemoryUsageDetails#getEntries - */ - public Builder entries(Set entries) { - this.entries = Sets.newLinkedHashSet(checkNotNull(entries, "entries")); - return this; - } - - public Builder addEntry(ComputePoolMemoryUsageDetailSummaryEntry entry) { - entries.add(checkNotNull(entry,"entry")); - return this; - } - - public MemoryUsageDetails build() { - return new MemoryUsageDetails(entries); - } - - public Builder fromMemoryUsageDetails(MemoryUsageDetails in) { - return entries(in.getEntries()); - } - } - - private MemoryUsageDetails() { - //For JAXB and builder use - } - - private MemoryUsageDetails(Set entries) { - this.entries = Sets.newLinkedHashSet(entries); - } - - @XmlElement(name = "MemoryUsageDetail", required=false) - private Set entries = Sets.newLinkedHashSet(); - - public Set getEntries() { - return Collections.unmodifiableSet(entries); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - MemoryUsageDetails tasks1 = (MemoryUsageDetails) o; - - if (!entries.equals(tasks1.entries)) return false; - - return true; - } - - @Override - public int hashCode() { - return entries.hashCode(); - } - - public String toString() { - return "["+ entries.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/VirtualMachineMemoryUsageDetail.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/VirtualMachineMemoryUsageDetail.java deleted file mode 100644 index e930c5868a..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/VirtualMachineMemoryUsageDetail.java +++ /dev/null @@ -1,199 +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.tmrk.enterprisecloud.domain.resource.memory; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseNamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; -import java.net.URI; -import java.util.Map; - -/** - * - * @author Jason King - * - */ -public class VirtualMachineMemoryUsageDetail extends BaseNamedResource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromVirtualMachineMemoryUsageDetail(this); - } - - public static class Builder extends BaseNamedResource.Builder { - private ResourceCapacity usage; - private int utilization; - private boolean deleted; - - /** - * @see VirtualMachineMemoryUsageDetail#getUsage - */ - public Builder usage(ResourceCapacity usage) { - this.usage = usage; - return this; - } - - /** - * @see VirtualMachineMemoryUsageDetail#getUtilization - */ - public Builder utilization(int utilization) { - this.utilization = utilization; - return this; - } - - /** - * @see VirtualMachineMemoryUsageDetail#isDeleted - */ - public Builder deleted(boolean deleted) { - this.deleted = deleted; - return this; - } - - @Override - public VirtualMachineMemoryUsageDetail build() { - return new VirtualMachineMemoryUsageDetail(href, type, name, usage, utilization, deleted); - } - - public Builder fromVirtualMachineMemoryUsageDetail(VirtualMachineMemoryUsageDetail in) { - return fromNamedResource(in).usage(in.getUsage()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromNamedResource(BaseNamedResource in) { - return Builder.class.cast(super.fromNamedResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - } - - @XmlElement(name = "Usage", required = false) - private ResourceCapacity usage; - - @XmlElement(name = "Utilization", required = true) - private int utilization; - - @XmlElement(name = "Deleted", required = false) - private boolean deleted; - - private VirtualMachineMemoryUsageDetail(URI href, String type, String name, - @Nullable ResourceCapacity usage, int utilization, boolean deleted) { - super(href, type, name); - this.usage = usage; - this.utilization = utilization; - this.deleted = deleted; - } - - private VirtualMachineMemoryUsageDetail() { - //For JAXB - } - - public ResourceCapacity getUsage() { - return usage; - } - - public int getUtilization() { - return utilization; - } - - public boolean isDeleted() { - return deleted; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - VirtualMachineMemoryUsageDetail that = (VirtualMachineMemoryUsageDetail) o; - - if (deleted != that.deleted) return false; - if (utilization != that.utilization) return false; - if (usage != null ? !usage.equals(that.usage) : that.usage != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (usage != null ? usage.hashCode() : 0); - result = 31 * result + utilization; - result = 31 * result + (deleted ? 1 : 0); - return result; - } - - @Override - public String string() { - return super.string()+", usage="+usage+", utilization="+utilization+", deleted="+deleted; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/VirtualMachinesMemoryUsage.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/VirtualMachinesMemoryUsage.java deleted file mode 100644 index b150e7fa48..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/memory/VirtualMachinesMemoryUsage.java +++ /dev/null @@ -1,107 +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.tmrk.enterprisecloud.domain.resource.memory; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual VirtualMachineMemoryUsageDetail elements. - * - * @author Jason King - */ -public class VirtualMachinesMemoryUsage { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromMemoryUsageDetails(this); - } - - public static class Builder { - - private Set virtualMachinesMemoryUsageDetail = Sets.newLinkedHashSet(); - - /** - * @see VirtualMachinesMemoryUsage#getVirtualMachinesMemoryUsageDetail - */ - public Builder vmMemoryUsageDetails(Set vmMemoryUsageDetails) { - this.virtualMachinesMemoryUsageDetail = Sets.newLinkedHashSet(checkNotNull(vmMemoryUsageDetails, "vmMemoryUsageDetails")); - return this; - } - - public Builder addVmMemoryUsageDetail(VirtualMachineMemoryUsageDetail vmMemoryUsageDetail) { - virtualMachinesMemoryUsageDetail.add(checkNotNull(vmMemoryUsageDetail,"vmMemoryUsageDetail")); - return this; - } - - public VirtualMachinesMemoryUsage build() { - return new VirtualMachinesMemoryUsage(virtualMachinesMemoryUsageDetail); - } - - public Builder fromMemoryUsageDetails(VirtualMachinesMemoryUsage in) { - return vmMemoryUsageDetails(in.getVirtualMachinesMemoryUsageDetail()); - } - } - - private VirtualMachinesMemoryUsage() { - //For JAXB and builder use - } - - private VirtualMachinesMemoryUsage(Set virtualMachinesMemoryUsageDetail) { - this.virtualMachinesMemoryUsageDetail = Sets.newLinkedHashSet(virtualMachinesMemoryUsageDetail); - } - - @XmlElement(name = "VirtualMachine", required=false) - private Set virtualMachinesMemoryUsageDetail = Sets.newLinkedHashSet(); - - public Set getVirtualMachinesMemoryUsageDetail() { - return Collections.unmodifiableSet(virtualMachinesMemoryUsageDetail); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - VirtualMachinesMemoryUsage that = (VirtualMachinesMemoryUsage) o; - - if (virtualMachinesMemoryUsageDetail != null ? !virtualMachinesMemoryUsageDetail.equals(that.virtualMachinesMemoryUsageDetail) : that.virtualMachinesMemoryUsageDetail != null) - return false; - - return true; - } - - @Override - public int hashCode() { - return virtualMachinesMemoryUsageDetail != null ? virtualMachinesMemoryUsageDetail.hashCode() : 0; - } - - public String toString() { - return "["+ virtualMachinesMemoryUsageDetail.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/ComputePoolStorageUsageDetail.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/ComputePoolStorageUsageDetail.java deleted file mode 100644 index 1dc0b9c69c..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/ComputePoolStorageUsageDetail.java +++ /dev/null @@ -1,183 +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.tmrk.enterprisecloud.domain.resource.storage; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * ComputePoolStorageUsageDetail is more than a simple wrapper as it extends Resource. - * - * @author Jason King - * - */ -@XmlRootElement(name = "ComputePoolStorageUsageDetail") -public class ComputePoolStorageUsageDetail extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromComputePoolStorageUsageDetail(this); - } - - public static class Builder extends Resource.Builder { - private ResourceCapacity allocated; - private VirtualMachinesStorageDetails virtualMachinesStorageDetails; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.storage.ComputePoolStorageUsageDetail#getAllocated - */ - public Builder allocated(ResourceCapacity allocated) { - this.allocated =(checkNotNull(allocated,"allocated")); - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.storage.ComputePoolStorageUsageDetail#getVirtualMachinesStorageDetails - */ - public Builder virtualMachines(VirtualMachinesStorageDetails virtualMachinesStorageDetails) { - this.virtualMachinesStorageDetails =(checkNotNull(virtualMachinesStorageDetails,"virtualMachinesStorageDetails")); - return this; - } - - @Override - public ComputePoolStorageUsageDetail build() { - return new ComputePoolStorageUsageDetail(href, type, name, links, actions, allocated, virtualMachinesStorageDetails); - } - - public Builder fromComputePoolStorageUsageDetail(ComputePoolStorageUsageDetail in) { - return fromResource(in).allocated(in.getAllocated()).virtualMachines(in.getVirtualMachinesStorageDetails()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "Allocated", required = false) - private ResourceCapacity allocated; - - @XmlElement(name = "VirtualMachines", required = false) - private VirtualMachinesStorageDetails virtualMachinesStorageDetails; - - private ComputePoolStorageUsageDetail(URI href, String type, String name, Set links, Set actions, @Nullable ResourceCapacity allocated, @Nullable VirtualMachinesStorageDetails virtualMachinesStorageDetails) { - super(href, type, name, links, actions); - this.allocated = allocated; - this.virtualMachinesStorageDetails = virtualMachinesStorageDetails; - } - - private ComputePoolStorageUsageDetail() { - //For JAXB - } - - public ResourceCapacity getAllocated() { - return allocated; - } - - public VirtualMachinesStorageDetails getVirtualMachinesStorageDetails() { - return virtualMachinesStorageDetails; - } - - - - @Override - public String string() { - return super.string()+", allocated="+ allocated +", virtualMachinesStorageDetails="+ virtualMachinesStorageDetails; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/VirtualMachineStorageUsageDetail.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/VirtualMachineStorageUsageDetail.java deleted file mode 100644 index 5d9419501a..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/VirtualMachineStorageUsageDetail.java +++ /dev/null @@ -1,204 +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.tmrk.enterprisecloud.domain.resource.storage; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.ResourceCapacity; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * VirtualMachineStorageUsageDetail is more than a simple wrapper as it extends Resource. - * - * @author Jason King - * - */ -@XmlRootElement(name = "VirtualMachineStorageUsageDetail") -public class VirtualMachineStorageUsageDetail extends Resource { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromVirtualMachineStorageUsageDetail(this); - } - - public static class Builder extends Resource.Builder { - private int diskCount; - private ResourceCapacity allocated; - - /** - * @see VirtualMachineStorageUsageDetail#getDiskCount - */ - public Builder diskCount(int diskCount) { - this.diskCount =(checkNotNull(diskCount,"diskCount")); - return this; - } - - /** - * @see VirtualMachineStorageUsageDetail#getAllocated - */ - public Builder allocated(ResourceCapacity allocated) { - this.allocated =(checkNotNull(allocated,"allocated")); - return this; - } - - @Override - public VirtualMachineStorageUsageDetail build() { - return new VirtualMachineStorageUsageDetail(href, type, name, links, actions, diskCount, allocated); - } - - public Builder fromVirtualMachineStorageUsageDetail(VirtualMachineStorageUsageDetail in) { - return fromResource(in).diskCount(in.getDiskCount()).allocated(in.getAllocated()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "DiskCount", required = true) - private int diskCount; - - @XmlElement(name = "Allocated", required = false) - private ResourceCapacity allocated; - - private VirtualMachineStorageUsageDetail(URI href, String type, String name, Set links, Set actions, int diskCount, @Nullable ResourceCapacity allocated) { - super(href, type, name, links, actions); - this.diskCount = diskCount; - this.allocated = allocated; - } - - private VirtualMachineStorageUsageDetail() { - //For JAXB - } - - public int getDiskCount() { - return diskCount; - } - - public ResourceCapacity getAllocated() { - return allocated; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - VirtualMachineStorageUsageDetail that = (VirtualMachineStorageUsageDetail) o; - - if (diskCount != that.diskCount) return false; - if (allocated != null ? !allocated.equals(that.allocated) : that.allocated != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + diskCount; - result = 31 * result + (allocated != null ? allocated.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", diskCount="+ diskCount +", allocated="+ allocated; - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/VirtualMachinesStorageDetails.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/VirtualMachinesStorageDetails.java deleted file mode 100644 index afb8b815f1..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/resource/storage/VirtualMachinesStorageDetails.java +++ /dev/null @@ -1,107 +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.tmrk.enterprisecloud.domain.resource.storage; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * Wraps individual VirtualMachineStorageUsageDetail elements. - * - * @author Jason King - */ -public class VirtualMachinesStorageDetails { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromStorageUsageDetails(this); - } - - public static class Builder { - - private Set virtualMachinesStorageUsageDetail = Sets.newLinkedHashSet(); - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.resource.storage.VirtualMachinesStorageDetails#getVirtualMachinesStorageUsageDetail - */ - public Builder vmStorageUsageDetails(Set vmStorageUsageDetails) { - this.virtualMachinesStorageUsageDetail = Sets.newLinkedHashSet(checkNotNull(vmStorageUsageDetails, "vmStorageUsageDetails")); - return this; - } - - public Builder addVmStorageUsageDetail(VirtualMachineStorageUsageDetail vmStorageUsageDetails) { - virtualMachinesStorageUsageDetail.add(checkNotNull(vmStorageUsageDetails,"vmStorageUsageDetails")); - return this; - } - - public VirtualMachinesStorageDetails build() { - return new VirtualMachinesStorageDetails(virtualMachinesStorageUsageDetail); - } - - public Builder fromStorageUsageDetails(VirtualMachinesStorageDetails in) { - return vmStorageUsageDetails(in.getVirtualMachinesStorageUsageDetail()); - } - } - - private VirtualMachinesStorageDetails() { - //For JAXB and builder use - } - - private VirtualMachinesStorageDetails(Set virtualMachinesStorageUsageDetail) { - this.virtualMachinesStorageUsageDetail = Sets.newLinkedHashSet(virtualMachinesStorageUsageDetail); - } - - @XmlElement(name = "VirtualMachine", required=false) - private Set virtualMachinesStorageUsageDetail = Sets.newLinkedHashSet(); - - public Set getVirtualMachinesStorageUsageDetail() { - return Collections.unmodifiableSet(virtualMachinesStorageUsageDetail); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - VirtualMachinesStorageDetails that = (VirtualMachinesStorageDetails) o; - - if (virtualMachinesStorageUsageDetail != null ? !virtualMachinesStorageUsageDetail.equals(that.virtualMachinesStorageUsageDetail) : that.virtualMachinesStorageUsageDetail != null) - return false; - - return true; - } - - @Override - public int hashCode() { - return virtualMachinesStorageUsageDetail != null ? virtualMachinesStorageUsageDetail.hashCode() : 0; - } - - public String toString() { - return "["+ virtualMachinesStorageUsageDetail.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/Protocol.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/Protocol.java deleted file mode 100644 index 8c6e52a0a8..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/Protocol.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.jclouds.tmrk.enterprisecloud.domain.service; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; - -@XmlEnum -public enum Protocol { - - /** - * HyperText Transfer Protocol - */ - @XmlEnumValue("HTTP") - HTTP, - - /** - * HyperText Transfer Protocol Secure - */ - @XmlEnumValue("HTTPS") - HTTPS, - - /** - * Transmission Control Protocol - */ - @XmlEnumValue("TCP") - TCP, - - /** - * User Datagram Protocol - */ - @XmlEnumValue("UDP") - UDP, - - /** - * Internet Protocol security - */ - @XmlEnumValue("IPSEC") - IPSEC, - - /** - * File Transfer Protocol - */ - @XmlEnumValue("FTP") - FTP, - - @XmlEnumValue("Any") - Any; - - @Override - public String toString() { - return name(); - } - - public String value() { - return name(); - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/internet/InternetService.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/internet/InternetService.java deleted file mode 100644 index ee3a4f69cf..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/internet/InternetService.java +++ /dev/null @@ -1,419 +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.tmrk.enterprisecloud.domain.service.internet; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.NamedResource; -import org.jclouds.tmrk.enterprisecloud.domain.Task; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Entity; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; -import org.jclouds.tmrk.enterprisecloud.domain.service.Protocol; -import org.jclouds.tmrk.enterprisecloud.domain.service.node.NodeServices; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -/** - * - * @author Jason King - */ -@XmlRootElement(name="InternetService") -public class InternetService extends Entity { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromSshKey(this); - } - - public static class Builder extends Entity.Builder { - - - private Protocol protocol; - private int port; - private boolean enabled; - private String description; - private NamedResource publicIp; - private InternetServicePersistenceType persistence; - private String redirectUrl; - private NamedResource monitor; - private NamedResource trustedNetworkGroup; - private NamedResource backupInternetService; - private NodeServices nodeServices; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService#getProtocol - */ - public Builder protocol(Protocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService#getPort - */ - public Builder port(int port) { - this.port = port; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService#isEnabled - */ - public Builder enabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService#getDescription - */ - public Builder description(String description) { - this.description = description; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService#getPersistence - */ - public Builder persistence(InternetServicePersistenceType persistence) { - this.persistence = persistence; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService#getPublicIp - */ - public Builder publicIp(NamedResource publicIp) { - this.publicIp = publicIp; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService#getRedirectUrl - */ - public Builder redirectUrl(String redirectUrl) { - this.redirectUrl = redirectUrl; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService#getMonitor - */ - public Builder monitor(NamedResource monitor) { - this.monitor = monitor; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService#getTrustedNetworkGroup - */ - public Builder trustedNetworkGroup(NamedResource trustedNetworkGroup) { - this.trustedNetworkGroup = trustedNetworkGroup; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService#getBackupInternetService - */ - public Builder backupInternetService(NamedResource backupInternetService) { - this.backupInternetService = backupInternetService; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetService#getNodeServices - */ - public Builder nodeServices(NodeServices nodeServices) { - this.nodeServices = nodeServices; - return this; - } - - @Override - public InternetService build() { - return new InternetService(href, type, name, links, actions, tasks, - protocol, port, enabled, description,publicIp,persistence, - redirectUrl, monitor, trustedNetworkGroup, backupInternetService, nodeServices); - } - - public Builder fromSshKey(InternetService in) { - return fromEntity(in).protocol(in.getProtocol()) - .port(in.getPort()) - .enabled(in.isEnabled()) - .description(in.getDescription()) - .publicIp(in.getPublicIp()) - .persistence(in.getPersistence()) - .redirectUrl(in.getRedirectUrl()) - .monitor(in.getMonitor()) - .trustedNetworkGroup(in.getTrustedNetworkGroup()) - .backupInternetService(in.getBackupInternetService()) - .nodeServices(in.getNodeServices()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromEntity(Entity in) { - return Builder.class.cast(super.fromEntity(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder tasks(Set tasks) { - return Builder.class.cast(super.tasks(tasks)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - } - - @XmlElement(name = "Protocol", required = false) - private Protocol protocol; - - @XmlElement(name = "Port", required = false) - private int port; - - @XmlElement(name = "Enabled", required = true) - private boolean enabled; - - @XmlElement(name = "PrivateKey", required = false) - private String description; - - @XmlElement(name = "PublicIp", required = false) - private NamedResource publicIp; - - @XmlElement(name = "Persistence", required = false) - private InternetServicePersistenceType persistence; - - @XmlElement(name = "RedirectUrl", required = false) - private String redirectUrl; - - @XmlElement(name = "Monitor", required = false) - private NamedResource monitor; - - @XmlElement(name = "TrustedNetworkGroup", required = false) - private NamedResource trustedNetworkGroup; - - @XmlElement(name = "BackupInternetService", required = false) - private NamedResource backupInternetService; - - @XmlElement(name = "NodeServices", required = false) - private NodeServices nodeServices; - - private InternetService(URI href, String type, String name, Set links, Set actions, Set tasks, - @Nullable Protocol protocol, int port, boolean enabled, @Nullable String description, - @Nullable NamedResource publicIp, @Nullable InternetServicePersistenceType persistence, @Nullable String redirectUrl, @Nullable NamedResource monitor, - @Nullable NamedResource trustedNetworkGroup, @Nullable NamedResource backupInternetService, @Nullable NodeServices nodeServices) { - super(href, type, name, links, actions, tasks); - this.protocol = protocol; - this.port = port; - this.enabled = enabled; - this.description = description; - this.publicIp = publicIp; - this.persistence = persistence; - this.redirectUrl = redirectUrl; - this.monitor = monitor; - this.trustedNetworkGroup = trustedNetworkGroup; - this.backupInternetService = backupInternetService; - this.nodeServices = nodeServices; - } - - private InternetService() { - //For JAXB - } - - public Protocol getProtocol() { - return protocol; - } - - public int getPort() { - return port; - } - - public boolean isEnabled() { - return enabled; - } - - public String getDescription() { - return description; - } - - public NamedResource getPublicIp() { - return publicIp; - } - - public InternetServicePersistenceType getPersistence() { - return persistence; - } - - public String getRedirectUrl() { - return redirectUrl; - } - - public NamedResource getMonitor() { - return monitor; - } - - public NamedResource getTrustedNetworkGroup() { - return trustedNetworkGroup; - } - - public NamedResource getBackupInternetService() { - return backupInternetService; - } - - public NodeServices getNodeServices() { - return nodeServices; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - InternetService that = (InternetService) o; - - if (enabled != that.enabled) return false; - if (port != that.port) return false; - if (backupInternetService != null ? !backupInternetService.equals(that.backupInternetService) : that.backupInternetService != null) - return false; - if (description != null ? !description.equals(that.description) : that.description != null) - return false; - if (monitor != null ? !monitor.equals(that.monitor) : that.monitor != null) - return false; - if (nodeServices != null ? !nodeServices.equals(that.nodeServices) : that.nodeServices != null) - return false; - if (persistence != null ? !persistence.equals(that.persistence) : that.persistence != null) - return false; - if (protocol != that.protocol) return false; - if (publicIp != null ? !publicIp.equals(that.publicIp) : that.publicIp != null) - return false; - if (redirectUrl != null ? !redirectUrl.equals(that.redirectUrl) : that.redirectUrl != null) - return false; - if (trustedNetworkGroup != null ? !trustedNetworkGroup.equals(that.trustedNetworkGroup) : that.trustedNetworkGroup != null) - return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (protocol != null ? protocol.hashCode() : 0); - result = 31 * result + port; - result = 31 * result + (enabled ? 1 : 0); - result = 31 * result + (description != null ? description.hashCode() : 0); - result = 31 * result + (publicIp != null ? publicIp.hashCode() : 0); - result = 31 * result + (persistence != null ? persistence.hashCode() : 0); - result = 31 * result + (redirectUrl != null ? redirectUrl.hashCode() : 0); - result = 31 * result + (monitor != null ? monitor.hashCode() : 0); - result = 31 * result + (trustedNetworkGroup != null ? trustedNetworkGroup.hashCode() : 0); - result = 31 * result + (backupInternetService != null ? backupInternetService.hashCode() : 0); - result = 31 * result + (nodeServices != null ? nodeServices.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+ - ", protocol="+protocol+", port="+port+", enabled="+enabled+", description="+description+ - ", publicIp="+publicIp+" persistence="+persistence+", redirectUrl="+redirectUrl+ - ", monitor="+monitor+", trustedNetworkGroup="+trustedNetworkGroup+ - ", backupInternetService="+backupInternetService+", nodeServices="+nodeServices; - } - -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/internet/InternetServicePersistenceType.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/internet/InternetServicePersistenceType.java deleted file mode 100644 index 590185b61d..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/internet/InternetServicePersistenceType.java +++ /dev/null @@ -1,135 +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.tmrk.enterprisecloud.domain.service.internet; - -import org.jclouds.javax.annotation.Nullable; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; - -import static com.google.common.base.CaseFormat.*; - -/** - * - * @author Jason King - */ -public class InternetServicePersistenceType { - - @XmlEnum - public static enum PersistenceType { - - @XmlEnumValue("None") - NONE, - - @XmlEnumValue("SourceIp") - SOURCE_IP; - - public String value() { - String lower = UPPER_UNDERSCORE.to(LOWER_CAMEL,name()); - return LOWER_CAMEL.to(UPPER_CAMEL,lower); - } - } - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromNodeServices(this); - } - - public static class Builder { - - private PersistenceType persistenceType; - private int timeout = -1; - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetServicePersistenceType#getPersistenceType - */ - public Builder persistenceType(PersistenceType persistenceType) { - this.persistenceType = persistenceType; - return this; - } - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.internet.InternetServicePersistenceType#getTimeout - */ - public Builder timeout(int timeout) { - this.timeout = timeout; - return this; - } - - public InternetServicePersistenceType build() { - return new InternetServicePersistenceType(persistenceType,timeout); - } - - public Builder fromNodeServices(InternetServicePersistenceType in) { - return persistenceType(in.getPersistenceType()).timeout(in.getTimeout()); - } - } - - private InternetServicePersistenceType() { - //For JAXB and builder use - } - - private InternetServicePersistenceType(@Nullable PersistenceType persistenceType, int timeout ) { - this.persistenceType = persistenceType; - this.timeout = timeout; - } - - @XmlElement(name = "Type") - private PersistenceType persistenceType; - - @XmlElement(name = "Timeout") - private int timeout = -1; - - public PersistenceType getPersistenceType() { - return persistenceType; - } - - public int getTimeout() { - return timeout; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - InternetServicePersistenceType that = (InternetServicePersistenceType) o; - - if (timeout != that.timeout) return false; - if (persistenceType != that.persistenceType) return false; - - return true; - } - - @Override - public int hashCode() { - int result = persistenceType != null ? persistenceType.hashCode() : 0; - result = 31 * result + timeout; - return result; - } - - public String toString() { - return "[persistenceType="+persistenceType+", timeout="+timeout+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/node/NodeService.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/node/NodeService.java deleted file mode 100644 index d265b991f1..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/node/NodeService.java +++ /dev/null @@ -1,281 +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.tmrk.enterprisecloud.domain.service.node; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.Task; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Entity; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; -import org.jclouds.tmrk.enterprisecloud.domain.network.IpAddressReference; -import org.jclouds.tmrk.enterprisecloud.domain.service.Protocol; - -import javax.xml.bind.annotation.XmlElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -/** - * - * @author Jason King - */ -public class NodeService extends Entity { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromSshKey(this); - } - - public static class Builder extends Entity.Builder { - private IpAddressReference ipAddress; - private Protocol protocol; - private int port; - private boolean enabled; - private String description; - - /** - * @see NodeService#getIpAddress - */ - public Builder ipAddress(IpAddressReference ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - /** - * @see NodeService#getProtocol - */ - public Builder protocol(Protocol protocol) { - this.protocol = protocol; - return this; - } - - /** - * @see NodeService#getPort - */ - public Builder port(int port) { - this.port = port; - return this; - } - - /** - * @see NodeService#isEnabled - */ - public Builder enabled(boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * @see NodeService#getDescription - */ - public Builder description(String description) { - this.description = description; - return this; - } - - @Override - public NodeService build() { - return new NodeService(href, type, name, links, actions, tasks, ipAddress, protocol, port, enabled, description); - } - - public Builder fromSshKey(NodeService in) { - return fromEntity(in).ipAddress(in.getIpAddress()) - .protocol(in.getProtocol()) - .port(in.getPort()) - .enabled(in.isEnabled()) - .description(in.getDescription()); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromEntity(Entity in) { - return Builder.class.cast(super.fromEntity(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder tasks(Set tasks) { - return Builder.class.cast(super.tasks(tasks)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map attributes) { - return Builder.class.cast(super.fromAttributes(attributes)); - } - - } - - @XmlElement(name = "IpAddress", required = false) - private IpAddressReference ipAddress; - - @XmlElement(name = "Protocol", required = false) - private Protocol protocol; - - @XmlElement(name = "Port", required = false) - private int port; - - @XmlElement(name = "Enabled", required = false) - private boolean enabled; - - @XmlElement(name = "PrivateKey", required = false) - private String description; - - private NodeService(URI href, String type, String name, Set links, Set actions, Set tasks, - @Nullable IpAddressReference ipAddress, @Nullable Protocol protocol, int port, boolean enabled, @Nullable String description) { - super(href, type, name, links, actions, tasks); - this.ipAddress = ipAddress; - this.protocol = protocol; - this.port = port; - this.enabled = enabled; - this.description = description; - } - - private NodeService() { - //For JAXB - } - - public IpAddressReference getIpAddress() { - return ipAddress; - } - - public Protocol getProtocol() { - return protocol; - } - - public int getPort() { - return port; - } - - public boolean isEnabled() { - return enabled; - } - - public String getDescription() { - return description; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - if (!super.equals(o)) return false; - - NodeService that = (NodeService) o; - - if (enabled != that.enabled) return false; - if (port != that.port) return false; - if (description != null ? !description.equals(that.description) : that.description != null) - return false; - if (ipAddress != null ? !ipAddress.equals(that.ipAddress) : that.ipAddress != null) - return false; - if (protocol != that.protocol) return false; - - return true; - } - - @Override - public int hashCode() { - int result = super.hashCode(); - result = 31 * result + (ipAddress != null ? ipAddress.hashCode() : 0); - result = 31 * result + (protocol != null ? protocol.hashCode() : 0); - result = 31 * result + port; - result = 31 * result + (enabled ? 1 : 0); - result = 31 * result + (description != null ? description.hashCode() : 0); - return result; - } - - @Override - public String string() { - return super.string()+", ipAddress="+ipAddress+", protocol="+protocol+", port="+port+", enabled="+enabled+", description="+description; - } - -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/node/NodeServices.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/node/NodeServices.java deleted file mode 100644 index 56211a84c3..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/service/node/NodeServices.java +++ /dev/null @@ -1,104 +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.tmrk.enterprisecloud.domain.service.node; - -import com.google.common.collect.Sets; - -import javax.xml.bind.annotation.XmlElement; -import java.util.Collections; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * @author Jason King - */ -public class NodeServices { - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return new Builder().fromNodeServices(this); - } - - public static class Builder { - - private Set services = Sets.newLinkedHashSet(); - - /** - * @see org.jclouds.tmrk.enterprisecloud.domain.service.node.NodeServices#getNodeServices() - */ - public Builder services(Set services) { - this.services = Sets.newLinkedHashSet(checkNotNull(services, "services")); - return this; - } - - public Builder addNodeService(NodeService service) { - services.add(checkNotNull(service, "service")); - return this; - } - - public NodeServices build() { - return new NodeServices(services); - } - - public Builder fromNodeServices(NodeServices in) { - return services(in.getNodeServices()); - } - } - - private NodeServices() { - //For JAXB and builder use - } - - private NodeServices(Set services) { - this.services = Sets.newLinkedHashSet(services); - } - - @XmlElement(name = "NodeService") - private Set services = Sets.newLinkedHashSet(); - - public Set getNodeServices() { - return Collections.unmodifiableSet(services); - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - NodeServices that = (NodeServices) o; - - if (!services.equals(that.services)) return false; - - return true; - } - - @Override - public int hashCode() { - return services.hashCode(); - } - - public String toString() { - return "["+ services.toString()+"]"; - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/software/OperatingSystem.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/software/OperatingSystem.java deleted file mode 100644 index 705308236e..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/software/OperatingSystem.java +++ /dev/null @@ -1,139 +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.tmrk.enterprisecloud.domain.software; - -import org.jclouds.tmrk.enterprisecloud.domain.Action; -import org.jclouds.tmrk.enterprisecloud.domain.Link; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; - -import java.net.URI; -import java.util.Map; -import java.util.Set; - -/** - * - * @author Jason King - * - */ -public class OperatingSystem extends Resource { - - //TODO There are other fields - - @SuppressWarnings("unchecked") - public static Builder builder() { - return new Builder(); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder toBuilder() { - return new Builder().fromOperatingSystem(this); - } - - public static class Builder extends Resource.Builder { - - /** - * {@inheritDoc} - */ - @Override - public OperatingSystem build() { - return new OperatingSystem(href, type, links, actions, name); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromResource(Resource in) { - return Builder.class.cast(super.fromResource(in)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromBaseResource(BaseResource in) { - return Builder.class.cast(super.fromBaseResource(in)); - } - - public Builder fromOperatingSystem(OperatingSystem in) { - return fromResource(in); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder name(String name) { - return Builder.class.cast(super.name(name)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder href(URI href) { - return Builder.class.cast(super.href(href)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder type(String type) { - return Builder.class.cast(super.type(type)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder links(Set links) { - return Builder.class.cast(super.links(links)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder actions(Set actions) { - return Builder.class.cast(super.actions(actions)); - } - - /** - * {@inheritDoc} - */ - @Override - public Builder fromAttributes(Map in) { - return Builder.class.cast(super.fromAttributes(in)); - } - - } - - private OperatingSystem(URI href, String type, Set links, Set actions, String name) { - super(href, type, name, links, actions); - } - - private OperatingSystem() { - //For JAXB - } -} \ No newline at end of file diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/software/ToolsStatus.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/software/ToolsStatus.java deleted file mode 100644 index b3d7d1ff55..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/software/ToolsStatus.java +++ /dev/null @@ -1,50 +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.tmrk.enterprisecloud.domain.software; - -import javax.xml.bind.annotation.XmlEnum; -import javax.xml.bind.annotation.XmlEnumValue; - -import static com.google.common.base.CaseFormat.LOWER_CAMEL; -import static com.google.common.base.CaseFormat.UPPER_UNDERSCORE; - -/** - * - * @author Jason King - */ -@XmlEnum -public enum ToolsStatus { - @XmlEnumValue("NotInstalled") - NOT_INSTALLED, - @XmlEnumValue("NotRunning") - NOT_RUNNING, - @XmlEnumValue("OutOfDate") - OUT_OF_DATE, - @XmlEnumValue("Current") - CURRENT; - - public String value() { - return UPPER_UNDERSCORE.to(LOWER_CAMEL, name()); - } - - @Override - public String toString() { - return value(); - } -} diff --git a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/Template.java b/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/Template.java deleted file mode 100644 index 88ecc31314..0000000000 --- a/sandbox-providers/tmrk-enterprisecloud/src/main/java/org/jclouds/tmrk/enterprisecloud/domain/template/Template.java +++ /dev/null @@ -1,315 +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.tmrk.enterprisecloud.domain.template; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.tmrk.enterprisecloud.domain.*; -import org.jclouds.tmrk.enterprisecloud.domain.internal.BaseResource; -import org.jclouds.tmrk.enterprisecloud.domain.internal.Resource; -import org.jclouds.tmrk.enterprisecloud.domain.software.OperatingSystem; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -/** - * - * @author Jason King - * - */ -@XmlRootElement(name = "Template") -public class Template extends Resource