|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensaml.saml2.metadata.provider.EntityRoleFilter
public class EntityRoleFilter
A filter the removes roles, from an entity descriptor. For those roles specified within the SAML metadata specification the role element QName is used to identify the role. For other roles, those that appear as <RoleDescriptor xsi:type="someRoleType"> the role schema type is used to identify the role. If the entity descriptor does not contain any roles after filter it may, optionally be removed as well. If the root element of the metadata document is an entity descriptor it will never be removed, regardless of of whether it still contains roles. If and entities descriptor does not contains any entity descriptors after filter it may, optionally, be removed as well. If the root element of the metadata document is an entities descriptor it will never be removed, regardless of of whether it still contains entity descriptors.
Field Summary | |
---|---|
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 Summary | |
---|---|
EntityRoleFilter(List<QName> keptRoles)
Constructor. |
Method Summary | |
---|---|
void |
doFilter(XMLObject metadata)
Filters the given metadata, perhaps to remove elements that are not wanted. |
protected void |
filterEntitiesDescriptor(EntitiesDescriptor descriptor)
Filters entities descriptor. |
protected void |
filterEntityDescriptor(EntityDescriptor descriptor)
Filters entity descriptor roles. |
boolean |
getRemoveEmptyEntitiesDescriptors()
Gets whether to remove an entities descriptor if it does not contain any entity descriptor or entities descriptors. |
boolean |
getRemoveRolelessEntityDescriptors()
Gets 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()
Gets the unmodifiable list of roles that are NOT removed by this filter. |
void |
setRemoveEmptyEntitiesDescriptors(boolean remove)
Sets whether to remove an entities descriptor if it does not contain any entity descriptor or entities descriptors. |
void |
setRemoveRolelessEntityDescriptors(boolean remove)
Sets whether to remove an entity descriptor if it does not contain any roles after filtering. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final org.slf4j.Logger log
private List<QName> roleWhiteList
private boolean removeRolelessEntityDescriptors
private boolean removeEmptyEntitiesDescriptors
private final QName extRoleDescriptor
Constructor Detail |
---|
public EntityRoleFilter(List<QName> keptRoles)
keptRoles
- list of roles NOT removed by this filterMethod Detail |
---|
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
descriptorspublic void doFilter(XMLObject metadata) throws FilterException
doFilter
in interface MetadataFilter
metadata
- the metadata to be filtered.
FilterException
- thrown if an error occurs during the filtering processprotected void filterEntitiesDescriptor(EntitiesDescriptor descriptor) throws FilterException
descriptor
- entities descriptor to filter
FilterException
- thrown if an effective role name can not be determinedprotected void filterEntityDescriptor(EntityDescriptor descriptor) throws FilterException
descriptor
- entity descriptor to filter
FilterException
- thrown if an effective role name can not be determinedprotected QName getRoleName(RoleDescriptor role) throws FilterException
role
- role to get the effective name for
FilterException
- thrown if the effective role name can not be determined
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |