Class UserCreatedEvent
- All Implemented Interfaces:
Serializable
There are two scenarios for this event:
- User registration
- Customer create via API. This triggers a User creation event in Auth.
In case #2, the event originates from an action in Customer. This scenario results in a bit of back and forth. There is a soft link between an Auth user and Customer via an attribute on Customer, the "user_id", but when a customer is created via API, an Auth user does not exist. The flow is:
- Customer is created - Triggers customer creation event
- Auth receives customer creation event - Creates user
- Customer receives user created event - Updates customer with auth generated user ID
- Auth receives customer update event - The User data here has not changed. This is a no-op in Auth.
As mentioned above, keep in mind that auth listens to customer update events. Because of this, customer does not listen to auth User update events. We would have an infinite loop of updates as both services would constantly trigger update events. Therefore, any changes to a customer's data that synchronizes with Auth (e.g. name, email, etc.) after initial creation should only be done via the Customer API.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
Additional custom information that was provided as part of the user registration process.getUser()
int
hashCode()
boolean
Indicates whether the user was created from a preview context.void
setAttributes
(Map<String, Object> attributes) Additional custom information that was provided as part of the user registration process.void
setPreview
(boolean preview) Indicates whether the user was created from a preview context.void
toString()
-
Constructor Details
-
UserCreatedEvent
public UserCreatedEvent()
-
-
Method Details
-
isPreview
public boolean isPreview()Indicates whether the user was created from a preview context. -
getAttributes
Additional custom information that was provided as part of the user registration process.Client implementations may choose to populate and utilize this field for custom behavior.
-
setUser
-
setPreview
public void setPreview(boolean preview) Indicates whether the user was created from a preview context. -
setAttributes
Additional custom information that was provided as part of the user registration process.Client implementations may choose to populate and utilize this field for custom behavior.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getUser
-