Package org.jppf.discovery
Class DriverConnectionInfo
java.lang.Object
org.jppf.discovery.DriverConnectionInfo
- Direct Known Subclasses:
ClientConnectionPoolInfo
Superclass for connection info in custom driver discovery mechanisms.
- Since:
- 5.2.1
- Author:
- Laurent Cohen
-
Constructor Summary
ConstructorsConstructorDescriptionInitialize a plain connection with default name("driver"), pool size (1), host ("localhost") and port (11111).DriverConnectionInfo(String name, boolean secure, String host, int port) Initialize a connection with a default pool size of 1.DriverConnectionInfo(String name, boolean secure, String host, int port, int poolSize) Initialize a connection.DriverConnectionInfo(String name, boolean secure, String host, int port, int poolSize, boolean heartbeatEnabled) Initialize a connection.DriverConnectionInfo(String name, String host, int port) Initialize a plain connection with a default pool size of 1. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetHost()Get the driver host name or IP address.getName()Get the name given to this connection.intGet the connection pool size.intgetPort()Get the driver port to connect to.inthashCode()booleanDetermine whether the heartbeat mechanism is enabled for the connection pool.booleanisSecure()Determine whether secure (with SSL/TLS) connections should be established.voidsetHeartbeatEnabled(boolean heartbeatEnabled) Set whether the heartbeat mechanism is enabled for the connection pool.voidSet the driver host name or IP address.voidSet the name of this connection.voidsetPoolSize(int poolSize) Set the connection pool size.voidsetPort(int port) Set the driver port to connect to.voidsetSecure(boolean secure) Set whether secure (with SSL/TLS) connections should be established.toString()
-
Constructor Details
-
DriverConnectionInfo
public DriverConnectionInfo()Initialize a plain connection with default name("driver"), pool size (1), host ("localhost") and port (11111). -
DriverConnectionInfo
Initialize a plain connection with a default pool size of 1.- Parameters:
name- the name given to this connection.host- the driver host name or IP address.port- the driver port to connect to.
-
DriverConnectionInfo
Initialize a connection with a default pool size of 1.- Parameters:
name- the name given to this connection.secure- whether SSL/TLS should be used.host- the driver host name or IP address.port- the driver port to connect to.
-
DriverConnectionInfo
Initialize a connection.- Parameters:
name- the name given to this connection.secure- whether SSL/TLS should be used.host- the driver host name or IP address.port- the driver port to connect to.poolSize- the number of driver connections in the pool.
-
DriverConnectionInfo
public DriverConnectionInfo(String name, boolean secure, String host, int port, int poolSize, boolean heartbeatEnabled) Initialize a connection.- Parameters:
name- the name given to this connection.secure- whether SSL/TLS should be used.host- the driver host name or IP address.port- the driver port to connect to.poolSize- the number of driver connections in the pool.heartbeatEnabled- whether the heartbeat mechanism is enabled for the connection pool.
-
-
Method Details
-
getName
Get the name given to this connection.- Returns:
- the connection name as a string.
-
setName
Set the name of this connection.- Parameters:
name- the connection name as a string.
-
isSecure
public boolean isSecure()Determine whether secure (with SSL/TLS) connections should be established.- Returns:
truefor secure connections,falseotherwise.
-
setSecure
public void setSecure(boolean secure) Set whether secure (with SSL/TLS) connections should be established.- Parameters:
secure-truefor secure connections,falseotherwise.
-
getHost
Get the driver host name or IP address.- Returns:
- the host as a string.
-
setHost
Set the driver host name or IP address.- Parameters:
host- the host as a string.
-
getPort
public int getPort()Get the driver port to connect to.- Returns:
- the driver port as an int value.
-
setPort
public void setPort(int port) Set the driver port to connect to.- Parameters:
port- the driver port as an int value.
-
getPoolSize
public int getPoolSize()Get the connection pool size.- Returns:
- the connection pool size as an int value.
-
setPoolSize
public void setPoolSize(int poolSize) Set the connection pool size.- Parameters:
poolSize- the connection pool size as an int value.
-
isHeartbeatEnabled
public boolean isHeartbeatEnabled()Determine whether the heartbeat mechanism is enabled for the connection pool.- Returns:
trueif heartbeat is enabled,falseotherwise.
-
setHeartbeatEnabled
public void setHeartbeatEnabled(boolean heartbeatEnabled) Set whether the heartbeat mechanism is enabled for the connection pool.- Parameters:
heartbeatEnabled-trueif heartbeat is enabled,falseotherwise.
-
hashCode
public int hashCode() -
equals
-
toString
-