| 1 | /** |
| 2 | * Licensed to jclouds, Inc. (jclouds) under one or more |
| 3 | * contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. jclouds licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
| 19 | package org.jclouds.trmk.vcloud_0_8.domain.internal; |
| 20 | |
| 21 | import java.net.URI; |
| 22 | |
| 23 | import org.jclouds.trmk.vcloud_0_8.domain.FenceMode; |
| 24 | import org.jclouds.trmk.vcloud_0_8.domain.ReferenceType; |
| 25 | import org.jclouds.trmk.vcloud_0_8.domain.Network; |
| 26 | |
| 27 | /** |
| 28 | * Locations of resources in vCloud |
| 29 | * |
| 30 | * @author Adrian Cole |
| 31 | * |
| 32 | */ |
| 33 | public class NetworkImpl extends ReferenceTypeImpl implements Network { |
| 34 | |
| 35 | protected final String description; |
| 36 | protected final String gateway; |
| 37 | protected final String netmask; |
| 38 | protected final FenceMode fenceMode; |
| 39 | protected final ReferenceType networkExtension; |
| 40 | protected final ReferenceType ips; |
| 41 | |
| 42 | public NetworkImpl(String name, String type, URI id, String description, String gateway, String netmask, |
| 43 | FenceMode fenceMode, ReferenceType networkExtension, ReferenceType ips) { |
| 44 | super(name, type, id); |
| 45 | this.description = description; |
| 46 | this.gateway = gateway; |
| 47 | this.netmask = netmask; |
| 48 | this.fenceMode = fenceMode; |
| 49 | this.networkExtension = networkExtension; |
| 50 | this.ips = ips; |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * {@inheritDoc} |
| 55 | */ |
| 56 | @Override |
| 57 | public String getDescription() { |
| 58 | return description; |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * {@inheritDoc} |
| 63 | */ |
| 64 | @Override |
| 65 | public String getGateway() { |
| 66 | return gateway; |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * {@inheritDoc} |
| 71 | */ |
| 72 | @Override |
| 73 | public String getNetmask() { |
| 74 | return netmask; |
| 75 | } |
| 76 | |
| 77 | /** |
| 78 | * {@inheritDoc} |
| 79 | */ |
| 80 | @Override |
| 81 | public FenceMode getFenceMode() { |
| 82 | return fenceMode; |
| 83 | } |
| 84 | |
| 85 | /** |
| 86 | * {@inheritDoc} |
| 87 | */ |
| 88 | @Override |
| 89 | public ReferenceType getIps() { |
| 90 | return ips; |
| 91 | } |
| 92 | |
| 93 | /** |
| 94 | * {@inheritDoc} |
| 95 | */ |
| 96 | @Override |
| 97 | public ReferenceType getNetworkExtension() { |
| 98 | return networkExtension; |
| 99 | } |
| 100 | |
| 101 | /** |
| 102 | * {@inheritDoc} |
| 103 | */ |
| 104 | @Override |
| 105 | public int compareTo(ReferenceType o) { |
| 106 | return (this == o) ? 0 : getHref().compareTo(o.getHref()); |
| 107 | } |
| 108 | |
| 109 | } |