

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

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

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

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

    // read/write attribute ISnapshot::name of type wstring
    public String getName() {
        try {
            String retVal = port.iSnapshotGetName(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
    public void setName(String value) {
        try {
            port.iSnapshotSetName(_this, value);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read/write attribute ISnapshot::description of type wstring
    public String getDescription() {
        try {
            String retVal = port.iSnapshotGetDescription(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
    public void setDescription(String value) {
        try {
            port.iSnapshotSetDescription(_this, value);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute ISnapshot::timeStamp of type long long
    public Long getTimeStamp() {
        try {
            Long retVal = port.iSnapshotGetTimeStamp(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute ISnapshot::online of type boolean
    public Boolean getOnline() {
        try {
            Boolean retVal = port.iSnapshotGetOnline(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute ISnapshot::machine of type IMachine
    public com.sun.xml.ws.commons.virtualbox.IMachine getMachine() {
        try {
            String retVal = port.iSnapshotGetMachine(_this);
            return new IMachine(retVal, port);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute ISnapshot::parent of type ISnapshot
    public com.sun.xml.ws.commons.virtualbox.ISnapshot getParent() {
        try {
            String retVal = port.iSnapshotGetParent(_this);
            return new ISnapshot(retVal, port);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute ISnapshot::children of type ISnapshotCollection
    public List<com.sun.xml.ws.commons.virtualbox.ISnapshot> getChildren() {
        try {
            org.virtualbox.ArrayOfISnapshot retVal = port.iSnapshotGetChildren(_this);
            return Helper.wrap(ISnapshot.class, port, ((retVal == null)?null:retVal.getArray()));
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
}
