

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

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

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

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

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

    /* method IVMDKImage::createDynamicImage(
            [in] unsigned long long size,
            [return] IProgress progress)
     */
    public com.sun.xml.ws.commons.virtualbox.IProgress createDynamicImage(BigInteger size) {
        try {
            String retVal = port.ivmdkImageCreateDynamicImage(_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 IVMDKImage::createFixedImage(
            [in] unsigned long long size,
            [return] IProgress progress)
     */
    public com.sun.xml.ws.commons.virtualbox.IProgress createFixedImage(BigInteger size) {
        try {
            String retVal = port.ivmdkImageCreateFixedImage(_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 IVMDKImage::deleteImage()
     */
    public void deleteImage() {
        try {
            port.ivmdkImageDeleteImage(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
}
