Class JPPFCsvFileConnectionStrategy

java.lang.Object
org.jppf.node.connection.AbstractCsvConnectionStrategy
org.jppf.node.connection.JPPFCsvFileConnectionStrategy
All Implemented Interfaces:
DriverConnectionStrategy

public class JPPFCsvFileConnectionStrategy extends AbstractCsvConnectionStrategy
This implementation of DriverConnectionStrategy reads a list of drivers from a CSV file where each line has the following format:

secure, host, port, recovery_enabled

where:

  • secure is a boolean value (either 'true' or 'false', case-insenssitive) indicating whether a SSL/TLS connection should be established. any value that is not 'true' will be interpreted as 'false'.
  • host is the host name or ip address of the driver to connect to
  • port is the port to connect to on the driver host
  • recovery_enabled is a boolean value (either 'true' or 'false', case-insenssitive) indicating whether the recovery (or heartbeat) mechanism is enabled for the node

Additionally, any line starting with a '#' (after trimming) will be considered as a comment and ignored.

The file location is read from the configuration property 'jppf.node.connection.strategy.file'. It will first be looked up in the file system, then in the classpath if it is not found in the file system. If no file is found at all, the node will fall back to the JPPF default strategy and use the configuration to find the driver connection information.

The listed drivers will be used as if they were arrayed in a "circle", with the driver selection mechanism rotating one tick each time nextConnectionInfo() is invoked.

Since:
4.1
Author:
Laurent Cohen
  • Constructor Details

    • JPPFCsvFileConnectionStrategy

      public JPPFCsvFileConnectionStrategy()
      Find and read the CSV file.
    • JPPFCsvFileConnectionStrategy

      public JPPFCsvFileConnectionStrategy(org.jppf.utils.TypedProperties config)
      Find and read the CSV file.
      Parameters:
      config - the node configuration.