Package org.openid4java.message

Examples of org.openid4java.message.Parameter


    {
        List attributes = new ArrayList();

        String level = required ? "required" : "optional";

        Parameter param = _parameters.getParameter(level);
        if (param != null)
        {
            String[] values = param.getValue().split(",");
            for (int i = 0; i < values.length; i++)
            {
                String attr = multivalDecode(values[i]);
                attributes.add(attr);
            }
View Full Code Here


            throw new MessageException("Invalid policy_url: " + policyUrl);
        }

        if (DEBUG) _log.debug("Setting SReg request policy_url: " + policyUrl);

        _parameters.set(new Parameter("policy_url", policyUrl));
    }
View Full Code Here

     * @param       attr        An attribute name.
     * @param       value       The value of the attribute.
     */
    public void addAttribute(String attr, String value) throws MessageException
    {
        _parameters.set(new Parameter(attr, value));

        if (! SREG_FIELDS.contains(attr))
            throw new MessageException("Invalid attribute for SReg: " + attr);

        if (DEBUG)
View Full Code Here

    /**
     * Constructs a Fetch Response with an empty parameter list.
     */
    protected FetchResponse()
    {
        _parameters.set(new Parameter("mode", "fetch_response"));

        if (DEBUG) _log.debug("Created empty fetch response.");
    }
View Full Code Here

        String index = "";

        switch(count)
        {
            case 0:
                _parameters.set(new Parameter("type." + alias, typeUri));
                break;

            case 1:
                // rename the existing one
                _parameters.set(new Parameter("value." + alias + ".1",
                        getParameterValue("value." + alias)));
                _parameters.removeParameters("value." + alias);
                index = ".2";
                break;

            default:
                index = "." +Integer.toString(count + 1);
        }

        _parameters.set(new Parameter("value." + alias + index, value));
        setCount(alias, ++count);

        if (DEBUG)
            _log.debug("Added new attribute to fetch response; type: " + typeUri
                       + " alias: " + alias + " count: " + count);
View Full Code Here

    {
        // make sure that count.< alias >.1 is removed
        _parameters.removeParameters("count." + alias);

        if (count > 1)
            _parameters.set(new Parameter("count." + alias, Integer.toString(count)));
    }
View Full Code Here

            throw new MessageException("Invalid update_url: " + updateUrl);
        }

        if (DEBUG) _log.debug("Setting fetch response update_url: " + updateUrl);

        _parameters.set(new Parameter("update_url", updateUrl));
    }
View Full Code Here

    /**
     * Constructs a Fetch Request with an empty parameter list.
     */
    protected FetchRequest()
    {
        _parameters.set(new Parameter("mode", "fetch_request"));

        if (DEBUG) _log.debug("Created empty fetch request.");
    }
View Full Code Here

     * @param       count       The number of attribute values requested.
     */
    public void addAttribute(String alias, String typeUri,
                             boolean required, int count)
    {
        _parameters.set(new Parameter("type." + alias, typeUri));

        String level = required ? "required" : "if_available";

        Parameter levelParam = _parameters.getParameter(level);
        Parameter newParam;

        if (levelParam == null)
        {
            newParam = new Parameter(level, multivalEncode(alias));
        }
        else
        {
            newParam = new Parameter(level,
                    levelParam.getValue() + "," + multivalEncode(alias));
            _parameters.removeParameters(level);
        }

        _parameters.set(newParam);

        if (count > 1)
            _parameters.set(
                    new Parameter("count." + alias, Integer.toString(count)));

        if (DEBUG) _log.debug("Added new attribute to fetch request; type: "
                              + typeUri + " alias: " + alias + " count: "
                              + count + " required: " + required);
    }
View Full Code Here

     */
    public void setCount(String alias, int count)
    {
        if (count > 1)
            _parameters.set(
                    new Parameter("count." + alias, Integer.toString(count)));
    }
View Full Code Here

TOP

Related Classes of org.openid4java.message.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.