public abstract class BaseSourceAdapter extends Object implements Source
Base Source adapter. Developers note: you should implement the getSubject and getSubjectByIdentifier methods (that take boolean) since the base class method will soon become abstract, and the method overloads which are deprecated and dont take booleans will go away.
| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
attributes |
protected String |
id |
protected Set<String> |
internalAttributes
internal attributes.
|
protected String |
name |
protected Properties |
params |
protected Map<Integer,String> |
searchAttributes |
protected HashMap<String,Search> |
searches
The three different kinds of searches:
|
protected Map<Integer,String> |
sortAttributes |
protected SubjectType |
type |
protected Set<SubjectType> |
types |
| Constructor and Description |
|---|
BaseSourceAdapter()
Default constructor.
|
BaseSourceAdapter(String id1,
String name1)
Allocates adapter with ID and name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(String attributeName) |
void |
addInitParam(String name1,
String value)
(non-javadoc)
|
void |
addInternalAttribute(String attributeName) |
void |
addSubjectType(String type1)
(non-javadoc)
|
boolean |
equals(Object other)
Compares this source against the specified source.
|
protected Set |
getAttributes() |
String |
getId()
Returns the ID of this source.
|
String |
getInitParam(String name1)
(non-javadoc)
|
Set<String> |
getInternalAttributes()
Get a set of attributes that are marked as being internal attributes.
|
String |
getName()
Returns the name of this source.
|
protected Search |
getSearch(String searchType) |
Map<Integer,String> |
getSearchAttributes()
Get the names of attributes used for searching.
|
protected HashMap<String,Search> |
getSearches() |
Map<Integer,String> |
getSortAttributes()
Get the names of attributes used for sorting.
|
abstract Subject |
getSubject(String id1)
Deprecated.
use the overload instead
|
Subject |
getSubject(String id1,
boolean exceptionIfNull)
Gets a Subject by its ID.
|
Subject |
getSubject(String id1,
boolean exceptionIfNull,
String realm)
Gets a Subject by its ID.
|
abstract Subject |
getSubjectByIdentifier(String id1)
Deprecated.
use the overload instead
|
Subject |
getSubjectByIdentifier(String id1,
boolean exceptionIfNull)
note, you should implement this method since this implementation will become abstract at some point
|
Subject |
getSubjectByIdentifier(String id1,
boolean exceptionIfNull,
String realm)
Gets a Subject by other well-known identifiers, aside
from the subject ID, for example, login ID.
|
Subject |
getSubjectByIdOrIdentifier(String idOrIdentifier,
boolean exceptionIfNull)
find by id or identifier
|
Subject |
getSubjectByIdOrIdentifier(String idOrIdentifier,
boolean exceptionIfNull,
String realm)
find by id or identifier.
|
Map<String,Subject> |
getSubjectsByIdentifiers(Collection<String> identifiers)
Get subjects by identifiers.
|
Map<String,Subject> |
getSubjectsByIdentifiers(Collection<String> identifiers,
String realm)
Get subjects by identifiers.
|
Map<String,Subject> |
getSubjectsByIds(Collection<String> ids)
Get subjects by ids.
|
Map<String,Subject> |
getSubjectsByIds(Collection<String> ids,
String realm)
Get subjects by ids.
|
Map<String,Subject> |
getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers)
Get subjects by ids or identifiers.
|
Map<String,Subject> |
getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers,
String realm)
Get subjects by ids or identifiers.
|
SubjectStatusConfig |
getSubjectStatusConfig()
get the config bean for this source
|
SubjectType |
getSubjectType() |
Set<SubjectType> |
getSubjectTypes()
Gets the SubjectTypes supported by this source.
|
int |
hashCode() |
abstract void |
init()
Called by SourceManager when it loads this source.
|
Properties |
initParams()
(non-javadoc)
|
void |
loadSearch(Search search) |
void |
removeInitParam(String name1) |
static Integer |
resultSetLimit(boolean firstPageOnly,
Integer pageSize,
Integer theMaxResults)
see what the result set limit should be (dont add one yet)
|
abstract Set<Subject> |
search(String searchValue)
Unstructured search for Subjects.
|
Set<Subject> |
search(String searchValue,
String realm)
Unstructured search for Subjects.
|
SearchPageResult |
searchPage(String searchValue)
Unstructured search for Subjects.
|
SearchPageResult |
searchPage(String searchValue,
String realm)
Unstructured search for Subjects.
|
void |
setId(String id1)
Sets the ID of this source.
|
void |
setName(String name1)
Sets the name of this source.
|
void |
setSearchAttributes(Map<Integer,String> searchAttributes) |
protected void |
setSearches(HashMap<String,Search> searches1) |
void |
setSortAttributes(Map<Integer,String> sortAttributes) |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitcheckConfig, printConfigprotected String id
protected String name
protected Set<SubjectType> types
protected SubjectType type
protected Properties params
public Subject getSubject(String id1, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
SourcegetSubject in interface SourceexceptionIfNull - if SubjectNotFoundException should be
throws if the subject is null, or if null should be returnedrealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSubjectNotFoundExceptionSubjectNotUniqueExceptionSource.getSubject(java.lang.String, boolean, java.lang.String)public Subject getSubjectByIdentifier(String id1, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
SourcegetSubjectByIdentifier in interface Sourcerealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSubjectNotFoundExceptionSubjectNotUniqueExceptionSource.getSubjectByIdentifier(java.lang.String, boolean, java.lang.String)public Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
SourcegetSubjectByIdOrIdentifier in interface SourceexceptionIfNull - if SubjectNotFoundException or nullrealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSubjectNotFoundExceptionSubjectNotUniqueExceptionSource.getSubjectByIdOrIdentifier(java.lang.String, boolean, java.lang.String)public Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers, String realm)
SourcegetSubjectsByIdentifiers in interface Sourcerealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSource.getSubjectsByIdentifiers(java.util.Collection, java.lang.String)public Map<String,Subject> getSubjectsByIds(Collection<String> ids, String realm)
SourcegetSubjectsByIds in interface Sourcerealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSource.getSubjectsByIds(java.util.Collection, java.lang.String)public Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers, String realm)
SourcegetSubjectsByIdsOrIdentifiers in interface SourceidsOrIdentifiers - each string could be a subject id or identifierrealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSource.getSubjectsByIdsOrIdentifiers(java.util.Collection, java.lang.String)public Set<Subject> search(String searchValue, String realm)
Sourcesearch in interface Sourcerealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSource.search(java.lang.String, java.lang.String)public SearchPageResult searchPage(String searchValue, String realm)
SourcesearchPage in interface Sourcerealm - string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSource.searchPage(java.lang.String, java.lang.String)public SubjectStatusConfig getSubjectStatusConfig()
SourcegetSubjectStatusConfig in interface SourceSource.getSubjectStatusConfig()public static Integer resultSetLimit(boolean firstPageOnly, Integer pageSize, Integer theMaxResults)
firstPageOnly - pageSize - theMaxResults - public SearchPageResult searchPage(String searchValue)
SourcesearchPage in interface SourceSource.searchPage(java.lang.String)public Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers)
SourcegetSubjectsByIdentifiers in interface SourceSource.getSubjectsByIdentifiers(java.util.Collection)public Map<String,Subject> getSubjectsByIds(Collection<String> ids)
SourcegetSubjectsByIds in interface SourceSource.getSubjectsByIds(java.util.Collection)public Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
getSubjectByIdOrIdentifier in interface SourceidOrIdentifier - exceptionIfNull - if SubjectNotFoundException or nullSubjectNotFoundExceptionSubjectNotUniqueExceptionpublic Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers)
SourcegetSubjectsByIdsOrIdentifiers in interface SourceidsOrIdentifiers - each string could be a subject id or identifierSource.getSubjectsByIdsOrIdentifiers(java.util.Collection)public String getId()
public void setId(String id1)
public String getName()
public void setName(String name1)
public Set<SubjectType> getSubjectTypes()
getSubjectTypes in interface Sourcepublic SubjectType getSubjectType()
@Deprecated public abstract Subject getSubject(String id1) throws SubjectNotFoundException, SubjectNotUniqueException
SourcegetSubject in interface SourceSubjectNotFoundExceptionSubjectNotUniqueExceptionSource.getSubject(java.lang.String)public Subject getSubject(String id1, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
SourcegetSubject in interface SourceexceptionIfNull - if SubjectNotFoundException should be
throws if the subject is null, or if null should be returnedSubjectNotFoundExceptionSubjectNotUniqueExceptionSource.getSubject(java.lang.String, boolean)@Deprecated public abstract Subject getSubjectByIdentifier(String id1) throws SubjectNotFoundException, SubjectNotUniqueException
SourcegetSubjectByIdentifier in interface SourceSubjectNotFoundExceptionSubjectNotUniqueExceptionSource.getSubjectByIdentifier(java.lang.String)public Subject getSubjectByIdentifier(String id1, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
getSubjectByIdentifier in interface SourceSubjectNotFoundExceptionSubjectNotUniqueExceptionSource.getSubjectByIdentifier(java.lang.String, boolean)public abstract Set<Subject> search(String searchValue)
public abstract void init()
throws SourceUnavailableException
init in interface SourceSourceUnavailableExceptionpublic boolean equals(Object other)
public int hashCode()
hashCode in class ObjectObject.hashCode()public void addSubjectType(String type1)
type1 - public void addInitParam(String name1, String value)
name1 - value - public void removeInitParam(String name1)
name1 - public String getInitParam(String name1)
getInitParam in interface Sourcename1 - public Properties initParams()
initParams in interface Sourcepublic void addAttribute(String attributeName)
attributeName - public void addInternalAttribute(String attributeName)
attributeName - protected Set getAttributes()
public Set<String> getInternalAttributes()
SourcegetInternalAttributes in interface Sourcepublic void loadSearch(Search search)
search - public void setSortAttributes(Map<Integer,String> sortAttributes)
sortAttributes - public void setSearchAttributes(Map<Integer,String> searchAttributes)
searchAttributes - public Map<Integer,String> getSortAttributes()
SourcegetSortAttributes in interface SourceSource.getSortAttributes()public Map<Integer,String> getSearchAttributes()
SourcegetSearchAttributes in interface SourceSource.getSearchAttributes()Copyright © 2016 Internet2. All rights reserved.