001/**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.activemq.broker.jmx;
018
019import javax.management.openmbean.CompositeData;
020import javax.management.openmbean.OpenDataException;
021import javax.management.openmbean.TabularData;
022
023/**
024 * 
025 */
026public interface DurableSubscriptionViewMBean extends SubscriptionViewMBean {
027    /**
028     * @return name of the durable subscription name
029     */
030    String getSubscriptionName();
031
032    /**
033     * Browse messages for this durable subscriber
034     * 
035     * @return messages
036     * @throws OpenDataException
037     */
038    CompositeData[] browse() throws OpenDataException;
039
040    /**
041     * Browse messages for this durable subscriber
042     * 
043     * @return messages
044     * @throws OpenDataException
045     */
046    TabularData browseAsTable() throws OpenDataException;
047
048    /**
049     * Destroys the durable subscription so that messages will no longer be
050     * stored for this subscription
051     */
052    void destroy() throws Exception;
053    
054    /**
055     * @return true if the message cursor has memory space available
056     * to page in more messages
057     */
058    public boolean doesCursorHaveSpace();
059    
060    /**
061     * @return true if the cursor has reached its memory limit for
062     * paged in messages
063     */
064    public boolean isCursorFull();
065    
066    /**
067     * @return true if the cursor has messages buffered to deliver
068     */
069    public boolean doesCursorHaveMessagesBuffered();
070    
071    /**
072     * @return the cursor memory usage in bytes
073     */
074    public long getCursorMemoryUsage();
075    
076    /**
077     * @return the cursor memory usage as a percentage
078     */
079    public int getCursorPercentUsage();
080    
081    /**
082     * @return the number of messages available to be paged in 
083     * by the cursor
084     */
085    public int cursorSize();
086}