use of com.cubrid.cubridmanager.core.monitoring.model.StatusTemplateInfos in project cubrid-manager by CUBRID.
the class AddAndDelStatusTemplateTaskTest method testExec2.
public void testExec2() {
StatusTemplateInfo info = new StatusTemplateInfo();
info.setDb_name(testDbName);
info.setDesc("testStatus");
info.setName("newStatus");
TargetConfigInfo targetConfigInfo = new TargetConfigInfo();
targetConfigInfo.setCas_st_long_tran(new String[] { "aaa", "dd", "dd" });
info.addTarget_config(targetConfigInfo);
info.setSampling_term("1");
AddStatusTemplateTask task = new AddStatusTemplateTask(serverInfo);
task.setStatusTemplateInfo(info);
task.buildMsg();
task.execute();
assertNull(task.getErrorMsg());
StatusTemplateInfos bean = new StatusTemplateInfos();
final CommonQueryTask<StatusTemplateInfos> showTask = new CommonQueryTask<StatusTemplateInfos>(serverInfo, CommonSendMsg.getCommonSimpleSendMsg(), bean);
showTask.execute();
bean.getStatusTemplateInfoList();
assertEquals(bean.getTaskName(), "getstatustemplate");
DelStatusTemplateTask delTsk = new DelStatusTemplateTask(serverInfo);
delTsk.setTemplateName("newStatus");
delTsk.execute();
assertNull(delTsk.getErrorMsg());
}
use of com.cubrid.cubridmanager.core.monitoring.model.StatusTemplateInfos in project cubrid-manager by CUBRID.
the class CubridMonitorFolderLoader method loadStatusTempInfoTask.
/**
* load sub node by the task of getStatusTemplateInfos
*
* @param parent the parent node
* @param monitor the instance of IProgressMonitor
* @param serverInfo the instance of serverInfo
* @return boolean false if error occur, true if succeed
*/
private boolean loadStatusTempInfoTask(ICubridNode parent, final IProgressMonitor monitor, ServerInfo serverInfo) {
StatusTemplateInfos statusTemplateInfos = new StatusTemplateInfos();
final CommonQueryTask<StatusTemplateInfos> task = new CommonQueryTask<StatusTemplateInfos>(serverInfo, CommonSendMsg.getCommonSimpleSendMsg(), statusTemplateInfos);
monitorCancel(monitor, new ITask[] { task });
task.execute();
final String errorMsg = task.getErrorMsg();
if (!monitor.isCanceled() && errorMsg != null && errorMsg.trim().length() > 0) {
//parent.removeAllChild();
removeAllStatusTemp(parent);
openErrorBox(errorMsg);
setLoaded(true);
return false;
}
if (monitor.isCanceled()) {
setLoaded(true);
return false;
}
//parent.removeAllChild();
removeAllStatusTemp(parent);
statusTemplateInfos = task.getResultModel();
if (statusTemplateInfos != null) {
List<StatusTemplateInfo> list = statusTemplateInfos.getStatusTemplateInfoList().getStatusTemplateInfoList();
if (list != null) {
for (StatusTemplateInfo statusTemplateInfo : list) {
String id = parent.getId() + NODE_SEPARATOR + statusTemplateInfo.getName();
ICubridNode logInfoNode = new DefaultCubridNode(id, statusTemplateInfo.getName(), "icons/navigator/status_item.png");
logInfoNode.setType(CubridNodeType.STATUS_MONITOR_TEMPLATE);
logInfoNode.setModelObj(statusTemplateInfo);
logInfoNode.setViewId(StatusMonitorViewPart.ID);
logInfoNode.setContainer(false);
parent.addChild(logInfoNode);
}
}
}
return true;
}
use of com.cubrid.cubridmanager.core.monitoring.model.StatusTemplateInfos in project cubrid-manager by CUBRID.
the class CubridStatusMonitorFolderLoader method loadStatusTempInfoTask.
/**
* load sub node by the task of getStatusTemplateInfos
*
* @param parent the parent node
* @param monitor the instance of IProgressMonitor
* @param serverInfo the instance of serverInfo
* @return boolean false if error occur, true if succeed
*/
private boolean loadStatusTempInfoTask(ICubridNode parent, final IProgressMonitor monitor, ServerInfo serverInfo) {
StatusTemplateInfos statusTemplateInfos = new StatusTemplateInfos();
final CommonQueryTask<StatusTemplateInfos> task = new CommonQueryTask<StatusTemplateInfos>(serverInfo, CommonSendMsg.getCommonSimpleSendMsg(), statusTemplateInfos);
monitorCancel(monitor, new ITask[] { task });
task.execute();
final String errorMsg = task.getErrorMsg();
if (!monitor.isCanceled() && errorMsg != null && errorMsg.trim().length() > 0) {
parent.removeAllChild();
openErrorBox(errorMsg);
setLoaded(true);
return false;
}
if (monitor.isCanceled()) {
setLoaded(true);
return false;
}
parent.removeAllChild();
statusTemplateInfos = task.getResultModel();
if (statusTemplateInfos != null) {
List<StatusTemplateInfo> list = statusTemplateInfos.getStatusTemplateInfoList().getStatusTemplateInfoList();
if (list != null) {
for (StatusTemplateInfo statusTemplateInfo : list) {
String id = parent.getId() + NODE_SEPARATOR + statusTemplateInfo.getName();
ICubridNode logInfoNode = new DefaultCubridNode(id, statusTemplateInfo.getName(), "icons/navigator/status_item.png");
logInfoNode.setType(CubridNodeType.STATUS_MONITOR_TEMPLATE);
logInfoNode.setModelObj(statusTemplateInfo);
logInfoNode.setViewId(StatusMonitorViewPart.ID);
logInfoNode.setContainer(false);
parent.addChild(logInfoNode);
}
}
}
return true;
}
use of com.cubrid.cubridmanager.core.monitoring.model.StatusTemplateInfos in project cubrid-manager by CUBRID.
the class AddAndDelStatusTemplateTaskTest method testExec.
public void testExec() {
StatusTemplateInfo info = new StatusTemplateInfo();
info.setDb_name(testDbName);
info.setDesc("testStatus");
info.setName("newStatus");
TargetConfigInfo targetConfigInfo = new TargetConfigInfo();
targetConfigInfo.setCas_st_long_tran(new String[] { "aaa", "dd", "dd" });
info.addTarget_config(targetConfigInfo);
info.setSampling_term("1");
AddStatusTemplateTask task = new AddStatusTemplateTask(serverInfo);
task.setStatusTemplateInfo(info);
task.buildMsg();
task.execute();
assertNull(task.getErrorMsg());
StatusTemplateInfos bean = new StatusTemplateInfos();
final CommonQueryTask<StatusTemplateInfos> showTask = new CommonQueryTask<StatusTemplateInfos>(serverInfo, CommonSendMsg.getCommonSimpleSendMsg(), bean);
showTask.execute();
bean.getStatusTemplateInfoList();
assertEquals(bean.getTaskName(), "getstatustemplate");
DelStatusTemplateTask delTsk = new DelStatusTemplateTask(serverInfo);
delTsk.setTemplateName("newStatus");
delTsk.execute();
assertNull(delTsk.getErrorMsg());
}
Aggregations