use of com.cubrid.cubridmanager.core.common.model.ServerUserInfo in project cubrid-manager by CUBRID.
the class ViewReplicationErrorLogAction method isSupported.
/**
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
* .lang.Object)
* @param obj Object
* @return boolean(whether to support)
*/
public boolean isSupported(Object obj) {
if (obj instanceof CubridDatabase) {
CubridDatabase database = (CubridDatabase) obj;
if (!database.isLogined()) {
return false;
}
ServerUserInfo serverUserInfo = database.getServer().getServerInfo().getLoginedUserInfo();
if (serverUserInfo == null || !serverUserInfo.isAdmin()) {
return false;
}
return database.isDistributorDb();
}
return false;
}
use of com.cubrid.cubridmanager.core.common.model.ServerUserInfo in project cubrid-manager by CUBRID.
the class DatabaseConnectionPropertyPage method loadPreference.
/**
* load the preference data.
*/
private void loadPreference() {
if (database == null) {
return;
}
String brokerIp = QueryOptions.getBrokerIp(database.getDatabaseInfo());
if (brokerIp == null || brokerIp.trim().length() == 0) {
brokerIp = database.getServer().getHostAddress();
}
this.oldBrokerIp = brokerIp;
brokerIpText.setText(brokerIp);
String brokerPort = QueryOptions.getBrokerPort(database.getDatabaseInfo());
this.oldBrokerPort = brokerPort;
String text = (String) brokerPortCombo.getData(brokerPort);
if (text != null) {
brokerPortCombo.setText(text);
}
if (text == null && brokerPort != null) {
brokerPortCombo.setText(brokerPort);
}
ServerUserInfo userInfo = database.getServer().getServerInfo().getLoginedUserInfo();
if (!userInfo.isAdmin()) {
brokerPortCombo.setEnabled(false);
brokerIpText.setEnabled(false);
}
String charset = QueryOptions.getCharset(database.getDatabaseInfo());
this.oldCharSet = charset;
charsetCombo.setItems(QueryOptions.getAllCharset(charset));
if (charset != null && charset.trim().length() > 0) {
charsetCombo.setText(charset);
} else {
charsetCombo.select(0);
}
}
use of com.cubrid.cubridmanager.core.common.model.ServerUserInfo in project cubrid-manager by CUBRID.
the class ShowSystemMonitorAction method isSupported.
/**
* Return whether this action support this object,if not support,this action
* will be disabled
*
* @param obj Object
* @return boolean true if supported , false otherwise
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
* .lang.Object)
*/
public boolean isSupported(Object obj) {
if (obj instanceof ICubridNode) {
ICubridNode node = (ICubridNode) obj;
if (!CubridNodeType.SYSTEM_MONITOR_TEMPLATE.equals(node.getType())) {
return false;
}
ServerUserInfo userInfo = node.getServer().getServerInfo().getLoginedUserInfo();
if (userInfo == null || (StatusMonitorAuthType.AUTH_ADMIN != userInfo.getStatusMonitorAuth() && StatusMonitorAuthType.AUTH_MONITOR != userInfo.getStatusMonitorAuth())) {
return false;
}
return true;
}
return false;
}
use of com.cubrid.cubridmanager.core.common.model.ServerUserInfo in project cubrid-manager by CUBRID.
the class EditStatusMonitorTemplateAction method isSupported.
/**
* Return whether this action support this object,if not support,this action
* will be disabled
*
* @param obj Object
* @return boolean true if supported, false otherwise
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
* .lang.Object)
*/
public boolean isSupported(Object obj) {
if (obj instanceof ICubridNode) {
ICubridNode node = (ICubridNode) obj;
if (!CubridNodeType.STATUS_MONITOR_TEMPLATE.equals(node.getType())) {
return false;
}
ServerUserInfo userInfo = node.getServer().getServerInfo().getLoginedUserInfo();
if (userInfo == null || StatusMonitorAuthType.AUTH_ADMIN != userInfo.getStatusMonitorAuth()) {
return false;
}
return true;
}
return false;
}
use of com.cubrid.cubridmanager.core.common.model.ServerUserInfo in project cubrid-manager by CUBRID.
the class ShowBrokerMonitorHistoryAction method isSupported.
/**
* Return whether this action support this object,if not support,this action
* will be disabled
*
* @param obj Object
* @return boolean true if supported , false otherwise
* @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
* .lang.Object)
*/
public boolean isSupported(Object obj) {
if (obj instanceof ICubridNode) {
ICubridNode node = (ICubridNode) obj;
if (!CubridNodeType.MONITOR_FOLDER.equals(node.getType())) {
return false;
}
ServerUserInfo userInfo = node.getServer().getServerInfo().getLoginedUserInfo();
if (userInfo == null || (StatusMonitorAuthType.AUTH_ADMIN != userInfo.getStatusMonitorAuth() && StatusMonitorAuthType.AUTH_MONITOR != userInfo.getStatusMonitorAuth())) {
return false;
}
return true;
}
return false;
}
Aggregations