Class VmChannel

java.lang.Object
org.jgrapes.core.Subchannel.DefaultSubchannel
org.jdrupes.vmoperator.manager.events.VmChannel
All Implemented Interfaces:
org.jgrapes.core.Associator, org.jgrapes.core.Channel, org.jgrapes.core.Eligible, org.jgrapes.core.Subchannel

public class VmChannel extends org.jgrapes.core.Subchannel.DefaultSubchannel
A subchannel used to send the events related to a specific VM.
  • Nested Class Summary

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

    org.jgrapes.core.Channel.Default

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

    org.jgrapes.core.Subchannel.DefaultSubchannel
  • Field Summary

    Fields inherited from interface org.jgrapes.core.Channel

    BROADCAST, SELF
  • Constructor Summary

    Constructors
    Constructor
    Description
    VmChannel(org.jgrapes.core.Channel mainChannel, org.jgrapes.core.EventPipeline pipeline, K8sClient client)
    Instantiates a new watch channel.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the API client.
    <T extends org.jgrapes.core.Event<?>>
    T
    fire(T event)
    Fire the given event on this channel, using the associated pipeline().
    long
    Gets the last processed generation.
    org.jgrapes.core.EventPipeline
    Returns the pipeline.
    boolean
    setGeneration(long generation)
    Sets the last processed generation.
    Sets the last known definition of the resource.
    Returns the last known definition of the VM.

    Methods inherited from class org.jgrapes.core.Subchannel.DefaultSubchannel

    associated, mainChannel, setAssociated, toString

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.jgrapes.core.Associator

    associated, associated, associated, associatedGet

    Methods inherited from interface org.jgrapes.core.Subchannel

    defaultCriterion, isEligibleFor
  • Constructor Details

    • VmChannel

      public VmChannel(org.jgrapes.core.Channel mainChannel, org.jgrapes.core.EventPipeline pipeline, K8sClient client)
      Instantiates a new watch channel.
      Parameters:
      mainChannel - the main channel
      pipeline - the pipeline
      client - the client
  • Method Details

    • setVmDefinition

      public VmChannel setVmDefinition(VmDefinition definition)
      Sets the last known definition of the resource.
      Parameters:
      definition - the definition
      Returns:
      the watch channel
    • vmDefinition

      Returns the last known definition of the VM.
      Returns:
      the defintion
    • generation

      public long generation()
      Gets the last processed generation.

      Returns -1 if no definition has been processed yet.

      Returns:
      the generation
    • setGeneration

      public boolean setGeneration(long generation)
      Sets the last processed generation.
      Parameters:
      generation - the generation to set
      Returns:
      true if value has changed
    • pipeline

      public org.jgrapes.core.EventPipeline pipeline()
      Returns the pipeline.
      Returns:
      the event pipeline
    • fire

      public <T extends org.jgrapes.core.Event<?>> T fire(T event)
      Fire the given event on this channel, using the associated pipeline().
      Type Parameters:
      T - the generic type
      Parameters:
      event - the event
      Returns:
      the t
    • client

      public K8sClient client()
      Returns the API client.
      Returns:
      the API client