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
Fields Modifier and Type Field Description protected E
entity
protected RealmModel
realm
protected KeycloakSession
session
-
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
Constructors Constructor Description AbstractClientModel(KeycloakSession session, RealmModel realm, E entity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addClientScope(ClientScopeModel clientScope, boolean defaultScope)
Add clientScope with this client.void
addClientScopes(Set<ClientScopeModel> clientScopes, boolean defaultScope)
Add clientScopes with this client.RoleModel
addRole(String name)
RoleModel
addRole(String id, String name)
boolean
equals(Object o)
Map<String,ClientScopeModel>
getClientScopes(boolean defaultScope)
Return all default scopes (if 'defaultScope' is true) or all optional scopes (if 'defaultScope' is false) linked with this clientStream<RoleModel>
getRealmScopeMappingsStream()
From the scope mappings returned byScopeContainerModel.getScopeMappingsStream()
returns only those that belong to the realm that owns this scope container.RoleModel
getRole(String name)
Stream<RoleModel>
getRolesStream()
Returns available roles as a stream.Stream<RoleModel>
getRolesStream(Integer firstResult, Integer maxResults)
Returns available roles as a stream.int
hashCode()
void
removeClientScope(ClientScopeModel clientScope)
boolean
removeRole(RoleModel role)
Stream<RoleModel>
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.RoleContainerModel
addDefaultRole, getDefaultRoles, getDefaultRolesStream, removeDefaultRoles, updateDefaultRoles
-
Methods inherited from interface org.keycloak.models.ScopeContainerModel
addScopeMapping, deleteScopeMapping, getScopeMappingsStream, hasScope
-
-
-
-
Field Detail
-
session
protected final KeycloakSession session
-
realm
protected final RealmModel realm
-
entity
protected final E extends AbstractEntity entity
-
-
Constructor Detail
-
AbstractClientModel
public AbstractClientModel(KeycloakSession session, RealmModel realm, E entity)
-
-
Method Detail
-
addClientScopes
public void addClientScopes(Set<ClientScopeModel> clientScopes, boolean defaultScope)
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
public void addClientScope(ClientScopeModel clientScope, boolean defaultScope)
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
public void removeClientScope(ClientScopeModel clientScope)
- Specified by:
removeClientScope
in interfaceClientModel
-
getClientScopes
public Map<String,ClientScopeModel> getClientScopes(boolean defaultScope)
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
public Stream<RoleModel> 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
public RoleModel getRole(String name)
- Specified by:
getRole
in interfaceRoleContainerModel
-
addRole
public RoleModel addRole(String name)
- Specified by:
addRole
in interfaceRoleContainerModel
-
addRole
public RoleModel addRole(String id, String name)
- Specified by:
addRole
in interfaceRoleContainerModel
-
removeRole
public boolean removeRole(RoleModel role)
- Specified by:
removeRole
in interfaceRoleContainerModel
-
getRolesStream
public Stream<RoleModel> getRolesStream()
Description copied from interface:RoleContainerModel
Returns available roles as a stream.- Specified by:
getRolesStream
in interfaceRoleContainerModel
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getRolesStream
public Stream<RoleModel> getRolesStream(Integer firstResult, Integer maxResults)
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
public Stream<RoleModel> searchForRolesStream(String search, Integer first, Integer max)
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
.
-
-