当前位置: 首页>>代码示例>>Java>>正文


Java ResteasyUriInfo类代码示例

本文整理汇总了Java中org.jboss.resteasy.spi.ResteasyUriInfo的典型用法代码示例。如果您正苦于以下问题:Java ResteasyUriInfo类的具体用法?Java ResteasyUriInfo怎么用?Java ResteasyUriInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ResteasyUriInfo类属于org.jboss.resteasy.spi包,在下文中一共展示了ResteasyUriInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createResteasyHttpRequest

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
@Override
public HttpRequest createResteasyHttpRequest(final String httpMethod,
                                             final HttpServletRequest request,
                                             final ResteasyHttpHeaders headers,
                                             final ResteasyUriInfo uriInfo,
                                             final HttpResponse theResponse,
                                             final HttpServletResponse response)
{
	return new HttpServletInputMessage(request,
	                                   response,
	                                   request.getServletContext(),
	                                   theResponse,
	                                   headers,
	                                   uriInfo,
	                                   httpMethod.toUpperCase(),
	                                   (SynchronousDispatcher) dispatcher.getDispatcher());
}
 
开发者ID:petergeneric,项目名称:stdlib,代码行数:18,代码来源:ResteasyRequestResponseFactory.java

示例2: VertxHttpRequest

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
public VertxHttpRequest(final RoutingContext context,
    final ResteasyUriInfo uriInfo,
    final ResteasyProviderFactory providerFactory) {

    super(uriInfo);

    this.context = context;
    vertxRequest = context.request();

    httpHeaders = new VertxRoutingContextHttpHeaders(context);

    LOG.debug("vertxRequest.isEnded={}", vertxRequest.isEnded());

    if (!vertxRequest.isEnded()) {
        is = new VertxBlockingInputStream(vertxRequest);
    } else {
        is = NullInputStream.nullInputStream();
    }

    asynchronousContext = new VertxExecutionContext(context, providerFactory, this);
}
 
开发者ID:trajano,项目名称:app-ms,代码行数:22,代码来源:VertxHttpRequest.java

示例3: getResourceOrCollection

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
private void getResourceOrCollection(String path, List <String> accepts, String typeResponse, int statusResponse)
        throws URISyntaxException {
    MultivaluedMap <String, String> acceptHeader = new MultivaluedMapImpl<>();
    acceptHeader.put("Accept", accepts);
    HttpHeaders headers = new ResteasyHttpHeaders(acceptHeader);

    UriInfo uriInfo = new ResteasyUriInfo(new URI("http://localhost:8080/FiwareRepository/v2/collec/"+path),
            new URI("http://localhost:8080/FiwareRepository/v2/"));

    Response response = toTest.getResource(uriInfo, headers, path);

    if (typeResponse !=  null) {
        assertEquals(typeResponse, response.getMediaType().toString());
    }
    assertEquals(statusResponse, response.getStatus());
}
 
开发者ID:conwetlab,项目名称:Repository-RI,代码行数:17,代码来源:CollectionServiceTest.java

示例4: getResourceMeta

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
private void getResourceMeta(String path, List <String> accepts, String typeResponse, int statusResponse)
        throws URISyntaxException {
    MultivaluedMap <String, String> acceptHeader = new MultivaluedMapImpl<>();
    acceptHeader.put("Accept", accepts);
    HttpHeaders headers = new ResteasyHttpHeaders(acceptHeader);

    UriInfo uriInfo = new ResteasyUriInfo(new URI("http://localhost:8080/FiwareRepository/v2/collec/"+path+".meta"),
            new URI("http://localhost:8080/FiwareRepository/v2/"));

    Response response = toTest.getResourceMeta(uriInfo, headers, path);

    if (typeResponse !=  null) {
        assertEquals(typeResponse, response.getMediaType().toString());
    }
    assertEquals(statusResponse, response.getStatus());
}
 
开发者ID:conwetlab,项目名称:Repository-RI,代码行数:17,代码来源:CollectionServiceTest.java

示例5: shouldGenerateHeaderLinksNormalPage

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
@Test
public void shouldGenerateHeaderLinksNormalPage() throws URISyntaxException {
    //given
    final ResteasyUriInfo uriInfo = getUriInfo();

    //when
    final LinkHeader linkHeader = endpoint.getLinkHeader(2, 3, uriInfo);

    final Link prev = findLinkByRel(linkHeader, "prev");
    assertThat(prev).isNotNull();
    assertThat(prev.getHref()).isEqualTo("/?page=1");
    final Link next = findLinkByRel(linkHeader, "next");
    assertThat(next).isNotNull();
    assertThat(next.getHref()).isEqualTo("/?page=3");

}
 
开发者ID:aerogear,项目名称:aerogear-unifiedpush-server,代码行数:17,代码来源:InstallationManagementEndpointTest.java

示例6: shouldGenerateHeaderLinksLastPage

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
@Test
public void shouldGenerateHeaderLinksLastPage() throws URISyntaxException {
    //given
    final ResteasyUriInfo uriInfo = getUriInfo();

    //when
    final LinkHeader linkHeader = endpoint.getLinkHeader(3, 3, uriInfo);

    final Link prev = findLinkByRel(linkHeader, "prev");
    assertThat(prev).isNotNull();
    assertThat(prev.getHref()).isEqualTo("/?page=2");
    final Link first = findLinkByRel(linkHeader, "first");
    assertThat(first).isNotNull();
    assertThat(first.getHref()).isEqualTo("/?page=0");
    assertThat(findLinkByRel(linkHeader, "last")).isNull();
}
 
开发者ID:aerogear,项目名称:aerogear-unifiedpush-server,代码行数:17,代码来源:InstallationManagementEndpointTest.java

示例7: testParseQueryStringToWebQuery

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
@Test
public void testParseQueryStringToWebQuery()
{
	WebQuery expected = new WebQuery().logSQL(true).eq("id", "123").offset(0).limit(200);
	WebQuery actual = new WebQuery().decode(new ResteasyUriInfo(URI.create("http://example.com?_log_sql=true&id=123")));

	assertEquals(expected.encode().toString(), actual.encode().toString());
}
 
开发者ID:petergeneric,项目名称:stdlib,代码行数:9,代码来源:WebQueryTest.java

示例8: shouldGenerateHeaderLinksFirstPage

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
@Test
public void shouldGenerateHeaderLinksFirstPage() throws URISyntaxException {
    //given
    final ResteasyUriInfo uriInfo = getUriInfo();

    //when
    final LinkHeader linkHeader = endpoint.getLinkHeader(0, 3, uriInfo);

    //then
    assertThat(findLinkByRel(linkHeader, "prev")).isNull();
    final Link next = findLinkByRel(linkHeader, "next");
    assertThat(next).isNotNull();
    assertThat(next.getHref()).isEqualTo("/?page=1");
    assertThat(findLinkByRel(linkHeader, "first")).isNull();
}
 
开发者ID:aerogear,项目名称:aerogear-unifiedpush-server,代码行数:16,代码来源:InstallationManagementEndpointTest.java

示例9: handle

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
@Override
public void handle(HttpServerRequest request)
{
   request.bodyHandler(buff -> {
      Context ctx = vertx.getOrCreateContext();
      ResteasyUriInfo uriInfo = VertxUtil.extractUriInfo(request.getDelegate(), servletMappingPrefix);
      ResteasyHttpHeaders headers = VertxUtil.extractHttpHeaders(request.getDelegate());
      HttpServerResponse response = request.response();
      VertxHttpResponse vertxResponse = new VertxHttpResponse(response.getDelegate(), dispatcher.getProviderFactory(), request.method());
      VertxHttpRequest vertxRequest = new VertxHttpRequest(ctx.getDelegate(), headers, uriInfo, request.rawMethod(), dispatcher.getDispatcher(), vertxResponse, false);
      if (buff.length() > 0)
      {
         ByteBufInputStream in = new ByteBufInputStream(buff.getDelegate().getByteBuf());
         vertxRequest.setInputStream(in);
      }

      try
      {
     	AppGlobals.set(appGlobals);
     	appGlobals.injectGlobals();
         dispatcher.service(ctx.getDelegate(), request.getDelegate(), response.getDelegate(), vertxRequest, vertxResponse, true);
      } catch (Failure e1)
      {
         vertxResponse.setStatus(e1.getErrorCode());
      } catch (Exception ex)
      {
         vertxResponse.setStatus(500);
         LogMessages.LOGGER.error(Messages.MESSAGES.unexpected(), ex);
      }
      finally 
      {
     	 AppGlobals.set(null);
      }
      if (!vertxRequest.getAsyncContext().isSuspended())
      {
         try
         {
            vertxResponse.finish();
         } catch (IOException e)
         {
            e.printStackTrace();
         }
      }
   });
}
 
开发者ID:FroMage,项目名称:redpipe,代码行数:46,代码来源:VertxPluginRequestHandler.java

示例10: uriInfo

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
private UriInfo uriInfo(final String uri) {
  return new ResteasyUriInfo(URI.create(uri));
}
 
开发者ID:sonatype,项目名称:nexus-public,代码行数:4,代码来源:SearchResourceTest.java

示例11: getUriInfo

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
private static UriInfo getUriInfo()
        throws URISyntaxException {
    return new ResteasyUriInfo(new URI("http://test/stack"),
                               new URI("http://test"));
}
 
开发者ID:saalfeldlab,项目名称:render,代码行数:6,代码来源:StackMetaDataServiceTest.java

示例12: testGetAndSaveResolvedTiles

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
@Test
public void testGetAndSaveResolvedTiles() throws Exception {

    final ResolvedTileSpecCollection resolvedTiles = service.getResolvedTiles(alignStackId.getOwner(),
                                                                              alignStackId.getProject(),
                                                                              alignStackId.getStack(),
                                                                              Z);

    validateResolvedTiles("before save", resolvedTiles, 1, 1);

    final LeafTransformSpec leafTransformSpecA = new LeafTransformSpec("test_transform_a",
                                                                      null,
                                                                      "mpicbg.trakem2.transform.AffineModel2D",
                                                                      "1  0  0  1  0  0");
    resolvedTiles.addTransformSpecToCollection(leafTransformSpecA);
    resolvedTiles.addReferenceTransformToAllTiles(leafTransformSpecA.getId(), false);

    final StackId testStackId = new StackId(alignStackId.getOwner(), alignStackId.getProject(), "test");

    final UriInfo uriInfo = new ResteasyUriInfo(new URI("http://test/resolvedTiles"),
                                                new URI("http://test"));

    service.saveResolvedTilesForZ(testStackId.getOwner(),
                                  testStackId.getProject(),
                                  testStackId.getStack(),
                                  Z,
                                  null,
                                  uriInfo,
                                  resolvedTiles);

    final ResolvedTileSpecCollection resolvedTestTiles = service.getResolvedTiles(testStackId.getOwner(),
                                                                                  testStackId.getProject(),
                                                                                  testStackId.getStack(),
                                                                                  Z);

    validateResolvedTiles("after save", resolvedTestTiles, 1, 2);

    final TransformSpec leafTransformSpecB = new LeafTransformSpec("test_transform_b",
                                                                   null,
                                                                   "mpicbg.trakem2.transform.AffineModel2D",
                                                                   "1  0  0  1  0  0");
    final TileSpec tileSpecB = new TileSpec();
    tileSpecB.setTileId("test_tile_b");
    tileSpecB.setZ(Z);
    tileSpecB.addTransformSpecs(Collections.singletonList(leafTransformSpecB));
    tileSpecB.setWidth(10.0);
    tileSpecB.setHeight(10.0);
    tileSpecB.deriveBoundingBox(tileSpecB.getMeshCellSize(), false);

    resolvedTestTiles.addTileSpecToCollection(tileSpecB);

    service.saveResolvedTilesForZ(testStackId.getOwner(),
                                  testStackId.getProject(),
                                  testStackId.getStack(),
                                  Z,
                                  null,
                                  uriInfo,
                                  resolvedTestTiles);

    final ResolvedTileSpecCollection resolvedTest2Tiles = service.getResolvedTiles(testStackId.getOwner(),
                                                                                   testStackId.getProject(),
                                                                                   testStackId.getStack(),
                                                                                   Z);

    validateResolvedTiles("after second save", resolvedTest2Tiles, 2, 2);
}
 
开发者ID:saalfeldlab,项目名称:render,代码行数:67,代码来源:RenderDataServiceTest.java

示例13: getUriInfo

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
private ResteasyUriInfo getUriInfo() throws URISyntaxException {
    return new ResteasyUriInfo(new URI("/"), new URI("http://localhost"));
}
 
开发者ID:aerogear,项目名称:aerogear-unifiedpush-server,代码行数:4,代码来源:InstallationManagementEndpointTest.java

示例14: createResteasyHttpRequest

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
@Override
public HttpRequest createResteasyHttpRequest(String httpMethod, HttpServletRequest request, ResteasyHttpHeaders headers,
        ResteasyUriInfo uriInfo, HttpResponse theResponse, HttpServletResponse response) {
    return createHttpRequest(httpMethod, request, headers, uriInfo, theResponse, response);
}
 
开发者ID:trein,项目名称:gtfs-java,代码行数:6,代码来源:MultipleMappingsHttpServletDispatcher.java

示例15: createHttpRequest

import org.jboss.resteasy.spi.ResteasyUriInfo; //导入依赖的package包/类
protected HttpRequest createHttpRequest(String httpMethod, HttpServletRequest request, ResteasyHttpHeaders headers,
        ResteasyUriInfo uriInfo, HttpResponse theResponse, HttpServletResponse response) {
    return new HttpServletInputMessage(request, response, getServletContext(), theResponse, headers, uriInfo, httpMethod
            .toUpperCase(), (SynchronousDispatcher) getDispatcher());
}
 
开发者ID:trein,项目名称:gtfs-java,代码行数:6,代码来源:MultipleMappingsHttpServletDispatcher.java


注:本文中的org.jboss.resteasy.spi.ResteasyUriInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。