
/**
 * Copyright (C) 2008-2009 Sun Microsystems, Inc.
 *
 * This file is part of a free software library; you can redistribute
 * it and/or modify it under the terms of the GNU Lesser General
 * Public License version 2.1 as published by the Free Software
 * Foundation and shipped in the "COPYING.LIB" file with this library.
 * The library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY of any kind.
 *
 * Sun LGPL Disclaimer: For the avoidance of doubt, except that if
 * any license choice other than GPL or LGPL is available it will
 * apply instead, Sun elects to use only the Lesser General Public
 * License version 2.1 (LGPLv2) at this time for any software where
 * a choice of LGPL license versions is made available with the
 * language indicating that LGPLv2 or any later version may be used,
 * or where a choice of which version of the LGPL is applied is
 * otherwise unspecified.
 *
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
 * Clara, CA 95054 USA or visit http://www.sun.com if you need
 * additional information or have any questions.
 *
 * IFloppyDrive.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/webservice/glue-jaxws.xsl
 */


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

import org.virtualbox_2_2.VboxPortType;
import org.virtualbox_2_2.VboxService;
import org.virtualbox_2_2.InvalidObjectFaultMsg;
import org.virtualbox_2_2.RuntimeFaultMsg;
import javax.xml.ws.WebServiceException;
import java.math.BigInteger;
import java.util.List;
import java.util.UUID;
import javax.xml.ws.Holder;
import javax.xml.ws.WebServiceException;
public class IFloppyDrive extends IUnknown {

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

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

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

    // read-only attribute IFloppyDrive::state of type DriveState
    public org.virtualbox_2_2.DriveState getState() {
        try {
            org.virtualbox_2_2.DriveState retVal = port.iFloppyDriveGetState(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IFloppyDrive::mountImage(
            [in] uuid imageId)
     */
    public void mountImage(UUID imageId) {
        try {
            port.iFloppyDriveMountImage(_this, imageId.toString());
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IFloppyDrive::captureHostDrive(
            [in] IHostFloppyDrive drive)
     */
    public void captureHostDrive(com.sun.xml.ws.commons.virtualbox_2_2.IHostFloppyDrive drive) {
        try {
            port.iFloppyDriveCaptureHostDrive(_this, ((drive == null)?null:drive.getRef()));
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IFloppyDrive::unmount()
     */
    public void unmount() {
        try {
            port.iFloppyDriveUnmount(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IFloppyDrive::getImage(
            [return] IFloppyImage image)
     */
    public com.sun.xml.ws.commons.virtualbox_2_2.IFloppyImage getImage() {
        try {
            String retVal = port.iFloppyDriveGetImage(_this);
            return new com.sun.xml.ws.commons.virtualbox_2_2.IFloppyImage(retVal, port);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IFloppyDrive::getHostDrive(
            [return] IHostFloppyDrive drive)
     */
    public com.sun.xml.ws.commons.virtualbox_2_2.IHostFloppyDrive getHostDrive() {
        try {
            String retVal = port.iFloppyDriveGetHostDrive(_this);
            return new com.sun.xml.ws.commons.virtualbox_2_2.IHostFloppyDrive(retVal, port);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
}
