Class Components

java.lang.Object
org.jenkinsci.plugins.slave_setup.Components

public class Components extends Object
We are going to store in cache the master delimiter and each node delimiter while they are deployed.
Author:
ByteHeed:, Mikel Royo Gutierrez, Aaron Giovannini
  • Constructor Summary

    Constructors
    Constructor
    Description
    Components(FilePath remoteRootPath, Computer slave)
    Add construction description, Checks if config exists and creates it, then store all remote objects to be used at deploy time
    Call Components(slave.getNode().getRootPath(), slave) Add construction description, Checks if config exists and creates it, then store all remote objects to be used at deploy time
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    debug(String message)
    Print only if debug enabled (debug purposes)
    static void
    Just disable debug Mode
    void
    Iterates over all instance's SetupConfigItem performing/calling a singleSetup for each SetupConfigItem
    static boolean
    doConfigSetups(List<Computer> activeSlaves)
    Iterates over all given computers performing the doConfig for each computer
    void
    Slave setup flow, here, the method iterates all SetupItems and if not installed jet, will call doDeploy
    static boolean
    doSetups(List<Computer> activeSlaves)
    Iterates over all the given computers list seting up or updating the installation if required.
    static void
    Just enable debug mode
    static void
    info(String message)
    Global printer to return logger to master
    boolean
    Check if slave contains some setup configured as false,it means that is first time connection or any designed setup.
    static void
    Required method to define logging procedures
    void
    Performs the execution of the config item on the matching label nodes.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Components

      public Components(FilePath remoteRootPath, Computer slave) throws IOException, InterruptedException
      Add construction description, Checks if config exists and creates it, then store all remote objects to be used at deploy time
      Parameters:
      remoteRootPath - FilePath of remote/slave rootPath
      slave - Computer slave.
      Throws:
      InterruptedException - Pipe Broken
      IOException - IO error while accessing configFile
    • Components

      public Components(Computer slave) throws IOException, InterruptedException
      Call Components(slave.getNode().getRootPath(), slave) Add construction description, Checks if config exists and creates it, then store all remote objects to be used at deploy time
      Parameters:
      slave - Computer slave.
      Throws:
      InterruptedException - Pipe Broken
      IOException - IO error while accessing configFile
  • Method Details

    • newDeploy

      public boolean newDeploy()
      Check if slave contains some setup configured as false,it means that is first time connection or any designed setup. If we want verbose just set listener and verbose will work
      Returns:
      Boolean checking if the cache is empty or not to tag it as newDeploy
    • setLogger

      public static void setLogger(TaskListener listener)
      Required method to define logging procedures
      Parameters:
      listener - TaskListener of the job
    • doSetup

      public void doSetup() throws AbortException, IOException, InterruptedException
      Slave setup flow, here, the method iterates all SetupItems and if not installed jet, will call doDeploy
      Throws:
      InterruptedException - If connection is broken
      IOException - IOErrors accessing cache
      AbortException - User close/Cancelled
    • singleSetup

      public void singleSetup(SetupConfigItem item) throws IOException, InterruptedException
      Performs the execution of the config item on the matching label nodes.
      Parameters:
      item - SetupConfigItem to perform.
      Throws:
      InterruptedException - If connection is broken
      IOException - IOErrors accessing hashCode
    • doConfig

      public void doConfig() throws AbortException, IOException, InterruptedException
      Iterates over all instance's SetupConfigItem performing/calling a singleSetup for each SetupConfigItem
      Throws:
      InterruptedException - If connection is broken
      IOException - IOErrors accessing cache
      AbortException - User close/Cancelled
    • doConfigSetups

      public static boolean doConfigSetups(List<Computer> activeSlaves)
      Iterates over all given computers performing the doConfig for each computer
      Parameters:
      activeSlaves - List of the conected slaveComputers
      Returns:
      Boolean telling if all the node execution went ok with true and error with false.
    • doSetups

      public static boolean doSetups(List<Computer> activeSlaves)
      Iterates over all the given computers list seting up or updating the installation if required.
      Parameters:
      activeSlaves - List conatining all the instance's slaveComputers
      Returns:
      Boolean telling if all the executions went ok with true.
    • debug

      public static void debug(String message)
      Print only if debug enabled (debug purposes)
      Parameters:
      message - String to print as DEBUG
    • info

      public static void info(String message)
      Global printer to return logger to master
      Parameters:
      message - String to print as INFO
    • enableDebug

      public static void enableDebug()
      Just enable debug mode
    • disableDebug

      public static void disableDebug()
      Just disable debug Mode