/** * Get the group's name, or a suitable facsimile if not named. * * @param group the {@link EntitiesDescriptor} * * @return a suitable name to use for logging */ @Nonnull @NotEmpty protected String getGroupName(@Nonnull final EntitiesDescriptor group) { String name = group.getName(); if (name != null) { return name; } name = group.getID(); if (name != null) { return name; } return "(unnamed)"; }
if (Direction.EXCLUDE.equals(direction) == condition.apply(entityDescriptor)) { log.trace("Filtering out entity {} from group {}", entityDescriptor.getEntityID(), descriptor.getName()); emptyEntityDescriptors.add(entityDescriptor); log.trace("Filtering out empty group {} from group {}", entitiesDescriptor.getName(), descriptor.getName()); emptyEntitiesDescriptors.add(entitiesDescriptor);
rawResult = Collections.singleton(((EntityDescriptor)input).getEntityID()); } else if (input instanceof EntitiesDescriptor) { rawResult = Collections.singleton(((EntitiesDescriptor)input).getName()); } else if (input instanceof RoleDescriptor) { XMLObject parent = input.getParent();
/** * Create a CAS {@link Service} from an input service URL and the matching {@link EntityDescriptor} that was * resolved from the metadata source. * * @param serviceURL CAS service URL. * @param entity Entity resolved from metadata. * * @return CAS service created from inputs. */ @Nonnull protected Service create(@Nonnull final String serviceURL, @Nonnull final EntityDescriptor entity) { final XMLObject parent = entity.getParent(); final Service service = new Service( serviceURL, parent instanceof EntitiesDescriptor ? ((EntitiesDescriptor) parent).getName() : "unknown", isAuthorizedToProxy(entity), hasSingleLogoutService(entity)); service.setEntityDescriptor(entity); return service; }
if (entityRoles == null || entityRoles.isEmpty()) { log.trace("Filtering out entity descriptor {} from entity group {}", entityDescriptor .getEntityID(), descriptor.getName()); emptyEntityDescriptors.add(entityDescriptor); .getEntitiesDescriptors().isEmpty())) { log.trace("Filtering out entity descriptor {} from entity group {}", entitiesDescriptor .getName(), descriptor.getName()); emptyEntitiesDescriptors.add(entitiesDescriptor);
/** {@inheritDoc} */ @Override public void process(XMLObject metadataNode) throws FilterException { if (metadataNode instanceof EntityDescriptor) { XMLObject currentParent = metadataNode.getParent(); while (currentParent != null) { if (currentParent instanceof EntitiesDescriptor) { String name = StringSupport.trimOrNull(((EntitiesDescriptor)currentParent).getName()); if (name != null) { if (log.isTraceEnabled()) { log.trace("Attaching EntityGroupName '{}' to EntityDescriptor: {}", name, ((EntityDescriptor)metadataNode).getEntityID()); } metadataNode.getObjectMetadata().put(new EntityGroupName(name)); } } currentParent = currentParent.getParent(); } } }