Record Class PawSource

java.lang.Object
java.lang.Record
io.skipcheck.tm1.testcontainers.PawSource
Record Components:
zip - the PAW Local zip; made absolute

public record PawSource(Path zip) extends Record
Where a PawContainer gets Planning Analytics Workspace from: IBM's PAW Local zip, ipa_workspace_local_<release>.<build>.zip.

IBM ships PAW Local as Docker images, compose files and scripts in that zip. Nothing from it is in this library, so every PawContainer needs one.

discover() finds one from the environment. Each setting is read first as a system property and then as an environment variable, under the same name, the names docker/paw/paw-local.sh uses:

  1. PAW_ZIP: the zip itself
  2. PAW_BUNDLE_DIR: a folder holding it; the newest ipa_workspace_local_*.zip there is used
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    A folder holding the PAW Local zip; the newest one there is used.
    static final String
    The PAW Local zip.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Makes the path absolute and checks it's a file.
  • Method Summary

    Modifier and Type
    Method
    Description
    A short description for logs and messages.
    Finds a source from system properties and environment variables.
    discover(Function<String, @Nullable String> lookup)
    Finds a source using lookup to read each setting.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.
    zip()
    Returns the value of the zip record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • PawSource

      public PawSource(Path zip)
      Makes the path absolute and checks it's a file.
  • Method Details

    • describe

      public String describe()
      A short description for logs and messages.
      Returns:
      the description
    • discover

      public static Optional<PawSource> discover()
      Finds a source from system properties and environment variables. See the class docs.
      Returns:
      the source, or empty if none is configured
      Throws:
      IllegalArgumentException - if a setting is present but invalid
    • discover

      public static Optional<PawSource> discover(Function<String, @Nullable String> lookup)
      Finds a source using lookup to read each setting. Blank values count as unset.
      Parameters:
      lookup - reads a setting by name, returning null if it's unset
      Returns:
      the source, or empty if none is configured
      Throws:
      IllegalArgumentException - if a setting is present but invalid, such as a folder with no PAW Local zip in it. A wrong setting fails rather than silently skipping the tests.
    • 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.
    • zip

      public Path zip()
      Returns the value of the zip record component.
      Returns:
      the value of the zip record component