本文整理汇总了Java中com.vmware.vim25.WaitOptions类的典型用法代码示例。如果您正苦于以下问题:Java WaitOptions类的具体用法?Java WaitOptions怎么用?Java WaitOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WaitOptions类属于com.vmware.vim25包,在下文中一共展示了WaitOptions类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: ObjectUpdateIterator
import com.vmware.vim25.WaitOptions; //导入依赖的package包/类
ObjectUpdateIterator(ManagedObjectReference pc) {
this.pc = pc;
// don't fetch too much data or block for too long
this.opts = new WaitOptions();
this.opts.setMaxWaitSeconds(10);
this.opts.setMaxObjectUpdates(DEFAULT_FETCH_PAGE_SIZE);
}
开发者ID:vmware,项目名称:photon-model,代码行数:9,代码来源:EnumerationClient.java
示例2: waitForUpdatesEx
import com.vmware.vim25.WaitOptions; //导入依赖的package包/类
/** @since SDK4.1 */
public UpdateSet waitForUpdatesEx(String version, WaitOptions options) throws InvalidCollectorVersion, RuntimeFault, RemoteException
{
return getVimService().waitForUpdatesEx(getMOR(), version, options);
}
开发者ID:Juniper,项目名称:vijava,代码行数:6,代码来源:PropertyCollector.java
示例3: wait
import com.vmware.vim25.WaitOptions; //导入依赖的package包/类
/**
* Handle Updates for a single object. waits till expected values of
* properties to check are reached Destroys the ObjectFilter when done.
*
* @param objMor MOR of the Object to wait for param
* @param filterProps Properties list to filter
* @param endWaitProps Properties list to check for expected values these be properties
* of a property in the filter properties list
* @param expectedValues values for properties to end the wait
* @return true indicating expected values were met, and false otherwise
* @throws RuntimeFaultFaultMsg
* @throws InvalidPropertyFaultMsg
* @throws InvalidCollectorVersionFaultMsg
*/
public Object[] wait(ManagedObjectReference objMor, String[] filterProps, String[] endWaitProps, Object[][] expectedValues)
throws InvalidPropertyFaultMsg, RuntimeFaultFaultMsg, InvalidCollectorVersionFaultMsg {
String version = Constants.EMPTY;
String stateVal = null;
Object[] endValues = new Object[endWaitProps.length];
Object[] filterValues = new Object[filterProps.length];
PropertyFilterSpec spec = propertyFilterSpec(objMor, filterProps);
ManagedObjectReference filterSpecRef = vimPort.createFilter(serviceContent.getPropertyCollector(), spec, true);
boolean reached = false;
UpdateSet updateset;
while (!reached) {
updateset = vimPort.waitForUpdatesEx(serviceContent.getPropertyCollector(), version, new WaitOptions());
int waitForUpdateCounter = 0;
if (updateset == null || updateset.getFilterSet() == null) {
waitForUpdateCounter++;
if (waitForUpdateCounter <= MAX_TRIED_WAIT_FOR_UPDATE_COUNTER) {
continue;
}
break;
}
version = updateset.getVersion();
for (PropertyFilterUpdate filtup : updateset.getFilterSet()) {
for (ObjectUpdate objup : filtup.getObjectSet()) {
if (objup.getKind() == ObjectUpdateKind.MODIFY || objup.getKind() == ObjectUpdateKind.ENTER ||
objup.getKind() == ObjectUpdateKind.LEAVE) {
for (PropertyChange propchg : objup.getChangeSet()) {
updateValues(endWaitProps, endValues, propchg);
updateValues(filterProps, filterValues, propchg);
}
}
}
}
// Check if the expected values have been reached and exit the loop if done.
// Also exit the WaitForUpdates loop if this is the case.
for (int chgi = 0; chgi < endValues.length && !reached; chgi++) {
for (int vali = 0; vali < expectedValues[chgi].length && !reached; vali++) {
Object expctdval = expectedValues[chgi][vali];
if (endValues[chgi].toString().contains(KEY_VALUE_NULL_STRING)) {
Element stateElement = (Element) endValues[chgi];
if (stateElement != null && stateElement.getFirstChild() != null) {
stateVal = stateElement.getFirstChild().getTextContent();
reached = expctdval.toString().equalsIgnoreCase(stateVal);
}
} else {
expctdval = expectedValues[chgi][vali];
reached = expctdval.equals(endValues[chgi]);
stateVal = FILTER_VALUES;
}
}
}
}
try {
vimPort.destroyPropertyFilter(filterSpecRef);
} catch (RuntimeFaultFaultMsg e) {
throw new RuntimeException(e.getMessage());
}
return getObjectState(stateVal, filterValues);
}
开发者ID:CloudSlang,项目名称:cs-actions,代码行数:80,代码来源:WaitForValues.java
注:本文中的com.vmware.vim25.WaitOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论