Class HealthChecks

java.lang.Object
io.vertx.mutiny.ext.healthchecks.HealthChecks
All Implemented Interfaces:
MutinyDelegate

public class HealthChecks extends Object implements MutinyDelegate

NOTE: This class has been automatically generated from the original non Mutiny-ified interface.

Author:
Clement Escoffier
See Also:
  • HealthChecks
  • Field Details

  • Constructor Details

    • HealthChecks

      public HealthChecks(io.vertx.ext.healthchecks.HealthChecks delegate)
      Create a new instance of HealthChecks delegating to the given (non-null) instance of HealthChecks.
    • HealthChecks

      public HealthChecks(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.healthchecks.HealthChecks getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • invoke

      @CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.core.json.JsonObject> invoke(String name)
      Invokes the registered procedure with the given name and sub-procedures. It computes the overall outcome.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HealthChecks.invoke(String)
    • invokeAndAwait

      public io.vertx.core.json.JsonObject invokeAndAwait(String name)
      Invokes the registered procedure with the given name and sub-procedures. It computes the overall outcome.

      Unlike the bare Vert.x variant, this method returns a JsonObject. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • HealthChecks.invoke(String)
    • invokeAndForget

      public HealthChecks invokeAndForget(String name)
      Invokes the registered procedure with the given name and sub-procedures. It computes the overall outcome.

      Unlike the bare Vert.x variant, this method ignores the JsonObject result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HealthChecks.invoke(String)
    • checkStatus

      @CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.CheckResult> checkStatus()
      Invokes the registered procedures.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HealthChecks.checkStatus()
    • checkStatusAndAwait

      public io.vertx.ext.healthchecks.CheckResult checkStatusAndAwait()
      Invokes the registered procedures.

      Unlike the bare Vert.x variant, this method returns a CheckResult. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • HealthChecks.checkStatus()
    • checkStatusAndForget

      public HealthChecks checkStatusAndForget()
      Invokes the registered procedures.

      Unlike the bare Vert.x variant, this method ignores the CheckResult result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HealthChecks.checkStatus()
    • checkStatus

      @CheckReturnValue public io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.CheckResult> checkStatus(String name)
      Invokes the registered procedure with the given name and sub-procedures.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • HealthChecks.checkStatus(String)
    • checkStatusAndAwait

      public io.vertx.ext.healthchecks.CheckResult checkStatusAndAwait(String name)
      Invokes the registered procedure with the given name and sub-procedures.

      Unlike the bare Vert.x variant, this method returns a CheckResult. This method awaits indefinitely for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

      Returns:
      The operation result
      See Also:
      • HealthChecks.checkStatus(String)
    • checkStatusAndForget

      public HealthChecks checkStatusAndForget(String name)
      Invokes the registered procedure with the given name and sub-procedures.

      Unlike the bare Vert.x variant, this method ignores the CheckResult result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • HealthChecks.checkStatus(String)
    • create

      public static HealthChecks create(Vertx vertx)
      Creates a new instance of the default implementation of HealthChecks.
      Parameters:
      vertx - the instance of Vert.x, must not be null
      Returns:
      the created instance
    • register

      public HealthChecks register(String name, io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.Status> procedure)
      Registers a health check procedure.

      The procedure is a Handler taking a Promise of Status as parameter. Procedures are asynchronous, and must complete or fail the given Promise. If the future object is failed, the procedure outcome is considered as `DOWN`. If the future is completed without any object, the procedure outcome is considered as `UP`. If the future is completed with a (not-null) Status, the procedure outcome is the received status.

      This method uses a 1s timeout. Use #register(String, long, Handler) to configure the timeout.

      Parameters:
      name - the name of the procedure, must not be null or empty
      procedure - the procedure, must not be null
      Returns:
      the current HealthChecks
    • register

      public HealthChecks register(String name, long timeout, io.smallrye.mutiny.Uni<io.vertx.ext.healthchecks.Status> procedure)
      Registers a health check procedure.

      The procedure is a Handler taking a Promise of Status as parameter. Procedures are asynchronous, and must complete or fail the given Promise. If the future object is failed, the procedure outcome is considered as `DOWN`. If the future is completed without any object, the procedure outcome is considered as `UP`. If the future is completed with a (not-null) Status, the procedure outcome is the received status.

      Parameters:
      name - the name of the procedure, must not be null or empty
      timeout - the procedure timeout in milliseconds
      procedure - the procedure, must not be null
      Returns:
      the current HealthChecks
    • unregister

      public HealthChecks unregister(String name)
      Unregisters a procedure.
      Parameters:
      name - the name of the procedure
      Returns:
      the current HealthChecks
    • invoke

      public HealthChecks invoke(Consumer<io.vertx.core.json.JsonObject> resultHandler)
      Invokes the registered procedures and computes the outcome.
      Parameters:
      resultHandler - the result handler, must not be null. The handler received the computed JsonObject.
      Returns:
      the current HealthChecks
    • newInstance

      public static HealthChecks newInstance(io.vertx.ext.healthchecks.HealthChecks delegate)
      Creates a new instance of the HealthChecks.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object