Class GrouperLoaderResultset
java.lang.Object
edu.internet2.middleware.grouper.app.loader.db.GrouperLoaderResultset
encapsulate a resultset into this resultset to be case-insensitive and
column-order insensitive
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
ConstructorDescriptionGrouperLoaderResultset
(GrouperLoaderDb grouperLoaderDb, String query, String jobName, Hib3GrouperLoaderLog hib3GrouperLoaderLog) get a resultset based on a db and queryGrouperLoaderResultset
(GrouperLoaderResultset parentResultSet, String groupName) get a resultset on another resultset and a group nameGrouperLoaderResultset
(String ldapServerId, String filter, String searchDn, String subjectAttribute, String sourceId, String subjectIdType, String ldapSearchScope, String jobName, Hib3GrouperLoaderLog hib3GrouperLoaderLog, String ldapSubjectExpression) get a resultset based on an ldap server and filter -
Method Summary
Modifier and TypeMethodDescriptionvoid
assertColumnName
(String columnName) make sure this column name is herevoid
if we should bulk lookup subjects to add/removeint
columnIndex
(String columnNameInput) find a column index in the resultsetint
columnIndex
(String columnNameInput, boolean throwErrorIfNotFound) find a column index in the resultsetfind
(String subjectId, String subjectSourceId, String subjectIdentifier0, String subjectIdentifier1, String subjectIdentifier2) find a row and returnget a cell in the data structurereturn the column namesgetLdapMembershipsForLdapGroupsFromAttributes
(String ldapServerId, String filter, String searchDn, String subjectAttributeName, String groupAttributeName, String sourceId, String subjectIdType, String ldapSearchScope, Hib3GrouperLoaderLog hib3GrouperLoaderLog, String overallGroupName, String subjectExpression, String extraAttributes, String groupNameExpression, String groupDisplayNameExpression, String groupDescriptionExpression, Map<String, String> groupNameToDisplayName, Map<String, String> groupNameToDescription, String ldapAttributeFilterExpression, String subjectIdIfIncremental, String resultsTransformationClass) get a set of group namesstatic boolean
groupParentFolderNameIsRoot
(String overallGroupName, String groupName) This is going to end with a colon.boolean
hasColumnName
(String columnName) make sure this column name is herevoid
initForLdapGroupsFromAttributes
(String ldapServerId, String filter, String searchDn, String subjectAttributeName, String groupAttributeName, String sourceId, String subjectIdType, String ldapSearchScope, String jobName, Hib3GrouperLoaderLog hib3GrouperLoaderLog, String subjectExpression, String extraAttributes, String groupNameExpression, String groupDisplayNameExpression, String groupDescriptionExpression, Map<String, String> groupNameToDisplayName, Map<String, String> groupNameToDescription, String ldapAttributeFilterExpression, String resultsTransformationClass) get a resultset based on an ldap server and filter for ldap list of groupsvoid
initForLdapListOfGroups
(String ldapServerId, String filter, String searchDn, String subjectAttributeName, String sourceId, String subjectIdType, String ldapSearchScope, String jobName, Hib3GrouperLoaderLog hib3GrouperLoaderLog, String subjectExpression, String extraAttributes, String groupNameExpression, String groupDisplayNameExpression, String groupDescriptionExpression, Map<String, String> groupNameToDisplayName, Map<String, String> groupNameToDescription, Set<String> groupNames) get a resultset based on an ldap server and filter for ldap list of groupsstatic void
int
return the number of rowsvoid
remove
(int i) remove by row indexvoid
remove by rowretrieveRow
(int i) find a certain row
-
Field Details
-
SUBJECT_ID_COL
- See Also:
-
SUBJECT_IDENTIFIER_COL
- See Also:
-
SUBJECT_ID_OR_IDENTIFIER_COL
- See Also:
-
ACTION_NAME_COL
- See Also:
-
GROUP_NAME_COL
- See Also:
-
GROUP_DISPLAY_NAME_COL
- See Also:
-
GROUP_DESCRIPTION_COL
- See Also:
-
GROUP_VIEWERS_COL
- See Also:
-
GROUP_READERS_COL
- See Also:
-
GROUP_UPDATERS_COL
- See Also:
-
GROUP_ADMINS_COL
- See Also:
-
ATTR_NAME_COL
- See Also:
-
ATTR_DISPLAY_NAME_COL
- See Also:
-
ATTR_DESCRIPTION_COL
- See Also:
-
IF_HAS_ATTR_NAME_COL
- See Also:
-
THEN_HAS_ATTR_NAME_COL
- See Also:
-
IF_HAS_ACTION_NAME_COL
- See Also:
-
THEN_HAS_ACTION_NAME_COL
- See Also:
-
GROUP_OPTINS_COL
- See Also:
-
GROUP_OPTOUTS_COL
- See Also:
-
GROUP_ATTR_READERS_COL
- See Also:
-
GROUP_ATTR_UPDATERS_COL
- See Also:
-
SUBJECT_SOURCE_ID_COL
- See Also:
-
-
Constructor Details
-
GrouperLoaderResultset
get a resultset on another resultset and a group name- Parameters:
parentResultSet
-groupName
-
-
GrouperLoaderResultset
public GrouperLoaderResultset(GrouperLoaderDb grouperLoaderDb, String query, String jobName, Hib3GrouperLoaderLog hib3GrouperLoaderLog) get a resultset based on a db and query- Parameters:
grouperLoaderDb
-query
-jobName
-hib3GrouperLoaderLog
-
-
GrouperLoaderResultset
public GrouperLoaderResultset(String ldapServerId, String filter, String searchDn, String subjectAttribute, String sourceId, String subjectIdType, String ldapSearchScope, String jobName, Hib3GrouperLoaderLog hib3GrouperLoaderLog, String ldapSubjectExpression) get a resultset based on an ldap server and filter- Parameters:
ldapServerId
- server id in grouper-loader.propertiesfilter
- ldap filter querysearchDn
- place in ldap where search starts fromsubjectAttribute
- attribute where the subjectId, or subjectIdentifier, or subjectIdOrIdentifier issourceId
- if all subjects come from one source, put the sourceId heresubjectIdType
- the type of the subjectId, either: subjectId, subjectIdentifier, or subjectIdOrIdentifierldapSearchScope
- either OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPEjobName
- for logging if problemhib3GrouperLoaderLog
-ldapSubjectExpression
-
-
GrouperLoaderResultset
public GrouperLoaderResultset()
-
-
Method Details
-
main
- Parameters:
args
-
-
bulkLookupSubjects
public void bulkLookupSubjects()if we should bulk lookup subjects to add/remove -
groupNames
get a set of group names- Returns:
- the set of names, never null
-
initForLdapListOfGroups
public void initForLdapListOfGroups(String ldapServerId, String filter, String searchDn, String subjectAttributeName, String sourceId, String subjectIdType, String ldapSearchScope, String jobName, Hib3GrouperLoaderLog hib3GrouperLoaderLog, String subjectExpression, String extraAttributes, String groupNameExpression, String groupDisplayNameExpression, String groupDescriptionExpression, Map<String, String> groupNameToDisplayName, Map<String, String> groupNameToDescription, Set<String> groupNames) get a resultset based on an ldap server and filter for ldap list of groups- Parameters:
ldapServerId
- server id in grouper-loader.propertiesfilter
- ldap filter querysearchDn
- place in ldap where search starts fromsubjectAttributeName
- attribute where the subjectId, or subjectIdentifier, or subjectIdOrIdentifier issourceId
- if all subjects come from one source, put the sourceId heresubjectIdType
- the type of the subjectId, either: subjectId, subjectIdentifier, or subjectIdOrIdentifierldapSearchScope
- either OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPEjobName
- for logging if problemhib3GrouperLoaderLog
-subjectExpression
-extraAttributes
-groupNameExpression
-groupDisplayNameExpression
-groupDescriptionExpression
-groupNameToDisplayName
- map to translate group name to display namegroupNameToDescription
- map to translate group name to descriptiongroupNames
- keep track of which group names there are
-
initForLdapGroupsFromAttributes
public void initForLdapGroupsFromAttributes(String ldapServerId, String filter, String searchDn, String subjectAttributeName, String groupAttributeName, String sourceId, String subjectIdType, String ldapSearchScope, String jobName, Hib3GrouperLoaderLog hib3GrouperLoaderLog, String subjectExpression, String extraAttributes, String groupNameExpression, String groupDisplayNameExpression, String groupDescriptionExpression, Map<String, String> groupNameToDisplayName, Map<String, String> groupNameToDescription, String ldapAttributeFilterExpression, String resultsTransformationClass) get a resultset based on an ldap server and filter for ldap list of groups- Parameters:
ldapServerId
- server id in grouper-loader.propertiesfilter
- ldap filter querysearchDn
- place in ldap where search starts fromsubjectAttributeName
- attribute where the subjectId, or subjectIdentifier, or subjectIdOrIdentifier isgroupAttributeName
- attribute (e.g. affiliation) of subject which holds link to groupsourceId
- if all subjects come from one source, put the sourceId heresubjectIdType
- the type of the subjectId, either: subjectId, subjectIdentifier, or subjectIdOrIdentifierldapSearchScope
- either OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPEjobName
- for logging if problemhib3GrouperLoaderLog
-subjectExpression
-extraAttributes
-groupNameExpression
-groupDisplayNameExpression
-groupDescriptionExpression
-groupNameToDisplayName
- map to translate group name to display namegroupNameToDescription
- map to translate group name to descriptionldapAttributeFilterExpression
- if specified, this will filter the attributes that are turned into groups, should return true or falseresultsTransformationClass
-
-
getLdapMembershipsForLdapGroupsFromAttributes
public static Map<String,List<String>> getLdapMembershipsForLdapGroupsFromAttributes(String ldapServerId, String filter, String searchDn, String subjectAttributeName, String groupAttributeName, String sourceId, String subjectIdType, String ldapSearchScope, Hib3GrouperLoaderLog hib3GrouperLoaderLog, String overallGroupName, String subjectExpression, String extraAttributes, String groupNameExpression, String groupDisplayNameExpression, String groupDescriptionExpression, Map<String, String> groupNameToDisplayName, Map<String, String> groupNameToDescription, String ldapAttributeFilterExpression, String subjectIdIfIncremental, String resultsTransformationClass) - Parameters:
ldapServerId
-filter
-searchDn
-subjectAttributeName
-groupAttributeName
-sourceId
-subjectIdType
-ldapSearchScope
-jobName
-hib3GrouperLoaderLog
-overallGroupName
-subjectExpression
-extraAttributes
-groupNameExpression
-groupDisplayNameExpression
-groupDescriptionExpression
-groupNameToDisplayName
-groupNameToDescription
-ldapAttributeFilterExpression
-subjectIdIfIncremental
-resultsTransformationClass
-- Returns:
- map of memberships
-
groupParentFolderNameIsRoot
This is going to end with a colon.- Parameters:
requireTopStemAsStemFromConfigGroup
-overallGroupName
-groupName
-- Returns:
-
columnIndex
find a column index in the resultset- Parameters:
columnNameInput
-- Returns:
- the column index
-
columnIndex
find a column index in the resultset- Parameters:
columnNameInput
-throwErrorIfNotFound
- if should throw error if not found- Returns:
- the column index or -1 if not found or exception
-
retrieveRow
find a certain row- Parameters:
i
-- Returns:
- the row
-
numberOfRows
public int numberOfRows()return the number of rows- Returns:
- the number of rows
-
getColumnNames
return the column names- Returns:
- the column names
-
getCell
get a cell in the data structure- Parameters:
rowIndex
-columnName
-exceptionOnColNotFound
-- Returns:
- the cell or null if col not found and not throwing exception if col not found
-
assertColumnName
make sure this column name is here- Parameters:
columnName
-
-
hasColumnName
make sure this column name is here- Parameters:
columnName
-- Returns:
- true if the column is there
-
remove
remove by row- Parameters:
row
-
-
remove
public void remove(int i) remove by row index- Parameters:
i
-
-
find
public GrouperLoaderResultset.Row find(String subjectId, String subjectSourceId, String subjectIdentifier0, String subjectIdentifier1, String subjectIdentifier2) find a row and return- Parameters:
subjectId
-subjectSourceId
-subjectIdentifier0
-subjectIdentifier1
-subjectIdentifier2
-- Returns:
- row if found, else null
-