Interface Publisher<V>

  • Type Parameters:
    V - Type of value to be published. in a form of Result.
    All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable

    public interface Publisher<V>
    extends java.io.Closeable
    NXCALS Ingestion API main interface. It defines methods to send data to the underlying system returning confirmation
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  Publisher.Constants  
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default Result publish​(V value)
      Publishes synchronously the given {@param value} to the NXCALS system.
      default java.util.concurrent.CompletableFuture<Result> publishAsync​(V value)
      Publishes asynchronously the given {@param value} to the NXCALS system.
      java.util.concurrent.CompletableFuture<Result> publishAsync​(V value, java.util.concurrent.Executor executor)
      Publishes asynchronously the given {@param value} to the NXCALS system.
      • Methods inherited from interface java.io.Closeable

        close
    • Method Detail

      • publish

        default Result publish​(V value)
        Publishes synchronously the given {@param value} to the NXCALS system. The invocation is performed using the caller thread.
        Parameters:
        value - the value to be published
        Returns:
        result of the publication
      • publishAsync

        default java.util.concurrent.CompletableFuture<Result> publishAsync​(V value)
        Publishes asynchronously the given {@param value} to the NXCALS system. The invocation is performed using the ForkJoinPool.commonPool() (unless it does not support a parallelism level of at least two, in which case, a new Thread is created to run each task).
        Parameters:
        value - the value to be published
        Returns:
        result of the publication
      • publishAsync

        java.util.concurrent.CompletableFuture<Result> publishAsync​(V value,
                                                                    java.util.concurrent.Executor executor)
        Publishes asynchronously the given {@param value} to the NXCALS system. The invocation is performed using the provided {@param executor}.
        Parameters:
        value - the value to be published
        executor - the executor to perform the publication within.
        Returns:
        result of the publication