Package org.opennms.protocols.wmi
Class WmiClient
- java.lang.Object
-
- org.opennms.protocols.wmi.WmiClient
-
- All Implemented Interfaces:
IWmiClient
public class WmiClient extends Object implements IWmiClient
This is a low-level WMI client harnessing DCOM to communicate with remote agents. The interface provided is similar but not identical to that of the SWbemServices interface.
- Author:
- Matt Raykowski, OpenNMS
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect(String domain, String username, String password, String namespace)
connectstatic Object
convertToNativeType(org.jinterop.dcom.core.JIVariant type)
convertToNativeTypestatic Date
convertWmiDate(String dateStr)
convertWmiDatevoid
disconnect()
disconnectOnmsWbemObjectSet
performExecQuery(String strQuery)
performExecQueryOnmsWbemObjectSet
performExecQuery(String strQuery, String strQueryLanguage, Integer flags)
performExecQueryOnmsWbemObjectSet
performInstanceOf(String wmiClass)
performInstanceOfOnmsWbemObjectSet
performSubclassOf()
performSubclassOfOnmsWbemObjectSet
performSubclassOf(String strSuperClass)
performSubclassOfOnmsWbemObject
performWmiGet(String strObjectPath)
performWmiGet
-
-
-
Constructor Detail
-
WmiClient
public WmiClient(String address) throws WmiException
Constructor for WmiClient.
- Parameters:
address
- aString
object.- Throws:
WmiException
- if any.
-
-
Method Detail
-
performInstanceOf
public OnmsWbemObjectSet performInstanceOf(String wmiClass) throws WmiException
performInstanceOf
- Specified by:
performInstanceOf
in interfaceIWmiClient
- Parameters:
wmiClass
- aString
object.- Returns:
- a
OnmsWbemObjectSet
object. - Throws:
WmiException
- if any.
-
performExecQuery
public OnmsWbemObjectSet performExecQuery(String strQuery) throws WmiException
performExecQuery
- Specified by:
performExecQuery
in interfaceIWmiClient
- Parameters:
strQuery
- aString
object.- Returns:
- a
OnmsWbemObjectSet
object. - Throws:
WmiException
- if any.
-
performExecQuery
public OnmsWbemObjectSet performExecQuery(String strQuery, String strQueryLanguage, Integer flags) throws WmiException
performExecQuery
- Specified by:
performExecQuery
in interfaceIWmiClient
- Parameters:
strQuery
- aString
object.strQueryLanguage
- aString
object.flags
- aInteger
object.- Returns:
- a
OnmsWbemObjectSet
object. - Throws:
WmiException
- if any.
-
performWmiGet
public OnmsWbemObject performWmiGet(String strObjectPath) throws WmiException
performWmiGet
- Parameters:
strObjectPath
- aString
object.- Returns:
- a
OnmsWbemObject
object. - Throws:
WmiException
- if any.
-
performSubclassOf
public OnmsWbemObjectSet performSubclassOf(String strSuperClass) throws WmiException
performSubclassOf
- Parameters:
strSuperClass
- aString
object.- Returns:
- a
OnmsWbemObjectSet
object. - Throws:
WmiException
- if any.
-
performSubclassOf
public OnmsWbemObjectSet performSubclassOf() throws WmiException
performSubclassOf
- Returns:
- a
OnmsWbemObjectSet
object. - Throws:
WmiException
- if any.
-
convertToNativeType
public static Object convertToNativeType(org.jinterop.dcom.core.JIVariant type) throws WmiException
convertToNativeType
- Parameters:
type
- aJIVariant
object.- Returns:
- a
Object
object. - Throws:
WmiException
- if any.
-
connect
public void connect(String domain, String username, String password, String namespace) throws WmiException
connect
- Specified by:
connect
in interfaceIWmiClient
- Parameters:
domain
- aString
object.username
- aString
object.password
- aString
object.namespace
- aString
object.- Throws:
WmiException
- if any.
-
disconnect
public void disconnect() throws WmiException
disconnect
- Specified by:
disconnect
in interfaceIWmiClient
- Throws:
WmiException
- if any.
-
convertWmiDate
public static Date convertWmiDate(String dateStr) throws ParseException
convertWmiDate
- Parameters:
dateStr
- aString
object.- Returns:
- a
Date
object. - Throws:
ParseException
- if any.
-
-