

/**
 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
 * 
 * Sun Microsystems, Inc. confidential
 * All rights reserved
 *
 * This file is autogenerated by glue-jaxws.xsl, DO NOT EDIT! 
 */

package com.sun.xml.ws.commons.virtualbox;

import java.math.BigInteger;
import java.util.List;
import java.util.UUID;
import javax.xml.ws.Holder;
import javax.xml.ws.WebServiceException;
import com.sun.xml.ws.commons.virtualbox.IUnknown;

import org.virtualbox.service.InvalidObjectFaultMsg;
import org.virtualbox.service.RuntimeFaultMsg;
import org.virtualbox.service.VboxService;
import org.virtualbox.service.VboxPortType;

public class IUSBController extends IUnknown {

    public static IUSBController cast(IUnknown other) {
        return new IUSBController(other.getRef(), other.getRemoteWSPort());
    }

    public IUSBController(String _this, VboxPortType port) {
        super(_this,port);
    }

    // read/write attribute IUSBController::enabled of type boolean
    public Boolean getEnabled() {
        try {
            Boolean retVal = port.iusbControllerGetEnabled(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
    public void setEnabled(Boolean value) {
        try {
            port.iusbControllerSetEnabled(_this, value);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read/write attribute IUSBController::enabledEhci of type boolean
    public Boolean getEnabledEhci() {
        try {
            Boolean retVal = port.iusbControllerGetEnabledEhci(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
    public void setEnabledEhci(Boolean value) {
        try {
            port.iusbControllerSetEnabledEhci(_this, value);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IUSBController::USBStandard of type unsigned short
    public Integer getUSBStandard() {
        try {
            int retVal = port.iusbControllerGetUSBStandard(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IUSBController::deviceFilters of type IUSBDeviceFilterCollection
    public List<com.sun.xml.ws.commons.virtualbox.IUSBDeviceFilter> getDeviceFilters() {
        try {
            org.virtualbox.ArrayOfIUSBDeviceFilter retVal = port.iusbControllerGetDeviceFilters(_this);
            return Helper.wrap(IUSBDeviceFilter.class, port, ((retVal == null)?null:retVal.getArray()));
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IUSBController::createDeviceFilter(
            [in] wstring name,
            [return] IUSBDeviceFilter filter)
     */
    public com.sun.xml.ws.commons.virtualbox.IUSBDeviceFilter createDeviceFilter(String name) {
        try {
            String retVal = port.iusbControllerCreateDeviceFilter(_this, name);
            return new com.sun.xml.ws.commons.virtualbox.IUSBDeviceFilter(retVal, port);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IUSBController::insertDeviceFilter(
            [in] unsigned long position,
            [in] IUSBDeviceFilter filter)
     */
    public void insertDeviceFilter(Long position, com.sun.xml.ws.commons.virtualbox.IUSBDeviceFilter filter) {
        try {
            port.iusbControllerInsertDeviceFilter(_this, position, ((filter == null)?null:filter.getRef()));
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IUSBController::removeDeviceFilter(
            [in] unsigned long position,
            [return] IUSBDeviceFilter filter)
     */
    public com.sun.xml.ws.commons.virtualbox.IUSBDeviceFilter removeDeviceFilter(Long position) {
        try {
            String retVal = port.iusbControllerRemoveDeviceFilter(_this, position);
            return new com.sun.xml.ws.commons.virtualbox.IUSBDeviceFilter(retVal, port);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
}
