public class DefaultClientPolicyManager extends Object implements ClientPolicyManager
Constructor and Description |
---|
DefaultClientPolicyManager(KeycloakSession session,
Supplier<List<ClientProfileRepresentation>> globalClientProfilesSupplier) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
ClientPoliciesRepresentation |
getClientPolicies(RealmModel realm)
when getting client policies via Admin REST API, returns the existing client policies set on the realm.
|
ClientProfilesRepresentation |
getClientProfiles(RealmModel realm,
boolean includeGlobalProfiles)
when getting client profiles via Admin REST API, returns the existing client profiles set on the realm.
|
void |
setupClientPoliciesOnCreatedRealm(RealmModel realm)
when creating a realm, adds the default client policies, which should be available on the realm and put them onto the realm as its attribute.
|
void |
triggerOnEvent(ClientPolicyContext context)
execute a method for handling an event defined in
ClientPolicyEvent . |
void |
updateClientPolicies(RealmModel realm,
ClientPoliciesRepresentation clientPolicies)
when updating client policies via Admin REST API, reads the json representation of the client policies
and overrides the existing client policies set on the realm with them.
|
void |
updateClientProfiles(RealmModel realm,
ClientProfilesRepresentation clientProfiles)
when updating client profiles via Admin REST API, reads the json representation of the client profiles
and overrides the existing client profiles set on the realm with them.
|
void |
updateRealmModelFromRepresentation(RealmModel realm,
RealmRepresentation rep)
when importing a realm, or updating a realm, update model from the representation object
|
void |
updateRealmRepresentationFromModel(RealmModel realm,
RealmRepresentation rep)
when exporting realm, or retrieve the realm for admin REST API, prepares the exported representation of the client profiles and policies.
|
public DefaultClientPolicyManager(KeycloakSession session, Supplier<List<ClientProfileRepresentation>> globalClientProfilesSupplier)
public void triggerOnEvent(ClientPolicyContext context) throws ClientPolicyException
ClientPolicyManager
ClientPolicyEvent
.triggerOnEvent
in interface ClientPolicyManager
context
- - the context of the event.ClientPolicyException
public void setupClientPoliciesOnCreatedRealm(RealmModel realm)
ClientPolicyManager
setupClientPoliciesOnCreatedRealm
in interface ClientPolicyManager
realm
- - the newly created realmpublic void updateRealmModelFromRepresentation(RealmModel realm, RealmRepresentation rep)
ClientPolicyManager
updateRealmModelFromRepresentation
in interface ClientPolicyManager
realm
- - the newly created realm to be overriden by imported realm's representationrep
- - imported realm's representationpublic void updateClientProfiles(RealmModel realm, ClientProfilesRepresentation clientProfiles) throws ClientPolicyException
ClientPolicyManager
updateClientProfiles
in interface ClientPolicyManager
realm
- - the realm whose client profiles is to be overriden by the new client profilesclientProfiles
- - the json representation of the new client profiles that overrides the existing client profiles set on the realm. With
the exception of global profiles, which are not overriden as mentioned above.ClientPolicyException
public ClientProfilesRepresentation getClientProfiles(RealmModel realm, boolean includeGlobalProfiles) throws ClientPolicyException
ClientPolicyManager
getClientProfiles
in interface ClientPolicyManager
realm
- - the realm whose client profiles is to be returnedincludeGlobalProfiles
- - If true, method will return realm profiles and global profiles as well. If false, then "globalProfiles" field would be nullClientPolicyException
public void updateClientPolicies(RealmModel realm, ClientPoliciesRepresentation clientPolicies) throws ClientPolicyException
ClientPolicyManager
updateClientPolicies
in interface ClientPolicyManager
realm
- - the realm whose client policies is to be overriden by the new client policiesclientPolicies
- - the json representation of the new client policies that overrides the existing client policies set on the realmClientPolicyException
public ClientPoliciesRepresentation getClientPolicies(RealmModel realm) throws ClientPolicyException
ClientPolicyManager
getClientPolicies
in interface ClientPolicyManager
realm
- - the realm whose client policies is to be returnedClientPolicyException
public void updateRealmRepresentationFromModel(RealmModel realm, RealmRepresentation rep)
ClientPolicyManager
updateRealmRepresentationFromModel
in interface ClientPolicyManager
realm
- - the realm to be exportedrep
- - the realm's representation to be exported actuallyCopyright © 2021 JBoss by Red Hat. All rights reserved.