Package javax.management

Examples of javax.management.OperationsException


    {
        QueueEntry entry = _queue.getMessageOnTheQueue(msgId);

        if (entry == null)
        {
            throw new OperationsException("AMQMessage with message id = " + msgId + " is not in the " + _queueName);
        }

        ServerMessage serverMsg = entry.getMessage();
        final int bodySize = (int) serverMsg.getSize();
View Full Code Here


     */
    public TabularData viewMessages(long startPosition, long endPosition) throws JMException
    {
        if ((startPosition > endPosition) || (startPosition < 1))
        {
            throw new OperationsException("From Index = " + startPosition + ", To Index = " + endPosition
                + "\n\"From Index\" should be greater than 0 and less than \"To Index\"");
        }

        if ((endPosition - startPosition) > Integer.MAX_VALUE)
        {
            throw new OperationsException("Specified MessageID interval is too large. Intervals must be less than 2^31 in size");
        }

        List<QueueEntry> list = _queue.getMessagesRangeOnTheQueue(startPosition,endPosition);
        TabularDataSupport _messageList = new TabularDataSupport(_messagelistDataType);

View Full Code Here

     */
    public void moveMessages(long fromMessageId, long toMessageId, String toQueueName) throws JMException
    {
        if ((fromMessageId > toMessageId) || (fromMessageId < 1))
        {
            throw new OperationsException("\"From MessageId\" should be greater than 0 and less than \"To MessageId\"");
        }

        ServerTransaction txn = new LocalTransaction(_queue.getVirtualHost().getTransactionLog());
        _queue.moveMessagesToAnotherQueue(fromMessageId, toMessageId, toQueueName, txn);
        txn.commit();
View Full Code Here

     */
    public void deleteMessages(long fromMessageId, long toMessageId) throws JMException
    {
        if ((fromMessageId > toMessageId) || (fromMessageId < 1))
        {
            throw new OperationsException("\"From MessageId\" should be greater than 0 and less than \"To MessageId\"");
        }

        _queue.removeMessagesFromQueue(fromMessageId, toMessageId);
    }
View Full Code Here

     */
    public void copyMessages(long fromMessageId, long toMessageId, String toQueueName) throws JMException
    {
        if ((fromMessageId > toMessageId) || (fromMessageId < 1))
        {
            throw new OperationsException("\"From MessageId\" should be greater than 0 and less than \"To MessageId\"");
        }

        ServerTransaction txn = new LocalTransaction(_queue.getVirtualHost().getTransactionLog());

        _queue.copyMessagesToAnotherQueue(fromMessageId, toMessageId, toQueueName, txn);
View Full Code Here

    public static Queue findQueueFromQueueName(VirtualHost virtualHost, String queueName) throws OperationsException
    {
        Queue queue = ConfiguredObjectFinder.findConfiguredObjectByName(virtualHost.getQueues(), queueName);
        if (queue == null)
        {
            throw new OperationsException("No such queue \""+queueName+"\"");
        }
        else
        {
            return queue;
        }
View Full Code Here

    public static  Exchange findExchangeFromExchangeName(VirtualHost virtualHost, String exchangeName) throws OperationsException
    {
        Exchange exchange = ConfiguredObjectFinder.findConfiguredObjectByName(virtualHost.getExchanges(), exchangeName);
        if (exchange == null)
        {
            throw new OperationsException("No such exchange \""+exchangeName+"\"");
        }
        else
        {
            return exchange;
        }
View Full Code Here

    {
        QueueEntry entry = _queue.getMessageOnTheQueue(msgId);

        if (entry == null)
        {
            throw new OperationsException("AMQMessage with message id = " + msgId + " is not in the " + _queueName);
        }

        AMQMessage msg = entry.getMessage();
        // get message content
        Iterator<ContentChunk> cBodies = msg.getContentBodyIterator();
View Full Code Here

     */
    public TabularData viewMessages(int beginIndex, int endIndex) throws JMException
    {
        if ((beginIndex > endIndex) || (beginIndex < 1))
        {
            throw new OperationsException("From Index = " + beginIndex + ", To Index = " + endIndex
                + "\n\"From Index\" should be greater than 0 and less than \"To Index\"");
        }

        List<QueueEntry> list = _queue.getMessagesOnTheQueue();
        TabularDataSupport _messageList = new TabularDataSupport(_messagelistDataType);
View Full Code Here

     */
    public void moveMessages(long fromMessageId, long toMessageId, String toQueueName) throws JMException
    {
        if ((fromMessageId > toMessageId) || (fromMessageId < 1))
        {
            throw new OperationsException("\"From MessageId\" should be greater then 0 and less then \"To MessageId\"");
        }

        _queue.moveMessagesToAnotherQueue(fromMessageId, toMessageId, toQueueName, _storeContext);
    }
View Full Code Here

TOP

Related Classes of javax.management.OperationsException

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.