Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  
  /*
   *  Copyright (C) 2010-2011 Oracle Corporation
   *
   *  This file is part of the VirtualBox SDK, as available from
   *  http://www.virtualbox.org.  This library is free software; you can
   *  redistribute it and/or modify it under the terms of the GNU Lesser General
   *  Public License as published by the Free Software Foundation, in version 2.1
   *  as it comes in the "COPYING.LIB" file of the VirtualBox SDK distribution.
  *  This library is distributed in the hope that it will be useful, but WITHOUT
  *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
  *  License for more details.
  *
  * IHost.java
  *
  * DO NOT EDIT! This is a generated file.
  * Generated from: src/VBox/Main/idl/VirtualBox.xidl (VirtualBox's interface definitions in XML)
  * Generator: src/VBox/Main/glue/glue-java.xsl
  */
 
 package org.virtualbox_4_2;
 
 import javax.xml.ws.*;
 import java.util.List;

The IHost interface represents the physical machine that this VirtualBox installation runs on. An object implementing this interface is returned by the IVirtualBox.getHost() attribute. This interface contains read-only information about the host's physical hardware (such as what processors and disks are available, what the host operating system is, and so on) and also allows for manipulating some of the host's hardware, such as global USB device filters and host interface networking. Interface ID: {30678943-32DF-4830-B413-931B25AC86A0}
 
 public class IHost extends IUnknown {
 
     public IHost(String wrappedVboxPortType port) {
           super(wrappedport);
     }
List of DVD drives available on the host.

Returns:
List<org.virtualbox_4_2.IMedium>
 
     public List<org.virtualbox_4_2.IMediumgetDVDDrives() {
       try {
          List<StringretVal = .iHostGetDVDDrives();
          return Helper.wrap(org.virtualbox_4_2.IMedium.classretVal);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
List of floppy drives available on the host.

Returns:
List<org.virtualbox_4_2.IMedium>
 
       try {
          List<StringretVal = .iHostGetFloppyDrives();
          return Helper.wrap(org.virtualbox_4_2.IMedium.classretVal);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      }
     }
List of USB devices currently attached to the host. Once a new device is physically attached to the host computer, it appears in this list and remains there until detached. NOTE: If USB functionality is not available in the given edition of VirtualBox, this method will set the result code to E_NOTIMPL.

Returns:
List<org.virtualbox_4_2.IHostUSBDevice>
 
       try {
          List<StringretVal = .iHostGetUSBDevices();
          return Helper.wrap(org.virtualbox_4_2.IHostUSBDevice.classretVal);
      } catch (InvalidObjectFaultMsg e) {
           throw new VBoxException(ee.getMessage());
      } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
List of USB device filters in action. When a new device is physically attached to the host computer, filters from this list are applied to it (in order they are stored in the list). The first matched filter will determine the IHostUSBDeviceFilter.getAction() performed on the device. Unless the device is ignored by these filters, filters of all currently running virtual machines (IUSBController.getDeviceFilters()) are applied to it. NOTE: If USB functionality is not available in the given edition of VirtualBox, this method will set the result code to E_NOTIMPL.

Returns:
List<org.virtualbox_4_2.IHostUSBDeviceFilter>
See also:
IHostUSBDeviceFilter
USBDeviceState
      try {
         List<StringretVal = .iHostGetUSBDeviceFilters();
         return Helper.wrap(org.virtualbox_4_2.IHostUSBDeviceFilter.classretVal);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
List of host network interfaces currently defined on the host.

Returns:
List<org.virtualbox_4_2.IHostNetworkInterface>
      try {
         List<StringretVal = .iHostGetNetworkInterfaces();
         return Helper.wrap(org.virtualbox_4_2.IHostNetworkInterface.classretVal);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Number of (logical) CPUs installed in the host system.

Returns:
Long
    public Long getProcessorCount() {
      try {
         Long retVal = .iHostGetProcessorCount();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Number of (logical) CPUs online in the host system.

Returns:
Long
    public Long getProcessorOnlineCount() {
      try {
         Long retVal = .iHostGetProcessorOnlineCount();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Number of physical processor cores installed in the host system.

Returns:
Long
    public Long getProcessorCoreCount() {
      try {
         Long retVal = .iHostGetProcessorCoreCount();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Amount of system memory in megabytes installed in the host system.

Returns:
Long
    public Long getMemorySize() {
      try {
         Long retVal = .iHostGetMemorySize();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Available system memory in the host system.

Returns:
Long
    public Long getMemoryAvailable() {
      try {
         Long retVal = .iHostGetMemoryAvailable();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Name of the host system's operating system.

Returns:
String
    public String getOperatingSystem() {
      try {
         String retVal = .iHostGetOperatingSystem();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Host operating system's version string.

Returns:
String
    public String getOSVersion() {
      try {
         String retVal = .iHostGetOSVersion();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Returns the current host time in milliseconds since 1970-01-01 UTC.

Returns:
Long
    public Long getUTCTime() {
      try {
         Long retVal = .iHostGetUTCTime();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Returns true when the host supports 3D hardware acceleration.

Returns:
Boolean
      try {
         Boolean retVal = .iHostGetAcceleration3DAvailable();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
    public static IHost queryInterface(IUnknown obj) {
       return obj == null ?  null : new IHost(obj.getWrapped(), obj.getRemoteWSPort());
    }
Query the (approximate) maximum speed of a specified host CPU in Megahertz.

Parameters:
cpuId Identifier of the CPU.
Returns:
Speed value. 0 is returned if value is not known or cpuId is invalid.
    public Long getProcessorSpeed(Long cpuId) {
      try {
        Long     retVal;
        retVal = .iHostGetProcessorSpeed(cpuId);
        return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Query whether a CPU feature is supported or not.

Parameters:
feature CPU Feature identifier.
Returns:
Feature is supported or not.
      try {
        Boolean     retVal;
        retVal = .iHostGetProcessorFeature(, org.virtualbox_4_2.jaxws.ProcessorFeature.fromValue(feature.name()));
        return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Query the model string of a specified host CPU.

Parameters:
cpuId Identifier of the CPU.
Returns:
Model string. An empty string is returned if value is not known or cpuId is invalid. NOTE: The current implementation might not necessarily return the description for this exact CPU.
    public String getProcessorDescription(Long cpuId) {
      try {
        String     retVal;
        retVal = .iHostGetProcessorDescription(cpuId);
        return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Returns the CPU cpuid information for the specified leaf.

Parameters:
cpuId Identifier of the CPU. The CPU most be online.
leaf CPUID leaf index (eax).
subLeaf CPUID leaf sub index (ecx). This currently only applies to cache information on Intel CPUs. Use 0 if retrieving values for IMachine.setCPUIDLeaf(java.lang.Long,java.lang.Long,java.lang.Long,java.lang.Long,java.lang.Long).
valEax CPUID leaf value for register eax.
valEbx CPUID leaf value for register ebx.
valEcx CPUID leaf value for register ecx.
valEdx CPUID leaf value for register edx. NOTE: The current implementation might not necessarily return the description for this exact CPU.
    public void getProcessorCPUIDLeaf(Long cpuIdLong leafLong subLeafHolder<LongvalEaxHolder<LongvalEbxHolder<LongvalEcxHolder<LongvalEdx) {
      try {
        javax.xml.ws.Holder<Long>   tmp_valEax = new  javax.xml.ws.Holder<Long>();
        javax.xml.ws.Holder<Long>   tmp_valEbx = new  javax.xml.ws.Holder<Long>();
        javax.xml.ws.Holder<Long>   tmp_valEcx = new  javax.xml.ws.Holder<Long>();
        javax.xml.ws.Holder<Long>   tmp_valEdx = new  javax.xml.ws.Holder<Long>();
        .iHostGetProcessorCPUIDLeaf(cpuIdleafsubLeaftmp_valEaxtmp_valEbxtmp_valEcxtmp_valEdx);
        valEax.value = tmp_valEax.value;
        valEbx.value = tmp_valEbx.value;
        valEcx.value = tmp_valEcx.value;
        valEdx.value = tmp_valEdx.value;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Creates a new adapter for Host Only Networking.

Parameters:
hostInterface Created host interface object.
Returns:
Progress object to track the operation completion. Expected result codes:
E_INVALIDARG Host network interface name already exists.
      try {
        javax.xml.ws.Holder<String>   tmp_hostInterface = new  javax.xml.ws.Holder<String>();
        javax.xml.ws.Holder<StringretVal = new javax.xml.ws.Holder<String>();
        .iHostCreateHostOnlyNetworkInterface(tmp_hostInterfaceretVal);
        hostInterface.value = (tmp_hostInterface.value.length() > 0) ? new org.virtualbox_4_2.IHostNetworkInterface(tmp_hostInterface.value) : null;
        return (retVal.value.length() > 0) ? new org.virtualbox_4_2.IProgress(retVal.value) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Removes the given Host Only Networking interface.

Parameters:
id Adapter GUID.
Returns:
Progress object to track the operation completion. Expected result codes:
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND No host network interface matching id found.
      try {
        String     retVal;
        retVal = .iHostRemoveHostOnlyNetworkInterface(id);
        return (retVal.length() > 0) ? new org.virtualbox_4_2.IProgress(retVal) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Creates a new USB device filter. All attributes except the filter name are set to empty (any match), active is false (the filter is not active). The created filter can be added to the list of filters using insertUSBDeviceFilter(java.lang.Long,org.virtualbox_4_2.IHostUSBDeviceFilter).

Parameters:
name Filter name. See IUSBDeviceFilter.getName() for more information.
Returns:
Created filter object.
See also:
getUSBDeviceFilters()
      try {
        String     retVal;
        retVal = .iHostCreateUSBDeviceFilter(name);
        return (retVal.length() > 0) ? new org.virtualbox_4_2.IHostUSBDeviceFilter(retVal) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Inserts the given USB device to the specified position in the list of filters. Positions are numbered starting from 0. If the specified position is equal to or greater than the number of elements in the list, the filter is added at the end of the collection.

Parameters:
position Position to insert the filter to.
filter USB device filter to insert. Expected result codes:
@link ::VBOX_E_INVALID_OBJECT_STATE VBOX_E_INVALID_OBJECT_STATE USB device filter is not created within this VirtualBox instance.
E_INVALIDARG USB device filter already in list.
NOTE: Duplicates are not allowed, so an attempt to insert a filter already in the list is an error. NOTE: If USB functionality is not available in the given edition of VirtualBox, this method will set the result code to E_NOTIMPL.
See also:
getUSBDeviceFilters()
    public void insertUSBDeviceFilter(Long positionorg.virtualbox_4_2.IHostUSBDeviceFilter filter) {
      try {
        .iHostInsertUSBDeviceFilter(position, ((filter == null) ? null :filter.getWrapped()));
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Removes a USB device filter from the specified position in the list of filters. Positions are numbered starting from 0. Specifying a position equal to or greater than the number of elements in the list will produce an error.

Parameters:
position Position to remove the filter from. Expected result codes:
E_INVALIDARG USB device filter list empty or invalid position.
NOTE: If USB functionality is not available in the given edition of VirtualBox, this method will set the result code to E_NOTIMPL.
See also:
getUSBDeviceFilters()
    public void removeUSBDeviceFilter(Long position) {
      try {
        .iHostRemoveUSBDeviceFilter(position);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Searches for a host DVD drive with the given name.

Parameters:
name Name of the host drive to search for
Returns:
Found host drive object Expected result codes:
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND Given name does not correspond to any host drive.
      try {
        String     retVal;
        retVal = .iHostFindHostDVDDrive(name);
        return (retVal.length() > 0) ? new org.virtualbox_4_2.IMedium(retVal) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Searches for a host floppy drive with the given name.

Parameters:
name Name of the host floppy drive to search for
Returns:
Found host floppy drive object Expected result codes:
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND Given name does not correspond to any host floppy drive.
      try {
        String     retVal;
        retVal = .iHostFindHostFloppyDrive(name);
        return (retVal.length() > 0) ? new org.virtualbox_4_2.IMedium(retVal) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Searches through all host network interfaces for an interface with the given name.

Parameters:
name Name of the host network interface to search for.
Returns:
Found host network interface object. NOTE: The method returns an error if the given name does not correspond to any host network interface.
      try {
        String     retVal;
        retVal = .iHostFindHostNetworkInterfaceByName(name);
        return (retVal.length() > 0) ? new org.virtualbox_4_2.IHostNetworkInterface(retVal) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Searches through all host network interfaces for an interface with the given GUID.

Parameters:
id GUID of the host network interface to search for.
Returns:
Found host network interface object. NOTE: The method returns an error if the given GUID does not correspond to any host network interface.
      try {
        String     retVal;
        retVal = .iHostFindHostNetworkInterfaceById(id);
        return (retVal.length() > 0) ? new org.virtualbox_4_2.IHostNetworkInterface(retVal) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Searches through all host network interfaces and returns a list of interfaces of the specified type

Parameters:
type type of the host network interfaces to search for.
Returns:
Found host network interface objects.
      try {
        List<String>     retVal;
        retVal = .iHostFindHostNetworkInterfacesOfType(, org.virtualbox_4_2.jaxws.HostNetworkInterfaceType.fromValue(type.name()));
        return Helper.wrap(org.virtualbox_4_2.IHostNetworkInterface.classretVal);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Searches for a USB device with the given UUID.

Parameters:
id UUID of the USB device to search for.
Returns:
Found USB device object. Expected result codes:
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND Given id does not correspond to any USB device.
See also:
IUSBDevice.getId()
      try {
        String     retVal;
        retVal = .iHostFindUSBDeviceById(id);
        return (retVal.length() > 0) ? new org.virtualbox_4_2.IHostUSBDevice(retVal) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Searches for a USB device with the given host address.

Parameters:
name Address of the USB device (as assigned by the host) to search for.
Returns:
Found USB device object. Expected result codes:
@link ::VBOX_E_OBJECT_NOT_FOUND VBOX_E_OBJECT_NOT_FOUND Given name does not correspond to any USB device.
See also:
IUSBDevice.getAddress()
      try {
        String     retVal;
        retVal = .iHostFindUSBDeviceByAddress(name);
        return (retVal.length() > 0) ? new org.virtualbox_4_2.IHostUSBDevice(retVal) : null;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Generates a valid Ethernet MAC address, 12 hexadecimal characters.

Returns:
New Ethernet MAC address.
    public String generateMACAddress() {
      try {
        String     retVal;
        retVal = .iHostGenerateMACAddress();
        return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
New to GrepCode? Check out our FAQ X