use of org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel in project ovirt-engine by oVirt.
the class AsyncDataProvider method getIsoStorageModels.
public List<IStorageModel> getIsoStorageModels() {
ArrayList<IStorageModel> models = new ArrayList<>();
NfsStorageModel nfsIsoModel = new NfsStorageModel();
models.add(nfsIsoModel);
PosixStorageModel posixIsoModel = new PosixStorageModel();
models.add(posixIsoModel);
GlusterStorageModel glusterStorageModel = new GlusterStorageModel();
models.add(glusterStorageModel);
LocalStorageModel localIsoModel = new LocalStorageModel();
models.add(localIsoModel);
addTypeToStorageModels(StorageDomainType.ISO, models);
return models;
}
use of org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel in project ovirt-engine by oVirt.
the class AsyncDataProvider method getExportStorageModels.
public List<IStorageModel> getExportStorageModels() {
ArrayList<IStorageModel> models = new ArrayList<>();
NfsStorageModel nfsExportModel = new NfsStorageModel();
models.add(nfsExportModel);
PosixStorageModel posixExportModel = new PosixStorageModel();
models.add(posixExportModel);
GlusterStorageModel glusterExportModel = new GlusterStorageModel();
models.add(glusterExportModel);
LocalStorageModel localExportStorageModel = new LocalStorageModel();
models.add(localExportStorageModel);
addTypeToStorageModels(StorageDomainType.ImportExport, models);
return models;
}
use of org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel in project ovirt-engine by oVirt.
the class DataCenterGuideModel 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 -> {
DataCenterGuideModel dataCenterGuideModel = (DataCenterGuideModel) result.getState();
dataCenterGuideModel.removeConnection = true;
ActionReturnValue actionReturnValue = result.getReturnValue();
dataCenterGuideModel.storageDomain.setStorage((String) actionReturnValue.getActionReturnValue());
};
IFrontendActionAsyncCallback callback2 = result -> {
DataCenterGuideModel dataCenterGuideModel = (DataCenterGuideModel) result.getState();
dataCenterGuideModel.removeConnection = false;
dataCenterGuideModel.onFinish(dataCenterGuideModel.context, true, dataCenterGuideModel.storageModel);
};
IFrontendActionAsyncCallback failureCallback = result -> {
DataCenterGuideModel dataCenterGuideModel = (DataCenterGuideModel) result.getState();
if (dataCenterGuideModel.removeConnection) {
dataCenterGuideModel.cleanConnection(dataCenterGuideModel.connection, dataCenterGuideModel.hostId);
dataCenterGuideModel.removeConnection = false;
}
dataCenterGuideModel.onFinish(dataCenterGuideModel.context, false, dataCenterGuideModel.storageModel);
};
Frontend.getInstance().runMultipleActions(actionTypes, parameters, new ArrayList<>(Arrays.asList(new IFrontendActionAsyncCallback[] { callback1, callback2 })), failureCallback, this);
}
use of org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel in project ovirt-engine by oVirt.
the class AsyncDataProvider method getFileDataStorageModels.
public List<IStorageModel> getFileDataStorageModels() {
ArrayList<IStorageModel> models = new ArrayList<>();
NfsStorageModel nfsDataModel = new NfsStorageModel();
models.add(nfsDataModel);
PosixStorageModel posixDataModel = new PosixStorageModel();
models.add(posixDataModel);
GlusterStorageModel GlusterDataModel = new GlusterStorageModel();
models.add(GlusterDataModel);
LocalStorageModel localDataModel = new LocalStorageModel();
models.add(localDataModel);
addTypeToStorageModels(StorageDomainType.Data, models);
return models;
}
use of org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel in project ovirt-engine by oVirt.
the class DataCenterGuideModel method addLocalStorage.
private void addLocalStorage() {
final StorageModel model = new StorageModel(new NewEditStorageModelBehavior());
setWindow(model);
model.setTitle(ConstantsManager.getInstance().getConstants().newLocalDomainTitle());
model.setHelpTag(HelpTag.new_local_domain);
// $NON-NLS-1$
model.setHashName("new_local_domain");
LocalStorageModel localStorageModel = new LocalStorageModel();
localStorageModel.setRole(StorageDomainType.Data);
ArrayList<IStorageModel> list = new ArrayList<>();
list.add(localStorageModel);
model.setStorageModels(list);
model.setCurrentStorageItem(list.get(0));
AsyncDataProvider.getInstance().getLocalStorageHost(new AsyncQuery<>(localHost -> {
model.getHost().setItems(new ArrayList<>(Arrays.asList(new VDS[] { localHost })));
model.getHost().setSelectedItem(localHost);
model.getDataCenter().setItems(Collections.singletonList(getEntity()), getEntity());
// $NON-NLS-1$
UICommand tempVar = UICommand.createDefaultOkUiCommand("OnAddStorage", DataCenterGuideModel.this);
model.getCommands().add(tempVar);
// $NON-NLS-1$
UICommand tempVar2 = UICommand.createCancelUiCommand("Cancel", DataCenterGuideModel.this);
model.getCommands().add(tempVar2);
}), getEntity().getName());
}
Aggregations