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.
  *
  * IUSBDeviceFilter.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 IUSBDeviceFilter interface represents an USB device filter used to perform actions on a group of USB devices. This type of filters is used by running virtual machines to automatically capture selected USB devices once they are physically attached to the host computer. A USB device is matched to the given device filter if and only if all attributes of the device match the corresponding attributes of the filter (that is, attributes are joined together using the logical AND operation). On the other hand, all together, filters in the list of filters carry the semantics of the logical OR operation. So if it is desirable to create a match like "this vendor id OR this product id", one needs to create two filters and specify "any match" (see below) for unused attributes. All filter attributes used for matching are strings. Each string is an expression representing a set of values of the corresponding device attribute, that will match the given filter. Currently, the following filtering expressions are supported:
  • Interval filters. Used to specify valid intervals for integer device attributes (Vendor ID, Product ID and Revision). The format of the string is: int:((m)|([m]-[n]))(,(m)|([m]-[n]))* where m and n are integer numbers, either in octal (starting from 0), hexadecimal (starting from 0x) or decimal (otherwise) form, so that m < n. If m is omitted before a dash (-), the minimum possible integer is assumed; if n is omitted after a dash, the maximum possible integer is assumed.
  • Boolean filters. Used to specify acceptable values for boolean device attributes. The format of the string is: true|false|yes|no|0|1
  • Exact match. Used to specify a single value for the given device attribute. Any string that doesn't start with int: represents the exact match. String device attributes are compared to this string including case of symbols. Integer attributes are first converted to a string (see individual filter attributes) and then compared ignoring case.
  • Any match. Any value of the corresponding device attribute will match the given filter. An empty or null string is used to construct this type of filtering expressions.
NOTE: On the Windows host platform, interval filters are not currently available. Also all string filter attributes (getManufacturer(), getProduct(), getSerialNumber()) are ignored, so they behave as any match no matter what string expression is specified.

See also:
IUSBController.getDeviceFilters()
IHostUSBDeviceFilter Interface ID: {D6831FB4-1A94-4C2C-96EF-8D0D6192066D}
 
 public class IUSBDeviceFilter extends IUnknown {
 
     public IUSBDeviceFilter(String wrappedVboxPortType port) {
           super(wrappedport);
     }
Visible name for this filter. This name is used to visually distinguish one filter from another, so it can neither be null nor an empty string.

Returns:
String
    public String getName() {
      try {
         String retVal = .iusbDeviceFilterGetName();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Visible name for this filter. This name is used to visually distinguish one filter from another, so it can neither be null nor an empty string.

Parameters:
value String
    public void setName(String value) {
      try {
        .iusbDeviceFilterSetName(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Whether this filter active or has been temporarily disabled.

Returns:
Boolean
    public Boolean getActive() {
      try {
         Boolean retVal = .iusbDeviceFilterGetActive();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
Whether this filter active or has been temporarily disabled.

Parameters:
value Boolean
    public void setActive(Boolean value) {
      try {
        .iusbDeviceFilterSetActive(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getVendorId() filter. The string representation for the exact matching has the form XXXX, where X is the hex digit (including leading zeroes).

Returns:
String
    public String getVendorId() {
      try {
         String retVal = .iusbDeviceFilterGetVendorId();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getVendorId() filter. The string representation for the exact matching has the form XXXX, where X is the hex digit (including leading zeroes).

Parameters:
value String
    public void setVendorId(String value) {
      try {
        .iusbDeviceFilterSetVendorId(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getProductId() filter. The string representation for the exact matching has the form XXXX, where X is the hex digit (including leading zeroes).

Returns:
String
    public String getProductId() {
      try {
         String retVal = .iusbDeviceFilterGetProductId();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getProductId() filter. The string representation for the exact matching has the form XXXX, where X is the hex digit (including leading zeroes).

Parameters:
value String
    public void setProductId(String value) {
      try {
        .iusbDeviceFilterSetProductId(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getProductId() filter. The string representation for the exact matching has the form IIFF, where I is the decimal digit of the integer part of the revision, and F is the decimal digit of its fractional part (including leading and trailing zeros). Note that for interval filters, it's best to use the hexadecimal form, because the revision is stored as a 16 bit packed BCD value; so the expression int:0x0100-0x0199 will match any revision from 1.0 to 1.99.

Returns:
String
    public String getRevision() {
      try {
         String retVal = .iusbDeviceFilterGetRevision();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getProductId() filter. The string representation for the exact matching has the form IIFF, where I is the decimal digit of the integer part of the revision, and F is the decimal digit of its fractional part (including leading and trailing zeros). Note that for interval filters, it's best to use the hexadecimal form, because the revision is stored as a 16 bit packed BCD value; so the expression int:0x0100-0x0199 will match any revision from 1.0 to 1.99.

Parameters:
value String
    public void setRevision(String value) {
      try {
        .iusbDeviceFilterSetRevision(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getManufacturer() filter.

Returns:
String
    public String getManufacturer() {
      try {
         String retVal = .iusbDeviceFilterGetManufacturer();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getManufacturer() filter.

Parameters:
value String
    public void setManufacturer(String value) {
      try {
        .iusbDeviceFilterSetManufacturer(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getProduct() filter.

Returns:
String
    public String getProduct() {
      try {
         String retVal = .iusbDeviceFilterGetProduct();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getProduct() filter.

Parameters:
value String
    public void setProduct(String value) {
      try {
        .iusbDeviceFilterSetProduct(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getSerialNumber() filter.

Returns:
String
    public String getSerialNumber() {
      try {
         String retVal = .iusbDeviceFilterGetSerialNumber();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getSerialNumber() filter.

Parameters:
value String
    public void setSerialNumber(String value) {
      try {
        .iusbDeviceFilterSetSerialNumber(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getPort() filter.

Returns:
String
    public String getPort() {
      try {
         String retVal = .iusbDeviceFilterGetPort();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getPort() filter.

Parameters:
value String
    public void setPort(String value) {
      try {
        .iusbDeviceFilterSetPort(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getRemote() filter. NOTE: This filter makes sense only for machine USB filters, i.e. it is ignored by IHostUSBDeviceFilter objects.

Returns:
String
    public String getRemote() {
      try {
         String retVal = .iusbDeviceFilterGetRemote();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
IUSBDevice.getRemote() filter. NOTE: This filter makes sense only for machine USB filters, i.e. it is ignored by IHostUSBDeviceFilter objects.

Parameters:
value String
    public void setRemote(String value) {
      try {
        .iusbDeviceFilterSetRemote(value);
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
This is an advanced option for hiding one or more USB interfaces from the guest. The value is a bit mask where the bits that are set means the corresponding USB interface should be hidden, masked off if you like. This feature only works on Linux hosts.

Returns:
Long
    public Long getMaskedInterfaces() {
      try {
         Long retVal = .iusbDeviceFilterGetMaskedInterfaces();
         return retVal;
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
This is an advanced option for hiding one or more USB interfaces from the guest. The value is a bit mask where the bits that are set means the corresponding USB interface should be hidden, masked off if you like. This feature only works on Linux hosts.

Parameters:
value Long
    public void setMaskedInterfaces(Long value) {
      try {
     } catch (InvalidObjectFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     } catch (RuntimeFaultMsg e) {
          throw new VBoxException(ee.getMessage());
     }
    }
    public static IUSBDeviceFilter queryInterface(IUnknown obj) {
       return obj == null ?  null : new IUSBDeviceFilter(obj.getWrapped(), obj.getRemoteWSPort());
    }
New to GrepCode? Check out our FAQ X