public class ClientStorageManager extends Object implements ClientProvider
| Modifier and Type | Field and Description |
|---|---|
protected KeycloakSession |
session |
| Constructor and Description |
|---|
ClientStorageManager(KeycloakSession session,
long clientStorageProviderTimeout) |
| Modifier and Type | Method and Description |
|---|---|
ClientModel |
addClient(RealmModel realm,
String clientId)
Adds a client with given
clientId to the given realm. |
ClientModel |
addClient(RealmModel realm,
String id,
String clientId)
Adds a client with given internal ID and
clientId to the given realm. |
void |
close() |
Stream<ClientModel> |
getAlwaysDisplayInConsoleClientsStream(RealmModel realm)
Returns a stream 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.
|
long |
getClientsCount(RealmModel realm)
Returns number of clients in the given realm
|
Stream<ClientModel> |
getClientsStream(RealmModel realm)
Returns all the clients of the given realm as a stream.
|
Stream<ClientModel> |
getClientsStream(RealmModel realm,
Integer firstResult,
Integer maxResults)
Returns the clients of the given realm as a stream.
|
static <T> Stream<T> |
getEnabledStorageProviders(KeycloakSession session,
RealmModel realm,
Class<T> type) |
static ClientStorageProvider |
getStorageProvider(KeycloakSession session,
RealmModel realm,
String componentId) |
static ClientStorageProvider |
getStorageProviderInstance(KeycloakSession session,
ClientStorageProviderModel model,
ClientStorageProviderFactory factory) |
static ClientStorageProviderModel |
getStorageProviderModel(RealmModel realm,
String componentId) |
static <T> Stream<T> |
getStorageProviders(KeycloakSession session,
RealmModel realm,
Class<T> type) |
static boolean |
isStorageProviderEnabled(RealmModel realm,
String providerId) |
boolean |
removeClient(RealmModel realm,
String id)
Removes given client from the given realm.
|
void |
removeClients(RealmModel realm)
Removes all clients from the given realm.
|
Stream<ClientModel> |
searchClientsByClientIdStream(RealmModel realm,
String clientId,
Integer firstResult,
Integer maxResults)
Obtaining clients from an external client storage is time-bounded.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAlwaysDisplayInConsoleClients, getClients, getClients, removeClientgetClientByClientId, getClientById, searchClientsByClientIdprotected KeycloakSession session
public ClientStorageManager(KeycloakSession session, long clientStorageProviderTimeout)
public static boolean isStorageProviderEnabled(RealmModel realm, String providerId)
public static ClientStorageProviderModel getStorageProviderModel(RealmModel realm, String componentId)
public static ClientStorageProvider getStorageProvider(KeycloakSession session, RealmModel realm, String componentId)
public static ClientStorageProvider getStorageProviderInstance(KeycloakSession session, ClientStorageProviderModel model, ClientStorageProviderFactory factory)
public static <T> Stream<T> getStorageProviders(KeycloakSession session, RealmModel realm, Class<T> type)
public static <T> Stream<T> getEnabledStorageProviders(KeycloakSession session, RealmModel realm, Class<T> type)
public ClientModel getClientById(RealmModel realm, String id)
ClientLookupProvidergetClientById in interface ClientLookupProviderrealm - Realm to limit the search.id - Internal IDnull if no client is found.public ClientModel getClientByClientId(RealmModel realm, String clientId)
ClientLookupProvidergetClientByClientId in interface ClientLookupProviderrealm - 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 Stream<ClientModel> searchClientsByClientIdStream(RealmModel realm, String clientId, Integer firstResult, Integer maxResults)
DefaultKeycloakSessionFactory.getClientStorageProviderTimeout() property is used.
Default value is 3000 milliseconds and it's configurable.
See DefaultKeycloakSessionFactory for details.searchClientsByClientIdStream in interface ClientLookupProviderrealm - 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 - Maximum number of results to return. Ignored if negative or null.public ClientModel addClient(RealmModel realm, String clientId)
ClientProviderclientId to the given realm.
The internal ID of the client will be created automatically.addClient in interface ClientProviderrealm - Realm owning this client.clientId - String that identifies the client to the external parties.
Maps to client_id in OIDC or entityID in SAML.public ClientModel addClient(RealmModel realm, String id, String clientId)
ClientProviderclientId to the given realm.addClient in interface ClientProviderrealm - 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 Stream<ClientModel> getClientsStream(RealmModel realm, Integer firstResult, Integer maxResults)
ClientProvidergetClientsStream in interface ClientProviderrealm - Realm.firstResult - First result to return. Ignored if negative or null.maxResults - Maximum number of results to return. Ignored if negative or null.null.public Stream<ClientModel> getClientsStream(RealmModel realm)
ClientProvidergetClientsStream(realm, null, null).getClientsStream in interface ClientProviderrealm - Realm.null.public long getClientsCount(RealmModel realm)
ClientProvidergetClientsCount in interface ClientProviderrealm - Realm.public Stream<ClientModel> getAlwaysDisplayInConsoleClientsStream(RealmModel realm)
ClientProvidergetAlwaysDisplayInConsoleClientsStream in interface ClientProviderrealm - Realm owning the clients.null.public void removeClients(RealmModel realm)
ClientProviderremoveClients in interface ClientProviderrealm - Realm.public boolean removeClient(RealmModel realm, String id)
ClientProviderremoveClient in interface ClientProviderrealm - Realm.id - Internal ID of the clienttrue if the client existed and has been removed, false otherwise.Copyright © 2021 JBoss by Red Hat. All rights reserved.