Record Class PluginTaskOutcome

java.lang.Object
java.lang.Record
com.xebialabs.xlrelease.domain.tasks.plugin.PluginTaskOutcome
Record Components:
kind - what to do with the task
message - failure message; only set when kind is PluginTaskOutcome.Kind.FAILED
delay - re-entry delay; only set when kind is PluginTaskOutcome.Kind.SUSPEND_FOR
results - output properties and status line to persist, whatever the kind

public record PluginTaskOutcome(PluginTaskOutcome.Kind kind, String message, Duration delay, PluginTaskResults results) extends Record
The host-side translation of what a TaskExecutorExtension returned, plus everything the execution context collected while it ran.

Deliberately a separate type from the plugin-facing TaskExecutionResult: the worker must hand a plain value back to processResult, and that value must not be an object graph loaded from the plugin's bundle classloader - holding one across the result-processing boundary would pin the bundle and defeat clean uninstall.

  • Constructor Details

    • PluginTaskOutcome

      public PluginTaskOutcome(PluginTaskOutcome.Kind kind, String message, Duration delay, PluginTaskResults results)
      Creates an instance of a PluginTaskOutcome record class.
      Parameters:
      kind - the value for the kind record component
      message - the value for the message record component
      delay - the value for the delay record component
      results - the value for the results record component
  • Method Details

    • from

      public static PluginTaskOutcome from(com.xebialabs.xlrelease.osgi.api.tasks.TaskExecutionResult result, PluginTaskOutcome.ResultsFactory results)
      Translates a plugin-returned result, taking the results from results so the suspension intent travels with the output properties - exactly as CustomScriptTaskResults carries nextScriptPath/interval alongside its output variables.
      Parameters:
      result - may be null if an extension misbehaves
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • kind

      public PluginTaskOutcome.Kind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • message

      public String message()
      Returns the value of the message record component.
      Returns:
      the value of the message record component
    • delay

      public Duration delay()
      Returns the value of the delay record component.
      Returns:
      the value of the delay record component
    • results

      public PluginTaskResults results()
      Returns the value of the results record component.
      Returns:
      the value of the results record component