001    /******************************************************************************
002     * Copyright (C) MActor Developers. All rights reserved.                        *
003     * ---------------------------------------------------------------------------*
004     * This file is part of MActor.                                               *
005     *                                                                            *
006     * MActor is free software; you can redistribute it and/or modify             *
007     * it under the terms of the GNU General Public License as published by       *
008     * the Free Software Foundation; either version 2 of the License, or          *
009     * (at your option) any later version.                                        *
010     *                                                                            *
011     * MActor is distributed in the hope that it will be useful,                  *
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
014     * GNU General Public License for more details.                               *
015     *                                                                            *
016     * You should have received a copy of the GNU General Public License          *
017     * along with MActor; if not, write to the Free Software                      *
018     * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA *
019     ******************************************************************************/
020    package org.mactor.brokers;
021    
022    import java.util.Calendar;
023    
024    import org.mactor.framework.spec.SpecNode;
025    
026    /**
027     * Context information about a message
028     * 
029     * @author Lars Ivar Almli
030     */
031    public class MessageContextInfo {
032            private String archivePath;
033            private SpecNode node;
034            private String channel;
035            private Message responseToMessage;
036            private Message responseMessage;
037            private Calendar createdTime = Calendar.getInstance();
038            private boolean incoming;
039            private long messageSequenceNumber;
040            public boolean isIncoming() {
041                    return incoming;
042            }
043            public boolean isResponseMessage() {
044                    return responseToMessage != null;
045            }
046            public boolean hasResponseMessage() {
047                    return responseMessage != null;
048            }
049            public void setIncoming(boolean incoming) {
050                    this.incoming = incoming;
051            }
052            public MessageContextInfo(long messageSequenceNumber) {
053                    this.messageSequenceNumber = messageSequenceNumber;
054            }
055            public String getArchivePath() {
056                    return archivePath;
057            }
058            public String getChannel() {
059                    return channel;
060            }
061            public SpecNode getNode() {
062                    return node;
063            }
064            public Message getResponseToMessage() {
065                    return responseToMessage;
066            }
067            public void setResponseToMessage(Message responseToMessage) {
068                    this.responseToMessage = responseToMessage;
069            }
070            public void setArchivePath(String archivePath) {
071                    this.archivePath = archivePath;
072            }
073            public void setChannel(String channel) {
074                    this.channel = channel;
075            }
076            public void setNode(SpecNode node) {
077                    this.node = node;
078            }
079            public Calendar getCreatedTime() {
080                    return createdTime;
081            }
082            public long getMessageSequenceNumber() {
083                    return messageSequenceNumber;
084            }
085            public Message getResponseMessage() {
086                    return responseMessage;
087            }
088            public void setResponseMessage(Message responseMessage) {
089                    this.responseMessage = responseMessage;
090            }
091    }