public class EntityRoleFilter extends Object implements MetadataFilter
Modifier and Type | Field and Description |
---|---|
private QName |
extRoleDescriptor
QName of extension role element.
|
private org.slf4j.Logger |
log
Class logger.
|
private boolean |
removeEmptyEntitiesDescriptors
Whether to keep entities descriptors that contain no entity descriptors; default value: true.
|
private boolean |
removeRolelessEntityDescriptors
Whether to keep entity descriptors that contain no roles; default value: true.
|
private List<QName> |
roleWhiteList
List of roles that are NOT removed by this filter.
|
Constructor and Description |
---|
EntityRoleFilter(List<QName> keptRoles)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
org.opensaml.core.xml.XMLObject |
filter(org.opensaml.core.xml.XMLObject metadata) |
protected void |
filterEntitiesDescriptor(EntitiesDescriptor descriptor)
Filters
EntitiesDescriptor . |
protected void |
filterEntityDescriptor(EntityDescriptor descriptor)
Filters entity descriptor roles.
|
boolean |
getRemoveEmptyEntitiesDescriptors()
Get whether to remove an entities descriptor if it does not contain any entity descriptor or entities
descriptors.
|
boolean |
getRemoveRolelessEntityDescriptors()
Get whether to remove an entity descriptor if it does not contain any roles after filtering.
|
protected QName |
getRoleName(RoleDescriptor role)
Gets the effective name for the role.
|
List<QName> |
getRoleWhiteList()
Get the unmodifiable list of roles that are NOT removed by this filter.
|
void |
setRemoveEmptyEntitiesDescriptors(boolean remove)
Set whether to remove an entities descriptor if it does not contain any entity descriptor or entities
descriptors.
|
void |
setRemoveRolelessEntityDescriptors(boolean remove)
Set whether to remove an entity descriptor if it does not contain any roles after filtering.
|
@Nonnull private final org.slf4j.Logger log
@Nonnull @NonnullElements private List<QName> roleWhiteList
private boolean removeRolelessEntityDescriptors
private boolean removeEmptyEntitiesDescriptors
@Nonnull @NonnullElements @Unmodifiable @NotLive public List<QName> getRoleWhiteList()
public boolean getRemoveRolelessEntityDescriptors()
public void setRemoveRolelessEntityDescriptors(boolean remove)
remove
- whether to remove an entity descriptor if it does not contain any roles after filteringpublic boolean getRemoveEmptyEntitiesDescriptors()
public void setRemoveEmptyEntitiesDescriptors(boolean remove)
remove
- whether to remove an entities descriptor if it does not contain any entity descriptor or entities
descriptors@Nullable public org.opensaml.core.xml.XMLObject filter(@Nullable org.opensaml.core.xml.XMLObject metadata) throws FilterException
filter
in interface MetadataFilter
FilterException
protected void filterEntitiesDescriptor(@Nonnull EntitiesDescriptor descriptor) throws FilterException
EntitiesDescriptor
.descriptor
- entities descriptor to filterFilterException
- thrown if an effective role name can not be determinedprotected void filterEntityDescriptor(@Nonnull EntityDescriptor descriptor) throws FilterException
descriptor
- entity descriptor to filterFilterException
- thrown if an effective role name can not be determinedprotected QName getRoleName(@Nonnull RoleDescriptor role) throws FilterException
role
- role to get the effective name forFilterException
- thrown if the effective role name can not be determinedCopyright © 1999–2020 Shibboleth Consortium. All rights reserved.