Package org.keycloak.models.map.client
Class AbstractClientModel<E extends AbstractEntity>
java.lang.Object
org.keycloak.models.map.client.AbstractClientModel<E>
- All Implemented Interfaces:
ClientModel
,ClientScopeModel
,OrderedModel
,ProtocolMapperContainerModel
,RoleContainerModel
,ScopeContainerModel
- Direct Known Subclasses:
MapClientAdapter
public abstract class AbstractClientModel<E extends AbstractEntity>
extends Object
implements ClientModel
- Author:
- hmlnarik
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.ClientModel
ClientModel.ClientCreationEvent, ClientModel.ClientIdChangeEvent, ClientModel.ClientProtocolUpdatedEvent, ClientModel.ClientRemovedEvent, ClientModel.ClientUpdatedEvent, ClientModel.SearchableFields
Nested classes/interfaces inherited from interface org.keycloak.models.ClientScopeModel
ClientScopeModel.ClientScopeRemovedEvent
Nested classes/interfaces inherited from interface org.keycloak.models.OrderedModel
OrderedModel.OrderedModelComparator<OM extends OrderedModel>
Nested classes/interfaces inherited from interface org.keycloak.models.RoleContainerModel
RoleContainerModel.RoleRemovedEvent
-
Field Summary
Modifier and TypeFieldDescriptionprotected final E
protected final RealmModel
protected final KeycloakSession
Fields inherited from interface org.keycloak.models.ClientModel
LOGO_URI, POLICY_URI, PRIVATE_KEY, PUBLIC_KEY, TOS_URI, X509CERTIFICATE
Fields inherited from interface org.keycloak.models.ClientScopeModel
CONSENT_SCREEN_TEXT, DISPLAY_ON_CONSENT_SCREEN, DYNAMIC_SCOPE_REGEXP, GUI_ORDER, INCLUDE_IN_TOKEN_SCOPE, IS_DYNAMIC_SCOPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addClientScope
(ClientScopeModel clientScope, boolean defaultScope) Add clientScope with this client.void
addClientScopes
(Set<ClientScopeModel> clientScopes, boolean defaultScope) Add clientScopes with this client.boolean
getClientScopes
(boolean defaultScope) Return all default scopes (if 'defaultScope' is true) or all optional scopes (if 'defaultScope' is false) linked with this clientFrom the scope mappings returned byScopeContainerModel.getScopeMappingsStream()
returns only those that belong to the realm that owns this scope container.Returns available roles as a stream.getRolesStream
(Integer firstResult, Integer maxResults) Returns available roles as a stream.int
hashCode()
void
removeClientScope
(ClientScopeModel clientScope) boolean
removeRole
(RoleModel role) searchForRolesStream
(String search, Integer first, Integer max) Searches roles by the given name.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.models.ClientModel
addRedirectUri, addWebOrigin, getAttribute, getAttributes, getAuthenticationFlowBindingOverride, getAuthenticationFlowBindingOverrides, getBaseUrl, getClientAuthenticatorType, getClientId, getConsentScreenText, getDescription, getDynamicClientScope, getId, getManagementUrl, getName, getNodeReRegistrationTimeout, getNotBefore, getProtocol, getRealm, getRedirectUris, getRegisteredNodes, getRegistrationToken, getRootUrl, getSecret, getWebOrigins, hasDirectScope, isAlwaysDisplayInConsole, isBearerOnly, isConsentRequired, isDirectAccessGrantsEnabled, isDisplayOnConsentScreen, isEnabled, isFrontchannelLogout, isFullScopeAllowed, isImplicitFlowEnabled, isPublicClient, isServiceAccountsEnabled, isStandardFlowEnabled, isSurrogateAuthRequired, registerNode, removeAttribute, removeAuthenticationFlowBindingOverride, removeRedirectUri, removeWebOrigin, setAlwaysDisplayInConsole, setAttribute, setAuthenticationFlowBindingOverride, setBaseUrl, setBearerOnly, setClientAuthenticatorType, setClientId, setConsentRequired, setDescription, setDirectAccessGrantsEnabled, setEnabled, setFrontchannelLogout, setFullScopeAllowed, setImplicitFlowEnabled, setManagementUrl, setName, setNodeReRegistrationTimeout, setNotBefore, setProtocol, setPublicClient, setRedirectUris, setRegistrationToken, setRootUrl, setSecret, setServiceAccountsEnabled, setStandardFlowEnabled, setSurrogateAuthRequired, setWebOrigins, unregisterNode, updateClient, validateSecret
Methods inherited from interface org.keycloak.models.ClientScopeModel
getDynamicScopeRegexp, getGuiOrder, isDynamicScope, isIncludeInTokenScope, setConsentScreenText, setDisplayOnConsentScreen, setGuiOrder, setIncludeInTokenScope, setIsDynamicScope
Methods inherited from interface org.keycloak.models.ProtocolMapperContainerModel
addProtocolMapper, getProtocolMapperById, getProtocolMapperByName, getProtocolMappersStream, removeProtocolMapper, updateProtocolMapper
Methods inherited from interface org.keycloak.models.ScopeContainerModel
addScopeMapping, deleteScopeMapping, getScopeMappingsStream, hasScope
-
Field Details
-
session
-
realm
-
entity
-
-
Constructor Details
-
AbstractClientModel
-
-
Method Details
-
addClientScopes
Description copied from interface:ClientModel
Add clientScopes with this client. Add as default scopes (if parameter 'defaultScope' is true) or optional scopes (if parameter 'defaultScope' is false)- Specified by:
addClientScopes
in interfaceClientModel
-
addClientScope
Description copied from interface:ClientModel
Add clientScope with this client. Add it as default scope (if parameter 'defaultScope' is true) or optional scope (if parameter 'defaultScope' is false)- Specified by:
addClientScope
in interfaceClientModel
-
removeClientScope
- Specified by:
removeClientScope
in interfaceClientModel
-
getClientScopes
Description copied from interface:ClientModel
Return all default scopes (if 'defaultScope' is true) or all optional scopes (if 'defaultScope' is false) linked with this client- Specified by:
getClientScopes
in interfaceClientModel
- Returns:
- map where key is the name of the clientScope, value is particular clientScope. Returns empty map if no scopes linked (never returns null).
-
getRealmScopeMappingsStream
Description copied from interface:ScopeContainerModel
From the scope mappings returned byScopeContainerModel.getScopeMappingsStream()
returns only those that belong to the realm that owns this scope container.- Specified by:
getRealmScopeMappingsStream
in interfaceScopeContainerModel
- Returns:
- stream of
RoleModel
. Never returnsnull
.
-
getRole
- Specified by:
getRole
in interfaceRoleContainerModel
-
addRole
- Specified by:
addRole
in interfaceRoleContainerModel
-
addRole
- Specified by:
addRole
in interfaceRoleContainerModel
-
removeRole
- Specified by:
removeRole
in interfaceRoleContainerModel
-
getRolesStream
Description copied from interface:RoleContainerModel
Returns available roles as a stream.- Specified by:
getRolesStream
in interfaceRoleContainerModel
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getRolesStream
Description copied from interface:RoleContainerModel
Returns available roles as a stream.- Specified by:
getRolesStream
in interfaceRoleContainerModel
- Parameters:
firstResult
-Integer
Index of the first desired role. Ignored if negative ornull
.maxResults
-Integer
Maximum number of returned roles. Ignored if negative ornull
.- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
searchForRolesStream
Description copied from interface:RoleContainerModel
Searches roles by the given name. Returns all roles that match the given filter.- Specified by:
searchForRolesStream
in interfaceRoleContainerModel
- Parameters:
search
-String
Name of the role to be used as a filter.first
-Integer
Index of the first desired role. Ignored if negative ornull
.max
-Integer
Maximum number of returned roles. Ignored if negative ornull
.- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
equals
-
hashCode
public int hashCode()
-