Package org.axonframework.sample.app.query

Examples of org.axonframework.sample.app.query.ContactEntry


        publisher.publish(new Message<AddressEntry>("address-created", value));
    }

    @EventHandler
    public void handleAddressRemovedEvent(AddressRemovedEvent event) {
        ContactEntry contactEntry = obtainContactByIdentifier(event.getContactId());
        logger.debug("Received an address removed event with type {} for contact {}",
                     event.getType(),
                     contactEntry.getIdentifier());
        Map<String, Object> message = new HashMap<String, Object>();
        message.put("contact", contactEntry);
        message.put("addressType", event.getType());
        publisher.publish(new Message<Map<String, Object>>("address-removed", message));
    }
View Full Code Here


        Contact contact = repository.load(command.getContactId());
        contact.removeAddress(command.getAddressType());
    }

    private void cancelClaimedContactName(String contactIdentifier, UnitOfWork unitOfWork) {
        final ContactEntry contactEntry = contactRepository.loadContactDetails(contactIdentifier);
        unitOfWork.registerListener(new UnitOfWorkListenerAdapter() {
            @Override
            public void afterCommit(UnitOfWork uow) {
                logger.debug("About to cancel the name {}", contactEntry.getName());
                contactNameRepository.cancelContactName(contactEntry.getName());
            }
        });
    }
View Full Code Here

    @Override
    public void valueChange(Property.ValueChangeEvent event) {
        Property property = event.getProperty();
        if (property == contactList) {
            @SuppressWarnings({"unchecked"})
            ContactEntry item = ((BeanItem<ContactEntry>) contactList.getItem(contactList.getValue())).getBean();
            ContactFormBean contactFormBean = new ContactFormBean(item.getIdentifier(), item.getName());
            contactForm.setItemDataSource(new BeanItem<ContactFormBean>(contactFormBean));
        }
    }
View Full Code Here

TOP

Related Classes of org.axonframework.sample.app.query.ContactEntry

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.