Class USDU
java.lang.Object
edu.internet2.middleware.grouper.app.usdu.USDU
The Unresolvable Subject Deletion Utility finds and optionally deletes
members whose subjects can not be resolved by their source.
Documentation is available via the 'Unresolvable Subject Deletion Utility' on
the Grouper Product wiki
https://spaces.internet2.edu/pages/viewpage.action?pageId=14517820
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
deleteUnresolvableMember
(Member member, AttributeDef attributeDef, Privilege privilege) Revoke unresolvable member's privilege from attribute def.static void
deleteUnresolvableMember
(Member member, Group group, Field field) Delete unresolvable member from group and field.static void
deleteUnresolvableMember
(Member member, Group group, Privilege privilege) Revoke unresolvable member's privilege from group.static void
deleteUnresolvableMember
(Member member, Stem stem, Privilege privilege) Revoke unresolvable member's privilege from stem.protected static Set<Membership>
getAllImmediateMemberships
(Member member, Set<Field> fields) Get memberships for a member for the given fields.protected static String
Return the identifier of theGrouperSourceAdapter/code>, probably but not definitely 'g:gsa'.
Get fields of which a subject might be a member.protected static Privilege
getPrivilege
(Field field) Map fields to privileges.getUnresolvableMembers
(GrouperSession s, Source source) Deprecated.getUnresolvableMembers
(GrouperSession s, Source source, Map<String, Subject> memberIdToSubjectMap) Deprecated.protected static Subject
getUSDUSubject
(Member member) Return a subject suitable for deleting membership and privileges.static boolean
isMemberResolvable
(GrouperSession s, Member member) Check if this member's subject can be found in a source.static boolean
isMemberResolvable
(GrouperSession s, Member member, Map<String, Subject> memberIdToSubjectMap) Check if this member's subject can be found in a source.static void
resolveMember
(GrouperSession s, String uuid, boolean delete) Deprecated.static void
resolveMembers
(GrouperSession s, boolean delete) Deprecated.static void
resolveMembers
(GrouperSession s, Source source, boolean delete) Deprecated.protected static void
resolveMembers
(Set<Member> unresolvables, boolean delete) Deprecated.
-
Constructor Details
-
USDU
public USDU()
-
-
Method Details
-
resolveMember
public static void resolveMember(GrouperSession s, String uuid, boolean delete) throws IllegalArgumentException, InsufficientPrivilegeException, GroupNotFoundException, MemberDeleteException, MemberNotFoundException, RevokePrivilegeException, SchemaException, SourceUnavailableException, StemNotFoundException Deprecated.Deprecated - USDU is now run using the daemon and doesn't call this method Find and optionally delete memberships and privileges for the unresolvable subject with given member uuid.- Parameters:
s
- the Grouper sessionuuid
- the uuid of the memberdelete
- if true will delete memberships and privileges- Throws:
IllegalArgumentException
InsufficientPrivilegeException
GroupNotFoundException
MemberDeleteException
MemberNotFoundException
RevokePrivilegeException
SchemaException
SourceUnavailableException
StemNotFoundException
-
resolveMembers
public static void resolveMembers(GrouperSession s, boolean delete) throws IllegalArgumentException, InsufficientPrivilegeException, GroupNotFoundException, MemberDeleteException, MemberNotFoundException, RevokePrivilegeException, SchemaException, SourceUnavailableException, StemNotFoundException Deprecated.Deprecated - USDU is now run using the daemon and doesn't call this method Find and optionally delete memberships and privileges for unresolvable subjects from all sources.- Parameters:
s
- the Grouper sessiondelete
- if true will delete memberships and privileges- Throws:
IllegalArgumentException
InsufficientPrivilegeException
GroupNotFoundException
MemberDeleteException
MemberNotFoundException
RevokePrivilegeException
SchemaException
SourceUnavailableException
StemNotFoundException
-
resolveMembers
public static void resolveMembers(GrouperSession s, Source source, boolean delete) throws IllegalArgumentException, InsufficientPrivilegeException, GroupNotFoundException, MemberDeleteException, MemberNotFoundException, RevokePrivilegeException, SchemaException, SourceUnavailableException, StemNotFoundException Deprecated.Deprecated - USDU is now run using the daemon and doesn't call this method Find and optionally delete memberships and privileges for unresolvable subjects from the specified source.- Parameters:
s
- the Grouper sessionsource
-delete
- if true will delete memberships and privileges- Throws:
IllegalArgumentException
InsufficientPrivilegeException
GroupNotFoundException
MemberDeleteException
MemberNotFoundException
RevokePrivilegeException
SchemaException
SourceUnavailableException
StemNotFoundException
-
resolveMembers
protected static void resolveMembers(Set<Member> unresolvables, boolean delete) throws IllegalArgumentException, InsufficientPrivilegeException, GroupNotFoundException, MemberDeleteException, MemberNotFoundException, RevokePrivilegeException, SchemaException, SourceUnavailableException, StemNotFoundException Deprecated.Deprecated - USDU is now run using the daemon and doesn't call this method Print to stdout and optionally delete memberships and privileges for the given unresolvable subjects.- Parameters:
unresolvables
- a set of unresolvable membersdelete
- if true will delete memberships and privileges- Throws:
IllegalArgumentException
InsufficientPrivilegeException
GroupNotFoundException
MemberDeleteException
MemberNotFoundException
RevokePrivilegeException
SchemaException
SourceUnavailableException
StemNotFoundException
-
getAllImmediateMemberships
protected static Set<Membership> getAllImmediateMemberships(Member member, Set<Field> fields) throws SchemaException Get memberships for a member for the given fields.- Parameters:
member
-fields
- a set of 'list' fields- Returns:
- a set of memberships
- Throws:
SchemaException
-
deleteUnresolvableMember
public static void deleteUnresolvableMember(Member member, Group group, Field field) throws IllegalArgumentException, InsufficientPrivilegeException, MemberDeleteException, SourceUnavailableException, SchemaException Delete unresolvable member from group and field.- Parameters:
member
-group
-field
-- Throws:
IllegalArgumentException
InsufficientPrivilegeException
MemberDeleteException
SourceUnavailableException
SchemaException
-
deleteUnresolvableMember
public static void deleteUnresolvableMember(Member member, Group group, Privilege privilege) throws IllegalArgumentException, InsufficientPrivilegeException, RevokePrivilegeException, SchemaException, SourceUnavailableException Revoke unresolvable member's privilege from group.- Parameters:
member
-group
-privilege
-- Throws:
IllegalArgumentException
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
SourceUnavailableException
-
deleteUnresolvableMember
public static void deleteUnresolvableMember(Member member, Stem stem, Privilege privilege) throws IllegalArgumentException, InsufficientPrivilegeException, RevokePrivilegeException, SchemaException, SourceUnavailableException Revoke unresolvable member's privilege from stem.- Parameters:
member
-stem
-privilege
-- Throws:
IllegalArgumentException
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
SourceUnavailableException
-
deleteUnresolvableMember
public static void deleteUnresolvableMember(Member member, AttributeDef attributeDef, Privilege privilege) throws IllegalArgumentException, InsufficientPrivilegeException, RevokePrivilegeException, SchemaException, SourceUnavailableException Revoke unresolvable member's privilege from attribute def.- Parameters:
member
-attributeDef
-privilege
-- Throws:
IllegalArgumentException
InsufficientPrivilegeException
RevokePrivilegeException
SchemaException
SourceUnavailableException
-
getUSDUSubject
protected static Subject getUSDUSubject(Member member) throws IllegalArgumentException, SourceUnavailableException Return a subject suitable for deleting membership and privileges.- Parameters:
member
-- Returns:
- a contrived subject
- Throws:
IllegalArgumentException
SourceUnavailableException
-
getGrouperSourceAdapterId
Return the identifier of theGrouperSourceAdapter/code>, probably but not definitely 'g:gsa'.
- Returns:
- the GrouperSourceAdapter identifier
-
getMemberFields
Get fields of which a subject might be a member. Includes all fields of type FieldType.LIST, FieldType.ACCESS, and FieldType.NAMING.- Returns:
- set of fields
- Throws:
SchemaException
-
getPrivilege
Map fields to privileges.- Parameters:
field
-- Returns:
- the privilege matching the given field or null
-
getUnresolvableMembers
Deprecated.Deprecated - USDU is now run using the daemon and doesn't call this method Find members whose subjects can not be found by their source.- Parameters:
s
- GrouperSessionsource
- if null will find members from all sources- Returns:
- unresolvable members
-
getUnresolvableMembers
public static Set<Member> getUnresolvableMembers(GrouperSession s, Source source, Map<String, Subject> memberIdToSubjectMap) Deprecated.Deprecated - USDU is now run using the daemon and doesn't call this method Find members whose subjects can not be found by their source.- Parameters:
s
- GrouperSessionsource
- if null will find members from all sourcesmemberIdToSubjectMap
- if you'd like this map filled with subjects as they are resolved- Returns:
- unresolvable members
-
isMemberResolvable
Check if this member's subject can be found in a source.- Parameters:
s
-member
-- Returns:
- Boolean true if member's subject is found in source
-
isMemberResolvable
public static boolean isMemberResolvable(GrouperSession s, Member member, Map<String, Subject> memberIdToSubjectMap) Check if this member's subject can be found in a source.- Parameters:
s
-member
-memberIdToSubjectMap
- if you'd like this map filled with subjects as they are resolved- Returns:
- Boolean true if member's subject is found in source
-