Package org.apache.abdera.protocol.server.impl

Examples of org.apache.abdera.protocol.server.impl.RouteManager


    super();
    init();
  }
 
  private void init() {
    RouteManager routeManager =
      new RouteManager()
        .addRoute("service", "/", TargetType.TYPE_SERVICE)
        .addRoute("feed", "/:feed", TargetType.TYPE_COLLECTION)
        .addRoute("entry", "/:feed/:entry", TargetType.TYPE_ENTRY);
    setTargetBuilder(routeManager);
    setTargetResolver(routeManager);
View Full Code Here


  public void testUrlForEmptyContext() throws Exception {
    runTestUrlFor("/app/base/", null);
  }
 
  private void runTestUrlFor(String expected, Map<String, String> context) {
    RouteManager manager = new RouteManager().addRoute(new Route("entry", "/base/:entry"));

    RequestContext request = createMock(RequestContext.class);
    expect(request.getContextPath()).andReturn("/app");
    replay(request);

    assertEquals(expected, manager.urlFor(request, "entry", context));
  }
View Full Code Here

    assertEquals(expected, manager.urlFor(request, "entry", context));
  }
 
  @Test
  public void testStaticResolve() throws Exception {
    RouteManager manager = new RouteManager();
    manager.addRoute(new Route("collection", "/:coll"), TargetType.TYPE_COLLECTION)
      .addRoute(new Route("openSearch", "/openSearch.xml"), TargetType.TYPE_ENTRY);
   
    RequestContext request = createMock(RequestContext.class);
      expect(request.getTargetPath()).andReturn("/openSearch.xml");
      replay(request);
     
      RouteTarget target = (RouteTarget) manager.resolve(request);
      assertEquals("/openSearch.xml", target.getRoute().getPattern());
  }
View Full Code Here

        processors.put(OpenSearchTargetTypes.OPENSEARCH_URL, osUrlProcessor);

        DefaultWorkspaceManager wsManager = new DefaultWorkspaceManager();
        wsManager.setWorkspaces(new LinkedList<WorkspaceInfo>());

        RouteManager routeManager = new RouteManager();
        routeManager.addRoute("service", "/", TargetType.TYPE_SERVICE)
                .addRoute("feed", "/atom/:collection", TargetType.TYPE_COLLECTION)
                .addRoute("entry", "/atom/:collection/:entry", TargetType.TYPE_ENTRY)
                .addRoute("categories", "/atom/:collection/:entry;categories", TargetType.TYPE_CATEGORIES)
                .addRoute("osSearch1", "/search1", OpenSearchTargetTypes.OPENSEARCH_URL)
                .addRoute("osSearch2", "/search2", OpenSearchTargetTypes.OPENSEARCH_URL)
View Full Code Here

        processors.put(OpenSearchTargetTypes.OPENSEARCH_DESCRIPTION, osRequestProcessor);

        DefaultWorkspaceManager wsManager = new DefaultWorkspaceManager();
        wsManager.setWorkspaces(new LinkedList<WorkspaceInfo>());

        RouteManager routeManager = new RouteManager();
        routeManager.addRoute("service", "/", TargetType.TYPE_SERVICE)
                .addRoute("feed", "/atom/:collection", TargetType.TYPE_COLLECTION)
                .addRoute("entry", "/atom/:collection/:entry", TargetType.TYPE_ENTRY)
                .addRoute("categories", "/atom/:collection/:entry;categories", TargetType.TYPE_CATEGORIES)
                .addRoute("osDescription", "/search", OpenSearchTargetTypes.OPENSEARCH_DESCRIPTION);
View Full Code Here

        processors.put(OpenSearchTargetTypes.OPENSEARCH_URL, osUrlProcessor);

        DefaultWorkspaceManager wsManager = new DefaultWorkspaceManager();
        wsManager.setWorkspaces(new LinkedList<WorkspaceInfo>());

        RouteManager routeManager = new RouteManager();
        routeManager.addRoute("service", "/", TargetType.TYPE_SERVICE)
                .addRoute("feed", "/atom/:collection", TargetType.TYPE_COLLECTION)
                .addRoute("entry", "/atom/:collection/:entry", TargetType.TYPE_ENTRY)
                .addRoute("categories", "/atom/:collection/:entry;categories", TargetType.TYPE_CATEGORIES)
                .addRoute("osSearch1", "/search1", OpenSearchTargetTypes.OPENSEARCH_URL);
View Full Code Here

    public CustomProvider() {

        this.adapter = new SimpleAdapter();

        RouteManager rm =
            new RouteManager().addRoute("service", "/", TargetType.TYPE_SERVICE).addRoute("collection",
                                                                                          "/:collection",
                                                                                          TargetType.TYPE_COLLECTION)
                .addRoute("entry", "/:collection/:entry", TargetType.TYPE_ENTRY);

        setTargetBuilder(rm);
View Full Code Here

        processors.put(OpenSearchTargetTypes.OPENSEARCH_URL, osUrlProcessor);

        DefaultWorkspaceManager wsManager = new DefaultWorkspaceManager();
        wsManager.setWorkspaces(new LinkedList<WorkspaceInfo>());

        RouteManager routeManager = new RouteManager();
        routeManager.addRoute("service", "/", TargetType.TYPE_SERVICE).addRoute("feed",
                                                                                "/atom/:collection",
                                                                                TargetType.TYPE_COLLECTION)
            .addRoute("entry", "/atom/:collection/:entry", TargetType.TYPE_ENTRY)
            .addRoute("categories", "/atom/:collection/:entry;categories", TargetType.TYPE_CATEGORIES)
            .addRoute("osSearch1", "/search1", OpenSearchTargetTypes.OPENSEARCH_URL)
View Full Code Here

        processors.put(OpenSearchTargetTypes.OPENSEARCH_DESCRIPTION, osRequestProcessor);

        DefaultWorkspaceManager wsManager = new DefaultWorkspaceManager();
        wsManager.setWorkspaces(new LinkedList<WorkspaceInfo>());

        RouteManager routeManager = new RouteManager();
        routeManager.addRoute("service", "/", TargetType.TYPE_SERVICE).addRoute("feed",
                                                                                "/atom/:collection",
                                                                                TargetType.TYPE_COLLECTION)
            .addRoute("entry", "/atom/:collection/:entry", TargetType.TYPE_ENTRY)
            .addRoute("categories", "/atom/:collection/:entry;categories", TargetType.TYPE_CATEGORIES)
            .addRoute("osDescription", "/search", OpenSearchTargetTypes.OPENSEARCH_DESCRIPTION);
View Full Code Here

        processors.put(OpenSearchTargetTypes.OPENSEARCH_URL, osUrlProcessor);

        DefaultWorkspaceManager wsManager = new DefaultWorkspaceManager();
        wsManager.setWorkspaces(new LinkedList<WorkspaceInfo>());

        RouteManager routeManager = new RouteManager();
        routeManager.addRoute("service", "/", TargetType.TYPE_SERVICE).addRoute("feed",
                                                                                "/atom/:collection",
                                                                                TargetType.TYPE_COLLECTION)
            .addRoute("entry", "/atom/:collection/:entry", TargetType.TYPE_ENTRY)
            .addRoute("categories", "/atom/:collection/:entry;categories", TargetType.TYPE_CATEGORIES)
            .addRoute("osSearch1", "/search1", OpenSearchTargetTypes.OPENSEARCH_URL);
View Full Code Here

TOP

Related Classes of org.apache.abdera.protocol.server.impl.RouteManager

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.