use of com.ctrip.xpipe.redis.console.model.OrganizationTbl in project x-pipe by ctripcorp.
the class OrganizationServiceImplTest method testGetOrgTblUpdateList2.
@Test
public void testGetOrgTblUpdateList2() {
List<OrganizationTbl> localDbOrgs = createOrganizationTblList(10);
organizationDao.createBatchOrganizations(localDbOrgs);
localDbOrgs = organizationService.getAllOrganizations();
List<OrganizationTbl> remoteDbOrgs = Lists.newArrayList(localDbOrgs);
OrganizationTbl org = new OrganizationTbl().setOrgId(remoteDbOrgs.get(0).getOrgId()).setOrgName("test-different");
remoteDbOrgs.set(0, org);
List<OrganizationTbl> toUpdate = organizationService.getOrgTblUpdateList(remoteDbOrgs, localDbOrgs);
organizationDao.updateBatchOrganizations(toUpdate);
}
use of com.ctrip.xpipe.redis.console.model.OrganizationTbl in project x-pipe by ctripcorp.
the class ClusterCreateInfo method fromClusterTbl.
public static ClusterCreateInfo fromClusterTbl(ClusterTbl clusterTbl, DcService dcService) {
ClusterCreateInfo clusterCreateInfo = new ClusterCreateInfo();
clusterCreateInfo.setDesc(clusterTbl.getClusterDescription());
clusterCreateInfo.setClusterName(clusterTbl.getClusterName());
OrganizationTbl organizationTbl = clusterTbl.getOrganizationInfo();
clusterCreateInfo.setOrganizationId(organizationTbl != null ? organizationTbl.getOrgId() : 0L);
clusterCreateInfo.setClusterAdminEmails(clusterTbl.getClusterAdminEmails());
List<DcTbl> clusterRelatedDc = dcService.findClusterRelatedDc(clusterTbl.getClusterName());
clusterRelatedDc.forEach(dcTbl -> {
if (dcTbl.getId() == clusterTbl.getActivedcId()) {
clusterCreateInfo.addFirstDc(dcTbl.getDcName());
} else {
clusterCreateInfo.addDc(dcTbl.getDcName());
}
});
return clusterCreateInfo;
}
Aggregations