class PutRoleMembershipNotificationTask implements NotificationTask {

    @Override
    public List<Notification> getNotifications() {
        // we need to generate the appropriate recipients for the notification
        // there are 2 possible use cases we need to handle here:
        // a) audit enabled role - we need to add the domain and org roles
        //          from the sys.auth.audit domain
        // b) review/self-serve roles - we need to look at the configured
        //          role list for notification and if not present then default
        //          to the admin role from the domain

        Set<String> recipients = new HashSet<>();
        if (role.getAuditEnabled() == Boolean.TRUE) {

            recipients.add(ZMSUtils.roleResourceName(ZMSConsts.SYS_AUTH_AUDIT_BY_DOMAIN, domain));
            recipients.add(ZMSUtils.roleResourceName(ZMSConsts.SYS_AUTH_AUDIT_BY_ORG, org));

        } else {

            // if we're given a notify role list then we're going
            // to add those role members to the recipient list
            // otherwise use the admin role for the domain

            final String notifyRoles = role.getNotifyRoles();
            if (notifyRoles == null || notifyRoles.isEmpty()) {
                recipients.add(ZMSUtils.roleResourceName(domain, ZMSConsts.ADMIN_ROLE_NAME));
            } else {
                Iterable<String> roleNames = Splitter.on(',')
                        .omitEmptyStrings()
                        .trimResults()
                        .split(notifyRoles);

                for (String roleName : roleNames) {
                    if (roleName.indexOf(AuthorityConsts.ROLE_SEP) == -1) {
                        recipients.add(ZMSUtils.roleResourceName(domain, roleName));
                    } else {
                        recipients.add(roleName);
                    }
                }
            }
        }

        // create and process our notification

        return Collections.singletonList(notificationCommon.createNotification(
                recipients,
                details,
                putMembershipNotificationToEmailConverter,
                NOTIFICATION_TYPE));
    }

    public  PutRoleMembershipNotificationTask(String domain, String org, Role role, Map<String, String> details, DBService dbService, String userDomainPrefix);

}