

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

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

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

    // read/write attribute IVirtualDiskImage::filePath of type wstring
    public String getFilePath() {
        try {
            String retVal = port.iVirtualDiskImageGetFilePath(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
    public void setFilePath(String value) {
        try {
            port.iVirtualDiskImageSetFilePath(_this, value);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IVirtualDiskImage::created of type boolean
    public Boolean getCreated() {
        try {
            Boolean retVal = port.iVirtualDiskImageGetCreated(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IVirtualDiskImage::createDynamicImage(
            [in] unsigned long long size,
            [return] IProgress progress)
     */
    public com.sun.xml.ws.commons.virtualbox.IProgress createDynamicImage(BigInteger size) {
        try {
            String retVal = port.iVirtualDiskImageCreateDynamicImage(_this, size);
            return new com.sun.xml.ws.commons.virtualbox.IProgress(retVal, port);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IVirtualDiskImage::createFixedImage(
            [in] unsigned long long size,
            [return] IProgress progress)
     */
    public com.sun.xml.ws.commons.virtualbox.IProgress createFixedImage(BigInteger size) {
        try {
            String retVal = port.iVirtualDiskImageCreateFixedImage(_this, size);
            return new com.sun.xml.ws.commons.virtualbox.IProgress(retVal, port);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IVirtualDiskImage::deleteImage()
     */
    public void deleteImage() {
        try {
            port.iVirtualDiskImageDeleteImage(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
}
