Search in sources :

Example 6 with AppDomainInfo

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);
}
Also used : AppDomainInfo(com.qlangtech.tis.manage.common.AppDomainInfo)

Example 7 with AppDomainInfo

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);
}
Also used : AppDomainInfo(com.qlangtech.tis.manage.common.AppDomainInfo) SnapshotDomain(com.qlangtech.tis.manage.common.SnapshotDomain) DocCollection(org.apache.solr.common.cloud.DocCollection) Func(com.qlangtech.tis.manage.spring.aop.Func)

Example 8 with AppDomainInfo

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());
}
Also used : AppDomainInfo(com.qlangtech.tis.manage.common.AppDomainInfo) Department(com.qlangtech.tis.manage.biz.dal.pojo.Department) Application(com.qlangtech.tis.manage.biz.dal.pojo.Application) Nullable(com.qlangtech.tis.pubhook.common.Nullable)

Aggregations

AppDomainInfo (com.qlangtech.tis.manage.common.AppDomainInfo)8 Nullable (com.qlangtech.tis.pubhook.common.Nullable)4 Pager (com.koubei.web.tag.pager.Pager)1 ActionProxy (com.opensymphony.xwork2.ActionProxy)1 Application (com.qlangtech.tis.manage.biz.dal.pojo.Application)1 Department (com.qlangtech.tis.manage.biz.dal.pojo.Department)1 Option (com.qlangtech.tis.manage.common.Option)1 SnapshotDomain (com.qlangtech.tis.manage.common.SnapshotDomain)1 Func (com.qlangtech.tis.manage.spring.aop.Func)1 RunEnvironment (com.qlangtech.tis.pubhook.common.RunEnvironment)1 Rundata (com.qlangtech.tis.runtime.module.action.BasicModule.Rundata)1 QueryRequestWrapper (com.qlangtech.tis.runtime.module.screen.IndexQuery.QueryRequestWrapper)1 PSchemaField (com.qlangtech.tis.solrdao.pojo.PSchemaField)1 DocCollection (org.apache.solr.common.cloud.DocCollection)1