Package org.axonframework.sample.app.api

Examples of org.axonframework.sample.app.api.RemoveContactCommand


    }

    @RequestMapping(value = "{identifier}/delete", method = RequestMethod.POST)
    public String formDelete(@ModelAttribute("contact") ContactEntry contact, BindingResult bindingResult) {
        if (!bindingResult.hasErrors()) {
            RemoveContactCommand command = new RemoveContactCommand();
            command.setContactId(contact.getIdentifier());
            commandBus.dispatch(new GenericCommandMessage<Object>(command));

            return "redirect:/contacts";
        }
        return "contacts/delete";
View Full Code Here


    @RequestMapping(method = RequestMethod.DELETE)
    public void delete(@RequestBody ContactEntry contact) throws MissingServletRequestParameterException {
        if (!StringUtils.hasText(contact.getIdentifier())) {
            throw new MissingServletRequestParameterException("identifier", "String");
        }
        RemoveContactCommand command = new RemoveContactCommand();
        command.setContactId(contact.getIdentifier());
        commandBus.dispatch(new GenericCommandMessage<Object>(command));
    }
View Full Code Here

    }

    private void handleDelete() {
        setReadOnly(true);
        ContactFormBean contact = obtainContactFormBeanFromDatasource();
        RemoveContactCommand command = new RemoveContactCommand();
        command.setContactId(contact.getIdentifier());
        commandBus.dispatch(new GenericCommandMessage<Object>(command));
        String message = "Removed the contact with name " + contact.getName();
        fireEvent(new FormIsSuccessfullyCommittedEvent(this));
        getApplication().getMainWindow().showNotification(message, Window.Notification.TYPE_TRAY_NOTIFICATION);
    }
View Full Code Here

TOP

Related Classes of org.axonframework.sample.app.api.RemoveContactCommand

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.