Examples of searchLink()


Examples of com.abiquo.server.core.enterprise.EnterpriseDto.searchLink()

      Invokable<?, ?> method = method(EnterpriseApi.class, "createLimits", EnterpriseDto.class, DatacenterDto.class,
            DatacenterLimitsDto.class);
      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
            ImmutableList.<Object> of(enterprise, datacenter, limits)));

      String limitsUri = enterprise.searchLink("limits").getHref();
      String requestURI = String.format("POST %s?datacenter=%d HTTP/1.1", limitsUri, datacenter.getId());

      assertRequestLineEquals(request, requestURI);
      assertNonPayloadHeadersEqual(request, "Accept: " + DatacenterLimitsDto.BASE_MEDIA_TYPE + "\n");
      assertPayloadEquals(request, withHeader(EnterpriseResources.datacenterLimitsPostPayload()),
View Full Code Here

Examples of com.abiquo.server.core.enterprise.EnterpriseDto.searchLink()

      Invokable<?, ?> method = method(EnterpriseApi.class, "getLimits", EnterpriseDto.class, DatacenterDto.class);
      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
            ImmutableList.<Object> of(enterprise, datacenter)));

      String limitsUri = enterprise.searchLink("limits").getHref();
      String requestURI = String.format("GET %s?datacenter=%d HTTP/1.1", limitsUri, datacenter.getId());

      assertRequestLineEquals(request, requestURI);
      assertNonPayloadHeadersEqual(request, "Accept: " + DatacentersLimitsDto.BASE_MEDIA_TYPE + "\n");
      assertPayloadEquals(request, null, null, false);
View Full Code Here

Examples of com.abiquo.server.core.enterprise.EnterpriseDto.searchLink()

      Invokable<?, ?> method = method(EnterpriseApi.class, "createLimits", EnterpriseDto.class, DatacenterDto.class,
            DatacenterLimitsDto.class);
      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
            ImmutableList.<Object> of(enterprise, datacenter, limits)));

      String limitsUri = enterprise.searchLink("limits").getHref();
      String requestURI = String.format("POST %s?datacenter=%d HTTP/1.1", limitsUri, datacenter.getId());

      assertRequestLineEquals(request, requestURI);
      assertNonPayloadHeadersEqual(request, "Accept: " + DatacenterLimitsDto.BASE_MEDIA_TYPE + "\n");
      assertPayloadEquals(request, withHeader(EnterpriseResources.datacenterLimitsPostPayload()),
View Full Code Here

Examples of com.abiquo.server.core.enterprise.EnterpriseDto.searchLink()

      Invokable<?, ?> method = method(EnterpriseApi.class, "getLimits", EnterpriseDto.class, DatacenterDto.class);
      GeneratedHttpRequest request = processor.apply(Invocation.create(method,
            ImmutableList.<Object> of(enterprise, datacenter)));

      String limitsUri = enterprise.searchLink("limits").getHref();
      String requestURI = String.format("GET %s?datacenter=%d HTTP/1.1", limitsUri, datacenter.getId());

      assertRequestLineEquals(request, requestURI);
      assertNonPayloadHeadersEqual(request, "Accept: " + DatacentersLimitsDto.BASE_MEDIA_TYPE + "\n");
      assertPayloadEquals(request, null, null, false);
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.AbstractIpDto.searchLink()

   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
      checkArgument(checkNotNull(input, "input") instanceof AbstractIpDto,
            "this binder is only valid for AbstractIpDto objects");

      AbstractIpDto ip = (AbstractIpDto) input;
      RESTLink selfLink = checkNotNull(ip.searchLink("self"), "AbstractIpDto must have an self link");

      LinksDto refs = new LinksDto();
      refs.addLink(new RESTLink(selfLink.getTitle(), selfLink.getHref()));

      return super.bindToRequest(request, refs);
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.AbstractIpDto.searchLink()

   public <R extends HttpRequest> R bindToRequest(final R request, final Object input) {
      checkArgument(checkNotNull(input, "input") instanceof AbstractIpDto,
            "this binder is only valid for AbstractIpDto objects");

      AbstractIpDto ip = (AbstractIpDto) input;
      RESTLink selfLink = checkNotNull(ip.searchLink("self"), "AbstractIpDto must have an self link");

      LinksDto refs = new LinksDto();
      refs.addLink(new RESTLink(selfLink.getTitle(), selfLink.getHref()));

      return super.bindToRequest(request, refs);
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.PrivateIpDto.searchLink()

   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);
   }

   public void testBindMultipleIps() throws IOException {
      PrivateIpDto ip = NetworkResources.privateIpPut();
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.PrivateIpDto.searchLink()

      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);
   }

   public void testBindMultipleIps() throws IOException {
      PrivateIpDto ip = NetworkResources.privateIpPut();
      BindIpRefsToPayload binder = new BindIpRefsToPayload(new JAXBParser("false"));
View Full Code Here

Examples of com.abiquo.server.core.infrastructure.network.PrivateIpDto.searchLink()

   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

Examples of com.abiquo.server.core.infrastructure.network.PrivateIpDto.searchLink()

      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
TOP
Copyright © 2018 www.massapi.com. 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.