Class CloudServiceDeferredStateEvent

java.lang.Object
eu.cloudnetservice.driver.event.Event
eu.cloudnetservice.driver.event.events.service.CloudServiceDeferredStateEvent

public final class CloudServiceDeferredStateEvent extends Event
An event which gets called when a deferred service creation gets a state update, either by successfully creating the service or by failing if the maximum retry count is reached.

This event is only called on all channel message receivers which were defined previously.

Since:
4.0
  • Field Details

  • Constructor Details

    • CloudServiceDeferredStateEvent

      public CloudServiceDeferredStateEvent(@NonNull @NonNull UUID creationId, @NonNull @NonNull ServiceCreateResult createResult)
      Constructs a new deferred state event instance.
      Parameters:
      creationId - the id submitted in the initial result of the service creation.
      createResult - the result of the creation process.
      Throws:
      NullPointerException - if the given creation id or result is null.
  • Method Details

    • deferredCreationId

      @NonNull public @NonNull UUID deferredCreationId()
      Get the id of the deferred result this event is associated with. The same id was given in the service create result with the DEFERRED state.
      Returns:
      the creation id of the deferred service.
    • state

      Get the state of the service creation. Equivalent to serviceCreateResult().state().
      Returns:
      the state of the service creation.
    • createdService

      @NonNull public @NonNull ServiceInfoSnapshot createdService()
      Get the underlying service of the service result. This method throws an exception if the state of the creation is not CREATED. Equivalent to serviceCreateResult().createdService().
      Returns:
      the underlying service of the service result.
      Throws:
      IllegalStateException - if the underlying result was not completed successfully.
    • serviceCreateResult

      @NonNull public @NonNull ServiceCreateResult serviceCreateResult()
      Get the raw underlying create result.
      Returns:
      the raw underlying create result.