Package org.talamonso.OMAPI.Objects

Examples of org.talamonso.OMAPI.Objects.Host


      c.setAuth(omapiKeyName, omapiKeyValue);
    } catch (OmapiException e) {
      System.err.println(e.getMessage());
    }

    Host searchHost = new Host(c);
;
    searchHost.setName(name);
    try {
      Host existingHost=searchHost.send(Message.OPEN);
      existingHost.delete();

    } catch (OmapiObjectException e) {
      // Object does not exist
      // So we can try to create it       
    }

    try {
      Host newHost = new Host(c);
      newHost.setName(name);
      newHost.setHardwareAddress(macAddress);
      newHost.setHardwareType(1);
      newHost.send(Message.CREATE);
    } catch (OmapiObjectException e1) {
      // Update failed for some reason
      e1.printStackTrace();
    }
View Full Code Here

TOP

Related Classes of org.talamonso.OMAPI.Objects.Host

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.