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
Modifier and TypeFieldDescriptionstatic boolean
for testing if we should fail on testingprotected Integer
if 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
ConstructorDescriptionAllocates new JNDISourceAdapter;JNDISourceAdapterLegacy
(String id1, String name1) Allocates new JNDISourceAdapter; -
Method Summary
Modifier and TypeMethodDescriptionvoid
make sure the config is ok, and log descriptive errors if notprotected String
escapeSearchFilter
(String filter) Escape a search filter to prevent LDAP injection.protected NamingEnumeration
getLdapResults
(Search search, String searchValue, String[] attributeNames) protected NamingEnumeration
getLdapResults
(Search search, String searchValue, String[] attributeNames, boolean firstPageOnly) protected Attributes
getLdapUnique
(Search search, String searchValue, String[] attributeNames) max Page sizeprotected static int
getSubject
(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 pointvoid
init()
Called by SourceManager when it loads this source.protected Map
loadAttributes
(SubjectImpl subject) Loads attributes for the argument subject.void
start 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 void
setupEnvironment
(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:Source
start logging the source low level actions -
loggingStop
Description copied from interface:Source
stop 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:Source
Gets a Subject by its ID.- Specified by:
getSubject
in interfaceSource
- Overrides:
getSubject
in classBaseSourceAdapter
exceptionIfNull
- if SubjectNotFoundException should be throws if the subject is null, or if null should be returned- Returns:
- subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
- See Also:
-
getSubjectByIdentifier
public Subject getSubjectByIdentifier(String id1, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException Description copied from class:BaseSourceAdapter
note, you should implement this method since this implementation will become abstract at some point- Specified by:
getSubjectByIdentifier
in interfaceSource
- Overrides:
getSubjectByIdentifier
in classBaseSourceAdapter
- Returns:
- subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
- 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:
search
in interfaceSource
- Specified by:
search
in classBaseSourceAdapter
- Returns:
- set
-
searchPage
Description copied from interface:Source
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 if maxPageSize is set in subject.properties, then only return max that many, and if there are more, set the tooManyResults flag- Specified by:
searchPage
in interfaceSource
- Overrides:
searchPage
in classBaseSourceAdapter
- Returns:
- results and if there are too many, never return null!!!
- See Also:
-
init
Description copied from class:BaseSourceAdapter
Called by SourceManager when it loads this source.- Specified by:
init
in interfaceSource
- Specified by:
init
in 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:
SubjectNotFoundException
SubjectNotUniqueException
-
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:Source
make sure the config is ok, and log descriptive errors if not- See Also:
-
printConfig
Description copied from interface:Source
in 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:Source
Gets a Subject by its ID.- Specified by:
getSubject
in interfaceSource
- Specified by:
getSubject
in classBaseSourceAdapter
- Returns:
- subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
- See Also:
-
getSubjectByIdentifier
@Deprecated public Subject getSubjectByIdentifier(String id1) throws SubjectNotFoundException, SubjectNotUniqueException Deprecated.Description copied from interface:Source
Gets a Subject by other well-known identifiers, aside from the subject ID, for example, login ID.- Specified by:
getSubjectByIdentifier
in interfaceSource
- Specified by:
getSubjectByIdentifier
in classBaseSourceAdapter
- Returns:
- subject
- Throws:
SubjectNotFoundException
SubjectNotUniqueException
- See Also:
-
getMaxPage
max Page size- Returns:
- the maxPage
-