Class ConnectionProperties
java.lang.Object
com.ibm.java.diagnostics.healthcenter.api.ConnectionProperties
This class represents the information that is required to connect to a
running application that was started with the Health Center agent attached. A
successful connection requires the correct port number, host name, and
authentication settings.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new ConnectionProperties object, using the default valueslocalhostand1972for the host name and port number and JMX as the transport type.ConnectionProperties(String hostname, int port) Constructs a new ConnectionProperties object, using the specified parameters for host name and port number and JMX as the transport type. -
Method Summary
Modifier and TypeMethodDescriptionGets the host name that is associated with this ConnectionProperties object.Gets the JMX Authentication password that is associated with this ConnectionProperties object.Gets the JMX authentication user name that is associated with this ConnectionProperties object.Gets the MQTT Authentication password that is associated with this ConnectionProperties object.Gets the MQTT authentication user name that is associated with this ConnectionProperties object.intgetPort()Gets the port number that is associated with this ConnectionProperties object.Gets the SSL truststore certificate password that is associated with this ConnectionProperties object.Gets the SSL truststore location that is associated with this ConnectionProperties object.Gets the SSL truststore password that is associated with this ConnectionProperties object.booleanIndicates whether this object is set to use JMX as its transport typebooleanIndicates whether this object is set to use MQTT as its transport typebooleanIndicates whether this object is set to use JMX authentication.booleanIndicates whether this object is set to use MQTT authentication.booleanIndicates whether this object is set to use SSL authentication.voidsetHostname(String hostname) Sets the host name.voidSets the connection type for this connection to be JMX.voidsetJmxPassword(String jmxPassword) Sets the JMX authentication password.voidsetJmxUsername(String jmxUsername) Sets the JMX authentication user name.voidSets the connection type for this connection to be MQTT.voidsetMqttPassword(String mqttPassword) Sets the MQTT authentication password.voidsetMqttUsername(String mqttUsername) Sets the MQTT authentication user name.voidsetPort(int port) Sets the port to be used for the agent connection.voidsetSSLTruststoreCertificatePassword(String sslTruststoreCertificatePassword) Sets the SSL truststore certificate password.voidsetSSLTruststoreLocation(String sslTruststoreLocation) Sets the SSL truststore location to use for this connection.voidsetSSLTruststorePassword(String sslTruststorePassword) Sets the SSL truststore password.
-
Constructor Details
-
ConnectionProperties
public ConnectionProperties()Constructs a new ConnectionProperties object, using the default valueslocalhostand1972for the host name and port number and JMX as the transport type. -
ConnectionProperties
Constructs a new ConnectionProperties object, using the specified parameters for host name and port number and JMX as the transport type.- Parameters:
hostname- the name of the host to connect to.port- the port number to connect to. Setting a value of 0 will attempt a connection to an agent running in the same process as this api. This is useful for in-process monitoring where you do not require a separate process to handle the analysis. The agent needs to be started with -Xhealthcenter:level=inprocess to start the agent without a network socket running (it is not needed for in-process). This feature is available on a 2.2.1 agent and above. You can connect to earlier agents but they will still start a socket for connection (although it will be ignored)
-
-
Method Details
-
getHostname
Gets the host name that is associated with this ConnectionProperties object.- Returns:
- the current host name
-
setHostname
Sets the host name.- Parameters:
hostname- the host name to use.
-
getPort
public int getPort()Gets the port number that is associated with this ConnectionProperties object.- Returns:
- the current port number being used.
-
setPort
public void setPort(int port) Sets the port to be used for the agent connection. Setting a value of 0 will attempt a connection to an agent running in the same process as this api. This is useful for in-process monitoring where you do not require a separate process to handle the analysis. The agent needs to be started with -Xhealthcenter:level=inprocess to start the agent without a network socket running (it is not needed for in-process). This feature is available on a 2.2.1 agent and above. You can connect to earlier agents but they will still start a socket for connection (although it will be ignored)- Parameters:
port- the port number to use.
-
getSSLTruststoreLocation
Gets the SSL truststore location that is associated with this ConnectionProperties object.- Returns:
- the current SSL truststore location.
-
setSSLTruststoreLocation
Sets the SSL truststore location to use for this connection.- Parameters:
sslTruststoreLocation- the SSL truststore location value to use.
-
getSSLTruststorePassword
Gets the SSL truststore password that is associated with this ConnectionProperties object.- Returns:
- the current SSL truststore password.
-
setSSLTruststorePassword
Sets the SSL truststore password.- Parameters:
sslTruststorePassword- the SSL truststore password value to use.
-
getSSLTruststoreCertificatePassword
Gets the SSL truststore certificate password that is associated with this ConnectionProperties object.- Returns:
- the current SSL truststore certificate password.
-
setSSLTruststoreCertificatePassword
Sets the SSL truststore certificate password.- Parameters:
sslTruststoreCertificatePassword- the SSL truststore certificate password value to use.
-
getJmxUsername
Gets the JMX authentication user name that is associated with this ConnectionProperties object.- Returns:
- the current JMX user name.
-
setJmxUsername
Sets the JMX authentication user name.- Parameters:
jmxUsername- the JMX authentication user name value to use.
-
getMqttUsername
Gets the MQTT authentication user name that is associated with this ConnectionProperties object.- Returns:
- the current MQTT user name.
-
setMqttUsername
Sets the MQTT authentication user name.- Parameters:
mqttUsername- the MQTT authentication user name value to use.
-
getJmxPassword
Gets the JMX Authentication password that is associated with this ConnectionProperties object.- Returns:
- the current JMX password.
-
setJmxPassword
Sets the JMX authentication password.- Parameters:
jmxPassword- the JMX authentication password value to use.
-
getMqttPassword
Gets the MQTT Authentication password that is associated with this ConnectionProperties object.- Returns:
- the current MQTT password.
-
setMqttPassword
Sets the MQTT authentication password.- Parameters:
mqttPassword- the MQTT authentication password value to use.
-
isUseJXMAuth
public boolean isUseJXMAuth()Indicates whether this object is set to use JMX authentication.- Returns:
- a value indicating whether JMX authentication is set on for this ConnectionProperties object.
-
isUseMQTTAuth
public boolean isUseMQTTAuth()Indicates whether this object is set to use MQTT authentication.- Returns:
- a value indicating whether MQTT authentication is set on for this ConnectionProperties object.
-
isUseSSLAuth
public boolean isUseSSLAuth()Indicates whether this object is set to use SSL authentication.- Returns:
- a value indicating whether SSL authentication is set on this ConnectionProperties objects.
-
setMQTTConnection
public void setMQTTConnection()Sets the connection type for this connection to be MQTT. The default type upon object creation is JMX. This method must be invoked when the use of MQTT transport is required. -
setJMXConnection
public void setJMXConnection()Sets the connection type for this connection to be JMX. This is the default type upon object creation. -
isMQTTConnection
public boolean isMQTTConnection()Indicates whether this object is set to use MQTT as its transport type- Returns:
- a value indicating whether a MQTT transport type is set on for this ConnectionProperties object.
-
isJMXConnection
public boolean isJMXConnection()Indicates whether this object is set to use JMX as its transport type- Returns:
- a value indicating whether a JMX transport type is set on for this ConnectionProperties object.
-