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

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

The newest version!
package sdmxdl.web.spi;

import internal.sdmxdl.web.spi.NoOpRegistry;
import lombok.NonNull;
import nbbrd.design.StaticFactoryMethod;
import nbbrd.design.ThreadSafe;
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.ext.Persistence;
import sdmxdl.web.WebSources;

import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

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

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

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

    @NonNull WebSources getSources(
            @NonNull List persistences,
            @Nullable Consumer onEvent,
            @Nullable BiConsumer onError);

    @NonNull Collection getRegistryProperties();

    @StaticFactoryMethod
    static @NonNull Registry noOp() {
        return NoOpRegistry.INSTANCE;
    }

    int UNKNOWN_REGISTRY_RANK = -1;

    String REGISTRY_PROPERTY_PREFIX = "sdmxdl.registry";
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy