Package org.opennms.protocols.wmi
Class WmiClient
- java.lang.Object
-
- org.opennms.protocols.wmi.WmiClient
-
- All Implemented Interfaces:
IWmiClient
public class WmiClient extends java.lang.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
-
-
Constructor Summary
Constructors Constructor Description WmiClient(java.lang.String address)
Constructor for WmiClient.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect(java.lang.String domain, java.lang.String username, java.lang.String password, java.lang.String namespace)
connectstatic java.lang.Object
convertToNativeType(org.jinterop.dcom.core.JIVariant type)
convertToNativeTypestatic java.util.Date
convertWmiDate(java.lang.String dateStr)
convertWmiDatevoid
disconnect()
disconnectOnmsWbemObjectSet
performExecQuery(java.lang.String strQuery)
performExecQueryOnmsWbemObjectSet
performExecQuery(java.lang.String strQuery, java.lang.String strQueryLanguage, java.lang.Integer flags)
performExecQueryOnmsWbemObjectSet
performInstanceOf(java.lang.String wmiClass)
performInstanceOfOnmsWbemObjectSet
performSubclassOf()
performSubclassOfOnmsWbemObjectSet
performSubclassOf(java.lang.String strSuperClass)
performSubclassOfOnmsWbemObject
performWmiGet(java.lang.String strObjectPath)
performWmiGet
-
-
-
Constructor Detail
-
WmiClient
public WmiClient(java.lang.String address) throws WmiException
Constructor for WmiClient.
- Parameters:
address
- aString
object.- Throws:
WmiException
- if any.
-
-
Method Detail
-
performInstanceOf
public OnmsWbemObjectSet performInstanceOf(java.lang.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(java.lang.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(java.lang.String strQuery, java.lang.String strQueryLanguage, java.lang.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(java.lang.String strObjectPath) throws WmiException
performWmiGet
- Parameters:
strObjectPath
- aString
object.- Returns:
- a
OnmsWbemObject
object. - Throws:
WmiException
- if any.
-
performSubclassOf
public OnmsWbemObjectSet performSubclassOf(java.lang.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 java.lang.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(java.lang.String domain, java.lang.String username, java.lang.String password, java.lang.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 java.util.Date convertWmiDate(java.lang.String dateStr) throws java.text.ParseException
convertWmiDate
- Parameters:
dateStr
- aString
object.- Returns:
- a
Date
object. - Throws:
java.text.ParseException
- if any.
-
-