

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

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

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

    // read/write attribute ICustomHardDisk::location of type wstring
    public String getLocation() {
        try {
            String retVal = port.iCustomHardDiskGetLocation(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
    public void setLocation(String value) {
        try {
            port.iCustomHardDiskSetLocation(_this, value);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute ICustomHardDisk::format of type wstring
    public String getFormat() {
        try {
            String retVal = port.iCustomHardDiskGetFormat(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

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

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