cluster.setGuid(UUID.nameUUIDFromBytes(String.valueOf(clusterId).getBytes(Charset.forName("UTF-8"))).toString()); _clusterDao.update(clusterId, cluster);
clu.setGuid(UUID.randomUUID().toString()); _clusterDao.update(clusterId, clu);
clu.setGuid(UUID.randomUUID().toString());
clu.setGuid(UUID.randomUUID().toString()); _clusterDao.update(clusterId, clu);
void setClusterGuid(ClusterVO cluster, String guid) { cluster.setGuid(guid); try { _clusterDao.update(cluster.getId(), cluster); } catch (EntityExistsException e) { QueryBuilder<ClusterVO> sc = QueryBuilder.create(ClusterVO.class); sc.and(sc.entity().getGuid(), Op.EQ, guid); List<ClusterVO> clusters = sc.list(); ClusterVO clu = clusters.get(0); List<HostVO> clusterHosts = _resourceMgr.listAllHostsInCluster(clu.getId()); if (clusterHosts == null || clusterHosts.size() == 0) { clu.setGuid(null); _clusterDao.update(clu.getId(), clu); _clusterDao.update(cluster.getId(), cluster); return; } throw e; } }
cluster.setGuid(UUID.nameUUIDFromBytes(String.valueOf(clusterId).getBytes()).toString()); _clusterDao.update(clusterId, cluster);
@Override public boolean remove(Long id) { TransactionLegacy txn = TransactionLegacy.currentTxn(); txn.start(); ClusterVO cluster = createForUpdate(); cluster.setName(null); cluster.setGuid(null); update(id, cluster); boolean result = super.remove(id); txn.commit(); return result; }
cluster.setGuid(startup.getPool()); _clusterDao.update(cluster.getId(), cluster); } else if (!cluster.getGuid().equals(startup.getPool())) {
cluster.setGuid(startup.getPool()); _clusterDao.update(cluster.getId(), cluster);
if (hosts.size() == 0) { final ClusterVO cluster = _clusterDao.findById(clusterId); cluster.setGuid(null); _clusterDao.update(clusterId, cluster);