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

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


      return wrap(context, PrivateIp.class, ips.toPagedIterable().concat());
   }

   @Override
   public PrivateIp getIp(final Integer id) {
      PrivateIpDto ip = context.getApi().getCloudApi().getPrivateNetworkIp(target, id);
      return wrap(context, PrivateIp.class, ip);
   }
View Full Code Here


      return vlan;
   }

   public static PrivateIpDto privateIpPut() {
      PrivateIpDto ip = new PrivateIpDto();
      ip.setId(1);
      ip.setName("private ip");
      ip.setMac("00:58:5A:c0:C3:01");
      RESTLink self = new RESTLink("self", "http://localhost/api/cloud/virtualdatacenters/1/privatenetworks/1/ips/1");
      self.setTitle("privateip");
      ip.addLink(self);
      return ip;
   }
View Full Code Here

      request = binder.bindToRequest(request, new AbstractIpDto[] {});
      assertPayloadEquals(request.getPayload(), withHeader("<links/>"), LinksDto.class);
   }

   public void testBindSingleIp() throws IOException {
      PrivateIpDto ip = NetworkResources.privateIpPut();
      BindIpRefsToPayload binder = new BindIpRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, new AbstractIpDto[] { ip });
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + ip.searchLink("self").getHref()
            + "\" rel=\"" + ip.searchLink("self").getTitle() + "\"/></links>"), LinksDto.class);
   }
View Full Code Here

      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + ip.searchLink("self").getHref()
            + "\" rel=\"" + ip.searchLink("self").getTitle() + "\"/></links>"), LinksDto.class);
   }

   public void testBindMultipleIps() throws IOException {
      PrivateIpDto ip = NetworkResources.privateIpPut();
      BindIpRefsToPayload binder = new BindIpRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, new AbstractIpDto[] { ip, ip });
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + ip.searchLink("self").getHref()
            + "\" rel=\"" + ip.searchLink("self").getTitle() + "\"/></links>"), LinksDto.class);
   }
View Full Code Here

      vm.setRam(2048);
      vm.setCpu(2);
      vm.setState(VirtualMachineState.ON);
      vm.addLink(new RESTLink("edit", "http://foo/bar"));

      privNic = new PrivateIpDto();
      privNic.setIp("192.168.1.2");
      privNic.setMac("2a:6e:40:69:84:e0");

      pubNic = new PublicIpDto();
      pubNic.setIp("80.80.80.80");
View Full Code Here

      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      binder.bindToRequest(request, new Object());
   }

   public void testBindIpRef() throws IOException {
      PrivateIpDto ip = NetworkResources.privateIpPut();
      RESTLink selfLink = ip.searchLink("self");
      BindIpRefToPayload binder = new BindIpRefToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, ip);
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + selfLink.getHref() + "\" rel=\""
            + selfLink.getTitle() + "\"/></links>"), LinksDto.class);
View Full Code Here

      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      binder.bindToRequest(request, new Object());
   }

   public void testBindIpRef() throws IOException {
      PrivateIpDto ip = NetworkResources.privateIpPut();
      RESTLink selfLink = ip.searchLink("self");
      BindIpRefToPayload binder = new BindIpRefToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, ip);
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + selfLink.getHref() + "\" rel=\""
            + selfLink.getTitle() + "\"/></links>"), LinksDto.class);
View Full Code Here

      request = binder.bindToRequest(request, new AbstractIpDto[] {});
      assertPayloadEquals(request.getPayload(), withHeader("<links/>"), LinksDto.class);
   }

   public void testBindSingleIp() throws IOException {
      PrivateIpDto ip = NetworkResources.privateIpPut();
      BindIpRefsToPayload binder = new BindIpRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, new AbstractIpDto[] { ip });
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + ip.searchLink("self").getHref()
            + "\" rel=\"" + ip.searchLink("self").getTitle() + "\"/></links>"), LinksDto.class);
   }
View Full Code Here

      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + ip.searchLink("self").getHref()
            + "\" rel=\"" + ip.searchLink("self").getTitle() + "\"/></links>"), LinksDto.class);
   }

   public void testBindMultipleIps() throws IOException {
      PrivateIpDto ip = NetworkResources.privateIpPut();
      BindIpRefsToPayload binder = new BindIpRefsToPayload(new JAXBParser("false"));
      HttpRequest request = HttpRequest.builder().method("GET").endpoint(URI.create("http://localhost")).build();
      request = binder.bindToRequest(request, new AbstractIpDto[] { ip, ip });
      assertPayloadEquals(request.getPayload(), withHeader("<links><link href=\"" + ip.searchLink("self").getHref()
            + "\" rel=\"" + ip.searchLink("self").getTitle() + "\"/></links>"), LinksDto.class);
   }
View Full Code Here

      vm.setRam(2048);
      vm.setCpu(2);
      vm.setState(VirtualMachineState.ON);
      vm.addLink(new RESTLink("edit", "http://foo/bar"));

      privNic = new PrivateIpDto();
      privNic.setIp("192.168.1.2");
      privNic.setMac("2a:6e:40:69:84:e0");

      pubNic = new PublicIpDto();
      pubNic.setIp("80.80.80.80");
View Full Code Here

TOP

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

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.