コード例 #1
0
 /**
  * This is for tests to harness and create a mock client. Do not use!
  *
  * @param client allows a IWmiClient to be pre-instantiated. Used for mock testing.
  * @throws org.opennms.protocols.wmi.WmiException is thrown if there are any problems connecting.
  */
 public void init(final IWmiClient client) throws WmiException {
   m_WmiClient = client;
   m_WmiClient.connect(m_Domain, m_Username, m_Password);
 }
コード例 #2
0
 /**
  * This creates a new WmiClient and creates a connection to the host.
  *
  * @throws org.opennms.protocols.wmi.WmiException An exception will be thrown if the system is
  *     unable to look up the host and if J-Interop throws an exception this will re-throw that
  *     exception so that implementors need not know J-Interop exceptions.
  */
 public void init() throws WmiException {
   m_WmiClient = (IWmiClient) new WmiClient(m_HostName);
   m_WmiClient.connect(m_Domain, m_Username, m_Password);
 }