use of org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase in project ovirt-engine by oVirt.
the class FileStorageHelper method runConnectionStorageToDomain.
@Override
protected Pair<Boolean, EngineFault> runConnectionStorageToDomain(StorageDomain storageDomain, Guid vdsId, int type) {
Pair<Boolean, EngineFault> result;
StorageServerConnections connection = storageServerConnectionDao.get(storageDomain.getStorage());
if (connection != null) {
ActionReturnValue returnValue = backend.runInternalAction(ActionType.forValue(type), new StorageServerConnectionParametersBase(connection, vdsId, false));
result = new Pair<>(returnValue.getSucceeded(), returnValue.getFault());
} else {
result = new Pair<>(false, null);
log.warn("Did not connect host '{}' to storage domain '{}' because connection for connectionId '{}' is null.", vdsId, storageDomain.getStorageName(), storageDomain.getStorage());
}
return result;
}
use of org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase in project ovirt-engine by oVirt.
the class BackendStorageServerConnectionsResource method getAddParams.
private StorageServerConnectionParametersBase getAddParams(StorageServerConnections entity, Guid hostId) {
StorageServerConnectionParametersBase params = new StorageServerConnectionParametersBase(entity, hostId, false);
params.setVdsId(hostId);
return params;
}
use of org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase in project ovirt-engine by oVirt.
the class BackendStorageServerConnectionResource method remove.
@Override
public Response remove() {
get();
StorageServerConnections connection = new StorageServerConnections();
connection.setId(id);
String host = ParametersHelper.getParameter(httpHeaders, uriInfo, HOST);
Guid hostId = Guid.Empty;
if (host != null) {
hostId = getHostId(host);
}
StorageServerConnectionParametersBase parameters = new StorageServerConnectionParametersBase(connection, hostId, false);
return performAction(ActionType.RemoveStorageServerConnection, parameters);
}
use of org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase in project ovirt-engine by oVirt.
the class SanStorageModelBase method connectTargets.
private void connectTargets() {
VDS host = getContainer().getHost().getSelectedItem();
if (host == null) {
return;
}
ArrayList<ActionType> actionTypes = new ArrayList<>();
ArrayList<ActionParametersBase> parameters = new ArrayList<>();
ArrayList<IFrontendActionAsyncCallback> callbacks = new ArrayList<>();
final SanStorageModelBase sanStorageModel = this;
IFrontendActionAsyncCallback loginCallback = result -> sanStorageModel.postLogin(result.getReturnValue(), sanStorageModel);
for (int i = 0; i < targetsToConnect.size(); i++) {
SanTargetModel model = targetsToConnect.get(i);
StorageServerConnections connection = new StorageServerConnections();
connection.setStorageType(StorageType.ISCSI);
// $NON-NLS-1$
connection.setUserName(getUseUserAuth().getEntity() ? getUserName().getEntity() : "");
// $NON-NLS-1$
connection.setPassword(getUseUserAuth().getEntity() ? getPassword().getEntity() : "");
connection.setIqn(model.getName());
connection.setConnection(model.getAddress());
connection.setPort(String.valueOf(model.getPort()));
connection.setPortal(model.getPortal());
actionTypes.add(ActionType.ConnectStorageToVds);
parameters.add(new StorageServerConnectionParametersBase(connection, host.getId(), false));
callbacks.add(loginCallback);
}
Object target = getWidgetModel() != null ? getWidgetModel() : getContainer();
Frontend.getInstance().runMultipleActions(actionTypes, parameters, callbacks, null, target);
}
use of org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase in project ovirt-engine by oVirt.
the class StorageListModel method cancelImportConfirm.
private void cancelImportConfirm() {
cancelConfirm();
getWindow().stopProgress();
if (fileConnection != null) {
Frontend.getInstance().runAction(ActionType.DisconnectStorageServerConnection, new StorageServerConnectionParametersBase(fileConnection, hostId, false), result -> {
StorageListModel storageListModel = (StorageListModel) result.getState();
cleanConnection(storageListModel.fileConnection, storageListModel.hostId);
storageListModel.fileConnection = null;
}, this);
}
}
Aggregations