Class JPPFDriverConnectionInfo

java.lang.Object
org.jppf.node.connection.JPPFDriverConnectionInfo
All Implemented Interfaces:
DriverConnectionInfo

public class JPPFDriverConnectionInfo extends Object implements DriverConnectionInfo
A default implementation for the DriverConnectionInfo interface.
Since:
4.1
Author:
Laurent Cohen
  • Field Details

    • secure

      protected boolean secure
      Whether SSL/TLS should be used.
    • host

      protected String host
      The driver host name or IP address.
    • port

      protected int port
      The driver port to connect to.
    • recoveryEnabled

      protected boolean recoveryEnabled
      Whether recovery is enabled.
  • Constructor Details

    • JPPFDriverConnectionInfo

      public JPPFDriverConnectionInfo()
      Create an unpopulated driver connection info.
    • JPPFDriverConnectionInfo

      public JPPFDriverConnectionInfo(boolean secure, String host, int port, int recoveryPort)
      Deprecated.
      as of JPPF 6.0, the recovery mechanism uses the same port number as the main server port.
      This constructor assumes recovery is enabled if recoveryPort > 0, and disabled otherwise.
      Initialize the parameters with the specified values.
      Parameters:
      secure - whether SSL/TLS should be used.
      host - the driver host name or IP address.
      port - the driver port to connect to.
      recoveryPort - the driver recovery port to connect to.
    • JPPFDriverConnectionInfo

      public JPPFDriverConnectionInfo(boolean secure, String host, int port, boolean recoveryEnabled)
      Initialize the parameters with the specified values.
      Parameters:
      secure - whether SSL/TLS should be used.
      host - the driver host name or IP address.
      port - the driver port to connect to.
      recoveryEnabled - whether recovery is enabled.
  • Method Details

    • isSecure

      public boolean isSecure()
      Description copied from interface: DriverConnectionInfo
      Determine whether secure (with SSL/TLS) connections should be established.
      Specified by:
      isSecure in interface DriverConnectionInfo
      Returns:
      true for secure connections, false otherwise.
    • setSecure

      public void setSecure(boolean secure)
      Set whether the connection is secured via SSL/TLS.
      Parameters:
      secure - true if the connection is secure, false otherwise.
    • getHost

      public String getHost()
      Description copied from interface: DriverConnectionInfo
      Get the driver host name or IP address.
      Specified by:
      getHost in interface DriverConnectionInfo
      Returns:
      the host as a string.
    • setHost

      public void setHost(String host)
      Set the driver host.
      Parameters:
      host - the dirver's hostname or ip address.
    • getPort

      public int getPort()
      Description copied from interface: DriverConnectionInfo
      Get the driver port to connect to.
      Specified by:
      getPort in interface DriverConnectionInfo
      Returns:
      the driver port as an int value.
    • setPort

      public void setPort(int port)
      Set the driver port.
      Parameters:
      port - the driver port number.
    • getRecoveryPort

      public int getRecoveryPort()
      Deprecated.
      as of JPPF 6.0, the recovery mechanism uses the same port number as the main server port.
      This method will return -1 if recovery is disabled, or the value of getPort() if it is enabled.
      Description copied from interface: DriverConnectionInfo
      Get the recovery port for the heartbeat mechanism.
      Specified by:
      getRecoveryPort in interface DriverConnectionInfo
      Returns:
      the recovery port a an int; a negative value indicates that recovery is disabled for the node.
    • isRecoveryEnabled

      public boolean isRecoveryEnabled()
      Determine whether the recovery mechanism (exchange of heartbeat messages) is enabled.
      Specified by:
      isRecoveryEnabled in interface DriverConnectionInfo
      Returns:
      true if recovery is enabled, false otherwise.
    • setHeartbeatEnabled

      public void setHeartbeatEnabled(boolean recoveryEnabled)
      Set whether a heatbeat connection is enabled.
      Parameters:
      recoveryEnabled - true if the heartbeat connection is enabled, false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • fromJPPFConnectionInformation

      public static DriverConnectionInfo fromJPPFConnectionInformation(org.jppf.comm.discovery.JPPFConnectionInformation ci, boolean ssl, boolean recovery)
      Convert the specified JPPFConnectionInformation object into a DriverConnectionInfo.
      Parameters:
      ci - the JPPFConnectionInformation object to convert from.
      ssl - whether ssl is enabled or not.
      recovery - whether discovery is enabled or not.
      Returns:
      a DriverConnectionInfo instance.