Search in sources :

Example 11 with CubridBroker

use of com.cubrid.cubridmanager.ui.spi.model.CubridBroker in project cubrid-manager by CUBRID.

the class StartBrokerAction method isSupportedNode.

/**
	 * Return whether this action support this object,if not support,this action
	 * will be disabled
	 * 
	 * @see com.cubrid.common.ui.spi.action.ISelectionAction#isSupported(java
	 *      .lang.Object)
	 * @param obj the object
	 * @return <code>true</code> if supported;<code>false</code>
	 */
public static boolean isSupportedNode(Object obj) {
    if (obj instanceof CubridBroker) {
        CubridBroker selection = ((CubridBroker) obj);
        ServerUserInfo userInfo = selection.getServer().getServerInfo().getLoginedUserInfo();
        if (userInfo == null || CasAuthType.AUTH_ADMIN != userInfo.getCasAuth()) {
            return false;
        }
        CubridBrokerFolder parent = (CubridBrokerFolder) (selection.getParent());
        return parent.isRunning() && !selection.isRunning();
    }
    return false;
}
Also used : CubridBroker(com.cubrid.cubridmanager.ui.spi.model.CubridBroker) ServerUserInfo(com.cubrid.cubridmanager.core.common.model.ServerUserInfo) CubridBrokerFolder(com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder)

Example 12 with CubridBroker

use of com.cubrid.cubridmanager.ui.spi.model.CubridBroker in project cubrid-manager by CUBRID.

the class BrokerStatusView method nodeChanged.

/**
	 * Response to node changes
	 * 
	 * @param event the node changed event
	 */
public void nodeChanged(CubridNodeChangedEvent event) {
    ICubridNode eventNode = event.getCubridNode();
    if (eventNode == null || brokerNode == null) {
        return;
    }
    //if it is not in the same host,return
    if (!eventNode.getServer().getId().equals(brokerNode.getServer().getId())) {
        return;
    }
    String type = eventNode.getType();
    if (!CubridNodeType.BROKER_FOLDER.equals(type)) {
        return;
    }
    synchronized (this) {
        String id = brokerNode.getId();
        CubridBroker currentNode = (CubridBroker) eventNode.getChild(id);
        this.brokerNode = currentNode;
        if (currentNode == null || !currentNode.isRunning()) {
            setRunflag(false);
            this.setTitleImage(CubridManagerUIPlugin.getImage("icons/navigator/broker.png"));
            if (asTableViewer != null && asTableViewer.getTable() != null && !asTableViewer.getTable().isDisposed()) {
                asTableViewer.getTable().removeAll();
            }
            if (jqTableViewer != null && jqTableViewer.getTable() != null && !jqTableViewer.getTable().isDisposed()) {
                jqTableViewer.getTable().removeAll();
            }
        } else {
            setRunflag(true);
            this.setTitleImage(CubridManagerUIPlugin.getImage("icons/navigator/broker_started.png"));
            refresh(true, false);
        }
    }
}
Also used : CubridBroker(com.cubrid.cubridmanager.ui.spi.model.CubridBroker) ICubridNode(com.cubrid.common.ui.spi.model.ICubridNode)

Aggregations

CubridBroker (com.cubrid.cubridmanager.ui.spi.model.CubridBroker)12 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)6 CubridBrokerFolder (com.cubrid.cubridmanager.ui.spi.model.CubridBrokerFolder)6 ServerUserInfo (com.cubrid.cubridmanager.core.common.model.ServerUserInfo)5 BrokerInfo (com.cubrid.cubridmanager.core.broker.model.BrokerInfo)4 CubridServer (com.cubrid.common.ui.spi.model.CubridServer)3 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)2 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)2 BrokerInfos (com.cubrid.cubridmanager.core.broker.model.BrokerInfos)2 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)2 CommonQueryTask (com.cubrid.cubridmanager.core.common.task.CommonQueryTask)2 CubridShardFolder (com.cubrid.cubridmanager.ui.spi.model.CubridShardFolder)2 DecoratedImage (com.cubrid.common.ui.decorator.DecoratedImage)1 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)1 DatabaseEditorConfig (com.cubrid.common.ui.spi.model.DatabaseEditorConfig)1 ICubridNodeLoader (com.cubrid.common.ui.spi.model.ICubridNodeLoader)1 Shards (com.cubrid.cubridmanager.core.shard.model.Shards)1 GetShardConfTask (com.cubrid.cubridmanager.core.shard.task.GetShardConfTask)1 GetShardStatusTask (com.cubrid.cubridmanager.core.shard.task.GetShardStatusTask)1 StartBrokerAction (com.cubrid.cubridmanager.ui.broker.action.StartBrokerAction)1