Package com.sparc.knappsack.components.events

Examples of com.sparc.knappsack.components.events.EventDelivery


        User user = userService.getUserFromSecurityContext();
        DomainUserRequest domainUserRequest = domainUserRequestService.createDomainUserRequest(user, accessCode);

        if (domainUserRequest != null && domainUserRequest.getId() != null && domainUserRequest.getId() > 0) {
            EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(EventType.DOMAIN_USER_ACCESS_REQUEST);
            if (deliveryMechanism != null) {
                success = deliveryMechanism.sendNotifications(domainUserRequest);
            }
            if (!success) {
                log.error("Error sending DomainAccessRequest email.", domainUserRequest);
                requestService.delete(domainUserRequest.getId());
            }
View Full Code Here


            return "redirect:/home";
        }

        if (userService.activate(user.getId(), code)) {
            userService.updateSecurityContext(userService.get(user.getId()));
            EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(EventType.USER_ACCOUNT_ACTIVATION_SUCCESS);
            if (deliveryMechanism != null) {
                deliveryMechanism.sendNotifications(user);
            }
            redirectAttributes.addFlashAttribute("activationSuccess", true);
            return "redirect:/home";
        } else {
            redirectAttributes.addFlashAttribute("error", true);
View Full Code Here

        User user = userService.getUserFromSecurityContext();

        boolean success = false;

        EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(EventType.USER_ACCOUNT_ACTIVATION);
        if (deliveryMechanism != null) {
            success = deliveryMechanism.sendNotifications(user);
        }

        result.setResult(success);

        return result;
View Full Code Here

        userModel.setPassword(registrationForm.getFirstPassword().trim());

        User user = registrationService.registerUser(userModel, false);
        if (user != null && user.getId() != null && user.getId() > 0) {
            try {
                EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(EventType.USER_ACCOUNT_ACTIVATION);
                if (deliveryMechanism != null) {
                    deliveryMechanism.sendNotifications(user);
                }
            } catch (MailException e) {
                log.error("Error sending Activation email to " + user.getEmail() + ".", e);
                String[] codes = {"registration.emailException"};
                ObjectError error = new ObjectError("registrationForm", codes, null, null);
View Full Code Here

                if (domainRequest != null && domainRequest.getId() != null && domainRequest.getId() > 0) {
                    redirectAttributes.addFlashAttribute("success", true);

                    boolean emailsSent = false;
                    EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(EventType.DOMAIN_ACCESS_REQUEST);
                    if (deliveryMechanism != null) {
                        emailsSent = deliveryMechanism.sendNotifications(domainRequest);
                    }
                    if (!emailsSent) {
                        log.info("Error sending DomainAccessRequest email.", domainRequest);
                    }
                } else {
View Full Code Here

    @Override
    public boolean sendInvitation(List<Invitation> invitations, boolean deleteOnError) {
        boolean invitationSent = false;
        if (!CollectionUtils.isEmpty(invitations)) {
            EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(EventType.USER_INVITE);
            try {
                invitationSent = deliveryMechanism.sendNotifications(invitations);
            } catch (MailException e) {
                log.error("Error during invitations notification.", e);
                if (deleteOnError) {
                    for (Invitation invitation : invitations) {
                        invitationService.delete(invitation.getId());
View Full Code Here

    }

    @Override
    public void sendNotifications(Notifiable notifiable, EventType... eventTypes) {
        for (EventType eventType : eventTypes) {
            EventDelivery eventDelivery = eventDeliveryFactory.getEventDelivery(eventType);
            eventDelivery.sendNotifications(notifiable);
        }
    }
View Full Code Here

        return bandwidthLimitReached;
    }

    private boolean sendBandwidthNotification(Organization organization) {
        boolean success = false;
        EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(EventType.BANDWIDTH_LIMIT_REACHED);
        if (deliveryMechanism != null) {
            success = deliveryMechanism.sendNotifications(organization);
        }
        return success;
    }
View Full Code Here

    }

    private boolean sendNotifications(ApplicationVersion applicationVersion, EventType eventType) {
        boolean success = false;

        EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(eventType);
        if (deliveryMechanism != null) {
            success = deliveryMechanism.sendNotifications(applicationVersion);
        }

        return success;
    }
View Full Code Here

            if (userDomain != null) {
                domainUserRequest.setStatus(Status.ACCEPTED);
//                update(domainUserRequest);

                EventDelivery deliveryMechanism = eventDeliveryFactory.getEventDelivery(EventType.DOMAIN_USER_ACCESS_REQUEST_CONFIRMATION);
                if (deliveryMechanism != null) {
                    if (!deliveryMechanism.sendNotifications(domainUserRequest)) {
                        log.error("Error sending Group Access Request Confirmation Email:", domainUserRequest);
                    }
                }

                delete(domainUserRequest.getId());
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.components.events.EventDelivery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.