Package com.saasovation.common.notification

Examples of com.saasovation.common.notification.PublishedNotificationTracker


        this.setPublishedNotificationTrackerStore(aPublishedNotificationTrackerStore);
    }

    @Override
    public void publishNotifications() {
        PublishedNotificationTracker publishedNotificationTracker =
                this.publishedNotificationTrackerStore().publishedNotificationTracker();

        List<Notification> notifications =
            this.listUnpublishedNotifications(
                    publishedNotificationTracker.mostRecentPublishedNotificationId());

        MessageProducer messageProducer = this.messageProducer();

        try {
            for (Notification notification : notifications) {
View Full Code Here


        this.setPublishedNotificationTrackerStore(aPublishedNotificationTrackerStore);
    }

    @Override
    public void publishNotifications() {
        PublishedNotificationTracker publishedNotificationTracker =
                this.publishedNotificationTrackerStore().publishedNotificationTracker();

        List<Notification> notifications =
            this.listUnpublishedNotifications(
                    publishedNotificationTracker.mostRecentPublishedNotificationId());

        try {
            for (Notification notification : notifications) {
                this.publish(notification);
            }
View Full Code Here

                        "from PublishedNotificationTracker as pnt "
                        + "where pnt.typeName = ?");

        query.setParameter(0, aTypeName);

        PublishedNotificationTracker publishedNotificationTracker = null;

        try {
            publishedNotificationTracker =
                    (PublishedNotificationTracker) query.uniqueResult();
        } catch (Exception e) {
            // fall through
        }

        if (publishedNotificationTracker == null) {
            publishedNotificationTracker =
                    new PublishedNotificationTracker(this.typeName());
        }

        return publishedNotificationTracker;
    }
View Full Code Here

        NotificationLogFactory factory = new NotificationLogFactory(eventStore);
        NotificationLog log = factory.createCurrentNotificationLog();

        this.publishedNotificationTrackerStore
            .trackMostRecentPublishedNotification(
                    new PublishedNotificationTracker("saasOvation_test"),
                    log.notifications());

        LevelDBUnitOfWork.current().commit();

        PublishedNotificationTracker tracker =
                this.publishedNotificationTrackerStore
                    .publishedNotificationTracker();

        int notifications = log.notifications().size();

        assertNotNull(tracker);
        assertEquals(log.notifications().get(notifications - 1).notificationId(),
                tracker.mostRecentPublishedNotificationId());
    }
View Full Code Here

    public PublishedNotificationTracker publishedNotificationTracker(String aTypeName) {
        LevelDBUnitOfWork uow = LevelDBUnitOfWork.readOnly(this.database());

        LevelDBKey primaryKey = new LevelDBKey(PRIMARY, this.typeName());

        PublishedNotificationTracker publishedNotificationTracker =
                uow.readObject(primaryKey, PublishedNotificationTracker.class);

        if (publishedNotificationTracker == null) {
            publishedNotificationTracker = new PublishedNotificationTracker(this.typeName());
        }

        return publishedNotificationTracker;
    }
View Full Code Here

TOP

Related Classes of com.saasovation.common.notification.PublishedNotificationTracker

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.