

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

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

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

    // read-only attribute IPerformanceCollector::metricNames of type wstring
    public List<String> getMetricNames() {
        try {
            List<String> retVal = port.iPerformanceCollectorGetMetricNames(_this);
            return retVal;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IPerformanceCollector::getMetrics(
            [in] wstring metricNames[],
            [in] $unknown objects[],
            [return] IPerformanceMetric metrics[])
     */
    public List<com.sun.xml.ws.commons.virtualbox.IPerformanceMetric> getMetrics(List<String> metricNames, List<IUnknown> objects) {
        try {
            List<String> retVal = port.iPerformanceCollectorGetMetrics(_this, metricNames, Helper.unwrap(objects));
            return Helper.wrap(com.sun.xml.ws.commons.virtualbox.IPerformanceMetric.class, port, retVal);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IPerformanceCollector::setupMetrics(
            [in] wstring metricNames[],
            [in] $unknown objects[],
            [in] unsigned long period,
            [in] unsigned long count)
     */
    public void setupMetrics(List<String> metricNames, List<IUnknown> objects, Long period, Long count) {
        try {
            port.iPerformanceCollectorSetupMetrics(_this, metricNames, Helper.unwrap(objects), period, count);
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IPerformanceCollector::enableMetrics(
            [in] wstring metricNames[],
            [in] $unknown objects[])
     */
    public void enableMetrics(List<String> metricNames, List<IUnknown> objects) {
        try {
            port.iPerformanceCollectorEnableMetrics(_this, metricNames, Helper.unwrap(objects));
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IPerformanceCollector::disableMetrics(
            [in] wstring metricNames[],
            [in] $unknown objects[])
     */
    public void disableMetrics(List<String> metricNames, List<IUnknown> objects) {
        try {
            port.iPerformanceCollectorDisableMetrics(_this, metricNames, Helper.unwrap(objects));
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }

    /* method IPerformanceCollector::queryMetricsData(
            [in] wstring metricNames[],
            [in] $unknown objects[],
            [out] wstring returnMetricNames[],
            [out] $unknown returnObjects[],
            [out] unsigned long returnDataIndices[],
            [out] unsigned long returnDataLengths[],
            [return] long returnData[])
     */
    public List<Integer> queryMetricsData(List<String> metricNames, List<IUnknown> objects, Holder<List<String>> returnMetricNames, Holder<List<IUnknown>> returnObjects, Holder<List<Long>> returnDataIndices, Holder<List<Long>> returnDataLengths) {
        try {
            Holder<List<String>> tmpreturnObjects = new Holder<List<String>>(); 
            Holder<List<Integer>> retVal = new Holder<List<Integer>>();
            port.iPerformanceCollectorQueryMetricsData(_this, metricNames, Helper.unwrap(objects), returnMetricNames, tmpreturnObjects, returnDataIndices, returnDataLengths, retVal);
            returnObjects.value = Helper.wrap(IUnknown.class, port, tmpreturnObjects.value);
            return retVal.value;
        } catch (InvalidObjectFaultMsg e) {
            throw new WebServiceException(e);
        } catch (RuntimeFaultMsg e) {
            throw new WebServiceException(e);
        }
    }
}
