/** {@inheritDoc} */ protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject) throws UnmarshallingException { AttributeConsumingService service = (AttributeConsumingService) parentSAMLObject; if (childSAMLObject instanceof ServiceName) { service.getNames().add((ServiceName) childSAMLObject); } else if (childSAMLObject instanceof ServiceDescription) { service.getDescriptions().add((ServiceDescription) childSAMLObject); } else if (childSAMLObject instanceof RequestedAttribute) { service.getRequestAttributes().add((RequestedAttribute) childSAMLObject); } else { super.processChildElement(parentSAMLObject, childSAMLObject); } }
/** * Look for an <AttributeConsumeService> and if its there look for an appropriate name. * * @param lang - which language to look up * @return null or an appropriate name */ @Nullable protected String getNameFromAttributeConsumingService(final String lang) { if (null == getRPAttributeConsumingService()) { return null; } for (final ServiceName name : getRPAttributeConsumingService().getNames()) { log.trace("Found name in AttributeConsumingService, language '{}'", name.getXMLLang()); if (name.getXMLLang() != null && name.getXMLLang().equals(lang)) { log.debug("Returning name from AttributeConsumingService '{}'", name.getValue()); return name.getValue(); } } log.trace("No name found in AttributeConsumingService for '{}'", lang); return null; }