/** * a key can have several values per version. a null version represents the default while other are specific one: * key.value = someval // the default value. the path returned is "value" key.value.3.1 = otherval // the 3.1 * version val. the path returned is "value.3.1" * * @return the string representation of the value path. for key.value.3.1 = otherval "value.3.1" should be returned. */ private String versionedValuePath(Version version) { return version == null ? "value" : "value." + version.toString(); }
public void setCompatibilityVersion(Version value) { compatibilityVersion = value.toString(); version = null; }
private static Object cloneVersion(Version instance) { return new Version(instance.toString()); }
private String defaultClusterRngSourcesCsv(Version ver) { String srcs = (String) AsyncDataProvider.getInstance().getConfigValuePreConverted(ConfigValues.ClusterRequiredRngSourcesDefault, ver.toString()); return (srcs == null) ? "" : srcs; }
public void getPmTypeList(AsyncQuery<List<String>> aQuery, Version version) { aQuery.converterCallback = source -> { ArrayList<String> list = new ArrayList<>(); if (source != null) { String[] array = ((String) source).split("[,]", -1); //$NON-NLS-1$ for (String item : array) { list.add(item); } } return list; }; GetConfigurationValueParameters param = new GetConfigurationValueParameters(ConfigValues.VdsFenceType); param.setVersion(version != null ? version.toString() : getDefaultConfigurationVersion()); Frontend.getInstance().runQuery(QueryType.GetFenceConfigurationValue, param, aQuery); }
public static <T> MockConfigDescriptor<T> of(ConfigValues value, Version version, T returnValue) { return new MockConfigDescriptor<>(value, version.toString(), returnValue); }
@BeforeEach public void mockAsyncDataProvider() { adp = AsyncDataProvider.getInstance(); // Mocked by UiCommonSetupExtension when(adp.getConfigValuePreConverted(ConfigValues.VncKeyboardLayoutValidValues)).thenReturn(Collections.emptyList()); when(adp.osNameExists(OS_TYPE)).thenReturn(true); when(adp.getMaxVmNameLength()).thenReturn(64); when(adp.getOsDefaultIconId(OS_TYPE, false)).thenReturn(LARGE_OS_DEFAULT_ICON_ID); when(adp.getConfigValuePreConverted(ConfigValues.ResumeBehaviorSupported, CLUSTER_VERSION.toString())).thenReturn(true); }
public void updateMaxNumOfVmCpus() { String version = getCompatibilityVersion().toString(); AsyncDataProvider.getInstance().getMaxNumOfVmCpus(asyncQuery( returnValue -> { maxCpus = returnValue; postUpdateNumOfSockets2(); }), version); }
public void postUpdateNumOfSockets2() { String version = getCompatibilityVersion().toString(); AsyncDataProvider.getInstance().getMaxNumOfCPUsPerSocket(asyncQuery( returnValue -> { maxCpusPerSocket = returnValue; postUpdateNumOfSockets3(); }), version); }
public void postUpdateNumOfSockets3() { String version = getCompatibilityVersion().toString(); AsyncDataProvider.getInstance().getMaxNumOfThreadsPerCpu(asyncQuery( returnValue -> { maxThreadsPerCore = returnValue; totalCpuCoresChanged(); }), version); }
protected void updateNumOfSockets() { Version version = getCompatibilityVersion(); if (version == null) { return; } AsyncDataProvider.getInstance().getMaxNumOfVmSockets(asyncQuery( returnValue -> { maxNumOfSockets = returnValue; updataMaxVmsInPool(); }), version.toString()); }
@Test public void testAddValueVersion() { Version verision = new Version(this.random.nextInt(), this.random.nextInt()); paramSource.addValue(paramName, verision); assertEquals( verision.toString(), paramSource.getValue(paramName), "wrong value returned from parameter source"); }
private void handleQxlClusterLevel() { getBehavior().enableSinglePCI(getIsQxlSupported()); if (getSelectedCluster() != null) { boolean isQxl = getDisplayType().getSelectedItem() == DisplayType.qxl; if (!isQxl) { handleQxlChangeProhibitionReason( getSpiceFileTransferEnabled(), getCompatibilityVersion().toString(), false); } getSpiceFileTransferEnabled().setIsChangeable(isQxl); GraphicsTypes selectedGraphics = getGraphicsType().getSelectedItem(); boolean spiceCopyPasteToggle = selectedGraphics != null && selectedGraphics.getBackingGraphicsTypes().contains(GraphicsType.SPICE); if (!spiceCopyPasteToggle) { handleQxlChangeProhibitionReason( getSpiceCopyPasteEnabled(), getCompatibilityVersion().toString(), isQxl); } getSpiceCopyPasteEnabled().setIsChangeable(spiceCopyPasteToggle); } }
@Override public void edit(final SnapshotModel model) { driver.edit(model); if (model.isShowMemorySnapshotWarning() && !model.isShowPartialSnapshotWarning()) { Style dialogStyle = getParent().getParent().getParent().getElement().getStyle(); dialogStyle.setWidth(450, Style.Unit.PX); dialogStyle.setHeight(240, Style.Unit.PX); } partialSnapshotWarningPanel.setVisible(model.isShowPartialSnapshotWarning()); memoryWarningPanel.setVisible(model.isShowMemorySnapshotWarning()); if (model.getOldClusterVersionOfSnapshotWithMemory() != null) { messageLabel.setText(messages.snapshotContainsMemoryIncompatibleCluster( model.getOldClusterVersionOfSnapshotWithMemory().toString())); model.getMemory().setEntity(false); } horizontalSeparator.setVisible(model.isShowPartialSnapshotWarning() && model.isShowMemorySnapshotWarning()); vmDisksLabel.setText(messages.vmDisksLabel(model.getVmDisks().size(), String.join(", ", Linq.getDiskAliases(model.getVmDisks())))); //$NON-NLS-1$ snapshotDisksLabel.setText(messages.snapshotDisksLabel(model.getDisks().size(), String.join(", ", Linq.getDiskAliases(model.getDisks())))); //$NON-NLS-1$ }
/** * Update the available fields based on the selection of the Power Management type list. Certain types will have * different fields available to select/fill out. */ private void updateFormStatus() { String pmType = getPmType().getSelectedItem(); if (StringHelper.isNotNullOrEmpty(pmType)) { String version = AsyncDataProvider.getInstance().getDefaultConfigurationVersion(); if (getHost().getCluster().getSelectedItem() != null) { version = getHost().getCluster().getSelectedItem().getCompatibilityVersion().toString(); } AsyncDataProvider.getInstance().getPmOptions(new AsyncQuery<>(pmOptions -> { if (pmOptions != null) { getPmPort().setIsAvailable(pmOptions.contains(PM_PORT_KEY)); getPmSlot().setIsAvailable(pmOptions.contains(PM_SLOT_KEY)); getPmSecure().setIsAvailable(pmOptions.contains(PM_SECURE_KEY)); getPmEncryptOptions().setIsAvailable(pmOptions.contains(PM_ENCRYPT_OPTIONS_KEY)); } else { getPmPort().setIsAvailable(false); getPmSlot().setIsAvailable(false); getPmSecure().setIsAvailable(false); } }), pmType, version); setCiscoUcsPrimaryPmTypeSelected(pmType.equals(CISCO_USC)); } else { getPmPort().setIsAvailable(false); getPmSlot().setIsAvailable(false); getPmSecure().setIsAvailable(false); } }
private void postNicInit() { getName().setEntity(AsyncDataProvider.getInstance().getNewNicName(getVmNicList())); initMAC(); getPlugged().setIsChangeable(allowPlug()); getPlugged().setEntity(allowPlug()); if (!allowPlug()) { getPlugged().setChangeProhibitionReason(ConstantsManager.getInstance() .getMessages() .nicHotPlugNotSupported(getClusterCompatibilityVersion().toString())); } initLinked(); initProfiles(); initCommands(); }
private void postNicInit() { getName().setEntity(getNic().getName()); initMAC(); initLinked(); initNetworkFilterParameters(new AsyncQuery<>(returnValue -> { getNetworkFilterParameterListModel().setItems(returnValue); })); initProfiles(); // Plug should be the last one updated, cause it controls the changeability of the other editor getPlugged().setEntity(getNic().isPlugged()); getPlugged().setIsChangeable(allowPlug()); if (!allowPlug()) { getPlugged().setChangeProhibitionReason(ConstantsManager.getInstance() .getMessages() .nicHotPlugNotSupported(getClusterCompatibilityVersion().toString())); } initCommands(); }
? vm.getCompatibilityVersion().toString() : ""); //$NON-NLS-1$
if (!getVolatileRun().getIsChangable()) { getVolatileRun().setChangeProhibitionReason( ConstantsManager.getInstance().getMessages().optionNotSupportedClusterVersionTooOld(vm.getCompatibilityVersion().toString()));