

/**
 * 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 IDVDDrive extends IUnknown {

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

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

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

    // read/write attribute IDVDDrive::passthrough of type boolean
    public Boolean getPassthrough() {
        try {
            Boolean retVal = port.idvdDriveGetPassthrough(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
    public void setPassthrough(Boolean value) {
        try {
            port.idvdDriveSetPassthrough(_this, value);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

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

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

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

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

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