use of com.cubrid.cubridmanager.core.cubrid.jobauto.model.QueryPlanInfo in project cubrid-manager by CUBRID.
the class EditQueryPlanDialog method initPara.
/**
* Sets the queryPlanInfo and selection which is a folder
*
* @param selection the selection to set
*/
public void initPara(DefaultSchemaNode selection) {
childrenLabel = new ArrayList<String>();
ICubridNode[] childrenNode = null;
QueryPlanInfo qpi = null;
if (operation == AddEditType.EDIT) {
qpi = (QueryPlanInfo) selection.getAdapter(QueryPlanInfo.class);
childrenNode = selection.getParent().getChildren(new NullProgressMonitor());
} else {
qpi = new QueryPlanInfo();
childrenNode = selection.getChildren(new NullProgressMonitor());
}
queryPlanInfo = new QueryPlanInfoHelp();
queryPlanInfo.setQueryPlanInfo(qpi);
database = selection.getDatabase();
for (ICubridNode childNode : childrenNode) {
childrenLabel.add(childNode.getLabel());
}
withUser = CompatibleUtil.isSupportQueryPlanWithUser(database.getDatabaseInfo());
}
use of com.cubrid.cubridmanager.core.cubrid.jobauto.model.QueryPlanInfo in project cubrid-manager by CUBRID.
the class JobAutoDashboardEditorPart method editQueryPlan.
public void editQueryPlan() {
TableItem[] items = queryPlanInfoTable.getTable().getSelection();
if (items.length != 0) {
TableItem item = items[0];
QueryPlanInfo queryPlanInfo = (QueryPlanInfo) item.getData();
Set<String> typeSet = new HashSet<String>();
typeSet.add(CubridNodeType.QUERY_PLAN);
ICubridNode queryPlanNode = findAutoJobInfoNode(CubridNodeType.QUERY_PLAN, queryPlanInfo.getQuery_id());
if (queryPlanNode != null) {
EditQueryPlanAction action = (EditQueryPlanAction) ActionManager.getInstance().getAction(EditQueryPlanAction.ID);
if (action.run(database, (DefaultSchemaNode) queryPlanNode) == IDialogConstants.OK_ID) {
refreshQueryPlan();
}
}
} else {
CommonUITool.openWarningBox(Messages.errJobAutoNoSelection);
}
}
use of com.cubrid.cubridmanager.core.cubrid.jobauto.model.QueryPlanInfo in project cubrid-manager by CUBRID.
the class JobAutoDashboardEditorPart method deleteQueryPlan.
public void deleteQueryPlan() {
TableItem[] items = queryPlanInfoTable.getTable().getSelection();
if (items.length > 0) {
List<ISchemaNode> selectNodeList = new ArrayList<ISchemaNode>();
for (TableItem item : items) {
QueryPlanInfo queryPlanInfo = (QueryPlanInfo) item.getData();
Set<String> typeSet = new HashSet<String>();
typeSet.add(CubridNodeType.QUERY_PLAN);
ICubridNode queryPlanNode = CommonUITool.findNode(database, typeSet, queryPlanInfo.getQuery_id());
selectNodeList.add((ISchemaNode) queryPlanNode);
}
if (selectNodeList.size() > 0) {
DeleteQueryPlanAction action = (DeleteQueryPlanAction) ActionManager.getInstance().getAction(DeleteQueryPlanAction.ID);
ISchemaNode[] nodeArr = new ISchemaNode[selectNodeList.size()];
action.run(selectNodeList.toArray(nodeArr));
refreshQueryPlan();
}
} else {
CommonUITool.openWarningBox(Messages.errJobAutoNoSelection);
}
}
use of com.cubrid.cubridmanager.core.cubrid.jobauto.model.QueryPlanInfo in project cubrid-manager by CUBRID.
the class OpenJobAutomationInfoPartProgress method run.
/* (non-Javadoc)
* @see org.eclipse.jface.operation.IRunnableWithProgress#run(org.eclipse.core.runtime.IProgressMonitor)
*/
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
if (getBackupPlanInfo) {
final GetBackupPlanListTask getBackupPlanInfoListTask = new GetBackupPlanListTask(database.getServer().getServerInfo());
getBackupPlanInfoListTask.setDbName(database.getLabel());
getBackupPlanInfoListTask.execute();
if (getBackupPlanInfoListTask.isSuccess()) {
backupPlanInfoList = getBackupPlanInfoListTask.getBackupPlanInfoList();
} else {
backupPlanInfoList = new ArrayList<BackupPlanInfo>();
}
}
if (getQueryPlanInfo) {
final GetQueryPlanListTask getQueryPlanListTask = new GetQueryPlanListTask(database.getServer().getServerInfo());
getQueryPlanListTask.setDbName(database.getLabel());
getQueryPlanListTask.execute();
if (getQueryPlanListTask.isSuccess()) {
queryPlanInfoList = getQueryPlanListTask.getQueryPlanInfoList();
} else {
queryPlanInfoList = new ArrayList<QueryPlanInfo>();
}
}
success = true;
}
use of com.cubrid.cubridmanager.core.cubrid.jobauto.model.QueryPlanInfo in project cubrid-manager by CUBRID.
the class DatabaseInfoTest method testRemoveQueryPlanInfo.
/**
* Test method for
* {@link com.cubrid.cubridmanager.core.cubrid.database.model.DatabaseInfo#removeQueryPlanInfo(com.cubrid.cubridmanager.core.cubrid.jobauto.model.QueryPlanInfo)}
* .
*/
public void testRemoveQueryPlanInfo() {
QueryPlanInfo queryPlanInfo = new QueryPlanInfo();
bean.removeQueryPlanInfo(queryPlanInfo);
bean.setQueryPlanInfoList(new ArrayList<QueryPlanInfo>());
bean.addQueryPlanInfo(queryPlanInfo);
bean.removeQueryPlanInfo(queryPlanInfo);
}
Aggregations