Class VmMonitor

java.lang.Object
org.jgrapes.core.internal.ComponentVertex
org.jgrapes.core.Component
All Implemented Interfaces:
Iterable<org.jgrapes.core.ComponentType>, org.jgrapes.core.Channel, org.jgrapes.core.ComponentType, org.jgrapes.core.Eligible, org.jgrapes.core.Manager

Watches for changes of VM definitions.

When a VM definition (CR) becomes known, is is registered with a ChannelManager and thus gets an associated VmChannel and an associated EventPipeline.

The EventPipeline is used for submitting an action that processes the change data from kubernetes, eventually transforming it to a VmResourceChanged event that is handled by another EventPipeline associated with the VmChannel. This event pipeline should be used for all events related to changes of a particular VM.

  • Nested Class Summary

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

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

    Fields inherited from class org.jgrapes.core.Component

    logger

    Fields inherited from interface org.jgrapes.core.Channel

    BROADCAST, SELF
  • Constructor Summary

    Constructors
    Constructor
    Description
    VmMonitor(org.jgrapes.core.Channel componentChannel, ChannelManager<String,VmChannel,org.jgrapes.core.EventPipeline> channelManager)
    Instantiates a new VM definition watcher.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    handleChange(K8sClient client, io.kubernetes.client.util.Watch.Response<VmDefinition> response)
    Handle an observed change.
    void
    onModifyVm(ModifyVm event, VmChannel channel)
    On modify vm.
    void
    On pod changed.
    void
    Attempt to Update the assignment information in the status of the VM CR.
    protected void
    Invoked by AbstractMonitor.onStart(Start) after the namespace has been configured and before starting the observer.

    Methods inherited from class org.jdrupes.vmoperator.manager.AbstractMonitor

    client, client, context, context, namespace, namespace, onConfigurationUpdate, onStart, options, options

    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
  • Constructor Details

    • VmMonitor

      public VmMonitor(org.jgrapes.core.Channel componentChannel, ChannelManager<String,VmChannel,org.jgrapes.core.EventPipeline> channelManager)
      Instantiates a new VM definition watcher.
      Parameters:
      componentChannel - the component channel
      channelManager - the channel manager
  • Method Details