Class Client


  • public class Client
    extends com.logicmonitor.common.sse.utils.SSEResource
    This class provide jmx related functions.
    A Client indicates a connection to the remote server.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object[] getChildren​(java.lang.String path)
      get the childrens under the path
      java.lang.String getValue​(java.lang.String path)
      get the value for a path
      boolean isReleased()
      indicate the resource is released or not
      no need to call manually.
      static Client open​(java.lang.String protocol, java.lang.String hostname, int port, java.lang.String path, java.util.Map env, long timeoutInMs)  
      static Client open​(java.lang.String protocol, java.lang.String hostname, int port, java.util.Map env, long timeoutInMs)
      connect to a remote host
      static Client open​(java.lang.String url, java.lang.String username, java.lang.String password, long timeoutInMs)
      connect to a remote host
      void release()
      release related materials.
      no need to call manually.
      java.lang.String toString()  
      • Methods inherited from class com.logicmonitor.common.sse.utils.SSEResource

        register, unregister
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • isReleased

        public boolean isReleased()
        indicate the resource is released or not
        no need to call manually.
        Specified by:
        isReleased in class com.logicmonitor.common.sse.utils.SSEResource
        Returns:
        Whether if current client released
      • release

        public void release()
        release related materials.
        no need to call manually.
        Specified by:
        release in class com.logicmonitor.common.sse.utils.SSEResource
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getValue

        public java.lang.String getValue​(java.lang.String path)
                                  throws java.io.IOException
        get the value for a path
        Parameters:
        path - The jmx path
        Returns:
        String the value
        Throws:
        java.io.IOException - If some other I/O error occurs
      • getChildren

        public java.lang.Object[] getChildren​(java.lang.String path)
                                       throws java.io.IOException
        get the childrens under the path
        Parameters:
        path - The jmx path
        Returns:
        Object[] Value of the path
        Throws:
        java.io.IOException - If some other I/O error occurs
      • open

        public static Client open​(java.lang.String url,
                                  java.lang.String username,
                                  java.lang.String password,
                                  long timeoutInMs)
                           throws java.io.IOException
        connect to a remote host
        Parameters:
        url - url
        username - username
        password - password
        timeoutInMs - timeout in mill seconds, 0 means will use default timeout
        Returns:
        JMX Client
        Throws:
        java.io.IOException - If some other I/O error occurs
      • open

        public static Client open​(java.lang.String protocol,
                                  java.lang.String hostname,
                                  int port,
                                  java.util.Map env,
                                  long timeoutInMs)
                           throws java.io.IOException
        connect to a remote host
        Parameters:
        protocol - the protocol of the jmx, eg, rmi, jmxmp
        hostname - the host ip
        port - the jmx port
        env - the env of the jmx, eg, credential, SSLSockets
        timeoutInMs - the timeout in mill seconds, 0 means will use default timeout
        Returns:
        JMX Client
        Throws:
        java.io.IOException - If some other I/O error occurs
      • open

        public static Client open​(java.lang.String protocol,
                                  java.lang.String hostname,
                                  int port,
                                  java.lang.String path,
                                  java.util.Map env,
                                  long timeoutInMs)
                           throws java.io.IOException
        Parameters:
        protocol - the protocol of the jmx, eg, rmi, jmxmp
        hostname - the host ip
        port - the jmx port
        path - the URL path part of the URL. If null, defaults to the empty string, but for rmi, the default url path is "/jndi/rmi://hostname:port/jmxrmi"
        env - the env of the jmx, eg, credential, SSLSockets
        timeoutInMs - the timeout in mill seconds, 0 means will use default timeout
        Returns:
        JMX Client
        Throws:
        java.io.IOException - If some other I/O error occurs