Package org.keycloak.models.jpa
Class ClientAdapter
- java.lang.Object
- 
- org.keycloak.models.jpa.ClientAdapter
 
- 
- All Implemented Interfaces:
- ClientModel,- ClientScopeModel,- JpaModel<ClientEntity>,- OrderedModel,- ProtocolMapperContainerModel,- RoleContainerModel,- ScopeContainerModel
 
 public class ClientAdapter extends Object implements ClientModel, JpaModel<ClientEntity> - Version:
- $Revision: 1 $
- Author:
- Bill Burke
 
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.keycloak.models.ClientModelClientModel.ClientCreationEvent, ClientModel.ClientIdChangeEvent, ClientModel.ClientProtocolUpdatedEvent, ClientModel.ClientRemovedEvent, ClientModel.ClientUpdatedEvent, ClientModel.SearchableFields
 - 
Nested classes/interfaces inherited from interface org.keycloak.models.ClientScopeModelClientScopeModel.ClientScopeRemovedEvent
 - 
Nested classes/interfaces inherited from interface org.keycloak.models.OrderedModelOrderedModel.OrderedModelComparator<OM extends OrderedModel>
 - 
Nested classes/interfaces inherited from interface org.keycloak.models.RoleContainerModelRoleContainerModel.RoleRemovedEvent
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected javax.persistence.EntityManageremprotected ClientEntityentityprotected RealmModelrealmprotected KeycloakSessionsession- 
Fields inherited from interface org.keycloak.models.ClientModelLOGO_URI, POLICY_URI, PRIVATE_KEY, PUBLIC_KEY, TOS_URI, X509CERTIFICATE
 - 
Fields inherited from interface org.keycloak.models.ClientScopeModelCONSENT_SCREEN_TEXT, DISPLAY_ON_CONSENT_SCREEN, DYNAMIC_SCOPE_REGEXP, GUI_ORDER, INCLUDE_IN_TOKEN_SCOPE, IS_DYNAMIC_SCOPE
 
- 
 - 
Constructor SummaryConstructors Constructor Description ClientAdapter(RealmModel realm, javax.persistence.EntityManager em, KeycloakSession session, ClientEntity entity)
 - 
Method Summary- 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.models.ClientModelgetConsentScreenText, getDynamicClientScope, hasDirectScope, isDisplayOnConsentScreen
 - 
Methods inherited from interface org.keycloak.models.ClientScopeModelgetDynamicScopeRegexp, getGuiOrder, isDynamicScope, isIncludeInTokenScope, setConsentScreenText, setDisplayOnConsentScreen, setGuiOrder, setIncludeInTokenScope, setIsDynamicScope
 - 
Methods inherited from interface org.keycloak.models.RoleContainerModelgetDefaultRoles, updateDefaultRoles
 
- 
 
- 
- 
- 
Field Detail- 
sessionprotected KeycloakSession session 
 - 
realmprotected RealmModel realm 
 - 
emprotected javax.persistence.EntityManager em 
 - 
entityprotected ClientEntity entity 
 
- 
 - 
Constructor Detail- 
ClientAdapterpublic ClientAdapter(RealmModel realm, javax.persistence.EntityManager em, KeycloakSession session, ClientEntity entity) 
 
- 
 - 
Method Detail- 
getEntitypublic ClientEntity getEntity() - Specified by:
- getEntityin interface- JpaModel<ClientEntity>
 
 - 
getIdpublic String getId() Description copied from interface:ClientModelReturns client internal ID (UUID).- Specified by:
- getIdin interface- ClientModel
- Specified by:
- getIdin interface- ClientScopeModel
- Specified by:
- getIdin interface- RoleContainerModel
 
 - 
getRealmpublic RealmModel getRealm() - Specified by:
- getRealmin interface- ClientModel
- Specified by:
- getRealmin interface- ClientScopeModel
 
 - 
getNamepublic String getName() - Specified by:
- getNamein interface- ClientModel
- Specified by:
- getNamein interface- ClientScopeModel
 
 - 
setNamepublic void setName(String name) - Specified by:
- setNamein interface- ClientModel
- Specified by:
- setNamein interface- ClientScopeModel
 
 - 
getDescriptionpublic String getDescription() - Specified by:
- getDescriptionin interface- ClientModel
- Specified by:
- getDescriptionin interface- ClientScopeModel
 
 - 
setDescriptionpublic void setDescription(String description) - Specified by:
- setDescriptionin interface- ClientModel
- Specified by:
- setDescriptionin interface- ClientScopeModel
 
 - 
isEnabledpublic boolean isEnabled() - Specified by:
- isEnabledin interface- ClientModel
 
 - 
setEnabledpublic void setEnabled(boolean enabled) - Specified by:
- setEnabledin interface- ClientModel
 
 - 
isAlwaysDisplayInConsolepublic boolean isAlwaysDisplayInConsole() - Specified by:
- isAlwaysDisplayInConsolein interface- ClientModel
 
 - 
setAlwaysDisplayInConsolepublic void setAlwaysDisplayInConsole(boolean alwaysDisplayInConsole) - Specified by:
- setAlwaysDisplayInConsolein interface- ClientModel
 
 - 
isPublicClientpublic boolean isPublicClient() - Specified by:
- isPublicClientin interface- ClientModel
 
 - 
setPublicClientpublic void setPublicClient(boolean flag) - Specified by:
- setPublicClientin interface- ClientModel
 
 - 
isFrontchannelLogoutpublic boolean isFrontchannelLogout() - Specified by:
- isFrontchannelLogoutin interface- ClientModel
 
 - 
setFrontchannelLogoutpublic void setFrontchannelLogout(boolean flag) - Specified by:
- setFrontchannelLogoutin interface- ClientModel
 
 - 
isFullScopeAllowedpublic boolean isFullScopeAllowed() - Specified by:
- isFullScopeAllowedin interface- ClientModel
 
 - 
setFullScopeAllowedpublic void setFullScopeAllowed(boolean value) - Specified by:
- setFullScopeAllowedin interface- ClientModel
 
 - 
getWebOriginspublic Set<String> getWebOrigins() - Specified by:
- getWebOriginsin interface- ClientModel
 
 - 
setWebOriginspublic void setWebOrigins(Set<String> webOrigins) - Specified by:
- setWebOriginsin interface- ClientModel
 
 - 
addWebOriginpublic void addWebOrigin(String webOrigin) - Specified by:
- addWebOriginin interface- ClientModel
 
 - 
removeWebOriginpublic void removeWebOrigin(String webOrigin) - Specified by:
- removeWebOriginin interface- ClientModel
 
 - 
getRedirectUrispublic Set<String> getRedirectUris() - Specified by:
- getRedirectUrisin interface- ClientModel
 
 - 
setRedirectUrispublic void setRedirectUris(Set<String> redirectUris) - Specified by:
- setRedirectUrisin interface- ClientModel
 
 - 
addRedirectUripublic void addRedirectUri(String redirectUri) - Specified by:
- addRedirectUriin interface- ClientModel
 
 - 
removeRedirectUripublic void removeRedirectUri(String redirectUri) - Specified by:
- removeRedirectUriin interface- ClientModel
 
 - 
getClientAuthenticatorTypepublic String getClientAuthenticatorType() - Specified by:
- getClientAuthenticatorTypein interface- ClientModel
 
 - 
setClientAuthenticatorTypepublic void setClientAuthenticatorType(String clientAuthenticatorType) - Specified by:
- setClientAuthenticatorTypein interface- ClientModel
 
 - 
getSecretpublic String getSecret() - Specified by:
- getSecretin interface- ClientModel
 
 - 
setSecretpublic void setSecret(String secret) - Specified by:
- setSecretin interface- ClientModel
 
 - 
getRegistrationTokenpublic String getRegistrationToken() - Specified by:
- getRegistrationTokenin interface- ClientModel
 
 - 
setRegistrationTokenpublic void setRegistrationToken(String registrationToken) - Specified by:
- setRegistrationTokenin interface- ClientModel
 
 - 
validateSecretpublic boolean validateSecret(String secret) - Specified by:
- validateSecretin interface- ClientModel
 
 - 
getNotBeforepublic int getNotBefore() Description copied from interface:ClientModelTime in seconds since epoc- Specified by:
- getNotBeforein interface- ClientModel
- Returns:
 
 - 
setNotBeforepublic void setNotBefore(int notBefore) - Specified by:
- setNotBeforein interface- ClientModel
 
 - 
getRealmScopeMappingsStreampublic Stream<RoleModel> getRealmScopeMappingsStream() Description copied from interface:ScopeContainerModelFrom the scope mappings returned byScopeContainerModel.getScopeMappingsStream()returns only those that belong to the realm that owns this scope container.- Specified by:
- getRealmScopeMappingsStreamin interface- ScopeContainerModel
- Returns:
- stream of RoleModel. Never returnsnull.
 
 - 
getScopeMappingsStreampublic Stream<RoleModel> getScopeMappingsStream() Description copied from interface:ScopeContainerModelReturns scope mappings for this scope container as a stream.- Specified by:
- getScopeMappingsStreamin interface- ScopeContainerModel
- Returns:
- Stream of RoleModel. Never returnsnull.
 
 - 
addScopeMappingpublic void addScopeMapping(RoleModel role) - Specified by:
- addScopeMappingin interface- ScopeContainerModel
 
 - 
deleteScopeMappingpublic void deleteScopeMapping(RoleModel role) - Specified by:
- deleteScopeMappingin interface- ScopeContainerModel
 
 - 
getProtocolpublic String getProtocol() - Specified by:
- getProtocolin interface- ClientModel
- Specified by:
- getProtocolin interface- ClientScopeModel
 
 - 
setProtocolpublic void setProtocol(String protocol) - Specified by:
- setProtocolin interface- ClientModel
- Specified by:
- setProtocolin interface- ClientScopeModel
 
 - 
setAuthenticationFlowBindingOverridepublic void setAuthenticationFlowBindingOverride(String name, String value) - Specified by:
- setAuthenticationFlowBindingOverridein interface- ClientModel
 
 - 
removeAuthenticationFlowBindingOverridepublic void removeAuthenticationFlowBindingOverride(String name) - Specified by:
- removeAuthenticationFlowBindingOverridein interface- ClientModel
 
 - 
getAuthenticationFlowBindingOverridepublic String getAuthenticationFlowBindingOverride(String name) Description copied from interface:ClientModelGet authentication flow binding override for this client. Allows client to override an authentication flow binding.- Specified by:
- getAuthenticationFlowBindingOverridein interface- ClientModel
- Parameters:
- name- examples are "browser", "direct_grant"
- Returns:
 
 - 
getAuthenticationFlowBindingOverridespublic Map<String,String> getAuthenticationFlowBindingOverrides() - Specified by:
- getAuthenticationFlowBindingOverridesin interface- ClientModel
 
 - 
setAttributepublic void setAttribute(String name, String value) - Specified by:
- setAttributein interface- ClientModel
- Specified by:
- setAttributein interface- ClientScopeModel
 
 - 
removeAttributepublic void removeAttribute(String name) - Specified by:
- removeAttributein interface- ClientModel
- Specified by:
- removeAttributein interface- ClientScopeModel
 
 - 
getAttributepublic String getAttribute(String name) - Specified by:
- getAttributein interface- ClientModel
- Specified by:
- getAttributein interface- ClientScopeModel
 
 - 
getAttributespublic Map<String,String> getAttributes() - Specified by:
- getAttributesin interface- ClientModel
- Specified by:
- getAttributesin interface- ClientScopeModel
 
 - 
addClientScopepublic void addClientScope(ClientScopeModel clientScope, boolean defaultScope) Description copied from interface:ClientModelAdd clientScope with this client. Add it as default scope (if parameter 'defaultScope' is true) or optional scope (if parameter 'defaultScope' is false)- Specified by:
- addClientScopein interface- ClientModel
 
 - 
addClientScopespublic void addClientScopes(Set<ClientScopeModel> clientScopes, boolean defaultScope) Description copied from interface:ClientModelAdd clientScopes with this client. Add as default scopes (if parameter 'defaultScope' is true) or optional scopes (if parameter 'defaultScope' is false)- Specified by:
- addClientScopesin interface- ClientModel
 
 - 
removeClientScopepublic void removeClientScope(ClientScopeModel clientScope) - Specified by:
- removeClientScopein interface- ClientModel
 
 - 
getClientScopespublic Map<String,ClientScopeModel> getClientScopes(boolean defaultScope) Description copied from interface:ClientModelReturn all default scopes (if 'defaultScope' is true) or all optional scopes (if 'defaultScope' is false) linked with this client- Specified by:
- getClientScopesin interface- ClientModel
- Returns:
- map where key is the name of the clientScope, value is particular clientScope. Returns empty map if no scopes linked (never returns null).
 
 - 
getProtocolMappersStreampublic Stream<ProtocolMapperModel> getProtocolMappersStream() Description copied from interface:ProtocolMapperContainerModelReturns protocol mappers as a stream.- Specified by:
- getProtocolMappersStreamin interface- ProtocolMapperContainerModel
- Returns:
- Stream of protocol mapper. Never returns null.
 
 - 
addProtocolMapperpublic ProtocolMapperModel addProtocolMapper(ProtocolMapperModel model) - Specified by:
- addProtocolMapperin interface- ProtocolMapperContainerModel
 
 - 
getProtocolMapperEntityprotected ProtocolMapperEntity getProtocolMapperEntity(String id) 
 - 
getProtocolMapperEntityByNameprotected ProtocolMapperEntity getProtocolMapperEntityByName(String protocol, String name) 
 - 
removeProtocolMapperpublic void removeProtocolMapper(ProtocolMapperModel mapping) - Specified by:
- removeProtocolMapperin interface- ProtocolMapperContainerModel
 
 - 
updateProtocolMapperpublic void updateProtocolMapper(ProtocolMapperModel mapping) - Specified by:
- updateProtocolMapperin interface- ProtocolMapperContainerModel
 
 - 
getProtocolMapperByIdpublic ProtocolMapperModel getProtocolMapperById(String id) - Specified by:
- getProtocolMapperByIdin interface- ProtocolMapperContainerModel
 
 - 
getProtocolMapperByNamepublic ProtocolMapperModel getProtocolMapperByName(String protocol, String name) - Specified by:
- getProtocolMapperByNamein interface- ProtocolMapperContainerModel
 
 - 
entityToModelprotected ProtocolMapperModel entityToModel(ProtocolMapperEntity entity) 
 - 
updateClientpublic void updateClient() Description copied from interface:ClientModelNotifies other providers that this client has been updated.After a client is updated, providers can register for ClientModel.ClientUpdatedEvent. The setters in this model do not send an update for individual updates of the model. This method is here to allow for sending this event for this client, allowsing for to group multiple changes of a client and signal that all the changes in this client have been performed.- Specified by:
- updateClientin interface- ClientModel
- See Also:
- ProviderEvent,- ProviderEventManager,- ClientModel.ClientUpdatedEvent
 
 - 
getClientIdpublic String getClientId() Description copied from interface:ClientModelReturns client ID as defined by the user.- Specified by:
- getClientIdin interface- ClientModel
- Returns:
 
 - 
setClientIdpublic void setClientId(String clientId) - Specified by:
- setClientIdin interface- ClientModel
 
 - 
isSurrogateAuthRequiredpublic boolean isSurrogateAuthRequired() - Specified by:
- isSurrogateAuthRequiredin interface- ClientModel
 
 - 
setSurrogateAuthRequiredpublic void setSurrogateAuthRequired(boolean surrogateAuthRequired) - Specified by:
- setSurrogateAuthRequiredin interface- ClientModel
 
 - 
getManagementUrlpublic String getManagementUrl() - Specified by:
- getManagementUrlin interface- ClientModel
 
 - 
setManagementUrlpublic void setManagementUrl(String url) - Specified by:
- setManagementUrlin interface- ClientModel
 
 - 
getRootUrlpublic String getRootUrl() - Specified by:
- getRootUrlin interface- ClientModel
 
 - 
setRootUrlpublic void setRootUrl(String url) - Specified by:
- setRootUrlin interface- ClientModel
 
 - 
getBaseUrlpublic String getBaseUrl() - Specified by:
- getBaseUrlin interface- ClientModel
 
 - 
setBaseUrlpublic void setBaseUrl(String url) - Specified by:
- setBaseUrlin interface- ClientModel
 
 - 
isBearerOnlypublic boolean isBearerOnly() - Specified by:
- isBearerOnlyin interface- ClientModel
 
 - 
setBearerOnlypublic void setBearerOnly(boolean only) - Specified by:
- setBearerOnlyin interface- ClientModel
 
 - 
isConsentRequiredpublic boolean isConsentRequired() - Specified by:
- isConsentRequiredin interface- ClientModel
 
 - 
setConsentRequiredpublic void setConsentRequired(boolean consentRequired) - Specified by:
- setConsentRequiredin interface- ClientModel
 
 - 
isStandardFlowEnabledpublic boolean isStandardFlowEnabled() - Specified by:
- isStandardFlowEnabledin interface- ClientModel
 
 - 
setStandardFlowEnabledpublic void setStandardFlowEnabled(boolean standardFlowEnabled) - Specified by:
- setStandardFlowEnabledin interface- ClientModel
 
 - 
isImplicitFlowEnabledpublic boolean isImplicitFlowEnabled() - Specified by:
- isImplicitFlowEnabledin interface- ClientModel
 
 - 
setImplicitFlowEnabledpublic void setImplicitFlowEnabled(boolean implicitFlowEnabled) - Specified by:
- setImplicitFlowEnabledin interface- ClientModel
 
 - 
isDirectAccessGrantsEnabledpublic boolean isDirectAccessGrantsEnabled() - Specified by:
- isDirectAccessGrantsEnabledin interface- ClientModel
 
 - 
setDirectAccessGrantsEnabledpublic void setDirectAccessGrantsEnabled(boolean directAccessGrantsEnabled) - Specified by:
- setDirectAccessGrantsEnabledin interface- ClientModel
 
 - 
isServiceAccountsEnabledpublic boolean isServiceAccountsEnabled() - Specified by:
- isServiceAccountsEnabledin interface- ClientModel
 
 - 
setServiceAccountsEnabledpublic void setServiceAccountsEnabled(boolean serviceAccountsEnabled) - Specified by:
- setServiceAccountsEnabledin interface- ClientModel
 
 - 
getRolepublic RoleModel getRole(String name) - Specified by:
- getRolein interface- RoleContainerModel
 
 - 
addRolepublic RoleModel addRole(String name) - Specified by:
- addRolein interface- RoleContainerModel
 
 - 
addRolepublic RoleModel addRole(String id, String name) - Specified by:
- addRolein interface- RoleContainerModel
 
 - 
removeRolepublic boolean removeRole(RoleModel roleModel) - Specified by:
- removeRolein interface- RoleContainerModel
 
 - 
getRolesStreampublic Stream<RoleModel> getRolesStream() Description copied from interface:RoleContainerModelReturns available roles as a stream.- Specified by:
- getRolesStreamin interface- RoleContainerModel
- Returns:
- Stream of RoleModel. Never returnsnull.
 
 - 
getRolesStreampublic Stream<RoleModel> getRolesStream(Integer first, Integer max) Description copied from interface:RoleContainerModelReturns available roles as a stream.- Specified by:
- getRolesStreamin interface- RoleContainerModel
- Parameters:
- first-- IntegerIndex of the first desired role. Ignored if negative or- null.
- max-- IntegerMaximum number of returned roles. Ignored if negative or- null.
- Returns:
- Stream of RoleModel. Never returnsnull.
 
 - 
searchForRolesStreampublic Stream<RoleModel> searchForRolesStream(String search, Integer first, Integer max) Description copied from interface:RoleContainerModelSearches roles by the given name. Returns all roles that match the given filter.- Specified by:
- searchForRolesStreamin interface- RoleContainerModel
- Parameters:
- search-- StringName of the role to be used as a filter.
- first-- IntegerIndex of the first desired role. Ignored if negative or- null.
- max-- IntegerMaximum number of returned roles. Ignored if negative or- null.
- Returns:
- Stream of RoleModel. Never returnsnull.
 
 - 
hasScopepublic boolean hasScope(RoleModel role) Description copied from interface:ScopeContainerModelReturnstrue, if this object has the given role directly or indirectly in its scope,falseotherwise.- Specified by:
- hasScopein interface- ScopeContainerModel
- Parameters:
- role- the role
- Returns:
- see description
- See Also:
- if you want to check if this object has the given role directly in its scope
 
 - 
getDefaultRolesStream@Deprecated public Stream<String> getDefaultRolesStream() Deprecated.- Specified by:
- getDefaultRolesStreamin interface- RoleContainerModel
- Returns:
- Stream of default roles names or empty stream if there are none. Never returns null.
 
 - 
addDefaultRole@Deprecated public void addDefaultRole(String name) Deprecated.- Specified by:
- addDefaultRolein interface- RoleContainerModel
 
 - 
removeDefaultRoles@Deprecated public void removeDefaultRoles(String... defaultRoles) Deprecated.- Specified by:
- removeDefaultRolesin interface- RoleContainerModel
 
 - 
getNodeReRegistrationTimeoutpublic int getNodeReRegistrationTimeout() - Specified by:
- getNodeReRegistrationTimeoutin interface- ClientModel
 
 - 
setNodeReRegistrationTimeoutpublic void setNodeReRegistrationTimeout(int timeout) - Specified by:
- setNodeReRegistrationTimeoutin interface- ClientModel
 
 - 
getRegisteredNodespublic Map<String,Integer> getRegisteredNodes() - Specified by:
- getRegisteredNodesin interface- ClientModel
 
 - 
registerNodepublic void registerNode(String nodeHost, int registrationTime) Description copied from interface:ClientModelRegister node or just update the 'lastReRegistration' time if this node is already registered- Specified by:
- registerNodein interface- ClientModel
 
 - 
unregisterNodepublic void unregisterNode(String nodeHost) - Specified by:
- unregisterNodein interface- ClientModel
 
 
- 
 
-