Class VmDefUpdater

java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
org.jdrupes.vmoperator.runner.qemu.VmDefUpdater
All Implemented Interfaces:
Iterable<org.jgrapes.core.ComponentType>, org.jgrapes.core.Channel, org.jgrapes.core.ComponentType, org.jgrapes.core.Eligible, org.jgrapes.core.Manager
Direct Known Subclasses:
ConsoleTracker, StatusUpdater

public class VmDefUpdater extends org.jgrapes.core.Component
Updates the CR status.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.jgrapes.core.Channel

    org.jgrapes.core.Channel.Default
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected K8sClient
     
    protected String
     
    protected String
     

    Fields inherited from class org.jgrapes.core.Component

    logger

    Fields inherited from interface org.jgrapes.core.Channel

    BROADCAST, SELF
  • Constructor Summary

    Constructors
    Constructor
    Description
    VmDefUpdater(org.jgrapes.core.Channel componentChannel)
    Instantiates a new status updater.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onConfigurationUpdate(org.jgrapes.util.events.ConfigurationUpdate event)
    On configuration update.
    protected com.google.gson.JsonObject
    updateCondition(VmDefinition from, String type, boolean state, String reason, String message)
    Update condition.

    Methods inherited from class org.jgrapes.core.Component

    channel, component, defaultCriterion, isEligibleFor, setName

    Methods inherited from class org.jgrapes.core.internal.ComponentVertex

    activeEventPipeline, addHandler, attach, channelReplacements, children, componentPath, componentVertex, detach, fire, initComponentsHandlers, iterator, name, newEventPipeline, newEventPipeline, parent, registerAsGenerator, root, toString, unregisterAsGenerator

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface org.jgrapes.core.Manager

    stream
  • Field Details

  • Constructor Details

    • VmDefUpdater

      public VmDefUpdater(org.jgrapes.core.Channel componentChannel)
      Instantiates a new status updater.
      Parameters:
      componentChannel - the component channel
      Throws:
      IOException
  • Method Details

    • onConfigurationUpdate

      @Handler public void onConfigurationUpdate(org.jgrapes.util.events.ConfigurationUpdate event)
      On configuration update.
      Parameters:
      event - the event
    • updateCondition

      protected com.google.gson.JsonObject updateCondition(VmDefinition from, String type, boolean state, String reason, String message)
      Update condition.

      The from VM definition is used to determine the observed generation and the current status. This method is intended to be called in the function passed to K8sGenericStub.updateStatus(O, java.util.function.Function<O, java.lang.Object>).

      Parameters:
      from - the VM definition
      type - the condition type
      state - the new state
      reason - the reason for the change
      message - the message
      Returns:
      the updated status