/** * Select the service based on the index value. * * @param candidates the list of candiate services * @return the selected candidate or null */ private AttributeConsumingService selectByIndex(List<AttributeConsumingService> candidates) { log.debug("Selecting AttributeConsumingService by index"); for (AttributeConsumingService attribCS : candidates) { // Check for null b/c don't ever want to fail with an NPE due to autoboxing. // Note: metadata index property is an int, not an Integer. if (index != null) { if (index == attribCS.getIndex()) { log.debug("Selected AttributeConsumingService with index: {}", index); return attribCS; } } } log.debug("A service index of '{}' was specified, but was not found in metadata", index); return null; }
/** {@inheritDoc} */ protected void marshallAttributes(XMLObject samlObject, Element domElement) throws MarshallingException { AttributeConsumingService service = (AttributeConsumingService) samlObject; domElement.setAttributeNS(null, AttributeConsumingService.INDEX_ATTRIB_NAME, Integer.toString(service .getIndex())); if (service.isDefaultXSBoolean() != null) { domElement.setAttributeNS(null, AttributeConsumingService.IS_DEFAULT_ATTRIB_NAME, service .isDefaultXSBoolean().toString()); } } }
log.debug("{} Request specified AttributeConsumingService index {}", getLogPrefix(), index); for (final AttributeConsumingService acsEntry : ssoDescriptor.getAttributeConsumingServices()) { if (index.intValue() == acsEntry.getIndex()) { acs = acsEntry; break; log.debug("{} Selected AttributeConsumingService with index {}", getLogPrefix(), acs.getIndex()); metadataContext.getSubcontext( AttributeConsumingServiceContext.class, true).setAttributeConsumingService(acs);