2

目前我正在尝试创建一个 vsphere Web 服务。我已经导出了所有必要的后端类以及其他一些解析器。这个想法是我可能需要扩展 DataProviderAdapter 以从 GUI 发送和接收信息。问题来了,我对这项技术不是很有经验。不幸的是,vmware sdk 的文档不是那么清楚,我仍然迷路了。这个想法是如何根据 GUI 发送和接收不同的数据。例如,GUI 想要显示有关主机的信息并将请求发送给我,我需要做什么以及如何做。这是我到目前为止所做的示例:

公共抽象类 DataObject 实现 DataProviderAdapter {

class ResourceType implements ResourceTypeResolver
{

    /**
     * A method parses a given URI and return a String containing the type of 
     * custom object to which the URI pertains. For example, 
     * for a URI that referred to a given custom DataObject object, 
     * the getResourceType() method must return the String “samples:DataObject”.
     */

    @Override
    public String getResourceType(URI uri)
    {
        return null;
    }

    /**
     * The getServerGuid() method parsed a given URI and returns a String containing 
     * the server global unique identifier for the URI target object, if any.
     */
    @Override
    public String getServerGuid(URI uri)
    {
        return null;
    }
        public DataObject(DataService dataService, ResourceTypeResolverRegistry typeResolverRegistry)
{
    if (null == dataService || null == typeResolverRegistry)
    {
        throw new NullPointerException("Some of the arguments is null!");
    }

    this.dataService = dataService;
    try
    {


    }catch(UnsupportedOperationException unsupportedOperation)
    {
        logger.warning("ModelObjectUriResolver registration failed:" +  unsupportedOperation.getMessage());
    }
}

如果你们中的某个人有一些经验并且可以分享这些例子,我将非常感激。干杯!

4

0 回答 0