Search in sources :

Example 21 with StorageServerConnections

use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.

the class StorageListModel method saveNewNfsStorage.

public void saveNewNfsStorage() {
    StorageModel model = (StorageModel) getWindow();
    NfsStorageModel nfsModel = (NfsStorageModel) model.getCurrentStorageItem();
    VDS host = model.getHost().getSelectedItem();
    hostId = host.getId();
    // Create storage connection.
    StorageServerConnections storageConnection = new StorageServerConnections();
    storageConnection.setConnection(path);
    storageConnection.setStorageType(nfsModel.getType());
    if (isConnectionOverriden()) {
        storageConnection.setNfsVersion((NfsVersion) ((EntityModel) nfsModel.getVersion().getSelectedItem()).getEntity());
        storageConnection.setNfsRetrans(nfsModel.getRetransmissions().asConvertible().nullableShort());
        storageConnection.setNfsTimeo(nfsModel.getTimeout().asConvertible().nullableShort());
        storageConnection.setMountOptions(nfsModel.getMountOptions().getEntity());
    }
    connection = storageConnection;
    ArrayList<ActionType> actionTypes = new ArrayList<>();
    ArrayList<ActionParametersBase> parameters = new ArrayList<>();
    actionTypes.add(ActionType.AddStorageServerConnection);
    actionTypes.add(ActionType.AddNFSStorageDomain);
    actionTypes.add(ActionType.DisconnectStorageServerConnection);
    parameters.add(new StorageServerConnectionParametersBase(connection, host.getId(), false));
    StorageDomainManagementParameter tempVar2 = new StorageDomainManagementParameter(storageDomain);
    tempVar2.setVdsId(host.getId());
    StoragePool dataCenter = model.getDataCenter().getSelectedItem();
    tempVar2.setStoragePoolId(dataCenter.getId());
    parameters.add(tempVar2);
    parameters.add(new StorageServerConnectionParametersBase(connection, host.getId(), false));
    IFrontendActionAsyncCallback callback1 = result -> {
        StorageListModel storageListModel = (StorageListModel) result.getState();
        ActionReturnValue actionReturnValue = result.getReturnValue();
        storageListModel.storageDomain.setStorage((String) actionReturnValue.getActionReturnValue());
        storageListModel.connection.setId((String) actionReturnValue.getActionReturnValue());
    };
    IFrontendActionAsyncCallback callback2 = result -> {
        StorageListModel storageListModel = (StorageListModel) result.getState();
        ActionReturnValue actionReturnValue = result.getReturnValue();
        storageListModel.storageId = actionReturnValue.getActionReturnValue();
    };
    IFrontendActionAsyncCallback callback3 = result -> {
        StorageListModel storageListModel = (StorageListModel) result.getState();
        StorageModel storageModel = (StorageModel) storageListModel.getWindow();
        // Attach storage to data center as necessary.
        StoragePool dataCenter1 = storageModel.getDataCenter().getSelectedItem();
        if (!dataCenter1.getId().equals(StorageModel.UnassignedDataCenterId)) {
            storageListModel.attachStorageToDataCenter(storageListModel.storageId, dataCenter1.getId(), storageModel.getActivateDomain().getEntity());
        }
        storageListModel.onFinish(storageListModel.context, true, storageListModel.storageModel);
    };
    IFrontendActionAsyncCallback failureCallback = result -> {
        StorageListModel storageListModel = (StorageListModel) result.getState();
        storageListModel.cleanConnection(storageListModel.connection, storageListModel.hostId);
        storageListModel.onFinish(storageListModel.context, false, storageListModel.storageModel);
    };
    Frontend.getInstance().runMultipleActions(actionTypes, parameters, new ArrayList<>(Arrays.asList(callback1, callback2, callback3)), failureCallback, this);
}
Also used : SearchType(org.ovirt.engine.core.common.interfaces.SearchType) Arrays(java.util.Arrays) FrontendActionAsyncResult(org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult) SearchObjects(org.ovirt.engine.core.searchbackend.SearchObjects) RegexValidation(org.ovirt.engine.ui.uicommonweb.validation.RegexValidation) Inject(com.google.inject.Inject) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ExtendSANStorageDomainParameters(org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters) DiskProfileListModel(org.ovirt.engine.ui.uicommonweb.models.profiles.DiskProfileListModel) ActionType(org.ovirt.engine.core.common.action.ActionType) GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) NfsVersion(org.ovirt.engine.core.common.businessentities.NfsVersion) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) HasEntity(org.ovirt.engine.ui.uicommonweb.models.HasEntity) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) AttachStorageDomainToPoolParameters(org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters) StorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) ReduceSANStorageDomainDevicesCommandParameters(org.ovirt.engine.core.common.action.ReduceSANStorageDomainDevicesCommandParameters) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) Set(java.util.Set) AddSANStorageDomainParameters(org.ovirt.engine.core.common.action.AddSANStorageDomainParameters) StorageDomainSharedStatus(org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus) StringHelper(org.ovirt.engine.core.compat.StringHelper) List(java.util.List) Cloner(org.ovirt.engine.ui.uicommonweb.Cloner) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) PermissionListModel(org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel) ITaskTarget(org.ovirt.engine.ui.uicompat.ITaskTarget) Guid(org.ovirt.engine.core.compat.Guid) IFrontendActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback) TaskContext(org.ovirt.engine.ui.uicompat.TaskContext) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) Task(org.ovirt.engine.ui.uicompat.Task) StorageDomainStatus(org.ovirt.engine.core.common.businessentities.StorageDomainStatus) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) GetDeviceListQueryParameters(org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Frontend(org.ovirt.engine.ui.frontend.Frontend) StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) LinkedList(java.util.LinkedList) Model(org.ovirt.engine.ui.uicommonweb.models.Model) RemoveStorageDomainParameters(org.ovirt.engine.core.common.action.RemoveStorageDomainParameters) StorageDomainManagementParameter(org.ovirt.engine.core.common.action.StorageDomainManagementParameter) Linq(org.ovirt.engine.ui.uicommonweb.Linq) SearchStringMapping(org.ovirt.engine.ui.uicommonweb.models.SearchStringMapping) IValidation(org.ovirt.engine.ui.uicommonweb.validation.IValidation) ListWithSimpleDetailsModel(org.ovirt.engine.ui.uicommonweb.models.ListWithSimpleDetailsModel) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) StorageDomainType(org.ovirt.engine.core.common.businessentities.StorageDomainType) WebAdminApplicationPlaces(org.ovirt.engine.ui.uicommonweb.place.WebAdminApplicationPlaces) VDS(org.ovirt.engine.core.common.businessentities.VDS) StorageDomainParametersBase(org.ovirt.engine.core.common.action.StorageDomainParametersBase) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) ActionType(org.ovirt.engine.core.common.action.ActionType) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) VDS(org.ovirt.engine.core.common.businessentities.VDS) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) StorageDomainManagementParameter(org.ovirt.engine.core.common.action.StorageDomainManagementParameter) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ArrayList(java.util.ArrayList) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) IFrontendActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback)

Example 22 with StorageServerConnections

use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.

the class StorageListModel method saveNewLocalStorage.

public void saveNewLocalStorage() {
    StorageModel model = (StorageModel) getWindow();
    LocalStorageModel localModel = (LocalStorageModel) model.getCurrentStorageItem();
    VDS host = model.getHost().getSelectedItem();
    hostId = host.getId();
    // Create storage connection.
    StorageServerConnections tempVar = new StorageServerConnections();
    tempVar.setConnection(path);
    tempVar.setStorageType(localModel.getType());
    connection = tempVar;
    ArrayList<ActionType> actionTypes = new ArrayList<>();
    ArrayList<ActionParametersBase> parameters = new ArrayList<>();
    actionTypes.add(ActionType.AddStorageServerConnection);
    actionTypes.add(ActionType.AddLocalStorageDomain);
    parameters.add(new StorageServerConnectionParametersBase(connection, host.getId(), false));
    StorageDomainManagementParameter tempVar2 = new StorageDomainManagementParameter(storageDomain);
    tempVar2.setVdsId(host.getId());
    parameters.add(tempVar2);
    IFrontendActionAsyncCallback callback1 = result -> {
        StorageListModel storageListModel = (StorageListModel) result.getState();
        storageListModel.removeConnection = true;
        ActionReturnValue actionReturnValue = result.getReturnValue();
        storageListModel.storageDomain.setStorage((String) actionReturnValue.getActionReturnValue());
        storageListModel.connection.setId((String) actionReturnValue.getActionReturnValue());
    };
    IFrontendActionAsyncCallback callback2 = result -> {
        StorageListModel storageListModel = (StorageListModel) result.getState();
        storageListModel.removeConnection = false;
        storageListModel.onFinish(storageListModel.context, true, storageListModel.storageModel);
    };
    IFrontendActionAsyncCallback failureCallback = result -> {
        StorageListModel storageListModel = (StorageListModel) result.getState();
        if (storageListModel.removeConnection) {
            storageListModel.cleanConnection(storageListModel.connection, storageListModel.hostId);
            storageListModel.removeConnection = false;
        }
        storageListModel.onFinish(storageListModel.context, false, storageListModel.storageModel);
    };
    Frontend.getInstance().runMultipleActions(actionTypes, parameters, new ArrayList<>(Arrays.asList(new IFrontendActionAsyncCallback[] { callback1, callback2 })), failureCallback, this);
}
Also used : SearchType(org.ovirt.engine.core.common.interfaces.SearchType) Arrays(java.util.Arrays) FrontendActionAsyncResult(org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult) SearchObjects(org.ovirt.engine.core.searchbackend.SearchObjects) RegexValidation(org.ovirt.engine.ui.uicommonweb.validation.RegexValidation) Inject(com.google.inject.Inject) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ExtendSANStorageDomainParameters(org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters) DiskProfileListModel(org.ovirt.engine.ui.uicommonweb.models.profiles.DiskProfileListModel) ActionType(org.ovirt.engine.core.common.action.ActionType) GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) NfsVersion(org.ovirt.engine.core.common.businessentities.NfsVersion) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) HasEntity(org.ovirt.engine.ui.uicommonweb.models.HasEntity) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) AttachStorageDomainToPoolParameters(org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters) StorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) ReduceSANStorageDomainDevicesCommandParameters(org.ovirt.engine.core.common.action.ReduceSANStorageDomainDevicesCommandParameters) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) Set(java.util.Set) AddSANStorageDomainParameters(org.ovirt.engine.core.common.action.AddSANStorageDomainParameters) StorageDomainSharedStatus(org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus) StringHelper(org.ovirt.engine.core.compat.StringHelper) List(java.util.List) Cloner(org.ovirt.engine.ui.uicommonweb.Cloner) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) PermissionListModel(org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel) ITaskTarget(org.ovirt.engine.ui.uicompat.ITaskTarget) Guid(org.ovirt.engine.core.compat.Guid) IFrontendActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback) TaskContext(org.ovirt.engine.ui.uicompat.TaskContext) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) Task(org.ovirt.engine.ui.uicompat.Task) StorageDomainStatus(org.ovirt.engine.core.common.businessentities.StorageDomainStatus) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) GetDeviceListQueryParameters(org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Frontend(org.ovirt.engine.ui.frontend.Frontend) StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) LinkedList(java.util.LinkedList) Model(org.ovirt.engine.ui.uicommonweb.models.Model) RemoveStorageDomainParameters(org.ovirt.engine.core.common.action.RemoveStorageDomainParameters) StorageDomainManagementParameter(org.ovirt.engine.core.common.action.StorageDomainManagementParameter) Linq(org.ovirt.engine.ui.uicommonweb.Linq) SearchStringMapping(org.ovirt.engine.ui.uicommonweb.models.SearchStringMapping) IValidation(org.ovirt.engine.ui.uicommonweb.validation.IValidation) ListWithSimpleDetailsModel(org.ovirt.engine.ui.uicommonweb.models.ListWithSimpleDetailsModel) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) StorageDomainType(org.ovirt.engine.core.common.businessentities.StorageDomainType) WebAdminApplicationPlaces(org.ovirt.engine.ui.uicommonweb.place.WebAdminApplicationPlaces) VDS(org.ovirt.engine.core.common.businessentities.VDS) StorageDomainParametersBase(org.ovirt.engine.core.common.action.StorageDomainParametersBase) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) ActionType(org.ovirt.engine.core.common.action.ActionType) VDS(org.ovirt.engine.core.common.businessentities.VDS) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) StorageDomainManagementParameter(org.ovirt.engine.core.common.action.StorageDomainManagementParameter) ArrayList(java.util.ArrayList) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) IFrontendActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback)

Example 23 with StorageServerConnections

use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.

the class StorageListModel method saveNewPosixStorage.

public void saveNewPosixStorage() {
    StorageModel model = (StorageModel) getWindow();
    PosixStorageModel posixModel = (PosixStorageModel) model.getCurrentStorageItem();
    VDS host = model.getHost().getSelectedItem();
    hostId = host.getId();
    // Create storage connection.
    StorageServerConnections connection = new StorageServerConnections();
    connection.setConnection(path);
    connection.setStorageType(posixModel.getType());
    connection.setVfsType(posixModel.getVfsType().getEntity());
    connection.setMountOptions(posixModel.getMountOptions().getEntity());
    if (posixModel instanceof GlusterStorageModel) {
        GlusterStorageModel glusterModel = (GlusterStorageModel) posixModel;
        Guid glusterVolId = null;
        if (glusterModel.getLinkGlusterVolume().getEntity()) {
            glusterVolId = ((GlusterStorageModel) posixModel).getGlusterVolumes().getSelectedItem() != null ? ((GlusterStorageModel) posixModel).getGlusterVolumes().getSelectedItem().getId() : null;
        }
        connection.setGlusterVolumeId(glusterVolId);
    }
    this.connection = connection;
    ArrayList<ActionType> actionTypes = new ArrayList<>();
    ArrayList<ActionParametersBase> parameters = new ArrayList<>();
    actionTypes.add(ActionType.AddStorageServerConnection);
    actionTypes.add(posixModel.getAddStorageDomainVdcAction());
    parameters.add(new StorageServerConnectionParametersBase(this.connection, host.getId(), false));
    StorageDomainManagementParameter parameter = new StorageDomainManagementParameter(storageDomain);
    parameter.setVdsId(host.getId());
    StoragePool dataCenter = model.getDataCenter().getSelectedItem();
    parameter.setStoragePoolId(dataCenter.getId());
    parameters.add(parameter);
    IFrontendActionAsyncCallback callback1 = result -> {
        StorageListModel storageListModel = (StorageListModel) result.getState();
        ActionReturnValue actionReturnValue = result.getReturnValue();
        storageListModel.storageDomain.setStorage((String) actionReturnValue.getActionReturnValue());
        storageListModel.connection.setId((String) actionReturnValue.getActionReturnValue());
    };
    IFrontendActionAsyncCallback callback2 = result -> {
        StorageListModel storageListModel = (StorageListModel) result.getState();
        ActionReturnValue actionReturnValue = result.getReturnValue();
        storageListModel.storageId = actionReturnValue.getActionReturnValue();
        // Attach storage to data center as necessary.
        StorageModel storageModel = (StorageModel) storageListModel.getWindow();
        StoragePool dataCenter1 = storageModel.getDataCenter().getSelectedItem();
        if (!dataCenter1.getId().equals(StorageModel.UnassignedDataCenterId)) {
            storageListModel.attachStorageToDataCenter(storageListModel.storageId, dataCenter1.getId(), storageModel.getActivateDomain().getEntity());
        }
        storageListModel.onFinish(storageListModel.context, true, storageListModel.storageModel);
    };
    IFrontendActionAsyncCallback failureCallback = result -> {
        StorageListModel storageListModel = (StorageListModel) result.getState();
        storageListModel.cleanConnection(storageListModel.connection, storageListModel.hostId);
        storageListModel.onFinish(storageListModel.context, false, storageListModel.storageModel);
    };
    Frontend.getInstance().runMultipleActions(actionTypes, parameters, new ArrayList<>(Arrays.asList(new IFrontendActionAsyncCallback[] { callback1, callback2 })), failureCallback, this);
}
Also used : SearchType(org.ovirt.engine.core.common.interfaces.SearchType) Arrays(java.util.Arrays) FrontendActionAsyncResult(org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult) SearchObjects(org.ovirt.engine.core.searchbackend.SearchObjects) RegexValidation(org.ovirt.engine.ui.uicommonweb.validation.RegexValidation) Inject(com.google.inject.Inject) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ApplicationMode(org.ovirt.engine.core.common.mode.ApplicationMode) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) EntityModel(org.ovirt.engine.ui.uicommonweb.models.EntityModel) ExtendSANStorageDomainParameters(org.ovirt.engine.core.common.action.ExtendSANStorageDomainParameters) DiskProfileListModel(org.ovirt.engine.ui.uicommonweb.models.profiles.DiskProfileListModel) ActionType(org.ovirt.engine.core.common.action.ActionType) GlusterBrickEntity(org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity) NfsVersion(org.ovirt.engine.core.common.businessentities.NfsVersion) ConstantsManager(org.ovirt.engine.ui.uicompat.ConstantsManager) HasEntity(org.ovirt.engine.ui.uicommonweb.models.HasEntity) AsyncDataProvider(org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider) AttachStorageDomainToPoolParameters(org.ovirt.engine.core.common.action.AttachStorageDomainToPoolParameters) StorageType(org.ovirt.engine.core.common.businessentities.storage.StorageType) SearchParameters(org.ovirt.engine.core.common.queries.SearchParameters) QueryReturnValue(org.ovirt.engine.core.common.queries.QueryReturnValue) ReduceSANStorageDomainDevicesCommandParameters(org.ovirt.engine.core.common.action.ReduceSANStorageDomainDevicesCommandParameters) UICommand(org.ovirt.engine.ui.uicommonweb.UICommand) Set(java.util.Set) AddSANStorageDomainParameters(org.ovirt.engine.core.common.action.AddSANStorageDomainParameters) StorageDomainSharedStatus(org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus) StringHelper(org.ovirt.engine.core.compat.StringHelper) List(java.util.List) Cloner(org.ovirt.engine.ui.uicommonweb.Cloner) NotEmptyValidation(org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) QueryType(org.ovirt.engine.core.common.queries.QueryType) PermissionListModel(org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel) ITaskTarget(org.ovirt.engine.ui.uicompat.ITaskTarget) Guid(org.ovirt.engine.core.compat.Guid) IFrontendActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback) TaskContext(org.ovirt.engine.ui.uicompat.TaskContext) StorageDomain(org.ovirt.engine.core.common.businessentities.StorageDomain) HelpTag(org.ovirt.engine.ui.uicommonweb.help.HelpTag) Task(org.ovirt.engine.ui.uicompat.Task) StorageDomainStatus(org.ovirt.engine.core.common.businessentities.StorageDomainStatus) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ConfirmationModel(org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel) GetDeviceListQueryParameters(org.ovirt.engine.core.common.queries.GetDeviceListQueryParameters) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Frontend(org.ovirt.engine.ui.frontend.Frontend) StorageDomainStatic(org.ovirt.engine.core.common.businessentities.StorageDomainStatic) LinkedList(java.util.LinkedList) Model(org.ovirt.engine.ui.uicommonweb.models.Model) RemoveStorageDomainParameters(org.ovirt.engine.core.common.action.RemoveStorageDomainParameters) StorageDomainManagementParameter(org.ovirt.engine.core.common.action.StorageDomainManagementParameter) Linq(org.ovirt.engine.ui.uicommonweb.Linq) SearchStringMapping(org.ovirt.engine.ui.uicommonweb.models.SearchStringMapping) IValidation(org.ovirt.engine.ui.uicommonweb.validation.IValidation) ListWithSimpleDetailsModel(org.ovirt.engine.ui.uicommonweb.models.ListWithSimpleDetailsModel) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) StorageDomainType(org.ovirt.engine.core.common.businessentities.StorageDomainType) WebAdminApplicationPlaces(org.ovirt.engine.ui.uicommonweb.place.WebAdminApplicationPlaces) VDS(org.ovirt.engine.core.common.businessentities.VDS) StorageDomainParametersBase(org.ovirt.engine.core.common.action.StorageDomainParametersBase) PropertyChangedEventArgs(org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs) LUNs(org.ovirt.engine.core.common.businessentities.storage.LUNs) ActionType(org.ovirt.engine.core.common.action.ActionType) StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) VDS(org.ovirt.engine.core.common.businessentities.VDS) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) StorageDomainManagementParameter(org.ovirt.engine.core.common.action.StorageDomainManagementParameter) ArrayList(java.util.ArrayList) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) Guid(org.ovirt.engine.core.compat.Guid) ActionParametersBase(org.ovirt.engine.core.common.action.ActionParametersBase) ActionReturnValue(org.ovirt.engine.core.common.action.ActionReturnValue) IFrontendActionAsyncCallback(org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback)

Example 24 with StorageServerConnections

use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.

the class StorageListModel method updatePath.

private void updatePath() {
    StorageModel model = (StorageModel) getWindow();
    VDS host = model.getHost().getSelectedItem();
    Guid hostId = Guid.Empty;
    if (host != null) {
        hostId = host.getId();
    }
    IStorageModel storageModel = model.getCurrentStorageItem();
    connection = new StorageServerConnections();
    connection.setId(storageDomain.getStorage());
    connection.setConnection(path);
    connection.setStorageType(storageModel.getType());
    if (storageModel.getType().equals(StorageType.NFS)) {
        updateNFSProperties(storageModel);
    } else if (storageModel instanceof PosixStorageModel) {
        updatePosixProperties(storageModel);
    }
    StorageServerConnectionParametersBase parameters = new StorageServerConnectionParametersBase(connection, hostId, false);
    Frontend.getInstance().runAction(ActionType.UpdateStorageServerConnection, parameters, result -> {
        StorageListModel storageListModel = (StorageListModel) result.getState();
        storageListModel.onFinish(storageListModel.context, true, storageListModel.storageModel);
    }, this);
}
Also used : VDS(org.ovirt.engine.core.common.businessentities.VDS) StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) StorageServerConnectionParametersBase(org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase) Guid(org.ovirt.engine.core.compat.Guid)

Example 25 with StorageServerConnections

use of org.ovirt.engine.core.common.businessentities.StorageServerConnections in project ovirt-engine by oVirt.

the class SanStorageModelBase method postDiscoverTargetsInternal.

protected void postDiscoverTargetsInternal(ArrayList<StorageServerConnections> items) {
    ArrayList<SanTargetModel> newItems = new ArrayList<>();
    for (StorageServerConnections a : items) {
        SanTargetModel model = new SanTargetModel();
        model.setAddress(a.getConnection());
        model.setPort(a.getPort());
        model.setPortal(a.getPortal());
        model.setName(a.getIqn());
        model.setLuns(new ObservableCollection<>());
        model.getLoggedInEvent().addListener(this);
        newItems.add(model);
    }
    if (items.isEmpty()) {
        setMessage(ConstantsManager.getInstance().getConstants().noNewDevicesWereFoundMsg());
    }
    postDiscoverTargets(newItems);
}
Also used : StorageServerConnections(org.ovirt.engine.core.common.businessentities.StorageServerConnections) ArrayList(java.util.ArrayList)

Aggregations

StorageServerConnections (org.ovirt.engine.core.common.businessentities.StorageServerConnections)181 Test (org.junit.Test)83 ArrayList (java.util.ArrayList)43 Guid (org.ovirt.engine.core.compat.Guid)39 LUNs (org.ovirt.engine.core.common.businessentities.storage.LUNs)33 StorageDomain (org.ovirt.engine.core.common.businessentities.StorageDomain)32 StorageDomainStatic (org.ovirt.engine.core.common.businessentities.StorageDomainStatic)19 List (java.util.List)18 StorageType (org.ovirt.engine.core.common.businessentities.storage.StorageType)17 VDS (org.ovirt.engine.core.common.businessentities.VDS)16 StorageServerConnectionParametersBase (org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase)15 QueryReturnValue (org.ovirt.engine.core.common.queries.QueryReturnValue)15 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)14 HashSet (java.util.HashSet)13 ActionReturnValue (org.ovirt.engine.core.common.action.ActionReturnValue)11 ActionType (org.ovirt.engine.core.common.action.ActionType)11 Set (java.util.Set)10 StorageConnection (org.ovirt.engine.api.model.StorageConnection)10 StorageDomainType (org.ovirt.engine.core.common.businessentities.StorageDomainType)10 QueryType (org.ovirt.engine.core.common.queries.QueryType)10