use of org.ovirt.engine.core.common.queries.DiscoverSendTargetsQueryParameters in project ovirt-engine by oVirt.
the class SanStorageModelBase method discoverTargets.
private void discoverTargets() {
if (!validateDiscoverTargetFields()) {
return;
}
VDS host = getContainer().getHost().getSelectedItem();
StorageServerConnections tempVar = new StorageServerConnections();
tempVar.setConnection(getAddress().getEntity().trim());
tempVar.setPort(getPort().getEntity().trim());
tempVar.setStorageType(StorageType.ISCSI);
// $NON-NLS-1$
tempVar.setUserName(getUseUserAuth().getEntity() ? getUserName().getEntity() : "");
// $NON-NLS-1$
tempVar.setPassword(getUseUserAuth().getEntity() ? getPassword().getEntity() : "");
DiscoverSendTargetsQueryParameters parameters = new DiscoverSendTargetsQueryParameters(host.getId(), tempVar);
setMessage(null);
final SanStorageModelBase model = this;
AsyncQuery<QueryReturnValue> asyncQuery = new AsyncQuery<>(returnValue -> {
Object result = returnValue.getReturnValue();
model.postDiscoverTargetsInternal(result != null ? (ArrayList<StorageServerConnections>) result : new ArrayList<>());
}, true);
Frontend.getInstance().runQuery(QueryType.DiscoverSendTargets, parameters, asyncQuery);
}
Aggregations