public class GrouperSourceAdapter extends BaseSourceAdapter
This is an adapter I2MI Subjects of type group. It allows groups within a Group Groups Registry to be referenced as I2MI Subjects.
To use, add the following to your subject.properties file:
<source adapterClass="edu.internet2.middleware.grouper.GrouperSourceAdapter"> <id>g:gsa</id> <name>Grouper: Grouper Source Adapter</name> <type>group</type> </source>
Modifier and Type | Field and Description |
---|---|
static boolean |
failOnSearchForTesting
for testing if we should fail on testing
|
attributes, descriptionAttributeName, id, internalAttributes, name, nameAttributeName, params, searchAttributes, searches, sortAttributes, subjectIdentifierAttributes, subjectIdentifierAttributesAll, type, types
Constructor and Description |
---|
GrouperSourceAdapter()
Allocates new GrouperSourceAdapter.
|
GrouperSourceAdapter(String id,
String name)
Allocates new GrouperSourceAdapter.
|
Modifier and Type | Method and Description |
---|---|
void |
checkConfig()
make sure the config is ok, and log descriptive errors if not
|
static void |
clearSearchForGroupsWithReadPrivilege()
put this in a finally block to clear that we are searching for groups with certain privileges
|
Integer |
getMaxPage()
max Page size
|
Subject |
getSubject(String id)
Deprecated.
|
Subject |
getSubject(String id,
boolean exceptionIfNotFound)
Get a
Group subject by UUID. |
Subject |
getSubjectByIdentifier(String name)
Deprecated.
|
Subject |
getSubjectByIdentifier(String name,
boolean exceptionIfNull)
Gets a
Group subject by its name. |
Map<Integer,String> |
getSubjectIdentifierAttributes()
Get the names of attributes that are subject identifiers.
|
Map<String,Subject> |
getSubjectsByIdentifiers(Collection<String> identifiers)
Get subjects by identifiers.
|
Map<String,Subject> |
getSubjectsByIds(Collection<String> ids)
Get subjects by ids.
|
Set |
getSubjectTypes()
Gets the SubjectTypes supported by this source.
|
static String |
groupSourceId()
return the group source id
|
void |
init()
Initializes the Grouper source adapter.
|
static GrouperSession |
internal_getSessionOrRootForSubjectFinder() |
void |
loggingStart()
start logging the source low level actions
|
String |
loggingStop()
stop logging and get the output
|
String |
printConfig()
in the startup on this i2mi app, print helpful and brief info about this source
|
Set<String> |
retrieveAllSubjectIds()
get all subject ids
|
Set<Subject> |
search(String searchValue)
Unstructured search for Subjects.
|
static boolean |
searchForGroupsWithReadPrivilege()
if searching for groups with read privilege
|
static void |
searchForGroupsWithReadPrivilege(boolean searchForRead)
when doing a subject search, search for groups with privileges
|
SearchPageResult |
searchPage(String searchValue)
Unstructured search for Subjects.
|
Set<TypeOfGroup> |
typeOfGroups()
type of groups to search on
|
addAttribute, addInitParam, addInternalAttribute, addSubjectType, convertSourceAttributeToSubjectAttribute, convertSubjectAttributeToSourceAttribute, createSubject, equals, getAttributes, getConfigId, getId, getInitParam, getInternalAttributes, getName, getSearch, getSearchAttributes, getSearches, getSortAttributes, getSourceAttributesToLowerCase, getSubject, getSubjectByIdentifier, getSubjectByIdOrIdentifier, getSubjectByIdOrIdentifier, getSubjectIdentifierAttributesAll, getSubjectsByIdentifiers, getSubjectsByIds, getSubjectsByIdsOrIdentifiers, getSubjectsByIdsOrIdentifiers, getSubjectStatusConfig, getSubjectType, hashCode, initParams, isEditable, isEnabled, loadSearch, removeInitParam, resultSetLimit, search, searchPage, setConfigId, setId, setName, setSearchAttributes, setSearches, setSortAttributes, setSubjectIdentifierAttributes
public static boolean failOnSearchForTesting
public GrouperSourceAdapter()
public void loggingStart()
Source
public String loggingStop()
Source
public Set<String> retrieveAllSubjectIds()
Source
retrieveAllSubjectIds
in interface Source
retrieveAllSubjectIds
in class BaseSourceAdapter
BaseSourceAdapter.retrieveAllSubjectIds()
public static void searchForGroupsWithReadPrivilege(boolean searchForRead)
privileges1
- public static boolean searchForGroupsWithReadPrivilege()
public static void clearSearchForGroupsWithReadPrivilege()
@Deprecated public Subject getSubject(String id) throws SubjectNotFoundException
Group
subject by UUID.
// Use it within the Grouper API try { Subject subj = SubjectFinder.getSubject(uuid, "group"); } catch (SubjectNotFoundException e) { // Subject not found } // Use it directly try { Subject subj = source.getSubject(uuid, "group"); } catch (SubjectNotFoundException e) { // Subject not found }
getSubject
in interface Source
getSubject
in class BaseSourceAdapter
id
- Group UUIDSubject
SubjectNotFoundException
Source.getSubject(java.lang.String)
public Subject getSubject(String id, boolean exceptionIfNotFound) throws SubjectNotFoundException
Group
subject by UUID.
// Use it within the Grouper API try { Subject subj = SubjectFinder.getSubject(uuid, "group"); } catch (SubjectNotFoundException e) { // Subject not found } // Use it directly try { Subject subj = source.getSubject(uuid, "group"); } catch (SubjectNotFoundException e) { // Subject not found }
getSubject
in interface Source
getSubject
in class BaseSourceAdapter
id
- Group UUIDexceptionIfNotFound
- Subject
SubjectNotFoundException
Source.getSubject(java.lang.String, boolean)
@Deprecated public Subject getSubjectByIdentifier(String name) throws SubjectNotFoundException
Group
subject by its name.
// Use it within the Grouper API try { Subject subj = SubjectFinder.getSubjectByIdentifier(name, "group"); } catch (SubjectNotFoundException e) { // Subject not found } // Use it directly try { Subject subj = source.getSubjectByIdentifier(name, "group"); } catch (SubjectNotFoundException e) { // Subject not found }
getSubjectByIdentifier
in interface Source
getSubjectByIdentifier
in class BaseSourceAdapter
name
- Group nameSubject
SubjectNotFoundException
Source.getSubjectByIdentifier(java.lang.String)
public Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers)
Source
getSubjectsByIdentifiers
in interface Source
getSubjectsByIdentifiers
in class BaseSourceAdapter
Source.getSubjectsByIdentifiers(Collection)
public Map<String,Subject> getSubjectsByIds(Collection<String> ids)
Source
getSubjectsByIds
in interface Source
getSubjectsByIds
in class BaseSourceAdapter
Source.getSubjectsByIds(Collection)
public Subject getSubjectByIdentifier(String name, boolean exceptionIfNull) throws SubjectNotFoundException
Group
subject by its name.
// Use it within the Grouper API try { Subject subj = SubjectFinder.getSubjectByIdentifier(name, "group"); } catch (SubjectNotFoundException e) { // Subject not found } // Use it directly try { Subject subj = source.getSubjectByIdentifier(name, "group"); } catch (SubjectNotFoundException e) { // Subject not found }
getSubjectByIdentifier
in interface Source
getSubjectByIdentifier
in class BaseSourceAdapter
name
- Group nameexceptionIfNull
- Subject
SubjectNotFoundException
Source.getSubjectByIdentifier(java.lang.String, boolean)
public Set getSubjectTypes()
SourceAdapter sa = new GrouperSourceAdapter(); Set types = sa.getSubjectTypes();
getSubjectTypes
in interface Source
getSubjectTypes
in class BaseSourceAdapter
public void init() throws SourceUnavailableException
No initialization is currently performed by this adapter.
init
in interface Source
init
in class BaseSourceAdapter
SourceUnavailableException
public static String groupSourceId()
public Set<TypeOfGroup> typeOfGroups()
public static GrouperSession internal_getSessionOrRootForSubjectFinder()
public void checkConfig()
Source
Source.checkConfig()
public String printConfig()
Source
Source.printConfig()
public Integer getMaxPage()
public Set<Subject> search(String searchValue)
search
in interface Source
search
in class BaseSourceAdapter
public SearchPageResult searchPage(String searchValue)
Source
searchPage
in interface Source
searchPage
in class BaseSourceAdapter
BaseSourceAdapter.searchPage(java.lang.String)
public Map<Integer,String> getSubjectIdentifierAttributes()
Source
getSubjectIdentifierAttributes
in interface Source
getSubjectIdentifierAttributes
in class BaseSourceAdapter
Source.getSubjectIdentifierAttributes()
Copyright © 2016 Internet2. All rights reserved.