Class JNDISourceAdapterLegacy
java.lang.Object
edu.internet2.middleware.subject.provider.BaseSourceAdapter
edu.internet2.middleware.subject.provider.JNDISourceAdapterLegacy
- All Implemented Interfaces:
Source
JNDI Source
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic booleanfor testing if we should fail on testingprotected Integerif there is a limit to the number of resultsReturn scope for searching as a int - associate the string with the intFields inherited from class edu.internet2.middleware.subject.provider.BaseSourceAdapter
attributes, id, internalAttributes, name, params, searchAttributes, searches, sortAttributes, subjectIdentifierAttributes, subjectIdentifierAttributesAll, type, types -
Constructor Summary
ConstructorsConstructorDescriptionAllocates new JNDISourceAdapter;JNDISourceAdapterLegacy(String id1, String name1) Allocates new JNDISourceAdapter; -
Method Summary
Modifier and TypeMethodDescriptionvoidmake sure the config is ok, and log descriptive errors if notprotected StringescapeSearchFilter(String filter) Escape a search filter to prevent LDAP injection.protected NamingEnumerationgetLdapResults(Search search, String searchValue, String[] attributeNames) protected NamingEnumerationgetLdapResults(Search search, String searchValue, String[] attributeNames, boolean firstPageOnly) protected AttributesgetLdapUnique(Search search, String searchValue, String[] attributeNames) max Page sizeprotected static intgetSubject(String id1) Deprecated.getSubject(String id1, boolean exceptionIfNull) Gets a Subject by its ID.Deprecated.getSubjectByIdentifier(String id1, boolean exceptionIfNull) note, you should implement this method since this implementation will become abstract at some pointvoidinit()Called by SourceManager when it loads this source.protected MaploadAttributes(SubjectImpl subject) Loads attributes for the argument subject.voidstart logging the source low level actionsstop logging and get the outputin the startup on this i2mi app, print helpful and brief info about this sourceUnstructured search for Subjects.searchPage(String searchValue) Unstructured search for Subjects.protected voidsetupEnvironment(Properties props) Setup environment.Methods inherited from class edu.internet2.middleware.subject.provider.BaseSourceAdapter
addAttribute, addInitParam, addInternalAttribute, addSubjectType, attributeNameToViewerGroupName, convertSourceAttributeToSubjectAttribute, convertSubjectAttributeToSourceAttribute, createSubject, equals, exportLabelToAttributeName, getAttributes, getConfigId, getId, getInitParam, getInternalAttributes, getName, getSearch, getSearchAttributes, getSearches, getSortAttributes, getSourceAttributesToLowerCase, getSubject, getSubjectByIdentifier, getSubjectByIdOrIdentifier, getSubjectByIdOrIdentifier, getSubjectIdentifierAttributes, getSubjectIdentifierAttributesAll, getSubjectsByIdentifiers, getSubjectsByIdentifiers, getSubjectsByIds, getSubjectsByIds, getSubjectsByIdsOrIdentifiers, getSubjectsByIdsOrIdentifiers, getSubjectStatusConfig, getSubjectType, getSubjectTypes, hashCode, initParams, isEditable, isEnabled, loadSearch, removeInitParam, resultSetLimit, retrieveAllSubjectIds, search, searchPage, setConfigId, setId, setName, setSearchAttributes, setSearches, setSortAttributes, setSubjectIdentifierAttributes, setSubjectIdentifierAttributesAll, virtualAttributesForSource, virtualAttributesForSourceLegacy, virtualAttributeVariablesForSourceLegacy
-
Field Details
-
maxResults
if there is a limit to the number of results -
scopeStrings
Return scope for searching as a int - associate the string with the int -
failOnSearchForTesting
public static boolean failOnSearchForTestingfor testing if we should fail on testing
-
-
Constructor Details
-
JNDISourceAdapterLegacy
public JNDISourceAdapterLegacy()Allocates new JNDISourceAdapter; -
JNDISourceAdapterLegacy
Allocates new JNDISourceAdapter;- Parameters:
id1-name1-
-
-
Method Details
-
loggingStart
public void loggingStart()Description copied from interface:Sourcestart logging the source low level actions -
loggingStop
Description copied from interface:Sourcestop logging and get the output -
getScope
- Parameters:
scope-- Returns:
- scope
-
getSubject
public Subject getSubject(String id1, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException Description copied from interface:SourceGets a Subject by its ID.- Specified by:
getSubjectin interfaceSource- Overrides:
getSubjectin classBaseSourceAdapterexceptionIfNull- if SubjectNotFoundException should be throws if the subject is null, or if null should be returned- Returns:
- subject
- Throws:
SubjectNotFoundExceptionSubjectNotUniqueException- See Also:
-
getSubjectByIdentifier
public Subject getSubjectByIdentifier(String id1, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException Description copied from class:BaseSourceAdapternote, you should implement this method since this implementation will become abstract at some point- Specified by:
getSubjectByIdentifierin interfaceSource- Overrides:
getSubjectByIdentifierin classBaseSourceAdapter- Returns:
- subject
- Throws:
SubjectNotFoundExceptionSubjectNotUniqueException- See Also:
-
search
Unstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema. Note if config param: throwErrorOnFindAllFailure is false, then swallow and log exceptions- Specified by:
searchin interfaceSource- Specified by:
searchin classBaseSourceAdapter- Returns:
- set
-
searchPage
Description copied from interface:SourceUnstructured search for Subjects. Each implementation utilizes its own search algorithm tailored to the Subject repository and schema. Note if config param: throwErrorOnFindAllFailure is false, then swallow and log exceptions if maxPageSize is set in subject.properties, then only return max that many, and if there are more, set the tooManyResults flag- Specified by:
searchPagein interfaceSource- Overrides:
searchPagein classBaseSourceAdapter- Returns:
- results and if there are too many, never return null!!!
- See Also:
-
init
Description copied from class:BaseSourceAdapterCalled by SourceManager when it loads this source.- Specified by:
initin interfaceSource- Specified by:
initin classBaseSourceAdapter- Throws:
SourceUnavailableException- See Also:
-
setupEnvironment
Setup environment.- Parameters:
props-- Throws:
SourceUnavailableException
-
loadAttributes
Loads attributes for the argument subject.- Parameters:
subject-- Returns:
- the map
-
getLdapResults
protected NamingEnumeration getLdapResults(Search search, String searchValue, String[] attributeNames) - Parameters:
search-searchValue-attributeNames-- Returns:
- naming enumeration
-
getLdapResults
protected NamingEnumeration getLdapResults(Search search, String searchValue, String[] attributeNames, boolean firstPageOnly) - Parameters:
search-searchValue-attributeNames-- Returns:
- naming enumeration
-
getLdapUnique
protected Attributes getLdapUnique(Search search, String searchValue, String[] attributeNames) throws SubjectNotFoundException, SubjectNotUniqueException - Parameters:
search-searchValue-attributeNames-- Returns:
- attributes
- Throws:
SubjectNotFoundExceptionSubjectNotUniqueException
-
escapeSearchFilter
Escape a search filter to prevent LDAP injection. From http://www.owasp.org/index.php/Preventing_LDAP_Injection_in_Java- Parameters:
filter-- Returns:
- escaped filter
-
checkConfig
public void checkConfig()Description copied from interface:Sourcemake sure the config is ok, and log descriptive errors if not- See Also:
-
printConfig
Description copied from interface:Sourcein the startup on this i2mi app, print helpful and brief info about this source- Returns:
- the info
- See Also:
-
getSubject
@Deprecated public Subject getSubject(String id1) throws SubjectNotFoundException, SubjectNotUniqueException Deprecated.Description copied from interface:SourceGets a Subject by its ID.- Specified by:
getSubjectin interfaceSource- Specified by:
getSubjectin classBaseSourceAdapter- Returns:
- subject
- Throws:
SubjectNotFoundExceptionSubjectNotUniqueException- See Also:
-
getSubjectByIdentifier
@Deprecated public Subject getSubjectByIdentifier(String id1) throws SubjectNotFoundException, SubjectNotUniqueException Deprecated.Description copied from interface:SourceGets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.- Specified by:
getSubjectByIdentifierin interfaceSource- Specified by:
getSubjectByIdentifierin classBaseSourceAdapter- Returns:
- subject
- Throws:
SubjectNotFoundExceptionSubjectNotUniqueException- See Also:
-
getMaxPage
max Page size- Returns:
- the maxPage
-