Examples of Redirector


Examples of org.gatein.web.redirect.Redirector

    // Used for retrieving the stored portal configuration
    DataStorage dataStorage;

    public SiteRedirectServiceImpl(DataStorage dataStorage, NavigationService navService) throws IOException {
        this.dataStorage = dataStorage;
        this.redirector = new Redirector();
        this.mapper = new Mapper(navService);
    }
View Full Code Here

Examples of org.restlet.Redirector

    }

     public synchronized Restlet createRoot() {
        Router router = new Router(getContext());

        router.attach("/",new Redirector(null,"/engine",Redirector.MODE_CLIENT_TEMPORARY));
        router.attach("/engine",EngineResource.class)
            .setMatchingMode(Template.MODE_EQUALS);
        router.attach("/engine/",EngineResource.class)
            .setMatchingMode(Template.MODE_EQUALS);
View Full Code Here

Examples of org.restlet.routing.Redirector

        // remove...
        if (callback == null)
            callback = request.getCookies().getFirstValue(
                    INTERNAL_SERVER_COOKIE);
        if (callback != null) {
            Redirector dispatcher = new Redirector(getContext(), callback,
                    Redirector.MODE_CLIENT_TEMPORARY);

            // //TODO maybe move it to use Principal.
            getContext().getAttributes().put("id", id); // same app
            dispatcher.handle(request, response);
            response.getCookieSettings().remove(INTERNAL_SERVER_COOKIE);
        } else {
            JSONObject obj = new JSONObject();
            try {
                obj.put("id", id);
                // for(String s : axRequired.keySet()) {
                // obj.put(s, axRequired.get(s));
                // }
                // for(String s : axOptional.keySet()) {
                // obj.put(s, axOptional.get(s));
                // }
            } catch (JSONException e) {
                getLogger().log(Level.WARNING, "Failed to get the ID!", e);
            }

            String jcallback = response.getCookieSettings().getFirstValue(
                    EXTERNAL_SERVER_COOKIE);
            if (jcallback == null)
                jcallback = request.getCookies().getFirstValue(
                        EXTERNAL_SERVER_COOKIE);
            if (jcallback != null) {
                Redirector dispatcher = new Redirector(getContext(), jcallback,
                        Redirector.MODE_SERVER_OUTBOUND);
                request.setEntity(new JsonRepresentation(obj));
                request.setMethod(Method.POST);
                dispatcher.handle(request, response);
                response.getCookieSettings().remove(EXTERNAL_SERVER_COOKIE);
            } else {
                response.setEntity(new JsonRepresentation(obj));
            }
        }
View Full Code Here

Examples of org.restlet.routing.Redirector

        clientComponent.getClients().add(Protocol.HTTP);
        proxyComponent.getClients().add(Protocol.HTTP);

        // Create the proxy Restlet
        final String target = "http://localhost:" + (TEST_PORT + 1) + "{rr}";
        final Redirector proxy = new Redirector(proxyComponent.getContext()
                .createChildContext(), target, Redirector.MODE_SERVER_OUTBOUND);

        // Create a new Restlet that will display some path information.
        final Restlet trace = new Restlet(originComponent.getContext()
                .createChildContext()) {
View Full Code Here

Examples of org.restlet.routing.Redirector

    @Override
    public Restlet createInboundRoot() {
        final Router router = new Router(getContext());

        // Redirect by defaul to the lst of users.
        router.attachDefault(new Redirector(getContext(), "/users",
                Redirector.MODE_CLIENT_PERMANENT));

        final Directory imgDirectory = new Directory(getContext(),
                LocalReference.createFileReference(webRootPath + "/images"));
        // Add a route for the image resources
View Full Code Here

Examples of org.restlet.routing.Redirector

        // Create a root router
        Router router = new Router(getContext());

        // Create a Redirector to Google search service
        String target = "http://www.google.com/search?q=site:mysite.org+{keywords}";
        Redirector redirector = new Redirector(getContext(), target,
                Redirector.MODE_CLIENT_TEMPORARY);

        // While routing requests to the redirector, extract the "kwd" query
        // parameter. For instance :
        // http://localhost:8111/search?kwd=myKeyword1+myKeyword2
View Full Code Here

Examples of org.restlet.routing.Redirector

                    ref.addQueryParameter("grantedScope", Scopes.toScope(r));
            }
        }

        getLogger().info("Redir = " + ref);
        Redirector dispatcher = new Redirector(getContext(), ref.toString(),
                Redirector.MODE_SERVER_OUTBOUND);
        // getRequest().setCookies(getResponse().getCookieSettings().get
        // getRequest().setCookies(cookies)
        getRequest().getAttributes().put(ClientCookieID, session.getId());
        dispatcher.handle(getRequest(), getResponse());
        return getResponseEntity();

    }
View Full Code Here

Examples of org.restlet.routing.Redirector

            }
           
            Reference targetRef = new Reference(to);
            Restlet restlet = null;
            if (targetRef.isAbsolute() && targetRef.getScheme().equals("riap")) {
               restlet = new Redirector(parentContext,to,Redirector.MODE_SERVER_INBOUND);
            } else {
               restlet = new Redirector(parentContext,to,Redirector.MODE_CLIENT_SEE_OTHER);
            }
            if (defaultRoute) {
               router.attachDefault(restlet);
            } else if (router!=null) {
               String [] extraction = null;
View Full Code Here

Examples of org.restlet.routing.Redirector

                    ref.addQueryParameter("grantedScope", Scopes.toScope(r));
            }
        }

        getLogger().info("Redir = " + ref);
        Redirector dispatcher = new Redirector(getContext(), ref.toString(),
                Redirector.MODE_SERVER_OUTBOUND);
        dispatcher.handle(getRequest(), getResponse());
        return getResponseEntity();

    }
View Full Code Here

Examples of org.restlet.routing.Redirector

      Router router = new Router(getContext());
      router.setDefaultMatchingMode(Template.MODE_STARTS_WITH);
      Filter guard = new UserGuard(getContext(),ChallengeScheme.HTTP_BASIC,"Atom User",auth);
      guard.setNext(router);
     
      Redirector byId = new IdRedirector(getContext(),this,atomDB,RESOURCE_BASE);
      router.attach("/id/",byId);
     
      ProtocolByPathFinder byPath = new ProtocolByPathFinder(getContext(),this,RESOURCE_BASE,app,atomDB,storage);
      router.attach(RESOURCE_BASE.toString(),byPath);
      router.attach("/R",byPath);
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.