public class MapClientProvider extends Object implements ClientProvider
Constructor and Description |
---|
MapClientProvider(KeycloakSession session,
MapStorage<UUID,MapClientEntity> clientStore,
ConcurrentMap<UUID,ConcurrentMap<String,Integer>> clientRegisteredNodesStore) |
Modifier and Type | Method and Description |
---|---|
ClientModel |
addClient(RealmModel realm,
String id,
String clientId)
Adds a client with given internal ID and
clientId to the given realm. |
void |
close() |
List<ClientModel> |
getAlwaysDisplayInConsoleClients(RealmModel realm)
Returns a list of clients that are expected to always show up in account console.
|
ClientModel |
getClientByClientId(RealmModel realm,
String clientId)
Exact search for a client by its public client identifier.
|
ClientModel |
getClientById(RealmModel realm,
String id)
Exact search for a client by its internal ID.
|
List<ClientModel> |
getClients(RealmModel realm)
Returns all the clients of the given realm.
|
List<ClientModel> |
getClients(RealmModel realm,
Integer firstResult,
Integer maxResults)
Returns the clients of the given realm.
|
long |
getClientsCount(RealmModel realm)
Returns number of clients in the given realm
|
Stream<ClientModel> |
getClientsStream(RealmModel realm) |
boolean |
removeClient(RealmModel realm,
String id)
Removes given client from the given realm.
|
void |
removeClients(RealmModel realm)
Removes all clients from the given realm.
|
List<ClientModel> |
searchClientsByClientId(RealmModel realm,
String clientId,
Integer firstResult,
Integer maxResults)
Case-insensitive search for clients that contain the given string in their public client identifier.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClient, removeClient
getClientByClientId, getClientById, searchClientsByClientId
public MapClientProvider(KeycloakSession session, MapStorage<UUID,MapClientEntity> clientStore, ConcurrentMap<UUID,ConcurrentMap<String,Integer>> clientRegisteredNodesStore)
public List<ClientModel> getClients(RealmModel realm, Integer firstResult, Integer maxResults)
ClientProvider
getClients
in interface ClientProvider
realm
- Realm.firstResult
- First result to return. Ignored if negative or null
.maxResults
- Maximim number of results to return. Ignored if negative or null
.null
.public Stream<ClientModel> getClientsStream(RealmModel realm)
public List<ClientModel> getClients(RealmModel realm)
ClientProvider
getClients(realm, null, null)
.getClients
in interface ClientProvider
realm
- Realm.null
.public ClientModel addClient(RealmModel realm, String id, String clientId)
ClientProvider
clientId
to the given realm.addClient
in interface ClientProvider
realm
- Realm owning this client.id
- Internal ID of the client or null
if one is to be created by the underlying storeclientId
- String that identifies the client to the external parties.
Maps to client_id
in OIDC or entityID
in SAML.public List<ClientModel> getAlwaysDisplayInConsoleClients(RealmModel realm)
ClientProvider
getAlwaysDisplayInConsoleClients
in interface ClientProvider
realm
- Realm owning the clients.null
.public void removeClients(RealmModel realm)
ClientProvider
removeClients
in interface ClientProvider
realm
- Realm.public boolean removeClient(RealmModel realm, String id)
ClientProvider
removeClient
in interface ClientProvider
realm
- Realm.id
- Internal ID of the clienttrue
if the client existed and has been removed, false
otherwise.public long getClientsCount(RealmModel realm)
ClientProvider
getClientsCount
in interface ClientProvider
realm
- Realm.public ClientModel getClientById(RealmModel realm, String id)
ClientLookupProvider
getClientById
in interface ClientLookupProvider
realm
- Realm to limit the search.id
- Internal IDnull
if no client is found.public ClientModel getClientByClientId(RealmModel realm, String clientId)
ClientLookupProvider
getClientByClientId
in interface ClientLookupProvider
realm
- Realm to limit the search for clients.clientId
- String that identifies the client to the external parties.
Maps to client_id
in OIDC or entityID
in SAML.null
if no client is found.public List<ClientModel> searchClientsByClientId(RealmModel realm, String clientId, Integer firstResult, Integer maxResults)
ClientLookupProvider
searchClientsByClientId
in interface ClientLookupProvider
realm
- Realm to limit the search for clients.clientId
- Searched substring of the public client
identifier (client_id
in OIDC or entityID
in SAML.)firstResult
- First result to return. Ignored if negative or null
.maxResults
- Maximim number of results to return. Ignored if negative or null
.null
if no client is found.Copyright © 2020 JBoss by Red Hat. All rights reserved.