Package org.keycloak.models.jpa
Class JpaIdentityProviderStorageProvider
java.lang.Object
org.keycloak.models.jpa.JpaIdentityProviderStorageProvider
- All Implemented Interfaces:
- IdentityProviderStorageProvider,- Provider
public class JpaIdentityProviderStorageProvider
extends Object
implements IdentityProviderStorageProvider
A JPA based implementation of 
IdentityProviderStorageProvider.- Author:
- Stefan Guilhen
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.keycloak.models.IdentityProviderStorageProviderIdentityProviderStorageProvider.FetchMode, IdentityProviderStorageProvider.LoginFilter
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()longcount()Returns the number of IDPs in the realm.create(IdentityProviderModel identityProvider) Creates a new identity provider from the specified model.Creates a new identity provider mapper from the specified model.Returns all identity providers in the realm filtered according to the specified search options.getByAlias(String alias) Obtains the identity provider with the specified alias.Returns the aliases of all identity providers whosefirstBrokerLoginFlowIdorpostBrokerLoginFlowIdmatches the providedflowId.Obtains the identity provider with the specified internal id.getMapperById(String id) Obtains the identity provider mapper with the specified id.getMapperByName(String identityProviderAlias, String name) Obtains the identity provider mapper with the provided identity provider alias and name.getMappersByAliasStream(String identityProviderAlias) Returns identity provider mappers by the provided alias as a stream.Returns all identity provider mappers in the realm filtered according to the specified search options.booleanRemoves the identity provider with the specified alias.voidRemoves all identity providers from the realm.voidRemoves all identity provider mappers from the realm.booleanRemoves the given identity provider mapper.voidupdate(IdentityProviderModel identityProvider) Updates the identity provider using the specified model.voidUpdates the identity provider mapper using the specified model.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.models.IdentityProviderStorageProvidergetAllStream, getByIdOrAlias, getByOrganization, getForLogin, getMappersStream, isIdentityFederationEnabled
- 
Field Details- 
loggerprotected static final org.jboss.logging.Logger logger
 
- 
- 
Constructor Details- 
JpaIdentityProviderStorageProvider
 
- 
- 
Method Details- 
createDescription copied from interface:IdentityProviderStorageProviderCreates a new identity provider from the specified model.- Specified by:
- createin interface- IdentityProviderStorageProvider
- Parameters:
- identityProvider- a- IdentityProviderModelcontaining the identity provider's data.
- Returns:
- the model of the created identity provider.
 
- 
updateDescription copied from interface:IdentityProviderStorageProviderUpdates the identity provider using the specified model.- Specified by:
- updatein interface- IdentityProviderStorageProvider
- Parameters:
- identityProvider- a- IdentityProviderModelcontaining the identity provider's data.
 
- 
removeDescription copied from interface:IdentityProviderStorageProviderRemoves the identity provider with the specified alias.- Specified by:
- removein interface- IdentityProviderStorageProvider
- Parameters:
- alias- the alias of the identity provider to be removed.
- Returns:
- trueif an IDP with the specified alias was found and removed;- falseotherwise.
 
- 
removeAllpublic void removeAll()Description copied from interface:IdentityProviderStorageProviderRemoves all identity providers from the realm.- Specified by:
- removeAllin interface- IdentityProviderStorageProvider
 
- 
getByIdDescription copied from interface:IdentityProviderStorageProviderObtains the identity provider with the specified internal id.- Specified by:
- getByIdin interface- IdentityProviderStorageProvider
- Parameters:
- internalId- the identity provider's internal id.
- Returns:
- a reference to the identity provider, or nullif no provider is found.
 
- 
getByAliasDescription copied from interface:IdentityProviderStorageProviderObtains the identity provider with the specified alias.- Specified by:
- getByAliasin interface- IdentityProviderStorageProvider
- Parameters:
- alias- the identity provider's alias.
- Returns:
- a reference to the identity provider, or nullif no provider is found.
 
- 
getAllStreampublic Stream<IdentityProviderModel> getAllStream(Map<String, String> attrs, Integer first, Integer max) Description copied from interface:IdentityProviderStorageProviderReturns all identity providers in the realm filtered according to the specified search options. The options include:- Regular fields found in IdentityProviderModel, such asALIAS,ENABLED,HIDE_ON_LOGIN, etc;
- Special search keys also present in IdentityProviderModel. Those includeSEARCH, used to perform exact, prefix, and infix searches by alias, andALIAS_NOT_IN, used to perform searches for identity providers whose alias doesn't match any of the specified aliases (separated by comma);
- Any attribute found in the identity provider's config. If the option key doesn't match any of the previous cases, the implementations must search the providers whose config contains a pair that matches the specified search option
 - Specified by:
- getAllStreamin interface- IdentityProviderStorageProvider
- Parameters:
- attrs- a- Mapcontaining identity provider search options that must be matched.
- first- the position of the first result to be processed (pagination offset). Ignored if negative or- null.
- max- the maximum number of results to be returned. Ignored if negative or- null.
- Returns:
- a non-null stream of IdentityProviderModels that match the search criteria.
 
- Regular fields found in 
- 
getByFlowDescription copied from interface:IdentityProviderStorageProviderReturns the aliases of all identity providers whosefirstBrokerLoginFlowIdorpostBrokerLoginFlowIdmatches the providedflowId.- Specified by:
- getByFlowin interface- IdentityProviderStorageProvider
- Parameters:
- flowId- the id of the flow.
- search- an optional- Stringrepresenting an identity provider alias (partial or exact). If the value is enclosed in double quotes, the method treats it as an exact search (e.g.- "name"). If the value is enclosed in wildcards, the method treats it as an infix search (e.g.- *name*). Otherwise, the method treats it as a prefix search (i.e.- name*and- namereturn the same results).
- first- the position of the first result to be processed (pagination offset). Ignored if negative or- null.
- max- the maximum number of results to be returned. Ignored if negative or- null.
- Returns:
- a non-null stream of IdentityProviderModels that match the search criteria.
 
- 
countpublic long count()Description copied from interface:IdentityProviderStorageProviderReturns the number of IDPs in the realm.- Specified by:
- countin interface- IdentityProviderStorageProvider
- Returns:
- the number of IDPs found in the realm.
 
- 
closepublic void close()
- 
createMapperDescription copied from interface:IdentityProviderStorageProviderCreates a new identity provider mapper from the specified model.- Specified by:
- createMapperin interface- IdentityProviderStorageProvider
- Parameters:
- model- a- IdentityProviderMapperModelcontaining the identity provider mapper's data.
- Returns:
- the model of the created identity provider mapper.
 
- 
updateMapperDescription copied from interface:IdentityProviderStorageProviderUpdates the identity provider mapper using the specified model.- Specified by:
- updateMapperin interface- IdentityProviderStorageProvider
- Parameters:
- model- a- IdentityProviderMapperModelcontaining the identity provider mapper's data.
 
- 
removeMapperDescription copied from interface:IdentityProviderStorageProviderRemoves the given identity provider mapper.- Specified by:
- removeMapperin interface- IdentityProviderStorageProvider
- Parameters:
- model- a- IdentityProviderMapperModelto be deleted.
- Returns:
- trueif an identity provider mapper was removed;- falseotherwise.
 
- 
removeAllMapperspublic void removeAllMappers()Description copied from interface:IdentityProviderStorageProviderRemoves all identity provider mappers from the realm.- Specified by:
- removeAllMappersin interface- IdentityProviderStorageProvider
 
- 
getMapperByIdDescription copied from interface:IdentityProviderStorageProviderObtains the identity provider mapper with the specified id.- Specified by:
- getMapperByIdin interface- IdentityProviderStorageProvider
- Parameters:
- id- the identity provider mapper's id.
- Returns:
- a reference to the identity provider mapper, or nullif no mapper is found.
 
- 
getMapperByNameDescription copied from interface:IdentityProviderStorageProviderObtains the identity provider mapper with the provided identity provider alias and name.- Specified by:
- getMapperByNamein interface- IdentityProviderStorageProvider
- Parameters:
- identityProviderAlias- the identity provider alias.
- name- the identity provider mapper's name.
- Returns:
- a reference to the identity provider mapper, or nullif no provider is found.
 
- 
getMappersStreampublic Stream<IdentityProviderMapperModel> getMappersStream(Map<String, String> options, Integer first, Integer max) Description copied from interface:IdentityProviderStorageProviderReturns all identity provider mappers in the realm filtered according to the specified search options.- Specified by:
- getMappersStreamin interface- IdentityProviderStorageProvider
- Parameters:
- options- a- Mapcontaining identity provider search options that must be matched.
- first- the position of the first result to be processed (pagination offset). Ignored if negative or- null.
- max- the maximum number of results to be returned. Ignored if negative or- null.
- Returns:
- a non-null stream of IdentityProviderModels that match the search criteria.
 
- 
getMappersByAliasStreamDescription copied from interface:IdentityProviderStorageProviderReturns identity provider mappers by the provided alias as a stream.- Specified by:
- getMappersByAliasStreamin interface- IdentityProviderStorageProvider
- Parameters:
- identityProviderAlias-- StringIdentity provider alias to filter results.
- Returns:
- Stream of IdentityProviderMapperModelNever returnsnull.
 
 
-