Examples of Redirector


Examples of org.restlet.routing.Redirector

        String restapihost = getContext().getParameters().getFirstValue("restapi.host", "localhost");
        String restapiport = getContext().getParameters().getFirstValue("restapi.port", "8111");

        String target = "http://" + restapihost + ":" + restapiport + "/v2{rr}";
        router.setDefaultMatchingMode(Template.MODE_STARTS_WITH);
        Redirector redirector = new Redirector(getContext(), target, Redirector.MODE_SERVER_OUTBOUND);
        router.attach("/v2", redirector);
        router.attach("/", new Directory(getContext(), "war:///"));
        return router;
    }
View Full Code Here

Examples of org.restlet.routing.Redirector

    ;
 
  public void createRedirector(String ip) {
        System.out.println("creating redirector: " + ip);
        String target = "http://" + ip + "8111/v2{rr}";
        Redirector redirector = new Redirector(getContext(), target, Redirector.MODE_SERVER_OUTBOUND);
//    router.attach("/v1", redirector);
        ((Router) getInboundRoot()).attach("/v2", redirector);
        System.out.println("Finishing redirector");
    }
View Full Code Here

Examples of org.restlet.routing.Redirector

    String restapihost = getContext().getParameters().getFirstValue("restapi.host","localhost");
    String restapiport = getContext().getParameters().getFirstValue("restapi.port","8111");
       
    String target = "http://"+restapihost+":"+restapiport+"/v1{rr}";
    router.setDefaultMatchingMode(Template.MODE_STARTS_WITH);
    Redirector redirector = new Redirector(getContext(),target, Redirector.MODE_SERVER_OUTBOUND);
    router.attach("/v1", redirector);
    router.attach("/", new Directory(getContext(), "war:///"));
    return  router;
  };
View Full Code Here

Examples of org.restlet.routing.Redirector

 
  public void createRedirector(String ip)
  {       
    System.out.println("creating redirector: "+ ip);
    String target = "http://"+ip+"8111/v1{rr}";   
    Redirector redirector = new Redirector(getContext(),target, Redirector.MODE_SERVER_OUTBOUND);
//    router.attach("/v1", redirector);
    ((Router)getInboundRoot()).attach("/v1", redirector);
    System.out.println("Finishing redirector");
  }
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.