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, setSubjectIdentifierAttributespublic static boolean failOnSearchForTesting
public GrouperSourceAdapter()
public void loggingStart()
Sourcepublic String loggingStop()
Sourcepublic Set<String> retrieveAllSubjectIds()
SourceretrieveAllSubjectIds in interface SourceretrieveAllSubjectIds in class BaseSourceAdapterBaseSourceAdapter.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 SourcegetSubject in class BaseSourceAdapterid - Group UUIDSubjectSubjectNotFoundExceptionSource.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 SourcegetSubject in class BaseSourceAdapterid - Group UUIDexceptionIfNotFound - SubjectSubjectNotFoundExceptionSource.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 SourcegetSubjectByIdentifier in class BaseSourceAdaptername - Group nameSubjectSubjectNotFoundExceptionSource.getSubjectByIdentifier(java.lang.String)public Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers)
SourcegetSubjectsByIdentifiers in interface SourcegetSubjectsByIdentifiers in class BaseSourceAdapterSource.getSubjectsByIdentifiers(Collection)public Map<String,Subject> getSubjectsByIds(Collection<String> ids)
SourcegetSubjectsByIds in interface SourcegetSubjectsByIds in class BaseSourceAdapterSource.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 SourcegetSubjectByIdentifier in class BaseSourceAdaptername - Group nameexceptionIfNull - SubjectSubjectNotFoundExceptionSource.getSubjectByIdentifier(java.lang.String, boolean)public Set getSubjectTypes()
SourceAdapter sa = new GrouperSourceAdapter(); Set types = sa.getSubjectTypes();
getSubjectTypes in interface SourcegetSubjectTypes in class BaseSourceAdapterpublic void init()
throws SourceUnavailableException
No initialization is currently performed by this adapter.
init in interface Sourceinit in class BaseSourceAdapterSourceUnavailableExceptionpublic static String groupSourceId()
public Set<TypeOfGroup> typeOfGroups()
public static GrouperSession internal_getSessionOrRootForSubjectFinder()
public void checkConfig()
SourceSource.checkConfig()public String printConfig()
SourceSource.printConfig()public Integer getMaxPage()
public Set<Subject> search(String searchValue)
search in interface Sourcesearch in class BaseSourceAdapterpublic SearchPageResult searchPage(String searchValue)
SourcesearchPage in interface SourcesearchPage in class BaseSourceAdapterBaseSourceAdapter.searchPage(java.lang.String)public Map<Integer,String> getSubjectIdentifierAttributes()
SourcegetSubjectIdentifierAttributes in interface SourcegetSubjectIdentifierAttributes in class BaseSourceAdapterSource.getSubjectIdentifierAttributes()Copyright © 2016 Internet2. All rights reserved.