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 */
017 package org.apache.activemq.memory.list;
018
019 import java.util.List;
020 import org.apache.activemq.broker.region.MessageReference;
021 import org.apache.activemq.command.ActiveMQDestination;
022 import org.apache.activemq.command.Message;
023
024 /**
025 * A container of messages which is used to store messages and then
026 * replay them later for a given subscription.
027 *
028 *
029 */
030 public interface MessageList {
031
032 void add(MessageReference node);
033
034 /**
035 * Returns the current list of MessageReference objects for the given subscription
036 */
037 List getMessages(ActiveMQDestination destination);
038
039 /**
040 * @param destination
041 * @return an array of Messages that match the destination
042 */
043 Message[] browse(ActiveMQDestination destination);
044
045 void clear();
046
047
048 }