Java 类com.vmware.vim25.LicenseManagerEvaluationInfo 实例源码

项目:vijava    文件:PrintLicExpirationDateV4.java   
public static void main(String[] args) throws Exception
{
  ServiceInstance si = new ServiceInstance(new URL("https://8.8.8.8/sdk"), 
      "administrator", "vmware", true);
  LicenseManager lm = si.getLicenseManager();
  LicenseManagerLicenseInfo[] lics = lm.getLicenses();

  DateFormat df = DateFormat.getInstance();
  for(LicenseManagerLicenseInfo lic : lics)
  {
    Date expDate = null;

    if("eval".equalsIgnoreCase(lic.getEditionKey()))
    {
      LicenseManagerEvaluationInfo evalInfo = lm.getEvaluation();
      expDate = getExpirationDate(evalInfo.getProperties());
    }
    else
    {
      expDate = getExpirationDate(lic.getProperties());
    }

    if(expDate!=null)
    {
      System.out.println(lic.getLicenseKey() + " expires on " + df.format(expDate));
    }
    else
    {
      System.out.println(lic.getLicenseKey() + " expires on NEVER");
    }
  }
}
项目:jcloud-vsphere    文件:LicenseManagerApi.java   
LicenseManagerEvaluationInfo getEvaluation();