Package javax.ws.rs.core

Examples of javax.ws.rs.core.Form.param()


                }
                accessTokenService.header("Authorization", sb.toString());
            } else {
                form.param(OAuthConstants.CLIENT_ID, consumer.getKey());
                if (consumer.getSecret() != null) {
                    form.param(OAuthConstants.CLIENT_SECRET, consumer.getSecret());
                }
            }
        } else {
            // in this case the AccessToken service is expected to find a mapping between
            // the authenticated credentials and the client registration id
View Full Code Here


                        Annotation[] anns,
                        MediaType mt, MultivaluedMap<String, Object> headers, OutputStream os)
        throws IOException, WebApplicationException {
       
        Form form = new Form(new MetadataMap<String, String>());
        form.param(OAuth.OAUTH_VERIFIER, obj.getVerifier());
        form.param(OAuth.OAUTH_TOKEN, obj.getRequestToken());
        if (obj.getState() != null) {
            form.param(OAuthConstants.X_OAUTH_STATE, obj.getState());
        }
        formProvider.writeTo(form, Form.class, Form.class, anns, mt, headers, os);
View Full Code Here

                        MediaType mt, MultivaluedMap<String, Object> headers, OutputStream os)
        throws IOException, WebApplicationException {
       
        Form form = new Form(new MetadataMap<String, String>());
        form.param(OAuth.OAUTH_VERIFIER, obj.getVerifier());
        form.param(OAuth.OAUTH_TOKEN, obj.getRequestToken());
        if (obj.getState() != null) {
            form.param(OAuthConstants.X_OAUTH_STATE, obj.getState());
        }
        formProvider.writeTo(form, Form.class, Form.class, anns, mt, headers, os);
    }
View Full Code Here

       
        Form form = new Form(new MetadataMap<String, String>());
        form.param(OAuth.OAUTH_VERIFIER, obj.getVerifier());
        form.param(OAuth.OAUTH_TOKEN, obj.getRequestToken());
        if (obj.getState() != null) {
            form.param(OAuthConstants.X_OAUTH_STATE, obj.getState());
        }
        formProvider.writeTo(form, Form.class, Form.class, anns, mt, headers, os);
    }

}
View Full Code Here

        WebClient client = WebClient.create("http://localhost:" + PORT + "/test/services/rest");
        client.type(MediaType.TEXT_PLAIN_TYPE).accept(MediaType.APPLICATION_XML_TYPE);
        client.path("/bookstore/books/139/subresource4/139/CXF Rocks");
        Book bean = new Book("CXF Rocks", 139L);
        Form form = new Form();
        form.param("name", "CXF Rocks").param("id", Long.toString(139L));
        Book b = readBook((InputStream)client.matrix("", bean).query("", bean).form(form).getEntity());
        assertEquals(139, b.getId());
        assertEquals("CXF Rocks", b.getName());
    }
   
View Full Code Here

       
        String baseAddress = "http://localhost:" + PORT
            + "/test/services/rest/bookstore/books/679/subresource3";
        WebClient wc = WebClient.create(baseAddress);
        Form f = new Form(new MetadataMap<String, String>());
        f.param("id", "679").param("name", "CXF in Action - ")
            .param("name", "679");
        Book b = readBook((InputStream)wc.accept("application/xml")
                          .form(f).getEntity());
        assertEquals(679, b.getId());
        assertEquals("CXF in Action - 679", b.getName());
View Full Code Here

        throws OAuthServiceException {   
       
        Form form = new Form(grant.toMap());
        if (extraParams != null) {
            for (Map.Entry<String, String> entry : extraParams.entrySet()) {
                form.param(entry.getKey(), entry.getValue());
            }
        }
        if (consumer != null) {
            if (setAuthorizationHeader) {
                StringBuilder sb = new StringBuilder();
View Full Code Here

                } catch (Exception ex) {
                    throw new ProcessingException(ex);
                }
                accessTokenService.header("Authorization", sb.toString());
            } else {
                form.param(OAuthConstants.CLIENT_ID, consumer.getKey());
                if (consumer.getSecret() != null) {
                    form.param(OAuthConstants.CLIENT_SECRET, consumer.getSecret());
                }
            }
        } else {
View Full Code Here

                }
                accessTokenService.header("Authorization", sb.toString());
            } else {
                form.param(OAuthConstants.CLIENT_ID, consumer.getKey());
                if (consumer.getSecret() != null) {
                    form.param(OAuthConstants.CLIENT_SECRET, consumer.getSecret());
                }
            }
        } else {
            // in this case the AccessToken service is expected to find a mapping between
            // the authenticated credentials and the client registration id
View Full Code Here

    Annotation[][] parameterAnnotations = method.getParameterAnnotations();
    for( int i = 0; i < parameterAnnotations.length; i++ ) {
      Annotation[] annotations = parameterAnnotations[ i ];
      FormParam formParam = extractAnnotation( annotations, FormParam.class );
      if( formParam != null ) {
        result.param( formParam.value(), parameter[ i ].toString() );
      }
    }
    return result.asMap().isEmpty() ? null : result;
  }
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.