Class Tool

java.lang.Object
org.ivoa.dm.tool.Tool
All Implemented Interfaces:
org.ivoa.vodml.jaxb.XmlIdManagement, org.ivoa.vodml.jpa.JPAManipulations, org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>

@Entity @VoDml(id="tool:Tool", role=objectType) public class Tool extends Object implements org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>, org.ivoa.vodml.jaxb.XmlIdManagement
Definition of a Library Tool. objectType: Tool
  • Field Details

    • id

      @VoDml(id="tool:Tool.id", role=attribute, type="ivoa:string", typeRole=primitiveType) protected String id
      Unique tool identifier. : Attribute id type ivoa:string : multiplicity 1
    • image

      @VoDml(id="tool:Tool.image", role=reference, type="tool:ToolImage", typeRole=objectType) protected ToolImage image
      ReferenceObject image : Tool container image reference. ( Multiplicity : 1 )
    • command

      @VoDml(id="tool:Tool.command", role=attribute, type="ivoa:string", typeRole=primitiveType) protected List<String> command
      Tokenized initial command; supports {{inputs.key}} min_length=1. : Attribute command type ivoa:string : multiplicity 1..*
    • env

      @VoDml(id="tool:Tool.env", role=composition, type="tool:EnvVar", typeRole=objectType) protected List<EnvVar> env
      Environment map entries. composition env : ( Multiplicity : 0..* )
    • interface_

      @VoDml(id="tool:Tool.interface", role=composition, type="pdl:ToolInterface", typeRole=objectType) protected ToolInterface interface_
      Tool interface definition - note that the inputs will be mounted in the /inputs directory and the outputs in the /outputs directory. composition interface : ( Multiplicity : 1 )
    • performanceProfile

      @VoDml(id="tool:Tool.performanceProfile", role=composition, type="tool:PerformanceProfile", typeRole=objectType) protected PerformanceProfile performanceProfile
      Performance profile for the tool. composition performanceProfile : ( Multiplicity : 1 )
  • Constructor Details

    • Tool

      public Tool()
      Creates a new Tool
    • Tool

      public Tool(String id, ToolImage image, List<String> command, List<EnvVar> env, ToolInterface interface_, PerformanceProfile performanceProfile)
      full parameter constructor.
      Parameters:
      id - Unique tool identifier.
      image - Tool container image reference.
      command - Tokenized initial command; supports {{inputs.key}} min_length=1.
      env - Environment map entries.
      interface_ - Tool interface definition - note that the inputs will be mounted in the /inputs directory and the outputs in the /outputs directory.
      performanceProfile - Performance profile for the tool.
    • Tool

      public Tool(Tool other)
      Copy Constructor. Note that references will remain as is rather than be copied.
      Parameters:
      other - the object to be copied.
  • Method Details

    • updateClonedReferences

      public void updateClonedReferences()
      updates any cloned references that are contained within the hierarchy.
    • updateUsing

      public void updateUsing(Tool other)
      Update this object with the content of the given object. Note that references will remain as is rather than be copied.
      Parameters:
      other - the object to be copied.
    • getId

      public String getId()
      Returns id Attribute.
      Specified by:
      getId in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>
      Returns:
      id Attribute
    • setId

      public void setId(String pId)
      Set id Attribute.
      Parameters:
      pId - value to set
    • withId

      public Tool withId(String pId)
      fluent setter for id Attribute.
      Parameters:
      pId - value to set
      Returns:
      Tool
    • getImage

      public ToolImage getImage()
      Returns image Reference
      Returns:
      image Reference
    • setImage

      public void setImage(ToolImage pImage)
      Defines image Reference
      Parameters:
      pImage - reference to set
    • getCommand

      public List<String> getCommand()
      Returns command Attribute.
      Returns:
      command Attribute
    • setCommand

      public void setCommand(List<String> pCommand)
      Set command Attribute.
      Parameters:
      pCommand - value to set
    • withCommand

      public Tool withCommand(List<String> pCommand)
      fluent setter for command Attribute.
      Parameters:
      pCommand - value to set
      Returns:
      Tool
    • getEnv

      public List<EnvVar> getEnv()
      Returns env composition as an immutable list.
      Returns:
      env composition.
    • setEnv

      public void setEnv(List<EnvVar> pEnv)
      Defines whole env composition.
      Parameters:
      pEnv - composition to set.
    • addToEnv

      public void addToEnv(EnvVar p)
      Add a org.ivoa.dm.tool.EnvVar to the composition.
      Parameters:
      p - org.ivoa.dm.tool.EnvVar to add
    • removeFromEnv

      public void removeFromEnv(EnvVar p)
      Remove a org.ivoa.dm.tool.EnvVar from the composition.
      Parameters:
      p - org.ivoa.dm.tool.EnvVar to remove
    • replaceInEnv

      public void replaceInEnv(EnvVar _p)
      update a org.ivoa.dm.tool.EnvVar in the composition.
      Parameters:
      _p - org.ivoa.dm.tool.EnvVar to update the match is done via the database key
    • getInterface

      public ToolInterface getInterface()
      Returns interface Attribute.
      Returns:
      interface Attribute
    • setInterface

      public void setInterface(ToolInterface pInterface)
      Set interface Attribute.
      Parameters:
      pInterface - value to set
    • withInterface

      public Tool withInterface(ToolInterface pInterface)
      fluent setter for interface Attribute.
      Parameters:
      pInterface - value to set
      Returns:
      Tool
    • getPerformanceProfile

      public PerformanceProfile getPerformanceProfile()
      Returns performanceProfile Attribute.
      Returns:
      performanceProfile Attribute
    • setPerformanceProfile

      public void setPerformanceProfile(PerformanceProfile pPerformanceProfile)
      Set performanceProfile Attribute.
      Parameters:
      pPerformanceProfile - value to set
    • withPerformanceProfile

      public Tool withPerformanceProfile(PerformanceProfile pPerformanceProfile)
      fluent setter for performanceProfile Attribute.
      Parameters:
      pPerformanceProfile - value to set
      Returns:
      Tool
    • getXmlId

      public String getXmlId()
      Specified by:
      getXmlId in interface org.ivoa.vodml.jaxb.XmlIdManagement
    • setXmlId

      public void setXmlId(String id)
      Specified by:
      setXmlId in interface org.ivoa.vodml.jaxb.XmlIdManagement
    • hasNaturalKey

      public boolean hasNaturalKey()
      Specified by:
      hasNaturalKey in interface org.ivoa.vodml.jaxb.XmlIdManagement
    • createTool

      public static Tool createTool(Consumer<Tool.ToolBuilder> f)
      create a Tool in functional builder style.
      Parameters:
      f - the functional builder.
      Returns:
      an object initialized from the builder.
    • forceLoad

      public void forceLoad()
      Specified by:
      forceLoad in interface org.ivoa.vodml.jpa.JPAManipulations
    • delete

      public void delete(jakarta.persistence.EntityManager em)
      Specified by:
      delete in interface org.ivoa.vodml.jpa.JPAManipulationsForObjectType<String>