Search in sources :

Example 6 with ServerGroup

use of com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup in project tis by qlangtech.

the class ServerGroupDAOImpl method deleteByPrimaryKey.

public int deleteByPrimaryKey(Integer gid) {
    ServerGroup key = new ServerGroup();
    key.setGid(gid);
    return this.deleteRecords("server_group.ibatorgenerated_deleteByPrimaryKey", key);
}
Also used : ServerGroup(com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup)

Example 7 with ServerGroup

use of com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup in project tis by qlangtech.

the class SnapshotDomainGetter method getSnapshot.

// @Override
public // request)
SnapshotDomain getSnapshot(AppKey appKey) throws SnapshotNotFindException {
    SnapshotInfoFromRequest result = new SnapshotInfoFromRequest();
    // final String resources = getResources(request);
    if (appKey.getTargetSnapshotId() != null && appKey.getTargetSnapshotId() > 0) {
        result.snapshotId = appKey.getTargetSnapshotId().intValue();
    } else {
        final ServerGroup group = runContext.getServerGroupDAO().load(appKey.appName, appKey.groupIndex, appKey.runtime.getId());
        if (group == null) {
            throw new SnapshotNotFindException("appName:" + appKey.appName + " groupIndex:" + appKey.groupIndex + " runtime:" + appKey.runtime + " has not a corresponding server group in db");
        }
        if (group.getPublishSnapshotId() == null) {
            throw new SnapshotNotFindException("groupid:" + group.getGid() + " has not set publish snapshot id");
        }
        result.snapshotId = group.getPublishSnapshotId();
    }
    // 如果在request中设置了unmergeglobalparams 这个参数
    if (!appKey.unmergeglobalparams) {
        result.runtime = appKey.runtime;
    }
    if (result.snapshotId == null) {
        throw new IllegalStateException("result.snapshotId can not be null");
    }
    ISnapshotViewDAO snapshotViewDAO = runContext.getSnapshotViewDAO();
    if (snapshotViewDAO == null) {
        throw new IllegalStateException("snapshotViewDAO can not be null");
    }
    return snapshotViewDAO.getView(result.snapshotId);
}
Also used : ServerGroup(com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup) ISnapshotViewDAO(com.qlangtech.tis.manage.biz.dal.dao.ISnapshotViewDAO) SnapshotNotFindException(com.qlangtech.tis.openapi.SnapshotNotFindException)

Example 8 with ServerGroup

use of com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup in project tis by qlangtech.

the class ServerGroupDAOImpl method loadFromWriteDB.

public ServerGroup loadFromWriteDB(Integer gid) {
    ServerGroup key = new ServerGroup();
    key.setGid(gid);
    ServerGroup record = this.loadFromWriterDB("server_group.ibatorgenerated_selectByPrimaryKey", key);
    return record;
}
Also used : ServerGroup(com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup)

Example 9 with ServerGroup

use of com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup in project tis by qlangtech.

the class ServerGroupDAOImpl method load.

/**
 * 百岁添加20120502
 */
public ServerGroup load(String appName, Short groupIndex, Short runtime) {
    ServerGroup key = new ServerGroup();
    key.setAppName(appName);
    key.setGroupIndex(groupIndex);
    key.setRuntEnvironment(runtime);
    return this.loadFromWriterDB("server_group.ibatorgenerated_getBy_appName_groupIndex_runtime", key);
}
Also used : ServerGroup(com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup)

Example 10 with ServerGroup

use of com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup in project tis by qlangtech.

the class ServerGroupDAOImpl method selectByPrimaryKey.

public ServerGroup selectByPrimaryKey(Integer gid) {
    ServerGroup key = new ServerGroup();
    key.setGid(gid);
    ServerGroup record = this.load("server_group.ibatorgenerated_selectByPrimaryKey", key);
    return record;
}
Also used : ServerGroup(com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup)

Aggregations

ServerGroup (com.qlangtech.tis.manage.biz.dal.pojo.ServerGroup)12 ServerGroupCriteria (com.qlangtech.tis.manage.biz.dal.pojo.ServerGroupCriteria)5 SnapshotDomain (com.qlangtech.tis.manage.common.SnapshotDomain)2 ISnapshotViewDAO (com.qlangtech.tis.manage.biz.dal.dao.ISnapshotViewDAO)1 Application (com.qlangtech.tis.manage.biz.dal.pojo.Application)1 Criteria (com.qlangtech.tis.manage.biz.dal.pojo.ServerGroupCriteria.Criteria)1 Snapshot (com.qlangtech.tis.manage.biz.dal.pojo.Snapshot)1 Func (com.qlangtech.tis.manage.spring.aop.Func)1 SnapshotNotFindException (com.qlangtech.tis.openapi.SnapshotNotFindException)1 ServerGroupAdapter (com.qlangtech.tis.runtime.pojo.ServerGroupAdapter)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1