Fired while a registration is being processed, before the profile is created, so that an app can refuse it. Mirrors the contract ShoppingCartEvent.createBeforeCheckoutEvent already uses for checkout: a listener that objects adds an error message, and a non-empty list aborts the operation. Registration had no equivalent, which is why this exists. This event is always dispatched synchronously within the request that is registering, and can never be queued - the whole point of it is that the caller waits for the answer. That is why it carries live entities rather than ids: there is no possibility of a handler seeing them in a different session, and a fraud rule asking about the target group should not have to re-resolve it.
Implements: CommonAppEvent
Properties
| Property | Returns | Description |
|---|---|---|
String | The submitted email address. There is no profile yet, so this is the only place to read it from. | |
| errorMessages | List<String> | The reasons this registration should be refused, accumulated by calls to addErrorMessage. |
| group | Group | The group being registered into. |
| ipAddress | String | The client IP address the registration request came from. |
| parameters | Map<String,String> | The submitted form parameters, so a listener can read fields this event does not name explicitly. |
| userName | String | The username that will be created. |
| website | Website | The website the registration was submitted on. |
Methods
getWebsite()
Returns: Website
The website the registration was submitted on.
getGroup()
Returns: Group
The group being registered into.
getEmail()
Returns: String
The submitted email address. There is no profile yet, so this is the only place to read it from.
getUserName()
Returns: String
The username that will be created.
getIpAddress()
Returns: String
The client IP address the registration request came from.
getParameters()
Returns: Map<String,String>
The submitted form parameters, so a listener can read fields this event does not name explicitly.
getErrorMessages()
Returns: List<String>
The reasons this registration should be refused, accumulated by calls to addErrorMessage.
addErrorMessage(String s)
Returns: void
Refuse this registration. Any message added here aborts the registration and is shown to the person registering, so it must be safe to show them.
| Parameter | Description |
|---|---|
s | the reason, shown to the user. Must not be blank |