Package org.restlet.data

Examples of org.restlet.data.Reference.addQueryParameter()


        }
        if (description != null && description.length() > 0) {
            cb.addQueryParameter("error_description", description);
        }
        if (errorUri != null && errorUri.length() > 0) {
            cb.addQueryParameter("error_uri", errorUri);
        }
        redirectTemporary(cb.toString());

        // cleanup cookie..
        ConcurrentMap<String, Object> attribs = getContext().getAttributes();
View Full Code Here


            Client client) {

        Reference ref = new Reference("riap://application/"
                + OAuthHelper.getAuthPage(getContext()));
        getLogger().info("Name = " + getApplication().getInboundRoot());
        ref.addQueryParameter("client", client.getClientId());
        // Requested
        String[] scopes = session.getRequestedScope();

        if (scopes != null && scopes.length > 0) {
            for (String s : scopes)
View Full Code Here

        // Requested
        String[] scopes = session.getRequestedScope();

        if (scopes != null && scopes.length > 0) {
            for (String s : scopes)
                ref.addQueryParameter("scope", s);
        }

        // Granted
        AuthenticatedUser user = client.findUser(session.getScopeOwner());
View Full Code Here

        if (user != null) { // null before first code generated
            // scopes = OAuthUtils.roluser.getGrantedScopes();
            List<Role> roles = user.getGrantedRoles();
            if (roles != null && roles.size() > 0) {
                for (Role r : roles)
                    ref.addQueryParameter("grantedScope", Scopes.toScope(r));
            }
        }

        getLogger().info("Redir = " + ref);
        Redirector dispatcher = new Redirector(getContext(), ref.toString(),
View Full Code Here

        if (redirUri == null || redirUri.length() == 0) {
            // create a fake uri...
            redirUri = "https://127.0.0.1/cb";
        }
        Reference cb = new Reference(redirUri);
        cb.addQueryParameter("error", error.name());
        if (state != null && state.length() > 0) {
            cb.addQueryParameter("state", state);
        }
        if (description != null && description.length() > 0) {
            cb.addQueryParameter("error_description", description);
View Full Code Here

            redirUri = "https://127.0.0.1/cb";
        }
        Reference cb = new Reference(redirUri);
        cb.addQueryParameter("error", error.name());
        if (state != null && state.length() > 0) {
            cb.addQueryParameter("state", state);
        }
        if (description != null && description.length() > 0) {
            cb.addQueryParameter("error_description", description);
        }
        if (errorUri != null && errorUri.length() > 0) {
View Full Code Here

        cb.addQueryParameter("error", error.name());
        if (state != null && state.length() > 0) {
            cb.addQueryParameter("state", state);
        }
        if (description != null && description.length() > 0) {
            cb.addQueryParameter("error_description", description);
        }
        if (errorUri != null && errorUri.length() > 0) {
            cb.addQueryParameter("error_uri", errorUri);
        }
        redirectTemporary(cb.toString());
View Full Code Here

        }
        if (description != null && description.length() > 0) {
            cb.addQueryParameter("error_description", description);
        }
        if (errorUri != null && errorUri.length() > 0) {
            cb.addQueryParameter("error_uri", errorUri);
        }
        redirectTemporary(cb.toString());

        // cleanup cookie..
        if (sessionId != null && sessionId.length() > 0) {
View Full Code Here

    private Reference createReferenceFromQuery(final Map<String, String> queryParameters) {
        validateEndPointUri();
        final Reference ref = new Reference(endPointUri.getScheme(), endPointUri.getHost(), endPointUri.getPort(),
            endPointUri.getPath(), null, null);
        for (final Map.Entry<String, String> entry : queryParameters.entrySet()) {
            ref.addQueryParameter(entry.getKey(), entry.getValue());
        }
        return ref;
    }

    private Representation getRepresentation() {
View Full Code Here

                     }
                     else
                     {
                        param = valueSerializer.serialize( value );
                     }
                     ref.addQueryParameter( propertyDescriptor.qualifiedName().name(), param );
                 }
             }
             catch( ValueSerializationException e )
             {
                 throw new ResourceException( e );
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.