Package org.restlet

Examples of org.restlet.Restlet


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


    public RestletConsumer(Endpoint endpoint, Processor processor)
        throws Exception {
        super(endpoint, processor);
       
        restlet = new Restlet() {
            @Override
            public void handle(Request request, Response response) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Consumer restlet handle request method: " + request.getMethod());
                }
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

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

    public RestletConsumer(Endpoint endpoint, Processor processor)
        throws Exception {
        super(endpoint, processor);
       
        restlet = new Restlet() {
            @Override
            public void handle(Request request, Response response) {
                LOG.debug("Consumer restlet handle request method: {}", request.getMethod());
               
                try {
View Full Code Here

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

    @Override
    public void handle(Request request, Response response) {
        Method method = request.getMethod();
        LOG.debug("MethodRouter ({}) received request method: {}", uriPattern, method);
       
        Restlet target = routes.get(method);
        if (target != null) {
            target.handle(request, response);
        } else {
            LOG.debug("MethodRouter ({}) method not allowed: {}", uriPattern, method);
            response.setStatus(Status.CLIENT_ERROR_METHOD_NOT_ALLOWED);
            // must include list of allowed methods
            response.setAllowedMethods(routes.keySet());
View Full Code Here

    public RestletConsumer(Endpoint endpoint, Processor processor)
        throws Exception {
        super(endpoint, processor);
       
        restlet = new Restlet() {
            @Override
            public void handle(Request request, Response response) {
                LOG.debug("Consumer restlet handle request method: {}", request.getMethod());
               
                try {
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

    router.attach("/clusters/{clusterName}/constraints/{constraintType}", ConstraintResource.class);
    router.attach("/clusters/{clusterName}/constraints/{constraintType}/{constraintId}", ConstraintResource.class);
    router.attach("/zkPath", ZkPathResource.class).setMatchingMode(Template.MODE_STARTS_WITH);
    router.attach("/zkChild", ZkChildResource.class).setMatchingMode(Template.MODE_STARTS_WITH);

    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.