Class ConnectionProperties

java.lang.Object
com.ibm.java.diagnostics.healthcenter.api.ConnectionProperties

public class ConnectionProperties extends Object
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 Details

    • ConnectionProperties

      public ConnectionProperties()
      Constructs a new ConnectionProperties object, using the default values localhost and 1972 for the host name and port number and JMX as the transport type.
    • ConnectionProperties

      public 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.
      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

      public String getHostname()
      Gets the host name that is associated with this ConnectionProperties object.
      Returns:
      the current host name
    • setHostname

      public void setHostname(String hostname)
      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

      public String getSSLTruststoreLocation()
      Gets the SSL truststore location that is associated with this ConnectionProperties object.
      Returns:
      the current SSL truststore location.
    • setSSLTruststoreLocation

      public void setSSLTruststoreLocation(String sslTruststoreLocation)
      Sets the SSL truststore location to use for this connection.
      Parameters:
      sslTruststoreLocation - the SSL truststore location value to use.
    • getSSLTruststorePassword

      public String getSSLTruststorePassword()
      Gets the SSL truststore password that is associated with this ConnectionProperties object.
      Returns:
      the current SSL truststore password.
    • setSSLTruststorePassword

      public void setSSLTruststorePassword(String sslTruststorePassword)
      Sets the SSL truststore password.
      Parameters:
      sslTruststorePassword - the SSL truststore password value to use.
    • getSSLTruststoreCertificatePassword

      public String getSSLTruststoreCertificatePassword()
      Gets the SSL truststore certificate password that is associated with this ConnectionProperties object.
      Returns:
      the current SSL truststore certificate password.
    • setSSLTruststoreCertificatePassword

      public void setSSLTruststoreCertificatePassword(String sslTruststoreCertificatePassword)
      Sets the SSL truststore certificate password.
      Parameters:
      sslTruststoreCertificatePassword - the SSL truststore certificate password value to use.
    • getJmxUsername

      public String getJmxUsername()
      Gets the JMX authentication user name that is associated with this ConnectionProperties object.
      Returns:
      the current JMX user name.
    • setJmxUsername

      public void setJmxUsername(String jmxUsername)
      Sets the JMX authentication user name.
      Parameters:
      jmxUsername - the JMX authentication user name value to use.
    • getMqttUsername

      public String getMqttUsername()
      Gets the MQTT authentication user name that is associated with this ConnectionProperties object.
      Returns:
      the current MQTT user name.
    • setMqttUsername

      public void setMqttUsername(String mqttUsername)
      Sets the MQTT authentication user name.
      Parameters:
      mqttUsername - the MQTT authentication user name value to use.
    • getJmxPassword

      public String getJmxPassword()
      Gets the JMX Authentication password that is associated with this ConnectionProperties object.
      Returns:
      the current JMX password.
    • setJmxPassword

      public void setJmxPassword(String jmxPassword)
      Sets the JMX authentication password.
      Parameters:
      jmxPassword - the JMX authentication password value to use.
    • getMqttPassword

      public String getMqttPassword()
      Gets the MQTT Authentication password that is associated with this ConnectionProperties object.
      Returns:
      the current MQTT password.
    • setMqttPassword

      public void setMqttPassword(String mqttPassword)
      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.