use of com.qlangtech.tis.manage.common.AppDomainInfo in project tis by qlangtech.
the class OfflineDatasourceAction method doGetWorkflowId.
/**
* @param context
* @throws Exception
*/
public void doGetWorkflowId(Context context) throws Exception {
AppDomainInfo app = this.getAppDomain();
if (app.getApp().getWorkFlowId() == null) {
throw new IllegalStateException("WorkFlowId have not been set in collection:" + app.getAppName());
}
Map<String, Integer> result = Maps.newHashMap();
result.put("workflowId", app.getApp().getWorkFlowId());
this.setBizResult(context, result);
}
use of com.qlangtech.tis.manage.common.AppDomainInfo in project tis by qlangtech.
the class SnapshotRevsionAction method doSelectRevsion.
@Func(value = PermissionConstant.CONFIG_SNAPSHOT_CHANGE)
public void doSelectRevsion(Context context) throws Exception {
this.errorsPageShow(context);
Integer snapshotid = this.getInt("selectedSnapshotid");
// 只作数据库保存,不推送到远到引擎中
boolean justSave = this.getBoolean("justSave");
// final Integer groupid = this.getInt("groupid");
final String memo = this.getString("memo");
if (snapshotid == null) {
throw new IllegalArgumentException("snapshotid can not be null");
}
if (StringUtils.isBlank(memo)) {
this.addErrorMessage(context, "请填写操作日志");
return;
}
SnapshotDomain toSnapshot = this.getSnapshotViewDAO().getView(snapshotid);
if (toSnapshot == null) {
this.addErrorMessage(context, "版本号:" + snapshotid + "对应的配置已经被删除");
return;
}
final ServerGroup group = getAppServerGroup();
Assert.assertNotNull(group);
final AppDomainInfo domain = this.getAppDomain();
if (domain.getAppid() != (toSnapshot.getAppId() + 0)) {
this.addErrorMessage(context, "执行的实例与当前实例“" + domain.getAppName() + "”不一致,请关闭当前页面重新打开");
return;
}
if (group.getPublishSnapshotId() != null && snapshotid == (int) group.getPublishSnapshotId()) {
this.addErrorMessage(context, "SNAPSHOT已经设置为:" + snapshotid + ",请重新设置");
return;
}
Application app = new Application();
app.setAppId(domain.getAppid());
app.setProjectName(domain.getAppName());
change2newSnapshot(snapshotid, memo, group, app, domain.getRunEnvironment(), this);
if (!justSave) {
DocCollection docCollection = TISZkStateReader.getCollectionLive(this.getZkStateReader(), this.getCollectionName());
CoreAction.pushConfig2Engine(this, context, docCollection, snapshotid, false);
}
addActionMessage(context, "已经将" + domain.getRunEnvironment().getDescribe() + "" + domain.getAppName() + "的配置切换成了snapshot:" + snapshotid);
}
use of com.qlangtech.tis.manage.common.AppDomainInfo in project tis by qlangtech.
the class AppDomain method execute.
public void execute(Context context) throws Exception {
AppDomainInfo appDomain = getAppDomain();
if (appDomain == null) {
// 跳转到指定上下文的页面
// .withTarget("changedomain");
getRundataInstance().redirectTo("changedomain");
return;
}
Department department = null;
// final Department department = this.getDepartmentDAO().loadFromWriteDB(
// appDomain.getDptid());
// Application app = this.getApplicationDAO().loadFromWriteDB(
// appDomain.getAppid());
Application app = new Application();
app.setProjectName(appDomain.getAppName());
// 校验是否选择了当前应用?
if ((appDomain instanceof Nullable) || !shallSelectApp(department, app)) {
appDomain = CheckAppDomainExistValve.createNull();
context.put(ChangeDomainAction.SELECT_APP_NAME, getNotSelectDomainCaption());
} else {
boolean shallnotShowEnvironment = (context.get("shallnotShowEnvironment") != null) && (Boolean) context.get("shallnotShowEnvironment");
context.put(ChangeDomainAction.SELECT_APP_NAME, getAppDesc(appDomain, department, app, shallnotShowEnvironment));
}
context.put("dptid", appDomain.getDptid());
context.put("appid", appDomain.getAppid());
context.put("runid", appDomain.getRunEnvironment().getId());
}
Aggregations