http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/internal/VmImpl.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/internal/VmImpl.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/internal/VmImpl.java deleted file mode 100644 index a6385c6..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/internal/VmImpl.java +++ /dev/null @@ -1,214 +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.internal; - -import static com.google.common.base.Preconditions.checkNotNull; - -import java.net.URI; -import java.util.List; - -import org.jclouds.javax.annotation.Nullable; -import org.jclouds.vcloud.domain.GuestCustomizationSection; -import org.jclouds.vcloud.domain.NetworkConnectionSection; -import org.jclouds.vcloud.domain.ReferenceType; -import org.jclouds.vcloud.domain.Status; -import org.jclouds.vcloud.domain.Task; -import org.jclouds.vcloud.domain.Vm; -import org.jclouds.vcloud.domain.ovf.VCloudOperatingSystemSection; -import org.jclouds.vcloud.domain.ovf.VCloudVirtualHardwareSection; - -import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; - -/** - * Locations of resources in vCloud - */ -public class VmImpl extends ReferenceTypeImpl implements Vm { - - @Nullable - private final Status status; - private final ReferenceType vApp; - @Nullable - private final String description; - private final List<Task> tasks = Lists.newArrayList(); - @Nullable - private final VCloudVirtualHardwareSection hardware; - private final String vAppScopedLocalId; - private final VCloudOperatingSystemSection os; - @Nullable - private final GuestCustomizationSection guestCustomization; - @Nullable - private final NetworkConnectionSection networkConnectionSection; - - public VmImpl(String name, String type, URI id, @Nullable Status status, ReferenceType vApp, - @Nullable String description, Iterable<Task> tasks, @Nullable VCloudVirtualHardwareSection hardware, - @Nullable VCloudOperatingSystemSection os, @Nullable NetworkConnectionSection networkConnectionSection, - @Nullable GuestCustomizationSection guestCustomization, @Nullable String vAppScopedLocalId) { - super(name, type, id); - this.status = status; - this.vApp = vApp;// TODO: once <1.0 is killed check not null - this.description = description; - Iterables.addAll(this.tasks, checkNotNull(tasks, "tasks")); - this.hardware = hardware; - this.os = os; - this.networkConnectionSection = networkConnectionSection; - this.guestCustomization = guestCustomization; - this.vAppScopedLocalId = vAppScopedLocalId; - } - - /** - * {@inheritDoc} - */ - @Override - @Nullable - public Status getStatus() { - return status; - } - - /** - * {@inheritDoc} - */ - @Override - public ReferenceType getParent() { - return vApp; - } - - /** - * {@inheritDoc} - */ - @Override - public String getDescription() { - return description; - } - - /** - * {@inheritDoc} - */ - @Override - public List<Task> getTasks() { - return tasks; - } - - /** - * {@inheritDoc} - */ - @Override - public VCloudVirtualHardwareSection getVirtualHardwareSection() { - return hardware; - } - - /** - * {@inheritDoc} - */ - @Override - public VCloudOperatingSystemSection getOperatingSystemSection() { - return os; - } - - /** - * {@inheritDoc} - */ - @Override - public NetworkConnectionSection getNetworkConnectionSection() { - return networkConnectionSection; - } - - /** - * {@inheritDoc} - */ - @Override - public GuestCustomizationSection getGuestCustomizationSection() { - return guestCustomization; - } - - /** - * {@inheritDoc} - */ - @Override - public String getVAppScopedLocalId() { - return vAppScopedLocalId; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((description == null) ? 0 : description.hashCode()); - result = prime * result + ((guestCustomization == null) ? 0 : guestCustomization.hashCode()); - result = prime * result + ((hardware == null) ? 0 : hardware.hashCode()); - result = prime * result + ((networkConnectionSection == null) ? 0 : networkConnectionSection.hashCode()); - result = prime * result + ((os == null) ? 0 : os.hashCode()); - result = prime * result + ((vApp == null) ? 0 : vApp.hashCode()); - result = prime * result + ((vAppScopedLocalId == null) ? 0 : vAppScopedLocalId.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (!super.equals(obj)) - return false; - if (getClass() != obj.getClass()) - return false; - VmImpl other = (VmImpl) obj; - if (description == null) { - if (other.description != null) - return false; - } else if (!description.equals(other.description)) - return false; - if (guestCustomization == null) { - if (other.guestCustomization != null) - return false; - } else if (!guestCustomization.equals(other.guestCustomization)) - return false; - if (hardware == null) { - if (other.hardware != null) - return false; - } else if (!hardware.equals(other.hardware)) - return false; - if (networkConnectionSection == null) { - if (other.networkConnectionSection != null) - return false; - } else if (!networkConnectionSection.equals(other.networkConnectionSection)) - return false; - if (os == null) { - if (other.os != null) - return false; - } else if (!os.equals(other.os)) - return false; - if (vApp == null) { - if (other.vApp != null) - return false; - } else if (!vApp.equals(other.vApp)) - return false; - if (vAppScopedLocalId == null) { - if (other.vAppScopedLocalId != null) - return false; - } else if (!vAppScopedLocalId.equals(other.vAppScopedLocalId)) - return false; - return true; - } - - @Override - public String toString() { - return "[href=" + getHref() + ", name=" + getName() + ", type=" + getType() + ", description=" + description - + ", status=" + status + ", tasks=" + tasks + ", vApp=" + vApp + ", hardware=" + hardware + ", os=" + os - + ", network=" + networkConnectionSection + ", vAppScopedLocalId=" + vAppScopedLocalId + "]"; - } - -}
http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/DhcpService.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/DhcpService.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/DhcpService.java deleted file mode 100644 index 628a7d1..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/DhcpService.java +++ /dev/null @@ -1,106 +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; - -/** - * specifies the properties of the networkâs DHCP service - */ -public class DhcpService { - private final boolean enabled; - @Nullable - private final Integer defaultLeaseTime; - @Nullable - private final Integer maxLeaseTime; - @Nullable - private final IpRange ipRange; - - public DhcpService(boolean enabled, @Nullable Integer defaultLeaseTime, @Nullable Integer maxLeaseTime, - @Nullable IpRange ipRange) { - this.enabled = enabled; - this.defaultLeaseTime = defaultLeaseTime; - this.maxLeaseTime = maxLeaseTime; - this.ipRange = ipRange; - } - - /** - * @return true if the service is enabled - * - * @since vcloud api 0.8 - */ - public boolean isEnabled() { - return enabled; - } - - /** - * default duration of a DHCP address lease - * - * @since vcloud api 0.9 - */ - @Nullable - public Integer getDefaultLeaseTime() { - return defaultLeaseTime; - } - - /** - * maximum duration of a DHCP address lease. - * - * @since vcloud api 0.9 - */ - @Nullable - public Integer getMaxLeaseTime() { - return maxLeaseTime; - } - - /** - * @return range of IP addresses available to DHCP clients - * - * @since vcloud api 0.9 - */ - @Nullable - public IpRange getIpRange() { - return ipRange; - } - - @Override - public boolean equals(Object o) { - if (this == o) - return true; - if (o == null || getClass() != o.getClass()) - return false; - DhcpService that = DhcpService.class.cast(o); - return equal(this.enabled, that.enabled) && equal(this.defaultLeaseTime, that.defaultLeaseTime) - && equal(this.maxLeaseTime, that.maxLeaseTime) && equal(this.ipRange, that.ipRange); - } - - @Override - public int hashCode() { - return Objects.hashCode(enabled, defaultLeaseTime, maxLeaseTime, ipRange); - } - - @Override - public String toString() { - return Objects.toStringHelper("").omitNullValues().add("enabled", enabled) - .add("defaultLeaseTime", defaultLeaseTime).add("maxLeaseTime", maxLeaseTime).add("ipRange", ipRange) - .toString(); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/Features.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/Features.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/Features.java deleted file mode 100644 index 24eb38e..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/FenceMode.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/FenceMode.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/FenceMode.java deleted file mode 100644 index a531b0d..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/FirewallService.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/FirewallService.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/FirewallService.java deleted file mode 100644 index 63212b2..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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.size() > 0) - helper.add("firewallRules", firewallRules); - return helper.toString(); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/IpAddressAllocationMode.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/IpAddressAllocationMode.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/IpAddressAllocationMode.java deleted file mode 100644 index 2b32691..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/IpRange.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/IpRange.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/IpRange.java deleted file mode 100644 index 180d13d..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/IpScope.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/IpScope.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/IpScope.java deleted file mode 100644 index e5af063..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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.size() > 0) - helper.add("ipRanges", ipRanges); - if (allocatedIpAddresses.size() > 0) - helper.add("allocatedIpAddresses", allocatedIpAddresses); - return helper.toString(); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/NatService.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/NatService.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/NatService.java deleted file mode 100644 index ea4c388..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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.size() > 0) - helper.add("natRules", natRules); - return helper.toString(); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/NetworkConfig.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/NetworkConfig.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/NetworkConfig.java deleted file mode 100644 index 79e6461..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/OrgNetwork.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/OrgNetwork.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/OrgNetwork.java deleted file mode 100644 index f50d18c..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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. - */ [email protected] -@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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallPolicy.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallPolicy.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallPolicy.java deleted file mode 100644 index 44a5e81..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallProtocols.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallProtocols.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallProtocols.java deleted file mode 100644 index 8b09dc2..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallRule.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallRule.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/firewall/FirewallRule.java deleted file mode 100644 index dfb578b..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/internal/OrgNetworkImpl.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/internal/OrgNetworkImpl.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/internal/OrgNetworkImpl.java deleted file mode 100644 index 76a394f..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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.size() > 0) - helper.add("allowedExternalIpAddresses", allowedExternalIpAddresses); - if (tasks.size() > 0) - helper.add("tasks", tasks); - return helper; - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatPolicy.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatPolicy.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatPolicy.java deleted file mode 100644 index 8a49b33..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatProtocol.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatProtocol.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatProtocol.java deleted file mode 100644 index 7204bae..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatRule.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatRule.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatRule.java deleted file mode 100644 index b9ca510..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatType.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatType.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/NatType.java deleted file mode 100644 index 98b95e2..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/MappingMode.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/MappingMode.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/MappingMode.java deleted file mode 100644 index 6d71116..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/OneToOneVmRule.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/OneToOneVmRule.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/OneToOneVmRule.java deleted file mode 100644 index c2b1b4b..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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/stratos/blob/897edde8/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/PortForwardingRule.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/PortForwardingRule.java b/dependencies/jclouds/apis/vcloud/1.8.1-stratos/src/main/java/org/jclouds/vcloud/domain/network/nat/rules/PortForwardingRule.java deleted file mode 100644 index 3170a73..0000000 --- a/dependencies/jclouds/apis/vcloud/1.8.1-stratos/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(); - } - -}
