

/**
 * 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 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.DriveState getState() {
        try {
            org.virtualbox.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.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.IFloppyImage getImage() {
        try {
            String retVal = port.iFloppyDriveGetImage(_this);
            return new com.sun.xml.ws.commons.virtualbox.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.IHostFloppyDrive getHostDrive() {
        try {
            String retVal = port.iFloppyDriveGetHostDrive(_this);
            return new com.sun.xml.ws.commons.virtualbox.IHostFloppyDrive(retVal, port);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
}
