static Cluster setUpEntityExpectations(Cluster entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); when(entity.getName()).thenReturn(NAMES[index]); when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]); when(entity.getMigrationBandwidthLimitType()).thenReturn(MigrationBandwidthLimitType.AUTO); return entity; }
static Cluster setUpEntityExpectations(Cluster entity, int index) { when(entity.getId()).thenReturn(GUIDS[index]); when(entity.getName()).thenReturn(NAMES[index]); when(entity.getDescription()).thenReturn(DESCRIPTIONS[index]); when(entity.getMigrationBandwidthLimitType()).thenReturn(MigrationBandwidthLimitType.AUTO); return entity; }
if (cluster != null) { getCluster().getDescription().setEntity(cluster.getDescription()); getCluster().getDescription().setEntity(cluster.getDescription());
private void updateProperties() { Cluster cluster = getEntity(); setName(cluster.getName()); setDescription(cluster.getDescription()); setCpuType(cluster.getCpuName()); setDataCenterName(cluster.getStoragePoolName()); setMemoryOverCommit(cluster.getMaxVdsMemoryOverCommit()); setCpuThreads(cluster.getCountThreadsAsCores()); setResiliencePolicy(cluster.getMigrateOnError()); setEmulatedMachine(cluster.getEmulatedMachine()); setCompatibilityVersion(cluster.getCompatibilityVersion().getValue()); generateClusterType(cluster.supportsGlusterService(), cluster.supportsVirtService()); AsyncDataProvider.getInstance().getNumberOfVmsInCluster(new AsyncQuery<>( (QueryReturnValue returnValue) -> setNumberOfVms((Integer) returnValue.getReturnValue())), cluster.getId()); }
private static Cluster cloneCluster(Cluster instance) { Cluster obj = new Cluster(); obj.setId(instance.getId()); obj.setName(instance.getName()); obj.setDescription(instance.getDescription()); obj.setComment(instance.getComment()); obj.setCpuName(instance.getCpuName()); obj.setClusterCompatibilityLevelUpgradeNeeded(instance.isClusterCompatibilityLevelUpgradeNeeded()); obj.setCompatibilityVersion(instance.getCompatibilityVersion()); obj.setMigrateOnError(instance.getMigrateOnError()); obj.setTransparentHugepages(instance.getTransparentHugepages()); obj.setStoragePoolId(instance.getStoragePoolId()); obj.setMaxVdsMemoryOverCommit(instance.getMaxVdsMemoryOverCommit()); obj.setCountThreadsAsCores(instance.getCountThreadsAsCores()); obj.setEmulatedMachine(instance.getEmulatedMachine()); obj.setDetectEmulatedMachine(instance.isDetectEmulatedMachine()); obj.setArchitecture(instance.getArchitecture()); obj.setSerialNumberPolicy(instance.getSerialNumberPolicy()); obj.setCustomSerialNumber(instance.getCustomSerialNumber()); obj.setFencingPolicy(new FencingPolicy(instance.getFencingPolicy())); obj.setAutoConverge(instance.getAutoConverge()); obj.setMigrateCompressed(instance.getMigrateCompressed()); return obj; }
model.setId(entity.getId().toString()); model.setName(entity.getName()); model.setDescription(entity.getDescription()); model.setComment(entity.getComment()); model.setSwitchType(SwitchTypeMapper.mapToModel(entity.getRequiredSwitchTypeForCluster()));
private void postInit() { getDescription().setEntity(getEntity().getDescription()); getComment().setEntity(getEntity().getComment());
private MapSqlParameterSource getClusterParamSource(Cluster cluster) { return getCustomMapSqlParameterSource() .addValue("description", cluster.getDescription()) .addValue("name", cluster.getName()) .addValue("free_text_comment", cluster.getComment())