Package org.restlet

Examples of org.restlet.Restlet


        RestletEndpoint endpoint = (RestletEndpoint)consumer.getEndpoint();
        addServerIfNeccessary(endpoint);
        MethodBasedRouter router = getMethodRouter(endpoint.getUriPattern());
       
        Map<String, String> realm = endpoint.getRealm();
        Restlet target = consumer.getRestlet();
        if (realm != null && realm.size() > 0) {
            Guard guard = new Guard(component.getContext().createChildContext(),
                    ChallengeScheme.HTTP_BASIC, "Camel-Restlet Endpoint Realm");
            for (Map.Entry<String, String> entry : realm.entrySet()) {
                guard.getSecrets().put(entry.getKey(), entry.getValue().toCharArray());
View Full Code Here


    private boolean checkVirtualHost(VirtualHost host) throws Exception {
        boolean result = true;

        if (host != null) {
            for (Route route : host.getRoutes()) {
                Restlet next = route.getNext();

                if (next instanceof Application) {
                    Application application = (Application) next;

                    for (Protocol clientProtocol : application
View Full Code Here

     * @param host
     * @throws Exception
     */
    private void stopVirtualHostApplications(VirtualHost host) throws Exception {
        for (Route route : host.getRoutes()) {
            Restlet next = route.getNext();

            if (next instanceof Application) {
                Application application = (Application) next;

                if (application.isStarted()) {
View Full Code Here

            getRoutes().add(
                    new HostRoute(this, getComponent().getDefaultHost()));
        }

        // If no host matches, display and error page with a precise message
        Restlet noHostMatched = new Restlet(getComponent().getContext()) {
            public void handle(Request request, Response response) {
                response.setStatus(Status.CLIENT_ERROR_NOT_FOUND,
                        "No virtual host could handle the request");
            }
        };
View Full Code Here

        RestletEndpoint endpoint = (RestletEndpoint)consumer.getEndpoint();
        addServerIfNeccessary(endpoint);
        MethodBasedRouter router = getMethodRouter(endpoint.getUriPattern());
       
        Map<String, String> realm = endpoint.getRestletRealm();
        Restlet target = consumer.getRestlet();
        if (realm != null && realm.size() > 0) {
            Guard guard = new Guard(component.getContext().createChildContext(),
                    ChallengeScheme.HTTP_BASIC, "Camel-Restlet Endpoint Realm");
            for (Map.Entry<String, String> entry : realm.entrySet()) {
                guard.getSecrets().put(entry.getKey(), entry.getValue().toCharArray());
View Full Code Here

        if (LOG.isDebugEnabled()) {
            LOG.debug("MethodRouter (" + uriPattern + ") received request method: "
                    + request.getMethod());
        }
       
        Restlet target = routes.get(request.getMethod());
        if (target != null) {
            target.handle(request, response);
        } else {
            if (LOG.isDebugEnabled()) {
                LOG.debug("No route for request method: " + request.getMethod());
            }
            response.setStatus(Status.CLIENT_ERROR_NOT_FOUND);
View Full Code Here

        while (it.hasNext()){
            Map.Entry entry = (Map.Entry) it.next();

            // LOG.info("Found mapping: " + entry.getKey().toString());
            Restlet restlet =
               (getApplicationContext().getBean(entry.getValue().toString()) instanceof Resource)
               ? new BeanResourceFinder(getApplicationContext(), entry.getValue().toString())
               : new BeanDelegatingRestlet(getApplicationContext(), entry.getValue().toString());

            String path = entry.getKey().toString();
View Full Code Here

                    }
                }
               
                @Override
                public Restlet getNext(Request request, Response response) {
                    Restlet next = super.getNext(request, response);
                    if (next != null) {
                        for (DispatcherCallback callback : callbacks) {
                            callback.dispatched(request, response, next);
                        }
                    }
View Full Code Here

       this.context = context;
       this.beanName = beanName;
    }

    public void handle(Request req, Response res){
        Restlet restlet = (Restlet)getBean();
        restlet.handle(req, res);
    }
View Full Code Here

        router.attach("/data/layerAsia?mode=bounds", FeatureBoundsResource.class);

        router.attach("/data/layerAsia/tiger_roads.1", SingleFeatureResource.class);

        Restlet mainpage = new Restlet() {

            @Override
            public void handle(Request request, Response response) {
                StringBuilder stringBuilder = new StringBuilder();
View Full Code Here

TOP

Related Classes of org.restlet.Restlet

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.