Class PmiClient
- java.lang.Object
-
- com.ibm.websphere.pmi.client.PmiClient
-
- All Implemented Interfaces:
- PmiConstants
Deprecated.As of 6.0, PMI Client API is replaced with JMX interface and MBean StatisticsProvider model. PMI CpdCollection data structure is replaced by J2EE Performance Data Framework defined injavax.management.j2ee.statistics
package.The PmiClient class is called by client application to access performance data. The purpose is to free the programmer from implementing the remote data access manually.
The class has two set of APIs. One set of APIs are 4.0 APIs, that use PerfDescriptor to get PMI data and the returned PMI data are CpdData/CpdCollection objects. In both 3.5.5+ and 4.0, the PmiClient API looks up a session bean in adminserver and invokes remote APIs on the session bean.
Another set of APIs are JMX-based API new in 5.0. The new APIs use ObjectName/MBeanStatDescriptor to get PMI data via JMX interface.
A brief calling flow is shown here. Details can be found in InfoCenter and sample code. First, a client application needs create an instance of the PmiClient object by passing the correct host name, port number, version name, and JMX connector types. If the PmiClient instance is successfully created, you are ready to call the methods on it to retrieve the data. You need to set the instrumentation level to enable the data for the first time because PMI data is disabled by default. You can call various list methods to navigate the WebSphere domain for nodes, servers, MBeans (or PerfDescriptor for 4.0 API). If you know the names for the node, server, PMI module, or data, you can call pmiClient to create the MBeanStatDescriptor (or PerfDescriptor for 4.0 API) object. Once you get the ObjectName, MBeansStatDescriptor, or PerfDescriptor, you can call the corresponding getXXX methods to get the PMI data.
Note that the setInstrumentationLevel method changes the level at the server side which means it effects other clients monitoring the same server.
Both 4.0 APIs and 5.0 APIs will be supported in 5.0. However, since the returned data are in different types when using 4.0 and 5.0 APIs, it is recommanded that you do not mix the two APIs together.
public class PmiClient extends java.lang.Object implements PmiConstants
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
COPYRIGHT
Deprecated.static java.lang.String
DEFAULT_CONNECTOR_PORT
Deprecated.static java.lang.String
DEFAULT_CONNECTOR_TYPE
Deprecated.static int
FAILED_TO_CREATE_PMISERVICE_BEAN_OBJECT
Deprecated.static int
FAILED_TO_DISABLE_DATA
Deprecated.static int
FAILED_TO_ENABLE_DATA
Deprecated.static int
FAILED_TO_GET_ADMIN_STATE
Deprecated.static int
FAILED_TO_GET_DATA
Deprecated.static int
FAILED_TO_GET_INITIAL_CONTEXT
Deprecated.static int
FAILED_TO_GET_LEVEL
Deprecated.static int
FAILED_TO_LIST_MEMBERS
Deprecated.static int
FAILED_TO_LIST_NODES
Deprecated.static int
FAILED_TO_LIST_SERVERS
Deprecated.static int
FAILED_TO_SET_LEVEL
Deprecated.static java.util.HashMap
moduleNLSMap
Deprecated.static int
NO_COLLECTOR_FOUND
Deprecated.static int
NO_ERROR
Deprecated.static int
NO_PERFMBEAN_FOUND
Deprecated.static int
NO_SUCH_A_NODE
Deprecated.static int
NO_SUCH_A_SERVER
Deprecated.static com.ibm.ejs.sm.client.ui.NLS
pmiNLS
Deprecated.static java.util.HashMap
prefixNLSMap
Deprecated.static java.lang.String
SEPERATOR40
Deprecated.static java.lang.String
SEPERATOR50
Deprecated.static int
SERVER_STOPPED
Deprecated.static java.lang.String
VERSION_AE
Deprecated.static java.lang.String
VERSION_AES
Deprecated.static java.lang.String
VERSION_EPM
Deprecated.static java.lang.String
VERSION_WAS50
Deprecated.static java.lang.String
VERSION_WAS50ND
Deprecated.-
Fields inherited from interface com.ibm.websphere.pmi.PmiConstants
AE_35, AE_40, AES_40, ALL_DATA, APPSERVER_MODULE, BEAN_METHODS_SUBMODULE, BEAN_MODULE, CACHE_MODULE, COLLECTION_DESC, CONNPOOL_MODULE, DEFAULT_MODULE_PREFIX, EJB_ENTITY, EJB_MESSAGEDRIVEN, EJB_METHODS_METHOD_CALLS, EJB_METHODS_METHOD_LOAD, EJB_METHODS_METHOD_RESPONSE_TIME, EJB_SINGLETON, EJB_STATEFUL, EJB_STATELESS, INITIALIZATION_FAILED, INITIALIZING, INTERCEPTOR_SUBMODULE, J2C_CF, J2C_DS, J2C_JMS_CONNECTIONS, J2C_MODULE, JAVA_TIME_CONVERT_RATIO, JVMPI_MODULE, LEVEL_DISABLE, LEVEL_ENABLE, LEVEL_FINEGRAIN, LEVEL_HIGH, LEVEL_HIGH_STRING, LEVEL_LOW, LEVEL_LOW_STRING, LEVEL_MAX, LEVEL_MAX_STRING, LEVEL_MEDIUM, LEVEL_MEDIUM_STRING, LEVEL_NONE, LEVEL_NONE_STRING, LEVEL_UNDEFINED, LOAD_AVG, LOST_CONTACT, METHODS_SUBMODULE_SHORTNAME, MSG_BUNDLE, NOT_IN_SUBMODULE, ORBPERF_MODULE, PLATFORM_ALL, PLATFORM_DISTRIBUTED, PLATFORM_ZOS, PMI_DISABLE_STRING, ROOT_DESC, ROOT_NAME, RUNNING, RUNTIME_MODULE, SERVLET_SUBMODULE, SERVLETS_SUBMODULE_SHORTNAME, SESSIONS_MODULE, STOPPED, SYSTEM_MODULE, TEMPLATE_SUBMODULE, TERMINATING, THREADPOOL_MODULE, TRAN_MODULE, TYPE_AVGSTAT, TYPE_CATEGORY, TYPE_COLLECTION, TYPE_DATA, TYPE_DOUBLE, TYPE_INSTANCE, TYPE_INT, TYPE_INVALID, TYPE_LOAD, TYPE_LONG, TYPE_MODULE, TYPE_MODULEROOT, TYPE_NODE, TYPE_RANGE, TYPE_ROOT, TYPE_SERVER, TYPE_STAT, TYPE_SUBINSTANCE, TYPE_SUBMODULE, TYPE_UNDEFINED, UNINITIALIZED, UNKNOWN_ID, URL_ASYNC_CONTEXT_RESPONSE_TIME, URL_CONCURRENT_REQUESTS, URL_RESPONSE_TIME, URL_TOTAL_REQUESTS, WEBAPP_MODULE, WEBSERVICES_MODULE, WEBSERVICES_SUBMODULE, WLM_CLIENT_MODULE, WLM_MODULE, WLM_SERVER_MODULE, WSGW_MODULE, XML_COLLECTION, XML_COUNT, XML_CREATETIME, XML_DOUBLE, XML_ENDCOLLECTION, XML_ENDLINE, XML_ENDMODULE, XML_ENDNODE, XML_ENDSERVER, XML_ENDTAG, XML_ID, XML_INT, XML_INTEGRAL, XML_LASTVALUE, XML_LOAD, XML_LONG, XML_MODULE, XML_NAME, XML_NODE, XML_QUOTE, XML_SERVER, XML_START, XML_STAT, XML_SUMOFSQUARES, XML_TIME, XML_TOTAL, XML_VALUE, XML_VIEW
-
-
Constructor Summary
Constructors Constructor and Description PmiClient()
Deprecated.Constructor: assume all defaults: local host, port DEFAULT_CONNECTOR_PORT, and WAS50 version.PmiClient(boolean inAppServer)
Deprecated.Use this constructor only when you are calling it inside an appserver.PmiClient(java.util.Properties props, java.lang.String version)
Deprecated.Constructor: take a Properties and the version.PmiClient(java.lang.String host, java.lang.String port)
Deprecated.Constructor:PmiClient(java.lang.String host, java.lang.String port, java.lang.String version)
Deprecated.Constructor: take host, port, and version.PmiClient(java.lang.String host, java.lang.String port, java.lang.String version, boolean inAppServer, java.lang.String connectorType)
Deprecated.Constructor: take host, port, and version.PmiClient(java.lang.String host, java.lang.String nodeName, java.lang.String port, java.lang.String version)
Deprecated.Constructor: take host, nodeName, port, and version.
-
Method Summary
Methods Modifier and Type Method and Description void
add(PerfDescriptor pd)
Deprecated.4.0 API.CpdCollection
createCpdCollection(PerfDescriptor colPd, com.ibm.ws.pmi.wire.WpdCollection wCol)
Deprecated.4.0 API: create a CpdCollection object from WpdCollectionstatic CpdData
createCpdData(PmiModuleConfig moduleConfig, PerfDescriptor parent, com.ibm.ws.pmi.wire.WpdData wData)
Deprecated.4.0 API: create a CpdData object from WpdDatastatic MBeanLevelSpec
createMBeanLevelSpec(javax.management.ObjectName oname, int level)
Deprecated.5.0 API: Create an MBeanLevelSpec object.static MBeanLevelSpec
createMBeanLevelSpec(javax.management.ObjectName oname, StatDescriptor sd, int level)
Deprecated.5.0 API: Create an MBeanLevelSpec object.static PerfDescriptor
createPerfDescriptor()
Deprecated.4.0 API.static PerfDescriptor
createPerfDescriptor(PerfDescriptor parent, int dataId)
Deprecated.4.0 API.static PerfDescriptor
createPerfDescriptor(PerfDescriptor parent, int[] dataIds)
Deprecated.4.0 API.static PerfDescriptor
createPerfDescriptor(PerfDescriptor parent, java.lang.String name)
Deprecated.4.0 API.static PerfDescriptor
createPerfDescriptor(java.lang.String qualifiedDataPath)
Deprecated.4.0 API.static PerfDescriptor
createPerfDescriptor(java.lang.String[] dataPath)
Deprecated.4.0 API.static PerfDescriptor
createPerfDescriptor(java.lang.String[] dataPath, int dataId)
Deprecated.4.0 API.static PerfDescriptor
createPerfDescriptor(java.lang.String[] dataPath, int[] dataIds)
Deprecated.4.0 API.static PerfDescriptor
createPerfDescriptor(java.lang.String qualifiedDataPath, int dataId)
Deprecated.4.0 API.static PerfDescriptor
createPerfDescriptor(java.lang.String qualifiedDataPath, int[] dataIds)
Deprecated.4.0 API.PerfLevelSpec
createPerfLevelSpec(int level)
Deprecated.4.0 API.PerfLevelSpec
createPerfLevelSpec(java.lang.String[] path, int level)
Deprecated.4.0 API.static CpdCollection
createRootCollection()
Deprecated.4.0 API: Create the root collection for the domainvoid
end()
Deprecated.Call this method before and ONLY before you are done with PmiClientstatic PmiModuleConfig
findConfig(PmiModuleConfig[] configs, javax.management.ObjectName on)
Deprecated.Return the config for the MBean ObjectNamestatic PmiModuleConfig
findConfig(PmiModuleConfig[] configs, java.lang.String moduleID)
Deprecated.Return the config for the moduleIDCpdCollection
get(PerfDescriptor pd, boolean recursive)
Deprecated.4.0 API: Get PMI data.int
getAdminState(java.lang.String nodeName)
Deprecated.Get the administratio state of the node, i.e., start or stop.int
getAdminState(java.lang.String nodeName, java.lang.String serverName)
Deprecated.Get the administratio state of the server, i.e., start or stop.PmiModuleConfig
getConfig(java.lang.String moduleName)
Deprecated.Return PmiModuleConfig for the module.PmiModuleConfig
getConfig(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName)
Deprecated.5.0 API: Get PmiModuleConfig for a particular MBean.PmiModuleConfig
getConfig(java.lang.String nodeName, java.lang.String serverName, java.lang.String moduleName)
Deprecated.Get PmiModuleConfig for a particular PMI module.PmiModuleConfig[]
getConfigs()
Deprecated.Get an array of PmiModuleConfig for all the PMI modules.PmiModuleConfig[]
getConfigs(java.lang.String nodeName, java.lang.String serverName)
Deprecated.5.0 API: Get all PmiModuleConfigs for the server.java.lang.String
getConnectedHost()
Deprecated.Return the connected host name: it should be the name of host name passed to PmiClient or the actual localhost name if "localhost" is passed to PmiClient.int
getDataId(java.lang.String moduleName, java.lang.String dataName)
Deprecated.Convert data name to dataIdjava.lang.String
getDataName(java.lang.String moduleName, int dataId)
Deprecated.Convert data id to data nameint
getErrorCode()
Deprecated.Check the error code, which could be one of the error constants defined in this class.int
getErrorCode(java.lang.String nodeName)
Deprecated.Check the error code, which could be one of the error constants defined in this class.java.lang.String
getErrorMessage()
Deprecated.Check the error message.java.lang.String
getErrorMessage(java.lang.String nodeName)
Deprecated.Check the error message.PerfLevelSpec[]
getInstrumentationLevel(java.lang.String nodeName, java.lang.String serverName)
Deprecated.4.0 API.static java.lang.String
getNLSValue(java.lang.String key)
Deprecated.Replaced by getNLSValue (key, moduleID)static java.lang.String
getNLSValue(java.lang.String key, java.lang.String moduleID)
Deprecated.Get translated key from the resource bundle.CpdCollection[]
gets(boolean recursive)
Deprecated.Get all the data you requested by calling add method.CpdCollection[]
gets(PerfDescriptor[] pds, boolean recursive)
Deprecated.4.0 API.CpdCollection[]
gets(PerfDescriptorList pdList, boolean recursive)
Deprecated.4.0 API.MBeanLevelSpec[]
getStatLevel(java.lang.String nodeName, java.lang.String serverName, MBeanStatDescriptor msd, boolean recursive)
Deprecated.5.0 API: Get MBeanLevelSpec[] based on a MBeanStatDescriptor.MBeanLevelSpec[]
getStatLevel(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName, boolean recursive)
Deprecated.5.0 API: Get MBeanLevelSpec[] based on an ObjectName.Stats[]
getStats(java.lang.String nodeName, java.lang.String serverName, MBeanStatDescriptor[] msds, boolean recursive)
Deprecated.5.0 API: Return an array of Stats objects.Stats
getStats(java.lang.String nodeName, java.lang.String serverName, MBeanStatDescriptor msd, boolean recursive)
Deprecated.5.0 API: Return a Stats object.Stats[]
getStats(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName[] oNames, boolean recursive)
Deprecated.5.0 API: Return an array of Stats objects.Stats
getStats(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName, boolean recursive)
Deprecated.5.0 API: Return a Stats object.javax.management.ObjectName[]
listMBeans(java.lang.String nodeName, java.lang.String serverName)
Deprecated.5.0 API: List all the MBeans in the server.PerfDescriptor[]
listMembers(PerfDescriptor pd)
Deprecated.4.0 API: List all the PMI members (modules, submodules, or data) under the PerfDescriptor.PerfDescriptor[]
listNodes()
Deprecated.List all the nodes in WebSphere domain.PerfDescriptor[]
listServers(PerfDescriptor pd)
Deprecated.List all the serves in the node.PerfDescriptor[]
listServers(java.lang.String nodeName)
Deprecated.List all the servers in the node.MBeanStatDescriptor[]
listStatMembers(java.lang.String nodeName, java.lang.String serverName, MBeanStatDescriptor msd)
Deprecated.5.0 API: List the MBeanStatDescriptors (if any) under it.MBeanStatDescriptor[]
listStatMembers(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName)
Deprecated.5.0 API: List the MBeanStatDescriptors (if any) under it.void
refreshModuleConfig(java.lang.String node, java.lang.String server)
Deprecated.Get the module configuration for all the modules from the given node and servervoid
setDebug(boolean enableDebug)
Deprecated.Pass true to it to enable debug, which is disabled by default.void
setInstrumentationLevel(java.lang.String nodeName, java.lang.String serverName, PerfLevelSpec[] specs, boolean recursive)
Deprecated.4.0 API.void
setPerfConfigInfo(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName, StatDescriptor sd, Stats stats)
Deprecated.void
setPerfConfigInfo(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName, Stats stats)
Deprecated.5.0 API: Set performance config info for each stats.void
setStatLevel(java.lang.String nodeName, java.lang.String serverName, MBeanLevelSpec[] msds, boolean recursive)
Deprecated.5.0 API: Set level.void
setStatLevel(java.lang.String nodeName, java.lang.String serverName, MBeanLevelSpec mls, boolean recursive)
Deprecated.5.0 API: Set level.static java.lang.String[]
stringToArray(java.lang.String qualifiedName)
Deprecated.4.0 API.
-
-
-
Field Detail
-
COPYRIGHT
public static final java.lang.String COPYRIGHT
Deprecated.- See Also:
- Constant Field Values
-
VERSION_AE
public static final java.lang.String VERSION_AE
Deprecated.- See Also:
- Constant Field Values
-
VERSION_AES
public static final java.lang.String VERSION_AES
Deprecated.- See Also:
- Constant Field Values
-
VERSION_EPM
public static final java.lang.String VERSION_EPM
Deprecated.- See Also:
- Constant Field Values
-
VERSION_WAS50
public static final java.lang.String VERSION_WAS50
Deprecated.- See Also:
- Constant Field Values
-
VERSION_WAS50ND
public static final java.lang.String VERSION_WAS50ND
Deprecated.- See Also:
- Constant Field Values
-
NO_ERROR
public static final int NO_ERROR
Deprecated.- See Also:
- Constant Field Values
-
FAILED_TO_GET_INITIAL_CONTEXT
public static final int FAILED_TO_GET_INITIAL_CONTEXT
Deprecated.- See Also:
- Constant Field Values
-
FAILED_TO_CREATE_PMISERVICE_BEAN_OBJECT
public static final int FAILED_TO_CREATE_PMISERVICE_BEAN_OBJECT
Deprecated.- See Also:
- Constant Field Values
-
FAILED_TO_LIST_NODES
public static final int FAILED_TO_LIST_NODES
Deprecated.- See Also:
- Constant Field Values
-
FAILED_TO_LIST_SERVERS
public static final int FAILED_TO_LIST_SERVERS
Deprecated.- See Also:
- Constant Field Values
-
FAILED_TO_LIST_MEMBERS
public static final int FAILED_TO_LIST_MEMBERS
Deprecated.- See Also:
- Constant Field Values
-
FAILED_TO_ENABLE_DATA
public static final int FAILED_TO_ENABLE_DATA
Deprecated.- See Also:
- Constant Field Values
-
FAILED_TO_DISABLE_DATA
public static final int FAILED_TO_DISABLE_DATA
Deprecated.- See Also:
- Constant Field Values
-
FAILED_TO_SET_LEVEL
public static final int FAILED_TO_SET_LEVEL
Deprecated.- See Also:
- Constant Field Values
-
FAILED_TO_GET_LEVEL
public static final int FAILED_TO_GET_LEVEL
Deprecated.- See Also:
- Constant Field Values
-
FAILED_TO_GET_DATA
public static final int FAILED_TO_GET_DATA
Deprecated.- See Also:
- Constant Field Values
-
FAILED_TO_GET_ADMIN_STATE
public static final int FAILED_TO_GET_ADMIN_STATE
Deprecated.- See Also:
- Constant Field Values
-
SERVER_STOPPED
public static final int SERVER_STOPPED
Deprecated.- See Also:
- Constant Field Values
-
NO_COLLECTOR_FOUND
public static final int NO_COLLECTOR_FOUND
Deprecated.- See Also:
- Constant Field Values
-
NO_SUCH_A_NODE
public static final int NO_SUCH_A_NODE
Deprecated.- See Also:
- Constant Field Values
-
NO_SUCH_A_SERVER
public static final int NO_SUCH_A_SERVER
Deprecated.- See Also:
- Constant Field Values
-
NO_PERFMBEAN_FOUND
public static final int NO_PERFMBEAN_FOUND
Deprecated.- See Also:
- Constant Field Values
-
SEPERATOR50
public static final java.lang.String SEPERATOR50
Deprecated.- See Also:
- Constant Field Values
-
SEPERATOR40
public static final java.lang.String SEPERATOR40
Deprecated.- See Also:
- Constant Field Values
-
DEFAULT_CONNECTOR_TYPE
public static final java.lang.String DEFAULT_CONNECTOR_TYPE
Deprecated.- See Also:
- Constant Field Values
-
DEFAULT_CONNECTOR_PORT
public static final java.lang.String DEFAULT_CONNECTOR_PORT
Deprecated.- See Also:
- Constant Field Values
-
pmiNLS
public static final com.ibm.ejs.sm.client.ui.NLS pmiNLS
Deprecated.
-
moduleNLSMap
public static java.util.HashMap moduleNLSMap
Deprecated.
-
prefixNLSMap
public static java.util.HashMap prefixNLSMap
Deprecated.
-
-
Constructor Detail
-
PmiClient
public PmiClient() throws java.rmi.RemoteException
Deprecated.Constructor: assume all defaults: local host, port DEFAULT_CONNECTOR_PORT, and WAS50 version.- Throws:
java.rmi.RemoteException
-
PmiClient
public PmiClient(boolean inAppServer) throws java.rmi.RemoteException
Deprecated.Use this constructor only when you are calling it inside an appserver.- Parameters:
inAppServer
- may be true if you are calling it inside an appserver- Throws:
java.rmi.RemoteException
-
PmiClient
public PmiClient(java.lang.String host, java.lang.String port) throws java.rmi.RemoteException
Deprecated.Constructor:- Parameters:
host
- is the host name where adminserver/netManager is runningport
- is the port number for adminserver/netManager Use default version, i.e., WAS50.- Throws:
java.rmi.RemoteException
-
PmiClient
public PmiClient(java.lang.String host, java.lang.String port, java.lang.String version) throws java.rmi.RemoteException
Deprecated.Constructor: take host, port, and version.- Parameters:
host
- is the host name where adminserver/netManager is runningport
- is the port number for adminserver/netManagerversion
- could be "WAS50" for 5.0, "AE" for 4.0x AE, "AES" for 4.0x AEs, and "EPM" for 3.5- Throws:
java.rmi.RemoteException
-
PmiClient
public PmiClient(java.lang.String host, java.lang.String nodeName, java.lang.String port, java.lang.String version) throws java.rmi.RemoteException
Deprecated.Constructor: take host, nodeName, port, and version. Only applicable to 3.5.x server.- Parameters:
host
- is the host name where adminserver/netManager is runningport
- is the port number for adminserver/netManagerversion
- could be "WAS50" for 5.0, "AE" for 4.0x AE, "AES" for 4.0x AEs, and "EPM" for 3.5nodeName:
- optional node name helps getting the EJB home name in some complicate network configuration (e.g., adminserver is running on a machine with multiple network interfaces). Note: in most of the cases, you do not have to set the node name. The node name only applies when getting data from 3.5.x server. It will be ignored for 4.0+ and 5.0.- Throws:
java.rmi.RemoteException
-
PmiClient
public PmiClient(java.lang.String host, java.lang.String port, java.lang.String version, boolean inAppServer, java.lang.String connectorType) throws java.rmi.RemoteException
Deprecated.Constructor: take host, port, and version.- Parameters:
host
- is the host name where adminserver/netManager is running. If not passed, the default is localhost.port
- is the port number for adminserver/netManager. If not passed, the default is DEFAULT_CONNECTOR_PORT.version
- could be "WAS50" for 5.0, "AE" for 4.0x and "EPM" for 3.5. If not passed, the default is WAS50.inAppServer
- should be false unless you are calling from an appserver. If not passed, the default is false.connectorType
- is either RMI or SOAP. If not passed, the default is DEFAULT_CONNECTOR_TYPE.- Throws:
java.rmi.RemoteException
-
PmiClient
public PmiClient(java.util.Properties props, java.lang.String version) throws java.rmi.RemoteException
Deprecated.Constructor: take a Properties and the version. This is a generic way to pass all the necessary paramter.If you do not use the default host (localhost), port (8880) and connector type (AdminClient.CONNECTOR_TYPE_SOAP), you have to set the following properties props.setProperty(AdminClient.CONNECTOR_HOST, hostName); props.setProperty(AdminClient.CONNECTOR_PORT, portNumber); props.setProperty(AdminClient.CONNECTOR_TYPE, connectorType);
Enable security for WAS 5.0. The following instruction is copied from AdminClient.
For SOAP based AdminClient, the users need to specifiy the "username" and "password" and explicitly set "securityEnabled" as "true". Some other properties are also required in order to make a SSL connection, these properties can be either specified as a Java system properties or passed as paramemters when invoking AdminClientFactory.createAdminClient(Properties). These properties include
- javax.net.ssl.trustStore
- javax.net.ssl.keyStore
- javax.net.ssl.trustStorePassword
- javax.net.ssl.keyStorePassword
An exmample to make a secure SOAP based AdminClient:
Properties props = new Properties(); props.setProperty(AdminClient.CONNECTOR_HOST, "localhost"); props.setProperty(AdminClient.CONNECTOR_PORT, "8880"); props.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_SOAP); props.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true"); props.setProperty(AdminClient.USERNAME, "user1"); props.setProperty(AdminClient.PASSWORD, "password1"); props.setProperty("javax.net.ssl.trustStore", "C:/WebSphere/AppServer/etc/DummyClientTrustFile.jks"); props.setProperty("javax.net.ssl.keyStore", "C:/WebSphere/AppServer/etc/DummyClientKeyFile.jks"); props.setProperty("javax.net.ssl.trustStorePassword", "WebAS"); props.setProperty("javax.net.ssl.keyStorePassword", "WebAS"); AdminClient client = AdminClientFactory.createAdminClient(props);
To make a secure RMI based AdminClient is a little easier because you can rely on existing "com.ibm.CORBA.ConfigURL" which normal points to a property file, for instance, $WAS_ROOT/properties/sas.client.properites. There are a couple different ways to specify the login username and password and it's determined by "com.ibm.CORBA.loginSource" in "com.ibm.CORBA.ConfigURL". For programmatic login, you can set "com.ibm.CORBA.loginSource" as "none" and then provide your username/password when you create a AdminClient using AdminClientFactory.
For example,
Properties props = new Properties(); props.setProperty(AdminClient.CONNECTOR_HOST, "localhost"); props.setProperty(AdminClient.CONNECTOR_PORT, "2809"); props.setProperty(AdminClient.CONNECTOR_TYPE, AdminClient.CONNECTOR_TYPE_RMI); props.setProperty(AdminClient.CONNECTOR_SECURITY_ENABLED, "true"); props.setProperty(AdminClient.USERNAME, "test"); props.setProperty(AdminClient.PASSWORD, "user4test"); AdminClient client = AdminClientFactory.createAdminClient(props);
- Throws:
java.rmi.RemoteException
-
-
Method Detail
-
getConnectedHost
public java.lang.String getConnectedHost()
Deprecated.Return the connected host name: it should be the name of host name passed to PmiClient or the actual localhost name if "localhost" is passed to PmiClient. Note: you can pass "localhost" when calling "new PmiClient", but you cannot use "localhost" when calling methods on PmiClient. You have to call this method to get the real host name and pass as parameter to methods in PmiClient.
-
createCpdData
public static CpdData createCpdData(PmiModuleConfig moduleConfig, PerfDescriptor parent, com.ibm.ws.pmi.wire.WpdData wData)
Deprecated.4.0 API: create a CpdData object from WpdData
-
createCpdCollection
public CpdCollection createCpdCollection(PerfDescriptor colPd, com.ibm.ws.pmi.wire.WpdCollection wCol)
Deprecated.4.0 API: create a CpdCollection object from WpdCollection
-
createRootCollection
public static CpdCollection createRootCollection()
Deprecated.4.0 API: Create the root collection for the domain
-
listNodes
public PerfDescriptor[] listNodes() throws PmiException
Deprecated.List all the nodes in WebSphere domain. You can call PerfDescriptor[i].getName() to get a list of node names in WebSphere domain.- Throws:
PmiException
-
listServers
public PerfDescriptor[] listServers(java.lang.String nodeName) throws PmiException
Deprecated.List all the servers in the node. You can call PerfDescriptor[i].getName() to get a list of server names on the node.- Throws:
PmiException
-
listServers
public PerfDescriptor[] listServers(PerfDescriptor pd) throws PmiException
Deprecated.List all the serves in the node. You can call PerfDescriptor[i].getName() to get a list of server names on the node.- Throws:
PmiException
-
listMembers
public PerfDescriptor[] listMembers(PerfDescriptor pd) throws PmiException
Deprecated.4.0 API: List all the PMI members (modules, submodules, or data) under the PerfDescriptor.- Throws:
PmiException
-
getConfigs
public PmiModuleConfig[] getConfigs()
Deprecated.Get an array of PmiModuleConfig for all the PMI modules. It may contain all the modules avaialbe in WebSphere app server. A specific appserver may or may not use all of the them.
-
refreshModuleConfig
public void refreshModuleConfig(java.lang.String node, java.lang.String server)
Deprecated.Get the module configuration for all the modules from the given node and server
-
getConfig
public PmiModuleConfig getConfig(java.lang.String moduleName)
Deprecated.Return PmiModuleConfig for the module.
-
get
public CpdCollection get(PerfDescriptor pd, boolean recursive) throws PmiException
Deprecated.4.0 API: Get PMI data. The PerfDescriptor uniquely identifies the PMI data in an appserver. It will return null if pd is wrong or server is down.- Parameters:
recursive
- If recursive is true, it will return all the subcollections with data. If recursive is false, it will return the data immediately under the PerfDescriptor and no subcollection will be returned.- Throws:
PmiException
-
gets
public CpdCollection[] gets(boolean recursive) throws PmiException
Deprecated.Get all the data you requested by calling add method.- Throws:
PmiException
-
gets
public CpdCollection[] gets(PerfDescriptor[] pds, boolean recursive) throws PmiException
Deprecated.4.0 API. Get PMI data. Each pd uniquely identifies the PMI data in an appserver.- Parameters:
recursive
- If recursive is true, it will return all the subcollections with data. If recursive is false, it will return the data immediately under the PerfDescriptor and no subcollection will be returned.- Throws:
PmiException
-
gets
public CpdCollection[] gets(PerfDescriptorList pdList, boolean recursive) throws PmiException
Deprecated.4.0 API. Get PMI data. Each pd uniquely identifies the PMI data in an appserver.- Parameters:
recursive
- If recursive is true, it will return all the subcollections with data. If recursive is false, it will return the data immediately under the PerfDescriptor and no subcollection will be returned.- Throws:
PmiException
-
getAdminState
public int getAdminState(java.lang.String nodeName) throws PmiException
Deprecated.Get the administratio state of the node, i.e., start or stop.- Throws:
PmiException
-
getAdminState
public int getAdminState(java.lang.String nodeName, java.lang.String serverName) throws PmiException
Deprecated.Get the administratio state of the server, i.e., start or stop.- Throws:
PmiException
-
getErrorCode
public int getErrorCode()
Deprecated.Check the error code, which could be one of the error constants defined in this class. You may want to call it when you think the return result is not expected.
-
getErrorMessage
public java.lang.String getErrorMessage()
Deprecated.Check the error message. You may want to call it when you think the return result is not expected.
-
getErrorCode
public int getErrorCode(java.lang.String nodeName)
Deprecated.Check the error code, which could be one of the error constants defined in this class. You may want to call it when you think the return result is not expected.
-
getErrorMessage
public java.lang.String getErrorMessage(java.lang.String nodeName)
Deprecated.Check the error message. You may want to call it when you think the return result is not expected.
-
add
public void add(PerfDescriptor pd)
Deprecated.4.0 API. Add pd to the PmiClient and later call gets(boolean recursive) to retrieve data for all the pds you have added.
-
stringToArray
public static java.lang.String[] stringToArray(java.lang.String qualifiedName)
Deprecated.4.0 API. A help method.- Parameters:
qualifiedName
- it should look like the following: nodename,servername,modulename,instancenameThe qualifierName can also be nodename/servername/modulename/instancename as supported in 4.0. However, "/" can not be in any name in the path if you use the 4.0 format. Otherwise, PMI will not be able to construct path correctly. You can use a substring of the above starting from node name
-
createPerfDescriptor
public static PerfDescriptor createPerfDescriptor()
Deprecated.4.0 API. Return a PerfDescriptor especially for the root in the domain. Take no param.
-
createPerfDescriptor
public static PerfDescriptor createPerfDescriptor(java.lang.String[] dataPath)
Deprecated.4.0 API. Return a PerfDescriptor with given dataPath
-
createPerfDescriptor
public static PerfDescriptor createPerfDescriptor(java.lang.String qualifiedDataPath)
Deprecated.4.0 API.- Parameters:
qualifiedDataPath
- it should look like the following: nodename/servername/modulename/instancename. e.g. node1/server1/connectionPoolModule/datasource1 node1/server1/beanModule/container1.bean1
-
createPerfDescriptor
public static PerfDescriptor createPerfDescriptor(java.lang.String[] dataPath, int dataId)
Deprecated.4.0 API. Return a PerfDescriptor with given dataPath and single dataId
-
createPerfDescriptor
public static PerfDescriptor createPerfDescriptor(java.lang.String qualifiedDataPath, int dataId)
Deprecated.4.0 API.- Parameters:
qualifiedDataPath
- it should look like the following: nodename/servername/modulename/instancename. e.g. node1/server1/connectionPoolModule/datasource1 node1/server1/beanModule/container1.bean1
-
createPerfDescriptor
public static PerfDescriptor createPerfDescriptor(java.lang.String[] dataPath, int[] dataIds)
Deprecated.4.0 API. Return a PerfDescriptor with given dataPath and multiple dataIds under same dataPath.
-
createPerfDescriptor
public static PerfDescriptor createPerfDescriptor(java.lang.String qualifiedDataPath, int[] dataIds)
Deprecated.4.0 API.- Parameters:
qualifiedDataPath
- it should look like the following: nodename/servername/modulename/instancename. e.g. node1/server1/connectionPoolModule/datasource1 node1/server1/beanModule/container1.bean1
-
createPerfDescriptor
public static PerfDescriptor createPerfDescriptor(PerfDescriptor parent, java.lang.String name)
Deprecated.4.0 API. Return a PerfDescriptor with the given parent.
-
createPerfDescriptor
public static PerfDescriptor createPerfDescriptor(PerfDescriptor parent, int dataId)
Deprecated.4.0 API. Return a PerfDescriptor with given dataPath and single dataId
-
createPerfDescriptor
public static PerfDescriptor createPerfDescriptor(PerfDescriptor parent, int[] dataIds)
Deprecated.4.0 API. Return a PerfDescriptor with given dataPath and multiple dataIds under same dataPath.
-
createPerfLevelSpec
public PerfLevelSpec createPerfLevelSpec(java.lang.String[] path, int level)
Deprecated.4.0 API. Return a PerfLevelSpec with given path and level
-
createPerfLevelSpec
public PerfLevelSpec createPerfLevelSpec(int level)
Deprecated.4.0 API. Return a PerfLevelSpec - no path means for all the paths in the app server
-
getDataName
public java.lang.String getDataName(java.lang.String moduleName, int dataId)
Deprecated.Convert data id to data name
-
getDataId
public int getDataId(java.lang.String moduleName, java.lang.String dataName)
Deprecated.Convert data name to dataId
-
getInstrumentationLevel
public PerfLevelSpec[] getInstrumentationLevel(java.lang.String nodeName, java.lang.String serverName) throws PmiException
Deprecated.4.0 API. Get instrumentation level for all the modules/submodules in the appserver.- Throws:
PmiException
-
setInstrumentationLevel
public void setInstrumentationLevel(java.lang.String nodeName, java.lang.String serverName, PerfLevelSpec[] specs, boolean recursive) throws PmiException
Deprecated.4.0 API.Note: setting levels from PmiClient will change the levels in the affected app server. It will impact other PMI clients that retrieve PMI data from the same app server.
- Throws:
PmiException
-
setPerfConfigInfo
public void setPerfConfigInfo(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName, Stats stats)
Deprecated.5.0 API: Set performance config info for each stats. Note the config info not passed by server in order to reduce communication cost.
-
setPerfConfigInfo
public void setPerfConfigInfo(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName, StatDescriptor sd, Stats stats)
Deprecated.
-
getStats
public Stats getStats(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName, boolean recursive) throws PmiException
Deprecated.5.0 API: Return a Stats object.- Throws:
PmiException
-
getStats
public Stats getStats(java.lang.String nodeName, java.lang.String serverName, MBeanStatDescriptor msd, boolean recursive) throws PmiException
Deprecated.5.0 API: Return a Stats object.- Throws:
PmiException
-
getStats
public Stats[] getStats(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName[] oNames, boolean recursive) throws PmiException
Deprecated.5.0 API: Return an array of Stats objects.- Throws:
PmiException
-
getStats
public Stats[] getStats(java.lang.String nodeName, java.lang.String serverName, MBeanStatDescriptor[] msds, boolean recursive) throws PmiException
Deprecated.5.0 API: Return an array of Stats objects.- Throws:
PmiException
-
listMBeans
public javax.management.ObjectName[] listMBeans(java.lang.String nodeName, java.lang.String serverName)
Deprecated.5.0 API: List all the MBeans in the server.
-
listStatMembers
public MBeanStatDescriptor[] listStatMembers(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName)
Deprecated.5.0 API: List the MBeanStatDescriptors (if any) under it.
-
listStatMembers
public MBeanStatDescriptor[] listStatMembers(java.lang.String nodeName, java.lang.String serverName, MBeanStatDescriptor msd)
Deprecated.5.0 API: List the MBeanStatDescriptors (if any) under it.
-
getConfigs
public PmiModuleConfig[] getConfigs(java.lang.String nodeName, java.lang.String serverName)
Deprecated.5.0 API: Get all PmiModuleConfigs for the server.
-
getConfig
public PmiModuleConfig getConfig(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName)
Deprecated.5.0 API: Get PmiModuleConfig for a particular MBean.
-
getConfig
public PmiModuleConfig getConfig(java.lang.String nodeName, java.lang.String serverName, java.lang.String moduleName)
Deprecated.Get PmiModuleConfig for a particular PMI module.
-
setStatLevel
public void setStatLevel(java.lang.String nodeName, java.lang.String serverName, MBeanLevelSpec mls, boolean recursive)
Deprecated.5.0 API: Set level. It will enable/disable PMI data in the server.
-
setStatLevel
public void setStatLevel(java.lang.String nodeName, java.lang.String serverName, MBeanLevelSpec[] msds, boolean recursive)
Deprecated.5.0 API: Set level. It will enable/disable PMI data in the server.
-
getStatLevel
public MBeanLevelSpec[] getStatLevel(java.lang.String nodeName, java.lang.String serverName, javax.management.ObjectName oName, boolean recursive)
Deprecated.5.0 API: Get MBeanLevelSpec[] based on an ObjectName.
-
getStatLevel
public MBeanLevelSpec[] getStatLevel(java.lang.String nodeName, java.lang.String serverName, MBeanStatDescriptor msd, boolean recursive)
Deprecated.5.0 API: Get MBeanLevelSpec[] based on a MBeanStatDescriptor.
-
createMBeanLevelSpec
public static MBeanLevelSpec createMBeanLevelSpec(javax.management.ObjectName oname, int level)
Deprecated.5.0 API: Create an MBeanLevelSpec object.
-
createMBeanLevelSpec
public static MBeanLevelSpec createMBeanLevelSpec(javax.management.ObjectName oname, StatDescriptor sd, int level)
Deprecated.5.0 API: Create an MBeanLevelSpec object.
-
end
public void end()
Deprecated.Call this method before and ONLY before you are done with PmiClient
-
getNLSValue
public static java.lang.String getNLSValue(java.lang.String key)
Deprecated. Replaced by getNLSValue (key, moduleID)Translate the key to the language you choose. Returns the key if ResourceBundle is missing.
-
getNLSValue
public static java.lang.String getNLSValue(java.lang.String key, java.lang.String moduleID)
Deprecated.Get translated key from the resource bundle.- Parameters:
key
- key to be translatedmoduleID
- the module name from the PmiModuleConfig. Pass null to use default resource bundle- Returns:
- Returns translated key or the key if resoure bundle is not available.
-
setDebug
public void setDebug(boolean enableDebug)
Deprecated.Pass true to it to enable debug, which is disabled by default.
-
findConfig
public static PmiModuleConfig findConfig(PmiModuleConfig[] configs, java.lang.String moduleID)
Deprecated.Return the config for the moduleID
-
findConfig
public static PmiModuleConfig findConfig(PmiModuleConfig[] configs, javax.management.ObjectName on)
Deprecated.Return the config for the MBean ObjectName
-
-