public Guid getClusterId() { return vdsStatic.getClusterId(); }
return server.getClusterId().equals(clusterId) ? server : null;
/** * Ensures all the right set of VdsStatic instances are returned. */ @Test public void testGetAllForCluster() { List<VdsStatic> result = dao.getAllForCluster(existingEntity.getClusterId()); assertNotNull(result); assertFalse(result.isEmpty()); for (VdsStatic vds : result) { assertEquals(existingEntity.getClusterId(), vds.getClusterId()); } }
@Override protected VdsStatic generateNewEntity() { VdsStatic newStaticVds = new VdsStatic(); newStaticVds.setHostName("farkle.redhat.com"); newStaticVds.setSshPort(22); newStaticVds.setSshUsername("root"); newStaticVds.setClusterId(existingEntity.getClusterId()); newStaticVds.setSshKeyFingerprint("b5:ad:16:19:06:9f:b3:41:69:eb:1c:42:1d:12:b5:31"); newStaticVds.setCurrentKernelCmdline("a=b"); newStaticVds.setLastStoredKernelCmdline("c=d"); newStaticVds.setKernelCmdlineIommu(true); return newStaticVds; }
@Override protected VDS getInverse(VdsStatic to) { VDS inverse = new VDS(); inverse.setId(to.getId()); inverse.setVdsName(to.getName()); inverse.setHostName(to.getHostName()); inverse.setClusterId(to.getClusterId()); inverse.setPort(to.getPort()); inverse.setSshKeyFingerprint(to.getSshKeyFingerprint()); inverse.setHostProviderId(to.getHostProviderId()); inverse.setSshPort(to.getSshPort()); inverse.setSshUsername(to.getSshUsername()); inverse.setVdsSpmPriority(to.getVdsSpmPriority()); inverse.setConsoleAddress(to.getConsoleAddress()); inverse.setComment(to.getComment()); return inverse; }
private MapSqlParameterSource getInsertOrUpdateParams(final VdsStatic vds) { return getCustomMapSqlParameterSource() .addValue("host_name", vds.getHostName()) .addValue("free_text_comment", vds.getComment()) .addValue("vds_unique_id", vds.getUniqueID()) .addValue("port", vds.getPort()) .addValue("cluster_id", vds.getClusterId()) .addValue("vds_id", vds.getId()) .addValue("vds_name", vds.getName()) .addValue("server_SSL_enabled", vds.isServerSslEnabled()) .addValue("vds_type", vds.getVdsType()) .addValue("vds_strength", vds.getVdsStrength()) .addValue("pm_enabled", vds.isPmEnabled()) .addValue("pm_proxy_preferences", FenceProxySourceTypeHelper.saveAsString(vds.getFenceProxySources())) .addValue("pm_detect_kdump", vds.isPmKdumpDetection()) .addValue("otp_validity", vds.getOtpValidity()) .addValue("vds_spm_priority", vds.getVdsSpmPriority()) .addValue("console_address", vds.getConsoleAddress()) .addValue("sshKeyFingerprint", vds.getSshKeyFingerprint()) .addValue("ssh_port", vds.getSshPort()) .addValue("ssh_username", vds.getSshUsername()) .addValue("disable_auto_pm", vds.isDisablePowerManagementPolicy()) .addValue("host_provider_id", vds.getHostProviderId()) .addValue("openstack_network_provider_id", vds.getOpenstackNetworkProviderId()) .addValue("kernel_cmdline", KernelCmdlineColumn.fromVdsStatic(vds).toJson()) .addValue("last_stored_kernel_cmdline", vds.getLastStoredKernelCmdline()) .addValue("reinstall_required", vds.isReinstallRequired()) .addValue("vgpu_placement", vds.getVgpuPlacement()); }