use of io.apiman.manager.api.beans.events.ClientVersionStatusEvent in project apiman by apiman.
the class ClientAppRegisteredEmailNotification method wants.
/**
* If a status change event && has transitioned into 'registered' state.
*/
@Override
public boolean wants(NotificationDto<? extends IVersionedApimanEvent> raw) {
if (raw.getReason().equals(ClientAppStatusNotificationProducer.APIMAN_CLIENT_STATUS_CHANGE)) {
// Get the event payload
NotificationDto<ClientVersionStatusEvent> notification = (NotificationDto<ClientVersionStatusEvent>) raw;
ClientVersionStatusEvent event = notification.getPayload();
// We only want to send a notification if the previous state was unregistered, and new state is registered (for now).
return (event.getNewStatus() == ClientStatus.Registered && event.getPreviousStatus() == ClientStatus.AwaitingApproval);
}
return false;
}
Aggregations