Package com.thimbleware.jmemcached.protocol.exceptions

Examples of com.thimbleware.jmemcached.protocol.exceptions.ClientException


        if (keystring.startsWith("clear")) {
            try {
                // clear|bbs|pass
                String[] clientInfo = QueueClient.parse(keystring, '|');
                if (clientInfo.length < 3 || valid(clientInfo[1], clientInfo[2]) == false) {
                    throw new ClientException("Authorization error");
                }
                AbstractQueue<byte[]> queue = getClientQueue(clientInfo[1]);
                queue.clear();
                LocalCacheElement element = new LocalCacheElement(keystring, 0, 0, 0);
                element.setData(String.valueOf(queue.size()).getBytes());
                return element;
            } catch (Exception e) {
                log.error("getsize " + keystring + "error", e);
                return null;
            }
        }
        // 重新加载权限信息
        if (keystring.startsWith("reload")) {
            try {
                // reload|bbs|pass
                String[] clientInfo = QueueClient.parse(keystring, '|');
                if (clientInfo.length < 3 || valid(clientInfo[1], clientInfo[2]) == false) {
                    throw new ClientException("Authorization error");
                }
                reloadAuthorization();
                LocalCacheElement element = new LocalCacheElement(keystring, 0, 0, 0);
                element.setData("reloadAuthorization".getBytes());
                return element;
            } catch (ConfigException e) {
                log.error(e.getMessage(), e);
            } catch (Exception e) {
                log.error("reloadAuthorization error", e);
                return null;
            }
        }
        throw new ClientException(keystring + " command Unsupported now");
    }
View Full Code Here


                } else {
                    log.info("queue empty");
                }
            } else {
                log.error("unvalid " + keystring);
                throw new ClientException("Authorization error");
            }
        } catch (Exception e) {
            log.error("get queue " + keystring + " error", e);
            return null;
        }
View Full Code Here

        String[] clientInfo = QueueClient.parseWithCache(keystring);
        if (valid(clientInfo[0], clientInfo[1])) {// 先进行密码验证
            getClientQueue(clientInfo[0]).add(e.getData());
            return null;
        } else {
            throw new ClientException("Authorization error");
        }
    }
View Full Code Here

        String[] clientInfo = QueueClient.parseWithCache(keystring);
        if (valid(clientInfo[0], clientInfo[1])) {// 先进行密码验证
            getClientQueue(clientInfo[0]).add(e.getData());
            return null;
        } else {
            throw new ClientException("Authorization error");
        }

    }
View Full Code Here

TOP

Related Classes of com.thimbleware.jmemcached.protocol.exceptions.ClientException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.