Package com.cloudhopper.mq.queue

Examples of com.cloudhopper.mq.queue.QueueFatalException


        }
    }

    static public void validate(String queueName) throws QueueFatalException {
        if (queueName == null) {
            throw new QueueFatalException("Queue name cannot be null");
        }

        if (queueName.equals("")) {
            throw new QueueFatalException("Queue name cannot be an empty string");
        }
       
        // name can only contain a-z, A-Z, 0-9, or .-_ (not as the first character)
        for (int i = 0; i < queueName.length(); i++) {
            char c = queueName.charAt(i);
            if ('a' <= c && c <= 'z') {
                // do nothing
            } else if ('A' <= c && c <= 'Z') {
                // do nothing
            } else if ('0' <= c && c <= '9') {
                // do nothing
      } else if (c == '+') {
                // do nothing
            } else if (i != 0 && (c == '.' || c == '-' || c == '_')) {
                // do nothing
            } else {
                throw new QueueFatalException("Invalid character [" + c + "] in queue name [" + queueName + "]");
            }
        }
    }
View Full Code Here


        return this.itemIdByteLength;
    }

    public void checkCompatability(RunInfo previousRunInfo) throws QueueFatalException {
        if (previousRunInfo.queueIdByteLength != this.queueIdByteLength) {
            throw new QueueFatalException("QueueIdByteLength mismatch with previous run");
        }

        if (previousRunInfo.itemIdByteLength != this.itemIdByteLength) {
            throw new QueueFatalException("ItemIdByteLength mismatch with previous run");
        }
    }
View Full Code Here

TOP

Related Classes of com.cloudhopper.mq.queue.QueueFatalException

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.