Package com.santaba.agent.groovyapi.jmx
Class Client
- java.lang.Object
-
- com.logicmonitor.common.sse.utils.SSEResource
-
- com.santaba.agent.groovyapi.jmx.Client
-
public class Client extends com.logicmonitor.common.sse.utils.SSEResourceThis 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 pathjava.lang.StringgetValue(java.lang.String path)get the value for a pathbooleanisReleased()indicate the resource is released or not
no need to call manually.static Clientopen(java.lang.String protocol, java.lang.String hostname, int port, java.lang.String path, java.util.Map env, long timeoutInMs)static Clientopen(java.lang.String protocol, java.lang.String hostname, int port, java.util.Map env, long timeoutInMs)connect to a remote hoststatic Clientopen(java.lang.String url, java.lang.String username, java.lang.String password, long timeoutInMs)connect to a remote hostvoidrelease()release related materials.
no need to call manually.java.lang.StringtoString()
-
-
-
Method Detail
-
isReleased
public boolean isReleased()
indicate the resource is released or not
no need to call manually.- Specified by:
isReleasedin classcom.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:
releasein classcom.logicmonitor.common.sse.utils.SSEResource
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getValue
public java.lang.String getValue(java.lang.String path) throws java.io.IOExceptionget 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.IOExceptionget 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- urlusername- usernamepassword- passwordtimeoutInMs- 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, jmxmphostname- the host ipport- the jmx portenv- the env of the jmx, eg, credential, SSLSocketstimeoutInMs- 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, jmxmphostname- the host ipport- the jmx portpath- 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, SSLSocketstimeoutInMs- 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
-
-