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, wait
checkConfig, printConfig
protected 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
Source
getSubject
in interface Source
exceptionIfNull
- 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 userSubjectNotFoundException
SubjectNotUniqueException
Source.getSubject(java.lang.String, boolean, java.lang.String)
public Subject getSubjectByIdentifier(String id1, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
Source
getSubjectByIdentifier
in interface Source
realm
- string value that sets the realm for the search. The source can
implement various realms to account for permissions of the calling userSubjectNotFoundException
SubjectNotUniqueException
Source.getSubjectByIdentifier(java.lang.String, boolean, java.lang.String)
public Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull, String realm) throws SubjectNotFoundException, SubjectNotUniqueException
Source
getSubjectByIdOrIdentifier
in interface Source
exceptionIfNull
- 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 userSubjectNotFoundException
SubjectNotUniqueException
Source.getSubjectByIdOrIdentifier(java.lang.String, boolean, java.lang.String)
public Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers, String realm)
Source
getSubjectsByIdentifiers
in interface Source
realm
- 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)
Source
getSubjectsByIds
in interface Source
realm
- 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)
Source
getSubjectsByIdsOrIdentifiers
in interface Source
idsOrIdentifiers
- 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)
Source
search
in interface Source
realm
- 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)
Source
searchPage
in interface Source
realm
- 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()
Source
getSubjectStatusConfig
in interface Source
Source.getSubjectStatusConfig()
public static Integer resultSetLimit(boolean firstPageOnly, Integer pageSize, Integer theMaxResults)
firstPageOnly
- pageSize
- theMaxResults
- public SearchPageResult searchPage(String searchValue)
Source
searchPage
in interface Source
Source.searchPage(java.lang.String)
public Map<String,Subject> getSubjectsByIdentifiers(Collection<String> identifiers)
Source
getSubjectsByIdentifiers
in interface Source
Source.getSubjectsByIdentifiers(java.util.Collection)
public Map<String,Subject> getSubjectsByIds(Collection<String> ids)
Source
getSubjectsByIds
in interface Source
Source.getSubjectsByIds(java.util.Collection)
public Subject getSubjectByIdOrIdentifier(String idOrIdentifier, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
getSubjectByIdOrIdentifier
in interface Source
idOrIdentifier
- exceptionIfNull
- if SubjectNotFoundException or nullSubjectNotFoundException
SubjectNotUniqueException
public Map<String,Subject> getSubjectsByIdsOrIdentifiers(Collection<String> idsOrIdentifiers)
Source
getSubjectsByIdsOrIdentifiers
in interface Source
idsOrIdentifiers
- 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 Source
public SubjectType getSubjectType()
@Deprecated public abstract Subject getSubject(String id1) throws SubjectNotFoundException, SubjectNotUniqueException
Source
getSubject
in interface Source
SubjectNotFoundException
SubjectNotUniqueException
Source.getSubject(java.lang.String)
public Subject getSubject(String id1, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
Source
getSubject
in interface Source
exceptionIfNull
- if SubjectNotFoundException should be
throws if the subject is null, or if null should be returnedSubjectNotFoundException
SubjectNotUniqueException
Source.getSubject(java.lang.String, boolean)
@Deprecated public abstract Subject getSubjectByIdentifier(String id1) throws SubjectNotFoundException, SubjectNotUniqueException
Source
getSubjectByIdentifier
in interface Source
SubjectNotFoundException
SubjectNotUniqueException
Source.getSubjectByIdentifier(java.lang.String)
public Subject getSubjectByIdentifier(String id1, boolean exceptionIfNull) throws SubjectNotFoundException, SubjectNotUniqueException
getSubjectByIdentifier
in interface Source
SubjectNotFoundException
SubjectNotUniqueException
Source.getSubjectByIdentifier(java.lang.String, boolean)
public abstract Set<Subject> search(String searchValue)
public abstract void init() throws SourceUnavailableException
init
in interface Source
SourceUnavailableException
public boolean equals(Object other)
public int hashCode()
hashCode
in class Object
Object.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 Source
name1
- public Properties initParams()
initParams
in interface Source
public void addAttribute(String attributeName)
attributeName
- public void addInternalAttribute(String attributeName)
attributeName
- protected Set getAttributes()
public Set<String> getInternalAttributes()
Source
getInternalAttributes
in interface Source
public 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()
Source
getSortAttributes
in interface Source
Source.getSortAttributes()
public Map<Integer,String> getSearchAttributes()
Source
getSearchAttributes
in interface Source
Source.getSearchAttributes()
Copyright © 2016 Internet2. All rights reserved.