

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

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

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

    // read-only attribute IProgress::id of type uuid
    public UUID getId() {
        try {
            String retVal = port.iProgressGetId(_this);
            return UUID.fromString(retVal);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IProgress::description of type wstring
    public String getDescription() {
        try {
            String retVal = port.iProgressGetDescription(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // Skipping attribute $unknown for it is of suppressed type $unknown

    // read-only attribute IProgress::cancelable of type boolean
    public Boolean getCancelable() {
        try {
            Boolean retVal = port.iProgressGetCancelable(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IProgress::percent of type long
    public Integer getPercent() {
        try {
            Integer retVal = port.iProgressGetPercent(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IProgress::completed of type boolean
    public Boolean getCompleted() {
        try {
            Boolean retVal = port.iProgressGetCompleted(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IProgress::canceled of type boolean
    public Boolean getCanceled() {
        try {
            Boolean retVal = port.iProgressGetCanceled(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IProgress::resultCode of type result
    public Long getResultCode() {
        try {
            Long retVal = port.iProgressGetResultCode(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // Skipping attribute IVirtualBoxErrorInfo for it is of suppressed type IVirtualBoxErrorInfo

    // read-only attribute IProgress::operationCount of type unsigned long
    public Long getOperationCount() {
        try {
            Long retVal = port.iProgressGetOperationCount(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IProgress::operation of type unsigned long
    public Long getOperation() {
        try {
            Long retVal = port.iProgressGetOperation(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IProgress::operationDescription of type wstring
    public String getOperationDescription() {
        try {
            String retVal = port.iProgressGetOperationDescription(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IProgress::operationPercent of type long
    public Integer getOperationPercent() {
        try {
            Integer retVal = port.iProgressGetOperationPercent(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IProgress::waitForCompletion(
            [in] long timeout)
     */
    public void waitForCompletion(Integer timeout) {
        try {
            port.iProgressWaitForCompletion(_this, timeout);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IProgress::waitForOperationCompletion(
            [in] unsigned long operation,
            [in] long timeout)
     */
    public void waitForOperationCompletion(Long operation, Integer timeout) {
        try {
            port.iProgressWaitForOperationCompletion(_this, operation, timeout);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IProgress::cancel()
     */
    public void cancel() {
        try {
            port.iProgressCancel(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
}
