All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sun.xml.ws.commons.virtualbox.IDVDDrive Maven / Gradle / Ivy


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

import java.util.UUID;
import javax.xml.ws.WebServiceException;


/**
 * The IDVDDrive interface represents the virtual CD/DVD drive of the
 *       virtual machine. An object of this type is returned by {@link IMachine#DVDDrive}.
 * 
 */
public class IDVDDrive {

    public final VboxPortType port;
    public final String _this;

    public IDVDDrive(String _this, VboxPortType port) {
        
        this._this = _this;
        this.port = port;
    
    }

    /**
     * Current drive state.
     * 
     */
    public DriveState getState() {
        try {
            DriveState retVal = port.idvdDriveGetState(_this);
            return retVal;
        } catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /**
     * When a host drive is mounted and passthrough is enabled
     *         the guest OS will be able to directly send SCSI commands to
     *         the host drive. This enables the guest OS to use CD/DVD writers
     *         but is potentially dangerous.
     * 
     */
    public boolean getPassthrough() {
        try {
            boolean retVal = port.idvdDriveGetPassthrough(_this);
            return retVal;
        } catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /**
     * When a host drive is mounted and passthrough is enabled
     *         the guest OS will be able to directly send SCSI commands to
     *         the host drive. This enables the guest OS to use CD/DVD writers
     *         but is potentially dangerous.
     * 
     */
    public void setPassthrough(boolean value) {
        try {
            port.idvdDriveSetPassthrough(_this, value);
        } catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /**
     * Mounts a CD/DVD image with the specified UUID.
     * 
     * @param imageId
     *     
     */
    public void mountImage(UUID imageId) {
        try {
            port.idvdDriveMountImage(_this, imageId.toString());
        } catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /**
     * Captures the specified host CD/DVD drive.
     * 
     * @param drive
     *     
     */
    public void captureHostDrive(IHostDVDDrive drive) {
        try {
            port.idvdDriveCaptureHostDrive(_this, ((drive == null)?null:drive._this));
        } catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /**
     * Unmounts the currently mounted image or host drive.
     * 
     */
    public void unmount() {
        try {
            port.idvdDriveUnmount(_this);
        } catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /**
     * Returns the currently mounted CD/DVD image.
     * 
     * @return
     *     
     */
    public IDVDImage2 getImage() {
        try {
            String retVal = port.idvdDriveGetImage(_this);
            return new IDVDImage2(retVal, port);
        } catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /**
     * Returns the currently mounted host CD/DVD drive.
     * 
     * @return
     *     
     */
    public IHostDVDDrive getHostDrive() {
        try {
            String retVal = port.idvdDriveGetHostDrive(_this);
            return new IHostDVDDrive(retVal, port);
        } catch (com.sun.xml.ws.commons.virtualbox.InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (com.sun.xml.ws.commons.virtualbox.RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy