Package org.keycloak.models.utils
Class ModelToRepresentation
java.lang.Object
org.keycloak.models.utils.ModelToRepresentation
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
buildGroupPath
(GroupModel group) static void
exportAuthenticationFlows
(KeycloakSession session, RealmModel realm, RealmRepresentation rep) static void
exportGroups
(RealmModel realm, RealmRepresentation rep) static void
exportRequiredActions
(RealmModel realm, RealmRepresentation rep) static <M,
R> Stream<R> filterValidRepresentations
(Stream<M> models, Function<M, R> transformer) Handles exceptions that occur when transforming the model to a representation and will remove all null objects from the stream.static GroupRepresentation
static Stream<GroupRepresentation>
searchForGroupByName
(KeycloakSession session, RealmModel realm, boolean full, String search, Boolean exact, Integer first, Integer max) static Stream<GroupRepresentation>
searchForGroupByName
(UserModel user, boolean full, String search, Integer first, Integer max) static Stream<GroupModel>
searchForGroupModelByName
(KeycloakSession session, RealmModel realm, boolean full, String search, Boolean exact, Integer first, Integer max) static Stream<GroupModel>
searchGroupModelsByAttributes
(KeycloakSession session, RealmModel realm, boolean full, boolean populateHierarchy, Map<String, String> attributes, Integer first, Integer max) static Stream<GroupRepresentation>
searchGroupsByAttributes
(KeycloakSession session, RealmModel realm, boolean full, boolean populateHierarchy, Map<String, String> attributes, Integer first, Integer max) stripRealmAttributesIncludedAsFields
(Map<String, String> attributes) static RealmRepresentation
toBriefRepresentation
(RealmModel realm) static RoleRepresentation
static UserRepresentation
static GroupRepresentation
toGroupHierarchy
(GroupModel group, boolean full) static GroupRepresentation
toGroupHierarchy
(GroupModel group, boolean full, String search) Deprecated.static GroupRepresentation
toGroupHierarchy
(GroupModel group, boolean full, String search, Boolean exact) static GroupRepresentation
toGroupHierarchy
(GroupModel group, boolean full, Map<String, String> attributes) static Stream<GroupRepresentation>
toGroupHierarchy
(RealmModel realm, boolean full) static Stream<GroupRepresentation>
toGroupHierarchy
(RealmModel realm, boolean full, Integer first, Integer max) static Stream<GroupRepresentation>
toGroupHierarchy
(UserModel user, boolean full) static Stream<GroupRepresentation>
toGroupHierarchy
(UserModel user, boolean full, Integer first, Integer max) static Stream<GroupModel>
toGroupModelHierarchy
(RealmModel realm, boolean full, Integer first, Integer max) static List<ConfigPropertyRepresentation>
toRepresentation
(List<ProviderConfigProperty> configProperties) toRepresentation
(PermissionTicket ticket, AuthorizationProvider authorization) toRepresentation
(PermissionTicket ticket, AuthorizationProvider authorization, boolean returnNames) static <R extends AbstractPolicyRepresentation>
RtoRepresentation
(Policy policy, AuthorizationProvider authorization) static <R extends AbstractPolicyRepresentation>
RtoRepresentation
(Policy policy, AuthorizationProvider authorization, boolean genericRepresentation, boolean export) static <R extends AbstractPolicyRepresentation>
RtoRepresentation
(Policy policy, AuthorizationProvider authorization, boolean genericRepresentation, boolean export, boolean allFields) static ResourceRepresentation
toRepresentation
(Resource model, ResourceServer resourceServer, AuthorizationProvider authorization) static ResourceRepresentation
toRepresentation
(Resource model, ResourceServer resourceServer, AuthorizationProvider authorization, Boolean deep) static ResourceServerRepresentation
toRepresentation
(ResourceServer model, ClientModel client) static ScopeRepresentation
toRepresentation
(Scope model) toRepresentation
(CredentialMetadata credentialMetadata) static CredentialRepresentation
static AdminEventRepresentation
toRepresentation
(AdminEvent adminEvent) static AuthDetailsRepresentation
toRepresentation
(AuthDetails authDetails) static EventRepresentation
toRepresentation
(Event event) static ClientRepresentation
toRepresentation
(ClientModel clientModel, KeycloakSession session) static ClientScopeRepresentation
toRepresentation
(ClientScopeModel clientScopeModel) toRepresentation
(FederatedIdentityModel socialLink) static GroupRepresentation
toRepresentation
(GroupModel group, boolean full) static ComponentRepresentation
toRepresentation
(KeycloakSession session, ComponentModel component, boolean internal) static RealmRepresentation
toRepresentation
(KeycloakSession session, RealmModel realm, boolean internal) toRepresentation
(KeycloakSession session, RealmModel realm, AuthenticationExecutionModel model) toRepresentation
(KeycloakSession session, RealmModel realm, AuthenticationFlowModel model) static UserRepresentation
toRepresentation
(KeycloakSession session, RealmModel realm, UserModel user) static ProtocolMapperRepresentation
toRepresentation
(RealmModel realm, IdentityProviderModel identityProviderModel) static RoleRepresentation
toRepresentation
(RoleModel role) static UserConsentRepresentation
toRepresentation
(UserConsentModel model) static CredentialRepresentation
static UserSessionRepresentation
toRepresentation
(UserSessionModel session) static ConfigPropertyRepresentation
static ComponentRepresentation
toRepresentationWithoutConfig
(ComponentModel component) static ResourceServerRepresentation
toResourceServerRepresentation
(KeycloakSession session, ClientModel client)
-
Field Details
-
REALM_EXCLUDED_ATTRIBUTES
-
-
Constructor Details
-
ModelToRepresentation
public ModelToRepresentation()
-
-
Method Details
-
buildGroupPath
-
groupToBriefRepresentation
-
toRepresentation
-
searchGroupsByAttributes
public static Stream<GroupRepresentation> searchGroupsByAttributes(KeycloakSession session, RealmModel realm, boolean full, boolean populateHierarchy, Map<String, String> attributes, Integer first, Integer max) -
searchGroupModelsByAttributes
public static Stream<GroupModel> searchGroupModelsByAttributes(KeycloakSession session, RealmModel realm, boolean full, boolean populateHierarchy, Map<String, String> attributes, Integer first, Integer max) -
searchForGroupByName
public static Stream<GroupRepresentation> searchForGroupByName(KeycloakSession session, RealmModel realm, boolean full, String search, Boolean exact, Integer first, Integer max) -
searchForGroupModelByName
public static Stream<GroupModel> searchForGroupModelByName(KeycloakSession session, RealmModel realm, boolean full, String search, Boolean exact, Integer first, Integer max) -
searchForGroupByName
-
toGroupHierarchy
public static Stream<GroupRepresentation> toGroupHierarchy(RealmModel realm, boolean full, Integer first, Integer max) -
toGroupModelHierarchy
public static Stream<GroupModel> toGroupModelHierarchy(RealmModel realm, boolean full, Integer first, Integer max) -
toGroupHierarchy
public static Stream<GroupRepresentation> toGroupHierarchy(UserModel user, boolean full, Integer first, Integer max) -
toGroupHierarchy
-
toGroupHierarchy
-
toGroupHierarchy
-
toGroupHierarchy
@Deprecated public static GroupRepresentation toGroupHierarchy(GroupModel group, boolean full, String search) Deprecated. -
toGroupHierarchy
public static GroupRepresentation toGroupHierarchy(GroupModel group, boolean full, String search, Boolean exact) -
toGroupHierarchy
public static GroupRepresentation toGroupHierarchy(GroupModel group, boolean full, Map<String, String> attributes) -
toRepresentation
public static UserRepresentation toRepresentation(KeycloakSession session, RealmModel realm, UserModel user) -
toBriefRepresentation
-
toRepresentation
-
toRepresentation
-
toRepresentation
-
toRepresentation
-
toBriefRepresentation
-
toBriefRepresentation
-
toRepresentation
public static RealmRepresentation toRepresentation(KeycloakSession session, RealmModel realm, boolean internal) -
stripRealmAttributesIncludedAsFields
-
exportGroups
-
exportAuthenticationFlows
public static void exportAuthenticationFlows(KeycloakSession session, RealmModel realm, RealmRepresentation rep) -
exportRequiredActions
-
toEventsConfigReprensetation
-
filterValidRepresentations
public static <M,R> Stream<R> filterValidRepresentations(Stream<M> models, Function<M, R> transformer) Handles exceptions that occur when transforming the model to a representation and will remove all null objects from the stream. Entities that have been removed from the store or where a lazy loading exception occurs will not show up in the output stream. -
toRepresentation
-
toRepresentation
-
toRepresentation
public static CredentialMetadataRepresentation toRepresentation(CredentialMetadata credentialMetadata) -
toRepresentation
-
toRepresentation
-
toRepresentation
-
toRepresentation
public static ClientRepresentation toRepresentation(ClientModel clientModel, KeycloakSession session) -
toRepresentation
public static IdentityProviderRepresentation toRepresentation(RealmModel realm, IdentityProviderModel identityProviderModel) -
toRepresentation
-
toRepresentation
public static IdentityProviderMapperRepresentation toRepresentation(IdentityProviderMapperModel model) -
toRepresentation
-
toRepresentation
public static AuthenticationFlowRepresentation toRepresentation(KeycloakSession session, RealmModel realm, AuthenticationFlowModel model) -
toRepresentation
public static AuthenticationExecutionExportRepresentation toRepresentation(KeycloakSession session, RealmModel realm, AuthenticationExecutionModel model) -
toRepresentation
-
toRepresentation
public static RequiredActionProviderRepresentation toRepresentation(RequiredActionProviderModel model) -
toRepresentation
public static List<ConfigPropertyRepresentation> toRepresentation(List<ProviderConfigProperty> configProperties) -
toRepresentation
-
toRepresentation
public static ComponentRepresentation toRepresentation(KeycloakSession session, ComponentModel component, boolean internal) -
toRepresentationWithoutConfig
-
toRepresentation
-
toRepresentation
public static ResourceServerRepresentation toRepresentation(ResourceServer model, ClientModel client) -
toRepresentation
public static <R extends AbstractPolicyRepresentation> R toRepresentation(Policy policy, AuthorizationProvider authorization) -
toRepresentation
public static <R extends AbstractPolicyRepresentation> R toRepresentation(Policy policy, AuthorizationProvider authorization, boolean genericRepresentation, boolean export) -
toRepresentation
public static <R extends AbstractPolicyRepresentation> R toRepresentation(Policy policy, AuthorizationProvider authorization, boolean genericRepresentation, boolean export, boolean allFields) -
toRepresentation
public static ResourceRepresentation toRepresentation(Resource model, ResourceServer resourceServer, AuthorizationProvider authorization) -
toRepresentation
public static ResourceRepresentation toRepresentation(Resource model, ResourceServer resourceServer, AuthorizationProvider authorization, Boolean deep) -
toRepresentation
public static PermissionTicketRepresentation toRepresentation(PermissionTicket ticket, AuthorizationProvider authorization) -
toRepresentation
public static PermissionTicketRepresentation toRepresentation(PermissionTicket ticket, AuthorizationProvider authorization, boolean returnNames) -
toResourceServerRepresentation
public static ResourceServerRepresentation toResourceServerRepresentation(KeycloakSession session, ClientModel client)
-