|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.services.persondir.support.AbstractDefaultQueryPersonAttributeDao
org.jasig.portal.services.persondir.support.JdbcPersonAttributeDaoImpl
public class JdbcPersonAttributeDaoImpl
An IPersonAttributeDao
implementation that maps from column names in the result of a SQL query
to attribute names.
You must set a Map from column names to attribute names and only column names
appearing as keys in that map will be used.
Nested Class Summary | |
---|---|
private class |
JdbcPersonAttributeDaoImpl.PersonAttributeMappingQuery
An object which will execute a SQL query with the expectation of yielding a ResultSet with zero or one rows, which it maps to null or to a Map from uPortal attribute names to values. |
Field Summary | |
---|---|
private java.util.Map |
attributeMappings
Map from column names to attribute names. |
private JdbcPersonAttributeDaoImpl.PersonAttributeMappingQuery |
query
The MappingSqlQuery to use to get attributes. |
private java.util.List |
queryAttributes
List of attributes to use in the query. |
private java.util.Set |
userAttributes
Set of attributes that may be provided for a user. |
Fields inherited from class org.jasig.portal.services.persondir.support.AbstractDefaultQueryPersonAttributeDao |
---|
log |
Constructor Summary | |
---|---|
JdbcPersonAttributeDaoImpl(javax.sql.DataSource ds,
java.util.List attrList,
java.lang.String sql)
Create the DAO, configured with the needed query information. |
Method Summary | |
---|---|
java.util.Map |
getColumnsToAttributes()
Get the Map from non-null String column names to Sets of non-null Strings representing the names of the uPortal attributes to be initialized from the specified column. |
java.util.Set |
getPossibleUserAttributeNames()
Gets a Set of attribute names that may be returned by the
IPersonAttributeDao.getUserAttributes(Map) . |
java.util.Map |
getUserAttributes(java.util.Map seed)
Returned Map will have values of String or a
List of String . |
void |
setColumnsToAttributes(java.util.Map columnsToAttributesMap)
Set the Map to use for mapping from a column name to a attribute
name or Set of attribute names. |
java.lang.String |
toString()
|
Methods inherited from class org.jasig.portal.services.persondir.support.AbstractDefaultQueryPersonAttributeDao |
---|
getDefaultAttributeName, getUserAttributes, setDefaultAttributeName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.Map attributeMappings
Map
from column names to attribute names.
private java.util.Set userAttributes
Set
of attributes that may be provided for a user.
private java.util.List queryAttributes
List
of attributes to use in the query.
private JdbcPersonAttributeDaoImpl.PersonAttributeMappingQuery query
MappingSqlQuery
to use to get attributes.
Constructor Detail |
---|
public JdbcPersonAttributeDaoImpl(javax.sql.DataSource ds, java.util.List attrList, java.lang.String sql)
ds
- The DataSource
to run the queries against.attrList
- The list of arguments for the query.sql
- The SQL query to run.Method Detail |
---|
public java.util.Map getUserAttributes(java.util.Map seed)
Map
will have values of String
or a
List
of String
.
seed
- immutable Map of attributes to values to seed the query
IPersonAttributeDao.getUserAttributes(java.util.Map)
public java.util.Set getPossibleUserAttributeNames()
IPersonAttributeDao
Set
of attribute names that may be returned by the
IPersonAttributeDao.getUserAttributes(Map)
. The names returned represent all
possible names IPersonAttributeDao.getUserAttributes(Map)
could return. If the
dao doesn't have a way to know all possible attribute names this
method should return null
.
Set
.
public java.util.Map getColumnsToAttributes()
public void setColumnsToAttributes(java.util.Map columnsToAttributesMap)
Map
to use for mapping from a column name to a attribute
name or Set
of attribute names. Column names that are specified
but have null mappings will use the column name for the attribute name.
Column names that are not specified as keys in this Map
will be
ignored.
Map
must have keys of type String
and values
of type String
or a Set
of String
.
columnsToAttributesMap
- Map
from column names to attribute names.
java.lang.IllegalArgumentException
- If the Map
doesn't follow the rules stated above.MultivaluedPersonAttributeUtils.parseAttributeToAttributeMapping(Map)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |