Package com.abiquo.server.core.infrastructure.network

Examples of com.abiquo.server.core.infrastructure.network.VLANNetworkDto


         this.virtualDatacenter = virtualDatacenter;
         return this;
      }

      public PrivateNetwork build() {
         VLANNetworkDto dto = new VLANNetworkDto();
         dto.setName(name);
         dto.setTag(tag);
         dto.setGateway(gateway);
         dto.setAddress(address);
         dto.setMask(mask);
         dto.setPrimaryDNS(primaryDNS);
         dto.setSecondaryDNS(secondaryDNS);
         dto.setSufixDNS(suffixDNS);
         dto.setDefaultNetwork(defaultNetwork);
         dto.setUnmanaged(false);
         dto.setType(NetworkType.INTERNAL);

         PrivateNetwork network = new PrivateNetwork(context, dto);
         network.virtualDatacenter = virtualDatacenter;

         return network;
View Full Code Here


         this.networkServiceType = Optional.of(networkServiceType);
         return this;
      }

      public PublicNetwork build() {
         VLANNetworkDto dto = new VLANNetworkDto();
         dto.setName(name);
         dto.setTag(tag);
         dto.setGateway(gateway);
         dto.setAddress(address);
         dto.setMask(mask);
         dto.setPrimaryDNS(primaryDNS);
         dto.setSecondaryDNS(secondaryDNS);
         dto.setSufixDNS(suffixDNS);
         dto.setDefaultNetwork(defaultNetwork);
         dto.setUnmanaged(false);
         dto.setType(NetworkType.PUBLIC);

         NetworkServiceType nst = networkServiceType.or(datacenter.defaultNetworkServiceType());
         dto.addLink(new RESTLink("networkservicetype", nst.unwrap().getEditLink().getHref()));

         PublicNetwork network = new PublicNetwork(context, dto);
         network.datacenter = datacenter;

         return network;
View Full Code Here

    *      Resource#
    *      VirtualDatacenterResource-GetdefaultVLANusedbydefaultinVirtualDatacenter
    *      </a>
    */
   public Network<?> getDefaultNetwork() {
      VLANNetworkDto network = context.getApi().getCloudApi().getDefaultNetwork(target);
      return wrap(context, network.getType() == NetworkType.INTERNAL ? PrivateNetwork.class : ExternalNetwork.class,
            network);
   }
View Full Code Here

      VLANNetworksDto networks = context.getApi().getCloudApi().listPrivateNetworks(target);
      return wrap(context, PrivateNetwork.class, networks.getCollection());
   }

   public PrivateNetwork getPrivateNetwork(final Integer id) {
      VLANNetworkDto network = context.getApi().getCloudApi().getPrivateNetwork(target, id);
      return wrap(context, PrivateNetwork.class, network);
   }
View Full Code Here

* @author Ignasi Barrera
* @author Francesc Montserrat
*/
public class NetworkResources {
   public static VLANNetworkDto vlanPost() {
      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.setAddress("192.168.1.0");
      vlan.setDefaultNetwork(true);
      vlan.setName("DefaultNetwork");
      vlan.setGateway("192.168.1.1");
      vlan.setMask(24);

      return vlan;
   }
View Full Code Here

      return nic;
   }

   public static VLANNetworkDto privateNetworkPut() {
      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.setId(1);
      vlan.setAddress("192.168.1.0");
      vlan.setDefaultNetwork(true);
      vlan.setName("DefaultNetwork");
      vlan.setGateway("192.168.1.1");
      vlan.setMask(24);
      vlan.setType(NetworkType.INTERNAL);
      vlan.addLink(new RESTLink("edit", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1"));
      vlan.addLink(new RESTLink("ips", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips"));

      return vlan;
   }
View Full Code Here

      return vlan;
   }

   public static VLANNetworkDto publicNetworkPut() {
      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.setId(1);
      vlan.setAddress("192.168.1.0");
      vlan.setDefaultNetwork(true);
      vlan.setName("PublicNetwork");
      vlan.setGateway("192.168.1.1");
      vlan.setMask(24);
      vlan.setType(NetworkType.PUBLIC);
      vlan.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/network/1"));
      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/datacenters/1/network/1/ips"));

      return vlan;
   }
View Full Code Here

      return vlan;
   }

   public static VLANNetworkDto externalNetworkPut() {
      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.setId(1);
      vlan.setAddress("192.168.1.0");
      vlan.setDefaultNetwork(true);
      vlan.setName("ExternalNetwork");
      vlan.setGateway("192.168.1.1");
      vlan.setMask(24);
      vlan.setType(NetworkType.EXTERNAL);
      vlan.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/network/1"));
      vlan.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/1/limits/1/externalnetworks/1/ips"));

      return vlan;
   }
View Full Code Here

      return vlan;
   }

   public static VLANNetworkDto unmanagedNetworkPut() {
      VLANNetworkDto vlan = new VLANNetworkDto();
      vlan.setId(1);
      vlan.setAddress("192.168.1.0");
      vlan.setDefaultNetwork(true);
      vlan.setName("UnmanagedNetwork");
      vlan.setGateway("192.168.1.1");
      vlan.setMask(24);
      vlan.setType(NetworkType.UNMANAGED);
      vlan.addLink(new RESTLink("edit", "http://localhost/api/admin/datacenters/1/network/1"));
      vlan.addLink(new RESTLink("enterprise", "http://localhost/api/admin/enterprises/1"));
      vlan.addLink(new RESTLink("ips", "http://localhost/api/admin/enterprises/1/limits/1/externalnetworks/1/ips"));

      return vlan;
   }
View Full Code Here

    *      PublicNetworkResource-Getthelistofpublicnetworks</a>
    * @return Network with the given id or <code>null</code> if it does not
    *         exist.
    */
   public Network<?> getNetwork(final Integer id) {
      VLANNetworkDto network = context.getApi().getInfrastructureApi().getNetwork(target, id);
      return Network.wrapNetwork(context, network);
   }
View Full Code Here

TOP

Related Classes of com.abiquo.server.core.infrastructure.network.VLANNetworkDto

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.