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

sdmxdl.web.spi.WebCaching Maven / Gradle / Ivy

The newest version!
package sdmxdl.web.spi;

import internal.sdmxdl.NoOpCaching;
import lombok.NonNull;
import nbbrd.design.StaticFactoryMethod;
import nbbrd.service.Quantifier;
import nbbrd.service.ServiceDefinition;
import nbbrd.service.ServiceId;
import nbbrd.service.ServiceSorter;
import org.checkerframework.checker.nullness.qual.Nullable;
import sdmxdl.DataRepository;
import sdmxdl.ErrorListener;
import sdmxdl.EventListener;
import sdmxdl.ext.Cache;
import sdmxdl.ext.Persistence;
import sdmxdl.web.MonitorReports;
import sdmxdl.web.WebSource;

import java.util.Collection;
import java.util.List;

@ServiceDefinition(
        quantifier = Quantifier.SINGLE,
        fallback = NoOpCaching.class,
        loaderName = "internal.{{canonicalName}}Loader"
)
public interface WebCaching {

    @ServiceId(pattern = ServiceId.SCREAMING_SNAKE_CASE)
    @NonNull String getWebCachingId();

    @ServiceSorter(reverse = true)
    int getWebCachingRank();

    @NonNull Cache getDriverCache(
            @NonNull WebSource source,
            @NonNull List persistences,
            @Nullable EventListener onEvent,
            @Nullable ErrorListener onError);

    @NonNull Cache getMonitorCache(
            @NonNull WebSource source,
            @NonNull List persistences,
            @Nullable EventListener onEvent,
            @Nullable ErrorListener onError);

    @NonNull Collection getWebCachingProperties();

    @StaticFactoryMethod
    static @NonNull WebCaching noOp() {
        return NoOpCaching.INSTANCE;
    }

    int UNKNOWN_WEB_CACHING_RANK = -1;

    String WEB_CACHING_PROPERTY_PREFIX = "sdmxdl.caching";
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy