FetchRequest fetchRequest = FetchRequest.createFetchRequest(); for (OpenIDAttribute attr : attributesToFetch) { if (logger.isDebugEnabled()) { + " to fetch request"); fetchRequest.addAttribute(attr.getName(), attr.getType(), attr.isRequired(), attr.getCount());
/** * Gets all requested attributes (required and optional). * * @return Map of attribute aliases -> attribute type URIs. */ public Map getAttributes() { Map attributes = getAttributes(true); attributes.putAll(getAttributes(false)); return attributes; }
/** * Constructs a Fetch Request with an empty parameter list. */ public static FetchRequest createFetchRequest() { return new FetchRequest(); }
/** * Adds an attribute to the fetch request, with a default value-count of 1. * An alias is generated for the provided type URI. * * @see #addAttribute(String, String, boolean, int) */ public String addAttribute(String typeUri, boolean required) throws MessageException { String alias = generateAlias(); addAttribute(alias, typeUri, required, 1); return alias; }
protected String authRequest(String userSuppliedString, String returnToUrl) throws IOException { ... // Attribute Exchange example: fetching the 'email' attribute FetchRequest fetch = FetchRequest.createFetchRequest(); fetch.addAttribute("email", "http://schema.openid.net/contact/email", // type URI true); // required
return FetchRequest.createFetchRequest(parameterList);
Map attributes = req.getAttributes(); int max = req.getCount(alias); int count; for (count = 0; count < max && values.hasNext(); count++) {
/** * Constructs a FetchRequest from a parameter list. * <p> * The parameter list can be extracted from a received message with the * getExtensionParams method of the Message class, and MUST NOT contain * the "openid.<extension_alias>." prefix. */ public static FetchRequest createFetchRequest(ParameterList params) throws MessageException { FetchRequest req = new FetchRequest(params); if (! req.isValid()) throw new MessageException("Invalid parameters for a fetch request"); if (DEBUG) _log.debug("Created fetch request from parameter list:\n" + params); return req; }
if (! checkCount(alias)) return false; if (! checkCount(alias)) return false;
/** * Adds an attribute to the fetch request, with a default value-count of 1. * An alias is generated for the provided type URI. * * @see #addAttribute(String, String, boolean, int) */ public String addAttribute(String typeUri, boolean required) throws MessageException { String alias = generateAlias(); addAttribute(alias, typeUri, required, 1); return alias; }
/** * Adds an attribute to the fetch request, with a default value-count of 1. * * @see #addAttribute(String, String, boolean, int) */ public void addAttribute(String alias, String typeUri, boolean required) throws MessageException { addAttribute(alias, typeUri, required, 1); }
return FetchRequest.createFetchRequest(parameterList); } else if ("fetch_response".equals(axMode)) { return FetchResponse.createFetchResponse(parameterList);
Map attributes = req.getAttributes(); int max = req.getCount(alias); if (max == 0) max = ((List)values).size();
/** * Constructs a FetchRequest from a parameter list. * <p> * The parameter list can be extracted from a received message with the * getExtensionParams method of the Message class, and MUST NOT contain * the "openid.<extension_alias>." prefix. */ public static FetchRequest createFetchRequest(ParameterList params) throws MessageException { FetchRequest req = new FetchRequest(params); if (! req.isValid()) throw new MessageException("Invalid parameters for a fetch request"); if (DEBUG) _log.debug("Created fetch request from parameter list:\n" + params); return req; }
if (!checkCount(alias)) { return false; if (!checkCount(alias)) { return false;
FetchRequest fetch = FetchRequest.createFetchRequest(); fetch.addAttribute("emailax", "http://axschema.org/contact/email", true); fetch.addAttribute("firstnameax", "http://axschema.org/namePerson/first", true); fetch.addAttribute("lastnameax", "http://axschema.org/namePerson/last", true); fetch.addAttribute("fullnameax", "http://axschema.org/namePerson", true); fetch.addAttribute("email", "http://schema.openid.net/contact/email", true); fetch.addAttribute("firstname", "http://schema.openid.net/namePerson/first", true); fetch.addAttribute("lastname", "http://schema.openid.net/namePerson/last", true); fetch.addAttribute("fullname", "http://schema.openid.net/namePerson", true);
/** * Adds an attribute to the fetch request, with a default value-count of 1. * An alias is generated for the provided type URI. * * @see #addAttribute(String, String, boolean, int) */ public String addAttribute(String typeUri, boolean required) throws MessageException { String alias = generateAlias(); addAttribute(alias, typeUri, required, 1); return alias; }
/** * Adds an attribute to the fetch request, with a default value-count of 1. * * @see #addAttribute(String, String, boolean, int) */ public void addAttribute(String alias, String typeUri, boolean required) throws MessageException { addAttribute(alias, typeUri, required, 1); }
return FetchRequest.createFetchRequest(parameterList);
/** * Gets all requested attributes (required and optional). * * @return Map of attribute aliases -> attribute type URIs. */ public Map getAttributes() { Map attributes = getAttributes(true); attributes.putAll(getAttributes(false)); return attributes; }