Package org.restlet.data

Examples of org.restlet.data.Method


   * requests, this returns the parameters from the request's body.
   */
  public static Form getParameters(Request request)
    throws ResourceException
  {
    Method reqMethod = request.getMethod();

    if (Method.GET.equals(reqMethod) || Method.HEAD.equals(reqMethod)) {
      return request.getResourceRef().getQueryAsForm();
    }
    else if (Method.POST.equals(reqMethod)) {
View Full Code Here


            for (Method method : methods) {
                router.addRoute(method, target);
                LOG.debug("Attached restlet uriPattern: {} method: {}", uriPattern, method);
            }
        } else {
            Method method = endpoint.getRestletMethod();
            router.addRoute(method, target);
            LOG.debug("Attached restlet uriPattern: {} method: {}", uriPattern, method);
        }

        if (!router.hasBeenAttached()) {
View Full Code Here

            for (Method method : methods) {
                router.addRoute(method, target);
                LOG.debug("Attached restlet uriPattern: {} method: {}", uriPattern, method);
            }
        } else {
            Method method = endpoint.getRestletMethod();
            router.addRoute(method, target);
            LOG.debug("Attached restlet uriPattern: {} method: {}", uriPattern, method);
        }

        if (!router.hasBeenAttached()) {
View Full Code Here

        ref = getAndRemoveParameter(parameters, "restletRealmRef", String.class);
        if (ref != null) {
            realm = CamelContextHelper.mandatoryLookup(getCamelContext(), ref, Map.class);
        }
       
        Method method = getAndRemoveParameter(parameters, "restletMethod", Method.class);
        RestletEndpoint result = new RestletEndpoint(this, remaining, parameters, restletBinding);
       
        if (method != null) {
            result.setRestletMethod(method);
        }
View Full Code Here

  public void testGetContext() throws Exception{
    LayerAboutPage lap = new LayerAboutPage();
    lap.setCatalog((Catalog) GeoServerExtensions.bean("catalog"));
   
    Request request = new Request(new Method("GET"), "http://example.org/geoserver/rest/topp/states.html");
   
    SimpleHash context;
   
    //test if it fails the right way with bogus namespace
    boolean hadRestletException = false;
View Full Code Here

     * @throws ResourceException
     */
    protected void callTarget(Resolver<String> resolver)
            throws ResourceException {
        // A - Build the request for the target resource
        final Method method = getTargetMethod(resolver);

        final Reference targetRef = getTargetRef(resolver);

        final Request request = new Request(method, targetRef);
        final ChallengeResponse challengeResponse = getTargetChallengeResponse(resolver);
View Full Code Here

     * @param resolver
     *            The resolver.
     * @return The target method.
     */
    protected Method getTargetMethod(Resolver<String> resolver) {
        Method method = Method.valueOf(resolver.resolve("method"));
        if (method == null) {
            method = getTargetMethod();
        }

        return method;
View Full Code Here

        for (Annotation annotation : javaMethod.getAnnotations()) {
            Annotation methodAnnotation = annotation.annotationType()
                    .getAnnotation(org.restlet.engine.Method.class);

            if (methodAnnotation != null) {
                Method restletMethod = Method
                        .valueOf(((org.restlet.engine.Method) methodAnnotation)
                                .value());

                String toString = annotation.toString();
                int startIndex = annotation.annotationType().getCanonicalName()
View Full Code Here

    private boolean processExtensions(Request request) {
        final TunnelService tunnelService = getTunnelService();
        boolean extensionsModified = false;

        // Tunnel the client preferences only for GET or HEAD requests
        final Method method = request.getMethod();
        if (tunnelService.isPreferencesTunnel()
                && (method.equals(Method.GET) || method.equals(Method.HEAD))) {
            final Reference resourceRef = request.getResourceRef();

            if (resourceRef.hasExtensions()) {
                final ClientInfo clientInfo = request.getClientInfo();
                boolean encodingFound = false;
View Full Code Here

        if (resourceRef.hasQuery()) {
            Form query = resourceRef.getQueryAsForm();

            // Tunnel the request method
            Method method = request.getMethod();
            if (tunnelService.isMethodTunnel()) {
                String methodName = query.getFirstValue(tunnelService
                        .getMethodParameter());

                Method tunnelledMethod = Method.valueOf(methodName);
                // The OPTIONS method can be tunneled via GET requests.
                if (tunnelledMethod != null
                        && (Method.POST.equals(method) || Method.OPTIONS
                                .equals(tunnelledMethod))) {
                    request.setMethod(tunnelledMethod);
View Full Code Here

TOP

Related Classes of org.restlet.data.Method

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.