Package javax.ws.rs.core

Examples of javax.ws.rs.core.UriBuilder.path()


   public static void setAcknowledgeNextLink(LinkStrategy linkStrategy, Response.ResponseBuilder response, UriInfo info, String basePath, String index)
   {
      if (index == null) throw new IllegalArgumentException("index cannot be null");
      UriBuilder builder = info.getBaseUriBuilder();
      builder.path(basePath)
              .path("acknowledge-next" + index);
      String uri = builder.build().toString();
      linkStrategy.setLinkHeader(response, "acknowledge-next", "acknowledge-next", uri, MediaType.APPLICATION_FORM_URLENCODED);
   }
View Full Code Here


         QueueConsumer consumer = createConsumer(durable, autoAck, subscriptionName, selector, timeout, deleteWhenIdle);
         queueConsumers.put(consumer.getId(), consumer);
         serviceManager.getTimeoutTask().add(this, consumer.getId());

         UriBuilder location = uriInfo.getAbsolutePathBuilder();
         if (autoAck) location.path("auto-ack");
         else location.path("acknowledged");
         location.path(consumer.getId());
         Response.ResponseBuilder builder = Response.created(location.build());
         if (autoAck)
         {
View Full Code Here

         queueConsumers.put(consumer.getId(), consumer);
         serviceManager.getTimeoutTask().add(this, consumer.getId());

         UriBuilder location = uriInfo.getAbsolutePathBuilder();
         if (autoAck) location.path("auto-ack");
         else location.path("acknowledged");
         location.path(consumer.getId());
         Response.ResponseBuilder builder = Response.created(location.build());
         if (autoAck)
         {
            QueueConsumer.setConsumeNextLink(serviceManager.getLinkStrategy(), builder, uriInfo, uriInfo.getMatchedURIs().get(1) + "/auto-ack/" + consumer.getId(), "-1");
View Full Code Here

         serviceManager.getTimeoutTask().add(this, consumer.getId());

         UriBuilder location = uriInfo.getAbsolutePathBuilder();
         if (autoAck) location.path("auto-ack");
         else location.path("acknowledged");
         location.path(consumer.getId());
         Response.ResponseBuilder builder = Response.created(location.build());
         if (autoAck)
         {
            QueueConsumer.setConsumeNextLink(serviceManager.getLinkStrategy(), builder, uriInfo, uriInfo.getMatchedURIs().get(1) + "/auto-ack/" + consumer.getId(), "-1");
         }
View Full Code Here

      HornetQRestLogger.LOGGER.debug("Handling POST request for \"" + info.getRequestUri() + "\"");

      if (closed)
      {
         UriBuilder builder = info.getBaseUriBuilder();
         builder.path(info.getMatchedURIs().get(1))
                 .path("consume-next");
         String uri = builder.build().toString();

         // redirect to another consume-next
View Full Code Here

   public static void setConsumeNextLink(LinkStrategy linkStrategy, Response.ResponseBuilder response, UriInfo info, String basePath, String index)
   {
      if (index == null) throw new IllegalArgumentException("index cannot be null");
      UriBuilder builder = info.getBaseUriBuilder();
      builder.path(basePath)
              .path("consume-next" + index);
      String uri = builder.build().toString();
      linkStrategy.setLinkHeader(response, "consume-next", "consume-next", uri, MediaType.APPLICATION_FORM_URLENCODED);
   }
View Full Code Here

   }

   public void setSessionLink(Response.ResponseBuilder response, UriInfo info, String basePath)
   {
      UriBuilder builder = info.getBaseUriBuilder();
      builder.path(basePath);
      String uri = builder.build().toString();
      serviceManager.getLinkStrategy().setLinkHeader(response, "consumer", "consumer", uri, MediaType.APPLICATION_XML);
   }
}
View Full Code Here

        ret.setType(a.getType());
        ret.setCheckInComment(a.getCheckinComment());
        ret.setDescription(a.getDescription());
        UriBuilder builder = uriInfo.getBaseUriBuilder();
        ret.setRefLink(
                builder.path("/packages/" + a.getPackage().getName() + "/assets/" + a.getName()).build());
        builder = uriInfo.getBaseUriBuilder();
        ret.setBinaryLink(
                builder.path("/packages/" + a.getPackage().getName() + "/assets/" + a.getName() + "/binary").build());
        builder = uriInfo.getBaseUriBuilder();
        ret.setSourceLink(
View Full Code Here

        UriBuilder builder = uriInfo.getBaseUriBuilder();
        ret.setRefLink(
                builder.path("/packages/" + a.getPackage().getName() + "/assets/" + a.getName()).build());
        builder = uriInfo.getBaseUriBuilder();
        ret.setBinaryLink(
                builder.path("/packages/" + a.getPackage().getName() + "/assets/" + a.getName() + "/binary").build());
        builder = uriInfo.getBaseUriBuilder();
        ret.setSourceLink(
                builder.path("/packages/" + a.getPackage().getName() + "/assets/" + a.getName() + "/source").build());
        ret.setVersion(a.getVersionNumber());
        return ret;
View Full Code Here

        builder = uriInfo.getBaseUriBuilder();
        ret.setBinaryLink(
                builder.path("/packages/" + a.getPackage().getName() + "/assets/" + a.getName() + "/binary").build());
        builder = uriInfo.getBaseUriBuilder();
        ret.setSourceLink(
                builder.path("/packages/" + a.getPackage().getName() + "/assets/" + a.getName() + "/source").build());
        ret.setVersion(a.getVersionNumber());
        return ret;
    }

    public static Package ToPackage(PackageItem p, UriInfo uriInfo) {
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.