From 792ad9dcb977b98f909a5049c20614b37ef17145 Mon Sep 17 00:00:00 2001 From: Andrew Bayer Date: Fri, 18 May 2012 14:01:39 -0700 Subject: [PATCH] Initial CloudStack 3.0 compatibility work. --- ...CloudStackComputeServiceContextModule.java | 42 +-- .../compute/functions/TemplateToImage.java | 2 +- .../functions/TemplateToOperatingSystem.java | 8 +- .../VirtualMachineToNodeMetadata.java | 8 +- .../compute/functions/ZoneToLocation.java | 2 +- .../options/CloudStackTemplateOptions.java | 32 +-- .../AdvancedNetworkOptionsConverter.java | 2 +- .../BasicNetworkOptionsConverter.java | 2 +- .../CloudStackComputeServiceAdapter.java | 76 ++--- .../compute/strategy/OptionsConverter.java | 2 +- .../config/CloudStackParserModule.java | 22 +- .../jclouds/cloudstack/domain/Account.java | 20 +- .../org/jclouds/cloudstack/domain/Alert.java | 12 +- .../domain/AsyncCreateResponse.java | 10 +- .../jclouds/cloudstack/domain/AsyncJob.java | 40 +-- .../jclouds/cloudstack/domain/Capacity.java | 22 +- .../jclouds/cloudstack/domain/Cluster.java | 28 +- .../cloudstack/domain/DiskOffering.java | 20 +- .../org/jclouds/cloudstack/domain/Domain.java | 26 +- .../org/jclouds/cloudstack/domain/Event.java | 20 +- .../cloudstack/domain/FirewallRule.java | 22 +- .../org/jclouds/cloudstack/domain/Host.java | 78 ++--- .../cloudstack/domain/IPForwardingRule.java | 30 +- .../org/jclouds/cloudstack/domain/ISO.java | 66 ++--- .../cloudstack/domain/ISOExtraction.java | 34 +-- .../cloudstack/domain/ISOPermissions.java | 18 +- .../cloudstack/domain/IngressRule.java | 12 +- .../cloudstack/domain/LoadBalancerRule.java | 40 +-- .../cloudstack/domain/LoginResponse.java | 18 +- .../org/jclouds/cloudstack/domain/NIC.java | 20 +- .../jclouds/cloudstack/domain/Network.java | 50 ++-- .../cloudstack/domain/NetworkOffering.java | 12 +- .../org/jclouds/cloudstack/domain/OSType.java | 20 +- .../org/jclouds/cloudstack/domain/Pod.java | 20 +- .../cloudstack/domain/PortForwardingRule.java | 30 +- .../cloudstack/domain/PublicIPAddress.java | 74 ++--- .../cloudstack/domain/ResourceLimit.java | 10 +- .../cloudstack/domain/SecurityGroup.java | 30 +- .../cloudstack/domain/ServiceOffering.java | 20 +- .../jclouds/cloudstack/domain/Snapshot.java | 38 +-- .../cloudstack/domain/SnapshotPolicy.java | 20 +- .../cloudstack/domain/StoragePool.java | 44 +-- .../jclouds/cloudstack/domain/Template.java | 74 ++--- .../cloudstack/domain/TemplateExtraction.java | 38 +-- .../cloudstack/domain/TemplateMetadata.java | 40 +-- .../cloudstack/domain/TemplatePermission.java | 20 +- .../cloudstack/domain/UsageRecord.java | 68 ++--- .../org/jclouds/cloudstack/domain/User.java | 22 +- .../jclouds/cloudstack/domain/VMGroup.java | 20 +- .../cloudstack/domain/VirtualMachine.java | 104 +++---- .../cloudstack/domain/VlanIPRange.java | 49 ++-- .../org/jclouds/cloudstack/domain/Volume.java | 88 +++--- .../org/jclouds/cloudstack/domain/Zone.java | 20 +- .../features/AccountAsyncClient.java | 6 +- .../cloudstack/features/AccountClient.java | 2 +- .../features/AddressAsyncClient.java | 10 +- .../cloudstack/features/AddressClient.java | 6 +- .../features/AsyncJobAsyncClient.java | 4 +- .../cloudstack/features/AsyncJobClient.java | 2 +- .../features/ConfigurationAsyncClient.java | 2 +- .../features/DomainAccountAsyncClient.java | 4 +- .../features/DomainAccountClient.java | 4 +- .../features/DomainDomainAsyncClient.java | 8 +- .../features/DomainDomainClient.java | 2 +- .../features/DomainUserAsyncClient.java | 4 +- .../cloudstack/features/DomainUserClient.java | 4 +- .../cloudstack/features/EventAsyncClient.java | 2 +- .../features/FirewallAsyncClient.java | 22 +- .../cloudstack/features/FirewallClient.java | 14 +- .../features/GlobalAccountAsyncClient.java | 4 +- .../features/GlobalAccountClient.java | 4 +- .../features/GlobalAlertAsyncClient.java | 2 +- .../features/GlobalCapacityAsyncClient.java | 2 +- .../GlobalConfigurationAsyncClient.java | 2 +- .../features/GlobalDomainAsyncClient.java | 6 +- .../features/GlobalDomainClient.java | 6 +- .../features/GlobalHostAsyncClient.java | 26 +- .../cloudstack/features/GlobalHostClient.java | 22 +- .../features/GlobalOfferingAsyncClient.java | 10 +- .../features/GlobalOfferingClient.java | 10 +- .../features/GlobalPodAsyncClient.java | 14 +- .../cloudstack/features/GlobalPodClient.java | 10 +- .../GlobalStoragePoolAsyncClient.java | 2 +- .../features/GlobalUsageAsyncClient.java | 2 +- .../features/GlobalUserAsyncClient.java | 6 +- .../cloudstack/features/GlobalUserClient.java | 6 +- .../features/GlobalVlanAsyncClient.java | 8 +- .../cloudstack/features/GlobalVlanClient.java | 4 +- .../features/GlobalZoneAsyncClient.java | 4 +- .../cloudstack/features/GlobalZoneClient.java | 4 +- .../features/GuestOSAsyncClient.java | 14 +- .../cloudstack/features/GuestOSClient.java | 6 +- .../features/HypervisorAsyncClient.java | 6 +- .../cloudstack/features/HypervisorClient.java | 2 +- .../cloudstack/features/ISOAsyncClient.java | 26 +- .../cloudstack/features/ISOClient.java | 20 +- .../cloudstack/features/LimitAsyncClient.java | 2 +- .../features/LoadBalancerAsyncClient.java | 40 +-- .../features/LoadBalancerClient.java | 18 +- .../cloudstack/features/NATAsyncClient.java | 22 +- .../cloudstack/features/NATClient.java | 14 +- .../features/NetworkAsyncClient.java | 12 +- .../cloudstack/features/NetworkClient.java | 6 +- .../features/OfferingAsyncClient.java | 18 +- .../cloudstack/features/OfferingClient.java | 6 +- .../features/SSHKeyPairAsyncClient.java | 4 +- .../features/SecurityGroupAsyncClient.java | 18 +- .../features/SecurityGroupClient.java | 14 +- .../features/SnapshotAsyncClient.java | 20 +- .../cloudstack/features/SnapshotClient.java | 14 +- .../features/TemplateAsyncClient.java | 28 +- .../cloudstack/features/TemplateClient.java | 16 +- .../features/VMGroupAsyncClient.java | 10 +- .../cloudstack/features/VMGroupClient.java | 6 +- .../features/VirtualMachineAsyncClient.java | 26 +- .../features/VirtualMachineClient.java | 20 +- .../features/VolumeAsyncClient.java | 34 +-- .../cloudstack/features/VolumeClient.java | 12 +- .../cloudstack/features/ZoneAsyncClient.java | 6 +- .../cloudstack/features/ZoneClient.java | 2 +- .../CreatePortForwardingRulesForIP.java | 6 +- .../ParseEventTypesFromHttpResponse.java | 24 +- .../ParseIdToNameEntryFromHttpResponse.java | 6 +- .../ParseIdToNameFromHttpResponse.java | 54 ++-- .../functions/ParseNamesFromHttpResponse.java | 42 ++- .../ReuseOrAssociateNewPublicIPAddress.java | 12 +- .../StaticNATVirtualMachineInNetwork.java | 4 +- .../cloudstack/functions/ZoneIdToZone.java | 4 +- .../options/AccountInDomainOptions.java | 8 +- .../cloudstack/options/AddClusterOptions.java | 4 +- .../cloudstack/options/AddHostOptions.java | 8 +- .../options/AddSecondaryStorageOptions.java | 4 +- .../options/AssociateIPAddressOptions.java | 12 +- .../options/CreateAccountOptions.java | 4 +- .../options/CreateDiskOfferingOptions.java | 8 +- .../options/CreateDomainOptions.java | 4 +- .../CreateLoadBalancerRuleOptions.java | 12 +- .../options/CreateNetworkOptions.java | 8 +- .../options/CreateServiceOfferingOptions.java | 8 +- .../options/CreateSnapshotOptions.java | 8 +- .../options/CreateTemplateOptions.java | 8 +- .../cloudstack/options/CreateUserOptions.java | 4 +- .../options/CreateVMGroupOptions.java | 4 +- .../options/CreateVlanIPRangeOptions.java | 20 +- .../cloudstack/options/CreateZoneOptions.java | 4 +- .../cloudstack/options/DeleteISOOptions.java | 4 +- .../options/DeleteTemplateOptions.java | 4 +- .../options/DeployVirtualMachineOptions.java | 42 +-- .../options/GenerateUsageRecordsOptions.java | 4 +- .../options/ListAccountsOptions.java | 12 +- .../cloudstack/options/ListAlertsOptions.java | 4 +- .../options/ListAsyncJobsOptions.java | 8 +- .../options/ListCapacityOptions.java | 12 +- .../options/ListClustersOptions.java | 12 +- .../options/ListDiskOfferingsOptions.java | 8 +- .../options/ListDomainChildrenOptions.java | 4 +- .../options/ListDomainsOptions.java | 4 +- .../cloudstack/options/ListEventsOptions.java | 4 +- .../options/ListFirewallRulesOptions.java | 16 +- .../cloudstack/options/ListHostsOptions.java | 28 +- .../options/ListIPForwardingRulesOptions.java | 20 +- .../cloudstack/options/ListISOsOptions.java | 16 +- .../options/ListLoadBalancerRulesOptions.java | 24 +- .../options/ListNetworkOfferingsOptions.java | 8 +- .../options/ListNetworksOptions.java | 16 +- .../options/ListOSTypesOptions.java | 8 +- .../cloudstack/options/ListPodsOptions.java | 8 +- .../ListPortForwardingRulesOptions.java | 16 +- .../options/ListPublicIPAddressesOptions.java | 24 +- .../options/ListResourceLimitsOptions.java | 18 +- .../options/ListSecurityGroupsOptions.java | 16 +- .../options/ListServiceOfferingsOptions.java | 12 +- .../options/ListSnapshotPoliciesOptions.java | 4 +- .../options/ListSnapshotsOptions.java | 12 +- .../options/ListStoragePoolsOptions.java | 16 +- .../options/ListTemplatesOptions.java | 16 +- .../options/ListUsageRecordsOptions.java | 12 +- .../cloudstack/options/ListUsersOptions.java | 12 +- .../options/ListVMGroupsOptions.java | 8 +- .../options/ListVirtualMachinesOptions.java | 32 +-- .../options/ListVlanIPRangesOptions.java | 28 +- .../options/ListVolumesOptions.java | 30 +- .../cloudstack/options/ListZonesOptions.java | 8 +- .../options/RegisterISOOptions.java | 8 +- .../options/RegisterTemplateOptions.java | 4 +- .../options/UpdateDiskOfferingOptions.java | 8 +- .../cloudstack/options/UpdateHostOptions.java | 4 +- .../cloudstack/options/UpdateISOOptions.java | 4 +- .../options/UpdateNetworkOfferingOptions.java | 8 +- .../options/UpdateServiceOfferingOptions.java | 8 +- .../options/UpdateTemplateOptions.java | 4 +- .../UpdateTemplatePermissionsOptions.java | 4 +- .../predicates/CorrectHypervisorForZone.java | 14 +- .../cloudstack/predicates/JobComplete.java | 6 +- .../predicates/NetworkPredicates.java | 8 +- .../cloudstack/predicates/OSCategoryIn.java | 12 +- .../predicates/PublicIPAddressPredicates.java | 10 +- ...BlockUntilJobCompletesAndReturnResult.java | 4 +- .../suppliers/NetworksForCurrentUser.java | 8 +- .../suppliers/ZoneIdToZoneSupplier.java | 8 +- .../PasswordAuthenticationExpectTest.java | 2 +- ...oudStackComputeServiceAdapterLiveTest.java | 18 +- .../compute/CloudStackExperimentLiveTest.java | 10 +- .../TemplateToOperatingSystemTest.java | 6 +- .../VirtualMachineToNodeMetadataTest.java | 38 +-- .../CloudStackTemplateOptionsTest.java | 44 +-- .../strategy/OptionsConverterTest.java | 20 +- .../features/AccountAsyncClientTest.java | 12 +- .../features/AccountClientExpectTest.java | 10 +- .../features/AccountClientLiveTest.java | 6 +- .../features/AddressAsyncClientTest.java | 14 +- .../features/AddressClientLiveTest.java | 6 +- .../features/AsyncJobAsyncClientTest.java | 8 +- .../features/AsyncJobClientLiveTest.java | 2 +- .../BaseCloudStackClientLiveTest.java | 16 +- .../ConfigurationAsyncClientTest.java | 2 +- .../DomainAccountAsyncClientTest.java | 8 +- .../DomainDomainClientExpectTest.java | 32 +-- .../features/DomainDomainClientLiveTest.java | 2 +- .../features/DomainLimitAsyncClientTest.java | 2 +- .../features/DomainUserClientLiveTest.java | 2 +- .../features/EventAsyncClientTest.java | 6 +- .../features/EventClientLiveTest.java | 2 +- .../features/FirewallAsyncClientTest.java | 14 +- .../features/FirewallClientExpectTest.java | 76 ++--- .../features/FirewallClientLiveTest.java | 10 +- .../GlobalAccountAsyncClientTest.java | 4 +- .../features/GlobalAlertAsyncClientTest.java | 6 +- .../features/GlobalAlertClientLiveTest.java | 2 +- .../GlobalCapacityAsyncClientTest.java | 6 +- .../GlobalConfigurationClientExpectTest.java | 4 +- .../GlobalDomainClientExpectTest.java | 12 +- .../features/GlobalHostAsyncClientTest.java | 2 +- .../features/GlobalHostClientExpectTest.java | 62 ++-- .../features/GlobalHostClientLiveTest.java | 6 +- .../GlobalOfferingAsyncClientTest.java | 10 +- .../GlobalOfferingClientLiveTest.java | 2 +- .../features/GlobalPodClientExpectTest.java | 26 +- .../features/GlobalPodClientLiveTest.java | 4 +- .../GlobalStoragePoolAsyncClientTest.java | 6 +- .../GlobalStoragePoolClientLiveTest.java | 8 +- .../features/GlobalUsageAsyncClientTest.java | 8 +- .../features/GlobalUserAsyncClientTest.java | 4 +- .../features/GlobalVlanClientExpectTest.java | 44 +-- .../features/GlobalVlanClientLiveTest.java | 8 +- .../features/GlobalZoneClientExpectTest.java | 10 +- .../features/GuestOSAsyncClientTest.java | 16 +- .../features/GuestOSClientLiveTest.java | 12 +- .../features/HypervisorAsyncClientTest.java | 6 +- .../features/ISOAsyncClientTest.java | 54 ++-- .../features/LimitAsyncClientTest.java | 6 +- .../features/LoadBalancerAsyncClientTest.java | 16 +- .../features/LoadBalancerClientLiveTest.java | 14 +- .../features/NATAsyncClientTest.java | 20 +- .../features/NATClientLiveTest.java | 6 +- .../features/NetworkAsyncClientTest.java | 18 +- .../features/NetworkClientLiveTest.java | 12 +- .../features/OfferingAsyncClientTest.java | 38 +-- .../features/OfferingClientLiveTest.java | 6 +- .../features/SSHKeyPairAsyncClientTest.java | 6 +- .../features/SSHKeyPairClientExpectTest.java | 6 +- .../SecurityGroupAsyncClientTest.java | 26 +- .../features/SecurityGroupClientLiveTest.java | 12 +- .../features/SessionClientExpectTest.java | 2 +- .../features/SnapshotAsyncClientTest.java | 34 +-- .../features/SnapshotClientLiveTest.java | 22 +- .../features/TemplateAsyncClientTest.java | 58 ++-- .../features/TemplateClientLiveTest.java | 12 +- .../features/VMGroupAsyncClientTest.java | 16 +- .../VirtualMachineAsyncClientTest.java | 28 +- .../VirtualMachineClientExpectTest.java | 2 +- .../VirtualMachineClientLiveTest.java | 60 ++-- .../features/VolumeAsyncClientTest.java | 20 +- .../features/VolumeClientLiveTest.java | 26 +- .../features/ZoneAsyncClientTest.java | 14 +- .../features/ZoneClientExpectTest.java | 8 +- .../features/ZoneClientLiveTest.java | 4 +- ...kUntilJobCompletesAndReturnResultTest.java | 18 +- .../ParseAsyncJobFromHttpResponseTest.java | 26 +- ...euseOrAssociateNewPublicIPAddressTest.java | 8 +- ...ticNATVirtualMachineInNetworkLiveTest.java | 4 +- .../options/AddClusterOptionsTest.java | 4 +- .../options/AddHostOptionsTest.java | 8 +- .../AddSecondaryStorageOptionsTest.java | 4 +- .../AssociateIPAddressOptionsTest.java | 8 +- .../options/CreateAccountOptionsTest.java | 4 +- .../options/CreateNetworkOptionsTest.java | 4 +- .../options/CreateUserOptionsTest.java | 4 +- .../options/CreateVlanIPRangeOptionsTest.java | 20 +- .../GenerateUsageRecordsOptionsTest.java | 4 +- .../options/ListAccountsOptionsTest.java | 16 +- .../options/ListAlertsOptionsTest.java | 4 +- .../options/ListAsyncJobsOptionsTest.java | 8 +- .../options/ListCapacityOptionsTest.java | 12 +- .../options/ListClustersOptionsTest.java | 12 +- .../options/ListDiskOfferingsOptionsTest.java | 8 +- .../options/ListHostsOptionsTest.java | 22 +- .../ListIPForwardingRulesOptionsTest.java | 20 +- .../options/ListISOsOptionsTest.java | 8 +- .../ListLoadBalancerRulesOptionsTest.java | 24 +- .../ListNetworkOfferingsOptionsTest.java | 12 +- .../options/ListNetworksOptionsTest.java | 20 +- .../options/ListOSTypesOptionsTest.java | 8 +- .../options/ListPodsOptionsTest.java | 8 +- .../ListPortForwardingRulesOptionsTest.java | 12 +- .../ListPublicIPAddressesOptionsTest.java | 24 +- .../ListSecurityGroupsOptionsTest.java | 16 +- .../ListServiceOfferingsOptionsTest.java | 12 +- .../options/ListStoragePoolsOptionsTest.java | 16 +- .../options/ListTemplatesOptionsTest.java | 20 +- .../options/ListUsageRecordsOptionsTest.java | 12 +- .../options/ListUsersOptionsTest.java | 10 +- .../options/ListVirtualMachesOptionsTest.java | 36 +-- .../options/ListVlanIPRangesOptionsTest.java | 24 +- .../options/ListZonesOptionsTest.java | 8 +- .../options/UpdateHostOptionsTest.java | 4 +- .../parse/ListAccountsResponseTest.java | 8 +- .../parse/ListAlertsResponseTest.java | 2 +- .../parse/ListCapacityResponseTest.java | 4 +- .../parse/ListClustersResponseTest.java | 12 +- .../parse/ListDiskOfferingsResponseTest.java | 6 +- .../parse/ListDomainsResponseTest.java | 4 +- .../parse/ListFirewallRulesResponseTest.java | 12 +- .../parse/ListHostsResponseTest.java | 30 +- .../ListIPForwardingRulesResponseTest.java | 4 +- .../ListLoadBalancerRulesResponseTest.java | 8 +- .../ListNetworkOfferingsResponseTest.java | 4 +- .../parse/ListNetworksResponseTest.java | 10 +- .../parse/ListOSCategoriesResponseTest.java | 12 +- .../parse/ListOSTypesResponseTest.java | 272 +++++++++--------- .../parse/ListPodsResponseTest.java | 8 +- .../ListPortForwardingRulesResponseTest.java | 8 +- .../ListPublicIPAddressesResponseTest.java | 8 +- .../parse/ListSecurityGroupsResponseTest.java | 28 +- .../ListServiceOfferingsResponseTest.java | 4 +- .../parse/ListStoragePoolsResponseTest.java | 2 +- .../parse/ListTemplatesResponseTest.java | 34 +-- .../parse/ListUsageRecordsResponseTest.java | 4 +- .../ListVirtualMachinesResponseTest.java | 18 +- .../parse/ListVlanIPRangesResponseTest.java | 20 +- .../parse/ListZonesResponseTest.java | 4 +- .../predicates/JobCompleteTest.java | 4 +- .../predicates/NetworkPredicatesTest.java | 20 +- .../predicates/OSCategoryInTest.java | 18 +- .../PublicIPAddressPredicatesTest.java | 12 +- .../VirtualMachineDestroyedTest.java | 4 +- .../VirtualMachineExpungedTest.java | 4 +- .../predicates/VirtualMachineRunningTest.java | 2 +- .../test/resources/listcapacityresponse.json | 2 +- 349 files changed, 2761 insertions(+), 2774 deletions(-) diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/config/CloudStackComputeServiceContextModule.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/config/CloudStackComputeServiceContextModule.java index 23af639fe9..18964f9e73 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/config/CloudStackComputeServiceContextModule.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/config/CloudStackComputeServiceContextModule.java @@ -106,11 +106,11 @@ public class CloudStackComputeServiceContextModule extends bind(new TypeLiteral>() { }).to(TemplateToOperatingSystem.class); install(new FactoryModuleBuilder().build(StaticNATVirtualMachineInNetwork.Factory.class)); - bind(new TypeLiteral>>() { + bind(new TypeLiteral>>() { }).to(GetIPForwardingRulesByVirtualMachine.class); - bind(new TypeLiteral>() { + bind(new TypeLiteral>() { }).to(ZoneIdToZone.class); - bind(new TypeLiteral>>() { + bind(new TypeLiteral>>() { }).to(ZoneIdToZoneSupplier.class); // to have the compute service adapter override default locations install(new LocationsFromComputeServiceAdapterModule(){}); @@ -119,12 +119,12 @@ public class CloudStackComputeServiceContextModule extends @Provides @Singleton @Memoized - public Supplier> listOSCategories(AtomicReference authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, + public Supplier> listOSCategories(AtomicReference authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, final CloudStackClient client) { - return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier>(authException, - seconds, new Supplier>() { + return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier>(authException, + seconds, new Supplier>() { @Override - public Map get() { + public Map get() { GuestOSClient guestOSClient = client.getGuestOSClient(); return guestOSClient.listOSCategories(); } @@ -134,17 +134,17 @@ public class CloudStackComputeServiceContextModule extends @Provides @Singleton @Memoized - public Supplier> listOSTypes(AtomicReference authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, + public Supplier> listOSTypes(AtomicReference authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, final CloudStackClient client) { - return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier>(authException, - seconds, new Supplier>() { + return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier>(authException, + seconds, new Supplier>() { @Override - public Map get() { + public Map get() { GuestOSClient guestOSClient = client.getGuestOSClient(); - return Maps.uniqueIndex(guestOSClient.listOSTypes(), new Function() { + return Maps.uniqueIndex(guestOSClient.listOSTypes(), new Function() { @Override - public Long apply(OSType arg0) { + public String apply(OSType arg0) { return arg0.getId(); } }); @@ -155,9 +155,9 @@ public class CloudStackComputeServiceContextModule extends @Provides @Singleton @Memoized - public Supplier> listNetworks(AtomicReference authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, + public Supplier> listNetworks(AtomicReference authException, @Named(PROPERTY_SESSION_INTERVAL) long seconds, final NetworksForCurrentUser networksForCurrentUser) { - return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier>(authException, + return new MemoizedRetryOnTimeOutButNotOnAuthorizationExceptionSupplier>(authException, seconds, networksForCurrentUser); } @@ -172,20 +172,20 @@ public class CloudStackComputeServiceContextModule extends @Provides @Singleton - protected Predicate jobComplete(JobComplete jobComplete) { + protected Predicate jobComplete(JobComplete jobComplete) { // TODO: parameterize - return new RetryablePredicate(jobComplete, 1200, 1, 5, TimeUnit.SECONDS); + return new RetryablePredicate(jobComplete, 1200, 1, 5, TimeUnit.SECONDS); } @Provides @Singleton - protected LoadingCache> getIPForwardingRulesByVirtualMachine( - CacheLoader> getIPForwardingRules) { + protected LoadingCache> getIPForwardingRulesByVirtualMachine( + CacheLoader> getIPForwardingRules) { return CacheBuilder.newBuilder().build(getIPForwardingRules); } @Singleton - public static class GetIPForwardingRulesByVirtualMachine extends CacheLoader> { + public static class GetIPForwardingRulesByVirtualMachine extends CacheLoader> { private final CloudStackClient client; @Inject @@ -198,7 +198,7 @@ public class CloudStackComputeServiceContextModule extends * when there is no ip forwarding rule available for the VM */ @Override - public Set load(Long input) { + public Set load(String input) { Set rules = client.getNATClient().getIPForwardingRulesForVirtualMachine(input); return rules != null ? rules : ImmutableSet.of(); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/TemplateToImage.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/TemplateToImage.java index 6b9f63e1d6..5384178636 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/TemplateToImage.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/TemplateToImage.java @@ -75,7 +75,7 @@ public class TemplateToImage implements Function { @Override public boolean matches(Template from, Location input) { - return input.getId().equals(Long.toString(from.getZoneId())); + return input.getId().equals(from.getZoneId()); } } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/TemplateToOperatingSystem.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/TemplateToOperatingSystem.java index fb4df381fa..93dcd51541 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/TemplateToOperatingSystem.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/TemplateToOperatingSystem.java @@ -55,13 +55,13 @@ public class TemplateToOperatingSystem implements Function> osTypes; - private final Supplier> osCategories; + private final Supplier> osTypes; + private final Supplier> osCategories; private final Map> osVersionMap; @Inject - public TemplateToOperatingSystem(@Memoized Supplier> osTypes, - @Memoized Supplier> osCategories, Map> osVersionMap) { + public TemplateToOperatingSystem(@Memoized Supplier> osTypes, + @Memoized Supplier> osCategories, Map> osVersionMap) { this.osTypes = checkNotNull(osTypes, "osTypes"); this.osCategories = checkNotNull(osCategories, "osCategories"); this.osVersionMap = checkNotNull(osVersionMap, "osVersionMap"); diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/VirtualMachineToNodeMetadata.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/VirtualMachineToNodeMetadata.java index 5f2af18028..8c551f66f7 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/VirtualMachineToNodeMetadata.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/functions/VirtualMachineToNodeMetadata.java @@ -78,13 +78,13 @@ public class VirtualMachineToNodeMetadata implements Function> getIPForwardingRulesByVirtualMachine; + private final LoadingCache> getIPForwardingRulesByVirtualMachine; private final GroupNamingConvention nodeNamingConvention; @Inject VirtualMachineToNodeMetadata(FindLocationForVirtualMachine findLocationForVirtualMachine, FindImageForVirtualMachine findImageForVirtualMachine, - LoadingCache> getIPForwardingRulesByVirtualMachine, + LoadingCache> getIPForwardingRulesByVirtualMachine, GroupNamingConvention.Factory namingConvention) { this.nodeNamingConvention = checkNotNull(namingConvention, "namingConvention").createWithoutPrefix(); this.findLocationForVirtualMachine = checkNotNull(findLocationForVirtualMachine, "findLocationForVirtualMachine"); @@ -178,7 +178,7 @@ public class VirtualMachineToNodeMetadata implements Function { @Override public Location apply(Zone zone) { return new LocationBuilder().scope(LocationScope.ZONE).metadata(ImmutableMap. of()) - .description(zone.getName()).id(Long.toString(zone.getId())) + .description(zone.getName()).id(zone.getId()) .parent(Iterables.getOnlyElement(provider.get())).build(); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/options/CloudStackTemplateOptions.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/options/CloudStackTemplateOptions.java index 10c47bc944..812c1becfd 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/options/CloudStackTemplateOptions.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/options/CloudStackTemplateOptions.java @@ -54,9 +54,9 @@ import com.google.common.collect.Sets; */ public class CloudStackTemplateOptions extends TemplateOptions implements Cloneable { - protected Set securityGroupIds = Sets. newLinkedHashSet(); - protected Set networkIds = Sets. newLinkedHashSet(); - protected Map ipsToNetworks = Maps.newLinkedHashMap(); + protected Set securityGroupIds = Sets. newLinkedHashSet(); + protected Set networkIds = Sets. newLinkedHashSet(); + protected Map ipsToNetworks = Maps.newLinkedHashMap(); protected String ipOnDefaultNetwork; protected String keyPair; protected boolean setupStaticNat = true; @@ -85,7 +85,7 @@ public class CloudStackTemplateOptions extends TemplateOptions implements Clonea /** * @see DeployVirtualMachineOptions#securityGroupId */ - public CloudStackTemplateOptions securityGroupId(long securityGroupId) { + public CloudStackTemplateOptions securityGroupId(String securityGroupId) { this.securityGroupIds.add(securityGroupId); return this; } @@ -93,19 +93,19 @@ public class CloudStackTemplateOptions extends TemplateOptions implements Clonea /** * @see DeployVirtualMachineOptions#securityGroupIds */ - public CloudStackTemplateOptions securityGroupIds(Iterable securityGroupIds) { + public CloudStackTemplateOptions securityGroupIds(Iterable securityGroupIds) { Iterables.addAll(this.securityGroupIds, checkNotNull(securityGroupIds, "securityGroupIds was null")); return this; } - public Set getSecurityGroupIds() { + public Set getSecurityGroupIds() { return securityGroupIds; } /** * @see DeployVirtualMachineOptions#networkId */ - public CloudStackTemplateOptions networkId(long networkId) { + public CloudStackTemplateOptions networkId(String networkId) { this.networkIds.add(networkId); return this; } @@ -113,12 +113,12 @@ public class CloudStackTemplateOptions extends TemplateOptions implements Clonea /** * @see DeployVirtualMachineOptions#networkIds */ - public CloudStackTemplateOptions networkIds(Iterable networkIds) { + public CloudStackTemplateOptions networkIds(Iterable networkIds) { Iterables.addAll(this.networkIds, checkNotNull(networkIds, "networkIds was null")); return this; } - public Set getNetworkIds() { + public Set getNetworkIds() { return networkIds; } @@ -146,12 +146,12 @@ public class CloudStackTemplateOptions extends TemplateOptions implements Clonea /** * @see DeployVirtualMachineOptions#ipOnDefaultNetwork(String) */ - public CloudStackTemplateOptions ipsToNetworks(Map ipsToNetworks) { + public CloudStackTemplateOptions ipsToNetworks(Map ipsToNetworks) { this.ipsToNetworks.putAll(ipsToNetworks); return this; } - public Map getIpsToNetworks() { + public Map getIpsToNetworks() { return ipsToNetworks; } @@ -174,7 +174,7 @@ public class CloudStackTemplateOptions extends TemplateOptions implements Clonea /** * @see CloudStackTemplateOptions#securityGroupId */ - public static CloudStackTemplateOptions securityGroupId(long id) { + public static CloudStackTemplateOptions securityGroupId(String id) { CloudStackTemplateOptions options = new CloudStackTemplateOptions(); return options.securityGroupId(id); } @@ -182,7 +182,7 @@ public class CloudStackTemplateOptions extends TemplateOptions implements Clonea /** * @see CloudStackTemplateOptions#securityGroupIds */ - public static CloudStackTemplateOptions securityGroupIds(Iterable securityGroupIds) { + public static CloudStackTemplateOptions securityGroupIds(Iterable securityGroupIds) { CloudStackTemplateOptions options = new CloudStackTemplateOptions(); return options.securityGroupIds(securityGroupIds); } @@ -190,7 +190,7 @@ public class CloudStackTemplateOptions extends TemplateOptions implements Clonea /** * @see CloudStackTemplateOptions#networkId */ - public static CloudStackTemplateOptions networkId(long id) { + public static CloudStackTemplateOptions networkId(String id) { CloudStackTemplateOptions options = new CloudStackTemplateOptions(); return options.networkId(id); } @@ -198,7 +198,7 @@ public class CloudStackTemplateOptions extends TemplateOptions implements Clonea /** * @see CloudStackTemplateOptions#networkIds */ - public static CloudStackTemplateOptions networkIds(Iterable networkIds) { + public static CloudStackTemplateOptions networkIds(Iterable networkIds) { CloudStackTemplateOptions options = new CloudStackTemplateOptions(); return options.networkIds(networkIds); } @@ -214,7 +214,7 @@ public class CloudStackTemplateOptions extends TemplateOptions implements Clonea /** * @see CloudStackTemplateOptions#ipsToNetworks */ - public static CloudStackTemplateOptions ipsToNetworks(Map ipToNetworkMap) { + public static CloudStackTemplateOptions ipsToNetworks(Map ipToNetworkMap) { CloudStackTemplateOptions options = new CloudStackTemplateOptions(); return options.ipsToNetworks(ipToNetworkMap); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/AdvancedNetworkOptionsConverter.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/AdvancedNetworkOptionsConverter.java index 15cf65672d..d34cdc0238 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/AdvancedNetworkOptionsConverter.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/AdvancedNetworkOptionsConverter.java @@ -39,7 +39,7 @@ import com.google.common.collect.Iterables; */ public class AdvancedNetworkOptionsConverter implements OptionsConverter { @Override - public DeployVirtualMachineOptions apply(CloudStackTemplateOptions templateOptions, Map networks, long zoneId, DeployVirtualMachineOptions options) { + public DeployVirtualMachineOptions apply(CloudStackTemplateOptions templateOptions, Map networks, String zoneId, DeployVirtualMachineOptions options) { // security groups not allowed. // at least one network must be given to CloudStack, // but jclouds will try to autodetect an appropriate network if none given. diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/BasicNetworkOptionsConverter.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/BasicNetworkOptionsConverter.java index e14c049d5f..32b367dac8 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/BasicNetworkOptionsConverter.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/BasicNetworkOptionsConverter.java @@ -31,7 +31,7 @@ import org.jclouds.cloudstack.options.DeployVirtualMachineOptions; */ public class BasicNetworkOptionsConverter implements OptionsConverter { @Override - public DeployVirtualMachineOptions apply(CloudStackTemplateOptions templateOptions, Map networks, long zoneId, DeployVirtualMachineOptions options) { + public DeployVirtualMachineOptions apply(CloudStackTemplateOptions templateOptions, Map networks, String zoneId, DeployVirtualMachineOptions options) { // both security groups and networks are optional, and CloudStack will // use the zone/user's default network/security group if none given if (templateOptions.getSecurityGroupIds().size() > 0) { diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/CloudStackComputeServiceAdapter.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/CloudStackComputeServiceAdapter.java index c7225110b5..8aeb94ff19 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/CloudStackComputeServiceAdapter.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/CloudStackComputeServiceAdapter.java @@ -81,24 +81,24 @@ public class CloudStackComputeServiceAdapter implements protected Logger logger = Logger.NULL; private final CloudStackClient client; - private final Predicate jobComplete; - private final Supplier> networkSupplier; + private final Predicate jobComplete; + private final Supplier> networkSupplier; private final BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult; private final Factory staticNATVMInNetwork; private final CreatePortForwardingRulesForIP setupPortForwardingRulesForIP; - private final LoadingCache> vmToRules; + private final LoadingCache> vmToRules; private final Map credentialStore; private final Map optionsConverters; - private final Supplier> zoneIdToZone; + private final Supplier> zoneIdToZone; @Inject - public CloudStackComputeServiceAdapter(CloudStackClient client, Predicate jobComplete, - @Memoized Supplier> networkSupplier, + public CloudStackComputeServiceAdapter(CloudStackClient client, Predicate jobComplete, + @Memoized Supplier> networkSupplier, BlockUntilJobCompletesAndReturnResult blockUntilJobCompletesAndReturnResult, StaticNATVirtualMachineInNetwork.Factory staticNATVMInNetwork, - CreatePortForwardingRulesForIP setupPortForwardingRulesForIP, LoadingCache> vmToRules, + CreatePortForwardingRulesForIP setupPortForwardingRulesForIP, LoadingCache> vmToRules, Map credentialStore, Map optionsConverters, - Supplier> zoneIdToZone) { + Supplier> zoneIdToZone) { this.client = checkNotNull(client, "client"); this.jobComplete = checkNotNull(jobComplete, "jobComplete"); this.networkSupplier = checkNotNull(networkSupplier, "networkSupplier"); @@ -120,9 +120,9 @@ public class CloudStackComputeServiceAdapter implements checkArgument(template.getOptions().getClass().isAssignableFrom(CloudStackTemplateOptions.class), "options class %s should have been assignable from CloudStackTemplateOptions", template.getOptions() .getClass()); - Map networks = networkSupplier.get(); + Map networks = networkSupplier.get(); - final long zoneId = Long.parseLong(template.getLocation().getId()); + final String zoneId = template.getLocation().getId(); Zone zone = null; try { zone = zoneIdToZone.get().get(zoneId); @@ -155,10 +155,10 @@ public class CloudStackComputeServiceAdapter implements } } - long templateId = Long.parseLong(template.getImage().getId()); - long serviceOfferingId = Long.parseLong(template.getHardware().getId()); + String templateId = template.getImage().getId(); + String serviceOfferingId = template.getHardware().getId(); - logger.info("serviceOfferingId %d, templateId %d, zoneId %d, options %s%n", serviceOfferingId, templateId, + logger.info("serviceOfferingId %s, templateId %s, zoneId %s, options %s%n", serviceOfferingId, templateId, zoneId, options); AsyncCreateResponse job = client.getVirtualMachineClient().deployVirtualMachineInZone(zoneId, serviceOfferingId, templateId, options); @@ -172,7 +172,7 @@ public class CloudStackComputeServiceAdapter implements } if (templateOptions.shouldSetupStaticNat()) { // TODO: possibly not all network ids, do we want to do this - for (long networkId : options.getNetworkIds()) { + for (String networkId : options.getNetworkIds()) { logger.debug(">> creating static NAT for virtualMachine(%s) in network(%s)", vm.getId(), networkId); PublicIPAddress ip = staticNATVMInNetwork.create(networks.get(networkId)).apply(vm); logger.trace("<< static NATed IPAddress(%s) to virtualMachine(%s)", ip.getId(), vm.getId()); @@ -211,13 +211,13 @@ public class CloudStackComputeServiceAdapter implements @Override public VirtualMachine getNode(String id) { - long virtualMachineId = Long.parseLong(id); + String virtualMachineId = id; return client.getVirtualMachineClient().getVirtualMachine(virtualMachineId); } @Override public void destroyNode(String id) { - long virtualMachineId = Long.parseLong(id); + String virtualMachineId = id; // There was a bug in 2.2.12 release happening when static nat IP address // was being released, and corresponding firewall rules were left behind. // So next time the same IP is allocated, it might be not be static nat @@ -231,7 +231,7 @@ public class CloudStackComputeServiceAdapter implements // the following: // 1) Delete IP forwarding rules associated with IP. - Set ipAddresses = deleteIPForwardingRulesForVMAndReturnDistinctIPs(virtualMachineId); + Set ipAddresses = deleteIPForwardingRulesForVMAndReturnDistinctIPs(virtualMachineId); // 2) Disable static nat rule for the IP. disableStaticNATOnIPAddresses(ipAddresses); @@ -244,16 +244,16 @@ public class CloudStackComputeServiceAdapter implements vmToRules.invalidate(virtualMachineId); } - public void disassociateIPAddresses(Set ipAddresses) { - for (long ipAddress : ipAddresses) { + public void disassociateIPAddresses(Set ipAddresses) { + for (String ipAddress : ipAddresses) { logger.debug(">> disassociating IPAddress(%s)", ipAddress); client.getAddressClient().disassociateIPAddress(ipAddress); } } - public void destroyVirtualMachine(long virtualMachineId) { + public void destroyVirtualMachine(String virtualMachineId) { - Long destroyVirtualMachine = client.getVirtualMachineClient().destroyVirtualMachine(virtualMachineId); + String destroyVirtualMachine = client.getVirtualMachineClient().destroyVirtualMachine(virtualMachineId); if (destroyVirtualMachine != null) { logger.debug(">> destroying virtualMachine(%s) job(%s)", virtualMachineId, destroyVirtualMachine); awaitCompletion(destroyVirtualMachine); @@ -263,10 +263,10 @@ public class CloudStackComputeServiceAdapter implements } - public void disableStaticNATOnIPAddresses(Set ipAddresses) { - Builder jobsToTrack = ImmutableSet.builder(); - for (Long ipAddress : ipAddresses) { - Long disableStaticNAT = client.getNATClient().disableStaticNATOnPublicIP(ipAddress); + public void disableStaticNATOnIPAddresses(Set ipAddresses) { + Builder jobsToTrack = ImmutableSet.builder(); + for (String ipAddress : ipAddresses) { + String disableStaticNAT = client.getNATClient().disableStaticNATOnPublicIP(ipAddress); if (disableStaticNAT != null) { logger.debug(">> disabling static NAT IPAddress(%s) job(%s)", ipAddress, disableStaticNAT); jobsToTrack.add(disableStaticNAT); @@ -275,18 +275,18 @@ public class CloudStackComputeServiceAdapter implements awaitCompletion(jobsToTrack.build()); } - public Set deleteIPForwardingRulesForVMAndReturnDistinctIPs(long virtualMachineId) { - Builder jobsToTrack = ImmutableSet.builder(); + public Set deleteIPForwardingRulesForVMAndReturnDistinctIPs(String virtualMachineId) { + Builder jobsToTrack = ImmutableSet.builder(); // immutable doesn't permit duplicates - Set ipAddresses = Sets.newLinkedHashSet(); + Set ipAddresses = Sets.newLinkedHashSet(); Set forwardingRules = client.getNATClient().getIPForwardingRulesForVirtualMachine( virtualMachineId); for (IPForwardingRule rule : forwardingRules) { if (!"Deleting".equals(rule.getState())) { ipAddresses.add(rule.getIPAddressId()); - Long deleteForwardingRule = client.getNATClient().deleteIPForwardingRule(rule.getId()); + String deleteForwardingRule = client.getNATClient().deleteIPForwardingRule(rule.getId()); if (deleteForwardingRule != null) { logger.debug(">> deleting IPForwardingRule(%s) job(%s)", rule.getId(), deleteForwardingRule); jobsToTrack.add(deleteForwardingRule); @@ -297,22 +297,22 @@ public class CloudStackComputeServiceAdapter implements return ipAddresses; } - public void awaitCompletion(Iterable jobs) { + public void awaitCompletion(Iterable jobs) { logger.debug(">> awaiting completion of jobs(%s)", jobs); - for (long job : jobs) + for (String job : jobs) awaitCompletion(job); logger.trace("<< completed jobs(%s)", jobs); } - public void awaitCompletion(long job) { + public void awaitCompletion(String job) { boolean completed = jobComplete.apply(job); logger.trace("<< job(%s) complete(%s)", job, completed); } @Override public void rebootNode(String id) { - long virtualMachineId = Long.parseLong(id); - Long job = client.getVirtualMachineClient().rebootVirtualMachine(virtualMachineId); + String virtualMachineId = id; + String job = client.getVirtualMachineClient().rebootVirtualMachine(virtualMachineId); if (job != null) { logger.debug(">> rebooting virtualMachine(%s) job(%s)", virtualMachineId, job); awaitCompletion(job); @@ -321,8 +321,8 @@ public class CloudStackComputeServiceAdapter implements @Override public void resumeNode(String id) { - long virtualMachineId = Long.parseLong(id); - Long job = client.getVirtualMachineClient().startVirtualMachine(Long.parseLong(id)); + String virtualMachineId = id; + String job = client.getVirtualMachineClient().startVirtualMachine(id); if (job != null) { logger.debug(">> starting virtualMachine(%s) job(%s)", virtualMachineId, job); awaitCompletion(job); @@ -331,8 +331,8 @@ public class CloudStackComputeServiceAdapter implements @Override public void suspendNode(String id) { - long virtualMachineId = Long.parseLong(id); - Long job = client.getVirtualMachineClient().stopVirtualMachine(Long.parseLong(id)); + String virtualMachineId = id; + String job = client.getVirtualMachineClient().stopVirtualMachine(id); if (job != null) { logger.debug(">> stopping virtualMachine(%s) job(%s)", virtualMachineId, job); awaitCompletion(job); diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/OptionsConverter.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/OptionsConverter.java index dbd30da725..0bcfb289cd 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/OptionsConverter.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/compute/strategy/OptionsConverter.java @@ -42,6 +42,6 @@ public interface OptionsConverter { * @param options where the resulting set of options will be applied * @return same as "options" parameter */ - DeployVirtualMachineOptions apply(CloudStackTemplateOptions templateOptions, Map networks, long zoneId, DeployVirtualMachineOptions options); + DeployVirtualMachineOptions apply(CloudStackTemplateOptions templateOptions, Map networks, String zoneId, DeployVirtualMachineOptions options); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackParserModule.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackParserModule.java index 91bd2075a4..4853cbe64d 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackParserModule.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/config/CloudStackParserModule.java @@ -80,11 +80,11 @@ public class CloudStackParserModule extends AbstractModule { } static final class PortForwardingRuleInternal { - private long id; + private String id; @SerializedName("ipaddress") private String IPAddress; @SerializedName("ipaddressid") - private long IPAddressId; + private String IPAddressId; @SerializedName("privateport") private int privatePort; private PortForwardingRule.Protocol protocol; @@ -94,7 +94,7 @@ public class CloudStackParserModule extends AbstractModule { @SerializedName("virtualmachinedisplayname") private String virtualMachineDisplayName; @SerializedName("virtualmachineid") - public long virtualMachineId; + public String virtualMachineId; @SerializedName("virtualmachinename") private String virtualMachineName; @SerializedName("cidrlist") @@ -132,7 +132,7 @@ public class CloudStackParserModule extends AbstractModule { } static final class FirewallRuleInternal { - private long id; + private String id; @SerializedName("cidrlist") private String CIDRs; @SerializedName("startport") @@ -146,7 +146,7 @@ public class CloudStackParserModule extends AbstractModule { @SerializedName("ipaddress") private String ipAddress; @SerializedName("ipaddressid") - private long ipAddressId; + private String ipAddressId; private FirewallRule.Protocol protocol; private FirewallRule.State state; } @@ -173,27 +173,27 @@ public class CloudStackParserModule extends AbstractModule { } static final class LoadBalancerRuleInternal { - private long id; + private String id; private String account; private LoadBalancerRule.Algorithm algorithm; private String description; private String domain; @SerializedName("domainid") - private long domainId; + private String domainId; private String name; @SerializedName("privateport") private int privatePort; @SerializedName("publicip") private String publicIP; @SerializedName("publicipid") - private long publicIPId; + private String publicIPId; @SerializedName("publicport") private int publicPort; private LoadBalancerRule.State state; @SerializedName("cidrlist") private String CIDRs; @SerializedName("zoneId") - private long zoneId; + private String zoneId; } } @@ -224,12 +224,12 @@ public class CloudStackParserModule extends AbstractModule { } static final class AccountInternal { - private long id; + private String id; @SerializedName("accounttype") private Account.Type type; private String domain; @SerializedName("domainid") - private long domainId; + private String domainId; @SerializedName("ipavailable") private String IPsAvailable; @SerializedName("iplimit") diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Account.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Account.java index e73d97e3d3..33dae7d1ca 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Account.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Account.java @@ -43,11 +43,11 @@ public class Account extends ForwardingSet implements Comparable } public static class Builder { - private long id; + private String id; private Type type; private String networkDomain; private String domain; - private long domainId; + private String domainId; private Long IPsAvailable; private Long IPLimit; private long IPs; @@ -72,7 +72,7 @@ public class Account extends ForwardingSet implements Comparable private long volumes; private Set users = ImmutableSet.of(); - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -92,7 +92,7 @@ public class Account extends ForwardingSet implements Comparable return this; } - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } @@ -285,14 +285,14 @@ public class Account extends ForwardingSet implements Comparable } - private long id; + private String id; @SerializedName("accounttype") private Type type; @SerializedName("networkdomain") private String networkDomain; private String domain; @SerializedName("domainId") - private long domainId; + private String domainId; @SerializedName("ipsavailable") private Long IPsAvailable; @SerializedName("iplimit") @@ -337,7 +337,7 @@ public class Account extends ForwardingSet implements Comparable private long volumes; private Set users; - public Account(long id, Type type, String networkDomain, String domain, long domainId, Long IPsAvailable, Long IPLimit, long iPs, + public Account(String id, Type type, String networkDomain, String domain, String domainId, Long IPsAvailable, Long IPLimit, long iPs, boolean cleanupRequired, String name, long receivedBytes, long sentBytes, Long snapshotsAvailable, Long snapshotLimit, long snapshots, org.jclouds.cloudstack.domain.Account.State state, Long templatesAvailable, Long templateLimit, long templates, Long VMsAvailable, Long VMLimit, long vMsRunning, @@ -382,7 +382,7 @@ public class Account extends ForwardingSet implements Comparable /** * @return the id of the account */ - public long getId() { + public String getId() { return id; } @@ -418,7 +418,7 @@ public class Account extends ForwardingSet implements Comparable /** * @return id of the Domain the account belongs to */ - public long getDomainId() { + public String getDomainId() { return domainId; } @@ -598,7 +598,7 @@ public class Account extends ForwardingSet implements Comparable @Override public int compareTo(Account arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Alert.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Alert.java index 647dae11b8..88ee6bb564 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Alert.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Alert.java @@ -34,12 +34,12 @@ public class Alert implements Comparable { } public static class Builder { - private long id; + private String id; private String description; private Date sent; private String type; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -64,7 +64,7 @@ public class Alert implements Comparable { } } - private long id; + private String id; private String description; private Date sent; private String type; @@ -73,14 +73,14 @@ public class Alert implements Comparable { Alert() { } - private Alert(long id, String description, Date sent, String type) { + private Alert(String id, String description, Date sent, String type) { this.id = id; this.description = description; this.sent = sent; this.type = type; } - public long getId() { + public String getId() { return id; } @@ -129,6 +129,6 @@ public class Alert implements Comparable { @Override public int compareTo(Alert other) { - return Long.valueOf(this.getId()).compareTo(other.getId()); + return this.getId().compareTo(other.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncCreateResponse.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncCreateResponse.java index 48e63c5d94..3c2ed009ca 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncCreateResponse.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncCreateResponse.java @@ -28,9 +28,9 @@ import com.google.gson.annotations.SerializedName; public class AsyncCreateResponse { public static final AsyncCreateResponse UNINITIALIZED = new AsyncCreateResponse(); - private long id = -1; + private String id; @SerializedName("jobid") - private long jobId = -1; + private String jobId; /** * present only for serializer @@ -40,7 +40,7 @@ public class AsyncCreateResponse { } - public AsyncCreateResponse(long id, long jobId) { + public AsyncCreateResponse(String id, String jobId) { this.id = id; this.jobId = jobId; } @@ -48,14 +48,14 @@ public class AsyncCreateResponse { /** * @return id of the resource being created */ - public long getId() { + public String getId() { return id; } /** * @return id of the job in progress */ - public long getJobId() { + public String getJobId() { return jobId; } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncJob.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncJob.java index a46cbe35d5..93551fc603 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncJob.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/AsyncJob.java @@ -103,21 +103,21 @@ public class AsyncJob { } public static class Builder { - private long accountId = -1; + private String accountId; private String cmd; private Date created; - private long id = -1; - private long instanceId = -1; + private String id; + private String instanceId; private String instanceType; - private int progress = -1; + private int progress; private T result; private ResultCode resultCode = ResultCode.UNKNOWN; private String resultType; private AsyncJobError error; private Status status = Status.UNKNOWN; - private int userId = -1; + private String userId; - public Builder accountId(long accountId) { + public Builder accountId(String accountId) { this.accountId = accountId; return this; } @@ -132,12 +132,12 @@ public class AsyncJob { return this; } - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } - public Builder instanceId(long instanceId) { + public Builder instanceId(String instanceId) { this.instanceId = instanceId; return this; } @@ -177,7 +177,7 @@ public class AsyncJob { return this; } - public Builder userId(int userId) { + public Builder userId(String userId) { this.userId = userId; return this; } @@ -195,17 +195,17 @@ public class AsyncJob { } @SerializedName("accountid") - private long accountId = -1; + private String accountId; private String cmd; private Date created; @SerializedName("jobid") - private long id = -1; + private String id; @SerializedName("jobinstanceid") - private long instanceId = -1; + private String instanceId; @SerializedName("jobinstancetype") private String instanceType; @SerializedName("jobprocstatus") - private int progress = -1; + private int progress; @SerializedName("jobresult") private T result; @SerializedName("jobresultcode") @@ -215,11 +215,11 @@ public class AsyncJob { @SerializedName("jobstatus") private Status status = Status.UNKNOWN; @SerializedName("userid") - private int userId = -1; + private String userId; private AsyncJobError error; - public AsyncJob(long accountId, String cmd, Date created, long id, long instanceId, String instanceType, - int progress, T result, ResultCode resultCode, String resultType, Status status, int userId, AsyncJobError error) { + public AsyncJob(String accountId, String cmd, Date created, String id, String instanceId, String instanceType, + int progress, T result, ResultCode resultCode, String resultType, Status status, String userId, AsyncJobError error) { this.accountId = accountId; this.cmd = cmd; this.created = created; @@ -246,7 +246,7 @@ public class AsyncJob { /** * @return the account that executed the async command */ - public long getAccountId() { + public String getAccountId() { return accountId; } @@ -267,14 +267,14 @@ public class AsyncJob { /** * @return async job ID */ - public long getId() { + public String getId() { return id; } /** * @return the unique ID of the instance/entity object related to the job */ - public long getInstanceId() { + public String getInstanceId() { return instanceId; } @@ -323,7 +323,7 @@ public class AsyncJob { /** * @return the user that executed the async command */ - public int getUserId() { + public String getUserId() { return userId; } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Capacity.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Capacity.java index a16a74c8ff..1f39af815f 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Capacity.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Capacity.java @@ -44,10 +44,10 @@ public class Capacity implements Comparable { private long capacityTotal; private long capacityUsed; private double percentUsed; - private long podId; + private String podId; private String podName; private Type type; - private long zoneId; + private String zoneId; private String zoneName; public Builder capacityTotal(long capacityTotal) { @@ -65,7 +65,7 @@ public class Capacity implements Comparable { return this; } - public Builder podId(long podId) { + public Builder podId(String podId) { this.podId = podId; return this; } @@ -80,7 +80,7 @@ public class Capacity implements Comparable { return this; } - public Builder zoneId(long zoneId) { + public Builder zoneId(String zoneId) { this.zoneId = zoneId; return this; } @@ -142,12 +142,12 @@ public class Capacity implements Comparable { @SerializedName("percentused") private double percentUsed; @SerializedName("podid") - private long podId = -1; + private String podId; @SerializedName("podname") private String podName; private Capacity.Type type; @SerializedName("zoneid") - private long zoneId = -1; + private String zoneId; @SerializedName("zonename") private String zoneName; @@ -155,7 +155,7 @@ public class Capacity implements Comparable { Capacity() { } - public Capacity(long capacityTotal, long capacityUsed, double percentUsed, long podId, String podName, Type type, long zoneId, String zoneName) { + public Capacity(long capacityTotal, long capacityUsed, double percentUsed, String podId, String podName, Type type, String zoneId, String zoneName) { this.capacityTotal = capacityTotal; this.capacityUsed = capacityUsed; this.percentUsed = percentUsed; @@ -178,7 +178,7 @@ public class Capacity implements Comparable { return percentUsed; } - public long getPodId() { + public String getPodId() { return podId; } @@ -190,7 +190,7 @@ public class Capacity implements Comparable { return type; } - public long getZoneId() { + public String getZoneId() { return zoneId; } @@ -239,9 +239,9 @@ public class Capacity implements Comparable { @Override public int compareTo(Capacity other) { - int comparison = Long.valueOf(this.zoneId).compareTo(other.zoneId); + int comparison = this.zoneId.compareTo(other.zoneId); if (comparison != 0) return comparison; - comparison = Long.valueOf(this.podId).compareTo(other.podId); + comparison = this.podId.compareTo(other.podId); if (comparison != 0) return comparison; return Integer.valueOf(this.type.code).compareTo(other.type.code); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Cluster.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Cluster.java index 4714939c4a..cb167a9af1 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Cluster.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Cluster.java @@ -57,18 +57,18 @@ public class Cluster implements Comparable { } public static class Builder { - private long id; + private String id; private AllocationState allocationState; private Host.ClusterType clusterType; private String hypervisor; private ManagedState managedState; private String name; - private long podId; + private String podId; private String podName; - private long zoneId; + private String zoneId; private String zoneName; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -98,7 +98,7 @@ public class Cluster implements Comparable { return this; } - public Builder podId(long podId) { + public Builder podId(String podId) { this.podId = podId; return this; } @@ -108,7 +108,7 @@ public class Cluster implements Comparable { return this; } - public Builder zoneId(long zoneId) { + public Builder zoneId(String zoneId) { this.zoneId = zoneId; return this; } @@ -123,21 +123,21 @@ public class Cluster implements Comparable { } } - private long id; + private String id; @SerializedName("allocationstate") private AllocationState allocationState; @SerializedName("clustertype") private Host.ClusterType clusterType; @SerializedName("hypervisortype") private String hypervisor; @SerializedName("managedstate") private ManagedState managedState; private String name; - @SerializedName("podid") private long podId; + @SerializedName("podid") private String podId; @SerializedName("podname") private String podName; - @SerializedName("zoneid") private long zoneId; + @SerializedName("zoneid") private String zoneId; @SerializedName("zonename") private String zoneName; // Just for the serializer Cluster() {} - public Cluster(long id, AllocationState allocationState, Host.ClusterType clusterType, String hypervisor, ManagedState managedState, String name, long podId, String podName, long zoneId, String zoneName) { + public Cluster(String id, AllocationState allocationState, Host.ClusterType clusterType, String hypervisor, ManagedState managedState, String name, String podId, String podName, String zoneId, String zoneName) { this.id = id; this.allocationState = allocationState; this.clusterType = clusterType; @@ -150,7 +150,7 @@ public class Cluster implements Comparable { this.zoneName = zoneName; } - public long getId() { + public String getId() { return id; } @@ -174,7 +174,7 @@ public class Cluster implements Comparable { return name; } - public long getPodId() { + public String getPodId() { return podId; } @@ -182,7 +182,7 @@ public class Cluster implements Comparable { return podName; } - public long getZoneId() { + public String getZoneId() { return zoneId; } @@ -235,6 +235,6 @@ public class Cluster implements Comparable { @Override public int compareTo(Cluster other) { - return Long.valueOf(this.id).compareTo(other.id); + return this.id.compareTo(other.id); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/DiskOffering.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/DiskOffering.java index 8ea21254b0..5128faeb63 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/DiskOffering.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/DiskOffering.java @@ -40,17 +40,17 @@ public class DiskOffering implements Comparable { } public static class Builder { - private long id; + private String id; private String name; private String displayText; private Date created; private String domain; - private long domainId; + private String domainId; private int diskSize; private boolean customized; private Set tags = ImmutableSet.of(); - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -75,7 +75,7 @@ public class DiskOffering implements Comparable { return this; } - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } @@ -100,21 +100,21 @@ public class DiskOffering implements Comparable { } } - private long id; + private String id; private String name; @SerializedName("displaytext") private String displayText; private Date created; private String domain; @SerializedName("domainid") - private long domainId; + private String domainId; @SerializedName("disksize") private int diskSize; @SerializedName("iscustomized") private boolean customized; private String tags; - public DiskOffering(long id, String name, String displayText, Date created, String domain, long domainId, + public DiskOffering(String id, String name, String displayText, Date created, String domain, String domainId, int diskSize, boolean customized, Set tags) { this.id = id; this.name = name; @@ -139,7 +139,7 @@ public class DiskOffering implements Comparable { * * @return the id of the disk offering */ - public long getId() { + public String getId() { return id; } @@ -180,7 +180,7 @@ public class DiskOffering implements Comparable { * * @return the domain id of the disk offering */ - public long getDomainId() { + public String getDomainId() { return domainId; } @@ -253,7 +253,7 @@ public class DiskOffering implements Comparable { @Override public int compareTo(DiskOffering arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Domain.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Domain.java index 577598f456..565e1f6c19 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Domain.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Domain.java @@ -35,15 +35,15 @@ public class Domain implements Comparable { public static class Builder { - private long id; + private String id; private boolean hasChild; private long level; private String name; private String networkDomain; - private long parentDomainId; + private String parentDomainId; private String parentDomainName; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -68,7 +68,7 @@ public class Domain implements Comparable { return this; } - public Builder parentDomainId(long parentDomainId) { + public Builder parentDomainId(String parentDomainId) { this.parentDomainId = parentDomainId; return this; } @@ -88,7 +88,7 @@ public class Domain implements Comparable { Domain() { } - private long id; + private String id; @SerializedName("haschild") private boolean hasChild; private long level; @@ -96,12 +96,12 @@ public class Domain implements Comparable { @SerializedName("networkdomain") private String networkDomain; @SerializedName("parentdomainid") - private long parentDomainId; + private String parentDomainId; @SerializedName("parentdomainname") private String parentDomainName; - public Domain(long id, boolean hasChild, long level, String name, String networkDomain, - long parentDomainId, String parentDomainName) { + public Domain(String id, boolean hasChild, long level, String name, String networkDomain, + String parentDomainId, String parentDomainName) { this.id = id; this.hasChild = hasChild; this.level = level; @@ -111,7 +111,7 @@ public class Domain implements Comparable { this.parentDomainName = parentDomainName; } - public long getId() { + public String getId() { return id; } @@ -131,7 +131,7 @@ public class Domain implements Comparable { return networkDomain; } - public long getParentDomainId() { + public String getParentDomainId() { return parentDomainId; } @@ -165,19 +165,19 @@ public class Domain implements Comparable { @Override public String toString() { return "Domain{" + - "id=" + id + + "id='" + id + '\'' + ", hasChild=" + hasChild + ", level=" + level + ", name='" + name + '\'' + ", networkDomain='" + networkDomain + '\'' + - ", parentDomainId=" + parentDomainId + + ", parentDomainId='" + parentDomainId + '\'' + ", parentDomainName='" + parentDomainName + '\'' + '}'; } @Override public int compareTo(Domain arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Event.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Event.java index 0666114c57..c1b6c1a7b6 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Event.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Event.java @@ -32,12 +32,12 @@ public class Event implements Comparable { } public static class Builder { - private long id; + private String id; private String account; private String description; private Date created; private String domain; - private long domainId; + private String domainId; //TODO Change to enum : the event level (INFO, WARN, ERROR) private String level; private String parentId; @@ -46,7 +46,7 @@ public class Event implements Comparable { private String type; private String username; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -71,7 +71,7 @@ public class Event implements Comparable { return this; } - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } @@ -107,12 +107,12 @@ public class Event implements Comparable { } - private long id; + private String id; private String account; private String description; private Date created; private String domain; - private long domainId; + private String domainId; //TODO Change to enum : the event level (INFO, WARN, ERROR) private String level; private String parentId; @@ -121,7 +121,7 @@ public class Event implements Comparable { private String type; private String username; - public Event(long id, String account, String description, Date created, String domain, long domainId, String level, + public Event(String id, String account, String description, Date created, String domain, String domainId, String level, String parentId, String state, String type, String username) { this.id = id; this.account = account; @@ -146,7 +146,7 @@ public class Event implements Comparable { /** * @return the ID of the event */ - public long getId() { + public String getId() { return id; } @@ -182,7 +182,7 @@ public class Event implements Comparable { /** * @return the id of the account's domain */ - public long getDomainId() { + public String getDomainId() { return domainId; } @@ -224,7 +224,7 @@ public class Event implements Comparable { @Override public int compareTo(Event arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } @Override diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/FirewallRule.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/FirewallRule.java index c53366a2b6..9c3a188f49 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/FirewallRule.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/FirewallRule.java @@ -78,7 +78,7 @@ public class FirewallRule implements Comparable { } public static class Builder { - private long id; + private String id; private Set CIDRs; private int startPort; @@ -88,12 +88,12 @@ public class FirewallRule implements Comparable { private String icmpType; private String ipAddress; - private long ipAddressId; + private String ipAddressId; private Protocol protocol; private State state; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -128,7 +128,7 @@ public class FirewallRule implements Comparable { return this; } - public Builder ipAddressId(long ipAddressId) { + public Builder ipAddressId(String ipAddressId) { this.ipAddressId = ipAddressId; return this; } @@ -149,7 +149,7 @@ public class FirewallRule implements Comparable { } } - private long id; + private String id; @SerializedName("cidrlist") private Set CIDRs; @SerializedName("startport") @@ -163,12 +163,12 @@ public class FirewallRule implements Comparable { @SerializedName("ipaddress") private String ipAddress; @SerializedName("ipaddressid") - private long ipAddressId; + private String ipAddressId; private Protocol protocol; private State state; - public FirewallRule(long id, Set CIDRs, int startPort, int endPort, - String icmpCode, String icmpType, String ipAddress, long ipAddressId, + public FirewallRule(String id, Set CIDRs, int startPort, int endPort, + String icmpCode, String icmpType, String ipAddress, String ipAddressId, Protocol protocol, State state) { this.id = id; this.CIDRs = ImmutableSet.copyOf(CIDRs); @@ -184,10 +184,10 @@ public class FirewallRule implements Comparable { @Override public int compareTo(FirewallRule arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } - public long getId() { + public String getId() { return id; } @@ -215,7 +215,7 @@ public class FirewallRule implements Comparable { return ipAddress; } - public long getIpAddressId() { + public String getIpAddressId() { return ipAddressId; } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Host.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Host.java index 2de0e4c58e..a92ba74b19 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Host.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Host.java @@ -121,11 +121,11 @@ public class Host implements Comparable { } public static class Builder { - private long id; + private String id; private AllocationState allocationState; private int averageLoad; private String capabilities; - private long clusterId; + private String clusterId; private String clusterName; private ClusterType clusterType; private String cpuAllocated; @@ -143,28 +143,28 @@ public class Host implements Comparable { private String hypervisor; private String ipAddress; private boolean localStorageActive; - private long jobId; + private String jobId; private AsyncJob.Status jobStatus; private Date lastPinged; - private long managementServerId; + private String managementServerId; private long memoryAllocated; private long memoryTotal; private long memoryUsed; private String name; private long networkKbsRead; private long networkKbsWrite; - private long osCategoryId; - private long osCategoryName; - private long podId; + private String osCategoryId; + private String osCategoryName; + private String podId; private String podName; private Date removed; private State state; private Type type; private String version; - private long zoneId; + private String zoneId; private String zoneName; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -184,7 +184,7 @@ public class Host implements Comparable { return this; } - public Builder clusterId(long clusterId) { + public Builder clusterId(String clusterId) { this.clusterId = clusterId; return this; } @@ -274,7 +274,7 @@ public class Host implements Comparable { return this; } - public Builder jobId(long jobId) { + public Builder jobId(String jobId) { this.jobId = jobId; return this; } @@ -289,7 +289,7 @@ public class Host implements Comparable { return this; } - public Builder managementServerId(long managementServerId) { + public Builder managementServerId(String managementServerId) { this.managementServerId = managementServerId; return this; } @@ -324,17 +324,17 @@ public class Host implements Comparable { return this; } - public Builder osCategoryId(long osCategoryId) { + public Builder osCategoryId(String osCategoryId) { this.osCategoryId = osCategoryId; return this; } - public Builder osCategoryName(long osCategoryName) { + public Builder osCategoryName(String osCategoryName) { this.osCategoryName = osCategoryName; return this; } - public Builder podId(long podId) { + public Builder podId(String podId) { this.podId = podId; return this; } @@ -364,7 +364,7 @@ public class Host implements Comparable { return this; } - public Builder zoneId(long zoneId) { + public Builder zoneId(String zoneId) { this.zoneId = zoneId; return this; } @@ -388,7 +388,7 @@ public class Host implements Comparable { } } - private long id; + private String id; @SerializedName("allocationstate") private AllocationState allocationState; @SerializedName("averageload") @@ -396,7 +396,7 @@ public class Host implements Comparable { @SerializedName("capabilities") private String capabilities; @SerializedName("clusterid") - private long clusterId; + private String clusterId; @SerializedName("clustername") private String clusterName; @SerializedName("clustertype") @@ -428,13 +428,13 @@ public class Host implements Comparable { @SerializedName("islocalstorageactive") private boolean localStorageActive; @SerializedName("jobid") - private long jobId; + private String jobId; @SerializedName("jobstatus") private AsyncJob.Status jobStatus; @SerializedName("lastpinged") private Date lastPinged; @SerializedName("managementserverid") - private long managementServerId; + private String managementServerId; @SerializedName("memoryallocated") private long memoryAllocated; @SerializedName("memorytotal") @@ -447,11 +447,11 @@ public class Host implements Comparable { @SerializedName("networkkbswrite") private long networkKbsWrite; @SerializedName("oscategoryid") - private long osCategoryId; + private String osCategoryId; @SerializedName("oscategoryname") - private long osCategoryName; + private String osCategoryName; @SerializedName("podid") - private long podId; + private String podId; @SerializedName("podname") private String podName; private Date removed; @@ -459,7 +459,7 @@ public class Host implements Comparable { private Type type; private String version; @SerializedName("zoneid") - private long zoneId; + private String zoneId; @SerializedName("zonename") private String zoneName; @@ -467,16 +467,16 @@ public class Host implements Comparable { Host() { } - public Host(long id, AllocationState allocationState, int averageLoad, String capabilities, - long clusterId, String clusterName, ClusterType clusterType, String cpuAllocated, + public Host(String id, AllocationState allocationState, int averageLoad, String capabilities, + String clusterId, String clusterName, ClusterType clusterType, String cpuAllocated, int cpuNumber, int cpuSpeed, String cpuUsed, float cpuWithOverProvisioning, Date created, Date disconnected, long diskSizeAllocated, long diskSizeTotal, String events, boolean hasEnoughCapacity, String hostTags, String hypervisor, - String ipAddress, boolean localStorageActive, long jobId, AsyncJob.Status jobStatus, - Date lastPinged, long managementServerId, long memoryAllocated, long memoryTotal, + String ipAddress, boolean localStorageActive, String jobId, AsyncJob.Status jobStatus, + Date lastPinged, String managementServerId, long memoryAllocated, long memoryTotal, long memoryUsed, String name, long networkKbsRead, long networkKbsWrite, - long osCategoryId, long osCategoryName, long podId, String podName, Date removed, - State state, Type type, String version, long zoneId, String zoneName) { + String osCategoryId, String osCategoryName, String podId, String podName, Date removed, + State state, Type type, String version, String zoneId, String zoneName) { this.id = id; this.allocationState = allocationState; this.averageLoad = averageLoad; @@ -521,7 +521,7 @@ public class Host implements Comparable { this.zoneName = zoneName; } - public long getId() { + public String getId() { return id; } @@ -537,7 +537,7 @@ public class Host implements Comparable { return capabilities; } - public long getClusterId() { + public String getClusterId() { return clusterId; } @@ -609,7 +609,7 @@ public class Host implements Comparable { return localStorageActive; } - public long getJobId() { + public String getJobId() { return jobId; } @@ -621,7 +621,7 @@ public class Host implements Comparable { return lastPinged; } - public long getManagementServerId() { + public String getManagementServerId() { return managementServerId; } @@ -649,15 +649,15 @@ public class Host implements Comparable { return networkKbsWrite; } - public long getOsCategoryId() { + public String getOsCategoryId() { return osCategoryId; } - public long getOsCategoryName() { + public String getOsCategoryName() { return osCategoryName; } - public long getPodId() { + public String getPodId() { return podId; } @@ -681,7 +681,7 @@ public class Host implements Comparable { return version; } - public long getZoneId() { + public String getZoneId() { return zoneId; } @@ -802,6 +802,6 @@ public class Host implements Comparable { @Override public int compareTo(Host other) { - return Long.valueOf(this.getId()).compareTo(other.getId()); + return this.getId().compareTo(other.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IPForwardingRule.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IPForwardingRule.java index ac9aa5ac1d..46a0b1133b 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IPForwardingRule.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IPForwardingRule.java @@ -35,22 +35,22 @@ public class IPForwardingRule implements Comparable { } public static class Builder { - private long id; + private String id; private String IPAddress; - private long IPAddressId; + private String IPAddressId; private int startPort; private String protocol; public int endPort; private String state; private String virtualMachineDisplayName; - public long virtualMachineId; + public String virtualMachineId; private String virtualMachineName; private Set CIDRs = ImmutableSet.of(); private int privateEndPort; private int publicEndPort; public int publicPort; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -60,7 +60,7 @@ public class IPForwardingRule implements Comparable { return this; } - public Builder IPAddressId(long IPAddressId) { + public Builder IPAddressId(String IPAddressId) { this.IPAddressId = IPAddressId; return this; } @@ -90,7 +90,7 @@ public class IPForwardingRule implements Comparable { return this; } - public Builder virtualMachineId(long virtualMachineId) { + public Builder virtualMachineId(String virtualMachineId) { this.virtualMachineId = virtualMachineId; return this; } @@ -126,11 +126,11 @@ public class IPForwardingRule implements Comparable { } } - private long id; + private String id; @SerializedName("ipaddress") private String IPAddress; @SerializedName("ipaddressid") - private long IPAddressId; + private String IPAddressId; @SerializedName("startport") private int startPort; private String protocol; @@ -140,7 +140,7 @@ public class IPForwardingRule implements Comparable { @SerializedName("virtualmachinedisplayname") private String virtualMachineDisplayName; @SerializedName("virtualmachineid") - public long virtualMachineId; + public String virtualMachineId; @SerializedName("virtualmachinename") private String virtualMachineName; @SerializedName("publicport") @@ -157,8 +157,8 @@ public class IPForwardingRule implements Comparable { } - public IPForwardingRule(long id, String iPAddress, long iPAddressId, int startPort, String protocol, int endPort, - String state, String virtualMachineDisplayName, long virtualMachineId, String virtualMachineName, + public IPForwardingRule(String id, String iPAddress, String iPAddressId, int startPort, String protocol, int endPort, + String state, String virtualMachineDisplayName, String virtualMachineId, String virtualMachineName, int publicEndPort, int publicPort, Set CIDRs, int privateEndPort) { this.id = id; this.IPAddress = iPAddress; @@ -179,13 +179,13 @@ public class IPForwardingRule implements Comparable { @Override public int compareTo(IPForwardingRule arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } /** * @return the ID of the ip forwarding rule */ - public long getId() { + public String getId() { return id; } @@ -199,7 +199,7 @@ public class IPForwardingRule implements Comparable { /** * @return the public ip address id for the ip forwarding rule */ - public long getIPAddressId() { + public String getIPAddressId() { return IPAddressId; } @@ -241,7 +241,7 @@ public class IPForwardingRule implements Comparable { /** * @return the VM ID for the ip forwarding rule */ - public long getVirtualMachineId() { + public String getVirtualMachineId() { return virtualMachineId; } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISO.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISO.java index 82462a4b51..6ed2242ec3 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISO.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISO.java @@ -36,43 +36,43 @@ public class ISO implements Comparable { public static class Builder { - private long id; + private String id; private String account; - private long accountId; + private String accountId; private boolean bootable; private String checksum; private Date created; private boolean crossZones; private String displayText; private String domain; - private long domainid; + private String domainid; private String format; - private long hostId; + private String hostId; private String hostName; private String hypervisor; private boolean isExtractable; private boolean isFeatured; private boolean isPublic; private boolean isReady; - private long jobId; + private String jobId; private String jobStatus; private String name; - private long osTypeId; + private String osTypeId; private String osTypeName; private boolean passwordEnabled; private Date removed; private long size; - private long sourceTemplateId; + private String sourceTemplateId; private String status; private String templateTag; private String templateType; - private long zoneId; + private String zoneId; private String zoneName; /** * @param id the template ID */ - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -88,7 +88,7 @@ public class ISO implements Comparable { /** * @param accountId the account id to which the template belongs */ - public Builder accountId(long accountId) { + public Builder accountId(String accountId) { this.accountId = accountId; return this; } @@ -144,7 +144,7 @@ public class ISO implements Comparable { /** * @param domainid the ID of the domain to which the template belongs */ - public Builder domainid(long domainid) { + public Builder domainid(String domainid) { this.domainid = domainid; return this; } @@ -160,7 +160,7 @@ public class ISO implements Comparable { /** * @param hostId the ID of the secondary storage host for the template */ - public Builder hostId(long hostId) { + public Builder hostId(String hostId) { this.hostId = hostId; return this; } @@ -216,7 +216,7 @@ public class ISO implements Comparable { /** * @param jobId shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the template */ - public Builder jobId(long jobId) { + public Builder jobId(String jobId) { this.jobId = jobId; return this; } @@ -240,7 +240,7 @@ public class ISO implements Comparable { /** * @param osTypeId the ID of the OS type for this template. */ - public Builder osTypeId(long osTypeId) { + public Builder osTypeId(String osTypeId) { this.osTypeId = osTypeId; return this; } @@ -280,7 +280,7 @@ public class ISO implements Comparable { /** * @param sourceTemplateId the template ID of the parent template if present */ - public Builder sourceTemplateId(long sourceTemplateId) { + public Builder sourceTemplateId(String sourceTemplateId) { this.sourceTemplateId = sourceTemplateId; return this; } @@ -312,7 +312,7 @@ public class ISO implements Comparable { /** * @param zoneId the ID of the zone for this template */ - public Builder zoneId(long zoneId) { + public Builder zoneId(String zoneId) { this.zoneId = zoneId; return this; } @@ -327,10 +327,10 @@ public class ISO implements Comparable { } - private long id; + private String id; private String account; @SerializedName("accountid") - private long accountId; + private String accountId; private boolean bootable; private String checksum; private Date created; @@ -339,10 +339,10 @@ public class ISO implements Comparable { private String displayText; private String domain; @SerializedName("domainId") - private long domainid; + private String domainid; private String format; @SerializedName("hostid") - private long hostId; + private String hostId; @SerializedName("hostname") private String hostName; private String hypervisor; @@ -355,12 +355,12 @@ public class ISO implements Comparable { @SerializedName("isready") private boolean isReady; @SerializedName("jobid") - private long jobId; + private String jobId; @SerializedName("jobstatus") private String jobStatus; private String name; @SerializedName("ostypeid") - private long osTypeId; + private String osTypeId; @SerializedName("ostypename") private String osTypeName; @SerializedName("passwordenabled") @@ -368,14 +368,14 @@ public class ISO implements Comparable { private Date removed; private long size; @SerializedName("sourcetemplateid") - private long sourceTemplateId; + private String sourceTemplateId; private String status; @SerializedName("templatetag") private String templateTag; @SerializedName("templatetype") private String templateType; @SerializedName("zoneid") - private long zoneId; + private String zoneId; @SerializedName("zonename") private String zoneName; @@ -388,7 +388,7 @@ public class ISO implements Comparable { /** * @return the template ID */ - public long getId() { + public String getId() { return id; } @@ -402,7 +402,7 @@ public class ISO implements Comparable { /** * @return the account id to which the template belongs */ - public long getAccountId() { + public String getAccountId() { return accountId; } @@ -451,7 +451,7 @@ public class ISO implements Comparable { /** * @return the ID of the domain to which the template belongs */ - public long getDomainid() { + public String getDomainid() { return domainid; } @@ -465,7 +465,7 @@ public class ISO implements Comparable { /** * @return the ID of the secondary storage host for the template */ - public long getHostId() { + public String getHostId() { return hostId; } @@ -514,7 +514,7 @@ public class ISO implements Comparable { /** * @return shows the current pending asynchronous job ID. This tag is not returned if no current pending jobs are acting on the template */ - public long getJobId() { + public String getJobId() { return jobId; } @@ -535,7 +535,7 @@ public class ISO implements Comparable { /** * @return the ID of the OS type for this template. */ - public long getOsTypeId() { + public String getOsTypeId() { return osTypeId; } @@ -570,7 +570,7 @@ public class ISO implements Comparable { /** * @return the template ID of the parent template if present */ - public long getSourceTemplateId() { + public String getSourceTemplateId() { return sourceTemplateId; } @@ -598,7 +598,7 @@ public class ISO implements Comparable { /** * @return the ID of the zone for this template */ - public long getZoneId() { + public String getZoneId() { return zoneId; } @@ -700,7 +700,7 @@ public class ISO implements Comparable { @Override public int compareTo(ISO other) { - return new Long(id).compareTo(other.getId()); + return id.compareTo(other.getId()); } public enum ISOFilter { diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISOExtraction.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISOExtraction.java index 9961de23cd..13e79e4048 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISOExtraction.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISOExtraction.java @@ -34,10 +34,10 @@ public class ISOExtraction implements Comparable { public static class Builder { - private long id; - private long accountId; + private String id; + private String accountId; private Date created; - private long extractId; + private String extractId; private ExtractMode extractMode; private String name; private String state; @@ -45,13 +45,13 @@ public class ISOExtraction implements Comparable { private String storageType; private int uploadPercentage; private String url; - private long zoneId; + private String zoneId; private String zoneName; /** * @param id the id of extracted object */ - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -59,7 +59,7 @@ public class ISOExtraction implements Comparable { /** * @param accountId the account id to which the extracted object belongs */ - public Builder accountId(long accountId) { + public Builder accountId(String accountId) { this.accountId = accountId; return this; } @@ -75,7 +75,7 @@ public class ISOExtraction implements Comparable { /** * @param extractId the upload id of extracted object */ - public Builder extractId(long extractId) { + public Builder extractId(String extractId) { this.extractId = extractId; return this; } @@ -139,7 +139,7 @@ public class ISOExtraction implements Comparable { /** * @param zoneId zone ID the object was extracted from */ - public Builder zoneId(long zoneId) { + public Builder zoneId(String zoneId) { this.zoneId = zoneId; return this; } @@ -154,11 +154,11 @@ public class ISOExtraction implements Comparable { } - private long id; + private String id; @SerializedName("accountid") - private long accountId; + private String accountId; private Date created; - private long extractId; + private String extractId; private ExtractMode extractMode; private String name; private String state; @@ -169,7 +169,7 @@ public class ISOExtraction implements Comparable { private int uploadPercentage; private String url; @SerializedName("zoneid") - private long zoneId; + private String zoneId; @SerializedName("zonename") private String zoneName; @@ -182,14 +182,14 @@ public class ISOExtraction implements Comparable { /** * @return the id of extracted object */ - public long getId() { + public String getId() { return id; } /** * @return the account id to which the extracted object belongs */ - public long getAccountId() { + public String getAccountId() { return accountId; } @@ -203,7 +203,7 @@ public class ISOExtraction implements Comparable { /** * @return the upload id of extracted object */ - public long getExtractId() { + public String getExtractId() { return extractId; } @@ -259,7 +259,7 @@ public class ISOExtraction implements Comparable { /** * @return zone ID the object was extracted from */ - public long getZoneId() { + public String getZoneId() { return zoneId; } @@ -320,7 +320,7 @@ public class ISOExtraction implements Comparable { @Override public int compareTo(ISOExtraction other) { - return new Long(id).compareTo(other.getId()); + return id.compareTo(other.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISOPermissions.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISOPermissions.java index f03f3ac0ab..79d1efe929 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISOPermissions.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ISOPermissions.java @@ -34,15 +34,15 @@ public class ISOPermissions implements Comparable { public static class Builder { - private long id; + private String id; private String account; - private long domainId; + private String domainId; private boolean isPublic; /** * @param id the template ID */ - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -58,7 +58,7 @@ public class ISOPermissions implements Comparable { /** * @param domainId the ID of the domain to which the template belongs */ - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } @@ -73,11 +73,11 @@ public class ISOPermissions implements Comparable { } - private long id; + private String id; @SerializedName("account") private Set accounts; @SerializedName("domainid") - private long domainId; + private String domainId; @SerializedName("ispublic") private boolean isPublic; @@ -90,7 +90,7 @@ public class ISOPermissions implements Comparable { /** * @return the template ID */ - public long getId() { + public String getId() { return id; } @@ -104,7 +104,7 @@ public class ISOPermissions implements Comparable { /** * @return the ID of the domain to which the template belongs */ - public long getDomainId() { + public String getDomainId() { return domainId; } @@ -147,7 +147,7 @@ public class ISOPermissions implements Comparable { @Override public int compareTo(ISOPermissions other) { - return new Long(id).compareTo(other.getId()); + return id.compareTo(other.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IngressRule.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IngressRule.java index 6224a32ad1..ebff971c4a 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IngressRule.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/IngressRule.java @@ -39,7 +39,7 @@ public class IngressRule implements Comparable { private int ICMPCode = -1; private int ICMPType = -1; private String protocol; - private long id = -1; + private String id; private String securityGroupName; private int startPort = -1; @@ -73,7 +73,7 @@ public class IngressRule implements Comparable { return this; } - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -104,7 +104,7 @@ public class IngressRule implements Comparable { private int ICMPType = -1; private String protocol; @SerializedName("ruleid") - private long id = -1; + private String id; @SerializedName("securitygroupname") private String securityGroupName; @SerializedName("startport") @@ -115,7 +115,7 @@ public class IngressRule implements Comparable { } - public IngressRule(String account, String CIDR, int endPort, int iCMPCode, int iCMPType, String protocol, long id, + public IngressRule(String account, String CIDR, int endPort, int iCMPCode, int iCMPType, String protocol, String id, String securityGroupName, int startPort) { if (account == null) checkArgument(securityGroupName == null && CIDR != null, @@ -179,7 +179,7 @@ public class IngressRule implements Comparable { /** * @return the id of the ingress rule */ - public long getId() { + public String getId() { return id; } @@ -239,6 +239,6 @@ public class IngressRule implements Comparable { @Override public int compareTo(IngressRule arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoadBalancerRule.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoadBalancerRule.java index 1450a4127d..28165de1ce 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoadBalancerRule.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoadBalancerRule.java @@ -72,22 +72,22 @@ public class LoadBalancerRule implements Comparable { } public static class Builder { - private long id; + private String id; private String account; private Algorithm algorithm; private String description; private String domain; - private long domainId; + private String domainId; private String name; private int privatePort; private String publicIP; - private long publicIPId; + private String publicIPId; private int publicPort; private State state; private Set CIDRs = ImmutableSet.of(); - private long zoneId; + private String zoneId; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -112,7 +112,7 @@ public class LoadBalancerRule implements Comparable { return this; } - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } @@ -132,7 +132,7 @@ public class LoadBalancerRule implements Comparable { return this; } - public Builder publicIPId(long publicIPId) { + public Builder publicIPId(String publicIPId) { this.publicIPId = publicIPId; return this; } @@ -152,7 +152,7 @@ public class LoadBalancerRule implements Comparable { return this; } - public Builder zoneId(long zoneId) { + public Builder zoneId(String zoneId) { this.zoneId = zoneId; return this; } @@ -163,36 +163,36 @@ public class LoadBalancerRule implements Comparable { } } - private long id; + private String id; private String account; private Algorithm algorithm; private String description; private String domain; @SerializedName("domainid") - private long domainId; + private String domainId; private String name; @SerializedName("privateport") private int privatePort; @SerializedName("publicip") private String publicIP; @SerializedName("publicipid") - private long publicIPId; + private String publicIPId; @SerializedName("publicport") private int publicPort; private State state; @SerializedName("cidrlist") private Set CIDRs; @SerializedName("zoneId") - private long zoneId; + private String zoneId; // for deserializer LoadBalancerRule() { } - public LoadBalancerRule(long id, String account, Algorithm algorithm, String description, String domain, - long domainId, String name, int privatePort, String publicIP, long publicIPId, int publicPort, State state, - long zoneId, Set CIDRs) { + public LoadBalancerRule(String id, String account, Algorithm algorithm, String description, String domain, + String domainId, String name, int privatePort, String publicIP, String publicIPId, int publicPort, State state, + String zoneId, Set CIDRs) { this.id = id; this.account = account; this.algorithm = algorithm; @@ -213,7 +213,7 @@ public class LoadBalancerRule implements Comparable { /** * @return the load balancer rule ID */ - public long getId() { + public String getId() { return id; } @@ -248,7 +248,7 @@ public class LoadBalancerRule implements Comparable { /** * @return the domain ID of the load balancer rule */ - public long getDomainId() { + public String getDomainId() { return domainId; } @@ -276,7 +276,7 @@ public class LoadBalancerRule implements Comparable { /** * @return the public ip address id */ - public long getPublicIPId() { + public String getPublicIPId() { return publicIPId; } @@ -304,13 +304,13 @@ public class LoadBalancerRule implements Comparable { /** * @return the id of the zone the rule beStrings to */ - public long getZoneId() { + public String getZoneId() { return zoneId; } @Override public int compareTo(LoadBalancerRule arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoginResponse.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoginResponse.java index 3a97d99b81..8fb36e4558 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoginResponse.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/LoginResponse.java @@ -36,9 +36,9 @@ public class LoginResponse implements Comparable { public static class Builder { private String username; - private long userId; + private String userId; private String password; - private long domainId; + private String domainId; private long timeout; private boolean registered; private String accountName; @@ -73,7 +73,7 @@ public class LoginResponse implements Comparable { return this; } - public Builder userId(long userId) { + public Builder userId(String userId) { this.userId = userId; return this; } @@ -83,7 +83,7 @@ public class LoginResponse implements Comparable { return this; } - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } @@ -146,10 +146,10 @@ public class LoginResponse implements Comparable { private final String username; @SerializedName("userid") - private final long userId; + private final String userId; private final String password; @SerializedName("domainid") - private final long domainId; + private final String domainId; private final long timeout; private final boolean registered; @SerializedName("account") @@ -167,7 +167,7 @@ public class LoginResponse implements Comparable { private final String sessionKey; private final String jSessionId; - public LoginResponse(String username, long userId, String password, long domainId, long timeout, boolean registered, + public LoginResponse(String username, String userId, String password, String domainId, long timeout, boolean registered, String accountName, String firstName, String lastName, Account.Type accountType, String timezone, String timezoneOffset, String sessionKey, String jSessionId) { this.username = username; @@ -190,7 +190,7 @@ public class LoginResponse implements Comparable { return username; } - public long getUserId() { + public String getUserId() { return userId; } @@ -198,7 +198,7 @@ public class LoginResponse implements Comparable { return password; } - public long getDomainId() { + public String getDomainId() { return domainId; } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/NIC.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/NIC.java index d5b9f7cf74..6ecf585dbf 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/NIC.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/NIC.java @@ -33,7 +33,7 @@ public class NIC { } public static class Builder { - private long id; + private String id; private URI broadcastURI; private String gateway; private String IPAddress; @@ -41,11 +41,11 @@ public class NIC { private URI isolationURI; private String netmask; private String macAddress; - private long networkId; + private String networkId; private TrafficType trafficType; private GuestIPType guestIPType; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -85,7 +85,7 @@ public class NIC { return this; } - public Builder networkId(long networkId) { + public Builder networkId(String networkId) { this.networkId = networkId; return this; } @@ -107,7 +107,7 @@ public class NIC { } } - private long id; + private String id; @SerializedName("broadcasturi") private URI broadcastURI; private String gateway; @@ -121,7 +121,7 @@ public class NIC { @SerializedName("macaddress") private String macAddress; @SerializedName("networkid") - private long networkId; + private String networkId; @SerializedName("traffictype") private TrafficType trafficType; @SerializedName("type") @@ -134,8 +134,8 @@ public class NIC { } - public NIC(long id, URI broadcastURI, String gateway, String iPAddress, boolean isDefault, URI isolationURI, - String netmask, String macAddress, long networkId, TrafficType trafficType, GuestIPType guestIPType) { + public NIC(String id, URI broadcastURI, String gateway, String iPAddress, boolean isDefault, URI isolationURI, + String netmask, String macAddress, String networkId, TrafficType trafficType, GuestIPType guestIPType) { this.id = id; this.broadcastURI = broadcastURI; this.gateway = gateway; @@ -152,7 +152,7 @@ public class NIC { /** * the ID of the nic */ - public long getId() { + public String getId() { return id; } @@ -208,7 +208,7 @@ public class NIC { /** * the ID of the corresponding network */ - public long getNetworkId() { + public String getNetworkId() { return networkId; } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java index 5f5faeac43..f2b36311b2 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Network.java @@ -44,7 +44,7 @@ public class Network implements Comparable { } public static class Builder { - private long id; + private String id; private String broadcastDomainType; private URI broadcastURI; private String displayText; @@ -59,24 +59,24 @@ public class Network implements Comparable { private String networkDomain; private String networkOfferingAvailability; private String networkOfferingDisplayText; - private long networkOfferingId; + private String networkOfferingId; private String networkOfferingName; - private long related; + private String related; private String startIP; private String name; private String state; private GuestIPType guestIPType; private String VLAN; private TrafficType trafficType; - private long zoneId; + private String zoneId; private Set services = ImmutableSet.of(); private String account; - private long domainId; + private String domainId; private boolean securityGroupEnabled; private Set tags = ImmutableSet.of(); - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -86,7 +86,7 @@ public class Network implements Comparable { return this; } - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } @@ -161,7 +161,7 @@ public class Network implements Comparable { return this; } - public Builder networkOfferingId(long networkOfferingId) { + public Builder networkOfferingId(String networkOfferingId) { this.networkOfferingId = networkOfferingId; return this; } @@ -171,7 +171,7 @@ public class Network implements Comparable { return this; } - public Builder related(long related) { + public Builder related(String related) { this.related = related; return this; } @@ -206,7 +206,7 @@ public class Network implements Comparable { return this; } - public Builder zoneId(long zoneId) { + public Builder zoneId(String zoneId) { this.zoneId = zoneId; return this; } @@ -234,7 +234,7 @@ public class Network implements Comparable { } } - private long id; + private String id; private String account; @SerializedName("broadcastdomaintype") private String broadcastDomainType; @@ -248,7 +248,7 @@ public class Network implements Comparable { private String DNS2; private String domain; @SerializedName("domainid") - private long domainId; + private String domainId; @SerializedName("endip") private String endIP; private String gateway; @@ -267,10 +267,10 @@ public class Network implements Comparable { @SerializedName("networkofferingdisplaytext") private String networkOfferingDisplayText; @SerializedName("networkofferingid") - private long networkOfferingId; + private String networkOfferingId; @SerializedName("networkofferingname") private String networkOfferingName; - private long related; + private String related; @SerializedName("startip") private String startIP; private String name; @@ -282,7 +282,7 @@ public class Network implements Comparable { @SerializedName("traffictype") private TrafficType trafficType; @SerializedName("zoneid") - private long zoneId; + private String zoneId; private String tags; @SerializedName("securitygroupenabled") private boolean securityGroupEnabled; @@ -297,12 +297,12 @@ public class Network implements Comparable { } - public Network(long id, String broadcastDomainType, URI broadcastURI, String displayText, - List DNS, String domain, long domainId, String endIP, String gateway, boolean isDefault, + public Network(String id, String broadcastDomainType, URI broadcastURI, String displayText, + List DNS, String domain, String domainId, String endIP, String gateway, boolean isDefault, boolean isShared, boolean isSystem, String netmask, String networkDomain, String networkOfferingAvailability, - String networkOfferingDisplayText, long networkOfferingId, String networkOfferingName, long related, + String networkOfferingDisplayText, String networkOfferingId, String networkOfferingName, String related, String startIP, String name, String state, GuestIPType type, String vLAN, TrafficType trafficType, - long zoneId, Set services, Set tags, boolean securityGroupEnabled, + String zoneId, Set services, Set tags, boolean securityGroupEnabled, String account) { this.id = id; this.broadcastDomainType = broadcastDomainType; @@ -340,7 +340,7 @@ public class Network implements Comparable { /** * @return network id */ - public long getId() { + public String getId() { return id; } @@ -387,7 +387,7 @@ public class Network implements Comparable { /** * @return the domain id of the Network */ - public long getDomainId() { + public String getDomainId() { return domainId; } @@ -499,7 +499,7 @@ public class Network implements Comparable { /** * @return network offering id the network is created from */ - public long getNetworkOfferingId() { + public String getNetworkOfferingId() { return networkOfferingId; } @@ -513,7 +513,7 @@ public class Network implements Comparable { /** * @return related to what other network configuration */ - public long getRelated() { + public String getRelated() { return related; } @@ -527,7 +527,7 @@ public class Network implements Comparable { /** * @return zone id of the network */ - public long getZoneId() { + public String getZoneId() { return zoneId; } @@ -640,6 +640,6 @@ public class Network implements Comparable { @Override public int compareTo(Network arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/NetworkOffering.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/NetworkOffering.java index cff69666f0..c8d475bff8 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/NetworkOffering.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/NetworkOffering.java @@ -41,7 +41,7 @@ public class NetworkOffering implements Comparable { } public static class Builder { - private long id; + private String id; private String name; private String displayText; private Date created; @@ -54,7 +54,7 @@ public class NetworkOffering implements Comparable { private GuestIPType guestIPType; private Set tags = ImmutableSet.of(); - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -120,7 +120,7 @@ public class NetworkOffering implements Comparable { } } - private long id; + private String id; private String name; @SerializedName("displaytext") private String displayText; @@ -141,7 +141,7 @@ public class NetworkOffering implements Comparable { private int networkRate = -1; private String tags; - public NetworkOffering(long id, String name, String displayText, @Nullable Date created, + public NetworkOffering(String id, String name, String displayText, @Nullable Date created, NetworkOfferingAvailabilityType availability, boolean supportsVLAN, @Nullable Integer maxConnections, boolean isDefault, TrafficType trafficType, GuestIPType guestIPType, int networkRate, Set tags) { this.id = id; @@ -170,7 +170,7 @@ public class NetworkOffering implements Comparable { * * @return the id of the network offering */ - public long getId() { + public String getId() { return id; } @@ -312,7 +312,7 @@ public class NetworkOffering implements Comparable { @Override public int compareTo(NetworkOffering arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/OSType.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/OSType.java index c5ae4399ee..1a1305ed9e 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/OSType.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/OSType.java @@ -32,16 +32,16 @@ public class OSType implements Comparable { } public static class Builder { - private long id; - private long OSCategoryId; + private String id; + private String OSCategoryId; private String description; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } - public Builder OSCategoryId(long OSCategoryId) { + public Builder OSCategoryId(String OSCategoryId) { this.OSCategoryId = OSCategoryId; return this; } @@ -61,12 +61,12 @@ public class OSType implements Comparable { } - private long id; + private String id; @SerializedName("oscategoryid") - private long OSCategoryId; + private String OSCategoryId; private String description; - public OSType(long id, long OSCategoryId, String description) { + public OSType(String id, String OSCategoryId, String description) { this.id = id; this.OSCategoryId = OSCategoryId; this.description = description; @@ -75,14 +75,14 @@ public class OSType implements Comparable { /** * @return the ID of the OS type */ - public long getId() { + public String getId() { return id; } /** * @return the ID of the OS category */ - public long getOSCategoryId() { + public String getOSCategoryId() { return OSCategoryId; } @@ -123,7 +123,7 @@ public class OSType implements Comparable { @Override public int compareTo(OSType arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Pod.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Pod.java index 67e76e1530..db49ce654c 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Pod.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Pod.java @@ -34,9 +34,9 @@ public class Pod implements Comparable { public static class Builder { - private long id; + private String id; private String name; - private long zoneId; + private String zoneId; private String zoneName; private String gateway; private String netmask; @@ -49,7 +49,7 @@ public class Pod implements Comparable { /** * @param id the ID of the Pod */ - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -65,7 +65,7 @@ public class Pod implements Comparable { /** * @param zoneId the Zone ID of the Pod */ - public Builder zoneId(long zoneId) { + public Builder zoneId(String zoneId) { this.zoneId = zoneId; return this; } @@ -127,9 +127,9 @@ public class Pod implements Comparable { } } - private long id; + private String id; private String name; - @SerializedName("zoneid") private long zoneId; + @SerializedName("zoneid") private String zoneId; @SerializedName("zonename") private String zoneName; private String gateway; private String netmask; @@ -140,7 +140,7 @@ public class Pod implements Comparable { /* Just for the serializer */ Pod() {} - public Pod(long id, String name, long zoneId, String zoneName, String gateway, String netmask, String startIp, String endIp, AllocationState allocationState) { + public Pod(String id, String name, String zoneId, String zoneName, String gateway, String netmask, String startIp, String endIp, AllocationState allocationState) { this.id = id; this.name = name; this.zoneId = zoneId; @@ -155,7 +155,7 @@ public class Pod implements Comparable { /** * @return id the ID of the Pod */ - public long getId() { + public String getId() { return id; } @@ -169,7 +169,7 @@ public class Pod implements Comparable { /** * @return zoneId the Zone ID of the Pod */ - public long getZoneId() { + public String getZoneId() { return zoneId; } @@ -257,6 +257,6 @@ public class Pod implements Comparable { @Override public int compareTo(Pod other) { - return Long.valueOf(this.id).compareTo(other.id); + return this.id.compareTo(other.id); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PortForwardingRule.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PortForwardingRule.java index 644037d4ac..7d0daf2dcf 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PortForwardingRule.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PortForwardingRule.java @@ -78,21 +78,21 @@ public class PortForwardingRule implements Comparable { } public static class Builder { - private long id; + private String id; private String IPAddress; - private long IPAddressId; + private String IPAddressId; private int privatePort; private Protocol protocol; public int publicPort; private State state; private String virtualMachineDisplayName; - public long virtualMachineId; + public String virtualMachineId; private String virtualMachineName; private Set CIDRs = ImmutableSet.of(); private int privateEndPort; private int publicEndPort; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -102,7 +102,7 @@ public class PortForwardingRule implements Comparable { return this; } - public Builder IPAddressId(long IPAddressId) { + public Builder IPAddressId(String IPAddressId) { this.IPAddressId = IPAddressId; return this; } @@ -132,7 +132,7 @@ public class PortForwardingRule implements Comparable { return this; } - public Builder virtualMachineId(long virtualMachineId) { + public Builder virtualMachineId(String virtualMachineId) { this.virtualMachineId = virtualMachineId; return this; } @@ -163,11 +163,11 @@ public class PortForwardingRule implements Comparable { } } - private long id; + private String id; @SerializedName("ipaddress") private String IPAddress; @SerializedName("ipaddressid") - private long IPAddressId; + private String IPAddressId; @SerializedName("privateport") private int privatePort; private Protocol protocol; @@ -177,7 +177,7 @@ public class PortForwardingRule implements Comparable { @SerializedName("virtualmachinedisplayname") private String virtualMachineDisplayName; @SerializedName("virtualmachineid") - public long virtualMachineId; + public String virtualMachineId; @SerializedName("virtualmachinename") private String virtualMachineName; @SerializedName("cidrlist") @@ -187,8 +187,8 @@ public class PortForwardingRule implements Comparable { @SerializedName("publicendport") private int publicEndPort; - public PortForwardingRule(long id, String iPAddress, long iPAddressId, int privatePort, Protocol protocol, - int publicPort, State state, String virtualMachineDisplayName, long virtualMachineId, + public PortForwardingRule(String id, String iPAddress, String iPAddressId, int privatePort, Protocol protocol, + int publicPort, State state, String virtualMachineDisplayName, String virtualMachineId, String virtualMachineName, Set CIDRs, int privateEndPort, int publicEndPort) { this.id = id; this.IPAddress = iPAddress; @@ -207,13 +207,13 @@ public class PortForwardingRule implements Comparable { @Override public int compareTo(PortForwardingRule arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } /** * @return the ID of the port forwarding rule */ - public long getId() { + public String getId() { return id; } @@ -227,7 +227,7 @@ public class PortForwardingRule implements Comparable { /** * @return the public ip address id for the port forwarding rule */ - public long getIPAddressId() { + public String getIPAddressId() { return IPAddressId; } @@ -269,7 +269,7 @@ public class PortForwardingRule implements Comparable { /** * @return the VM ID for the port forwarding rule */ - public long getVirtualMachineId() { + public String getVirtualMachineId() { return virtualMachineId; } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PublicIPAddress.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PublicIPAddress.java index 55f29049be..596cfc0e83 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PublicIPAddress.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/PublicIPAddress.java @@ -38,29 +38,29 @@ public class PublicIPAddress implements Comparable { } public static class Builder { - private long id; + private String id; private String account; private Date allocated; - private long associatedNetworkId; + private String associatedNetworkId; private String domain; - private long domainId; + private String domainId; private boolean usesVirtualNetwork; private String IPAddress; private boolean isSourceNAT; private boolean isStaticNAT; - private long networkId; + private String networkId; private State state; private String virtualMachineDisplayName; - private long virtualMachineId = -1; + private String virtualMachineId; private String virtualMachineName; - private long VLANId; + private String VLANId; private String VLANName; - private long zoneId; + private String zoneId; private String zoneName; - private Long jobId; + private String jobId; private Integer jobStatus; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -75,7 +75,7 @@ public class PublicIPAddress implements Comparable { return this; } - public Builder associatedNetworkId(long associatedNetworkId) { + public Builder associatedNetworkId(String associatedNetworkId) { this.associatedNetworkId = associatedNetworkId; return this; } @@ -85,7 +85,7 @@ public class PublicIPAddress implements Comparable { return this; } - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } @@ -110,7 +110,7 @@ public class PublicIPAddress implements Comparable { return this; } - public Builder networkId(long networkId) { + public Builder networkId(String networkId) { this.networkId = networkId; return this; } @@ -125,7 +125,7 @@ public class PublicIPAddress implements Comparable { return this; } - public Builder virtualMachineId(long virtualMachineId) { + public Builder virtualMachineId(String virtualMachineId) { this.virtualMachineId = virtualMachineId; return this; } @@ -135,7 +135,7 @@ public class PublicIPAddress implements Comparable { return this; } - public Builder VLANId(long VLANId) { + public Builder VLANId(String VLANId) { this.VLANId = VLANId; return this; } @@ -145,7 +145,7 @@ public class PublicIPAddress implements Comparable { return this; } - public Builder zoneId(long zoneId) { + public Builder zoneId(String zoneId) { this.zoneId = zoneId; return this; } @@ -155,7 +155,7 @@ public class PublicIPAddress implements Comparable { return this; } - public Builder jobId(Long jobId) { + public Builder jobId(String jobId) { this.jobId = jobId; return this; } @@ -172,14 +172,14 @@ public class PublicIPAddress implements Comparable { } } - private long id; + private String id; private String account; private Date allocated; @SerializedName("associatednetworkid") - private long associatedNetworkId; + private String associatedNetworkId; private String domain; @SerializedName("domainid") - private long domainId; + private String domainId; @SerializedName("forvirtualnetwork") private boolean usesVirtualNetwork; @SerializedName("ipaddress") @@ -189,25 +189,25 @@ public class PublicIPAddress implements Comparable { @SerializedName("isstaticnat") private boolean isStaticNAT; @SerializedName("networkid") - private long networkId; + private String networkId; private State state; @SerializedName("virtualmachinedisplayname") private String virtualMachineDisplayName; @SerializedName("virtualmachineid") - private long virtualMachineId = -1; + private String virtualMachineId; @SerializedName("virtualmachinename") private String virtualMachineName; @SerializedName("VLANid") - private long VLANId; + private String VLANId; @SerializedName("VLANname") private String VLANName; @SerializedName("zoneid") - private long zoneId; + private String zoneId; @SerializedName("zonename") private String zoneName; @SerializedName("jobid") @Nullable - private Long jobId; + private String jobId; @SerializedName("jobstatus") @Nullable private Integer jobStatus; @@ -235,10 +235,10 @@ public class PublicIPAddress implements Comparable { } - public PublicIPAddress(long id, String account, Date allocated, long associatedNetworkId, String domain, - long domainId, boolean usesVirtualNetwork, String iPAddress, boolean isSourceNAT, boolean isStaticNAT, - long networkId, State state, String virtualMachineDisplayName, long virtualMachineId, - String virtualMachineName, long VLANId, String VLANName, long zoneId, String zoneName, Long jobId, + public PublicIPAddress(String id, String account, Date allocated, String associatedNetworkId, String domain, + String domainId, boolean usesVirtualNetwork, String iPAddress, boolean isSourceNAT, boolean isStaticNAT, + String networkId, State state, String virtualMachineDisplayName, String virtualMachineId, + String virtualMachineName, String VLANId, String VLANName, String zoneId, String zoneName, String jobId, Integer jobStatus) { this.id = id; this.account = account; @@ -266,13 +266,13 @@ public class PublicIPAddress implements Comparable { @Override public int compareTo(PublicIPAddress arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } /** * @return public IP address id */ - public long getId() { + public String getId() { return id; } @@ -296,7 +296,7 @@ public class PublicIPAddress implements Comparable { * machine */ @Nullable - public Long getJobId() { + public String getJobId() { return jobId; } @@ -312,7 +312,7 @@ public class PublicIPAddress implements Comparable { /** * @return the ID of the Network associated with the IP address */ - public long getAssociatedNetworkId() { + public String getAssociatedNetworkId() { return associatedNetworkId; } @@ -326,7 +326,7 @@ public class PublicIPAddress implements Comparable { /** * @return the domain ID the public IP address is associated with */ - public long getDomainId() { + public String getDomainId() { return domainId; } @@ -361,7 +361,7 @@ public class PublicIPAddress implements Comparable { /** * @return the ID of the Network where ip belongs to */ - public long getNetworkId() { + public String getNetworkId() { return networkId; } @@ -385,7 +385,7 @@ public class PublicIPAddress implements Comparable { * @return virtual machine id the ip address is assigned to (not null only * for static nat Ip) */ - public long getVirtualMachineId() { + public String getVirtualMachineId() { return virtualMachineId; } @@ -400,7 +400,7 @@ public class PublicIPAddress implements Comparable { /** * @return the ID of the VLAN associated with the IP address */ - public long getVLANId() { + public String getVLANId() { return VLANId; } @@ -414,7 +414,7 @@ public class PublicIPAddress implements Comparable { /** * @return the ID of the zone the public IP address belongs to */ - public long getZoneId() { + public String getZoneId() { return zoneId; } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ResourceLimit.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ResourceLimit.java index 50aaa015a4..f2e6aa88f6 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ResourceLimit.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ResourceLimit.java @@ -42,7 +42,7 @@ public class ResourceLimit implements Comparable { private String account; private String domain; - private long domainId; + private String domainId; private int max; private ResourceType resourceType; @@ -56,7 +56,7 @@ public class ResourceLimit implements Comparable { return this; } - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } @@ -84,12 +84,12 @@ public class ResourceLimit implements Comparable { private String account; private String domain; @SerializedName("domainid") - private long domainId; + private String domainId; private int max; @SerializedName("resourcetype") private ResourceType resourceType; - public ResourceLimit(String account, String domain, long domainId, int max, ResourceType resourceType) { + public ResourceLimit(String account, String domain, String domainId, int max, ResourceType resourceType) { this.account = account; this.domain = domain; this.domainId = domainId; @@ -105,7 +105,7 @@ public class ResourceLimit implements Comparable { return domain; } - public long getDomainId() { + public String getDomainId() { return domainId; } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SecurityGroup.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SecurityGroup.java index 09a44d22d8..88232c2048 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SecurityGroup.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SecurityGroup.java @@ -39,18 +39,18 @@ public class SecurityGroup implements Comparable { } public static class Builder { - private long id; + private String id; private String account; private String name; private String description; private String domain; - private long domainId; - private Long jobId; + private String domainId; + private String jobId; private Integer jobStatus; private Set ingressRules = ImmutableSet.of(); - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -75,12 +75,12 @@ public class SecurityGroup implements Comparable { return this; } - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } - public Builder jobId(Long jobId) { + public Builder jobId(String jobId) { this.jobId = jobId; return this; } @@ -100,16 +100,16 @@ public class SecurityGroup implements Comparable { } } - private long id; + private String id; private String account; private String name; private String description; private String domain; @SerializedName("domainid") - private long domainId; + private String domainId; @SerializedName("jobid") @Nullable - private Long jobId; + private String jobId; @SerializedName("jobstatus") @Nullable private Integer jobStatus; @@ -117,8 +117,8 @@ public class SecurityGroup implements Comparable { // so that tests and serialization come out expected private SortedSet ingressRules = ImmutableSortedSet.of(); - public SecurityGroup(long id, String account, String name, String description, String domain, long domainId, - Long jobId, Integer jobStatus, Set ingressRules) { + public SecurityGroup(String id, String account, String name, String description, String domain, String domainId, + String jobId, Integer jobStatus, Set ingressRules) { this.id = id; this.account = account; this.name = name; @@ -140,7 +140,7 @@ public class SecurityGroup implements Comparable { /** * @return the id of the security group */ - public long getId() { + public String getId() { return id; } @@ -169,7 +169,7 @@ public class SecurityGroup implements Comparable { /** * @return the domain id of the security group */ - public long getDomainId() { + public String getDomainId() { return domainId; } @@ -179,7 +179,7 @@ public class SecurityGroup implements Comparable { * machine */ @Nullable - public Long getJobId() { + public String getJobId() { return jobId; } @@ -241,6 +241,6 @@ public class SecurityGroup implements Comparable { @Override public int compareTo(SecurityGroup arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ServiceOffering.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ServiceOffering.java index 06d1ebf459..8fc731fd54 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ServiceOffering.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/ServiceOffering.java @@ -39,12 +39,12 @@ public class ServiceOffering implements Comparable { public static class Builder { - private long id; + private String id; private String name; private String displayText; private Date created; private String domain; - private long domainId; + private String domainId; private int cpuNumber; private int cpuSpeed; private int memory; @@ -59,7 +59,7 @@ public class ServiceOffering implements Comparable { private Set tags = ImmutableSet.of(); - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -84,7 +84,7 @@ public class ServiceOffering implements Comparable { return this; } - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } @@ -157,14 +157,14 @@ public class ServiceOffering implements Comparable { } } - private long id; + private String id; private String name; @SerializedName("displaytext") private String displayText; private Date created; private String domain; @SerializedName("domainid") - private long domainId; + private String domainId; @SerializedName("cpunumber") private int cpuNumber; @SerializedName("cpuspeed") @@ -189,7 +189,7 @@ public class ServiceOffering implements Comparable { private boolean systemVmType; - public ServiceOffering(long id, String name, String displayText, Date created, String domain, long domainId, + public ServiceOffering(String id, String name, String displayText, Date created, String domain, String domainId, int cpuNumber, int cpuSpeed, int memory, boolean haSupport, StorageType storageType, Set tags, boolean defaultUse, String hostTags, boolean systemOffering, boolean cpuUseLimited, long networkRate, boolean systemVmType) { @@ -217,7 +217,7 @@ public class ServiceOffering implements Comparable { /** * @return the id of the service offering */ - public long getId() { + public String getId() { return id; } @@ -253,7 +253,7 @@ public class ServiceOffering implements Comparable { /** * @return the domain id of the service offering */ - public long getDomainId() { + public String getDomainId() { return domainId; } @@ -395,7 +395,7 @@ public class ServiceOffering implements Comparable { @Override public int compareTo(ServiceOffering arg0) { - return new Long(id).compareTo(arg0.getId()); + return id.compareTo(arg0.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Snapshot.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Snapshot.java index fbbb3fcfe1..a4a97044be 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Snapshot.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Snapshot.java @@ -37,25 +37,25 @@ public class Snapshot implements Comparable { public static class Builder { - private long id; + private String id; private String account; private Date created; private String domain; - private long domainId; + private String domainId; private Interval interval; - private long jobId; + private String jobId; private String jobStatus; private String name; private Type snapshotType; private State state; - private long volumeId; + private String volumeId; private String volumeName; private Volume.Type volumeType; /** * @param id ID of the snapshot */ - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -87,7 +87,7 @@ public class Snapshot implements Comparable { /** * @param domainId the domain ID of the snapshot's account */ - public Builder domainId(long domainId) { + public Builder domainId(String domainId) { this.domainId = domainId; return this; } @@ -103,7 +103,7 @@ public class Snapshot implements Comparable { /** * @param jobId the job ID associated with the snapshot. This is only displayed if the snapshot listed is part of a currently running asynchronous job. */ - public Builder jobId(long jobId) { + public Builder jobId(String jobId) { this.jobId = jobId; return this; } @@ -143,7 +143,7 @@ public class Snapshot implements Comparable { /** * @param volumeId ID of the disk volume */ - public Builder volumeId(long volumeId) { + public Builder volumeId(String volumeId) { this.volumeId = volumeId; return this; } @@ -215,16 +215,16 @@ public class Snapshot implements Comparable { } } - private long id; + private String id; private String account; private Date created; private String domain; @SerializedName("domainid") - private long domainId; + private String domainId; @SerializedName("intervaltype") private Interval interval; @SerializedName("jobid") - private long jobId; + private String jobId; @SerializedName("jobstatus") private String jobStatus; private String name; @@ -232,14 +232,14 @@ public class Snapshot implements Comparable { private Type snapshotType; private State state; @SerializedName("volumeid") - private long volumeId; + private String volumeId; @SerializedName("volumename") private String volumeName; @SerializedName("volumetype") private Volume.Type volumeType; - public Snapshot(long id, String account, Date created, String domain, long domainId, Interval interval, long jobId, - String jobStatus, String name, Type snapshotType, State state, long volumeId, String volumeName, Volume.Type volumeType) { + public Snapshot(String id, String account, Date created, String domain, String domainId, Interval interval, String jobId, + String jobStatus, String name, Type snapshotType, State state, String volumeId, String volumeName, Volume.Type volumeType) { this.id = id; this.account = account; this.created = created; @@ -265,7 +265,7 @@ public class Snapshot implements Comparable { /** * @return ID of the snapshot */ - public long getId() { + public String getId() { return id; } @@ -293,7 +293,7 @@ public class Snapshot implements Comparable { /** * @return the domain ID of the snapshot's account */ - public long getDomainId() { + public String getDomainId() { return domainId; } @@ -307,7 +307,7 @@ public class Snapshot implements Comparable { /** * @return the job ID associated with the snapshot. This is only displayed if the snapshot listed is part of a currently running asynchronous job. */ - public long getJobId() { + public String getJobId() { return jobId; } @@ -342,7 +342,7 @@ public class Snapshot implements Comparable { /** * @return ID of the disk volume */ - public long getVolumeId() { + public String getVolumeId() { return volumeId; } @@ -414,6 +414,6 @@ public class Snapshot implements Comparable { @Override public int compareTo(Snapshot other) { - return new Long(this.id).compareTo(other.getId()); + return id.compareTo(other.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicy.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicy.java index 44da162d04..b736eb73e9 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicy.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/SnapshotPolicy.java @@ -32,17 +32,17 @@ public class SnapshotPolicy implements Comparable { public static class Builder { - private long id; + private String id; private Snapshot.Interval interval; private long numberToRetain; private String schedule; private String timezone; - private long volumeId; + private String volumeId; /** * @param id the ID of the snapshot policy */ - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -82,7 +82,7 @@ public class SnapshotPolicy implements Comparable { /** * @param volumeId ID of the disk volume */ - public Builder volumeId(long volumeId) { + public Builder volumeId(String volumeId) { this.volumeId = volumeId; return this; } @@ -92,7 +92,7 @@ public class SnapshotPolicy implements Comparable { } } - private long id; + private String id; @SerializedName("intervaltype") private Snapshot.Interval interval; @SerializedName("maxsnaps") @@ -100,9 +100,9 @@ public class SnapshotPolicy implements Comparable { private String schedule; private String timezone; @SerializedName("volumeid") - private long volumeId; + private String volumeId; - public SnapshotPolicy(long id, Snapshot.Interval interval, long numberToRetain, String schedule, String timezone, long volumeId) { + public SnapshotPolicy(String id, Snapshot.Interval interval, long numberToRetain, String schedule, String timezone, String volumeId) { this.id = id; this.interval = interval; this.numberToRetain = numberToRetain; @@ -120,7 +120,7 @@ public class SnapshotPolicy implements Comparable { /** * @return the ID of the snapshot policy */ - public long getId() { + public String getId() { return id; } @@ -155,7 +155,7 @@ public class SnapshotPolicy implements Comparable { /** * @return ID of the disk volume */ - public long getVolumeId() { + public String getVolumeId() { return volumeId; } @@ -195,7 +195,7 @@ public class SnapshotPolicy implements Comparable { @Override public int compareTo(SnapshotPolicy other) { - return new Long(id).compareTo(other.getId()); + return id.compareTo(other.getId()); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/StoragePool.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/StoragePool.java index e8a05fdf59..03471a05c5 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/StoragePool.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/StoragePool.java @@ -94,26 +94,26 @@ public class StoragePool implements Comparable { private Builder() { } - private long id; + private String id; private String name; private String path; private String tags; private State state; private Type type; - private long zoneId; + private String zoneId; private String zoneName; - private long podId; + private String podId; private String podName; - private long clusterId; + private String clusterId; private String clusterName; private Date created; private long diskSizeAllocated; private long diskSizeTotal; private String ipAddress; - private Long jobId; + private String jobId; private String jobStatus; - public Builder id(long id) { + public Builder id(String id) { this.id = id; return this; } @@ -143,7 +143,7 @@ public class StoragePool implements Comparable { return this; } - public Builder zoneId(long zoneId) { + public Builder zoneId(String zoneId) { this.zoneId = zoneId; return this; } @@ -153,7 +153,7 @@ public class StoragePool implements Comparable { return this; } - public Builder podId(long podId) { + public Builder podId(String podId) { this.podId = podId; return this; } @@ -163,7 +163,7 @@ public class StoragePool implements Comparable { return this; } - public Builder clusterId(long clusterId) { + public Builder clusterId(String clusterId) { this.clusterId = clusterId; return this; } @@ -193,7 +193,7 @@ public class StoragePool implements Comparable { return this; } - public Builder jobId(Long jobId) { + public Builder jobId(String jobId) { this.jobId = jobId; return this; } @@ -208,30 +208,30 @@ public class StoragePool implements Comparable { } } - private long id; + private String id; private String name; private String path; private String tags; private State state; private Type type; - @SerializedName("zoneid") private long zoneId; + @SerializedName("zoneid") private String zoneId; @SerializedName("zonename") private String zoneName; - @SerializedName("podid") private long podId; + @SerializedName("podid") private String podId; @SerializedName("podname") private String podName; - @SerializedName("clusterid") private long clusterId; + @SerializedName("clusterid") private String clusterId; @SerializedName("clustername") private String clusterName; private Date created; @SerializedName("disksizeallocated") private long diskSizeAllocated; @SerializedName("disksizetotal") private long diskSizeTotal; @SerializedName("ipaddress") private String ipAddress; - @SerializedName("jobid") private Long jobId; + @SerializedName("jobid") private String jobId; @SerializedName("jobstatus") private String jobStatus; /* Exists only for the serializer */ StoragePool() { } - public StoragePool(long id, String name, String path, String tags, State state, Type type, long zoneId, String zoneName, long podId, String podName, long clusterId, String clusterName, Date created, long diskSizeAllocated, long diskSizeTotal, String ipAddress, Long jobId, String jobStatus) { + public StoragePool(String id, String name, String path, String tags, State state, Type type, String zoneId, String zoneName, String podId, String podName, String clusterId, String clusterName, Date created, long diskSizeAllocated, long diskSizeTotal, String ipAddress, String jobId, String jobStatus) { this.id = id; this.name = name; this.path = path; @@ -252,7 +252,7 @@ public class StoragePool implements Comparable { this.jobStatus = jobStatus; } - public long getId() { + public String getId() { return id; } @@ -276,7 +276,7 @@ public class StoragePool implements Comparable { return type; } - public long getZoneId() { + public String getZoneId() { return zoneId; } @@ -284,7 +284,7 @@ public class StoragePool implements Comparable { return zoneName; } - public long getPodId() { + public String getPodId() { return podId; } @@ -292,7 +292,7 @@ public class StoragePool implements Comparable { return podName; } - public long getClusterId() { + public String getClusterId() { return clusterId; } @@ -316,7 +316,7 @@ public class StoragePool implements Comparable { return ipAddress; } - public Long getJobId() { + public String getJobId() { return jobId; } @@ -386,6 +386,6 @@ public class StoragePool implements Comparable { @Override public int compareTo(StoragePool other) { - return Long.valueOf(this.id).compareTo(other.id); + return this.id.compareTo(other.id); } } diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Template.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Template.java index a3b4ea9eeb..27c33c1220 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Template.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/Template.java @@ -36,16 +36,16 @@ public class Template implements Comparable