You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by ad...@apache.org on 2014/11/17 17:19:30 UTC
[14/19] jclouds git commit: JCLOUDS-780 Remove vcloud.
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/Features.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/Features.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/Features.java
deleted file mode 100644
index 24eb38e..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/Features.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network;
-
-import static com.google.common.base.Objects.equal;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.base.Objects;
-
-/**
- * The Features element defines the DHCP and firewall features of a network.
- */
-public class Features {
- @Nullable
- private final DhcpService dhcpService;
- @Nullable
- private final FirewallService firewallService;
- @Nullable
- private final NatService natService;
-
- public Features(@Nullable DhcpService dhcpService, @Nullable FirewallService firewallService,
- @Nullable NatService natService) {
- this.dhcpService = dhcpService;
- this.firewallService = firewallService;
- this.natService = natService;
- }
-
- /**
- * specifies the properties of the network’s DHCP service
- *
- * @since vcloud api 0.9, but emulated for 0.8
- */
- @Nullable
- public DhcpService getDhcpService() {
- return dhcpService;
- }
-
- /**
- * defines the firewall service capabilities of the network
- *
- * @since vcloud api 0.8
- */
- @Nullable
- public FirewallService getFirewallService() {
- return firewallService;
- }
-
- /**
- * defines the NAT service capabilities of the network
- *
- * @since vcloud api 0.8
- */
- @Nullable
- public NatService getNatService() {
- return natService;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- Features that = Features.class.cast(o);
- return equal(this.dhcpService, that.dhcpService) && equal(this.firewallService, that.firewallService)
- && equal(this.natService, that.natService);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(dhcpService, firewallService, natService);
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper("").omitNullValues().add("dhcpService", dhcpService)
- .add("firewallService", firewallService).add("natService", natService).toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/FenceMode.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/FenceMode.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/FenceMode.java
deleted file mode 100644
index a531b0d..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/FenceMode.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.CaseFormat;
-
-/**
- *
- * The FenceMode element contains one of the following strings that specify how a network is
- * connected to its parent network.
- */
-public enum FenceMode {
- /**
- * The two networks are bridged.
- * <p/>
- * Note that in vcloud 0.8 this was called ALLOW_IN_OUT, and so our implementation automatically
- * converts this for you. Use bridged instead of allowInOut.
- *
- * @since vcloud api 0.9
- */
- BRIDGED,
- /**
- * The two networks are not connected.
- *
- * @since vcloud api 0.8
- */
- ISOLATED,
- /**
- * The two networks are connected as specified in their NatService elements.
- *
- * @since vcloud api 0.8
- */
- NAT_ROUTED, UNRECOGNIZED;
-
- public String value() {
- return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name());
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static FenceMode fromValue(String fenceMode) {
- try {
- return valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(fenceMode, "fenceMode")));
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/FirewallService.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/FirewallService.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/FirewallService.java
deleted file mode 100644
index bde3a21..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/FirewallService.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.vcloud.domain.network.firewall.FirewallRule;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
-/**
- * The FirewallService element defines the firewall service capabilities of a network.
- */
-public class FirewallService {
- private final boolean enabled;
-
- List<FirewallRule> firewallRules = Lists.newArrayList();
-
- public FirewallService(boolean enabled, Iterable<FirewallRule> firewallRules) {
- this.enabled = enabled;
- Iterables.addAll(this.firewallRules, checkNotNull(firewallRules, "firewallRules"));
- }
-
- /**
- * @return Firewall rules for the network
- *
- * @since vcloud api 0.8
- */
- public List<FirewallRule> getFirewallRules() {
- return firewallRules;
- }
-
- /**
- * @return true if the service is enabled
- *
- * @since vcloud api 0.9
- */
- @Nullable
- public boolean isEnabled() {
- return enabled;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- FirewallService that = FirewallService.class.cast(o);
- return equal(this.enabled, that.enabled) && equal(this.firewallRules, that.firewallRules);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(enabled, firewallRules);
- }
-
- @Override
- public String toString() {
- ToStringHelper helper = Objects.toStringHelper("").omitNullValues().add("enabled", enabled);
- if (!firewallRules.isEmpty())
- helper.add("firewallRules", firewallRules);
- return helper.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpAddressAllocationMode.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpAddressAllocationMode.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpAddressAllocationMode.java
deleted file mode 100644
index 2b32691..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpAddressAllocationMode.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network;
-
-
-/**
- *
- * The IpAddressAllocationMode element specifies how an IP address is allocated to this connection.
- */
-public enum IpAddressAllocationMode {
- /**
- * no IP addressing mode specified
- *
- * @since vcloud api 1.0
- */
- NONE,
- /**
- * static IP address assigned manually
- *
- * @since vcloud api 1.0
- */
- MANUAL,
- /**
- * static IP address allocated from a pool
- *
- * @since vcloud api 1.0
- */
- POOL,
- /**
- * IP address assigned by DHCP
- *
- * @since vcloud api 1.0
- */
- DHCP;
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpRange.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpRange.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpRange.java
deleted file mode 100644
index 180d13d..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpRange.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.Objects;
-
-/**
- * The IpRange element defines a range of IP addresses available on a network.
- */
-public class IpRange {
- private final String startAddress;
- private final String endAddress;
-
- public IpRange(String startAddress, String endAddress) {
- this.startAddress = checkNotNull(startAddress, "startAddress");
- this.endAddress = checkNotNull(endAddress, "endAddress");
- }
-
- /**
- * @return lowest IP address in the range
- *
- * @since vcloud api 0.9
- */
- public String getStartAddress() {
- return startAddress;
- }
-
- /**
- * @return highest IP address in the range
- *
- * @since vcloud api 0.9
- */
- public String getEndAddress() {
- return endAddress;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- IpRange that = IpRange.class.cast(o);
- return equal(this.startAddress, that.startAddress) && equal(this.endAddress, that.endAddress);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(startAddress, endAddress);
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper("").omitNullValues().add("startAddress", startAddress)
- .add("endAddress", endAddress).toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpScope.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpScope.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpScope.java
deleted file mode 100644
index 13cd9bb..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/IpScope.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Sets;
-
-/**
- * The IpScope element defines the address range, gateway, netmask, and other properties of the
- * network.
- */
-public class IpScope {
- private final boolean inherited;
- @Nullable
- private final String gateway;
- @Nullable
- private final String netmask;
- @Nullable
- private final String dns1;
- @Nullable
- private final String dns2;
- @Nullable
- private final String dnsSuffix;
- private final Set<IpRange> ipRanges = Sets.newLinkedHashSet();
- private final Set<String> allocatedIpAddresses = Sets.newLinkedHashSet();
-
- public IpScope(boolean inherited, @Nullable String gateway, @Nullable String netmask, @Nullable String dns1,
- @Nullable String dns2, @Nullable String dnsSuffix, Iterable<IpRange> ipRanges,
- Iterable<String> allocatedIpAddresses) {
- this.inherited = inherited;
- this.gateway = gateway;
- this.netmask = netmask;
- this.dns1 = dns1;
- this.dns2 = dns2;
- this.dnsSuffix = dnsSuffix;
- Iterables.addAll(this.ipRanges, checkNotNull(ipRanges, "ipRanges"));
- Iterables.addAll(this.allocatedIpAddresses, checkNotNull(allocatedIpAddresses, "allocatedIpAddresses"));
- }
-
- /**
- * @return true of the values in this IpScope element are inherited from the ParentNetwork of the
- * containing Configuration
- * @since vcloud api 0.9
- */
- public boolean isInherited() {
- return inherited;
- }
-
- /**
- * @return IP address of the network gateway
- *
- * @since vcloud api 0.8
- */
- @Nullable
- public String getGateway() {
- return gateway;
- }
-
- /**
- * @return netmask to apply to addresses on the network
- *
- * @since vcloud api 0.8
- */
- @Nullable
- public String getNetmask() {
- return netmask;
- }
-
- /**
- * @return IP address of the primary DNS server for this network
- *
- * @since vcloud api 0.9
- */
- @Nullable
- public String getDns1() {
- return dns1;
- }
-
- /**
- * @return IP address of the secondary DNS server for this network
- *
- * @since vcloud api 0.9
- */
- @Nullable
- public String getDns2() {
- return dns2;
- }
-
- /**
- * @return suffix to be applied when resolving hostnames that are not fully‐qualified.
- *
- * @since vcloud api 0.9
- */
- @Nullable
- public String getDnsSuffix() {
- return dnsSuffix;
- }
-
- /**
- * @return A container for IpRange elements.
- *
- * @since vcloud api 0.9
- */
- public Set<IpRange> getIpRanges() {
- return ipRanges;
- }
-
- /**
- * @return A list of addresses allocated from any of the specified IpRanges
- *
- * @since vcloud api 0.9
- */
- public Set<String> getAllocatedIpAddresses() {
- return allocatedIpAddresses;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- IpScope that = IpScope.class.cast(o);
- return equal(this.inherited, that.inherited) && equal(this.gateway, that.gateway)
- && equal(this.netmask, that.netmask) && equal(this.dns1, that.dns1) && equal(this.dns2, that.dns2)
- && equal(this.dnsSuffix, that.dnsSuffix)
- && equal(this.ipRanges, that.ipRanges)
- && equal(this.allocatedIpAddresses, that.allocatedIpAddresses);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(inherited, gateway, netmask, dns1, dns2, dnsSuffix, ipRanges, allocatedIpAddresses);
- }
-
- @Override
- public String toString() {
- ToStringHelper helper = Objects.toStringHelper("").omitNullValues().add("inherited", inherited).add("gateway", gateway)
- .add("netmask", netmask).add("dns1", dns1).add("dns2", dns2).add("dnsSuffix", dnsSuffix);
- if (!ipRanges.isEmpty())
- helper.add("ipRanges", ipRanges);
- if (!allocatedIpAddresses.isEmpty())
- helper.add("allocatedIpAddresses", allocatedIpAddresses);
- return helper.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/NatService.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/NatService.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/NatService.java
deleted file mode 100644
index 14e0251..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/NatService.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.util.List;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.vcloud.domain.network.nat.NatPolicy;
-import org.jclouds.vcloud.domain.network.nat.NatRule;
-import org.jclouds.vcloud.domain.network.nat.NatType;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
-/**
- * The NatService element defines the network address translation capabilities of a network.
- */
-public class NatService {
- private final boolean enabled;
- @Nullable
- private final NatType type;
- @Nullable
- private final NatPolicy policy;
- private final List<NatRule> natRules = Lists.newArrayList();
-
- public NatService(boolean enabled, @Nullable NatType type, @Nullable NatPolicy policy,
- Iterable<NatRule> natRules) {
- this.enabled = enabled;
- this.type = type;
- this.policy = policy;
- Iterables.addAll(this.natRules, checkNotNull(natRules, "natRules"));
- }
-
- /**
- * @return Nat rules for the network
- *
- * @since vcloud api 0.8
- */
- public List<NatRule> getNatRules() {
- return natRules;
- }
-
- /**
- * @return true if the service is enabled
- *
- * @since vcloud api 0.9
- */
- public boolean isEnabled() {
- return enabled;
- }
-
- /**
- * @return specifies how Network Address Translation is implemented by the NAT service
- *
- * @since vcloud api 0.9
- */
- @Nullable
- public NatType getType() {
- return type;
- }
-
- /**
- * @return specifies how packets are handled by the NAT service.
- *
- * @since vcloud api 0.9
- */
- @Nullable
- public NatPolicy getPolicy() {
- return policy;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- NatService that = NatService.class.cast(o);
- return equal(this.enabled, that.enabled) && equal(this.type, that.type)
- && equal(this.policy, that.policy) && equal(this.natRules, that.natRules);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(enabled, type, policy, natRules);
- }
-
- @Override
- public String toString() {
- ToStringHelper helper = Objects.toStringHelper("").omitNullValues().add("enabled", enabled)
- .add("type", type).add("policy", policy);
- if (!natRules.isEmpty())
- helper.add("natRules", natRules);
- return helper.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/NetworkConfig.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/NetworkConfig.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/NetworkConfig.java
deleted file mode 100644
index 79e6461..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/NetworkConfig.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-
-import org.jclouds.javax.annotation.Nullable;
-
-public class NetworkConfig {
-
- public Builder toBuilder() {
- return builder().fromNetworkConfig(this);
- }
-
- public static Builder builder() {
- return new Builder();
- }
-
- public static class Builder {
- private String networkName;
- private URI parentNetwork;
- private FenceMode fenceMode;
-
- public Builder networkName(String networkName) {
- this.networkName = networkName;
- return this;
- }
-
- public Builder parentNetwork(URI parentNetwork) {
- this.parentNetwork = parentNetwork;
- return this;
- }
-
- public Builder fenceMode(FenceMode fenceMode) {
- this.fenceMode = fenceMode;
- return this;
- }
-
- public Builder fromNetworkConfig(NetworkConfig in) {
- return networkName(in.getNetworkName()).parentNetwork(in.getParentNetwork()).fenceMode(in.getFenceMode());
- }
-
- public NetworkConfig build() {
- return new NetworkConfig(networkName, parentNetwork, fenceMode);
- }
- }
-
- @Nullable
- private final String networkName;
- private final URI parentNetwork;
- @Nullable
- private final FenceMode fenceMode;
-
- /**
- *
- * Create a new NetworkConfig.
- *
- * @param networkName
- * a valid {@networkConfig
- * org.jclouds.vcloud.domain.VAppTemplate#getNetworkSection network in the vapp
- * template}, or null to have us choose default
- * @param parentNetwork
- * a valid {@networkConfig org.jclouds.vcloud.domain.Org#getNetworks in
- * the Org}
- * @param fenceMode
- * how to manage the relationship between the two networks
- */
- public NetworkConfig(String networkName, URI parentNetwork, FenceMode fenceMode) {
- this.networkName = networkName;
- this.parentNetwork = checkNotNull(parentNetwork, "parentNetwork");
- this.fenceMode = fenceMode;
- }
-
- public NetworkConfig(URI parentNetwork) {
- this(null, parentNetwork, null);
- }
-
- /**
- * A name for the network. If the
- * {@link org.jclouds.vcloud.domain.VAppTemplate#getNetworkSection} includes a
- * {@link NetworkSection.Network} network element, the name you specify for the vApp network must
- * match the name specified in that element’s name attribute.
- *
- * @return
- */
- public String getNetworkName() {
- return networkName;
- }
-
- /**
- *
- * @return A reference to the organization network to which this network connects.
- */
- public URI getParentNetwork() {
- return parentNetwork;
- }
-
- /**
- * A value of bridged indicates that this vApp network is connected directly to the organization
- * network.
- */
- public FenceMode getFenceMode() {
- return fenceMode;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((fenceMode == null) ? 0 : fenceMode.hashCode());
- result = prime * result + ((parentNetwork == null) ? 0 : parentNetwork.hashCode());
- result = prime * result + ((networkName == null) ? 0 : networkName.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- NetworkConfig other = (NetworkConfig) obj;
- if (fenceMode == null) {
- if (other.fenceMode != null)
- return false;
- } else if (!fenceMode.equals(other.fenceMode))
- return false;
- if (parentNetwork == null) {
- if (other.parentNetwork != null)
- return false;
- } else if (!parentNetwork.equals(other.parentNetwork))
- return false;
- if (networkName == null) {
- if (other.networkName != null)
- return false;
- } else if (!networkName.equals(other.networkName))
- return false;
- return true;
- }
-
- @Override
- public String toString() {
- return "[networkName=" + networkName + ", parentNetwork=" + parentNetwork + ", fenceMode=" + fenceMode + "]";
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/OrgNetwork.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/OrgNetwork.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/OrgNetwork.java
deleted file mode 100644
index f50d18c..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/OrgNetwork.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network;
-
-import java.util.List;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.vcloud.domain.ReferenceType;
-import org.jclouds.vcloud.domain.Task;
-import org.jclouds.vcloud.domain.network.internal.OrgNetworkImpl;
-
-import com.google.inject.ImplementedBy;
-
-/**
- * A vDC is a deployment environment for vApps. A Vdc element provides a user view of a vDC.
- */
-@org.jclouds.vcloud.endpoints.Network
-@ImplementedBy(OrgNetworkImpl.class)
-public interface OrgNetwork extends ReferenceType {
- /**
- * The org this network belongs to.
- *
- * @since vcloud api 0.9
- */
- @Nullable
- ReferenceType getOrg();
-
- /**
- * optional description
- *
- * @since vcloud api 0.8
- */
- @Nullable
- String getDescription();
-
- /**
- * read‐only container for Task elements. Each element in the container represents a queued,
- * running, or failed task owned by this object.
- *
- * @since vcloud api 0.9
- */
- List<Task> getTasks();
-
- /**
- *
- * @return properties of the network
- *
- * @since vcloud api 0.9, but emulated for 0.8
- */
- Configuration getConfiguration();
-
- /**
- * A reference the network pool from which this network is provisioned. This element, which is
- * required when creating a NatRouted or Isolated network, is returned in response to a creation
- * request but not shown in subsequent GET requests.
- *
- * @since vcloud api 0.9
- */
- @Nullable
- ReferenceType getNetworkPool();
-
- /**
- * list of external IP addresses that this network can use for NAT.
- *
- * @since vcloud api 0.9
- */
- Set<String> getAllowedExternalIpAddresses();
-
- /**
- * The Configuration element specifies properties of a network.
- */
- interface Configuration {
- /**
- * defines the address range, gateway, netmask, and other properties of the network.
- *
- * @since vcloud api 0.9, but emulated for 0.8
- */
- @Nullable
- IpScope getIpScope();
-
- /**
- * reference to a network to which this network connects
- *
- * @since vcloud api 0.9
- */
- @Nullable
- ReferenceType getParentNetwork();
-
- /**
- * defines how this network is connected to its ParentNetwork
- *
- * @since vcloud api 0.8
- */
- FenceMode getFenceMode();
-
- /**
- * defines a set of network features.
- *
- * @since vcloud api 0.9, but emulated for 0.8
- */
- @Nullable Features getFeatures();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallPolicy.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallPolicy.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallPolicy.java
deleted file mode 100644
index 44a5e81..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallPolicy.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.firewall;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.CaseFormat;
-
-/**
- * specifies how packets are handled by the firewall
- */
-public enum FirewallPolicy {
- /**
- * drop packets of this type
- */
- DROP,
- /**
- * allow packets of this type to pass through the firewall
- */
- ALLOW, UNRECOGNIZED;
-
- public String value() {
- return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name());
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static FirewallPolicy fromValue(String policy) {
- try {
- return valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(policy, "policy")));
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallProtocols.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallProtocols.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallProtocols.java
deleted file mode 100644
index 8b09dc2..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallProtocols.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.firewall;
-
-import static com.google.common.base.Objects.equal;
-
-import com.google.common.base.Objects;
-
-/**
- * The Protocols element specifies the protocols to which firewall rules apply.
- *
- * @since vcloud api 0.9 emulated for 0.8
- */
-public class FirewallProtocols {
- private final boolean tcp;
- private final boolean udp;
-
- public FirewallProtocols(boolean tcp, boolean udp) {
- this.tcp = tcp;
- this.udp = udp;
- }
-
- /**
- * @return true if the firewall rules apply to the TCP protocol
- */
- public boolean isTcp() {
- return tcp;
- }
-
- /**
- * @return true if the firewall rules apply to the UDP protocol
- */
- public boolean isUdp() {
- return udp;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- FirewallProtocols that = FirewallProtocols.class.cast(o);
- return equal(this.tcp, that.tcp) && equal(this.udp, that.udp);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(tcp, udp);
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper("").omitNullValues().add("tcp", tcp).add("udp", udp).toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallRule.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallRule.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallRule.java
deleted file mode 100644
index dfb578b..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallRule.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.firewall;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.javax.annotation.Nullable;
-
-import com.google.common.base.Objects;
-
-/**
- * The FirewallRule element defines a single firewall rule.
- *
- * @since vcloud api 0.8
- */
-public class FirewallRule {
-
- private final boolean enabled;
- @Nullable
- private final String description;
- @Nullable
- private final FirewallPolicy policy;
- @Nullable
- private final FirewallProtocols protocols;
- private final int port;
- private final String destinationIp;
-
- public FirewallRule(boolean enabled, @Nullable String description, @Nullable FirewallPolicy policy,
- @Nullable FirewallProtocols protocols, int port, String destinationIp) {
- this.enabled = enabled;
- this.description = description;
- this.policy = policy;
- this.protocols = protocols;
- this.port = port;
- this.destinationIp = checkNotNull(destinationIp, "destinationIp");
- }
-
- /**
- * @return true if the rule is enabled
- */
- public boolean isEnabled() {
- return enabled;
- }
-
- /**
- * @return description of the rule
- */
- @Nullable
- public String getDescription() {
- return description;
- }
-
- /**
- * @return specifies how packets are handled by the firewall
- */
- @Nullable
- public FirewallPolicy getPolicy() {
- return policy;
- }
-
- /**
- * @return specifies the protocols to which this firewall rule applies
- */
- @Nullable
- public FirewallProtocols getProtocols() {
- return protocols;
- }
-
- /**
- * @return specifies the network port to which this firewall rule applies. A value of ‐1 matches
- * any port.
- */
- public int getPort() {
- return port;
- }
-
- /**
- * @return specifies the destination IP address, inside the firewall, to which this firewall rule
- * applies
- */
- public String getDestinationIp() {
- return destinationIp;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- FirewallRule that = FirewallRule.class.cast(o);
- return equal(this.enabled, that.enabled) && equal(this.description, that.description)
- && equal(this.policy, that.policy) && equal(this.protocols, that.protocols) && equal(this.port, that.port)
- && equal(this.destinationIp, that.destinationIp);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(enabled, description, policy, protocols, port, destinationIp);
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper("").omitNullValues().add("enabled", enabled).add("description", description)
- .add("policy", policy).add("protocols", protocols).add("port", port).add("destinationIp", destinationIp)
- .toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/internal/OrgNetworkImpl.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/internal/OrgNetworkImpl.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/internal/OrgNetworkImpl.java
deleted file mode 100644
index 0dc059a..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/internal/OrgNetworkImpl.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.internal;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import java.net.URI;
-import java.util.List;
-import java.util.Set;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.vcloud.domain.ReferenceType;
-import org.jclouds.vcloud.domain.Task;
-import org.jclouds.vcloud.domain.internal.ReferenceTypeImpl;
-import org.jclouds.vcloud.domain.network.Features;
-import org.jclouds.vcloud.domain.network.FenceMode;
-import org.jclouds.vcloud.domain.network.IpScope;
-import org.jclouds.vcloud.domain.network.OrgNetwork;
-
-import com.google.common.base.Objects;
-import com.google.common.base.Objects.ToStringHelper;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-import com.google.common.collect.Sets;
-
-public class OrgNetworkImpl extends ReferenceTypeImpl implements OrgNetwork {
- @Nullable
- private final ReferenceType org;
- @Nullable
- private final String description;
- private final List<Task> tasks = Lists.newArrayList();
- private final Configuration configuration;
- @Nullable
- private final ReferenceType networkPool;
- private final Set<String> allowedExternalIpAddresses = Sets.newLinkedHashSet();
-
- public OrgNetworkImpl(String name, String type, URI id, @Nullable ReferenceType org, @Nullable String description,
- Iterable<Task> tasks, Configuration configuration, @Nullable ReferenceType networkPool,
- Iterable<String> allowedExternalIpAddresses) {
- super(name, type, id);
- this.org = org;
- this.description = description;
- Iterables.addAll(this.tasks, checkNotNull(tasks, "tasks"));
- this.configuration = checkNotNull(configuration, "configuration");
- this.networkPool = networkPool;
- Iterables.addAll(this.allowedExternalIpAddresses, checkNotNull(allowedExternalIpAddresses,
- "allowedExternalIpAddresses"));
- }
-
- public static class ConfigurationImpl implements Configuration {
-
- @Nullable
- private final IpScope ipScope;
- @Nullable
- private final ReferenceType parentNetwork;
- private final FenceMode fenceMode;
- private final Features features;
-
- public ConfigurationImpl(@Nullable IpScope ipScope, @Nullable ReferenceType parentNetwork, FenceMode fenceMode,
- @Nullable Features features) {
- this.ipScope = ipScope;
- this.parentNetwork = parentNetwork;
- this.fenceMode = checkNotNull(fenceMode, "fenceMode");
- this.features = features;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IpScope getIpScope() {
- return ipScope;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ReferenceType getParentNetwork() {
- return parentNetwork;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public FenceMode getFenceMode() {
- return fenceMode;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- @Nullable
- public Features getFeatures() {
- return features;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- ConfigurationImpl that = ConfigurationImpl.class.cast(o);
- return equal(this.ipScope, that.ipScope) && equal(this.parentNetwork, that.parentNetwork)
- && equal(this.fenceMode, that.fenceMode) && equal(this.features, that.features);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(ipScope, parentNetwork, fenceMode, features);
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper("").omitNullValues().add("ipScope", ipScope).add("parentNetwork", parentNetwork)
- .add("fenceMode", fenceMode).add("features", features).toString();
- }
-
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ReferenceType getOrg() {
- return org;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public String getDescription() {
- return description;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public List<Task> getTasks() {
- return tasks;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Configuration getConfiguration() {
- return configuration;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ReferenceType getNetworkPool() {
- return networkPool;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Set<String> getAllowedExternalIpAddresses() {
- return allowedExternalIpAddresses;
- }
-
- @Override
- public ToStringHelper string() {
- ToStringHelper helper = super.string().add("org", org).add("description", description)
- .add("configuration", configuration).add("networkPool", networkPool);
- if (!allowedExternalIpAddresses.isEmpty())
- helper.add("allowedExternalIpAddresses", allowedExternalIpAddresses);
- if (!tasks.isEmpty())
- helper.add("tasks", tasks);
- return helper;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatPolicy.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatPolicy.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatPolicy.java
deleted file mode 100644
index 8a49b33..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatPolicy.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.nat;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.CaseFormat;
-
-/**
- * The Policy element of a NatService element specifies how packets are handled by the NAT service.
- */
-public enum NatPolicy {
- /**
- * packets of this type pass through the firewall in both directions
- */
- ALLOW_TRAFFIC,
- /**
- * only inbound packets of this type pass through the firewall
- */
- ALLOW_TRAFFIC_IN, UNRECOGNIZED;
-
- public String value() {
- return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name());
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static NatPolicy fromValue(String policy) {
- try {
- return valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(policy, "policy")));
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatProtocol.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatProtocol.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatProtocol.java
deleted file mode 100644
index 7204bae..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatProtocol.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.nat;
-
-
-/**
- *
- * The Protocol specifies the network protocol to which this rule applies
- *
- * @since vcloud api 0.9
- */
-public enum NatProtocol {
- /**
- * the rule applies to the TCP protocol
- *
- * @since vcloud api 0.9
- */
- TCP,
- /**
- * the rule applies to the UDP protocol
- *
- * @since vcloud api 0.9
- */
- UDP,
- /**
- * the rule applies to the TCP and UDP protocols.
- *
- * @since vcloud api 0.9
- */
- TCP_UDP;
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatRule.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatRule.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatRule.java
deleted file mode 100644
index b9ca510..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatRule.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.nat;
-
-import org.jclouds.javax.annotation.Nullable;
-
-/**
- *
- * Defines a rule associated with Nat
- *
- * @since vcloud api 0.9
- */
-public interface NatRule {
- /**
- * IP address to which this NAT rule maps the IP address specified in the InternalIp element.
- */
- @Nullable
- String getExternalIP();
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatType.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatType.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatType.java
deleted file mode 100644
index 98b95e2..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/NatType.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.nat;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.CaseFormat;
-
-/**
- *
- * The NatType element specifies how network address translation is implemented by the NAT service.
- *
- * @since vcloud api 0.9
- */
-public enum NatType {
- /**
- * NAT service implemented by IP address translation
- *
- * @since vcloud api 0.9
- */
- IP_TRANSLATION,
- /**
- * NAT service implemented by network port forwarding
- *
- * @since vcloud api 0.9
- */
- PORT_FORWARDING, UNRECOGNIZED;
-
- public String value() {
- return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name());
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static NatType fromValue(String natType) {
- try {
- return valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(natType, "natType")));
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/MappingMode.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/MappingMode.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/MappingMode.java
deleted file mode 100644
index 6d71116..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/MappingMode.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.nat.rules;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import com.google.common.base.CaseFormat;
-
-/**
- * The MappingMode element specifies how IP address mapping is implemented by the NAT service.
- */
-public enum MappingMode {
- /**
- * the external IP address is specified in the ExternalIP element
- */
- MANUAL,
- /**
- * the external IP address is assigned automatically
- */
- AUTOMATIC, UNRECOGNIZED;
-
- public String value() {
- return CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name());
- }
-
- @Override
- public String toString() {
- return value();
- }
-
- public static MappingMode fromValue(String mode) {
- try {
- return valueOf(CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, checkNotNull(mode, "mode")));
- } catch (IllegalArgumentException e) {
- return UNRECOGNIZED;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/OneToOneVmRule.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/OneToOneVmRule.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/OneToOneVmRule.java
deleted file mode 100644
index c2b1b4b..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/OneToOneVmRule.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.nat.rules;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.vcloud.domain.network.nat.NatRule;
-
-import com.google.common.base.Objects;
-
-/**
- * The OneToOneVmRule element describes a NAT rule that specifies network address translation
- * details for a single virtual machine. The external IP address can be specified manually or
- * assigned automatically at deployment time. The internal IP address is discovered by looking up
- * the specified VmReference and NIC ID.
- *
- * @since vcloud 0.9
- */
-public class OneToOneVmRule implements NatRule {
- private final MappingMode mappingMode;
- @Nullable
- private final String externalIP;
- @Nullable
- private final String vAppScopedVmId;
- private final int vmNicId;
-
- public OneToOneVmRule(MappingMode mappingMode, @Nullable String externalIp, @Nullable String vAppScopedVmId,
- int vmNicId) {
- this.mappingMode = checkNotNull(mappingMode, "mappingMode");
- this.externalIP = externalIp;
- this.vAppScopedVmId = vAppScopedVmId;
- this.vmNicId = vmNicId;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- OneToOneVmRule that = OneToOneVmRule.class.cast(o);
- return equal(this.mappingMode, that.mappingMode) && equal(this.externalIP, that.externalIP)
- && equal(this.vAppScopedVmId, that.vAppScopedVmId) && equal(this.vmNicId, that.vmNicId);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(mappingMode, externalIP, vAppScopedVmId, vmNicId);
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper("").omitNullValues().add("mappingMode", mappingMode).add("externalIP", externalIP)
- .add("vAppScopedVmId", vAppScopedVmId).add("vmNicId", vmNicId).toString();
- }
-
- /**
- * @return how IP address mapping is implemented by the NAT service
- * @since vcloud 0.9
- */
- public MappingMode getMappingMode() {
- return mappingMode;
- }
-
- /**
- * @return if MappingMode is manual, specifies the external IP address of this Vm, otherwise
- * null.
- * @since vcloud 0.9
- */
- @Nullable
- @Override
- public String getExternalIP() {
- return externalIP;
- }
-
- /**
- * @return read‐only identifier created on import
- * @since vcloud 0.9
- */
- @Nullable
- public String getVAppScopedVmId() {
- return vAppScopedVmId;
- }
-
- /**
- * @return device number of the NIC on the referenced virtual machine
- * @since vcloud 0.9
- */
- public int getVmNicId() {
- return vmNicId;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/PortForwardingRule.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/PortForwardingRule.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/PortForwardingRule.java
deleted file mode 100644
index 3170a73..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/PortForwardingRule.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.nat.rules;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.vcloud.domain.network.nat.NatProtocol;
-import org.jclouds.vcloud.domain.network.nat.NatRule;
-
-import com.google.common.base.Objects;
-
-/**
- * The PortForwardingRule element describes a NAT rule that maps an IP address and port in an
- * organization network to an external IP address and port.
- *
- * @since vcloud 0.8
- */
-public class PortForwardingRule implements NatRule {
- private final String externalIP;
- private final int externalPort;
- private final String internalIP;
- private final int internalPort;
- private final NatProtocol protocol;
-
- public PortForwardingRule(String externalIP, int externalPort, String internalIP, int internalPort,
- NatProtocol protocol) {
- this.externalIP = checkNotNull(externalIP, "externalIP");
- this.externalPort = externalPort;
- this.internalIP = checkNotNull(internalIP, "internalIP");
- this.internalPort = internalPort;
- this.protocol = checkNotNull(protocol, "protocol");
- }
-
- /**
- * IP address to which this NAT rule maps the IP address specified in the InternalIp element.
- */
- @Override
- public String getExternalIP() {
- return externalIP;
- }
-
- /**
- * network port to which this NAT rule maps the port number specified in the InternalPort element
- */
- public int getExternalPort() {
- return externalPort;
- }
-
- /**
- * IP address to which this NAT rule maps the IP address specified in the ExternalIp element.
- */
- public String getInternalIP() {
- return internalIP;
- }
-
- /**
- * network port to which this NAT rule maps the port number specified in the ExternalPort
- * element.
- */
- public int getInternalPort() {
- return internalPort;
- }
-
- /**
- * specifies the network protocol to which this rule applies
- */
- public NatProtocol getProtocol() {
- return protocol;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- PortForwardingRule that = PortForwardingRule.class.cast(o);
- return equal(this.externalIP, that.externalIP) && equal(this.externalPort, that.externalPort)
- && equal(this.internalIP, that.internalIP) && equal(this.internalPort, that.internalPort)
- && equal(this.protocol, that.protocol);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(externalIP, externalPort, internalIP, internalPort, protocol);
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper("").omitNullValues().add("externalIP", externalIP)
- .add("externalPort", externalPort).add("internalIP", internalIP).add("internalPort", internalPort)
- .add("protocol", protocol).toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/VmRule.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/VmRule.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/VmRule.java
deleted file mode 100644
index 8793a58..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/VmRule.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.network.nat.rules;
-
-import static com.google.common.base.Objects.equal;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.jclouds.javax.annotation.Nullable;
-import org.jclouds.vcloud.domain.network.nat.NatProtocol;
-import org.jclouds.vcloud.domain.network.nat.NatRule;
-
-import com.google.common.base.Objects;
-
-/**
- * The VmRule element describes a NAT rule that maps an IP address and port in a vApp network to an
- * external IP address and port. The external IP address, external port, and internal port are
- * specified in the element. The internal IP address is discovered by looking up the specified
- * VmReference and VmNicId.
- *
- * @since vcloud 0.9
- */
-public class VmRule implements NatRule {
- @Nullable
- private final String externalIP;
- private final int externalPort;
- @Nullable
- private final String vAppScopedLocalId;
- private final int vmNicId;
- private final int internalPort;
- private final NatProtocol protocol;
-
- public VmRule(@Nullable String externalIP, int externalPort, @Nullable String vAppScopedLocalId, int vmNicId,
- int internalPort, NatProtocol protocol) {
- this.externalIP = externalIP;
- this.externalPort = externalPort;
- this.vAppScopedLocalId = vAppScopedLocalId;
- this.vmNicId = vmNicId;
- this.internalPort = internalPort;
- this.protocol = checkNotNull(protocol, "protocol");
- }
-
- /**
- * IP address to which this NAT rule maps the IP address specified in the vAppScopedLocalId element.
- */
- @Nullable
- public String getExternalIP() {
- return externalIP;
- }
-
- /**
- * network port to which this NAT rule maps the port number specified in the InternalPort element
- */
- public Integer getExternalPort() {
- return externalPort;
- }
-
- /**
- * @return read‐only identifier created on import
- * @since vcloud 0.9
- */
- @Nullable
- public String getVAppScopedLocalId() {
- return vAppScopedLocalId;
- }
-
- /**
- * @return device number of the NIC on the referenced virtual machine
- * @since vcloud 0.9
- */
- public int getVmNicId() {
- return vmNicId;
- }
-
- /**
- * network port to which this NAT rule maps the port number specified in the ExternalPort
- * element.
- */
- public Integer getInternalPort() {
- return internalPort;
- }
-
- /**
- * specifies the network protocol to which this rule applies
- */
- public NatProtocol getProtocol() {
- return protocol;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o)
- return true;
- if (o == null || getClass() != o.getClass())
- return false;
- VmRule that = VmRule.class.cast(o);
- return equal(this.externalIP, that.externalIP) && equal(this.externalPort, that.externalPort)
- && equal(this.vAppScopedLocalId, that.vAppScopedLocalId) && equal(this.vmNicId, that.vmNicId)
- && equal(this.internalPort, that.internalPort) && equal(this.protocol, that.protocol);
- }
-
- @Override
- public int hashCode() {
- return Objects.hashCode(externalIP, externalPort, vAppScopedLocalId, vmNicId, internalPort, protocol);
- }
-
- @Override
- public String toString() {
- return Objects.toStringHelper("").omitNullValues().add("externalIP", externalIP)
- .add("externalPort", externalPort).add("vAppScopedLocalId", vAppScopedLocalId).add("vmNicId", vmNicId)
- .add("internalPort", internalPort).add("protocol", protocol).toString();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/jclouds/blob/6f974f34/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/ovf/EditableResourceAllocationSettingData.java
----------------------------------------------------------------------
diff --git a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/ovf/EditableResourceAllocationSettingData.java b/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/ovf/EditableResourceAllocationSettingData.java
deleted file mode 100644
index b12be86..0000000
--- a/apis/vcloud/src/main/java/org/jclouds/vcloud/domain/ovf/EditableResourceAllocationSettingData.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jclouds.vcloud.domain.ovf;
-
-import java.util.List;
-
-import org.jclouds.cim.ResourceAllocationSettingData;
-import org.jclouds.vcloud.domain.ReferenceType;
-
-public class EditableResourceAllocationSettingData extends ResourceAllocationSettingData {
-
- public static Builder builder() {
- return new Builder();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder toBuilder() {
- return builder().fromEditableResourceAllocationSettingData(this);
- }
-
- public static class Builder extends ResourceAllocationSettingData.Builder {
- private ReferenceType edit;
-
- /**
- * @see EditableResourceAllocationSettingData#getEdit
- */
- public Builder edit(ReferenceType edit) {
- this.edit = edit;
- return this;
- }
-
- public EditableResourceAllocationSettingData build() {
- return new EditableResourceAllocationSettingData(elementName, instanceID, caption, description, address,
- addressOnParent, allocationUnits, automaticAllocation, automaticDeallocation, consumerVisibility, limit,
- mappingBehavior, otherResourceType, parent, poolID, reservation, resourceSubType, resourceType,
- virtualQuantity, virtualQuantityUnits, weight, connections, hostResources, edit);
- }
-
- public Builder fromEditableResourceAllocationSettingData(EditableResourceAllocationSettingData in) {
- return edit(in.getEdit()).fromResourceAllocationSettingData(in);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder caption(String caption) {
- return Builder.class.cast(super.caption(caption));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder description(String description) {
- return Builder.class.cast(super.description(description));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder elementName(String elementName) {
- return Builder.class.cast(super.elementName(elementName));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder instanceID(String instanceID) {
- return Builder.class.cast(super.instanceID(instanceID));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder address(String address) {
- return Builder.class.cast(super.address(address));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder addressOnParent(String addressOnParent) {
- return Builder.class.cast(super.addressOnParent(addressOnParent));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder allocationUnits(String allocationUnits) {
- return Builder.class.cast(super.allocationUnits(allocationUnits));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder automaticAllocation(Boolean automaticAllocation) {
- return Builder.class.cast(super.automaticAllocation(automaticAllocation));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder automaticDeallocation(Boolean automaticDeallocation) {
- return Builder.class.cast(super.automaticDeallocation(automaticDeallocation));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder connection(String connection) {
- return Builder.class.cast(super.connection(connection));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder connections(List<String> connections) {
- return Builder.class.cast(super.connections(connections));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder consumerVisibility(ConsumerVisibility consumerVisibility) {
- return Builder.class.cast(super.consumerVisibility(consumerVisibility));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder hostResource(String hostResource) {
- return Builder.class.cast(super.hostResource(hostResource));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder hostResources(List<String> hostResources) {
- return Builder.class.cast(super.hostResources(hostResources));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder limit(Long limit) {
- return Builder.class.cast(super.limit(limit));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder mappingBehavior(MappingBehavior mappingBehavior) {
- return Builder.class.cast(super.mappingBehavior(mappingBehavior));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder otherResourceType(String otherResourceType) {
- return Builder.class.cast(super.otherResourceType(otherResourceType));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder parent(String parent) {
- return Builder.class.cast(super.parent(parent));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder poolID(String poolID) {
- return Builder.class.cast(super.poolID(poolID));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder reservation(Long reservation) {
- return Builder.class.cast(super.reservation(reservation));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder resourceSubType(String resourceSubType) {
- return Builder.class.cast(super.resourceSubType(resourceSubType));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder resourceType(org.jclouds.cim.ResourceAllocationSettingData.ResourceType resourceType) {
- return Builder.class.cast(super.resourceType(resourceType));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder virtualQuantity(Long virtualQuantity) {
- return Builder.class.cast(super.virtualQuantity(virtualQuantity));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder virtualQuantityUnits(String virtualQuantityUnits) {
- return Builder.class.cast(super.virtualQuantityUnits(virtualQuantityUnits));
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public Builder weight(Integer weight) {
- return Builder.class.cast(super.weight(weight));
- }
-
- @Override
- public Builder fromResourceAllocationSettingData(ResourceAllocationSettingData in) {
- return Builder.class.cast(super.fromResourceAllocationSettingData(in));
- }
-
- }
-
- private final ReferenceType edit;
-
- public EditableResourceAllocationSettingData(String elementName, String instanceID, String caption,
- String description, String address, String addressOnParent, String allocationUnits,
- Boolean automaticAllocation, Boolean automaticDeallocation, ConsumerVisibility consumerVisibility, Long limit,
- MappingBehavior mappingBehavior, String otherResourceType, String parent, String poolID, Long reservation,
- String resourceSubType, org.jclouds.cim.ResourceAllocationSettingData.ResourceType resourceType,
- Long virtualQuantity, String virtualQuantityUnits, Integer weight, List<String> connections,
- List<String> hostResources, ReferenceType edit) {
- super(elementName, instanceID, caption, description, address, addressOnParent, allocationUnits,
- automaticAllocation, automaticDeallocation, consumerVisibility, limit, mappingBehavior, otherResourceType,
- parent, poolID, reservation, resourceSubType, resourceType, virtualQuantity, virtualQuantityUnits, weight,
- connections, hostResources);
- this.edit = edit;
- }
-
- public ReferenceType getEdit() {
- return edit;
- }
-
- @Override
- public String toString() {
- return String
- .format(
- "[elementName=%s, instanceID=%s, caption=%s, description=%s, address=%s, addressOnParent=%s, allocationUnits=%s, automaticAllocation=%s, automaticDeallocation=%s, connections=%s, consumerVisibility=%s, hostResources=%s, limit=%s, mappingBehavior=%s, otherResourceType=%s, parent=%s, poolID=%s, reservation=%s, resourceSubType=%s, resourceType=%s, virtualQuantity=%s, virtualQuantityUnits=%s, weight=%s, edit=%s]",
- elementName, instanceID, caption, description, address, addressOnParent, allocationUnits,
- automaticAllocation, automaticDeallocation, connections, consumerVisibility, hostResources, limit,
- mappingBehavior, otherResourceType, parent, poolID, reservation, resourceSubType, resourceType,
- virtualQuantity, virtualQuantityUnits, weight, edit);
- }
-
-}