use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode in project cubrid-manager by CUBRID.
the class BrokerMonitorPartHelper method activate.
/**
* Generate the DataUpdateListener
*/
public void activate() {
if (brokerNode == null) {
return;
}
HostNode hostNode = brokerNode.getParent();
String generatorName = hostNode.getUserName() + "@" + hostNode.getIp() + ":" + hostNode.getPort();
generator = DataGeneratorPool.getInstance().getDataGenerator(generatorName, new DataProvider());
generator.addDataUpdateListener(this);
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode in project cubrid-manager by CUBRID.
the class DatabaseMonitorPartHelper method activate.
/**
* Generate the DataUpdateListener
*/
public void activate() {
if (dbNode == null) {
return;
}
HostNode hostNode = dbNode.getParent();
String generatorName = hostNode.getUserName() + "@" + hostNode.getIp() + ":" + hostNode.getPort();
generator = DataGeneratorPool.getInstance().getDataGenerator(generatorName, new DataProvider());
generator.addDataUpdateListener(this);
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode in project cubrid-manager by CUBRID.
the class DatabaseMonitorPart method createFigure.
/**
* get a database monitor figure.
*
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
* @return a database figure
*/
protected IFigure createFigure() {
DatabaseMonitorFigure dbMonitorFigure = new DatabaseMonitorFigure();
DatabaseNode databaseNode = (DatabaseNode) getModel();
HostNode hostNode = databaseNode.getParent();
dbMonitorFigure.setTitle(databaseNode.getName());
dbMonitorFigure.setHostName(hostNode.getName());
String statusText = DBStatusType.getShowText(databaseNode.getDbStatusType());
dbMonitorFigure.setStatus(true, hostNode.isConnected(), databaseNode.isConnected(), statusText, databaseNode.getErrorMsg(), databaseNode.hasNewErrorMsg());
dbMonitorFigure.setHint(new StringBuffer(" ").append(databaseNode.getDbName()).append("@").append(hostNode.getIp()).append(":").append(hostNode.getPort()).append(" ").toString());
return dbMonitorFigure;
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode in project cubrid-manager by CUBRID.
the class OpenApplyLogDBLogAction method run.
/**
* open apply database log
*
* @see org.eclipse.jface.action.Action#run()
*/
public void run() {
Object[] objArr = this.getSelectedObj();
if (objArr == null || objArr.length <= 0 || !isSupported(objArr[0])) {
setEnabled(false);
return;
}
DatabaseMonitorPart dbMonPart = (DatabaseMonitorPart) objArr[0];
DatabaseNode dbNode = (DatabaseNode) dbMonPart.getModel();
HostNode hostNode = dbNode.getParent();
ServerInfo serverInfo = hostNode.getServerInfo();
CubridServer server = new CubridServer(serverInfo.getHostAddress(), serverInfo.getHostAddress(), null, null);
server.setServerInfo(serverInfo);
LogInfo logInfo = new LogInfo();
String logPath = serverInfo.getEnvInfo().getRootDir() + serverInfo.getPathSeparator() + "log" + serverInfo.getPathSeparator();
String fileName = dbNode.getDbName() + "@localhost_applylogdb_" + dbNode.getDbName() + "_" + hostNode.getHostStatusInfo().getMasterHostStatusInfo().getHostName() + ".err";
logInfo.setPath(logPath + fileName);
DefaultCubridNode dbLogInfoNode = new DefaultCubridNode(dbNode.getDbName() + ICubridNodeLoader.NODE_SEPARATOR + "apply_database_log", logInfo.getName(), "icons/navigator/log_item.png");
dbLogInfoNode.setType(CubridNodeType.LOGS_APPLY_DATABASE_LOG);
dbLogInfoNode.setModelObj(logInfo);
dbLogInfoNode.setEditorId(LogEditorPart.ID);
dbLogInfoNode.setContainer(false);
dbLogInfoNode.setServer(server);
LogViewAction action = (LogViewAction) ActionManager.getInstance().getAction(LogViewAction.ID);
action.setCubridNode(dbLogInfoNode);
action.run();
}
use of com.cubrid.cubridmanager.ui.mondashboard.editor.model.HostNode in project cubrid-manager by CUBRID.
the class OpenCopyLogDBLogAction method isSupported.
/**
*
*
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java.lang.Object)
* @param obj Object
* @return is supported.
*/
public boolean isSupported(Object obj) {
if (obj instanceof DatabaseMonitorPart) {
DatabaseMonitorPart dbMonPart = (DatabaseMonitorPart) obj;
DatabaseNode dbNode = (DatabaseNode) dbMonPart.getModel();
HostNode hostNode = dbNode.getParent();
if (hostNode != null && hostNode.getServerInfo() != null && hostNode.getServerInfo().isConnected() && (dbNode.getDbStatusType() == DBStatusType.STANDBY || dbNode.getDbStatusType() == DBStatusType.MAINTENANCE) && hostNode.getHostStatusInfo() != null && hostNode.getHostStatusInfo().getMasterHostStatusInfo() != null) {
return true;
}
}
return false;
}
Aggregations