Package org.jppf.node.connection
Class JPPFDriverConnectionInfo
java.lang.Object
org.jppf.node.connection.JPPFDriverConnectionInfo
- All Implemented Interfaces:
DriverConnectionInfo
A default implementation for the
DriverConnectionInfo interface.- Since:
- 4.1
- Author:
- Laurent Cohen
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe driver host name or IP address.protected intThe driver port to connect to.protected booleanWhether recovery is enabled.protected booleanWhether SSL/TLS should be used. -
Constructor Summary
ConstructorsConstructorDescriptionCreate an unpopulated driver connection info.JPPFDriverConnectionInfo(boolean secure, String host, int port, boolean recoveryEnabled) Initialize the parameters with the specified values.JPPFDriverConnectionInfo(boolean secure, String host, int port, int recoveryPort) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic DriverConnectionInfofromJPPFConnectionInformation(org.jppf.comm.discovery.JPPFConnectionInformation ci, boolean ssl, boolean recovery) Convert the specifiedJPPFConnectionInformationobject into aDriverConnectionInfo.getHost()Get the driver host name or IP address.intgetPort()Get the driver port to connect to.intDeprecated.as of JPPF 6.0, the recovery mechanism uses the same port number as the main server port.
This method will return-1if recovery is disabled, or the value ofgetPort()if it is enabled.inthashCode()booleanDeprecated.useDriverConnectionInfo.isHeartbeatEnabled()instead.booleanisSecure()Determine whether secure (with SSL/TLS) connections should be established.voidsetHeartbeatEnabled(boolean recoveryEnabled) Set whether a heatbeat connection is enabled.voidSet the driver host.voidsetPort(int port) Set the driver port.voidsetSecure(boolean secure) Set whether the connection is secured via SSL/TLS.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jppf.node.connection.DriverConnectionInfo
isHeartbeatEnabled
-
Field Details
-
secure
protected boolean secureWhether SSL/TLS should be used. -
host
The driver host name or IP address. -
port
protected int portThe driver port to connect to. -
recoveryEnabled
protected boolean recoveryEnabledWhether recovery is enabled.
-
-
Constructor Details
-
JPPFDriverConnectionInfo
public JPPFDriverConnectionInfo()Create an unpopulated driver connection info. -
JPPFDriverConnectionInfo
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 ifrecoveryPort > 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
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:DriverConnectionInfoDetermine whether secure (with SSL/TLS) connections should be established.- Specified by:
isSecurein interfaceDriverConnectionInfo- Returns:
truefor secure connections,falseotherwise.
-
setSecure
public void setSecure(boolean secure) Set whether the connection is secured via SSL/TLS.- Parameters:
secure-trueif the connection is secure,falseotherwise.
-
getHost
Description copied from interface:DriverConnectionInfoGet the driver host name or IP address.- Specified by:
getHostin interfaceDriverConnectionInfo- Returns:
- the host as a string.
-
setHost
Set the driver host.- Parameters:
host- the dirver's hostname or ip address.
-
getPort
public int getPort()Description copied from interface:DriverConnectionInfoGet the driver port to connect to.- Specified by:
getPortin interfaceDriverConnectionInfo- 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-1if recovery is disabled, or the value ofgetPort()if it is enabled.Description copied from interface:DriverConnectionInfoGet the recovery port for the heartbeat mechanism.- Specified by:
getRecoveryPortin interfaceDriverConnectionInfo- Returns:
- the recovery port a an int; a negative value indicates that recovery is disabled for the node.
-
isRecoveryEnabled
public boolean isRecoveryEnabled()Deprecated.useDriverConnectionInfo.isHeartbeatEnabled()instead.Determine whether the recovery mechanism (exchange of heartbeat messages) is enabled.- Specified by:
isRecoveryEnabledin interfaceDriverConnectionInfo- Returns:
trueif recovery is enabled,falseotherwise.
-
setHeartbeatEnabled
public void setHeartbeatEnabled(boolean recoveryEnabled) Set whether a heatbeat connection is enabled.- Parameters:
recoveryEnabled-trueif the heartbeat connection is enabled,falseotherwise.
-
hashCode
public int hashCode() -
equals
-
toString
-
fromJPPFConnectionInformation
public static DriverConnectionInfo fromJPPFConnectionInformation(org.jppf.comm.discovery.JPPFConnectionInformation ci, boolean ssl, boolean recovery) Convert the specifiedJPPFConnectionInformationobject into aDriverConnectionInfo.- Parameters:
ci- theJPPFConnectionInformationobject to convert from.ssl- whether ssl is enabled or not.recovery- whether discovery is enabled or not.- Returns:
- a
DriverConnectionInfoinstance.
-
This constructor assumes recovery is enabled if
recoveryPort > 0, and disabled otherwise.