Class NodeChainTestCfg

java.lang.Object
com.nt.udc.testnodechain.config.NodeChainTestCfg
All Implemented Interfaces:
Serializable

public class NodeChainTestCfg extends Object implements Serializable
See Also:
  • Constructor Details

    • NodeChainTestCfg

      public NodeChainTestCfg(String cfgPath, Logger logger)
  • Method Details

    • containsTestId

      public boolean containsTestId(String testId)
    • getTestConfiguration

      public NodeChainTestCfgItemReadOnlyIfc getTestConfiguration(String testId)
      This method returns a NodeChainTestCfgItem object from test ID.
      Parameters:
      testId - Node Chain Test identifier
    • add

      public void add(NodeChainTestCfgItem cfgItem) throws NodeChainTestException, IOException
      This method adds the Node Chain Test configuration.
      Parameters:
      cfgItem - NodeChainTestCfgItem object to be added
      Throws:
      IOException - Exception thrown while writing to the file
      NodeChainTestException
    • update

      public void update(String testId, NodeChainTestCfgUpdateIfc callback) throws IOException
      This method updates the Node Chain Test configuration.
      Parameters:
      updatedCfg - Updated NodeChainTestCfgItem object
      Throws:
      IOException - Exception thrown if something were to go wrong
    • load

      public void load() throws IOException
      This method loads the Node Chain Test configuration.
      Throws:
      IOException - Exception thrown while writing to the file
    • getAllLockedAndRunningTestNodes

      public Set<String> getAllLockedAndRunningTestNodes()
      This method returns list of all locked and running nodes part of test.
      Returns:
      List of all locked and running nodes part of test
    • getStoppedTests

      public ArrayList<String> getStoppedTests()
      This method returns list of stopped tests from configuration.
      Returns:
      List of stopped tests from configuration
    • getStaleTests

      public ArrayList<String> getStaleTests()
      This method returns list of stale tests from configuration.
      Returns:
      List of stale tests from configuration
    • removeTestFromConfig

      public void removeTestFromConfig(String testId) throws IOException
      This method removes a test from configuration.
      Parameters:
      testId - Identifier of a test
      Throws:
      IOException - Thrown if something goes wrong while updating the configuration file
    • getRunningTests

      public List<String> getRunningTests()
    • getLockedAndRunningTests

      public List<String> getLockedAndRunningTests()
    • getAllTests

      public List<String> getAllTests()
    • getCfgMap

      public Map<String,NodeChainTestCfgItem> getCfgMap()