public static Date getExpirationDate(KeyAnyValue[] kavs) { if(kavs!=null) { for(KeyAnyValue kav : kavs) { if("expirationDate".equalsIgnoreCase(kav.getKey())) { Object val = kav.getValue(); if(val instanceof Calendar) { Calendar expDate = (Calendar) val; return expDate.getTime(); } } } } return null; }
public boolean isFeatureSupported(String featureKey, ManagedObjectReference hostMor) throws Exception { boolean featureSupported = false; // Retrieve host license properties List<KeyAnyValue> props = getHostLicenseProperties(hostMor); // Check host license properties to see if specified feature is supported by the license. for (KeyAnyValue prop : props) { String key = prop.getKey(); if (key.equalsIgnoreCase(LICENSE_INFO_FEATURE)) { KeyValue propValue = (KeyValue)prop.getValue(); if (propValue.getKey().equalsIgnoreCase(featureKey)) { featureSupported = true; break; } } } return featureSupported; }
public List<KeyAnyValue> getHostLicenseProperties(ManagedObjectReference hostMor) throws Exception { return getHostLicenseInfo(hostMor).getProperties(); }
/** * Gets the value of the messageArg property. * * <p> * This accessor method returns a reference to the live list, * not a snapshot. Therefore any modification you make to the * returned list will be present inside the JAXB object. * This is why there is not a <CODE>set</CODE> method for the messageArg property. * * <p> * For example, to add a new item, do as follows: * <pre> * getMessageArg().add(newItem); * </pre> * * * <p> * Objects of the following type(s) are allowed in the list * {@link KeyAnyValue } * * */ public List<KeyAnyValue> getMessageArg() { if (messageArg == null) { messageArg = new ArrayList<KeyAnyValue>(); } return this.messageArg; }