use of com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup in project tis by qlangtech.
the class GroupChangeSnapshotAction method doChange.
@Func(PermissionConstant.CONFIG_SNAPSHOT_CHANGE)
public // Navigator nav,
void doChange(Context context) throws Exception {
Assert.assertNotNull("form can not be null", form);
Assert.assertNotNull("form.getGroupSnapshot() can not be null", form.getGroupSnapshot());
Assert.assertNotNull("form.getSnapshotId() can not be null", form.getSnapshotId());
ServerGroupCriteria criteria = new ServerGroupCriteria();
criteria.createCriteria().andGidEqualTo(form.getGroupId()).andRuntEnvironmentEqualTo(this.getAppDomain().getRunEnvironment().getId());
ServerGroup group = new ServerGroup();
group.setPublishSnapshotId(form.getSnapshotId());
if (this.getServerGroupDAO().updateByExampleSelective(group, criteria) < 1) {
throw new IllegalArgumentException("has not update success");
}
this.addActionMessage(context, "已经将第" + this.getServerGroupDAO().selectByPrimaryKey(form.getGroupId()).getGroupIndex() + "组,发布快照切换成:snapshot" + form.getSnapshotId());
}
use of com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup in project tis by qlangtech.
the class ViewPojo method getSnapshotDoamin.
public static SnapshotDomain getSnapshotDoamin(BasicModule module, final AppDomainInfo appDomainInfo) {
ServerGroup group = DownloadServlet.getServerGroup(appDomainInfo.getAppid(), (short) 0, appDomainInfo.getRunEnvironment().getId(), module.getServerGroupDAO());
if (group == null) {
// return false;
throw new IllegalStateException("application:" + appDomainInfo + " can not get relevant serverGroup");
}
final SnapshotDomain snapshot = module.getSnapshotViewDAO().getView(group.getPublishSnapshotId());
return snapshot;
}
Aggregations