001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.kernel.messaging;
016    
017    import java.io.Serializable;
018    
019    import java.util.ArrayList;
020    import java.util.List;
021    
022    /**
023     * @author Michael C. Han
024     */
025    public class MessageBatch  implements Serializable {
026    
027            public MessageBatch(int initialSize) {
028                    this(null, initialSize);
029            }
030    
031            public MessageBatch(String messageBatchId) {
032                    this(messageBatchId, 10);
033            }
034    
035            public MessageBatch(String messageBatchId, int initialSize) {
036                    _messageBatchId = messageBatchId;
037                    _messages = new ArrayList<Message>(initialSize);
038            }
039    
040            public void addMessage(Message message) {
041                    _messages.add(message);
042            }
043    
044            public String getMessageBatchId() {
045                    return _messageBatchId;
046            }
047    
048            public List<Message> getMessages() {
049                    return _messages;
050            }
051    
052            private String _messageBatchId;
053            private List<Message> _messages;
054    
055    }