Package com.dyuproject.util.http

Examples of com.dyuproject.util.http.HttpConnector$Parameter


   
    public static Response serviceGET(String serviceUrl, ConsumerContext context, Endpoint ep,
            Token token, HttpServletRequest request, HttpServletResponse response)
            throws IOException
    {
        HttpConnector connector = context.getHttpConnector();
        UrlEncodedParameterMap params = new UrlEncodedParameterMap(serviceUrl);
        context.getNonceAndTimestamp().put(params, token.getCk());
        Parameter authorization = new Parameter("Authorization",
                HttpAuthTransport.getAuthHeaderValue(params, ep, token,
                context.getNonceAndTimestamp(),  ep.getSignature()));
        return connector.doGET(params.getUrl(), authorization);
       
    }
View Full Code Here


   
    public static Response serviceGET(String serviceUrl, ConsumerContext context, Endpoint ep,
            Token token, HttpServletRequest request, HttpServletResponse response)
            throws IOException
    {
        HttpConnector connector = context.getHttpConnector();
        UrlEncodedParameterMap params = new UrlEncodedParameterMap(serviceUrl);
        context.getNonceAndTimestamp().put(params, token.getCk());
        Parameter authorization = new Parameter("Authorization",
                HttpAuthTransport.getAuthHeaderValue(params, ep, token,
                context.getNonceAndTimestamp(),  ep.getSignature()));
        return connector.doGET(params.getUrl(), authorization);
       
    }
View Full Code Here

        Association association = associationParam==null ? new DiffieHellmanAssociation() :
            (Association)newObjectInstance(associationParam);
       
        // http connector
        String httpConnectorParam = properties.getProperty("openid.httpconnector");
        HttpConnector httpConnector = httpConnectorParam==null ? new SimpleHttpConnector() :
            (HttpConnector)newObjectInstance(httpConnectorParam);      
       
        // user manager
        String managerParam = properties.getProperty("openid.user.manager");
        OpenIdUserManager manager = managerParam == null ? new HttpSessionUserManager() :
View Full Code Here

     * Creates a new instance configured form the {@link Properties} {@code props}.
     */
    public static Consumer newInstance(Properties props) throws IOException
    {
        String httpConnectorParam = props.getProperty("oauth.consumer.httpconnector");
        HttpConnector httpConnector = httpConnectorParam==null ? SimpleHttpConnector.getDefault() :
            (HttpConnector)newObjectInstance(httpConnectorParam);
       
        String ntsParam = props.getProperty("oauth.consumer.nonce_and_timestamp");
        NonceAndTimestamp nonceAndTimestamp = ntsParam==null ? SimpleNonceAndTimestamp.DEFAULT :
            (NonceAndTimestamp)newObjectInstance(ntsParam);
View Full Code Here

                SampleOAuth2Provider.generateAccessAndRefreshToken(accessor);
                String redirect_uri = request.getParameter(OAuth2.REDIRECT_URI);
                String state = request.getParameter(OAuth2.STATE);
               
                List<Parameter> list = new ArrayList<Parameter>(5);
                list.add(new Parameter(OAuth2.ACCESS_TOKEN,accessor.accessToken));
                list.add(new Parameter(OAuth2.TOKEN_TYPE,accessor.tokenType));
                list.add(new Parameter(OAuth2.EXPIRES_IN,"3600"));
                if(accessor.scope!=null) list.add(new Parameter(OAuth2.SCOPE,accessor.scope));
                if(state != null){
                    list.add(new Parameter(OAuth2.STATE, state));
                }
               
                redirect_uri = OAuth2.addParametersAsFragment(redirect_uri,list);
                response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY);
                response.setHeader("Location", OAuth2.decodePercent(redirect_uri));
View Full Code Here

            // test number of parameters
            if (firstParameters.size() == secondParameters.size())
            {
                for (int i = 0; i < firstParameters.size() && sameSignature; i++)
                {
                    final Parameter firstParameter = (Parameter)firstParameters.get(i);
                    final Parameter secondParameter = (Parameter)secondParameters.get(i);

                    // test each parameter's type
                    sameSignature =
                        isEqual(
                            firstParameter.getType(),
                            secondParameter.getType());
                }
            }
            else
            {
                sameSignature = false;
View Full Code Here

        Iterator iterator = this.metaObject.getOwnedParameters().iterator();

        boolean commaNeeded = false;
        while (iterator.hasNext())
        {
            Parameter parameter = (Parameter)iterator.next();

            if (!parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL))
            {
                if (commaNeeded)
                {
                    buffer.append(", ");
                }
                buffer.append(parameter.getName());
                commaNeeded = true;
            }
        }
        return buffer.toString();
    }
View Full Code Here

        Iterator iterator = this.metaObject.getOwnedParameters().iterator();

        boolean commaNeeded = false;
        while (iterator.hasNext())
        {
            Parameter parameter = (Parameter)iterator.next();

            if (!parameter.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL))
            {
                if (commaNeeded)
                {
                    buffer.append(", ");
                }
View Full Code Here

            arguments,
            new Predicate()
            {
                public boolean evaluate(final Object object)
                {
                    Parameter p = (Parameter)object;
                    return !p.getDirection().equals(ParameterDirectionKind.RETURN_LITERAL) && !p.isException();
                }
            });
        return arguments;
    }
View Full Code Here

TOP

Related Classes of com.dyuproject.util.http.HttpConnector$Parameter

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.