Class JdbcPrincipalAttributesProperties
java.lang.Object
org.apereo.cas.configuration.model.support.jpa.AbstractJpaProperties
org.apereo.cas.configuration.model.support.jdbc.JdbcPrincipalAttributesProperties
- All Implemented Interfaces:
Serializable
,CasFeatureModule
@RequiresModule(name="cas-server-support-person-directory",
automated=true)
public class JdbcPrincipalAttributesProperties
extends AbstractJpaProperties
This is
JdbcPrincipalAttributesProperties
.- Since:
- 5.2.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apereo.cas.configuration.features.CasFeatureModule
CasFeatureModule.FeatureCatalog
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMap of attributes to fetch from the database.When constructing the final person object from the attribute repository, indicate how the username should be canonicalized.Collection of attributes, used to build the SQL query, that should go through a case canonicalization process defined askey->value
.Used only when there is a mapping of many rows to one user.getId()
A value can be assigned to this field to uniquely identify this resolver.int
getOrder()
The order of this attribute repository in the chain of repositories.Define aMap
of query attribute names to data-layer attribute names to use when building the query.Indicates how multiple attributes in a query should be concatenated together.getSql()
The SQL statement to execute and fetch attributes.getState()
Whether attribute resolution based on this source is enabled.Username attribute(s) to use when running the SQL query.boolean
If the SQL should only be run if all attributes listed in the mappings exist in the query.boolean
Designed to work against a table where there is a mapping of one row to one user.setAttributes
(Map<String, String> attributes) Map of attributes to fetch from the database.setCaseCanonicalization
(String caseCanonicalization) When constructing the final person object from the attribute repository, indicate how the username should be canonicalized.setCaseInsensitiveQueryAttributes
(List<String> caseInsensitiveQueryAttributes) Collection of attributes, used to build the SQL query, that should go through a case canonicalization process defined askey->value
.setColumnMappings
(Map<String, String> columnMappings) Used only when there is a mapping of many rows to one user.A value can be assigned to this field to uniquely identify this resolver.setOrder
(int order) The order of this attribute repository in the chain of repositories.setQueryAttributes
(Map<String, String> queryAttributes) Define aMap
of query attribute names to data-layer attribute names to use when building the query.setQueryType
(String queryType) Indicates how multiple attributes in a query should be concatenated together.setRequireAllAttributes
(boolean requireAllAttributes) If the SQL should only be run if all attributes listed in the mappings exist in the query.setSingleRow
(boolean singleRow) Designed to work against a table where there is a mapping of one row to one user.The SQL statement to execute and fetch attributes.Whether attribute resolution based on this source is enabled.setUsername
(List<String> username) Username attribute(s) to use when running the SQL query.Methods inherited from class org.apereo.cas.configuration.model.support.jpa.AbstractJpaProperties
getBatchSize, getConnectionTimeout, getDataSourceName, getDdlAuto, getDefaultCatalog, getDefaultSchema, getDialect, getDriverClass, getFailFastTimeout, getFetchSize, getHealthQuery, getIdleTimeout, getIsolationLevelName, getLeakThreshold, getPassword, getPhysicalNamingStrategyClassName, getPool, getPropagationBehaviorName, getProperties, getUrl, getUser, isAutocommit, isGenerateStatistics, isIsolateInternalQueries, isReadOnly, setAutocommit, setBatchSize, setConnectionTimeout, setDataSourceName, setDdlAuto, setDefaultCatalog, setDefaultSchema, setDialect, setDriverClass, setFailFastTimeout, setFetchSize, setGenerateStatistics, setHealthQuery, setIdleTimeout, setIsolateInternalQueries, setIsolationLevelName, setLeakThreshold, setPassword, setPhysicalNamingStrategyClassName, setPool, setPropagationBehaviorName, setProperties, setReadOnly, setUrl, setUser
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apereo.cas.configuration.features.CasFeatureModule
isDefined, isUndefined
-
Constructor Details
-
JdbcPrincipalAttributesProperties
public JdbcPrincipalAttributesProperties()
-
-
Method Details
-
getSql
The SQL statement to execute and fetch attributes. The syntax of the query must beSELECT * FROM table WHERE {0}
. TheWHERE
clause is dynamically generated by CAS. -
isSingleRow
public boolean isSingleRow()Designed to work against a table where there is a mapping of one row to one user. The fields in the table structure is assumed to matchusername|name|lastname|address
where there is only a single row per user. Setting this setting tofalse
will force CAS to work against a table where there is a mapping of one row to one user. The fields in the table structure is assumed to matchusername|attr_name|attr_value
where there is more than one row per username. -
isRequireAllAttributes
public boolean isRequireAllAttributes()If the SQL should only be run if all attributes listed in the mappings exist in the query. -
getCaseCanonicalization
When constructing the final person object from the attribute repository, indicate how the username should be canonicalized. Accepted values are:UPPER
: Transform the final person id into uppercase characters.LOWER
: Transform the final person id into lowercase characters.NONE
: Do nothing.
-
getQueryType
Indicates how multiple attributes in a query should be concatenated together. Accepted values are: *AND
: Concatenate attributes in the query using an AND-clause.OR
: Concatenate attributes in the query using an OR-clause.
-
getColumnMappings
Used only when there is a mapping of many rows to one user. This is done using a key-value structure where the key is the name of the "attribute name" column the value is the name of the "attribute value" column. If the table structure is as such: <pre> ----------------------------- uid | attr_name | attr_value ----------------------------- tom | first_name | Thomas </pre> Then a column mapping must be specified to teach CAS to useattr_name
andattr_value
for attribute names and values. -
getUsername
Username attribute(s) to use when running the SQL query. -
getOrder
public int getOrder()The order of this attribute repository in the chain of repositories. Can be used to explicitly position this source in chain and affects merging strategies. -
getId
A value can be assigned to this field to uniquely identify this resolver. -
getAttributes
Map of attributes to fetch from the database. Attributes are defined using a key-value structure where CAS allows the attribute name/key to be renamed virtually to a different attribute. The key is the attribute fetched from the data source and the value is the attribute name CAS should use for virtual renames. Attributes may be allowed to be virtually renamed and remapped. The key in the attribute map is the original attribute, and the value should be the virtually-renamed attribute. -
getCaseInsensitiveQueryAttributes
Collection of attributes, used to build the SQL query, that should go through a case canonicalization process defined askey->value
. Note that the key is not the name of the attribute, but the query attribute that is used in generating the final query clause (i.e.username
). The value can beNONE, LOWER, UPPER
.It's also possible to define a list of attributes without a case canonicalization override such as
username, attribute2
in which casecaseCanonicalization
will dictate the final outcome. -
getQueryAttributes
Define aMap
of query attribute names to data-layer attribute names to use when building the query. The key is always the name of the query attribute that is defined by CAS and passed internally, and the value is the database column that should map. -
getState
Whether attribute resolution based on this source is enabled. -
setSql
The SQL statement to execute and fetch attributes. The syntax of the query must beSELECT * FROM table WHERE {0}
. TheWHERE
clause is dynamically generated by CAS.- Returns:
this
.
-
setSingleRow
Designed to work against a table where there is a mapping of one row to one user. The fields in the table structure is assumed to matchusername|name|lastname|address
where there is only a single row per user. Setting this setting tofalse
will force CAS to work against a table where there is a mapping of one row to one user. The fields in the table structure is assumed to matchusername|attr_name|attr_value
where there is more than one row per username.- Returns:
this
.
-
setRequireAllAttributes
If the SQL should only be run if all attributes listed in the mappings exist in the query.- Returns:
this
.
-
setCaseCanonicalization
When constructing the final person object from the attribute repository, indicate how the username should be canonicalized. Accepted values are:UPPER
: Transform the final person id into uppercase characters.LOWER
: Transform the final person id into lowercase characters.NONE
: Do nothing.
- Returns:
this
.
-
setQueryType
Indicates how multiple attributes in a query should be concatenated together. Accepted values are: *AND
: Concatenate attributes in the query using an AND-clause.OR
: Concatenate attributes in the query using an OR-clause.
- Returns:
this
.
-
setColumnMappings
Used only when there is a mapping of many rows to one user. This is done using a key-value structure where the key is the name of the "attribute name" column the value is the name of the "attribute value" column. If the table structure is as such: <pre> ----------------------------- uid | attr_name | attr_value ----------------------------- tom | first_name | Thomas </pre> Then a column mapping must be specified to teach CAS to useattr_name
andattr_value
for attribute names and values.- Returns:
this
.
-
setUsername
Username attribute(s) to use when running the SQL query.- Returns:
this
.
-
setOrder
The order of this attribute repository in the chain of repositories. Can be used to explicitly position this source in chain and affects merging strategies.- Returns:
this
.
-
setId
A value can be assigned to this field to uniquely identify this resolver.- Returns:
this
.
-
setAttributes
Map of attributes to fetch from the database. Attributes are defined using a key-value structure where CAS allows the attribute name/key to be renamed virtually to a different attribute. The key is the attribute fetched from the data source and the value is the attribute name CAS should use for virtual renames. Attributes may be allowed to be virtually renamed and remapped. The key in the attribute map is the original attribute, and the value should be the virtually-renamed attribute.- Returns:
this
.
-
setCaseInsensitiveQueryAttributes
public JdbcPrincipalAttributesProperties setCaseInsensitiveQueryAttributes(List<String> caseInsensitiveQueryAttributes) Collection of attributes, used to build the SQL query, that should go through a case canonicalization process defined askey->value
. Note that the key is not the name of the attribute, but the query attribute that is used in generating the final query clause (i.e.username
). The value can beNONE, LOWER, UPPER
.It's also possible to define a list of attributes without a case canonicalization override such as
username, attribute2
in which casecaseCanonicalization
will dictate the final outcome.- Returns:
this
.
-
setQueryAttributes
Define aMap
of query attribute names to data-layer attribute names to use when building the query. The key is always the name of the query attribute that is defined by CAS and passed internally, and the value is the database column that should map.- Returns:
this
.
-
setState
Whether attribute resolution based on this source is enabled.- Returns:
this
.
-