當前位置: 首頁>>代碼示例>>Java>>正文


Java Description類代碼示例

本文整理匯總了Java中com.vmware.vim25.Description的典型用法代碼示例。如果您正苦於以下問題:Java Description類的具體用法?Java Description怎麽用?Java Description使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Description類屬於com.vmware.vim25包,在下文中一共展示了Description類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createNicSpec

import com.vmware.vim25.Description; //導入依賴的package包/類
static VirtualDeviceConfigSpec createNicSpec(String netName, 
    String nicName) throws Exception
{
  VirtualDeviceConfigSpec nicSpec = 
      new VirtualDeviceConfigSpec();
  nicSpec.setOperation(VirtualDeviceConfigSpecOperation.add);

  VirtualEthernetCard nic =  new VirtualPCNet32();
  VirtualEthernetCardNetworkBackingInfo nicBacking = 
      new VirtualEthernetCardNetworkBackingInfo();
  nicBacking.setDeviceName(netName);

  Description info = new Description();
  info.setLabel(nicName);
  info.setSummary(netName);
  nic.setDeviceInfo(info);
  
  // type: "generated", "manual", "assigned" by VC
  nic.setAddressType("generated");
  nic.setBacking(nicBacking);
  nic.setKey(0);
 
  nicSpec.setDevice(nic);
  return nicSpec;
}
 
開發者ID:Juniper,項目名稱:vijava,代碼行數:26,代碼來源:CreateVM.java

示例2: createExtensionObject

import com.vmware.vim25.Description; //導入依賴的package包/類
static Extension createExtensionObject(Properties props)
{
  String companyStr = props.getProperty("companyStr");
  String descStr = props.getProperty("descStr"); 
  String keyStr = props.getProperty("keyStr");
  String extUrl = props.getProperty("extUrl");
  String adminEmail = props.getProperty("adminEmail");
  String version = props.getProperty("version");

  Description description = new Description();
  description.setLabel(keyStr);
  description.setSummary(descStr);

  ExtensionServerInfo esi = new ExtensionServerInfo();
  esi.setDescription(description);
  esi.setUrl(extUrl);
  esi.setCompany(companyStr);
  // the following type must NOT be changed
  esi.setType("com.vmware.vim.viClientScripts");
  esi.setAdminEmail( new String[] { adminEmail } );

  ExtensionClientInfo eci = new ExtensionClientInfo();
  eci.setCompany(companyStr);
  eci.setUrl(extUrl);
  eci.setType("com.vmware.vim.viClientScripts");
  eci.setVersion(version);
  eci.setDescription(description);

  Extension ext = new Extension();
  ext.setServer(new ExtensionServerInfo[]{esi});
  ext.setClient(new ExtensionClientInfo[] {eci});
  ext.setDescription(description);
  ext.setKey(keyStr);
  ext.setVersion(version);
  ext.setLastHeartbeatTime(Calendar.getInstance());

  return ext;
}
 
開發者ID:Juniper,項目名稱:vijava,代碼行數:39,代碼來源:ExtMgrUtil.java


注:本文中的com.vmware.vim25.Description類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。