Search in sources :

Example 1 with DiscoverSendTargetsQueryParameters

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);
}
Also used : QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) VDS(org.ovirt.engine.core.common.businessentities.VDS) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ArrayList(java.util.ArrayList) DiscoverSendTargetsQueryParameters(org.ovirt.engine.core.common.queries.DiscoverSendTargetsQueryParameters)

Aggregations

ArrayList (java.util.ArrayList)1 StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 DiscoverSendTargetsQueryParameters (org.ovirt.engine.core.common.queries.DiscoverSendTargetsQueryParameters)1 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)1