org.keycloak.storage.client

## Class UnsupportedOperationsClientStorageAdapter

- java.lang.Object
- - org.keycloak.storage.client.UnsupportedOperationsClientStorageAdapter

- All Implemented Interfaces:
    ClientModel, ClientScopeModel, OrderedModel, ProtocolMapperContainerModel, RoleContainerModel, ScopeContainerModel
  Direct Known Subclasses:
    AbstractClientStorageAdapter

      public abstract class UnsupportedOperationsClientStorageAdapter
      extends Object
      implements ClientModel

  Base helper class. Unsupported operations are implemented here that throw exception on invocation.
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.models.ClientModel

      `ClientModel.ClientCreationEvent, ClientModel.ClientRemovedEvent, ClientModel.ClientUpdatedEvent`

    - ### 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 inherited from interface org.keycloak.models.ClientModel

      `PRIVATE_KEY, PUBLIC_KEY, X509CERTIFICATE`

    - ### Fields inherited from interface org.keycloak.models.ClientScopeModel

      `CONSENT_SCREEN_TEXT, DISPLAY_ON_CONSENT_SCREEN, GUI_ORDER, INCLUDE_IN_TOKEN_SCOPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UnsupportedOperationsClientStorageAdapter()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDefaultRole(String name)` Adds a role with given name to default roles of this object.
    `RoleModel` | `addRole(String name)`
    `RoleModel` | `addRole(String id, String name)`
    `Stream<String>` | `getDefaultRolesStream()` Returns all default role names of this object as a stream.
    `RoleModel` | `getRole(String name)`
    `Stream<RoleModel>` | `getRolesStream()`
    `Stream<RoleModel>` | `getRolesStream(Integer first, Integer max)`
    `void` | `removeDefaultRoles(String... defaultRoles)` Removes default roles from this object according to `defaultRoles`.
    `boolean` | `removeRole(RoleModel role)`
    `Stream<RoleModel>` | `searchForRolesStream(String search, Integer first, Integer max)`
    `void` | `updateDefaultRoles(String... defaultRoles)` Updates default roles of this object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.models.ClientModel

      `addClientScope, addClientScopes, addRedirectUri, addWebOrigin, getAttribute, getAttributes, getAuthenticationFlowBindingOverride, getAuthenticationFlowBindingOverrides, getBaseUrl, getClientAuthenticatorType, getClientId, getClientScopes, getConsentScreenText, getDescription, getDynamicClientScope, getId, getManagementUrl, getName, getNodeReRegistrationTimeout, getNotBefore, getProtocol, getRealm, getRedirectUris, getRegisteredNodes, getRegistrationToken, getRootUrl, getSecret, getWebOrigins, isAlwaysDisplayInConsole, isBearerOnly, isConsentRequired, isDirectAccessGrantsEnabled, isDisplayOnConsentScreen, isEnabled, isFrontchannelLogout, isFullScopeAllowed, isImplicitFlowEnabled, isPublicClient, isServiceAccountsEnabled, isStandardFlowEnabled, isSurrogateAuthRequired, registerNode, removeAttribute, removeAuthenticationFlowBindingOverride, removeClientScope, 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

      `getGuiOrder, isIncludeInTokenScope, setConsentScreenText, setDisplayOnConsentScreen, setGuiOrder, setIncludeInTokenScope`

    - ### Methods inherited from interface org.keycloak.models.ProtocolMapperContainerModel

      `addProtocolMapper, getProtocolMapperById, getProtocolMapperByName, getProtocolMappers, getProtocolMappersStream, removeProtocolMapper, updateProtocolMapper`

    - ### Methods inherited from interface org.keycloak.models.ScopeContainerModel

      `addScopeMapping, deleteScopeMapping, getRealmScopeMappings, getRealmScopeMappingsStream, getScopeMappings, getScopeMappingsStream, hasScope`

    - ### Methods inherited from interface org.keycloak.models.RoleContainerModel

      `getDefaultRoles, getRoles, getRoles, searchForRoles`

- - ### Constructor Detail

    - #### UnsupportedOperationsClientStorageAdapter

          public UnsupportedOperationsClientStorageAdapter()

  - ### Method Detail

    - #### getRole

          public final RoleModel getRole(String name)

      Specified by:
        `getRole` in interface `RoleContainerModel`

    - #### addRole

          public final RoleModel addRole(String name)

      Specified by:
        `addRole` in interface `RoleContainerModel`

    - #### addRole

          public final RoleModel addRole(String id,
                                         String name)

      Specified by:
        `addRole` in interface `RoleContainerModel`

    - #### removeRole

          public final boolean removeRole(RoleModel role)

      Specified by:
        `removeRole` in interface `RoleContainerModel`

    - #### getRolesStream

          public final Stream<RoleModel> getRolesStream()

      Specified by:
        `getRolesStream` in interface `RoleContainerModel`

    - #### getRolesStream

          public final Stream<RoleModel> getRolesStream(Integer first,
                                                        Integer max)

      Specified by:
        `getRolesStream` in interface `RoleContainerModel`

    - #### searchForRolesStream

          public final Stream<RoleModel> searchForRolesStream(String search,
                                                              Integer first,
                                                              Integer max)

      Specified by:
        `searchForRolesStream` in interface `RoleContainerModel`

    - #### getDefaultRolesStream

          public final Stream<String> getDefaultRolesStream()

      Description copied from interface: `RoleContainerModel`
      Returns all default role names of this object as a stream.
      Specified by:
        `getDefaultRolesStream` in interface `RoleContainerModel`
      Returns:
        stream of default role names of this object. Never returns `null`.

    - #### addDefaultRole

          public final void addDefaultRole(String name)

      Description copied from interface: `RoleContainerModel`
      Adds a role with given name to default roles of this object. If the role doesn't exist a new role is created.
      Specified by:
        `addDefaultRole` in interface `RoleContainerModel`
      Parameters:
        `name` - of the role to be (created and ) added

    - #### updateDefaultRoles

          public final void updateDefaultRoles(String... defaultRoles)

      Description copied from interface: `RoleContainerModel`
      Updates default roles of this object. It removes all default roles which are not specified by `defaultRoles` and adds all which weren't present in original default roles. In other words it's the same as calling `Set.retainAll` and `Set.addAll`.
      Specified by:
        `updateDefaultRoles` in interface `RoleContainerModel`
      Parameters:
        `defaultRoles` - Array of realm roles to be updated

    - #### removeDefaultRoles

          public final void removeDefaultRoles(String... defaultRoles)

      Description copied from interface: `RoleContainerModel`
      Removes default roles from this object according to `defaultRoles`.
      Specified by:
        `removeDefaultRoles` in interface `RoleContainerModel`
      Parameters:
        `defaultRoles` - Role names to be removed from default roles of this object.

Copyright © 2021 JBoss by Red Hat. All rights reserved.