/** * Adds the attributes in the supplied Map to the attribute payload. * A requested count of 1 is assumed for each attribute in the map. * * @param attributes Map<String typeURI, String value>. */ public void addAttributes(Map attributes) { String typeUri; Iterator iter = attributes.keySet().iterator(); while (iter.hasNext()) { typeUri = (String) iter.next(); addAttribute(typeUri, (String) attributes.get(typeUri)); } }
/** * Returns a list with the attribute value(s) associated for the specified * attribute type URI. * * @param typeUri The attribute type URI. * @return List of attribute values. */ public List getAttributeValuesByTypeUri(String typeUri) { return getAttributeValues(getAttributeAlias(typeUri)); }
/** * Gets the (first) value for the specified attribute type URI. * * @param typeUri * @return */ public String getAttributeValueByTypeUri(String typeUri) { return getAttributeValue(getAttributeAlias(typeUri)); }
/** * Gets the (first) value for the specified attribute alias. */ public String getAttributeValue(String alias) { return (_parameters.hasParameter("count." + alias) && getCount(alias) > 0) ? getParameterValue("value." + alias + ".1") : getParameterValue("value." + alias); }
"Characters [.,:\\n] are not allowed in attribute aliases: " + alias); int count = getCount(alias); getParameterValue("value." + alias))); _parameters.removeParameters("value." + alias); index = ".2"; setCount(alias, ++count);
private boolean checkAttributes() List aliases = getAttributeAliases(); int count = getCount(alias);
/** * Checks the validity of the extension. * <p/> * Used when constructing a extension from a parameter list. * * @return True if the extension is valid, false otherwise. */ public boolean isValid() { if (!_parameters.hasParameter("mode") || !"store_request".equals(_parameters.getParameterValue("mode"))) { _log.warn("Invalid mode value in store_request: " + _parameters.getParameterValue("mode")); return false; } return super.isValid(); }
protected boolean isValid() { Iterator it = _parameters.getParameters().iterator(); while (it.hasNext()) { String paramName = ((Parameter) it.next()).getKey(); if (!paramName.equals("mode") && !paramName.startsWith("type.") && !paramName.startsWith("count.") && !paramName.startsWith("value.") && !paramName.equals("update_url")) { _log.warn("Invalid parameter name in AX payload: " + paramName); //return false; } } return checkAttributes(); }
/** * Gets a map with attribute aliases -> list of values. */ public Map getAttributes() { Map attributes = new HashMap(); Iterator it = _parameters.getParameters().iterator(); while (it.hasNext()) { String paramName = ((Parameter) it.next()).getKey(); if (paramName.startsWith("type.")) { String alias = paramName.substring(5); if ( ! attributes.containsKey(alias) ) attributes.put(alias, getAttributeValues(alias)); } } return attributes; }
/** * Adds an attribute to the attribute payload, without the caller having to * specify an alias. An alias in the form "attrNN" will be automatically * generated. * * @param typeUri The attribute type URI. * @param value The attribute value. * @return The generated attribute alias. */ public String addAttribute(String typeUri, String value) { String alias = generateAlias(); // not calling the other addAttribute - extra overhead in checks there _parameters.set(new Parameter("type." + alias, typeUri)); _parameters.set(new Parameter("value." + alias, value)); if (DEBUG) { _log.debug("Added new attribute to the AX payload; type: " + typeUri + " alias: " + alias); } return alias; }
int count = getCount(alias); getParameterValue("value." + alias))); _parameters.removeParameters("value." + alias); index = ".2"; setCount(alias, ++count);
/** * Gets the (first) value for the specified attribute alias. */ public String getAttributeValue(String alias) { return (_parameters.hasParameter("count." + alias) && getCount(alias) > 0) ? getParameterValue("value." + alias + ".1") : getParameterValue("value." + alias); }
private boolean checkAttributes() List aliases = getAttributeAliases(); int count = getCount(alias);
/** * Checks the validity of the extension. * <p> * Used when constructing a extension from a parameter list. * * @return True if the extension is valid, false otherwise. */ public boolean isValid() { if ( ! _parameters.hasParameter("mode") || ! "store_request".equals(_parameters.getParameterValue("mode"))) { _log.warn("Invalid mode value in store_request: " + _parameters.getParameterValue("mode")); return false; } return super.isValid(); }
protected boolean isValid() { Iterator it = _parameters.getParameters().iterator(); while (it.hasNext()) { String paramName = ((Parameter) it.next()).getKey(); if (! paramName.equals("mode") && ! paramName.startsWith("type.") && ! paramName.startsWith("count.") && ! paramName.startsWith("value.") && ! paramName.equals("update_url")) { _log.warn("Invalid parameter name in AX payload: " + paramName); //return false; } } return checkAttributes(); }
/** * Gets a map with attribute aliases -> list of values. */ public Map getAttributes() { Map attributes = new HashMap(); Iterator it = _parameters.getParameters().iterator(); while (it.hasNext()) { String paramName = ((Parameter) it.next()).getKey(); if (paramName.startsWith("type.")) { String alias = paramName.substring(5); if ( ! attributes.containsKey(alias) ) attributes.put(alias, getAttributeValues(alias)); } } return attributes; }
/** * Adds an attribute to the attribute payload, without the caller having to * specify an alias. An alias in the form "attrNN" will be automatically * generated. * * @param typeUri The attribute type URI. * @param value The attribute value. * @return The generated attribute alias. */ public String addAttribute(String typeUri, String value) { String alias = generateAlias(); // not calling the other addAttribute - extra overhead in checks there _parameters.set(new Parameter("type." + alias, typeUri)); _parameters.set(new Parameter("value." + alias, value)); if (DEBUG) _log.debug("Added new attribute to the AX payload; type: " + typeUri + " alias: " + alias); return alias; }
"Characters [.,:\\n] are not allowed in attribute aliases: " + alias); int count = getCount(alias); getParameterValue("value." + alias))); _parameters.removeParameters("value." + alias); index = ".2"; setCount(alias, ++count);
/** * Gets the (first) value for the specified attribute alias. */ public String getAttributeValue(String alias) { return (_parameters.hasParameter("count." + alias) && getCount(alias) > 0) ? getParameterValue("value." + alias + ".1") : getParameterValue("value." + alias); }
/** * Returns a list with the attribute value(s) associated for the specified * attribute type URI. * * @param typeUri The attribute type URI. * @return List of attribute values. */ public List getAttributeValuesByTypeUri(String typeUri) { return getAttributeValues(getAttributeAlias(typeUri)); }