

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

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

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

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

    // read-only attribute IConsole::state of type MachineState
    public org.virtualbox.MachineState getState() {
        try {
            org.virtualbox.MachineState retVal = port.iConsoleGetState(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

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

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

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

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

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

    // read-only attribute IConsole::USBDevices of type IUSBDeviceCollection
    public List<com.sun.xml.ws.commons.virtualbox.IUSBDevice> getUSBDevices() {
        try {
            org.virtualbox.ArrayOfIUSBDevice retVal = port.iConsoleGetUSBDevices(_this);
            return Helper.wrap(IUSBDevice.class, port, ((retVal == null)?null:retVal.getArray()));
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IConsole::remoteUSBDevices of type IHostUSBDeviceCollection
    public List<com.sun.xml.ws.commons.virtualbox.IHostUSBDevice> getRemoteUSBDevices() {
        try {
            org.virtualbox.ArrayOfIHostUSBDevice retVal = port.iConsoleGetRemoteUSBDevices(_this);
            return Helper.wrap(IHostUSBDevice.class, port, ((retVal == null)?null:retVal.getArray()));
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IConsole::sharedFolders of type ISharedFolderCollection
    public List<org.virtualbox.ISharedFolder> getSharedFolders() {
        try {
            return port.iConsoleGetSharedFolders(_this).getArray();
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    // read-only attribute IConsole::remoteDisplayInfo of type IRemoteDisplayInfo
    public org.virtualbox.IRemoteDisplayInfo getRemoteDisplayInfo() {
        try {
            return port.iConsoleGetRemoteDisplayInfo(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::powerUp(
            [return] IProgress progress)
     */
    public com.sun.xml.ws.commons.virtualbox.IProgress powerUp() {
        try {
            String retVal = port.iConsolePowerUp(_this);
            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 IConsole::powerDown()
     */
    public void powerDown() {
        try {
            port.iConsolePowerDown(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::powerDownAsync(
            [return] IProgress progress)
     */
    public com.sun.xml.ws.commons.virtualbox.IProgress powerDownAsync() {
        try {
            String retVal = port.iConsolePowerDownAsync(_this);
            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 IConsole::reset()
     */
    public void reset() {
        try {
            port.iConsoleReset(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::pause()
     */
    public void pause() {
        try {
            port.iConsolePause(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::resume()
     */
    public void resume() {
        try {
            port.iConsoleResume(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::powerButton()
     */
    public void powerButton() {
        try {
            port.iConsolePowerButton(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::sleepButton()
     */
    public void sleepButton() {
        try {
            port.iConsoleSleepButton(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::getPowerButtonHandled(
            [return] boolean handled)
     */
    public Boolean getPowerButtonHandled() {
        try {
            Boolean retVal = port.iConsoleGetPowerButtonHandled(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::saveState(
            [return] IProgress progress)
     */
    public com.sun.xml.ws.commons.virtualbox.IProgress saveState() {
        try {
            String retVal = port.iConsoleSaveState(_this);
            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 IConsole::adoptSavedState(
            [in] wstring savedStateFile)
     */
    public void adoptSavedState(String savedStateFile) {
        try {
            port.iConsoleAdoptSavedState(_this, savedStateFile);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::discardSavedState()
     */
    public void discardSavedState() {
        try {
            port.iConsoleDiscardSavedState(_this);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::getDeviceActivity(
            [in] DeviceType type,
            [return] DeviceActivity activity)
     */
    public org.virtualbox.DeviceActivity getDeviceActivity(org.virtualbox.DeviceType type) {
        try {
            org.virtualbox.DeviceActivity retVal = port.iConsoleGetDeviceActivity(_this, type);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::attachUSBDevice(
            [in] uuid id)
     */
    public void attachUSBDevice(UUID id) {
        try {
            port.iConsoleAttachUSBDevice(_this, id.toString());
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::detachUSBDevice(
            [in] uuid id,
            [return] IUSBDevice device)
     */
    public com.sun.xml.ws.commons.virtualbox.IUSBDevice detachUSBDevice(UUID id) {
        try {
            String retVal = port.iConsoleDetachUSBDevice(_this, id.toString());
            return new com.sun.xml.ws.commons.virtualbox.IUSBDevice(retVal, port);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::createSharedFolder(
            [in] wstring name,
            [in] wstring hostPath,
            [in] boolean writable)
     */
    public void createSharedFolder(String name, String hostPath, Boolean writable) {
        try {
            port.iConsoleCreateSharedFolder(_this, name, hostPath, writable);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::removeSharedFolder(
            [in] wstring name)
     */
    public void removeSharedFolder(String name) {
        try {
            port.iConsoleRemoveSharedFolder(_this, name);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IConsole::takeSnapshot(
            [in] wstring name,
            [in] wstring description,
            [return] IProgress progress)
     */
    public com.sun.xml.ws.commons.virtualbox.IProgress takeSnapshot(String name, String description) {
        try {
            String retVal = port.iConsoleTakeSnapshot(_this, name, description);
            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 IConsole::discardSnapshot(
            [in] uuid id,
            [return] IProgress progress)
     */
    public com.sun.xml.ws.commons.virtualbox.IProgress discardSnapshot(UUID id) {
        try {
            String retVal = port.iConsoleDiscardSnapshot(_this, id.toString());
            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 IConsole::discardCurrentState(
            [return] IProgress progress)
     */
    public com.sun.xml.ws.commons.virtualbox.IProgress discardCurrentState() {
        try {
            String retVal = port.iConsoleDiscardCurrentState(_this);
            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 IConsole::discardCurrentSnapshotAndState(
            [return] IProgress progress)
     */
    public com.sun.xml.ws.commons.virtualbox.IProgress discardCurrentSnapshotAndState() {
        try {
            String retVal = port.iConsoleDiscardCurrentSnapshotAndState(_this);
            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);
        }
    }
}
