Package org.keycloak.events
Class EventBuilder
- java.lang.Object
- 
- org.keycloak.events.EventBuilder
 
- 
 public class EventBuilder extends Object - Author:
- Stian Thorgersen
 
- 
- 
Constructor SummaryConstructors Constructor Description EventBuilder(RealmModel realm, KeycloakSession session)EventBuilder(RealmModel realm, KeycloakSession session, ClientConnection clientConnection)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description EventBuilderclient(String clientId)EventBuilderclient(ClientModel client)EventBuilderclone()EventBuilderdetail(String key, String value)EventBuilderdetail(String key, Collection<String> values)Add event detail where strings from the input Collection are filtered not to containnulland then joined using::character.EventBuilderdetail(String key, Stream<String> values)Add event detail where strings from the input Stream are filtered not to containnulland then joined using::character.voiderror(String error)EventBuilderevent(EventType e)EventgetEvent()EventBuilderipAddress(String ipAddress)EventBuilderrealm(String realmId)EventBuilderrealm(RealmModel realm)EventBuilderremoveDetail(String key)EventBuildersession(String sessionId)EventBuildersession(UserSessionModel session)EventBuilderstoreImmediately(boolean forcedValue)Sets the time when to store the event.voidsuccess()EventBuilderuser(String userId)EventBuilderuser(UserModel user)
 
- 
- 
- 
Constructor Detail- 
EventBuilderpublic EventBuilder(RealmModel realm, KeycloakSession session, ClientConnection clientConnection) 
 - 
EventBuilderpublic EventBuilder(RealmModel realm, KeycloakSession session) 
 
- 
 - 
Method Detail- 
realmpublic EventBuilder realm(RealmModel realm) 
 - 
realmpublic EventBuilder realm(String realmId) 
 - 
clientpublic EventBuilder client(ClientModel client) 
 - 
clientpublic EventBuilder client(String clientId) 
 - 
userpublic EventBuilder user(UserModel user) 
 - 
userpublic EventBuilder user(String userId) 
 - 
sessionpublic EventBuilder session(UserSessionModel session) 
 - 
sessionpublic EventBuilder session(String sessionId) 
 - 
ipAddresspublic EventBuilder ipAddress(String ipAddress) 
 - 
eventpublic EventBuilder event(EventType e) 
 - 
detailpublic EventBuilder detail(String key, String value) 
 - 
detailpublic EventBuilder detail(String key, Collection<String> values) Add event detail where strings from the input Collection are filtered not to containnulland then joined using::character.- Parameters:
- key- of the detail
- values- , can be null
- Returns:
- builder for chaining
 
 - 
detailpublic EventBuilder detail(String key, Stream<String> values) Add event detail where strings from the input Stream are filtered not to containnulland then joined using::character.- Parameters:
- key- of the detail
- values- , can be null
- Returns:
- builder for chaining
 
 - 
storeImmediatelypublic EventBuilder storeImmediately(boolean forcedValue) Sets the time when to store the event. By default, events marked as success (success()) are stored upon commit of the session's transaction while the failures (error(java.lang.String)are stored and propagated to the event listeners immediately into the event store.- Parameters:
- forcedValue- If- true, the event is stored in the event store immediately. If- false, the event is stored upon commit.
- Returns:
 
 - 
removeDetailpublic EventBuilder removeDetail(String key) 
 - 
getEventpublic Event getEvent() 
 - 
successpublic void success() 
 - 
errorpublic void error(String error) 
 - 
clonepublic EventBuilder clone() 
 
- 
 
-