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

sdmxdl.web.SdmxWebListener Maven / Gradle / Ivy

There is a newer version: 3.0.0-beta.14
Show newest version
package sdmxdl.web;

import internal.sdmxdl.FunctionalListener;
import internal.sdmxdl.SdmxListeners;
import nbbrd.design.StaticFactoryMethod;
import nbbrd.design.ThreadSafe;
import org.checkerframework.checker.nullness.qual.NonNull;

import java.util.function.BiConsumer;

@ThreadSafe
public interface SdmxWebListener {

    boolean isEnabled();

    void onWebSourceEvent(@NonNull SdmxWebSource source, @NonNull String message);

    @StaticFactoryMethod
    static @NonNull SdmxWebListener getDefault() {
        return SdmxListeners.LOG_TO_INFO;
    }

    @StaticFactoryMethod
    static @NonNull SdmxWebListener noOp() {
        return SdmxListeners.NO_OP;
    }

    @StaticFactoryMethod
    static @NonNull SdmxWebListener of(@NonNull BiConsumer listener) {
        return FunctionalListener.builder().onWeb(listener).build();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy