Search in sources :

Example 6 with CmdResponse

use of com.generallycloud.baseio.container.jms.cmd.CmdResponse in project baseio by generallycloud.

the class MessageSizeExecutable method exec.

@Override
public CmdResponse exec(CommandContext context, HashMap<String, String> params) {
    CmdResponse response = new CmdResponse();
    MessageBrowser browser = getMessageBrowser(context);
    if (browser == null) {
        response.setResponse("请先登录!");
        return response;
    }
    try {
        int size = browser.size();
        response.setResponse(String.valueOf(size));
    } catch (Exception e) {
        response.setResponse(e.getMessage());
        logger.debug(e);
    }
    return response;
}
Also used : CmdResponse(com.generallycloud.baseio.container.jms.cmd.CmdResponse) MessageBrowser(com.generallycloud.baseio.container.jms.client.MessageBrowser)

Aggregations

CmdResponse (com.generallycloud.baseio.container.jms.cmd.CmdResponse)6 MessageBrowser (com.generallycloud.baseio.container.jms.client.MessageBrowser)3 ChannelConnector (com.generallycloud.baseio.connector.ChannelConnector)2 LoggerSocketSEListener (com.generallycloud.baseio.component.LoggerSocketSEListener)1 NioSocketChannelContext (com.generallycloud.baseio.component.NioSocketChannelContext)1 ServerConfiguration (com.generallycloud.baseio.configuration.ServerConfiguration)1 SocketChannelConnector (com.generallycloud.baseio.connector.SocketChannelConnector)1 FixedSession (com.generallycloud.baseio.container.FixedSession)1 SimpleIoEventHandle (com.generallycloud.baseio.container.SimpleIoEventHandle)1 Message (com.generallycloud.baseio.container.jms.Message)1 DefaultMessageBrowser (com.generallycloud.baseio.container.jms.client.impl.DefaultMessageBrowser)1