All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.randombits.confluence.metadata.event.MetadataUpdatedEvent Maven / Gradle / Ivy

There is a newer version: 7.4.1
Show newest version
package org.randombits.confluence.metadata.event;

import com.atlassian.confluence.event.events.ConfluenceEvent;
import com.atlassian.confluence.event.events.cluster.ClusterEvent;
import org.randombits.confluence.metadata.MetadataStorage;

/**
 * Event to fire when a metadata is updated (to indicate that, e.g. indexes on other nodes need update).
 * Refer to:
 * https://developer.atlassian.com/confdev/development-resources/confluence-developer-faq/how-do-i-ensure-my-add-on-works-properly-in-a-cluster#HowdoIensuremyadd-onworksproperlyinacluster
 *
 * @author LongYC
 * @since 7.0.0.20150209
 */
public class MetadataUpdatedEvent extends ConfluenceEvent implements ClusterEvent {

    private final MetadataStorage metadataStorage;
    private boolean buildIndex;

    public MetadataUpdatedEvent(MetadataUpdatedEventEmitter eventSource, MetadataStorage metadataStorage) {
        this(eventSource, metadataStorage, true);
    }

    public MetadataUpdatedEvent(MetadataUpdatedEventEmitter eventSource, MetadataStorage metadataStorage, boolean buildIndex) {
        super(eventSource);
        this.metadataStorage = metadataStorage;
        this.buildIndex = buildIndex;
    }

    public boolean shouldBuildIndex() {
        return buildIndex;
    }

    public MetadataStorage getMetadataStorage() {
        return metadataStorage;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy