/** * Returns Single logout service for given binding of the IDP. * * @param descriptor IDP to search for service in * @param binding binding supported by the service * @return SSO service capable of handling the given binding * @throws MetadataProviderException if the service can't be determined */ public static SingleLogoutService getLogoutServiceForBinding(SSODescriptor descriptor, String binding) throws MetadataProviderException { List<SingleLogoutService> services = descriptor.getSingleLogoutServices(); for (SingleLogoutService service : services) { if (binding.equals(service.getBinding())) { return service; } } log.debug("No binding found for IDP with binding " + binding); throw new MetadataProviderException("Binding " + binding + " is not supported for this IDP"); }
/** {@inheritDoc} */ protected void processChildElement(XMLObject parentElement, XMLObject childElement) throws UnmarshallingException { SSODescriptor descriptor = (SSODescriptor) parentElement; if (childElement instanceof ArtifactResolutionService) { descriptor.getArtifactResolutionServices().add((ArtifactResolutionService) childElement); } else if (childElement instanceof SingleLogoutService) { descriptor.getSingleLogoutServices().add((SingleLogoutService) childElement); } else if (childElement instanceof ManageNameIDService) { descriptor.getManageNameIDServices().add((ManageNameIDService) childElement); } else if (childElement instanceof NameIDFormat) { descriptor.getNameIDFormats().add((NameIDFormat) childElement); } else { super.processChildElement(parentElement, childElement); } } }